We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ValidationError: invalid value for timestamp
MODERATOR EDIT:  This issue relates to an error that looks something like

    ValidationError: Invalid value 1505856869.685 for timestamp

The issue relates to using conda 4.3.28, and then downgrading (presumably via conda-forge) to a previous version of conda, like 4.3.27.

# SOLUTION #

### To fix on macOS:

    # in the command below, set PATH_TO_ENVIRONMENT yourself
    sed -i '' -E 's|("timestamp": [0-9]+)\.|\1|' /PATH_TO_ENVIRONMENT/conda-meta/*.json

### To fix on Linux:

    # in the command below, set PATH_TO_ENVIRONMENT yourself
    sed -i -E 's|("timestamp": [0-9]+)\.|\1|' /PATH_TO_ENVIRONMENT/conda-meta/*.json

### To fix on Windows:

Open notepad, and copy the contents below to `c:\fix_timestamps.py`

```python
PATH_TO_ENVIRONMENT="c:\\ProgramData\\Anaconda3"  # <-- fill this in yourself
                                                  # backslashes must be doubled

from glob import glob
import json
import os
for path in glob(os.path.join(PATH_TO_ENVIRONMENT, 'conda-meta', '*.json')):
    with open(path) as fh:
        content = json.load(fh)
    if 'timestamp' in content:
        old_timestamp = content['timestamp']
        content['timestamp'] = int(old_timestamp)
        if old_timestamp != content['timestamp']:
            with open(path, 'w') as fh:
               fh.write(json.dumps(content, indent=2, sort_keys=True, separators=(',', ': ')))
```

Also, change the path in the variable `PATH_TO_ENVIRONMENT` to point to the conda environment you want to fix.  Then run the script with `python c:\fix_timestamps.py`.

----

EDITED: I realized this is not a pyqt issue, it's a conda issue

### steps to reproduce

1. Install 64-bit miniconda on windows 10 (version 4.3.27)  
2. conda update to `4.3.28-py36h9daa44c_0`  
3. conda install -c anaconda spyder  
4. conda config --add channels conda-forge  

Now any calls to conda results in the print-out below.

### conda info

This prints any time I try to use a conda command.

```conda install -c dsdale24 pyqt5
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



Current conda install:

               platform : win-64
          conda version : 4.3.27
       conda is private : False
      conda-env version : 4.3.27
    conda-build version : not installed
         python version : 3.6.2.final.0
       requests version : 2.18.4
       root environment : C:\Users\jrinker\Miniconda3  (writable)
    default environment : C:\Users\jrinker\Miniconda3
       envs directories : C:\Users\jrinker\Miniconda3\envs
                          C:\Users\jrinker\AppData\Local\conda\conda\envs
                          C:\Users\jrinker\.conda\envs
          package cache : C:\Users\jrinker\Miniconda3\pkgs
                          C:\Users\jrinker\AppData\Local\conda\conda\pkgs
           channel URLs : https://conda.anaconda.org/dsdale24/win-64
                          https://conda.anaconda.org/dsdale24/noarch
                          https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.continuum.io/pkgs/main/win-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/win-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/win-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/win-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-64
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : C:\Users\jrinker\.condarc
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.27 requests/2.18.4 CPython/3.6.2 Windows/10 Windows/10.0.15063
          administrator : False

`$ C:\Users\jrinker\Miniconda3\Scripts\conda install -c dsdale24 pyqt5`




    Traceback (most recent call last):
      File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\exceptions.py", line 640, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\cli\main.py", line 140, in _main
        exit_code = args.func(args, p)
      File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\cli\main_install.py", line 80, in execute
        install(args, parser, 'install')
      File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\cli\install.py", line 160, in install
        linked_dists = install_linked(prefix)
      File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\core\linked_data.py", line 123, in linked
        return set(linked_data(prefix, ignore_channels=ignore_channels).keys())
      File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\core\linked_data.py", line 115, in linked_data
        load_linked_data(prefix, dist_name, ignore_channels=ignore_channels)
      File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\core\linked_data.py", line 68, in load_linked_data
        linked_data_[prefix][dist] = rec = IndexRecord(**rec)
      File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 702, in __call__
        instance = super(EntityType, cls).__call__(*args, **kwargs)
      File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 719, in __init__
        setattr(self, key, kwargs[key])
      File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 424, in __set__
        instance.__dict__[self.name] = self.validate(instance, self.box(instance, val))
      File "C:\Users\jrinker\Miniconda3\lib\site-packages\conda\_vendor\auxlib\entity.py", line 465, in validate
        raise ValidationError(getattr(self, 'name', 'undefined name'), val)
    conda._vendor.auxlib.exceptions.ValidationError: Invalid value 1505856869.685 for timestamp
```  

### things I've tried

- Removing conda forge from channels
- `conda update conda` (still prints out error)

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `conda/models/index_record.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 from __future__ import absolute_import, division, print_function, unicode_literals
3 
4 from functools import total_ordering
5 
6 from .enums import LinkType, NoarchType, Platform
7 from .._vendor.auxlib.entity import (BooleanField, ComposableField, DictSafeMixin, Entity,
8                                      EnumField, Field, IntegerField, ListField, MapField,
9                                      StringField, NumberField)
10 from ..common.compat import string_types
11 
12 
13 @total_ordering
14 class Priority(object):
15 
16     def __init__(self, priority):
17         self._priority = priority
18 
19     def __int__(self):
20         return self._priority
21 
22     def __lt__(self, other):
23         return self._priority < int(other)
24 
25     def __eq__(self, other):
26         return self._priority == int(other)
27 
28     def __repr__(self):
29         return "Priority(%d)" % self._priority
30 
31 
32 class PriorityField(Field):
33     _type = (int, Priority)
34 
35     def unbox(self, instance, instance_type, val):
36         return int(val)
37 
38 
39 class LinkTypeField(EnumField):
40     def box(self, instance, val):
41         if isinstance(val, string_types):
42             val = val.replace('-', '').replace('_', '').lower()
43             if val == 'hard':
44                 val = LinkType.hardlink
45             elif val == 'soft':
46                 val = LinkType.softlink
47         return super(LinkTypeField, self).box(instance, val)
48 
49 
50 class NoarchField(EnumField):
51     def box(self, instance, val):
52         return super(NoarchField, self).box(instance, NoarchType.coerce(val))
53 
54 
55 class TimestampField(NumberField):
56 
57     def box(self, instance, val):
58         val = super(TimestampField, self).box(instance, val)
59         if val and val > 253402300799:  # 9999-12-31
60             val /= 1000  # convert milliseconds to seconds; see conda/conda-build#1988
61         return val
62 
63 
64 class Link(DictSafeMixin, Entity):
65     source = StringField()
66     type = LinkTypeField(LinkType, required=False)
67 
68 
69 EMPTY_LINK = Link(source='')
70 
71 # TODO: eventually stop mixing Record with LinkedPackageData
72 # class LinkedPackageRecord(DictSafeMixin, Entity):
73 #     arch = EnumField(Arch, nullable=True)
74 #     build = StringField()
75 #     build_number = IntegerField()
76 #     channel = StringField(required=False)
77 #     date = StringField(required=False)
78 #     depends = ListField(string_types)
79 #     files = ListField(string_types, required=False)
80 #     license = StringField(required=False)
81 #     link = ComposableField(Link, required=False)
82 #     md5 = StringField(required=False, nullable=True)
83 #     name = StringField()
84 #     platform = EnumField(Platform)
85 #     requires = ListField(string_types, required=False)
86 #     size = IntegerField(required=False)
87 #     subdir = StringField(required=False)
88 #     url = StringField(required=False)
89 #     version = StringField()
90 
91 
92 class IndexRecord(DictSafeMixin, Entity):
93     _lazy_validate = True
94 
95     arch = StringField(required=False, nullable=True)
96     build = StringField()
97     build_number = IntegerField()
98     date = StringField(required=False)
99     depends = ListField(string_types, required=False)
100     features = StringField(required=False)
101     has_prefix = BooleanField(required=False)
102     license = StringField(required=False)
103     license_family = StringField(required=False)
104     md5 = StringField(required=False, nullable=True)
105     name = StringField()
106     noarch = NoarchField(NoarchType, required=False, nullable=True)
107     platform = EnumField(Platform, required=False, nullable=True)
108     requires = ListField(string_types, required=False)
109     size = IntegerField(required=False)
110     subdir = StringField(required=False)
111     timestamp = TimestampField(required=False)
112     track_features = StringField(required=False)
113     version = StringField()
114 
115     fn = StringField(required=False, nullable=True)
116     schannel = StringField(required=False, nullable=True)
117     channel = StringField(required=False, nullable=True)
118     priority = PriorityField(required=False)
119     url = StringField(required=False, nullable=True)
120     auth = StringField(required=False, nullable=True)
121 
122     files = ListField(string_types, default=(), required=False)
123     link = ComposableField(Link, required=False)
124 
125     with_features_depends = MapField(required=False)
126     preferred_env = StringField(default=None, required=False, nullable=True)
127
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/conda/models/index_record.py b/conda/models/index_record.py
--- a/conda/models/index_record.py
+++ b/conda/models/index_record.py
@@ -54,12 +54,33 @@
 
 class TimestampField(NumberField):
 
-    def box(self, instance, val):
-        val = super(TimestampField, self).box(instance, val)
-        if val and val > 253402300799:  # 9999-12-31
-            val /= 1000  # convert milliseconds to seconds; see conda/conda-build#1988
+    # @staticmethod
+    # def _make_seconds(val):
+    #     if val:
+    #         val = int(val)
+    #         if val > 253402300799:  # 9999-12-31
+    #             val //= 1000  # convert milliseconds to seconds; see conda/conda-build#1988
+    #     return val
+
+    @staticmethod
+    def _make_milliseconds(val):
+        if val:
+            if val < 253402300799:  # 9999-12-31
+                val *= 1000  # convert seconds to milliseconds
+            val = int(val)
         return val
 
+    def box(self, instance, val):
+        return self._make_milliseconds(super(TimestampField, self).box(instance, val))
+
+    def unbox(self, instance, instance_type, val):
+        return self._make_milliseconds(
+            super(TimestampField, self).unbox(instance, instance_type, val)
+        )
+
+    def dump(self, val):
+        return self._make_milliseconds(super(TimestampField, self).dump(val))
+
 
 class Link(DictSafeMixin, Entity):
     source = StringField()

{"golden_diff": "diff --git a/conda/models/index_record.py b/conda/models/index_record.py\n--- a/conda/models/index_record.py\n+++ b/conda/models/index_record.py\n@@ -54,12 +54,33 @@\n \n class TimestampField(NumberField):\n \n-    def box(self, instance, val):\n-        val = super(TimestampField, self).box(instance, val)\n-        if val and val > 253402300799:  # 9999-12-31\n-            val /= 1000  # convert milliseconds to seconds; see conda/conda-build#1988\n+    # @staticmethod\n+    # def _make_seconds(val):\n+    #     if val:\n+    #         val = int(val)\n+    #         if val > 253402300799:  # 9999-12-31\n+    #             val //= 1000  # convert milliseconds to seconds; see conda/conda-build#1988\n+    #     return val\n+\n+    @staticmethod\n+    def _make_milliseconds(val):\n+        if val:\n+            if val < 253402300799:  # 9999-12-31\n+                val *= 1000  # convert seconds to milliseconds\n+            val = int(val)\n         return val\n \n+    def box(self, instance, val):\n+        return self._make_milliseconds(super(TimestampField, self).box(instance, val))\n+\n+    def unbox(self, instance, instance_type, val):\n+        return self._make_milliseconds(\n+            super(TimestampField, self).unbox(instance, instance_type, val)\n+        )\n+\n+    def dump(self, val):\n+        return self._make_milliseconds(super(TimestampField, self).dump(val))\n+\n \n class Link(DictSafeMixin, Entity):\n     source = StringField()\n", "issue": "ValidationError: invalid value for timestamp\nMODERATOR EDIT:  This issue relates to an error that looks something like\r\n\r\n    ValidationError: Invalid value 1505856869.685 for timestamp\r\n\r\nThe issue relates to using conda 4.3.28, and then downgrading (presumably via conda-forge) to a previous version of conda, like 4.3.27.\r\n\r\n# SOLUTION #\r\n\r\n### To fix on macOS:\r\n\r\n    # in the command below, set PATH_TO_ENVIRONMENT yourself\r\n    sed -i '' -E 's|(\"timestamp\": [0-9]+)\\.|\\1|' /PATH_TO_ENVIRONMENT/conda-meta/*.json\r\n\r\n### To fix on Linux:\r\n\r\n    # in the command below, set PATH_TO_ENVIRONMENT yourself\r\n    sed -i -E 's|(\"timestamp\": [0-9]+)\\.|\\1|' /PATH_TO_ENVIRONMENT/conda-meta/*.json\r\n\r\n### To fix on Windows:\r\n\r\nOpen notepad, and copy the contents below to `c:\\fix_timestamps.py`\r\n\r\n```python\r\nPATH_TO_ENVIRONMENT=\"c:\\\\ProgramData\\\\Anaconda3\"  # <-- fill this in yourself\r\n                                                  # backslashes must be doubled\r\n\r\nfrom glob import glob\r\nimport json\r\nimport os\r\nfor path in glob(os.path.join(PATH_TO_ENVIRONMENT, 'conda-meta', '*.json')):\r\n    with open(path) as fh:\r\n        content = json.load(fh)\r\n    if 'timestamp' in content:\r\n        old_timestamp = content['timestamp']\r\n        content['timestamp'] = int(old_timestamp)\r\n        if old_timestamp != content['timestamp']:\r\n            with open(path, 'w') as fh:\r\n               fh.write(json.dumps(content, indent=2, sort_keys=True, separators=(',', ': ')))\r\n```\r\n\r\nAlso, change the path in the variable `PATH_TO_ENVIRONMENT` to point to the conda environment you want to fix.  Then run the script with `python c:\\fix_timestamps.py`.\r\n\r\n----\r\n\r\nEDITED: I realized this is not a pyqt issue, it's a conda issue\r\n\r\n### steps to reproduce\r\n\r\n1. Install 64-bit miniconda on windows 10 (version 4.3.27)  \r\n2. conda update to `4.3.28-py36h9daa44c_0`  \r\n3. conda install -c anaconda spyder  \r\n4. conda config --add channels conda-forge  \r\n\r\nNow any calls to conda results in the print-out below.\r\n\r\n### conda info\r\n\r\nThis prints any time I try to use a conda command.\r\n\r\n```conda install -c dsdale24 pyqt5\r\nAn unexpected error has occurred.\r\nPlease consider posting the following information to the\r\nconda GitHub issue tracker at:\r\n\r\n    https://github.com/conda/conda/issues\r\n\r\n\r\n\r\nCurrent conda install:\r\n\r\n               platform : win-64\r\n          conda version : 4.3.27\r\n       conda is private : False\r\n      conda-env version : 4.3.27\r\n    conda-build version : not installed\r\n         python version : 3.6.2.final.0\r\n       requests version : 2.18.4\r\n       root environment : C:\\Users\\jrinker\\Miniconda3  (writable)\r\n    default environment : C:\\Users\\jrinker\\Miniconda3\r\n       envs directories : C:\\Users\\jrinker\\Miniconda3\\envs\r\n                          C:\\Users\\jrinker\\AppData\\Local\\conda\\conda\\envs\r\n                          C:\\Users\\jrinker\\.conda\\envs\r\n          package cache : C:\\Users\\jrinker\\Miniconda3\\pkgs\r\n                          C:\\Users\\jrinker\\AppData\\Local\\conda\\conda\\pkgs\r\n           channel URLs : https://conda.anaconda.org/dsdale24/win-64\r\n                          https://conda.anaconda.org/dsdale24/noarch\r\n                          https://conda.anaconda.org/conda-forge/win-64\r\n                          https://conda.anaconda.org/conda-forge/noarch\r\n                          https://repo.continuum.io/pkgs/main/win-64\r\n                          https://repo.continuum.io/pkgs/main/noarch\r\n                          https://repo.continuum.io/pkgs/free/win-64\r\n                          https://repo.continuum.io/pkgs/free/noarch\r\n                          https://repo.continuum.io/pkgs/r/win-64\r\n                          https://repo.continuum.io/pkgs/r/noarch\r\n                          https://repo.continuum.io/pkgs/pro/win-64\r\n                          https://repo.continuum.io/pkgs/pro/noarch\r\n                          https://repo.continuum.io/pkgs/msys2/win-64\r\n                          https://repo.continuum.io/pkgs/msys2/noarch\r\n            config file : C:\\Users\\jrinker\\.condarc\r\n             netrc file : None\r\n           offline mode : False\r\n             user-agent : conda/4.3.27 requests/2.18.4 CPython/3.6.2 Windows/10 Windows/10.0.15063\r\n          administrator : False\r\n\r\n`$ C:\\Users\\jrinker\\Miniconda3\\Scripts\\conda install -c dsdale24 pyqt5`\r\n\r\n\r\n\r\n\r\n    Traceback (most recent call last):\r\n      File \"C:\\Users\\jrinker\\Miniconda3\\lib\\site-packages\\conda\\exceptions.py\", line 640, in conda_exception_handler\r\n        return_value = func(*args, **kwargs)\r\n      File \"C:\\Users\\jrinker\\Miniconda3\\lib\\site-packages\\conda\\cli\\main.py\", line 140, in _main\r\n        exit_code = args.func(args, p)\r\n      File \"C:\\Users\\jrinker\\Miniconda3\\lib\\site-packages\\conda\\cli\\main_install.py\", line 80, in execute\r\n        install(args, parser, 'install')\r\n      File \"C:\\Users\\jrinker\\Miniconda3\\lib\\site-packages\\conda\\cli\\install.py\", line 160, in install\r\n        linked_dists = install_linked(prefix)\r\n      File \"C:\\Users\\jrinker\\Miniconda3\\lib\\site-packages\\conda\\core\\linked_data.py\", line 123, in linked\r\n        return set(linked_data(prefix, ignore_channels=ignore_channels).keys())\r\n      File \"C:\\Users\\jrinker\\Miniconda3\\lib\\site-packages\\conda\\core\\linked_data.py\", line 115, in linked_data\r\n        load_linked_data(prefix, dist_name, ignore_channels=ignore_channels)\r\n      File \"C:\\Users\\jrinker\\Miniconda3\\lib\\site-packages\\conda\\core\\linked_data.py\", line 68, in load_linked_data\r\n        linked_data_[prefix][dist] = rec = IndexRecord(**rec)\r\n      File \"C:\\Users\\jrinker\\Miniconda3\\lib\\site-packages\\conda\\_vendor\\auxlib\\entity.py\", line 702, in __call__\r\n        instance = super(EntityType, cls).__call__(*args, **kwargs)\r\n      File \"C:\\Users\\jrinker\\Miniconda3\\lib\\site-packages\\conda\\_vendor\\auxlib\\entity.py\", line 719, in __init__\r\n        setattr(self, key, kwargs[key])\r\n      File \"C:\\Users\\jrinker\\Miniconda3\\lib\\site-packages\\conda\\_vendor\\auxlib\\entity.py\", line 424, in __set__\r\n        instance.__dict__[self.name] = self.validate(instance, self.box(instance, val))\r\n      File \"C:\\Users\\jrinker\\Miniconda3\\lib\\site-packages\\conda\\_vendor\\auxlib\\entity.py\", line 465, in validate\r\n        raise ValidationError(getattr(self, 'name', 'undefined name'), val)\r\n    conda._vendor.auxlib.exceptions.ValidationError: Invalid value 1505856869.685 for timestamp\r\n```  \r\n\r\n### things I've tried\r\n\r\n- Removing conda forge from channels\r\n- `conda update conda` (still prints out error)\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom functools import total_ordering\n\nfrom .enums import LinkType, NoarchType, Platform\nfrom .._vendor.auxlib.entity import (BooleanField, ComposableField, DictSafeMixin, Entity,\n                                     EnumField, Field, IntegerField, ListField, MapField,\n                                     StringField, NumberField)\nfrom ..common.compat import string_types\n\n\n@total_ordering\nclass Priority(object):\n\n    def __init__(self, priority):\n        self._priority = priority\n\n    def __int__(self):\n        return self._priority\n\n    def __lt__(self, other):\n        return self._priority < int(other)\n\n    def __eq__(self, other):\n        return self._priority == int(other)\n\n    def __repr__(self):\n        return \"Priority(%d)\" % self._priority\n\n\nclass PriorityField(Field):\n    _type = (int, Priority)\n\n    def unbox(self, instance, instance_type, val):\n        return int(val)\n\n\nclass LinkTypeField(EnumField):\n    def box(self, instance, val):\n        if isinstance(val, string_types):\n            val = val.replace('-', '').replace('_', '').lower()\n            if val == 'hard':\n                val = LinkType.hardlink\n            elif val == 'soft':\n                val = LinkType.softlink\n        return super(LinkTypeField, self).box(instance, val)\n\n\nclass NoarchField(EnumField):\n    def box(self, instance, val):\n        return super(NoarchField, self).box(instance, NoarchType.coerce(val))\n\n\nclass TimestampField(NumberField):\n\n    def box(self, instance, val):\n        val = super(TimestampField, self).box(instance, val)\n        if val and val > 253402300799:  # 9999-12-31\n            val /= 1000  # convert milliseconds to seconds; see conda/conda-build#1988\n        return val\n\n\nclass Link(DictSafeMixin, Entity):\n    source = StringField()\n    type = LinkTypeField(LinkType, required=False)\n\n\nEMPTY_LINK = Link(source='')\n\n# TODO: eventually stop mixing Record with LinkedPackageData\n# class LinkedPackageRecord(DictSafeMixin, Entity):\n#     arch = EnumField(Arch, nullable=True)\n#     build = StringField()\n#     build_number = IntegerField()\n#     channel = StringField(required=False)\n#     date = StringField(required=False)\n#     depends = ListField(string_types)\n#     files = ListField(string_types, required=False)\n#     license = StringField(required=False)\n#     link = ComposableField(Link, required=False)\n#     md5 = StringField(required=False, nullable=True)\n#     name = StringField()\n#     platform = EnumField(Platform)\n#     requires = ListField(string_types, required=False)\n#     size = IntegerField(required=False)\n#     subdir = StringField(required=False)\n#     url = StringField(required=False)\n#     version = StringField()\n\n\nclass IndexRecord(DictSafeMixin, Entity):\n    _lazy_validate = True\n\n    arch = StringField(required=False, nullable=True)\n    build = StringField()\n    build_number = IntegerField()\n    date = StringField(required=False)\n    depends = ListField(string_types, required=False)\n    features = StringField(required=False)\n    has_prefix = BooleanField(required=False)\n    license = StringField(required=False)\n    license_family = StringField(required=False)\n    md5 = StringField(required=False, nullable=True)\n    name = StringField()\n    noarch = NoarchField(NoarchType, required=False, nullable=True)\n    platform = EnumField(Platform, required=False, nullable=True)\n    requires = ListField(string_types, required=False)\n    size = IntegerField(required=False)\n    subdir = StringField(required=False)\n    timestamp = TimestampField(required=False)\n    track_features = StringField(required=False)\n    version = StringField()\n\n    fn = StringField(required=False, nullable=True)\n    schannel = StringField(required=False, nullable=True)\n    channel = StringField(required=False, nullable=True)\n    priority = PriorityField(required=False)\n    url = StringField(required=False, nullable=True)\n    auth = StringField(required=False, nullable=True)\n\n    files = ListField(string_types, default=(), required=False)\n    link = ComposableField(Link, required=False)\n\n    with_features_depends = MapField(required=False)\n    preferred_env = StringField(default=None, required=False, nullable=True)\n", "path": "conda/models/index_record.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom functools import total_ordering\n\nfrom .enums import LinkType, NoarchType, Platform\nfrom .._vendor.auxlib.entity import (BooleanField, ComposableField, DictSafeMixin, Entity,\n                                     EnumField, Field, IntegerField, ListField, MapField,\n                                     StringField, NumberField)\nfrom ..common.compat import string_types\n\n\n@total_ordering\nclass Priority(object):\n\n    def __init__(self, priority):\n        self._priority = priority\n\n    def __int__(self):\n        return self._priority\n\n    def __lt__(self, other):\n        return self._priority < int(other)\n\n    def __eq__(self, other):\n        return self._priority == int(other)\n\n    def __repr__(self):\n        return \"Priority(%d)\" % self._priority\n\n\nclass PriorityField(Field):\n    _type = (int, Priority)\n\n    def unbox(self, instance, instance_type, val):\n        return int(val)\n\n\nclass LinkTypeField(EnumField):\n    def box(self, instance, val):\n        if isinstance(val, string_types):\n            val = val.replace('-', '').replace('_', '').lower()\n            if val == 'hard':\n                val = LinkType.hardlink\n            elif val == 'soft':\n                val = LinkType.softlink\n        return super(LinkTypeField, self).box(instance, val)\n\n\nclass NoarchField(EnumField):\n    def box(self, instance, val):\n        return super(NoarchField, self).box(instance, NoarchType.coerce(val))\n\n\nclass TimestampField(NumberField):\n\n    # @staticmethod\n    # def _make_seconds(val):\n    #     if val:\n    #         val = int(val)\n    #         if val > 253402300799:  # 9999-12-31\n    #             val //= 1000  # convert milliseconds to seconds; see conda/conda-build#1988\n    #     return val\n\n    @staticmethod\n    def _make_milliseconds(val):\n        if val:\n            if val < 253402300799:  # 9999-12-31\n                val *= 1000  # convert seconds to milliseconds\n            val = int(val)\n        return val\n\n    def box(self, instance, val):\n        return self._make_milliseconds(super(TimestampField, self).box(instance, val))\n\n    def unbox(self, instance, instance_type, val):\n        return self._make_milliseconds(\n            super(TimestampField, self).unbox(instance, instance_type, val)\n        )\n\n    def dump(self, val):\n        return self._make_milliseconds(super(TimestampField, self).dump(val))\n\n\nclass Link(DictSafeMixin, Entity):\n    source = StringField()\n    type = LinkTypeField(LinkType, required=False)\n\n\nEMPTY_LINK = Link(source='')\n\n# TODO: eventually stop mixing Record with LinkedPackageData\n# class LinkedPackageRecord(DictSafeMixin, Entity):\n#     arch = EnumField(Arch, nullable=True)\n#     build = StringField()\n#     build_number = IntegerField()\n#     channel = StringField(required=False)\n#     date = StringField(required=False)\n#     depends = ListField(string_types)\n#     files = ListField(string_types, required=False)\n#     license = StringField(required=False)\n#     link = ComposableField(Link, required=False)\n#     md5 = StringField(required=False, nullable=True)\n#     name = StringField()\n#     platform = EnumField(Platform)\n#     requires = ListField(string_types, required=False)\n#     size = IntegerField(required=False)\n#     subdir = StringField(required=False)\n#     url = StringField(required=False)\n#     version = StringField()\n\n\nclass IndexRecord(DictSafeMixin, Entity):\n    _lazy_validate = True\n\n    arch = StringField(required=False, nullable=True)\n    build = StringField()\n    build_number = IntegerField()\n    date = StringField(required=False)\n    depends = ListField(string_types, required=False)\n    features = StringField(required=False)\n    has_prefix = BooleanField(required=False)\n    license = StringField(required=False)\n    license_family = StringField(required=False)\n    md5 = StringField(required=False, nullable=True)\n    name = StringField()\n    noarch = NoarchField(NoarchType, required=False, nullable=True)\n    platform = EnumField(Platform, required=False, nullable=True)\n    requires = ListField(string_types, required=False)\n    size = IntegerField(required=False)\n    subdir = StringField(required=False)\n    timestamp = TimestampField(required=False)\n    track_features = StringField(required=False)\n    version = StringField()\n\n    fn = StringField(required=False, nullable=True)\n    schannel = StringField(required=False, nullable=True)\n    channel = StringField(required=False, nullable=True)\n    priority = PriorityField(required=False)\n    url = StringField(required=False, nullable=True)\n    auth = StringField(required=False, nullable=True)\n\n    files = ListField(string_types, default=(), required=False)\n    link = ComposableField(Link, required=False)\n\n    with_features_depends = MapField(required=False)\n    preferred_env = StringField(default=None, required=False, nullable=True)\n", "path": "conda/models/index_record.py"}]}