We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Security Group filter "default-vpc" does not function correctly.
Using the following policy:

```
policies:
  - name: default-sg-allows-all-traffic
    description: |
      Find whether the default security group allows all traffic.
    resource: security-group
    filters:
       - type: default-vpc
```

Comes up with no results, even when I have confirmed that my account has a default vpc and a default security group associated with it.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `c7n/filters/vpc.py`
Content:
```
1 # Copyright 2016 Capital One Services, LLC
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 from c7n.utils import local_session, type_schema
16 
17 from .core import Filter, ValueFilter
18 from .related import RelatedResourceFilter
19 
20 
21 class SecurityGroupFilter(RelatedResourceFilter):
22 
23     schema = type_schema(
24         'security-group', rinherit=ValueFilter.schema,
25         match_resource={'type': 'boolean'},
26         operator={'enum': ['and', 'or']})
27 
28     RelatedResource = "c7n.resources.vpc.SecurityGroup"
29     AnnotationKey = "matched-security-groups"
30 
31 
32 class SubnetFilter(RelatedResourceFilter):
33 
34     schema = type_schema(
35         'subnet', rinherit=ValueFilter.schema,
36         match_resource={'type': 'boolean'},
37         operator={'enum': ['and', 'or']})
38 
39     RelatedResource = "c7n.resources.vpc.Subnet"
40     AnnotationKey = "matched-subnets"    
41 
42 
43 class DefaultVpcBase(Filter):
44 
45     vpcs = None
46     default_vpc = None
47 
48     def match(self, vpc_id):
49         if self.default_vpc is None:
50             self.log.debug("querying default vpc %s" % vpc_id)
51             client = local_session(self.manager.session_factory).client('ec2')
52             vpcs = [v['VpcId'] for v
53                     in client.describe_vpcs(VpcIds=[vpc_id])['Vpcs']
54                     if v['IsDefault']]
55             if not vpcs:
56                 self.default_vpc = ""
57             else:
58                 self.default_vpc = vpcs.pop()
59         return vpc_id == self.default_vpc and True or False
60
```
--- 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/c7n/filters/vpc.py b/c7n/filters/vpc.py
--- a/c7n/filters/vpc.py
+++ b/c7n/filters/vpc.py
@@ -52,8 +52,6 @@
             vpcs = [v['VpcId'] for v
                     in client.describe_vpcs(VpcIds=[vpc_id])['Vpcs']
                     if v['IsDefault']]
-            if not vpcs:
-                self.default_vpc = ""
-            else:
+            if vpcs:
                 self.default_vpc = vpcs.pop()
         return vpc_id == self.default_vpc and True or False

{"golden_diff": "diff --git a/c7n/filters/vpc.py b/c7n/filters/vpc.py\n--- a/c7n/filters/vpc.py\n+++ b/c7n/filters/vpc.py\n@@ -52,8 +52,6 @@\n             vpcs = [v['VpcId'] for v\n                     in client.describe_vpcs(VpcIds=[vpc_id])['Vpcs']\n                     if v['IsDefault']]\n-            if not vpcs:\n-                self.default_vpc = \"\"\n-            else:\n+            if vpcs:\n                 self.default_vpc = vpcs.pop()\n         return vpc_id == self.default_vpc and True or False\n", "issue": "Security Group filter \"default-vpc\" does not function correctly.\nUsing the following policy:\n\n```\npolicies:\n  - name: default-sg-allows-all-traffic\n    description: |\n      Find whether the default security group allows all traffic.\n    resource: security-group\n    filters:\n       - type: default-vpc\n```\n\nComes up with no results, even when I have confirmed that my account has a default vpc and a default security group associated with it.\n\n", "before_files": [{"content": "# Copyright 2016 Capital One Services, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom c7n.utils import local_session, type_schema\n\nfrom .core import Filter, ValueFilter\nfrom .related import RelatedResourceFilter\n\n\nclass SecurityGroupFilter(RelatedResourceFilter):\n\n    schema = type_schema(\n        'security-group', rinherit=ValueFilter.schema,\n        match_resource={'type': 'boolean'},\n        operator={'enum': ['and', 'or']})\n\n    RelatedResource = \"c7n.resources.vpc.SecurityGroup\"\n    AnnotationKey = \"matched-security-groups\"\n\n\nclass SubnetFilter(RelatedResourceFilter):\n\n    schema = type_schema(\n        'subnet', rinherit=ValueFilter.schema,\n        match_resource={'type': 'boolean'},\n        operator={'enum': ['and', 'or']})\n\n    RelatedResource = \"c7n.resources.vpc.Subnet\"\n    AnnotationKey = \"matched-subnets\"    \n\n\nclass DefaultVpcBase(Filter):\n\n    vpcs = None\n    default_vpc = None\n\n    def match(self, vpc_id):\n        if self.default_vpc is None:\n            self.log.debug(\"querying default vpc %s\" % vpc_id)\n            client = local_session(self.manager.session_factory).client('ec2')\n            vpcs = [v['VpcId'] for v\n                    in client.describe_vpcs(VpcIds=[vpc_id])['Vpcs']\n                    if v['IsDefault']]\n            if not vpcs:\n                self.default_vpc = \"\"\n            else:\n                self.default_vpc = vpcs.pop()\n        return vpc_id == self.default_vpc and True or False\n", "path": "c7n/filters/vpc.py"}], "after_files": [{"content": "# Copyright 2016 Capital One Services, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom c7n.utils import local_session, type_schema\n\nfrom .core import Filter, ValueFilter\nfrom .related import RelatedResourceFilter\n\n\nclass SecurityGroupFilter(RelatedResourceFilter):\n\n    schema = type_schema(\n        'security-group', rinherit=ValueFilter.schema,\n        match_resource={'type': 'boolean'},\n        operator={'enum': ['and', 'or']})\n\n    RelatedResource = \"c7n.resources.vpc.SecurityGroup\"\n    AnnotationKey = \"matched-security-groups\"\n\n\nclass SubnetFilter(RelatedResourceFilter):\n\n    schema = type_schema(\n        'subnet', rinherit=ValueFilter.schema,\n        match_resource={'type': 'boolean'},\n        operator={'enum': ['and', 'or']})\n\n    RelatedResource = \"c7n.resources.vpc.Subnet\"\n    AnnotationKey = \"matched-subnets\"    \n\n\nclass DefaultVpcBase(Filter):\n\n    vpcs = None\n    default_vpc = None\n\n    def match(self, vpc_id):\n        if self.default_vpc is None:\n            self.log.debug(\"querying default vpc %s\" % vpc_id)\n            client = local_session(self.manager.session_factory).client('ec2')\n            vpcs = [v['VpcId'] for v\n                    in client.describe_vpcs(VpcIds=[vpc_id])['Vpcs']\n                    if v['IsDefault']]\n            if vpcs:\n                self.default_vpc = vpcs.pop()\n        return vpc_id == self.default_vpc and True or False\n", "path": "c7n/filters/vpc.py"}]}