PageRenderTime 70ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/documentation_files/__builtin__.py

https://github.com/kensington/kdevelop-python
Python | 1366 lines | 1183 code | 35 blank | 148 comment | 27 complexity | a0a1304c2dd14121232e3b27c61a75b3 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. #!/usr/bin/env python2.7
  2. # -*- coding: utf-8 -*-
  3. """
  4. Built-in Functions
  5. ==================
  6. The Python interpreter has a number of functions built into it that are always
  7. available. They are listed here in alphabetical order.
  8. =================== ================= ================== ================= ====================
  9. .. .. Built-in Functions .. ..
  10. =================== ================= ================== ================= ====================
  11. :func:`abs` :func:`divmod` :func:`input` :func:`open` :func:`staticmethod`
  12. :func:`all` :func:`enumerate` :func:`int` :func:`ord` :func:`str`
  13. :func:`any` :func:`eval` :func:`isinstance` :func:`pow` :func:`sum`
  14. :func:`basestring` :func:`execfile` :func:`issubclass` :func:`print` :func:`super`
  15. :func:`bin` :func:`file` :func:`iter` :func:`property` :func:`tuple`
  16. :func:`bool` :func:`filter` :func:`len` :func:`range` :func:`type`
  17. :func:`bytearray` :func:`float` :func:`list` :func:`raw_input` :func:`unichr`
  18. :func:`callable` :func:`format` :func:`locals` :func:`reduce` :func:`unicode`
  19. :func:`chr` :func:`frozenset` :func:`long` :func:`reload` :func:`vars`
  20. :func:`classmethod` :func:`getattr` :func:`map` :func:`repr` :func:`xrange`
  21. :func:`cmp` :func:`globals` :func:`max` :func:`reversed` :func:`zip`
  22. :func:`compile` :func:`hasattr` :func:`memoryview` :func:`round` :func:`__import__`
  23. :func:`complex` :func:`hash` :func:`min` :func:`set` :func:`apply`
  24. :func:`delattr` :func:`help` :func:`next` :func:`setattr` :func:`buffer`
  25. :func:`dict` :func:`hex` :func:`object` :func:`slice` :func:`coerce`
  26. :func:`dir` :func:`id` :func:`oct` :func:`sorted` :func:`intern`
  27. =================== ================= ================== ================= ====================
  28. """
  29. def abs(x):
  30. """
  31. Return the absolute value of a number. The argument may be a plain or long
  32. integer or a floating point number. If the argument is a complex number, its
  33. magnitude is returned.
  34. """
  35. pass
  36. def all(iterable):
  37. """
  38. Return True if all elements of the *iterable* are true (or if the iterable
  39. is empty). Equivalent to::
  40. def all(iterable):
  41. for element in iterable:
  42. if not element:
  43. return False
  44. return True
  45. """
  46. pass
  47. def any(iterable):
  48. """
  49. Return True if any element of the *iterable* is true. If the iterable
  50. is empty, return False. Equivalent to::
  51. def any(iterable):
  52. for element in iterable:
  53. if element:
  54. return True
  55. return False
  56. """
  57. pass
  58. def basestring():
  59. """
  60. This abstract type is the superclass for :class:`str` and :class:`unicode`. It
  61. cannot be called or instantiated, but it can be used to test whether an object
  62. is an instance of :class:`str` or :class:`unicode`. ``isinstance(obj,
  63. basestring)`` is equivalent to ``isinstance(obj, (str, unicode))``.
  64. """
  65. pass
  66. def bin(x):
  67. """
  68. Convert an integer number to a binary string. The result is a valid Python
  69. expression. If *x* is not a Python :class:`int` object, it has to define an
  70. :meth:`__index__` method that returns an integer.
  71. """
  72. pass
  73. def bool(x):
  74. """
  75. Convert a value to a Boolean, using the standard truth testing procedure. If
  76. *x* is false or omitted, this returns :const:`False`; otherwise it returns
  77. :const:`True`. :class:`bool` is also a class, which is a subclass of
  78. :class:`int`. Class :class:`bool` cannot be subclassed further. Its only
  79. instances are :const:`False` and :const:`True`.
  80. """
  81. pass
  82. def bytearray(source,encoding,errors):
  83. """
  84. Return a new array of bytes. The :class:`bytearray` type is a mutable
  85. sequence of integers in the range 0 <= x < 256. It has most of the usual
  86. methods of mutable sequences, described in :ref:`typesseq-mutable`, as well
  87. as most methods that the :class:`str` type has, see :ref:`string-methods`.
  88. The optional *source* parameter can be used to initialize the array in a few
  89. different ways:
  90. * If it is a *string*, you must also give the *encoding* (and optionally,
  91. *errors*) parameters; :func:`bytearray` then converts the string to
  92. bytes using :meth:`str.encode`.
  93. * If it is an *integer*, the array will have that size and will be
  94. initialized with null bytes.
  95. * If it is an object conforming to the *buffer* interface, a read-only buffer
  96. of the object will be used to initialize the bytes array.
  97. * If it is an *iterable*, it must be an iterable of integers in the range
  98. ``0 <= x < 256``, which are used as the initial contents of the array.
  99. Without an argument, an array of size 0 is created.
  100. """
  101. pass
  102. def callable(object):
  103. """
  104. Return :const:`True` if the *object* argument appears callable,
  105. :const:`False` if not. If this
  106. returns true, it is still possible that a call fails, but if it is false,
  107. calling *object* will never succeed. Note that classes are callable (calling a
  108. class returns a new instance); class instances are callable if they have a
  109. :meth:`__call__` method.
  110. """
  111. pass
  112. def chr(i):
  113. """
  114. Return a string of one character whose ASCII code is the integer *i*. For
  115. example, ``chr(97)`` returns the string ``'a'``. This is the inverse of
  116. :func:`ord`. The argument must be in the range [0..255], inclusive;
  117. :exc:`ValueError` will be raised if *i* is outside that range. See
  118. also :func:`unichr`.
  119. """
  120. pass
  121. def _classmethod(function):
  122. """
  123. Return a class method for *function*.
  124. A class method receives the class as implicit first argument, just like an
  125. instance method receives the instance. To declare a class method, use this
  126. idiom::
  127. class C:
  128. @classmethod
  129. def f(cls, arg1, arg2, more): more
  130. The ``@classmethod`` form is a function :term:`decorator` -- see the description
  131. of function definitions in :ref:`function` for details.
  132. It can be called either on the class (such as ``C.f()``) or on an instance (such
  133. as ``C().f()``). The instance is ignored except for its class. If a class
  134. method is called for a derived class, the derived class object is passed as the
  135. implied first argument.
  136. Class methods are different than C++ or Java static methods. If you want those,
  137. see :func:`staticmethod` in this section.
  138. For more information on class methods, consult the documentation on the standard
  139. type hierarchy in :ref:`types`.
  140. """
  141. pass
  142. def cmp(x,y):
  143. """
  144. Compare the two objects *x* and *y* and return an integer according to the
  145. outcome. The return value is negative if ``x < y``, zero if ``x == y`` and
  146. strictly positive if ``x > y``.
  147. """
  148. pass
  149. def compile(source,filename,mode,flags,dont_inherit):
  150. """
  151. Compile the *source* into a code or AST object. Code objects can be executed
  152. by an :keyword:`exec` statement or evaluated by a call to :func:`eval`.
  153. *source* can either be a string or an AST object. Refer to the :mod:`ast`
  154. module documentation for information on how to work with AST objects.
  155. The *filename* argument should give the file from which the code was read;
  156. pass some recognizable value if it wasn't read from a file (``'<string>'`` is
  157. commonly used).
  158. The *mode* argument specifies what kind of code must be compiled; it can be
  159. ``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if it
  160. consists of a single expression, or ``'single'`` if it consists of a single
  161. interactive statement (in the latter case, expression statements that
  162. evaluate to something other than ``None`` will be printed).
  163. The optional arguments *flags* and *dont_inherit* control which future
  164. statements (see :pep:`236`) affect the compilation of *source*. If neither
  165. is present (or both are zero) the code is compiled with those future
  166. statements that are in effect in the code that is calling compile. If the
  167. *flags* argument is given and *dont_inherit* is not (or is zero) then the
  168. future statements specified by the *flags* argument are used in addition to
  169. those that would be used anyway. If *dont_inherit* is a non-zero integer then
  170. the *flags* argument is it -- the future statements in effect around the call
  171. to compile are ignored.
  172. Future statements are specified by bits which can be bitwise ORed together to
  173. specify multiple statements. The bitfield required to specify a given feature
  174. can be found as the :attr:`compiler_flag` attribute on the :class:`_Feature`
  175. instance in the :mod:`__future__` module.
  176. This function raises :exc:`SyntaxError` if the compiled source is invalid,
  177. and :exc:`TypeError` if the source contains null bytes.
  178. """
  179. pass
  180. def complex(real,imag):
  181. """
  182. Create a complex number with the value *real* + *imag*\*j or convert a string or
  183. number to a complex number. If the first parameter is a string, it will be
  184. interpreted as a complex number and the function must be called without a second
  185. parameter. The second parameter can never be a string. Each argument may be any
  186. numeric type (including complex). If *imag* is omitted, it defaults to zero and
  187. the function serves as a numeric conversion function like :func:`int`,
  188. :func:`long` and :func:`float`. If both arguments are omitted, returns ``0j``.
  189. The complex type is described in :ref:`typesnumeric`.
  190. """
  191. pass
  192. def delattr(object,name):
  193. """
  194. This is a relative of :func:`setattr`. The arguments are an object and a
  195. string. The string must be the name of one of the object's attributes. The
  196. function deletes the named attribute, provided the object allows it. For
  197. example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``.
  198. """
  199. pass
  200. def dict(arg):
  201. """:noindex:
  202. Create a new data dictionary, optionally with items taken from *arg*.
  203. The dictionary type is described in :ref:`typesmapping`.
  204. For other containers see the built in :class:`list`, :class:`set`, and
  205. :class:`tuple` classes, and the :mod:`collections` module.
  206. """
  207. pass
  208. def dir(object):
  209. """
  210. Without arguments, return the list of names in the current local scope. With an
  211. argument, attempt to return a list of valid attributes for that object.
  212. If the object has a method named :meth:`__dir__`, this method will be called and
  213. must return the list of attributes. This allows objects that implement a custom
  214. :func:`__getattr__` or :func:`__getattribute__` function to customize the way
  215. :func:`dir` reports their attributes.
  216. If the object does not provide :meth:`__dir__`, the function tries its best to
  217. gather information from the object's :attr:`__dict__` attribute, if defined, and
  218. from its type object. The resulting list is not necessarily complete, and may
  219. be inaccurate when the object has a custom :func:`__getattr__`.
  220. The default :func:`dir` mechanism behaves differently with different types of
  221. objects, as it attempts to produce the most relevant, rather than complete,
  222. information:
  223. * If the object is a module object, the list contains the names of the module's
  224. attributes.
  225. * If the object is a type or class object, the list contains the names of its
  226. attributes, and recursively of the attributes of its bases.
  227. * Otherwise, the list contains the object's attributes' names, the names of its
  228. class's attributes, and recursively of the attributes of its class's base
  229. classes.
  230. The resulting list is sorted alphabetically. For example:
  231. >>> import struct
  232. >>> dir() # doctest: +SKIP
  233. ['__builtins__', '__doc__', '__name__', 'struct']
  234. >>> dir(struct) # doctest: +NORMALIZE_WHITESPACE
  235. ['Struct', '__builtins__', '__doc__', '__file__', '__name__',
  236. '__package__', '_clearcache', 'calcsize', 'error', 'pack', 'pack_into',
  237. 'unpack', 'unpack_from']
  238. >>> class Foo(object):
  239. more def __dir__(self):
  240. more return ["kan", "ga", "roo"]
  241. more
  242. >>> f = Foo()
  243. >>> dir(f)
  244. ['ga', 'kan', 'roo']
  245. """
  246. pass
  247. def divmod(a,b):
  248. """
  249. Take two (non complex) numbers as arguments and return a pair of numbers
  250. consisting of their quotient and remainder when using long division. With mixed
  251. operand types, the rules for binary arithmetic operators apply. For plain and
  252. long integers, the result is the same as ``(a // b, a % b)``. For floating point
  253. numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a / b)``
  254. but may be 1 less than that. In any case ``q * b + a % b`` is very close to
  255. *a*, if ``a % b`` is non-zero it has the same sign as *b*, and ``0 <= abs(a % b)
  256. < abs(b)``.
  257. """
  258. pass
  259. def enumerate(sequence,start=0):
  260. """
  261. Return an enumerate object. *sequence* must be a sequence, an
  262. :term:`iterator`, or some other object which supports iteration. The
  263. :meth:`!next` method of the iterator returned by :func:`enumerate` returns a
  264. tuple containing a count (from *start* which defaults to 0) and the
  265. corresponding value obtained from iterating over *iterable*.
  266. :func:`enumerate` is useful for obtaining an indexed series: ``(0, seq[0])``,
  267. ``(1, seq[1])``, ``(2, seq[2])``, more. For example:
  268. >>> for i, season in enumerate(['Spring', 'Summer', 'Fall', 'Winter']):
  269. more print i, season
  270. 0 Spring
  271. 1 Summer
  272. 2 Fall
  273. 3 Winter
  274. """
  275. pass
  276. def eval(expression,globals,locals):
  277. """
  278. The arguments are a string and optional globals and locals. If provided,
  279. *globals* must be a dictionary. If provided, *locals* can be any mapping
  280. object.
  281. """
  282. pass
  283. def execfile(filename,globals,locals):
  284. """
  285. This function is similar to the :keyword:`exec` statement, but parses a file
  286. instead of a string. It is different from the :keyword:`import` statement in
  287. that it does not use the module administration --- it reads the file
  288. unconditionally and does not create a new module. [#]_
  289. The arguments are a file name and two optional dictionaries. The file is parsed
  290. and evaluated as a sequence of Python statements (similarly to a module) using
  291. the *globals* and *locals* dictionaries as global and local namespace. If
  292. provided, *locals* can be any mapping object.
  293. """
  294. pass
  295. def file(filename,mode,bufsize):
  296. """
  297. Constructor function for the :class:`file` type, described further in section
  298. :ref:`bltin-file-objects`. The constructor's arguments are the same as those
  299. of the :func:`open` built-in function described below.
  300. When opening a file, it's preferable to use :func:`open` instead of invoking
  301. this constructor directly. :class:`file` is more suited to type testing (for
  302. example, writing ``isinstance(f, file)``).
  303. """
  304. pass
  305. def filter(function,iterable):
  306. """
  307. Construct a list from those elements of *iterable* for which *function* returns
  308. true. *iterable* may be either a sequence, a container which supports
  309. iteration, or an iterator. If *iterable* is a string or a tuple, the result
  310. also has that type; otherwise it is always a list. If *function* is ``None``,
  311. the identity function is assumed, that is, all elements of *iterable* that are
  312. false are removed.
  313. Note that ``filter(function, iterable)`` is equivalent to ``[item for item in
  314. iterable if function(item)]`` if function is not ``None`` and ``[item for item
  315. in iterable if item]`` if function is ``None``.
  316. See :func:`itertools.ifilter` and :func:`itertools.ifilterfalse` for iterator
  317. versions of this function, including a variation that filters for elements
  318. where the *function* returns false.
  319. """
  320. pass
  321. def float(x):
  322. """
  323. Convert a string or a number to floating point. If the argument is a string, it
  324. must contain a possibly signed decimal or floating point number, possibly
  325. embedded in whitespace. The argument may also be [+|-]nan or [+|-]inf.
  326. Otherwise, the argument may be a plain or long integer
  327. or a floating point number, and a floating point number with the same value
  328. (within Python's floating point precision) is returned. If no argument is
  329. given, returns ``0.0``.
  330. """
  331. pass
  332. def format(value,format_spec):
  333. """
  334. """
  335. pass
  336. def frozenset(iterable):
  337. """:noindex:
  338. Return a frozenset object, optionally with elements taken from *iterable*.
  339. The frozenset type is described in :ref:`types-set`.
  340. For other containers see the built in :class:`dict`, :class:`list`, and
  341. :class:`tuple` classes, and the :mod:`collections` module.
  342. """
  343. pass
  344. def getattr(object,name,default):
  345. """
  346. Return the value of the named attribute of *object*. *name* must be a string.
  347. If the string is the name of one of the object's attributes, the result is the
  348. value of that attribute. For example, ``getattr(x, 'foobar')`` is equivalent to
  349. ``x.foobar``. If the named attribute does not exist, *default* is returned if
  350. provided, otherwise :exc:`AttributeError` is raised.
  351. """
  352. pass
  353. def globals():
  354. """
  355. Return a dictionary representing the current global symbol table. This is always
  356. the dictionary of the current module (inside a function or method, this is the
  357. module where it is defined, not the module from which it is called).
  358. """
  359. pass
  360. def hasattr(object,name):
  361. """
  362. The arguments are an object and a string. The result is ``True`` if the string
  363. is the name of one of the object's attributes, ``False`` if not. (This is
  364. implemented by calling ``getattr(object, name)`` and seeing whether it raises an
  365. exception or not.)
  366. """
  367. pass
  368. def hash(object):
  369. """
  370. Return the hash value of the object (if it has one). Hash values are integers.
  371. They are used to quickly compare dictionary keys during a dictionary lookup.
  372. Numeric values that compare equal have the same hash value (even if they are of
  373. different types, as is the case for 1 and 1.0).
  374. """
  375. pass
  376. def help(object):
  377. """
  378. Invoke the built-in help system. (This function is intended for interactive
  379. use.) If no argument is given, the interactive help system starts on the
  380. interpreter console. If the argument is a string, then the string is looked up
  381. as the name of a module, function, class, method, keyword, or documentation
  382. topic, and a help page is printed on the console. If the argument is any other
  383. kind of object, a help page on the object is generated.
  384. This function is added to the built-in namespace by the :mod:`site` module.
  385. """
  386. pass
  387. def hex(x):
  388. """
  389. Convert an integer number (of any size) to a hexadecimal string. The result is a
  390. valid Python expression.
  391. """
  392. pass
  393. def id(object):
  394. """
  395. Return the "identity" of an object. This is an integer (or long integer) which
  396. is guaranteed to be unique and constant for this object during its lifetime.
  397. Two objects with non-overlapping lifetimes may have the same :func:`id`
  398. value.
  399. """
  400. pass
  401. def input(prompt):
  402. """
  403. Equivalent to ``eval(raw_input(prompt))``.
  404. """
  405. pass
  406. def int(x,base):
  407. """
  408. Convert a string or number to a plain integer. If the argument is a string,
  409. it must contain a possibly signed decimal number representable as a Python
  410. integer, possibly embedded in whitespace. The *base* parameter gives the
  411. base for the conversion (which is 10 by default) and may be any integer in
  412. the range [2, 36], or zero. If *base* is zero, the proper radix is
  413. determined based on the contents of string; the interpretation is the same as
  414. for integer literals. (See :ref:`numbers`.) If *base* is specified and *x*
  415. is not a string, :exc:`TypeError` is raised. Otherwise, the argument may be a
  416. plain or long integer or a floating point number. Conversion of floating
  417. point numbers to integers truncates (towards zero). If the argument is
  418. outside the integer range a long object will be returned instead. If no
  419. arguments are given, returns ``0``.
  420. The integer type is described in :ref:`typesnumeric`.
  421. """
  422. pass
  423. def isinstance(object,_classinfo):
  424. """
  425. Return true if the *object* argument is an instance of the *classinfo* argument,
  426. or of a (direct or indirect) subclass thereof. Also return true if *classinfo*
  427. is a type object (new-style class) and *object* is an object of that type or of
  428. a (direct or indirect) subclass thereof. If *object* is not a class instance or
  429. an object of the given type, the function always returns false. If *classinfo*
  430. is neither a class object nor a type object, it may be a tuple of class or type
  431. objects, or may recursively contain other such tuples (other sequence types are
  432. not accepted). If *classinfo* is not a class, type, or tuple of classes, types,
  433. and such tuples, a :exc:`TypeError` exception is raised.
  434. """
  435. pass
  436. def issub_class(_class,_classinfo):
  437. """
  438. Return true if *class* is a subclass (direct or indirect) of *classinfo*. A
  439. class is considered a subclass of itself. *classinfo* may be a tuple of class
  440. objects, in which case every entry in *classinfo* will be checked. In any other
  441. case, a :exc:`TypeError` exception is raised.
  442. """
  443. pass
  444. def iter(o,sentinel):
  445. """
  446. Return an :term:`iterator` object. The first argument is interpreted very differently
  447. depending on the presence of the second argument. Without a second argument, *o*
  448. must be a collection object which supports the iteration protocol (the
  449. :meth:`__iter__` method), or it must support the sequence protocol (the
  450. :meth:`__getitem__` method with integer arguments starting at ``0``). If it
  451. does not support either of those protocols, :exc:`TypeError` is raised. If the
  452. second argument, *sentinel*, is given, then *o* must be a callable object. The
  453. iterator created in this case will call *o* with no arguments for each call to
  454. its :meth:`~iterator.next` method; if the value returned is equal to *sentinel*,
  455. :exc:`StopIteration` will be raised, otherwise the value will be returned.
  456. One useful application of the second form of :func:`iter` is to read lines of
  457. a file until a certain line is reached. The following example reads a file
  458. until ``"STOP"`` is reached: ::
  459. with open("mydata.txt") as fp:
  460. for line in iter(fp.readline, "STOP"):
  461. process_line(line)
  462. """
  463. pass
  464. def len(s):
  465. """
  466. Return the length (the number of items) of an object. The argument may be a
  467. sequence (string, tuple or list) or a mapping (dictionary).
  468. """
  469. pass
  470. def list(iterable):
  471. """
  472. Return a list whose items are the same and in the same order as *iterable*'s
  473. items. *iterable* may be either a sequence, a container that supports
  474. iteration, or an iterator object. If *iterable* is already a list, a copy is
  475. made and returned, similar to ``iterable[:]``. For instance, ``list('abc')``
  476. returns ``['a', 'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. If
  477. no argument is given, returns a new empty list, ``[]``.
  478. :class:`list` is a mutable sequence type, as documented in
  479. :ref:`typesseq`. For other containers see the built in :class:`dict`,
  480. :class:`set`, and :class:`tuple` classes, and the :mod:`collections` module.
  481. """
  482. pass
  483. def locals():
  484. """
  485. Update and return a dictionary representing the current local symbol table.
  486. Free variables are returned by :func:`locals` when it is called in function
  487. blocks, but not in class blocks.
  488. """
  489. pass
  490. def long(x,base):
  491. """
  492. Convert a string or number to a long integer. If the argument is a string, it
  493. must contain a possibly signed number of arbitrary size, possibly embedded in
  494. whitespace. The *base* argument is interpreted in the same way as for
  495. :func:`int`, and may only be given when *x* is a string. Otherwise, the argument
  496. may be a plain or long integer or a floating point number, and a long integer
  497. with the same value is returned. Conversion of floating point numbers to
  498. integers truncates (towards zero). If no arguments are given, returns ``0L``.
  499. The long type is described in :ref:`typesnumeric`.
  500. """
  501. pass
  502. def map(function,iterable,more):
  503. """
  504. Apply *function* to every item of *iterable* and return a list of the results.
  505. If additional *iterable* arguments are passed, *function* must take that many
  506. arguments and is applied to the items from all iterables in parallel. If one
  507. iterable is shorter than another it is assumed to be extended with ``None``
  508. items. If *function* is ``None``, the identity function is assumed; if there
  509. are multiple arguments, :func:`map` returns a list consisting of tuples
  510. containing the corresponding items from all iterables (a kind of transpose
  511. operation). The *iterable* arguments may be a sequence or any iterable object;
  512. the result is always a list.
  513. """
  514. pass
  515. def max(iterable,argsmorekey):
  516. """
  517. With a single argument *iterable*, return the largest item of a non-empty
  518. iterable (such as a string, tuple or list). With more than one argument, return
  519. the largest of the arguments.
  520. The optional *key* argument specifies a one-argument ordering function like that
  521. used for :meth:`list.sort`. The *key* argument, if supplied, must be in keyword
  522. form (for example, ``max(a,b,c,key=func)``).
  523. """
  524. pass
  525. def memoryview(obj):
  526. """:noindex:
  527. Return a "memory view" object created from the given argument. See
  528. :ref:`typememoryview` for more information.
  529. """
  530. pass
  531. def min(iterable,argsmorekey):
  532. """
  533. With a single argument *iterable*, return the smallest item of a non-empty
  534. iterable (such as a string, tuple or list). With more than one argument, return
  535. the smallest of the arguments.
  536. The optional *key* argument specifies a one-argument ordering function like that
  537. used for :meth:`list.sort`. The *key* argument, if supplied, must be in keyword
  538. form (for example, ``min(a,b,c,key=func)``).
  539. """
  540. pass
  541. def next(iterator,default):
  542. """
  543. Retrieve the next item from the *iterator* by calling its
  544. :meth:`~iterator.next` method. If *default* is given, it is returned if the
  545. iterator is exhausted, otherwise :exc:`StopIteration` is raised.
  546. """
  547. pass
  548. def object():
  549. """
  550. Return a new featureless object. :class:`object` is a base for all new style
  551. classes. It has the methods that are common to all instances of new style
  552. classes.
  553. """
  554. pass
  555. def oct(x):
  556. """
  557. Convert an integer number (of any size) to an octal string. The result is a
  558. valid Python expression.
  559. """
  560. pass
  561. def open(filename,mode,bufsize):
  562. """
  563. Open a file, returning an object of the :class:`file` type described in
  564. section :ref:`bltin-file-objects`. If the file cannot be opened,
  565. :exc:`IOError` is raised. When opening a file, it's preferable to use
  566. :func:`open` instead of invoking the :class:`file` constructor directly.
  567. The first two arguments are the same as for ``stdio``'s :cfunc:`fopen`:
  568. *filename* is the file name to be opened, and *mode* is a string indicating how
  569. the file is to be opened.
  570. The most commonly-used values of *mode* are ``'r'`` for reading, ``'w'`` for
  571. writing (truncating the file if it already exists), and ``'a'`` for appending
  572. (which on *some* Unix systems means that *all* writes append to the end of the
  573. file regardless of the current seek position). If *mode* is omitted, it
  574. defaults to ``'r'``. The default is to use text mode, which may convert
  575. ``'\n'`` characters to a platform-specific representation on writing and back
  576. on reading. Thus, when opening a binary file, you should append ``'b'`` to
  577. the *mode* value to open the file in binary mode, which will improve
  578. portability. (Appending ``'b'`` is useful even on systems that don't treat
  579. binary and text files differently, where it serves as documentation.) See below
  580. for more possible values of *mode*.
  581. """
  582. pass
  583. def ord(c):
  584. """
  585. Given a string of length one, return an integer representing the Unicode code
  586. point of the character when the argument is a unicode object, or the value of
  587. the byte when the argument is an 8-bit string. For example, ``ord('a')`` returns
  588. the integer ``97``, ``ord(u'\u2020')`` returns ``8224``. This is the inverse of
  589. :func:`chr` for 8-bit strings and of :func:`unichr` for unicode objects. If a
  590. unicode argument is given and Python was built with UCS2 Unicode, then the
  591. character's code point must be in the range [0..65535] inclusive; otherwise the
  592. string length is two, and a :exc:`TypeError` will be raised.
  593. """
  594. pass
  595. def pow(x,y,z):
  596. """
  597. Return *x* to the power *y*; if *z* is present, return *x* to the power *y*,
  598. modulo *z* (computed more efficiently than ``pow(x, y) % z``). The two-argument
  599. form ``pow(x, y)`` is equivalent to using the power operator: ``x**y``.
  600. The arguments must have numeric types. With mixed operand types, the coercion
  601. rules for binary arithmetic operators apply. For int and long int operands, the
  602. result has the same type as the operands (after coercion) unless the second
  603. argument is negative; in that case, all arguments are converted to float and a
  604. float result is delivered. For example, ``10**2`` returns ``100``, but
  605. ``10**-2`` returns ``0.01``. (This last feature was added in Python 2.2. In
  606. Python 2.1 and before, if both arguments were of integer types and the second
  607. argument was negative, an exception was raised.) If the second argument is
  608. negative, the third argument must be omitted. If *z* is present, *x* and *y*
  609. must be of integer types, and *y* must be non-negative. (This restriction was
  610. added in Python 2.2. In Python 2.1 and before, floating 3-argument ``pow()``
  611. returned platform-dependent results depending on floating-point rounding
  612. accidents.)
  613. """
  614. pass
  615. def property(fget,fset,fdel,doc):
  616. """
  617. Return a property attribute for :term:`new-style class`\es (classes that
  618. derive from :class:`object`).
  619. *fget* is a function for getting an attribute value, likewise *fset* is a
  620. function for setting, and *fdel* a function for del'ing, an attribute. Typical
  621. use is to define a managed attribute ``x``::
  622. class C(object):
  623. def __init__(self):
  624. self._x = None
  625. def getx(self):
  626. return self._x
  627. def setx(self, value):
  628. self._x = value
  629. def delx(self):
  630. del self._x
  631. x = property(getx, setx, delx, "I'm the 'x' property.")
  632. If then *c* is an instance of *C*, ``c.x`` will invoke the getter,
  633. ``c.x = value`` will invoke the setter and ``del c.x`` the deleter.
  634. If given, *doc* will be the docstring of the property attribute. Otherwise, the
  635. property will copy *fget*'s docstring (if it exists). This makes it possible to
  636. create read-only properties easily using :func:`property` as a :term:`decorator`::
  637. class Parrot(object):
  638. def __init__(self):
  639. self._voltage = 100000
  640. @property
  641. def voltage(self):
  642. " " " Get the current voltage. " " "
  643. return self._voltage
  644. turns the :meth:`voltage` method into a "getter" for a read-only attribute
  645. with the same name.
  646. A property object has :attr:`getter`, :attr:`setter`, and :attr:`deleter`
  647. methods usable as decorators that create a copy of the property with the
  648. corresponding accessor function set to the decorated function. This is
  649. best explained with an example::
  650. class C(object):
  651. def __init__(self):
  652. self._x = None
  653. @property
  654. def x(self):
  655. " " " I'm the 'x' property. " " "
  656. return self._x
  657. @x.setter
  658. def x(self, value):
  659. self._x = value
  660. @x.deleter
  661. def x(self):
  662. del self._x
  663. This code is exactly equivalent to the first example. Be sure to give the
  664. additional functions the same name as the original property (``x`` in this
  665. case.)
  666. The returned property also has the attributes ``fget``, ``fset``, and
  667. ``fdel`` corresponding to the constructor arguments.
  668. """
  669. pass
  670. def range(start,stop,step):
  671. """
  672. This is a versatile function to create lists containing arithmetic progressions.
  673. It is most often used in :keyword:`for` loops. The arguments must be plain
  674. integers. If the *step* argument is omitted, it defaults to ``1``. If the
  675. *start* argument is omitted, it defaults to ``0``. The full form returns a list
  676. of plain integers ``[start, start + step, start + 2 * step, more]``. If *step*
  677. is positive, the last element is the largest ``start + i * step`` less than
  678. *stop*; if *step* is negative, the last element is the smallest ``start + i *
  679. step`` greater than *stop*. *step* must not be zero (or else :exc:`ValueError`
  680. is raised). Example:
  681. >>> range(10)
  682. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  683. >>> range(1, 11)
  684. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  685. >>> range(0, 30, 5)
  686. [0, 5, 10, 15, 20, 25]
  687. >>> range(0, 10, 3)
  688. [0, 3, 6, 9]
  689. >>> range(0, -10, -1)
  690. [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
  691. >>> range(0)
  692. []
  693. >>> range(1, 0)
  694. []
  695. """
  696. pass
  697. def raw_input(prompt):
  698. """
  699. If the *prompt* argument is present, it is written to standard output without a
  700. trailing newline. The function then reads a line from input, converts it to a
  701. string (stripping a trailing newline), and returns that. When EOF is read,
  702. :exc:`EOFError` is raised. Example::
  703. >>> s = raw_input('--> ')
  704. --> Monty Python's Flying Circus
  705. >>> s
  706. "Monty Python's Flying Circus"
  707. If the :mod:`readline` module was loaded, then :func:`raw_input` will use it to
  708. provide elaborate line editing and history features.
  709. """
  710. pass
  711. def reduce(function,iterable,initializer):
  712. """
  713. Apply *function* of two arguments cumulatively to the items of *iterable*, from
  714. left to right, so as to reduce the iterable to a single value. For example,
  715. ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calculates ``((((1+2)+3)+4)+5)``.
  716. The left argument, *x*, is the accumulated value and the right argument, *y*, is
  717. the update value from the *iterable*. If the optional *initializer* is present,
  718. it is placed before the items of the iterable in the calculation, and serves as
  719. a default when the iterable is empty. If *initializer* is not given and
  720. *iterable* contains only one item, the first item is returned.
  721. """
  722. pass
  723. def reload(module):
  724. """
  725. Reload a previously imported *module*. The argument must be a module object, so
  726. it must have been successfully imported before. This is useful if you have
  727. edited the module source file using an external editor and want to try out the
  728. new version without leaving the Python interpreter. The return value is the
  729. module object (the same as the *module* argument).
  730. When ``reload(module)`` is executed:
  731. * Python modules' code is recompiled and the module-level code reexecuted,
  732. defining a new set of objects which are bound to names in the module's
  733. dictionary. The ``init`` function of extension modules is not called a second
  734. time.
  735. * As with all other objects in Python the old objects are only reclaimed after
  736. their reference counts drop to zero.
  737. * The names in the module namespace are updated to point to any new or changed
  738. objects.
  739. * Other references to the old objects (such as names external to the module) are
  740. not rebound to refer to the new objects and must be updated in each namespace
  741. where they occur if that is desired.
  742. There are a number of other caveats:
  743. If a module is syntactically correct but its initialization fails, the first
  744. :keyword:`import` statement for it does not bind its name locally, but does
  745. store a (partially initialized) module object in ``sys.modules``. To reload the
  746. module you must first :keyword:`import` it again (this will bind the name to the
  747. partially initialized module object) before you can :func:`reload` it.
  748. When a module is reloaded, its dictionary (containing the module's global
  749. variables) is retained. Redefinitions of names will override the old
  750. definitions, so this is generally not a problem. If the new version of a module
  751. does not define a name that was defined by the old version, the old definition
  752. remains. This feature can be used to the module's advantage if it maintains a
  753. global table or cache of objects --- with a :keyword:`try` statement it can test
  754. for the table's presence and skip its initialization if desired::
  755. try:
  756. cache
  757. except NameError:
  758. cache = {}
  759. It is legal though generally not very useful to reload built-in or dynamically
  760. loaded modules, except for :mod:`sys`, :mod:`__main__` and :mod:`__builtin__`.
  761. In many cases, however, extension modules are not designed to be initialized
  762. more than once, and may fail in arbitrary ways when reloaded.
  763. If a module imports objects from another module using :keyword:`from` more
  764. :keyword:`import` more, calling :func:`reload` for the other module does not
  765. redefine the objects imported from it --- one way around this is to re-execute
  766. the :keyword:`from` statement, another is to use :keyword:`import` and qualified
  767. names (*module*.*name*) instead.
  768. If a module instantiates instances of a class, reloading the module that defines
  769. the class does not affect the method definitions of the instances --- they
  770. continue to use the old class definition. The same is true for derived classes.
  771. """
  772. pass
  773. def repr(object):
  774. """
  775. Return a string containing a printable representation of an object. This is
  776. the same value yielded by conversions (reverse quotes). It is sometimes
  777. useful to be able to access this operation as an ordinary function. For many
  778. types, this function makes an attempt to return a string that would yield an
  779. object with the same value when passed to :func:`eval`, otherwise the
  780. representation is a string enclosed in angle brackets that contains the name
  781. of the type of the object together with additional information often
  782. including the name and address of the object. A class can control what this
  783. function returns for its instances by defining a :meth:`__repr__` method.
  784. """
  785. pass
  786. def reversed(seq):
  787. """
  788. Return a reverse :term:`iterator`. *seq* must be an object which has
  789. a :meth:`__reversed__` method or supports the sequence protocol (the
  790. :meth:`__len__` method and the :meth:`__getitem__` method with integer
  791. arguments starting at ``0``).
  792. """
  793. pass
  794. def round(x,n):
  795. """
  796. Return the floating point value *x* rounded to *n* digits after the decimal
  797. point. If *n* is omitted, it defaults to zero. The result is a floating point
  798. number. Values are rounded to the closest multiple of 10 to the power minus
  799. *n*; if two multiples are equally close, rounding is done away from 0 (so. for
  800. example, ``round(0.5)`` is ``1.0`` and ``round(-0.5)`` is ``-1.0``).
  801. """
  802. pass
  803. def set(iterable):
  804. """:noindex:
  805. Return a new set, optionally with elements taken from *iterable*.
  806. The set type is described in :ref:`types-set`.
  807. For other containers see the built in :class:`dict`, :class:`list`, and
  808. :class:`tuple` classes, and the :mod:`collections` module.
  809. """
  810. pass
  811. def setattr(object,name,value):
  812. """
  813. This is the counterpart of :func:`getattr`. The arguments are an object, a
  814. string and an arbitrary value. The string may name an existing attribute or a
  815. new attribute. The function assigns the value to the attribute, provided the
  816. object allows it. For example, ``setattr(x, 'foobar', 123)`` is equivalent to
  817. ``x.foobar = 123``.
  818. """
  819. pass
  820. def slice(start,stop,step):
  821. """
  822. """
  823. pass
  824. def sorted(iterable,cmp,key,reverse):
  825. """
  826. Return a new sorted list from the items in *iterable*.
  827. The optional arguments *cmp*, *key*, and *reverse* have the same meaning as
  828. those for the :meth:`list.sort` method (described in section
  829. :ref:`typesseq-mutable`).
  830. *cmp* specifies a custom comparison function of two arguments (iterable
  831. elements) which should return a negative, zero or positive number depending on
  832. whether the first argument is considered smaller than, equal to, or larger than
  833. the second argument: ``cmp=lambda x,y: cmp(x.lower(), y.lower())``. The default
  834. value is ``None``.
  835. *key* specifies a function of one argument that is used to extract a comparison
  836. key from each list element: ``key=str.lower``. The default value is ``None``
  837. (compare the elements directly).
  838. *reverse* is a boolean value. If set to ``True``, then the list elements are
  839. sorted as if each comparison were reversed.
  840. In general, the *key* and *reverse* conversion processes are much faster
  841. than specifying an equivalent *cmp* function. This is because *cmp* is
  842. called multiple times for each list element while *key* and *reverse* touch
  843. each element only once. Use :func:`functools.cmp_to_key` to convert an
  844. old-style *cmp* function to a *key* function.
  845. For sorting examples and a brief sorting tutorial, see `Sorting HowTo
  846. <http://wiki.python.org/moin/HowTo/Sorting/>`_\.
  847. """
  848. pass
  849. def staticmethod(function):
  850. """
  851. Return a static method for *function*.
  852. A static method does not receive an implicit first argument. To declare a static
  853. method, use this idiom::
  854. class C:
  855. @staticmethod
  856. def f(arg1, arg2, more): more
  857. The ``@staticmethod`` form is a function :term:`decorator` -- see the
  858. description of function definitions in :ref:`function` for details.
  859. It can be called either on the class (such as ``C.f()``) or on an instance (such
  860. as ``C().f()``). The instance is ignored except for its class.
  861. Static methods in Python are similar to those found in Java or C++. For a more
  862. advanced concept, see :func:`classmethod` in this section.
  863. For more information on static methods, consult the documentation on the
  864. standard type hierarchy in :ref:`types`.
  865. """
  866. pass
  867. def str(object):
  868. """
  869. Return a string containing a nicely printable representation of an object. For
  870. strings, this returns the string itself. The difference with ``repr(object)``
  871. is that ``str(object)`` does not always attempt to return a string that is
  872. acceptable to :func:`eval`; its goal is to return a printable string. If no
  873. argument is given, returns the empty string, ``''``.
  874. For more information on strings see :ref:`typesseq` which describes sequence
  875. functionality (strings are sequences), and also the string-specific methods
  876. described in the :ref:`string-methods` section. To output formatted strings
  877. use template strings or the ``%`` operator described in the
  878. :ref:`string-formatting` section. In addition see the :ref:`stringservices`
  879. section. See also :func:`unicode`.
  880. """
  881. pass
  882. def sum(iterable,start):
  883. """
  884. Sums *start* and the items of an *iterable* from left to right and returns the
  885. total. *start* defaults to ``0``. The *iterable*'s items are normally numbers,
  886. and the start value is not allowed to be a string.
  887. For some use cases, there are good alternatives to :func:`sum`.
  888. The preferred, fast way to concatenate a sequence of strings is by calling
  889. ``''.join(sequence)``. To add floating point values with extended precision,
  890. see :func:`math.fsum`\. To concatenate a series of iterables, consider using
  891. :func:`itertools.chain`.
  892. """
  893. pass
  894. def super(type,object_or_type):
  895. """
  896. Return a proxy object that delegates method calls to a parent or sibling
  897. class of *type*. This is useful for accessing inherited methods that have
  898. been overridden in a class. The search order is same as that used by
  899. :func:`getattr` except that the *type* itself is skipped.
  900. The :attr:`__mro__` attribute of the *type* lists the method resolution
  901. search order used by both :func:`getattr` and :func:`super`. The attribute
  902. is dynamic and can change whenever the inheritance hierarchy is updated.
  903. If the second argument is omitted, the super object returned is unbound. If
  904. the second argument is an object, ``isinstance(obj, type)`` must be true. If
  905. the second argument is a type, ``issubclass(type2, type)`` must be true (this
  906. is useful for classmethods).
  907. """
  908. pass
  909. def tuple(iterable):
  910. """
  911. Return a tuple whose items are the same and in the same order as *iterable*'s
  912. items. *iterable* may be a sequence, a container that supports iteration, or an
  913. iterator object. If *iterable* is already a tuple, it is returned unchanged.
  914. For instance, ``tuple('abc')`` returns ``('a', 'b', 'c')`` and ``tuple([1, 2,
  915. 3])`` returns ``(1, 2, 3)``. If no argument is given, returns a new empty
  916. tuple, ``()``.
  917. :class:`tuple` is an immutable sequence type, as documented in
  918. :ref:`typesseq`. For other containers see the built in :class:`dict`,
  919. :class:`list`, and :class:`set` classes, and the :mod:`collections` module.
  920. """
  921. pass
  922. def type(object):
  923. """
  924. """
  925. pass
  926. def type(name,bases,dict):
  927. """:noindex:
  928. Return a new type object. This is essentially a dynamic form of the
  929. :keyword:`class` statement. The *name* string is the class name and becomes the
  930. :attr:`__name__` attribute; the *bases* tuple itemizes the base classes and
  931. becomes the :attr:`__bases__` attribute; and the *dict* dictionary is the
  932. namespace containing definitions for class body and becomes the :attr:`__dict__`
  933. attribute. For example, the following two statements create identical
  934. :class:`type` objects:
  935. >>> class X(object):
  936. more a = 1
  937. more
  938. >>> X = type('X', (object,), dict(a=1))
  939. """
  940. pass
  941. def unichr(i):
  942. """
  943. Return the Unicode string of one character whose Unicode code is the integer
  944. *i*. For example, ``unichr(97)`` returns the string ``u'a'``. This is the
  945. inverse of :func:`ord` for Unicode strings. The valid range for the argument
  946. depends how Python was configured -- it may be either UCS2 [0..0xFFFF] or UCS4
  947. [0..0x10FFFF]. :exc:`ValueError` is raised otherwise. For ASCII and 8-bit
  948. strings see :func:`chr`.
  949. """
  950. pass
  951. def unicode(object,encoding,errors):
  952. """
  953. Return the Unicode string version of *object* using one of the following modes:
  954. If *encoding* and/or *errors* are given, ``unicode()`` will decode the object
  955. which can either be an 8-bit string or a character buffer using the codec for
  956. *encoding*. The *encoding* parameter is a string giving the name of an encoding;
  957. if the encoding is not known, :exc:`LookupError` is raised. Error handling is
  958. done according to *errors*; this specifies the treatment of characters which are
  959. invalid in the input encoding. If *errors* is ``'strict'`` (the default), a
  960. :exc:`ValueError` is raised on errors, while a value of ``'ignore'`` causes
  961. errors to be silently ignored, and a value of ``'replace'`` causes the official
  962. Unicode replacement character, ``U+FFFD``, to be used to replace input
  963. characters which cannot be decoded. See also the :mod:`codecs` module.
  964. If no optional parameters are given, ``unicode()`` will mimic the behaviour of
  965. ``str()`` except that it returns Unicode strings instead of 8-bit strings. More
  966. precisely, if *object* is a Unicode string or subclass it will return that
  967. Unicode string without any additional decoding applied.
  968. For objects which provide a :meth:`__unicode__` method, it will call this method
  969. without arguments to create a Unicode string. For all other objects, the 8-bit
  970. string version or representation is requested and then converted to a Unicode
  971. string using the codec for the default encoding in ``'strict'`` mode.
  972. For more information on Unicode strings see :ref:`typesseq` which describes
  973. sequence functionality (Unicode strings are sequences), and also the
  974. string-specific methods described in the :ref:`string-methods` section. To
  975. output formatted strings use template strings or the ``%`` operator described
  976. in the :ref:`string-formatting` section. In addition see the
  977. :ref:`stringservices` section. See also :func:`str`.
  978. """
  979. pass
  980. def vars(object):
  981. """
  982. Without an argument, act like :func:`locals`.
  983. With a module, class or class instance object as argument (or anything else that
  984. has a :attr:`__dict__` attribute), return that attribute.
  985. """
  986. pass
  987. def xrange(start,stop,step):
  988. """
  989. This function is very similar to :func:`range`, but returns an "xrange object"
  990. instead of a list. This is an opaque sequence type which yields the same values
  991. as the corresponding list, without actually storing them all simultaneously.
  992. The advantage of :func:`xrange` over :func:`range` is minimal (since
  993. :func:`xrange` still has to create the values when asked for them) except when a
  994. very large range is used on a memory-starved machine or when all of the range's
  995. elements are never used (such as when the loop is usually terminated with
  996. :keyword:`break`).
  997. """
  998. pass
  999. def zip(iterable,more):
  1000. """
  1001. This function returns a list of tuples, where the *i*-th tuple contains the
  1002. *i*-th element from each of the argument sequences or iterables. The returned
  1003. list is truncated in length to the length of the shortest argument sequence.
  1004. When there are multiple arguments which are all of the same length, :func:`zip`
  1005. is similar to :func:`map` with an initial argument of ``None``. With a single
  1006. sequence argument, it returns a list of 1-tuples. With no arguments, it returns
  1007. an empty list.
  1008. The left-to-right evaluation order of the iterables is guaranteed. This
  1009. makes possible an idiom for clustering a data series into n-length groups
  1010. using ``zip(*[iter(s)]*n)``.
  1011. :func:`zip` in conjunction with the ``*`` operator can be used to unzip a
  1012. list::
  1013. >>> x = [1, 2, 3]
  1014. >>> y = [4, 5, 6]
  1015. >>> zipped = zip(x, y)
  1016. >>> zipped
  1017. [(1, 4), (2, 5), (3, 6)]
  1018. >>> x2, y2 = zip(*zipped)
  1019. >>> x == list(x2) and y == list(y2)
  1020. True
  1021. """
  1022. pass
  1023. def __import__(name,globals,locals,_fromlist,level):
  1024. """
  1025. """
  1026. pass
  1027. def apply(function,args,keywords):
  1028. """
  1029. The *function* argument must be a callable object (a user-defined or built-in
  1030. function or method, or a class object) and the *args* argument must be a
  1031. sequence. The *function* is called with *args* as the argument list; the number
  1032. of arguments is the length of the tuple. If the optional *keywords* argument is
  1033. present, it must be a dictionary whose keys are strings. It specifies keyword
  1034. arguments to be added to the end of the argument list. Calling :func:`apply` is
  1035. different from just calling ``function(args)``, since in that case there is
  1036. always exactly one argument. The use of :func:`apply` is equivalent to
  1037. ``function(*args, **keywords)``.
  1038. """
  1039. pass
  1040. def buffer(object,offset,size):
  1041. """
  1042. The *object* argument must be an object that supports the buffer call interface
  1043. (such as strings, arrays, and buffers). A new buffer object will be created
  1044. which references the *object* argument. The buffer object will be a slice from
  1045. the beginning of *object* (or from the specified *offset*). The slice will
  1046. extend to the end of *object* (or will have a length given by the *size*
  1047. argument).
  1048. """
  1049. pass
  1050. def coerce(x,y):
  1051. """
  1052. Return a tuple consisting of the two numeric arguments converted to a common
  1053. type, using the same rules as used by arithmetic operations. If coercion

Large files files are truncated, but you can click here to view the full file