Coverage for pygeodesy/deprecated/__init__.py: 96%
117 statements
« prev ^ index » next coverage.py v7.2.2, created at 2023-04-12 11:45 -0400
« prev ^ index » next coverage.py v7.2.2, created at 2023-04-12 11:45 -0400
2# -*- coding: utf-8 -*-
4u'''DEPRECATED constants, classes, functions, methods, etc.
6Kept and exported for backward compatibility, including deprecated modules
7C{pygeodesy.bases}, C{pygeodesy.datum} and C{pygeodesy,nvector}, previously
8inside the C{pygeodesy} package.
10Use either C{from pygeodesy import bases} or C{from pygeodesy.deprecated import
11bases}. Likewise for C{datum} and C{nvector}.
12'''
14from pygeodesy.constants import EPS, EPS_2, MANT_DIG, NAN, R_M, _float, _1_0
15from pygeodesy.interns import NN, _azi12_, _COMMASPACE_, _convergence_, \
16 _DEPRECATED_, _down_, _east_, _easting_, _end_, \
17 _hemipole_, _lat_, _lat1_, _lat2_, _lon_, _lon1_, \
18 _lon2_, _negative_, _north_, _northing_, _s_, \
19 _s12_, _S12_, _scalar_, _scale_, _sep_, _SPACE_, \
20 _start_, _sx_, _sy_, _sz_, _tx_, _ty_, _tz_, \
21 _UNDER_, _value_, _zone_
22from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, isLazy
23from pygeodesy.named import _NamedTuple, _Pass
24from pygeodesy.props import deprecated_class, deprecated_function, deprecated_method
25from pygeodesy.units import Degrees, Easting, Float, Int, Lat, Lon, Meter, Northing, \
26 Number_, Scalar, Scalar_, Str
27if isLazy: # XXX force import of all deprecated modules
28 import pygeodesy.deprecated.bases as bases, \
29 pygeodesy.deprecated.datum as datum, \
30 pygeodesy.deprecated.nvector as nvector # PYCHOK unused
31 # XXX instead, use module_property or enhance .lazily
33__all__ = _ALL_LAZY.deprecated
34__version__ = '23.03.29'
36_WGS84 = _UTM = object()
39class _Deprecated_Float(Float):
40 '''DEPRECATED, don't use.'''
41 pass
43EPS1_2 = _Deprecated_Float(EPS1_2=_1_0 - EPS_2) # PYCHOK floats
46class _Deprecated_Int(Int):
47 '''DEPRECATED, don't use.'''
48 pass
50MANTIS = _Deprecated_Int(MANTIS=MANT_DIG) # PYCHOK ints
53class _Deprecated_Str(Str):
54 '''DEPRECATED, don't use.'''
55 pass
57OK = _Deprecated_Str(OK='OK') # PYCHOK strs
60class _DeprecatedNamedTuple(_NamedTuple):
61 '''(INTERNAL) Base class for DEPRECATED C{_NamedTuple} classes.
62 '''
63 def __new__(cls, *args, **kwds):
64 deprecated_class(cls)
65 return _NamedTuple.__new__(cls, *args, **kwds)
68# DEPRECATED classes, for export and backward compatibility only
69class ClipCS3Tuple(_DeprecatedNamedTuple): # PYCHOK no cover
70 '''DEPRECATED, see function L{pygeodesy.clipCS3}.'''
71 _Names_ = (_start_, _end_, 'index')
72 _Units_ = (_Pass, _Pass, Number_)
75def EcefCartesian(*args, **kwds):
76 '''DEPRECATED, use class L{LocalCartesian}.'''
77 LocalCartesian = _MODS.ltp.LocalCartesian
79 class EcefCartesian(LocalCartesian):
80 '''DEPRECATED, use class L{LocalCartesian}.
82 @note: This class is named I{incorrectly}, since it provides conversion to
83 and from I{local} cartesian coordinates in a I{local tangent plane}
84 and I{not geocentric} (ECEF) ones, as the name suggests.
85 '''
86 def __init__(self, latlonh0=0, lon0=0, height0=0, ecef=None, name=NN):
87 deprecated_class(self.__class__)
88 LocalCartesian.__init__(self, latlonh0=latlonh0, lon0=lon0, height0=height0, ecef=ecef, name=name)
90 @deprecated_method
91 def forward(self, latlonh, lon=None, height=0, M=False, name=NN):
92 '''DEPRECATED, use method L{LocalCartesian.forward}.
94 @return: I{Incorrectly}, an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C,
95 M, datum)} with I{local} C{(x, y, z)} coordinates for the given
96 I{geodetic} ones C{(lat, lon, height)}, case C{C=0} always,
97 optionally I{concatenated} L{EcefMatrix} C{M} and C{datum}.
98 '''
99 t = LocalCartesian.forward(self, latlonh, lon=lon, height=height, M=M, name=name)
100 return _MODS.ecef.Ecef9Tuple(t.x, t.y, t.z, t.lat, t.lon, t.height,
101 0, t.M, t.ecef.datum,
102 name=t.name or self.name)
104 @deprecated_method
105 def reverse(self, xyz, y=None, z=None, M=False, name=NN):
106 '''DEPRECATED, use method L{LocalCartesian.reverse}.
108 @return: I{Incorrectly}, an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C,
109 M, datum)} with I{geodetic} coordinates C{(lat, lon, height)} for
110 the given I{local} ones C{(x, y, z)}, case C{C}, optionally
111 I{concatenated} L{EcefMatrix} C{M} and C{datum}.
112 '''
113 t = LocalCartesian.reverse(self, xyz, y=y, z=z, M=M, name=name)
114 return _MODS.ecef.Ecef9Tuple(t.x, t.y, t.z, t.lat, t.lon, t.height,
115 t.ecef.C, t.M, t.ecef.datum,
116 name=t.name or self.name)
118 _MODS.deprecated.EcefCartesian = EcefCartesian
119 return EcefCartesian(*args, **kwds)
122class EasNorExact4Tuple(_DeprecatedNamedTuple):
123 '''DEPRECATED, use class L{Forward4Tuple}.'''
124 _Names_ = (_easting_, _northing_, _convergence_, _scale_)
125 _Units_ = ( Easting, Northing, Degrees, Scalar)
128def HeightIDW(knots, **kwds): # PYCHOK no cover
129 '''DEPRECATED, use class L{HeightIDWeuclidean}.'''
130 HeightIDWeuclidean = _MODS.heights.HeightIDWeuclidean
132 class HeightIDW(HeightIDWeuclidean):
133 '''DEPRECATED, use class L{HeightIDWeuclidean}.'''
134 def __init__(self, knots, adjust=True, beta=2, name=NN):
135 deprecated_class(self.__class__)
136 HeightIDWeuclidean.__init__(self, knots, adjust=adjust, beta=beta, name=name)
138 _MODS.deprecated.HeightIDW = HeightIDW
139 return HeightIDW(knots, **kwds)
142def HeightIDW2(knots, **kwds): # PYCHOK no cover
143 '''DEPRECATED, use class L{HeightIDWequirectangular}.'''
144 HeightIDWequirectangular = _MODS.heights.HeightIDWequirectangular
146 class HeightIDW2(HeightIDWequirectangular):
147 '''DEPRECATED, use class L{HeightIDWequirectangular}.'''
148 def __init__(self, knots, adjust=True, wrap=False, name=NN):
149 deprecated_class(self.__class__)
150 HeightIDWequirectangular.__init__(self, knots, adjust=adjust, wrap=wrap, name=name)
152 _MODS.deprecated.HeightIDW2 = HeightIDW2
153 return HeightIDW2(knots, **kwds)
156def HeightIDW3(knots, **kwds): # PYCHOK no cover
157 '''DEPRECATED, use class L{HeightIDWhaversine}.'''
158 HeightIDWhaversine = _MODS.heights.HeightIDWhaversine
160 class HeightIDW3(HeightIDWhaversine):
161 '''DEPRECATED, use class L{HeightIDWhaversine}.
162 '''
163 def __init__(self, knots, beta=2, wrap=False, name=NN):
164 deprecated_class(self.__class__)
165 HeightIDWhaversine.__init__(self, knots, beta=beta, wrap=wrap, name=name)
167 _MODS.deprecated.HeightIDW3 = HeightIDW3
168 return HeightIDW3(knots, **kwds)
171class LatLonExact4Tuple(_DeprecatedNamedTuple):
172 '''DEPRECATED, used class L{Reverse4Tuple}.'''
173 _Names_ = (_lat_, _lon_, _convergence_, _scale_)
174 _Units_ = ( Lat, Lon, Degrees, Scalar)
177class Ned3Tuple(_DeprecatedNamedTuple): # was in .ellipsoidalNvector
178 '''DEPRECATED, use class L{pygeodesy.Ned4Tuple}.'''
179 _Names_ = (_north_, _east_, _down_)
180 _Units_ = ( Meter, Meter, Meter)
183def RefFrameError(*args, **kwds): # PYCHOK no cover
184 '''DEPRECATED, use class L{TRFError}.'''
185 TRFError = _MODS.errors.TRFError
187 class RefFrameError(TRFError):
188 '''DEPRECATED, use class L{TRFError}.
189 '''
190 def __init__(self, *name_value, **txt_name_values):
191 deprecated_class(self.__class__)
192 TRFError.__init__(self, *name_value, **txt_name_values)
194 _MODS.deprecated.RefFrameError = RefFrameError
195 return RefFrameError(*args, **kwds)
198class Rhumb7Tuple(_DeprecatedNamedTuple):
199 '''DEPRECATED, use class L{Rhumb8Tuple} ignoring item C{a12}.'''
200 _Names_ = (_lat1_, _lon1_, _lat2_, _lon2_, _azi12_, _s12_, _S12_)
201 _Units_ = (_Pass, _Pass, _Pass, _Pass, _Pass, _Pass, _Pass)
203 @deprecated_method
204 def toDirect9Tuple(self, **kwds):
205 return self.toRhumb8Tuple().toDirect9Tuple(self, **kwds)
207 @deprecated_method
208 def toGDict(self, **kwds):
209 return self.toRhumb8Tuple().toGDict(**kwds)
211 @deprecated_method
212 def toInverse10Tuple(self, **kwds):
213 return self.toRhumb8Tuple().toInverse10Tuple(self, **kwds)
215 @deprecated_method
216 def toRhumb8Tuple(self, dflt=NAN):
217 return _MODS.rhumbx.Rhumb8Tuple(self + (dflt,), name=self.name)
219 def _to7Tuple(self, **unused):
220 '''(INTERNAL) see L{Rhumb8Tuple._to7Tuple}.
221 '''
222 return self
225class Transform7Tuple(_DeprecatedNamedTuple): # PYCHOK no cover
226 '''DEPRECATED, use class L{Helmert7Tuple} without keyword arguments.'''
227 _Names_ = (_tx_, _ty_, _tz_, _s_, _sx_, _sy_, _sz_)
228 _Units_ = ( Float, Float, Float, Float, Float, Float, Float)
230 def __new__(cls, tx=0, ty=0, tz=0, s=0,
231 sx=0, sy=0, sz=0, name=NN):
232 t = map(_float, (tx, ty, tz, s, sx, sy, sz))
233 return _DeprecatedNamedTuple.__new__(cls, *t, name=name)
236class UtmUps4Tuple(_DeprecatedNamedTuple): # PYCHOK no cover
237 '''DEPRECATED and OBSOLETE, expect a L{UtmUps5Tuple} from method C{Mgrs.toUtm(utm=None)}.
239 4-Tuple C{(zone, hemipole, easting, northing)} as C{str},
240 C{str}, C{meter} and C{meter}.
241 '''
242 _Names_ = (_zone_, _hemipole_, _easting_, _northing_) # band
243 _Units_ = ( Str, Str, Easting, Northing)
246@deprecated_function
247def anStr(name, OKd='._-', sub=_UNDER_): # PYCHOK no cover
248 '''DEPRECATED, use function L{pygeodesy.anstr}.'''
249 return _MODS.streprs.anstr(name, OKd=OKd, sub=sub)
252@deprecated_function
253def areaof(points, adjust=True, radius=R_M, wrap=True): # PYCHOK no cover
254 '''DEPRECATED, use function L{pygeodesy.areaOf}.'''
255 return _MODS.points.areaOf(points, adjust=adjust, radius=radius, wrap=wrap)
258@deprecated_function
259def bounds(points, wrap=True, LatLon=None): # PYCHOK no cover
260 '''DEPRECATED, use function L{pygeodesy.boundsOf}.
262 @return: 2-Tuple C{(latlonSW, latlonNE)} as B{C{LatLon}}
263 or 4-Tuple C{(latS, lonW, latN, lonE)} if
264 B{C{LatLon}} is C{None}.
265 '''
266 return tuple(_MODS.points.boundsOf(points, wrap=wrap, LatLon=LatLon))
269@deprecated_function
270def clipCS3(points, lowerleft, upperright, closed=False, inull=False): # PYCHOK no cover
271 '''DEPRECATED, use function L{pygeodesy.clipCS4}.
273 @return: Yield a L{ClipCS3Tuple}C{(start, end, index)} for each
274 edge of the I{clipped} path.
275 '''
276 for p1, p2, _, j in _MODS.clipy.clipCS4(points, lowerleft, upperright,
277 closed=closed, inull=inull):
278 yield ClipCS3Tuple(p1, p2, j)
281@deprecated_function
282def clipDMS(deg, limit): # PYCHOK no cover
283 '''DEPRECATED, use function L{pygeodesy.clipDegrees}.'''
284 return _MODS.dms.clipDegrees(deg, limit)
287@deprecated_function
288def clipStr(bstr, limit=50, white=NN): # PYCHOK no cover
289 '''DEPRECATED, use function L{pygeodesy.clips}.'''
290 return _MODS.basics.clips(bstr, limit=limit, white=white)
293@deprecated_function
294def collins(pointA, pointB, pointC, alpha, beta, **useZ_Clas_and_kwds):
295 '''DEPRECATED, use function L{pygeodesy.collins5}.'''
296 return _MODS.resections.collins5(pointA, pointB, pointC, alpha, beta,
297 **useZ_Clas_and_kwds)
300@deprecated_function
301def copysign(x, y): # PYCHOK no cover
302 '''DEPRECATED, use function L{pygeodesy.copysign0}.'''
303 return _MODS.basics.copysign0(x, y)
306@deprecated_function
307def decodeEPSG2(arg): # PYCHOK no cover
308 '''DEPRECATED, use function L{epsg.decode2}.
310 @return: 2-Tuple C{(zone, hemipole)}
311 '''
312 return tuple(_MODS.epsg.decode2(arg))
315@deprecated_function
316def encodeEPSG(zone, hemipole=NN, band=NN): # PYCHOK no cover
317 '''DEPRECATED, use function L{epsg.encode}.
319 @return: C{EPSG} code (C{int}).
320 '''
321 return int(_MODS.epsg.encode(zone, hemipole=hemipole, band=band))
324@deprecated_function
325def enStr2(easting, northing, prec, *extras): # PYCHOK no cover
326 '''DEPRECATED, use function L{pygeodesy.enstr2}.'''
327 return _MODS.streprs.enstr2(easting, northing, (int(prec) // 2 - 5), *extras)
330@deprecated_function
331def equirectangular3(lat1, lon1, lat2, lon2, **options): # PYCHOK no cover
332 '''DEPRECATED, use function C{equirectangular_}.
334 @return: 3-Tuple C{(distance2, delta_lat, delta_lon)}.
335 '''
336 return tuple(_MODS.formy.equirectangular_(lat1, lon1, lat2, lon2, **options)[:3])
339@deprecated_function
340def excessAbc(A, b, c):
341 '''DEPRECATED, use function L{excessAbc_}.'''
342 return _MODS.formy.excessAbc_(A, b, c)
345@deprecated_function
346def excessGirard(A, B, C):
347 '''DEPRECATED, use function L{excessGirard_}.'''
348 return _MODS.formy.excessGirard_(A, B, C)
351@deprecated_function
352def excessLHuilier(a, b, c):
353 '''DEPRECATED, use function L{excessLHuilier_}.'''
354 return _MODS.formy.excessLHuilier_(a, b, c)
357@deprecated_function
358def false2f(value, name=_value_, false=True, Error=ValueError): # PYCHOK no cover
359 '''DEPRECATED, use function L{falsed2f}.'''
360 return falsed2f(falsed=false, Error=Error, **{name: value})
363@deprecated_function
364def falsed2f(falsed=True, Error=ValueError, **name_value): # PYCHOK no cover
365 '''DEPRECATED, use class L{Easting} or L{Northing}.
367 Convert a falsed east-/northing to non-negative C{float}.
369 @kwarg falsed: Value includes false origin (C{bool}).
370 @kwarg Error: Optional, overriding error (C{Exception}).
371 @kwarg name_value: One C{B{name}=value} pair.
373 @return: The value (C{float}).
375 @raise Error: Invalid or negative C{B{name}=value}.
376 '''
377 t = NN
378 if len(name_value) == 1:
379 try:
380 for f in name_value.values():
381 f = float(f)
382 if falsed and f < 0:
383 break
384 return f
385 t = _COMMASPACE_('falsed', _negative_)
386 except (TypeError, ValueError) as x:
387 t = str(x)
388 raise _MODS.errors._InvalidError(Error=Error, txt=t, **name_value)
391@deprecated_function
392def fStr(floats, prec=6, fmt=_MODS.streprs.Fmt.f, ints=False, sep=_COMMASPACE_): # PYCHOK no cover
393 '''DEPRECATED, use function L{fstr}.'''
394 return _MODS.streprs.fstr(floats, prec=prec, fmt=fmt, ints=ints, sep=sep)
397@deprecated_function
398def fStrzs(floatstr): # PYCHOK no cover
399 '''DEPRECATED, use function L{pygeodesy.fstrzs}.'''
400 return _MODS.streprs.fstrzs(floatstr)
403@deprecated_function
404def hypot3(x, y, z): # PYCHOK no cover
405 '''DEPRECATED, use function L{pygeodesy.hypot_}.'''
406 return _MODS.fmath.hypot_(x, y, z)
409@deprecated_function
410def inStr(inst, *args, **kwds): # PYCHOK no cover
411 '''DEPRECATED, use function L{pygeodesy.instr}.'''
412 return _MODS.streprs.instr(inst, *args, **kwds)
415def isDEPRECATED(obj):
416 '''Return C{True} if C{B{obj}} is a C{DEPRECATED} class, method
417 or function, C{False} if not or C{None} if undetermined.
418 '''
419 try: # XXX inspect.getdoc(obj)
420 return bool(obj.__doc__.lstrip().startswith(_DEPRECATED_))
421 except AttributeError:
422 return None
425@deprecated_function
426def isenclosedby(point, points, wrap=False): # PYCHOK no cover
427 '''DEPRECATED, use function L{pygeodesy.isenclosedBy}.'''
428 return _MODS.points.isenclosedBy(point, points, wrap=wrap)
431@deprecated_function
432def joined(*words, **sep): # PYCHOK no cover
433 '''DEPRECATED, use C{NN(...)}, C{NN.join_} or C{B{sep}.join}.'''
434 return sep.get(_sep_, NN).join(map(str, words))
437@deprecated_function
438def istuplist(obj, minum=0): # PYCHOK no cover
439 '''DEPRECATED, use function L{islistuple}.'''
440 return _MODS.basics.islistuple(obj, minum=minum)
443@deprecated_function
444def joined_(*words, **sep): # PYCHOK no cover
445 '''DEPRECATED, use C{_SPACE_(...)}, C{_SPACE_.join_} or C{B{sep}.join}, sep=" ".'''
446 return sep.get(_sep_, _SPACE_).join(map(str, words))
449@deprecated_function
450def nearestOn3(point, points, closed=False, wrap=False, **options): # PYCHOK no cover
451 '''DEPRECATED, use function L{pygeodesy.nearestOn5}.
453 @return: 3-Tuple C{(lat, lon, distance)}
454 '''
455 return tuple(_MODS.points.nearestOn5(point, points, closed=closed, wrap=wrap, **options)[:3])
458@deprecated_function
459def nearestOn4(point, points, closed=False, wrap=False, **options): # PYCHOK no cover
460 '''DEPRECATED, use function L{pygeodesy.nearestOn5}.
462 @return: 4-Tuple C{(lat, lon, distance, angle)}
463 '''
464 return tuple(_MODS.points.nearestOn5(point, points, closed=closed, wrap=wrap, **options)[:4])
467@deprecated_function
468def parseUTM(strUTM, datum=_WGS84, Utm=_UTM, name=NN): # PYCHOK no cover
469 '''DEPRECATED, use function L{parseUTM5}.
471 @return: The UTM coordinate (B{L{Utm}}) or 4-tuple C{(zone,
472 hemisphere, easting, northing)} if B{C{Utm}} is C{None}.
473 '''
474 d = _MODS.datums.Datums.WGS84 if datum is _WGS84 else datum # PYCHOK shadows?
475 U = _MODS.utm.Utm if Utm is _UTM else Utm
476 r = _MODS.utm.parseUTM5(strUTM, datum=d, Utm=U, name=name)
477 if isinstance(r, tuple): # UtmUps5Tuple
478 r = r.zone, r.hemipole, r.easting, r.northing # no band
479 return r
482@deprecated_function
483def perimeterof(points, closed=False, adjust=True, radius=R_M, wrap=True): # PYCHOK no cover
484 '''DEPRECATED, use function L{perimeterOf}.'''
485 return _MODS.points.perimeterOf(points, closed=closed, adjust=adjust, radius=radius, wrap=wrap)
488@deprecated_function
489def polygon(points, closed=True, base=None): # PYCHOK no cover
490 '''DEPRECATED, use function L{points2}.'''
491 return _MODS.deprecated.bases.points2(points, closed=closed, base=base)
494@deprecated_function
495def scalar(value, low=EPS, high=1.0, name=_scalar_, Error=ValueError): # PYCHOK no cover
496 '''DEPRECATED, use class L{Number_} or L{Scalar_}.
498 @return: New value (C{float} or C{int} for C{int} B{C{low}}).
500 @raise Error: Invalid B{C{value}}.
501 '''
502 C_ = Number_ if _MODS.basics.isint(low) else Scalar_
503 return C_(value, name=name, Error=Error, low=low, high=high)
506@deprecated_function
507def simplify2(points, pipe, radius=R_M, shortest=False, indices=False, **options): # PYCHOK no cover
508 '''DEPRECATED, use function L{pygeodesy.simplifyRW}.
509 '''
510 return _MODS.simplify.simplifyRW(points, pipe, radius=radius, shortest=shortest,
511 indices=indices, **options)
514@deprecated_function
515def tienstra(pointA, pointB, pointC, alpha, **beta_gamma_useZ_Clas_and_kwds):
516 '''DEPRECATED, use function L{pygeodesy.tienstra7}.'''
517 return _MODS.resections.tienstra7(pointA, pointB, pointC, alpha, **beta_gamma_useZ_Clas_and_kwds)
520@deprecated_function
521def toUtm(latlon, lon=None, datum=None, Utm=_UTM, cmoff=True, name=NN): # PYCHOK no cover
522 '''DEPRECATED, use function L{pygeodesy.toUtm8}.
524 @return: The UTM coordinate (B{C{Utm}}) or a 6-tuple C{(zone,
525 easting, northing, band, convergence, scale)} if
526 B{C{Utm}} is C{None} or B{C{cmoff}} is C{False}.
527 '''
528 U = _MODS.utm.Utm if Utm is _UTM else Utm
529 r = _MODS.utm.toUtm8(latlon, lon=lon, datum=datum, Utm=U, name=name, falsed=cmoff)
530 if isinstance(r, tuple): # UtmUps8Tuple
531 # no hemisphere/pole and datum
532 r = r.zone, r.easting, r.northing, r.band, r.gamma, r.scale
533 return r
536@deprecated_function
537def unsign0(x): # PYCHOK no cover
538 '''DEPRECATED, use function L{pygeodesy.unsigned0}.'''
539 return _MODS.basics.unsigned0(x)
542@deprecated_function
543def unStr(name, *args, **kwds): # PYCHOK no cover
544 '''DEPRECATED, use function L{pygeodesy.unstr}.'''
545 return _MODS.streprs.unstr(name, *args, **kwds)
548@deprecated_function
549def utmZoneBand2(lat, lon): # PYCHOK no cover
550 '''DEPRECATED, use function L{pygeodesy.utmZoneBand5}.
552 @return: 2-Tuple C{(zone, band)}.
553 '''
554 r = _MODS.utm.utmZoneBand5(lat, lon) # UtmUpsLatLon5Tuple
555 return r.zone, r.band
557# **) MIT License
558#
559# Copyright (C) 2018-2023 -- mrJean1 at Gmail -- All Rights Reserved.
560#
561# Permission is hereby granted, free of charge, to any person obtaining a
562# copy of this software and associated documentation files (the "Software"),
563# to deal in the Software without restriction, including without limitation
564# the rights to use, copy, modify, merge, publish, distribute, sublicense,
565# and/or sell copies of the Software, and to permit persons to whom the
566# Software is furnished to do so, subject to the following conditions:
567#
568# The above copyright notice and this permission notice shall be included
569# in all copies or substantial portions of the Software.
570#
571# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
572# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
573# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
574# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
575# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
576# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
577# OTHER DEALINGS IN THE SOFTWARE.