From 61d60c4780454e32047f02b0b779f2ac48b34a97 Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Thu, 20 Jun 2019 09:16:00 -0700 Subject: [PATCH 01/60] Persistent analysis, part I (#1224) * Remove old qualified name * Node storage * Class and scope to use AST map * Library analysis * Fix SO * Keep small AST with imports * AST reduction * Final field * Initial * Reload * Ignore post-final requests * Drop AST * Remove local variables * Test fixes * Fix overload match * Tests * Add locks * Remove local variables * Drop file content to save memory * Cache PEP hints * Recreate AST * Fix specialization * Fix locations * usings * Test fixes * Add options to keep data in memory * Fix test * Fix lambda parameters * Fix argument set Fix global scope node * Fix overload doc * Fix stub merge errors * Fix async issues * Undo some changes * Fix test * Fix race condition * Partial * Models and views * Restore log null checks * Fix merge conflict * Fix merge issue * Null check * Partial * Partial * Partial * Fix test * Partial * Partial * First test * Baseline comparison * Builtins * Partial * Type fixes * Fix type names, part I * Qualified name * Properly write variables * Partial * Construct module from model * Test * Variable creations * Factories * Factories * Split construction * Restore * Save builtins * Test passes * Qualified name * Better export detection * Test fixes * More consistent qualified names * Sys test * Demo * Complete sys write/read * Partial * Partial * Test staility * Perf bug * Baseline, remove debug code, deactivate db * Test fixes * Test fix * Simplify a bit * Baselines and use : separator * Baselines * PR feedback * Merge master * Remove registry reference * PR feedback --- .../Evaluation/ExpressionEval.Callables.cs | 1 - .../Evaluation/ExpressionEval.Collections.cs | 14 +- .../Evaluation/ExpressionEval.Operators.cs | 4 +- .../Analyzer/Evaluation/ExpressionEval.cs | 1 + .../Impl/Analyzer/Handlers/ImportHandler.cs | 2 +- .../Ast/Impl/Analyzer/ModuleWalker.cs | 12 +- .../Ast/Impl/Analyzer/PythonAnalyzer.cs | 4 +- .../Impl/Analyzer/PythonAnalyzerSession.cs | 1 + .../Analyzer/Symbols/FunctionEvaluator.cs | 1 - src/Analysis/Ast/Impl/Caching/CacheFolders.cs | 38 +- .../Definitions/ICacheFolderService.cs | 21 + .../Definitions/IModuleDatabaseService.cs | 37 + .../Caching/Definitions/ModuleStorageState.cs | 42 + src/Analysis/Ast/Impl/Caching/StubCache.cs | 9 +- .../Impl/Extensions/ArgumentSetExtensions.cs | 3 +- .../Extensions/PythonFunctionExtensions.cs | 12 +- .../Impl/Extensions/PythonTypeExtensions.cs | 8 +- .../Ast/Impl/Modules/CompiledPythonModule.cs | 2 +- .../Modules/Definitions/IModuleManagement.cs | 1 + .../Impl/Modules/Definitions/ModuleType.cs | 3 - .../Ast/Impl/Modules/PythonModule.Analysis.cs | 128 + .../Ast/Impl/Modules/PythonModule.Ast.cs | 182 + .../Ast/Impl/Modules/PythonModule.Content.cs | 87 + .../Modules/PythonModule.Documentation.cs | 76 + src/Analysis/Ast/Impl/Modules/PythonModule.cs | 378 +- .../Ast/Impl/Modules/PythonVariableModule.cs | 10 +- .../Resolution/MainModuleResolution.cs | 11 +- .../Resolution/ModuleResolutionBase.cs | 2 +- .../Ast/Impl/Properties/AssemblyInfo.cs | 2 + .../BuiltinsSpecializations.cs | 4 +- .../Specializations/Typing/Types/AnyType.cs | 1 + .../Typing/Types/GenericType.cs | 1 + .../Typing/Types/TypingDictionaryType.cs | 4 +- .../Typing/Types/TypingIteratorType.cs | 4 +- .../Typing/Types/TypingListType.cs | 6 +- .../Typing/Types/TypingTupleType.cs | 2 +- .../Typing/Values/TypingType.cs | 2 + src/Analysis/Ast/Impl/Types/ArgumentSet.cs | 1 - .../Types/Collections/PythonCollectionType.cs | 32 +- .../Types/Collections/PythonDictionaryType.cs | 4 +- .../Types/Collections/PythonIteratorType.cs | 6 +- .../Types/Definitions/IPythonClassMember.cs | 2 +- .../Types/Definitions/IPythonClassType.cs | 2 +- .../Impl/Types/Definitions/IPythonModule.cs | 15 +- .../Types/Definitions/IPythonPropertyType.cs | 5 + .../Ast/Impl/Types/Definitions/IPythonType.cs | 5 + src/Analysis/Ast/Impl/Types/ParameterInfo.cs | 2 +- .../Ast/Impl/Types/PythonClassType.cs | 11 +- .../Ast/Impl/Types/PythonFunctionType.cs | 2 + .../Ast/Impl/Types/PythonPropertyType.cs | 18 +- src/Analysis/Ast/Impl/Types/PythonType.cs | 7 + .../Ast/Impl/Types/PythonTypeWrapper.cs | 2 +- .../Ast/Impl/Types/PythonUnionType.cs | 14 +- .../ReentrancyGuard.cs} | 17 +- .../Values/Collections/PythonCollection.cs | 2 +- .../Values/Collections/PythonDictionary.cs | 16 +- .../Collections/PythonInstanceIterator.cs | 2 +- .../Values/Collections/PythonTypeIterator.cs | 2 +- .../PythonFunctionAssertions.cs | 2 - .../Microsoft.Python.Analysis.Tests.csproj | 4 +- .../Ast/Test/Properties/AssemblyInfo.cs | 18 + .../Core/Impl/Interpreter/LibraryType.cs | 38 + .../Impl/Interpreter/PythonLibraryPath.cs | 70 +- src/Caching/Impl/Factories/ClassFactory.cs | 50 + src/Caching/Impl/Factories/FactoryBase.cs | 66 + src/Caching/Impl/Factories/FunctionFactory.cs | 42 + src/Caching/Impl/Factories/ModuleFactory.cs | 152 + src/Caching/Impl/Factories/PropertyFactory.cs | 37 + src/Caching/Impl/Factories/VariableFactory.cs | 32 + src/Caching/Impl/GlobalScope.cs | 73 + .../Microsoft.Python.Analysis.Caching.csproj | 41 + src/Caching/Impl/Models/ClassModel.cs | 96 + .../Impl/Models/FunctionAttributes.cs} | 18 +- src/Caching/Impl/Models/FunctionModel.cs | 52 + src/Caching/Impl/Models/MemberModel.cs | 21 + src/Caching/Impl/Models/ModuleModel.cs | 80 + src/Caching/Impl/Models/OverloadModel.cs | 21 + src/Caching/Impl/Models/ParameterModel.cs | 25 + src/Caching/Impl/Models/PropertyModel.cs | 35 + src/Caching/Impl/Models/TypeVarModel.cs | 24 + src/Caching/Impl/Models/VariableModel.cs | 44 + src/Caching/Impl/ModuleDatabase.cs | 156 + src/Caching/Impl/ModuleUniqueId.cs | 88 + src/Caching/Impl/Properties/AssemblyInfo.cs | 18 + src/Caching/Impl/PythonDbModule.cs | 35 + src/Caching/Impl/TypeNames.cs | 117 + src/Caching/Test/AnalysisCachingTestBase.cs | 46 + src/Caching/Test/AssemblySetup.cs | 34 + src/Caching/Test/BasicTests.cs | 183 + src/Caching/Test/Files/Builtins.json | 31830 ++++++++++++++++ src/Caching/Test/Files/NestedClasses.json | 247 + src/Caching/Test/Files/Requests.json | 279 + src/Caching/Test/Files/SmokeTest.json | 156 + src/Caching/Test/Files/Sys.json | 6840 ++++ src/Caching/Test/Files/VersionedModule.json | 44 + .../FluentAssertions/AssertionsFactory.cs | 37 + ...osoft.Python.Analysis.Caching.Tests.csproj | 42 + src/Core/Impl/Extensions/StringExtensions.cs | 10 + .../Test/Microsoft.Python.Core.Tests.csproj | 1 - .../Impl/Documentation/DocstringConverter.cs | 2 +- .../Impl/Implementation/Server.cs | 5 + .../Microsoft.Python.LanguageServer.csproj | 1 + src/LanguageServer/Impl/Protocol/Classes.cs | 5 + src/PLS.sln | 18 +- src/Parsing/Impl/Resources.Designer.cs | 2 +- src/UnitTests/Core/Impl/Baseline.cs | 124 + 106 files changed, 42100 insertions(+), 544 deletions(-) create mode 100644 src/Analysis/Ast/Impl/Caching/Definitions/ICacheFolderService.cs create mode 100644 src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs create mode 100644 src/Analysis/Ast/Impl/Caching/Definitions/ModuleStorageState.cs create mode 100644 src/Analysis/Ast/Impl/Modules/PythonModule.Analysis.cs create mode 100644 src/Analysis/Ast/Impl/Modules/PythonModule.Ast.cs create mode 100644 src/Analysis/Ast/Impl/Modules/PythonModule.Content.cs create mode 100644 src/Analysis/Ast/Impl/Modules/PythonModule.Documentation.cs rename src/Analysis/Ast/Impl/{Extensions/QualifiedNameExtensions.cs => Utilities/ReentrancyGuard.cs} (65%) create mode 100644 src/Analysis/Ast/Test/Properties/AssemblyInfo.cs create mode 100644 src/Analysis/Core/Impl/Interpreter/LibraryType.cs create mode 100644 src/Caching/Impl/Factories/ClassFactory.cs create mode 100644 src/Caching/Impl/Factories/FactoryBase.cs create mode 100644 src/Caching/Impl/Factories/FunctionFactory.cs create mode 100644 src/Caching/Impl/Factories/ModuleFactory.cs create mode 100644 src/Caching/Impl/Factories/PropertyFactory.cs create mode 100644 src/Caching/Impl/Factories/VariableFactory.cs create mode 100644 src/Caching/Impl/GlobalScope.cs create mode 100644 src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj create mode 100644 src/Caching/Impl/Models/ClassModel.cs rename src/{Analysis/Ast/Impl/Types/Definitions/IPythonFile.cs => Caching/Impl/Models/FunctionAttributes.cs} (71%) create mode 100644 src/Caching/Impl/Models/FunctionModel.cs create mode 100644 src/Caching/Impl/Models/MemberModel.cs create mode 100644 src/Caching/Impl/Models/ModuleModel.cs create mode 100644 src/Caching/Impl/Models/OverloadModel.cs create mode 100644 src/Caching/Impl/Models/ParameterModel.cs create mode 100644 src/Caching/Impl/Models/PropertyModel.cs create mode 100644 src/Caching/Impl/Models/TypeVarModel.cs create mode 100644 src/Caching/Impl/Models/VariableModel.cs create mode 100644 src/Caching/Impl/ModuleDatabase.cs create mode 100644 src/Caching/Impl/ModuleUniqueId.cs create mode 100644 src/Caching/Impl/Properties/AssemblyInfo.cs create mode 100644 src/Caching/Impl/PythonDbModule.cs create mode 100644 src/Caching/Impl/TypeNames.cs create mode 100644 src/Caching/Test/AnalysisCachingTestBase.cs create mode 100644 src/Caching/Test/AssemblySetup.cs create mode 100644 src/Caching/Test/BasicTests.cs create mode 100644 src/Caching/Test/Files/Builtins.json create mode 100644 src/Caching/Test/Files/NestedClasses.json create mode 100644 src/Caching/Test/Files/Requests.json create mode 100644 src/Caching/Test/Files/SmokeTest.json create mode 100644 src/Caching/Test/Files/Sys.json create mode 100644 src/Caching/Test/Files/VersionedModule.json create mode 100644 src/Caching/Test/FluentAssertions/AssertionsFactory.cs create mode 100644 src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj create mode 100644 src/UnitTests/Core/Impl/Baseline.cs diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Callables.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Callables.cs index 38346a6e0..657ab23d2 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Callables.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Callables.cs @@ -17,7 +17,6 @@ using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Documents; -using Microsoft.Python.Analysis.Extensions; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Collections.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Collections.cs index a7469f05a..267ea35f5 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Collections.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Collections.cs @@ -62,7 +62,7 @@ public IMember GetValueFromList(ListExpression expression) { var value = GetValueFromExpression(item) ?? UnknownType; contents.Add(value); } - return PythonCollectionType.CreateList(Module.Interpreter, contents, exact: expression.Items.Count <= MaxCollectionSize); + return PythonCollectionType.CreateList(Module, contents, exact: expression.Items.Count <= MaxCollectionSize); } public IMember GetValueFromDictionary(DictionaryExpression expression) { @@ -72,7 +72,7 @@ public IMember GetValueFromDictionary(DictionaryExpression expression) { var value = GetValueFromExpression(item.SliceStop) ?? UnknownType; contents[key] = value; } - return new PythonDictionary(Interpreter, contents, exact: expression.Items.Count <= MaxCollectionSize); + return new PythonDictionary(Module, contents, exact: expression.Items.Count <= MaxCollectionSize); } private IMember GetValueFromTuple(TupleExpression expression) { @@ -81,7 +81,7 @@ private IMember GetValueFromTuple(TupleExpression expression) { var value = GetValueFromExpression(item) ?? UnknownType; contents.Add(value); } - return PythonCollectionType.CreateTuple(Module.Interpreter, contents, exact: expression.Items.Count <= MaxCollectionSize); + return PythonCollectionType.CreateTuple(Module, contents, exact: expression.Items.Count <= MaxCollectionSize); } public IMember GetValueFromSet(SetExpression expression) { @@ -90,7 +90,7 @@ public IMember GetValueFromSet(SetExpression expression) { var value = GetValueFromExpression(item) ?? UnknownType; contents.Add(value); } - return PythonCollectionType.CreateSet(Interpreter, contents, exact: expression.Items.Count <= MaxCollectionSize); + return PythonCollectionType.CreateSet(Module, contents, exact: expression.Items.Count <= MaxCollectionSize); } public IMember GetValueFromGenerator(GeneratorExpression expression) { @@ -110,14 +110,14 @@ public IMember GetValueFromComprehension(Comprehension node) { switch (node) { case ListComprehension lc: var v1 = GetValueFromExpression(lc.Item) ?? UnknownType; - return PythonCollectionType.CreateList(Interpreter, new[] { v1 }); + return PythonCollectionType.CreateList(Module, new[] { v1 }); case SetComprehension sc: var v2 = GetValueFromExpression(sc.Item) ?? UnknownType; - return PythonCollectionType.CreateSet(Interpreter, new[] { v2 }); + return PythonCollectionType.CreateSet(Module, new[] { v2 }); case DictionaryComprehension dc: var k = GetValueFromExpression(dc.Key) ?? UnknownType; var v = GetValueFromExpression(dc.Value) ?? UnknownType; - return new PythonDictionary(new PythonDictionaryType(Interpreter), new Dictionary { { k, v } }); + return new PythonDictionary(new PythonDictionaryType(Interpreter.ModuleResolution.BuiltinsModule), new Dictionary { { k, v } }); } return UnknownType; diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Operators.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Operators.cs index b9676e19b..16f89c794 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Operators.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Operators.cs @@ -106,9 +106,9 @@ private IMember GetValueFromBinaryOp(Expression expr) { switch (leftTypeId) { case BuiltinTypeId.List: - return PythonCollectionType.CreateConcatenatedList(Module.Interpreter, lc, rc); + return PythonCollectionType.CreateConcatenatedList(Module, lc, rc); case BuiltinTypeId.Tuple: - return PythonCollectionType.CreateConcatenatedTuple(Module.Interpreter, lc, rc); + return PythonCollectionType.CreateConcatenatedTuple(Module, lc, rc); } } diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs index 392dc1abe..6bf57caf0 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs @@ -59,6 +59,7 @@ public ExpressionEval(IServiceContainer services, IPythonModule module, GlobalSc public ModuleSymbolTable SymbolTable { get; } = new ModuleSymbolTable(); public IPythonType UnknownType => Interpreter.UnknownType; public Location DefaultLocation { get; } + public IPythonModule BuiltinsModule => Interpreter.ModuleResolution.BuiltinsModule; public LocationInfo GetLocationInfo(Node node) => node?.GetLocation(Module) ?? LocationInfo.Empty; diff --git a/src/Analysis/Ast/Impl/Analyzer/Handlers/ImportHandler.cs b/src/Analysis/Ast/Impl/Analyzer/Handlers/ImportHandler.cs index f5fe93800..3562c7f12 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Handlers/ImportHandler.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Handlers/ImportHandler.cs @@ -174,7 +174,7 @@ private PythonVariableModule GetOrCreateVariableModule(in string fullName, in Py return variableModule; } - variableModule = new PythonVariableModule(fullName, Interpreter); + variableModule = new PythonVariableModule(fullName, Eval.Interpreter); _variableModules[fullName] = variableModule; parentModule?.AddChildModule(memberName, variableModule); return variableModule; diff --git a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs index 2463dfc03..427845247 100644 --- a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs +++ b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs @@ -107,7 +107,7 @@ private void HandleAllAppendExtend(CallExpression node) { IPythonCollection values = null; switch (me.Name) { case "append": - values = PythonCollectionType.CreateList(Module.Interpreter, new List { v }, exact: true); + values = PythonCollectionType.CreateList(Module, new List { v }, exact: true); break; case "extend": values = v as IPythonCollection; @@ -129,7 +129,7 @@ private void ExtendAll(Node location, IPythonCollection values) { } var all = scope.Variables[AllVariableName]?.Value as IPythonCollection; - var list = PythonCollectionType.CreateConcatenatedList(Module.Interpreter, all, values); + var list = PythonCollectionType.CreateConcatenatedList(Module, all, values); var source = list.IsGeneric() ? VariableSource.Generic : VariableSource.Declaration; Eval.DeclareVariable(AllVariableName, list, source, location); @@ -228,6 +228,8 @@ private void MergeStub() { return; } + var builtins = Module.Interpreter.ModuleResolution.BuiltinsModule; + // Note that scrape can pick up more functions than the stub contains // Or the stub can have definitions that scraping had missed. Therefore // merge is the combination of the two with the documentation coming @@ -258,6 +260,10 @@ private void MergeStub() { var memberType = member?.GetPythonType(); var stubMemberType = stubMember.GetPythonType(); + + if (builtins.Equals(memberType?.DeclaringModule) || builtins.Equals(stubMemberType.DeclaringModule)) { + continue; // Leave builtins alone. + } if (!IsStubBetterType(memberType, stubMemberType)) { continue; } @@ -271,7 +277,7 @@ private void MergeStub() { // Re-declare variable with the data from the stub unless member is a module. // Modules members that are modules should remain as they are, i.e. os.path // should remain library with its own stub attached. - if (!(stubType is IPythonModule)) { + if (!(stubType is IPythonModule) && !builtins.Equals(stubType.DeclaringModule)) { sourceType.TransferDocumentationAndLocation(stubType); // TODO: choose best type between the scrape and the stub. Stub probably should always win. var source = Eval.CurrentScope.Variables[v.Name]?.Source ?? VariableSource.Declaration; diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs index 0f3c037fc..d04f03978 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs @@ -56,7 +56,9 @@ public PythonAnalyzer(IServiceManager services, string cacheFolderPath = null) { _startNextSession = StartNextSession; _progress = new ProgressReporter(services.GetService()); - _services.AddService(new StubCache(_services, cacheFolderPath)); + + _services.AddService(new CacheFolderService(_services, cacheFolderPath)); + _services.AddService(new StubCache(_services)); } public void Dispose() { diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index c0e9215f0..d2d9a58f1 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -19,6 +19,7 @@ using System.Runtime; using System.Threading; using System.Threading.Tasks; +using Microsoft.Python.Analysis.Caching; using Microsoft.Python.Analysis.Dependencies; using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Modules; diff --git a/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs b/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs index 847bbc000..9732aea0e 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs @@ -18,7 +18,6 @@ using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Analyzer.Evaluation; -using Microsoft.Python.Analysis.Extensions; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; diff --git a/src/Analysis/Ast/Impl/Caching/CacheFolders.cs b/src/Analysis/Ast/Impl/Caching/CacheFolders.cs index 3ee3508d0..414dec1e3 100644 --- a/src/Analysis/Ast/Impl/Caching/CacheFolders.cs +++ b/src/Analysis/Ast/Impl/Caching/CacheFolders.cs @@ -19,26 +19,27 @@ using System.Security.Cryptography; using System.Text; using Microsoft.Python.Core; -using Microsoft.Python.Core.IO; using Microsoft.Python.Core.Logging; using Microsoft.Python.Core.OS; namespace Microsoft.Python.Analysis.Caching { - internal static class CacheFolders { - public static string GetCacheFilePath(string root, string moduleName, string content, IFileSystem fs) { - // Folder for all module versions and variants - // {root}/module_name/content_hash.pyi - var folder = Path.Combine(root, moduleName); - - var filePath = Path.Combine(root, folder, $"{FileNameFromContent(content)}.pyi"); - if (fs.StringComparison == StringComparison.Ordinal) { - filePath = filePath.ToLowerInvariant(); - } + internal sealed class CacheFolderService: ICacheFolderService { + public CacheFolderService(IServiceContainer services, string cacheRootFolder) { + CacheFolder = cacheRootFolder ?? GetCacheFolder(services); + } + + public string CacheFolder { get; } - return filePath; + public string GetFileNameFromContent(string content) { + // File name depends on the content so we can distinguish between different versions. + using (var hash = SHA256.Create()) { + return Convert + .ToBase64String(hash.ComputeHash(new UTF8Encoding(false).GetBytes(content))) + .Replace('/', '_').Replace('+', '-'); + } } - public static string GetCacheFolder(IServiceContainer services) { + private static string GetCacheFolder(IServiceContainer services) { var platform = services.GetService(); var logger = services.GetService(); @@ -95,17 +96,6 @@ public static string GetCacheFolder(IServiceContainer services) { return cachePath; } - public static string FileNameFromContent(string content) { - // File name depends on the content so we can distinguish between different versions. - var hash = SHA256.Create(); - return Convert - .ToBase64String(hash.ComputeHash(new UTF8Encoding(false).GetBytes(content))) - .Replace('/', '_').Replace('+', '-'); - } - - public static string GetAnalysisCacheFilePath(string analysisRootFolder, string moduleName, string content, IFileSystem fs) - => GetCacheFilePath(analysisRootFolder, moduleName, content, fs); - private static bool CheckPathRooted(string varName, string path, ILogger logger) { if (!string.IsNullOrWhiteSpace(path) && Path.IsPathRooted(path)) { return true; diff --git a/src/Analysis/Ast/Impl/Caching/Definitions/ICacheFolderService.cs b/src/Analysis/Ast/Impl/Caching/Definitions/ICacheFolderService.cs new file mode 100644 index 000000000..acbe31f5d --- /dev/null +++ b/src/Analysis/Ast/Impl/Caching/Definitions/ICacheFolderService.cs @@ -0,0 +1,21 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +namespace Microsoft.Python.Analysis.Caching { + public interface ICacheFolderService { + string CacheFolder { get; } + string GetFileNameFromContent(string content); + } +} diff --git a/src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs b/src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs new file mode 100644 index 000000000..243e65776 --- /dev/null +++ b/src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs @@ -0,0 +1,37 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Python.Analysis.Types; + +namespace Microsoft.Python.Analysis.Caching { + internal interface IModuleDatabaseService { + /// + /// Creates module representation from module persistent state. + /// + /// Module name. If the name is not qualified + /// the module will ge resolved against active Python version. + /// Module file path. + /// Python module. + /// Module storage state + ModuleStorageState TryCreateModule(string moduleName, string filePath, out IPythonModule module); + + /// + /// Writes module data to the database. + /// + Task StoreModuleAnalysisAsync(IDocumentAnalysis analysis, CancellationToken cancellationToken = default); + } +} diff --git a/src/Analysis/Ast/Impl/Caching/Definitions/ModuleStorageState.cs b/src/Analysis/Ast/Impl/Caching/Definitions/ModuleStorageState.cs new file mode 100644 index 000000000..bbf14c809 --- /dev/null +++ b/src/Analysis/Ast/Impl/Caching/Definitions/ModuleStorageState.cs @@ -0,0 +1,42 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +namespace Microsoft.Python.Analysis.Caching { + /// + /// Describes module data stored in a database. + /// + public enum ModuleStorageState { + /// + /// Module does not exist in the database. + /// + DoesNotExist, + + /// + /// Partial data. This means module is still being analyzed + /// and the data on the module members is incomplete. + /// + Partial, + + /// + /// Modules exist and the analysis is complete. + /// + Complete, + + /// + /// Storage is corrupted or incompatible. + /// + Corrupted + } +} diff --git a/src/Analysis/Ast/Impl/Caching/StubCache.cs b/src/Analysis/Ast/Impl/Caching/StubCache.cs index ef91a1963..d20cb22d6 100644 --- a/src/Analysis/Ast/Impl/Caching/StubCache.cs +++ b/src/Analysis/Ast/Impl/Caching/StubCache.cs @@ -27,13 +27,14 @@ internal sealed class StubCache : IStubCache { private readonly IFileSystem _fs; private readonly ILogger _log; + private readonly ICacheFolderService _cfs; - public StubCache(IServiceContainer services, string cacheRootFolder = null) { + public StubCache(IServiceContainer services) { _fs = services.GetService(); _log = services.GetService(); - cacheRootFolder = cacheRootFolder ?? CacheFolders.GetCacheFolder(services); - StubCacheFolder = Path.Combine(cacheRootFolder, $"stubs.v{_stubCacheFormatVersion}"); + _cfs = services.GetService(); + StubCacheFolder = Path.Combine(_cfs.CacheFolder, $"stubs.v{_stubCacheFormatVersion}"); } public string StubCacheFolder { get; } @@ -58,7 +59,7 @@ public string GetCacheFilePath(string filePath) { dir = dir.ToLowerInvariant(); } - var dirHash = CacheFolders.FileNameFromContent(dir); + var dirHash = _cfs.GetFileNameFromContent(dir); var stubFile = Path.Combine(StubCacheFolder, Path.Combine(dirHash, name)); return Path.ChangeExtension(stubFile, ".pyi"); } diff --git a/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs b/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs index bd2cdf0d4..3b565d4e1 100644 --- a/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs @@ -15,6 +15,7 @@ using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Types; @@ -57,7 +58,7 @@ internal static void DeclareParametersInScope(this IArgumentSet args, Expression } if (args.ListArgument != null && !string.IsNullOrEmpty(args.ListArgument.Name)) { - var type = new PythonCollectionType(null, BuiltinTypeId.List, eval.Interpreter, false); + var type = new PythonCollectionType(null, BuiltinTypeId.List, eval.BuiltinsModule, false); var list = new PythonCollection(type, args.ListArgument.Values); eval.DeclareVariable(args.ListArgument.Name, list, VariableSource.Declaration, args.ListArgument.Location); } diff --git a/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs index b1914d9c0..a53be479c 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs @@ -13,12 +13,13 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System.Collections.Generic; using System.Linq; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; -namespace Microsoft.Python.Analysis.Extensions { +namespace Microsoft.Python.Analysis { public static class PythonFunctionExtensions { public static bool IsUnbound(this IPythonFunctionType f) => f.DeclaringType != null && f.MemberType == PythonMemberType.Function; @@ -34,5 +35,14 @@ public static IScope GetScope(this IPythonFunctionType f) { IScope gs = f.DeclaringModule.GlobalScope; return gs?.TraverseBreadthFirst(s => s.Children).FirstOrDefault(s => s.Node == f.FunctionDefinition); } + + public static string GetQualifiedName(this IPythonClassMember cm) { + var s = new Stack(); + s.Push(cm.Name); + for (var p = cm.DeclaringType as IPythonClassMember; p != null; p = p.DeclaringType as IPythonClassMember) { + s.Push(p.Name); + } + return $"{cm.DeclaringModule.Name}:{string.Join(".", s)}"; + } } } diff --git a/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs index 185f549bf..1e87eb99a 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs @@ -13,6 +13,7 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System.Diagnostics; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core; @@ -22,7 +23,7 @@ public static class PythonTypeExtensions { public static bool IsUnknown(this IPythonType value) => value == null || (value.TypeId == BuiltinTypeId.Unknown && value.MemberType == PythonMemberType.Unknown && value.Name.Equals("Unknown")); - public static bool IsGenericParameter(this IPythonType value) + public static bool IsGenericParameter(this IPythonType value) => value is IGenericTypeDefinition; public static bool IsGeneric(this IPythonType value) @@ -34,11 +35,14 @@ public static void TransferDocumentationAndLocation(this IPythonType s, IPythonT if (!string.IsNullOrEmpty(documentation)) { dst.SetDocumentation(documentation); } + dst.Location = src.Location; } } public static bool IsConstructor(this IPythonClassMember m) - => m.Name.EqualsOrdinal("__init__") || m.Name.EqualsOrdinal("__new__"); + => m.Name.EqualsOrdinal("__init__") || m.Name.EqualsOrdinal("__new__"); + + public static string GetQualifiedName(this IPythonType t) => $"{t.DeclaringModule.Name}:{t.Name}"; } } diff --git a/src/Analysis/Ast/Impl/Modules/CompiledPythonModule.cs b/src/Analysis/Ast/Impl/Modules/CompiledPythonModule.cs index 913a872d4..1335a8ccf 100644 --- a/src/Analysis/Ast/Impl/Modules/CompiledPythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/CompiledPythonModule.cs @@ -93,7 +93,7 @@ private string ScrapeModule() { try { using (var process = new Process()) { process.StartInfo = startInfo; - process.ErrorDataReceived += new DataReceivedEventHandler((s, e) => { }); + process.ErrorDataReceived += (s, e) => { }; process.Start(); process.BeginErrorReadLine(); diff --git a/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs b/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs index 4fbc1922e..fa7b260fa 100644 --- a/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs +++ b/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs @@ -14,6 +14,7 @@ // permissions and limitations under the License. using System; +using System.Collections; using System.Collections.Generic; using System.Threading; using Microsoft.Python.Analysis.Caching; diff --git a/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs b/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs index b017e0708..64ab06683 100644 --- a/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs +++ b/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs @@ -13,10 +13,7 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System; - namespace Microsoft.Python.Analysis.Modules { - [Flags] public enum ModuleType { /// /// Module is user file in the workspace. diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.Analysis.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.Analysis.cs new file mode 100644 index 000000000..07deffadd --- /dev/null +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.Analysis.cs @@ -0,0 +1,128 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Diagnostics; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Caching; +using Microsoft.Python.Analysis.Diagnostics; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; +using Microsoft.Python.Core; + +namespace Microsoft.Python.Analysis.Modules { + /// + /// Primary base for all modules and user documents. Provides access + /// to AST and the module analysis. + /// + [DebuggerDisplay("{Name} : {ModuleType}")] + internal partial class PythonModule { + public void NotifyAnalysisBegins() { + lock (AnalysisLock) { + if (Analysis is LibraryAnalysis) { + var sw = Log != null ? Stopwatch.StartNew() : null; + lock (AnalysisLock) { + _astMap[this] = RecreateAst(); + } + sw?.Stop(); + Log?.Log(TraceEventType.Verbose, $"Reloaded AST of {Name} in {sw?.Elapsed.TotalMilliseconds} ms"); + } + + if (_updated) { + _updated = false; + // In all variables find those imported, then traverse imported modules + // and remove references to this module. If variable refers to a module, + // recurse into module but only process global scope. + + if (GlobalScope == null) { + return; + } + + // TODO: Figure out where the nulls below are coming from. + var importedVariables = ((IScope)GlobalScope) + .TraverseDepthFirst(c => c?.Children ?? Enumerable.Empty()) + .SelectMany(s => s?.Variables ?? VariableCollection.Empty) + .Where(v => v?.Source == VariableSource.Import); + + foreach (var v in importedVariables) { + v.RemoveReferences(this); + if (v.Value is IPythonModule module) { + RemoveReferencesInModule(module); + } + } + } + } + } + + public void NotifyAnalysisComplete(int version, ModuleWalker walker, bool isFinalPass) { + lock (AnalysisLock) { + if (version < Analysis.Version) { + return; + } + + Analysis = CreateAnalysis(version, walker, isFinalPass); + GlobalScope = Analysis.GlobalScope; + + // Derived classes can override OnAnalysisComplete if they want + // to perform additional actions on the completed analysis such + // as declare additional variables, etc. + OnAnalysisComplete(); + ContentState = State.Analyzed; + + if (ModuleType != ModuleType.User) { + _buffer.Reset(_buffer.Version, string.Empty); + } + } + + // Do not report issues with libraries or stubs + if (ModuleType == ModuleType.User) { + _diagnosticsService?.Replace(Uri, Analysis.Diagnostics, DiagnosticSource.Analysis); + } + + NewAnalysis?.Invoke(this, EventArgs.Empty); + } + + protected virtual void OnAnalysisComplete() { } + + public IDocumentAnalysis GetAnyAnalysis() => Analysis; + + public Task GetAnalysisAsync(int waitTime = 200, CancellationToken cancellationToken = default) + => Services.GetService().GetAnalysisAsync(this, waitTime, cancellationToken); + + private IDocumentAnalysis CreateAnalysis(int version, ModuleWalker walker, bool isFinalPass) { + var analysis = ModuleType == ModuleType.Library && isFinalPass + ? new LibraryAnalysis(this, version, walker.Eval.Services, walker.GlobalScope, walker.StarImportMemberNames) + : (IDocumentAnalysis)new DocumentAnalysis(this, version, walker.GlobalScope, walker.Eval, walker.StarImportMemberNames); + + if (analysis.Document.ModuleType != ModuleType.Stub) { + var dbs = Services.GetService(); + dbs?.StoreModuleAnalysisAsync(analysis).DoNotWait(); + } + + return analysis; + } + + private void RemoveReferencesInModule(IPythonModule module) { + if (module.GlobalScope?.Variables != null) { + foreach (var v in module.GlobalScope.Variables) { + v.RemoveReferences(this); + } + } + } + } +} diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.Ast.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.Ast.cs new file mode 100644 index 000000000..08b69fd28 --- /dev/null +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.Ast.cs @@ -0,0 +1,182 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Diagnostics; +using Microsoft.Python.Core.Text; +using Microsoft.Python.Parsing; +using Microsoft.Python.Parsing.Ast; + +namespace Microsoft.Python.Analysis.Modules { + internal partial class PythonModule { + #region Parsing + /// + /// Returns document parse tree. + /// + public async Task GetAstAsync(CancellationToken cancellationToken = default) { + Task t = null; + while (true) { + lock (AnalysisLock) { + if (t == _parsingTask) { + break; + } + cancellationToken.ThrowIfCancellationRequested(); + t = _parsingTask; + } + try { + await (t ?? Task.CompletedTask); + break; + } catch (OperationCanceledException) { + // Parsing as canceled, try next task. + } + } + cancellationToken.ThrowIfCancellationRequested(); + return this.GetAst(); + } + + public PythonAst GetAnyAst() => GetAstNode(this); + + /// + /// Provides collection of parsing errors, if any. + /// + public IEnumerable GetParseErrors() => _parseErrors.ToArray(); + + private void Parse() { + _parseCts?.Cancel(); + _parseCts = new CancellationTokenSource(); + + _linkedParseCts?.Dispose(); + _linkedParseCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeToken.CancellationToken, _parseCts.Token); + + ContentState = State.Parsing; + _parsingTask = Task.Run(() => Parse(_linkedParseCts.Token), _linkedParseCts.Token); + } + + private void Parse(CancellationToken cancellationToken) { + CollectingErrorSink sink = null; + int version; + Parser parser; + + //Log?.Log(TraceEventType.Verbose, $"Parse begins: {Name}"); + + lock (AnalysisLock) { + version = _buffer.Version; + var options = new ParserOptions { + StubFile = FilePath != null && Path.GetExtension(FilePath).Equals(".pyi", FileSystem.StringComparison) + }; + if (ModuleType == ModuleType.User) { + sink = new CollectingErrorSink(); + options.ErrorSink = sink; + } + parser = Parser.CreateParser(new StringReader(_buffer.Text), Interpreter.LanguageVersion, options); + } + + var ast = parser.ParseFile(Uri); + + //Log?.Log(TraceEventType.Verbose, $"Parse complete: {Name}"); + + lock (AnalysisLock) { + cancellationToken.ThrowIfCancellationRequested(); + if (version != _buffer.Version) { + throw new OperationCanceledException(); + } + + // Stored nodes are no longer valid. + _astMap.Clear(); + _astMap[this] = ast; + + _parseErrors = sink?.Diagnostics ?? Array.Empty(); + + // Do not report issues with libraries or stubs + if (sink != null) { + _diagnosticsService?.Replace(Uri, _parseErrors, DiagnosticSource.Parser); + } + + ContentState = State.Parsed; + Analysis = new EmptyAnalysis(Services, this); + } + + NewAst?.Invoke(this, EventArgs.Empty); + + if (ContentState < State.Analyzing) { + ContentState = State.Analyzing; + + var analyzer = Services.GetService(); + analyzer.EnqueueDocumentForAnalysis(this, version); + } + + lock (AnalysisLock) { + _parsingTask = null; + } + } + + private class CollectingErrorSink : ErrorSink { + private readonly List _diagnostics = new List(); + + public IReadOnlyList Diagnostics => _diagnostics; + public override void Add(string message, SourceSpan span, int errorCode, Severity severity) + => _diagnostics.Add(new DiagnosticsEntry(message, span, $"parser-{errorCode}", severity, DiagnosticSource.Parser)); + } + #endregion + + #region IAstNodeContainer + public T GetAstNode(object o) where T : Node { + lock (AnalysisLock) { + return _astMap.TryGetValue(o, out var n) ? (T)n : null; + } + } + + public void AddAstNode(object o, Node n) { + lock (AnalysisLock) { + Debug.Assert(!_astMap.ContainsKey(o) || _astMap[o] == n); + _astMap[o] = n; + } + } + + public void ClearAst() { + lock (AnalysisLock) { + if (ModuleType != ModuleType.User) { + _astMap.Clear(); + } + } + } + public void ClearContent() { + lock (AnalysisLock) { + if (ModuleType != ModuleType.User) { + _buffer.Reset(_buffer.Version, string.Empty); + } + } + } + #endregion + + private PythonAst RecreateAst() { + lock (AnalysisLock) { + ContentState = State.None; + LoadContent(); + var parser = Parser.CreateParser(new StringReader(_buffer.Text), Interpreter.LanguageVersion, ParserOptions.Default); + var ast = parser.ParseFile(Uri); + ContentState = State.Parsed; + return ast; + } + } + } +} diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.Content.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.Content.cs new file mode 100644 index 000000000..911f604f8 --- /dev/null +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.Content.cs @@ -0,0 +1,87 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Documents; +using Microsoft.Python.Core.IO; + +namespace Microsoft.Python.Analysis.Modules { + internal partial class PythonModule { + public void Update(IEnumerable changes) { + lock (AnalysisLock) { + _parseCts?.Cancel(); + _parseCts = new CancellationTokenSource(); + + _linkedParseCts?.Dispose(); + _linkedParseCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeToken.CancellationToken, _parseCts.Token); + + _buffer.Update(changes); + _updated = true; + + Parse(); + } + + Services.GetService().InvalidateAnalysis(this); + } + + public void Reset(string content) { + lock (AnalysisLock) { + if (content != Content) { + ContentState = State.None; + InitializeContent(content, _buffer.Version + 1); + } + } + + Services.GetService().InvalidateAnalysis(this); + } + + protected virtual string LoadContent() { + if (ContentState < State.Loading) { + ContentState = State.Loading; + try { + var code = FileSystem.ReadTextWithRetry(FilePath); + ContentState = State.Loaded; + return code; + } catch (IOException) { } catch (UnauthorizedAccessException) { } + } + return null; // Keep content as null so module can be loaded later. + } + + private void InitializeContent(string content, int version) { + lock (AnalysisLock) { + LoadContent(content, version); + + var startParse = ContentState < State.Parsing && (_parsingTask == null || version > 0); + if (startParse) { + Parse(); + } + } + } + + private void LoadContent(string content, int version) { + if (ContentState < State.Loading) { + try { + content = content ?? LoadContent(); + _buffer.Reset(version, content); + ContentState = State.Loaded; + } catch (IOException) { } catch (UnauthorizedAccessException) { } + } + } + } +} diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.Documentation.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.Documentation.cs new file mode 100644 index 000000000..121fd1320 --- /dev/null +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.Documentation.cs @@ -0,0 +1,76 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.IO; +using System.Linq; +using System.Text; +using Microsoft.Python.Core; + +namespace Microsoft.Python.Analysis.Modules { + /// + /// Primary base for all modules and user documents. Provides access + /// to AST and the module analysis. + /// + internal partial class PythonModule { + private string TryGetDocFromModuleInitFile() { + if (string.IsNullOrEmpty(FilePath) || !FileSystem.FileExists(FilePath)) { + return string.Empty; + } + + try { + using (var sr = new StreamReader(FilePath)) { + string quote = null; + string line; + while (true) { + line = sr.ReadLine()?.Trim(); + if (line == null) { + break; + } + if (line.Length == 0 || line.StartsWithOrdinal("#")) { + continue; + } + if (line.StartsWithOrdinal("\"\"\"") || line.StartsWithOrdinal("r\"\"\"")) { + quote = "\"\"\""; + } else if (line.StartsWithOrdinal("'''") || line.StartsWithOrdinal("r'''")) { + quote = "'''"; + } + break; + } + + if (line != null && quote != null) { + // Check if it is a single-liner, but do distinguish from """ + // Also, handle quadruple+ quotes. + line = line.Trim(); + line = line.All(c => c == quote[0]) ? quote : line; + if (line.EndsWithOrdinal(quote) && line.IndexOf(quote, StringComparison.Ordinal) < line.LastIndexOf(quote, StringComparison.Ordinal)) { + return line.Substring(quote.Length, line.Length - 2 * quote.Length).Trim(); + } + var sb = new StringBuilder(); + while (true) { + line = sr.ReadLine(); + if (line == null || line.EndsWithOrdinal(quote)) { + break; + } + sb.AppendLine(line); + } + return sb.ToString(); + } + } + } catch (IOException) { } catch (UnauthorizedAccessException) { } + return string.Empty; + } + } +} diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.cs index c4e8fa134..47db6d93e 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.cs @@ -16,9 +16,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.IO; using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis.Analyzer; @@ -32,8 +30,6 @@ using Microsoft.Python.Core.Disposables; using Microsoft.Python.Core.IO; using Microsoft.Python.Core.Logging; -using Microsoft.Python.Core.Text; -using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Modules { @@ -42,7 +38,7 @@ namespace Microsoft.Python.Analysis.Modules { /// to AST and the module analysis. /// [DebuggerDisplay("{Name} : {ModuleType}")] - internal class PythonModule : LocatedMember, IDocument, IAnalyzable, IEquatable, IAstNodeContainer { + internal partial class PythonModule : LocatedMember, IDocument, IAnalyzable, IEquatable, IAstNodeContainer { private enum State { None, Loading, @@ -79,6 +75,7 @@ protected PythonModule(string name, ModuleType moduleType, IServiceContainer ser Log = services.GetService(); Interpreter = services.GetService(); Analysis = new EmptyAnalysis(services, this); + GlobalScope = Analysis.GlobalScope; _diagnosticsService = services.GetService(); SetDeclaringModule(this); @@ -117,6 +114,8 @@ internal PythonModule(ModuleCreationOptions creationOptions, IServiceContainer s #region IPythonType public string Name { get; } + public string QualifiedName => Name; + public BuiltinTypeId TypeId => BuiltinTypeId.Module; public bool IsBuiltin => true; public bool IsAbstract => false; @@ -149,10 +148,10 @@ public virtual string Documentation { #endregion #region IMemberContainer - public virtual IMember GetMember(string name) => Analysis.GlobalScope.Variables[name]?.Value; + public virtual IMember GetMember(string name) => GlobalScope.Variables[name]?.Value; public virtual IEnumerable GetMemberNames() { // drop imported modules and typing. - return Analysis.GlobalScope.Variables + return GlobalScope.Variables .Where(v => { // Instances are always fine. if (v.Value is IPythonInstance) { @@ -173,12 +172,9 @@ public virtual IEnumerable GetMemberNames() { public override LocationInfo Definition => new LocationInfo(Uri.ToAbsolutePath(), Uri, 0, 0); #endregion - #region IPythonFile - public virtual string FilePath { get; } - public virtual Uri Uri { get; } - #endregion - #region IPythonModule + public virtual string FilePath { get; protected set; } + public virtual Uri Uri { get; } public IDocumentAnalysis Analysis { get; private set; } public IPythonInterpreter Interpreter { get; } @@ -192,7 +188,7 @@ public virtual IEnumerable GetMemberNames() { /// /// Global cope of the module. /// - public IGlobalScope GlobalScope { get; private set; } + public virtual IGlobalScope GlobalScope { get; protected set; } /// /// If module is a stub points to the primary module. @@ -200,6 +196,7 @@ public virtual IEnumerable GetMemberNames() { /// wants to see library code and not a stub. /// public IPythonModule PrimaryModule { get; private set; } + #endregion #region IDisposable @@ -238,363 +235,8 @@ protected virtual void Dispose(bool disposing) { public string Content => _buffer.Text; #endregion - #region Parsing - /// - /// Returns document parse tree. - /// - public async Task GetAstAsync(CancellationToken cancellationToken = default) { - Task t = null; - while (true) { - lock (AnalysisLock) { - if (t == _parsingTask) { - break; - } - cancellationToken.ThrowIfCancellationRequested(); - t = _parsingTask; - } - try { - await (t ?? Task.CompletedTask); - break; - } catch (OperationCanceledException) { - // Parsing as canceled, try next task. - } - } - cancellationToken.ThrowIfCancellationRequested(); - return this.GetAst(); - } - - public PythonAst GetAnyAst() => GetAstNode(this); - - /// - /// Provides collection of parsing errors, if any. - /// - public IEnumerable GetParseErrors() => _parseErrors.ToArray(); - - public void Update(IEnumerable changes) { - lock (AnalysisLock) { - _parseCts?.Cancel(); - _parseCts = new CancellationTokenSource(); - - _linkedParseCts?.Dispose(); - _linkedParseCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeToken.CancellationToken, _parseCts.Token); - - _buffer.Update(changes); - _updated = true; - - Parse(); - } - - Services.GetService().InvalidateAnalysis(this); - } - - public void Reset(string content) { - lock (AnalysisLock) { - if (content != Content) { - ContentState = State.None; - InitializeContent(content, _buffer.Version + 1); - } - } - - Services.GetService().InvalidateAnalysis(this); - } - - private void Parse() { - _parseCts?.Cancel(); - _parseCts = new CancellationTokenSource(); - - _linkedParseCts?.Dispose(); - _linkedParseCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeToken.CancellationToken, _parseCts.Token); - - ContentState = State.Parsing; - _parsingTask = Task.Run(() => Parse(_linkedParseCts.Token), _linkedParseCts.Token); - } - - private void Parse(CancellationToken cancellationToken) { - CollectingErrorSink sink = null; - int version; - Parser parser; - - //Log?.Log(TraceEventType.Verbose, $"Parse begins: {Name}"); - - lock (AnalysisLock) { - version = _buffer.Version; - var options = new ParserOptions { - StubFile = FilePath != null && Path.GetExtension(FilePath).Equals(".pyi", FileSystem.StringComparison) - }; - if (ModuleType == ModuleType.User) { - sink = new CollectingErrorSink(); - options.ErrorSink = sink; - } - parser = Parser.CreateParser(new StringReader(_buffer.Text), Interpreter.LanguageVersion, options); - } - - var ast = parser.ParseFile(Uri); - - //Log?.Log(TraceEventType.Verbose, $"Parse complete: {Name}"); - - lock (AnalysisLock) { - cancellationToken.ThrowIfCancellationRequested(); - if (version != _buffer.Version) { - throw new OperationCanceledException(); - } - - // Stored nodes are no longer valid. - _astMap.Clear(); - _astMap[this] = ast; - - _parseErrors = sink?.Diagnostics ?? Array.Empty(); - - // Do not report issues with libraries or stubs - if (sink != null) { - _diagnosticsService?.Replace(Uri, _parseErrors, DiagnosticSource.Parser); - } - - ContentState = State.Parsed; - Analysis = new EmptyAnalysis(Services, this); - } - - NewAst?.Invoke(this, EventArgs.Empty); - - if (ContentState < State.Analyzing) { - ContentState = State.Analyzing; - - var analyzer = Services.GetService(); - analyzer.EnqueueDocumentForAnalysis(this, version); - } - - lock (AnalysisLock) { - _parsingTask = null; - } - } - - private class CollectingErrorSink : ErrorSink { - private readonly List _diagnostics = new List(); - - public IReadOnlyList Diagnostics => _diagnostics; - public override void Add(string message, SourceSpan span, int errorCode, Severity severity) - => _diagnostics.Add(new DiagnosticsEntry(message, span, $"parser-{errorCode}", severity, DiagnosticSource.Parser)); - } - #endregion - - #region IAnalyzable - - public void NotifyAnalysisBegins() { - lock (AnalysisLock) { - if (Analysis is LibraryAnalysis) { - var sw = Log != null ? Stopwatch.StartNew() : null; - lock (AnalysisLock) { - _astMap[this] = RecreateAst(); - } - sw?.Stop(); - Log?.Log(TraceEventType.Verbose, $"Reloaded AST of {Name} in {sw?.Elapsed.TotalMilliseconds} ms"); - } - - if (_updated) { - _updated = false; - // In all variables find those imported, then traverse imported modules - // and remove references to this module. If variable refers to a module, - // recurse into module but only process global scope. - - if (GlobalScope == null) { - return; - } - - // TODO: Figure out where the nulls below are coming from. - var importedVariables = ((IScope)GlobalScope) - .TraverseDepthFirst(c => c?.Children ?? Enumerable.Empty()) - .SelectMany(s => s?.Variables ?? VariableCollection.Empty) - .Where(v => v?.Source == VariableSource.Import); - - foreach (var v in importedVariables) { - v.RemoveReferences(this); - if (v.Value is IPythonModule module) { - RemoveReferencesInModule(module); - } - } - } - } - } - - public void NotifyAnalysisComplete(int version, ModuleWalker walker, bool isFinalPass) { - lock (AnalysisLock) { - if (version < Analysis.Version) { - return; - } - - Analysis = CreateAnalysis(version, walker, isFinalPass); - GlobalScope = Analysis.GlobalScope; - - // Derived classes can override OnAnalysisComplete if they want - // to perform additional actions on the completed analysis such - // as declare additional variables, etc. - OnAnalysisComplete(); - ContentState = State.Analyzed; - - if (ModuleType != ModuleType.User) { - _buffer.Reset(_buffer.Version, string.Empty); - } - } - - // Do not report issues with libraries or stubs - if (ModuleType == ModuleType.User) { - _diagnosticsService?.Replace(Uri, Analysis.Diagnostics, DiagnosticSource.Analysis); - } - - NewAnalysis?.Invoke(this, EventArgs.Empty); - } - - protected virtual void OnAnalysisComplete() { } - #endregion - #region IEquatable public bool Equals(IPythonModule other) => Name.Equals(other?.Name) && FilePath.Equals(other?.FilePath); #endregion - - #region IAstNodeContainer - public T GetAstNode(object o) where T : Node { - lock (AnalysisLock) { - return _astMap.TryGetValue(o, out var n) ? (T)n : null; - } - } - - public void AddAstNode(object o, Node n) { - lock (AnalysisLock) { - Debug.Assert(!_astMap.ContainsKey(o) || _astMap[o] == n); - _astMap[o] = n; - } - } - - public void ClearAst() { - lock (AnalysisLock) { - if (ModuleType != ModuleType.User) { - _astMap.Clear(); - } - } - } - public void ClearContent() { - lock (AnalysisLock) { - if (ModuleType != ModuleType.User) { - _buffer.Reset(_buffer.Version, string.Empty); - } - } - } - #endregion - - #region Analysis - public IDocumentAnalysis GetAnyAnalysis() => Analysis; - - public Task GetAnalysisAsync(int waitTime = 200, CancellationToken cancellationToken = default) - => Services.GetService().GetAnalysisAsync(this, waitTime, cancellationToken); - - #endregion - - #region Content management - protected virtual string LoadContent() { - if (ContentState < State.Loading) { - ContentState = State.Loading; - try { - var code = FileSystem.ReadTextWithRetry(FilePath); - ContentState = State.Loaded; - return code; - } catch (IOException) { } catch (UnauthorizedAccessException) { } - } - return null; // Keep content as null so module can be loaded later. - } - - private void InitializeContent(string content, int version) { - lock (AnalysisLock) { - LoadContent(content, version); - - var startParse = ContentState < State.Parsing && (_parsingTask == null || version > 0); - if (startParse) { - Parse(); - } - } - } - - private void LoadContent(string content, int version) { - if (ContentState < State.Loading) { - try { - content = content ?? LoadContent(); - _buffer.Reset(version, content); - ContentState = State.Loaded; - } catch (IOException) { } catch (UnauthorizedAccessException) { } - } - } - #endregion - - #region Documentation - private string TryGetDocFromModuleInitFile() { - if (string.IsNullOrEmpty(FilePath) || !FileSystem.FileExists(FilePath)) { - return string.Empty; - } - - try { - using (var sr = new StreamReader(FilePath)) { - string quote = null; - string line; - while (true) { - line = sr.ReadLine()?.Trim(); - if (line == null) { - break; - } - if (line.Length == 0 || line.StartsWithOrdinal("#")) { - continue; - } - if (line.StartsWithOrdinal("\"\"\"") || line.StartsWithOrdinal("r\"\"\"")) { - quote = "\"\"\""; - } else if (line.StartsWithOrdinal("'''") || line.StartsWithOrdinal("r'''")) { - quote = "'''"; - } - break; - } - - if (line != null && quote != null) { - // Check if it is a single-liner, but do distinguish from """ - // Also, handle quadruple+ quotes. - line = line.Trim(); - line = line.All(c => c == quote[0]) ? quote : line; - if (line.EndsWithOrdinal(quote) && line.IndexOf(quote, StringComparison.Ordinal) < line.LastIndexOf(quote, StringComparison.Ordinal)) { - return line.Substring(quote.Length, line.Length - 2 * quote.Length).Trim(); - } - var sb = new StringBuilder(); - while (true) { - line = sr.ReadLine(); - if (line == null || line.EndsWithOrdinal(quote)) { - break; - } - sb.AppendLine(line); - } - return sb.ToString(); - } - } - } catch (IOException) { } catch (UnauthorizedAccessException) { } - return string.Empty; - } - #endregion - - private void RemoveReferencesInModule(IPythonModule module) { - if (module.GlobalScope?.Variables != null) { - foreach (var v in module.GlobalScope.Variables) { - v.RemoveReferences(this); - } - } - } - - private IDocumentAnalysis CreateAnalysis(int version, ModuleWalker walker, bool isFinalPass) - => ModuleType == ModuleType.Library && isFinalPass - ? new LibraryAnalysis(this, version, walker.Eval.Services, walker.GlobalScope, walker.StarImportMemberNames) - : (IDocumentAnalysis)new DocumentAnalysis(this, version, walker.GlobalScope, walker.Eval, walker.StarImportMemberNames); - - private PythonAst RecreateAst() { - lock (AnalysisLock) { - ContentState = State.None; - LoadContent(null, _buffer.Version); - var parser = Parser.CreateParser(new StringReader(_buffer.Text), Interpreter.LanguageVersion, ParserOptions.Default); - var ast = parser.ParseFile(Uri); - ContentState = State.Parsed; - return ast; - } - } } } diff --git a/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs b/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs index 471c25e45..16d8a0c1f 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs @@ -16,8 +16,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; @@ -30,8 +28,10 @@ namespace Microsoft.Python.Analysis.Modules { /// internal sealed class PythonVariableModule : LocatedMember, IPythonModule, IEquatable { private readonly Dictionary _children = new Dictionary(); - + public string Name { get; } + public string QualifiedName => Name; + public IPythonModule Module { get; } public IPythonInterpreter Interpreter { get; } @@ -49,13 +49,13 @@ internal sealed class PythonVariableModule : LocatedMember, IPythonModule, IEqua public Uri Uri => Module?.Uri; public override PythonMemberType MemberType => PythonMemberType.Module; - public PythonVariableModule(string name, IPythonInterpreter interpreter): base(null) { + public PythonVariableModule(string name, IPythonInterpreter interpreter) : base(null) { Name = name; Interpreter = interpreter; SetDeclaringModule(this); } - public PythonVariableModule(IPythonModule module): base(module) { + public PythonVariableModule(IPythonModule module): base(module) { Name = module.Name; Interpreter = module.Interpreter; Module = module; diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs index 514ccea1c..c9eb9c936 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs @@ -99,7 +99,12 @@ protected override IPythonModule CreateModule(string name) { return module; } } - + + var dbs = _services.GetService(); + if (dbs != null && dbs.TryCreateModule(name, moduleImport.ModulePath, out var m) != ModuleStorageState.DoesNotExist && m != null) { + return m; + } + // If there is a stub, make sure it is loaded and attached // First check stub next to the module. if (!TryCreateModuleStub(name, moduleImport.ModulePath, out var stub)) { @@ -200,7 +205,7 @@ public async Task ReloadAsync(CancellationToken cancellationToken = default) { .ExcludeDefault()) { GetRdt()?.UnlockDocument(uri); } - + // Preserve builtins, they don't need to be reloaded since interpreter does not change. var builtins = Modules[BuiltinModuleName]; Modules.Clear(); @@ -237,7 +242,7 @@ public async Task ReloadAsync(CancellationToken cancellationToken = default) { ReloadModulePaths(addedRoots); } - public IEnumerable SetUserSearchPaths(in IEnumerable searchPaths) + public IEnumerable SetUserSearchPaths(in IEnumerable searchPaths) => PathResolver.SetUserSearchPaths(searchPaths); // For tests diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs b/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs index 1ddc7d3ed..06dfe6802 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs @@ -83,7 +83,7 @@ public IReadOnlyCollection GetPackagesFromDirectory(string searchPath, C public IStubCache StubCache { get; protected set; } - public IPythonModule GetImportedModule(string name) + public IPythonModule GetImportedModule(string name) => Modules.TryGetValue(name, out var moduleRef) ? moduleRef.Value : _interpreter.ModuleResolution.GetSpecializedModule(name); public IPythonModule GetOrLoadModule(string name) { diff --git a/src/Analysis/Ast/Impl/Properties/AssemblyInfo.cs b/src/Analysis/Ast/Impl/Properties/AssemblyInfo.cs index 52c4e3665..9aa458a2d 100644 --- a/src/Analysis/Ast/Impl/Properties/AssemblyInfo.cs +++ b/src/Analysis/Ast/Impl/Properties/AssemblyInfo.cs @@ -15,5 +15,7 @@ using System.Runtime.CompilerServices; +[assembly: InternalsVisibleTo("Microsoft.Python.Analysis.Caching, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] [assembly: InternalsVisibleTo("Microsoft.Python.Analysis.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] +[assembly: InternalsVisibleTo("Microsoft.Python.Analysis.Caching.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] [assembly: InternalsVisibleTo("Microsoft.Python.LanguageServer.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] diff --git a/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs b/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs index 1b29df047..54c905ed3 100644 --- a/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs +++ b/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs @@ -48,7 +48,7 @@ public static IMember Iterator(IPythonModule module, IPythonFunctionOverload ove } public static IMember List(IPythonInterpreter interpreter, IPythonFunctionOverload overload, IArgumentSet argSet) - => PythonCollectionType.CreateList(interpreter, argSet); + => PythonCollectionType.CreateList(interpreter.ModuleResolution.BuiltinsModule, argSet); public static IMember ListOfStrings(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { var type = new TypingListType("List", module.Interpreter.GetBuiltinType(BuiltinTypeId.Str), module.Interpreter, false); @@ -78,7 +78,7 @@ public static IMember __iter__(IPythonInterpreter interpreter, BuiltinTypeId con public static IMember Range(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { var args = argSet.Values(); if (args.Count > 0) { - var type = new PythonCollectionType(null, BuiltinTypeId.List, module.Interpreter, false); + var type = new PythonCollectionType(null, BuiltinTypeId.List, module.Interpreter.ModuleResolution.BuiltinsModule, false); return new PythonCollection(type, new[] { args[0] }); } return null; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/AnyType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/AnyType.cs index d1e5f9e0e..25e765037 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/AnyType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/AnyType.cs @@ -24,6 +24,7 @@ public AnyType(IPythonModule declaringModule) : base(declaringModule) { } public override PythonMemberType MemberType => PythonMemberType.Class; public string Name => "Any"; + public string QualifiedName => this.GetQualifiedName(); public BuiltinTypeId TypeId => BuiltinTypeId.Type; public string Documentation => Name; public bool IsBuiltin => false; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs index df9d14a97..41995e50e 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs @@ -80,6 +80,7 @@ public IPythonType CreateSpecificType(IReadOnlyList typeArguments) #region IPythonType public string Name { get; } + public string QualifiedName => this.GetQualifiedName(); public IMember GetMember(string name) => null; public IEnumerable GetMemberNames() => Enumerable.Empty(); public BuiltinTypeId TypeId { get; } = BuiltinTypeId.Unknown; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingDictionaryType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingDictionaryType.cs index 0f618e96c..494bee9d2 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingDictionaryType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingDictionaryType.cs @@ -31,10 +31,10 @@ internal class TypingDictionaryType : PythonDictionaryType, ITypingDictionaryTyp /// Type name (Dict, Mapping, ...) /// Type of dictionary keys. /// Type of dictionary values. - /// Python interpreter + /// Python interpreter. /// Tells if collection is mutable (Dict) or not (Mapping) public TypingDictionaryType(string name, IPythonType keyType, IPythonType valueType, IPythonInterpreter interpreter, bool isMutable) - : base(interpreter, isMutable) { + : base(interpreter.ModuleResolution.GetSpecializedModule("typing"), isMutable) { KeyType = keyType; ValueType = valueType; Name = $"{name}[{keyType.Name}, {valueType.Name}]"; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingIteratorType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingIteratorType.cs index 81762ac42..fa721e862 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingIteratorType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingIteratorType.cs @@ -30,7 +30,7 @@ internal sealed class TypingIteratorType : PythonIteratorType, ITypingIteratorTy /// track items in the collection, it repeats the same item endlessly. /// public TypingIteratorType(IPythonType itemType, BuiltinTypeId iteratorType, IPythonInterpreter interpreter) - : base(iteratorType, interpreter) { + : base(iteratorType, interpreter.ModuleResolution.GetSpecializedModule("typing")) { ItemTypes = new[] { itemType }; Repeat = true; Name = $"Iterator[{itemType.Name}]"; @@ -41,7 +41,7 @@ public TypingIteratorType(IPythonType itemType, BuiltinTypeId iteratorType, IPyt /// The iterator goes along declared items types and stops when there are no more types. /// public TypingIteratorType(IReadOnlyList itemTypes, BuiltinTypeId iteratorType, IPythonInterpreter interpreter) - : base(iteratorType, interpreter) { + : base(iteratorType, interpreter.ModuleResolution.GetSpecializedModule("typing")) { ItemTypes = itemTypes; Name = $"Iterator[{CodeFormatter.FormatSequence(string.Empty, '(', itemTypes)}]"; } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingListType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingListType.cs index 818ed2aa4..00694d3a0 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingListType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingListType.cs @@ -25,7 +25,7 @@ internal class TypingListType : PythonCollectionType, ITypingListType { /// /// Type name. /// List item type. - /// Python interpreter + /// Python interpreter. /// Tells of list represents a mutable collection. /// If true, type will append item type names to the base type name. public TypingListType(string typeName, IPythonType itemType, IPythonInterpreter interpreter, bool isMutable, bool formatName = true) @@ -37,11 +37,11 @@ public TypingListType(string typeName, IPythonType itemType, IPythonInterpreter /// Type name. /// Collection type id. Can be used when list is used to simulate other collections, like a set. /// List item type. - /// Python interpreter + /// Python interpreter. /// Tells of list represents a mutable collection. /// If true, type will append item type names to the base type name. public TypingListType(string typeName, BuiltinTypeId typeId, IPythonType itemType, IPythonInterpreter interpreter, bool isMutable, bool formatName = true) - : base(null, typeId, interpreter, isMutable) { + : base(null, typeId, interpreter.ModuleResolution.GetSpecializedModule("typing"), isMutable) { ItemType = itemType; Name = formatName ? $"{typeName}[{itemType.Name}]" : typeName; } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs index 3fda6b0f4..064391d3c 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs @@ -30,7 +30,7 @@ internal class TypingTupleType : PythonCollectionType, ITypingTupleType { /// Tuple item types. /// Python interpreter. public TypingTupleType(IReadOnlyList itemTypes, IPythonInterpreter interpreter) - : base(null, BuiltinTypeId.Tuple, interpreter, false) { + : base(null, BuiltinTypeId.Tuple, interpreter.ModuleResolution.GetSpecializedModule("typing"), false) { ItemTypes = itemTypes; Name = CodeFormatter.FormatSequence("Tuple", '[', itemTypes); } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingType.cs index 387dcdbd2..251611453 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingType.cs @@ -28,10 +28,12 @@ internal sealed class TypingType : LocatedMember, IPythonType { public TypingType(IPythonModule declaringModule, IPythonType type): base(declaringModule) { _type = type ?? throw new ArgumentNullException(nameof(type)); Name = $"Type[{_type.Name}]"; + QualifiedName = $"{DeclaringModule.Name}:Type[{_type.QualifiedName}]"; } public override PythonMemberType MemberType => PythonMemberType.Class; public string Name { get; } + public string QualifiedName { get; } public BuiltinTypeId TypeId => BuiltinTypeId.Type; public string Documentation => Name; public bool IsBuiltin => false; diff --git a/src/Analysis/Ast/Impl/Types/ArgumentSet.cs b/src/Analysis/Ast/Impl/Types/ArgumentSet.cs index 6aa2b5038..e0acc25a7 100644 --- a/src/Analysis/Ast/Impl/Types/ArgumentSet.cs +++ b/src/Analysis/Ast/Impl/Types/ArgumentSet.cs @@ -20,7 +20,6 @@ using Microsoft.Python.Analysis.Analyzer; using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Diagnostics; -using Microsoft.Python.Analysis.Extensions; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; using Microsoft.Python.Parsing; diff --git a/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs b/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs index 313367a1a..41b3ddd83 100644 --- a/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs +++ b/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs @@ -32,17 +32,17 @@ internal class PythonCollectionType : PythonTypeWrapper, IPythonCollectionType { /// /// Iterable type name. If null, name of the type id will be used. /// Collection type id, such as . - /// Python interpreter. + /// Declaring module. /// Indicates if collection is mutable (like list) or immutable (like tuple). public PythonCollectionType( string typeName, BuiltinTypeId collectionTypeId, - IPythonInterpreter interpreter, + IPythonModule declaringModule, bool isMutable - ) : base(collectionTypeId, interpreter.ModuleResolution.BuiltinsModule) { + ) : base(collectionTypeId, declaringModule) { _typeName = typeName; TypeId = collectionTypeId; - IteratorType = new PythonIteratorType(collectionTypeId.GetIteratorTypeId(), interpreter); + IteratorType = new PythonIteratorType(collectionTypeId.GetIteratorTypeId(), declaringModule); IsMutable = isMutable; } @@ -83,7 +83,7 @@ public override IMember Index(IPythonInstance instance, object index) #endregion - public static IPythonCollection CreateList(IPythonInterpreter interpreter, IArgumentSet args) { + public static IPythonCollection CreateList(IPythonModule declaringModule, IArgumentSet args) { var exact = true; IReadOnlyList contents; if (args.Arguments.Count > 1) { @@ -94,33 +94,33 @@ public static IPythonCollection CreateList(IPythonInterpreter interpreter, IArgu } else { contents = args.ListArgument?.Values; } - return CreateList(interpreter, contents ?? Array.Empty(), exact: exact); + return CreateList(declaringModule, contents ?? Array.Empty(), exact: exact); } - public static IPythonCollection CreateList(IPythonInterpreter interpreter, IReadOnlyList contents, bool flatten = true, bool exact = false) { - var collectionType = new PythonCollectionType(null, BuiltinTypeId.List, interpreter, true); + public static IPythonCollection CreateList(IPythonModule declaringModule, IReadOnlyList contents, bool flatten = true, bool exact = false) { + var collectionType = new PythonCollectionType(null, BuiltinTypeId.List, declaringModule, true); return new PythonCollection(collectionType, contents, flatten, exact: exact); } - public static IPythonCollection CreateConcatenatedList(IPythonInterpreter interpreter, params IPythonCollection[] many) { + public static IPythonCollection CreateConcatenatedList(IPythonModule declaringModule, params IPythonCollection[] many) { var exact = many?.All(c => c != null && c.IsExact) ?? false; var contents = many?.ExcludeDefault().Select(c => c.Contents).SelectMany().ToList() ?? new List(); - return CreateList(interpreter, contents, false, exact: exact); + return CreateList(declaringModule, contents, false, exact: exact); } - public static IPythonCollection CreateTuple(IPythonInterpreter interpreter, IReadOnlyList contents, bool exact = false) { - var collectionType = new PythonCollectionType(null, BuiltinTypeId.Tuple, interpreter, false); + public static IPythonCollection CreateTuple(IPythonModule declaringModule, IReadOnlyList contents, bool exact = false) { + var collectionType = new PythonCollectionType(null, BuiltinTypeId.Tuple, declaringModule, false); return new PythonCollection(collectionType, contents, exact: exact); } - public static IPythonCollection CreateConcatenatedTuple(IPythonInterpreter interpreter, params IPythonCollection[] many) { + public static IPythonCollection CreateConcatenatedTuple(IPythonModule declaringModule, params IPythonCollection[] many) { var exact = many?.All(c => c != null && c.IsExact) ?? false; var contents = many?.ExcludeDefault().Select(c => c.Contents).SelectMany().ToList() ?? new List(); - return CreateTuple(interpreter, contents, exact: exact); + return CreateTuple(declaringModule, contents, exact: exact); } - public static IPythonCollection CreateSet(IPythonInterpreter interpreter, IReadOnlyList contents, bool flatten = true, bool exact = false) { - var collectionType = new PythonCollectionType(null, BuiltinTypeId.Set, interpreter, true); + public static IPythonCollection CreateSet(IPythonModule declaringModule, IReadOnlyList contents, bool flatten = true, bool exact = false) { + var collectionType = new PythonCollectionType(null, BuiltinTypeId.Set, declaringModule, true); return new PythonCollection(collectionType, contents, flatten, exact: exact); } diff --git a/src/Analysis/Ast/Impl/Types/Collections/PythonDictionaryType.cs b/src/Analysis/Ast/Impl/Types/Collections/PythonDictionaryType.cs index e012e4b3a..855339441 100644 --- a/src/Analysis/Ast/Impl/Types/Collections/PythonDictionaryType.cs +++ b/src/Analysis/Ast/Impl/Types/Collections/PythonDictionaryType.cs @@ -19,8 +19,8 @@ namespace Microsoft.Python.Analysis.Types.Collections { internal class PythonDictionaryType : PythonCollectionType { - public PythonDictionaryType(IPythonInterpreter interpreter, bool isMutable = true) - : base(null, BuiltinTypeId.Dict, interpreter, isMutable) { + public PythonDictionaryType(IPythonModule declaringModule, bool isMutable = true) + : base(null, BuiltinTypeId.Dict, declaringModule, isMutable) { } public override IMember CreateInstance(string typeName, IArgumentSet args) { diff --git a/src/Analysis/Ast/Impl/Types/Collections/PythonIteratorType.cs b/src/Analysis/Ast/Impl/Types/Collections/PythonIteratorType.cs index 865cebae9..67f5df3b8 100644 --- a/src/Analysis/Ast/Impl/Types/Collections/PythonIteratorType.cs +++ b/src/Analysis/Ast/Impl/Types/Collections/PythonIteratorType.cs @@ -26,9 +26,9 @@ internal class PythonIteratorType : PythonTypeWrapper, IPythonIteratorType { /// Creates type info for an iterator. /// /// Iterator type id, such as . - /// Python interpreter - public PythonIteratorType(BuiltinTypeId typeId, IPythonInterpreter interpreter) - : base(typeId, interpreter.ModuleResolution.BuiltinsModule) { + /// Declaring module. + public PythonIteratorType(BuiltinTypeId typeId, IPythonModule declaringModule) + : base(typeId, declaringModule) { TypeId = typeId; } diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassMember.cs b/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassMember.cs index 2f95d489a..9ea3e402f 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassMember.cs +++ b/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassMember.cs @@ -17,7 +17,7 @@ namespace Microsoft.Python.Analysis.Types { /// /// Represents member of a class. /// - public interface IPythonClassMember : IPythonType, ILocatedMember { + public interface IPythonClassMember : IPythonType { IPythonType DeclaringType { get; } } } diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs b/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs index 38fd776a5..852860bef 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs +++ b/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs @@ -20,7 +20,7 @@ namespace Microsoft.Python.Analysis.Types { /// /// Represents Python class type definition. /// - public interface IPythonClassType : IPythonType, ILocatedMember { + public interface IPythonClassType : IPythonType { /// /// Class definition node in the AST. /// diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IPythonModule.cs b/src/Analysis/Ast/Impl/Types/Definitions/IPythonModule.cs index ae86bc87f..2c12d9f9a 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IPythonModule.cs +++ b/src/Analysis/Ast/Impl/Types/Definitions/IPythonModule.cs @@ -13,8 +13,7 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System.Threading; -using System.Threading.Tasks; +using System; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Values; @@ -22,7 +21,17 @@ namespace Microsoft.Python.Analysis.Types { /// /// Represents a Python module. /// - public interface IPythonModule : IPythonType, IPythonFile, ILocatedMember { + public interface IPythonModule : IPythonType { + /// + /// File path to the module. + /// + string FilePath { get; } + + /// + /// Module URI. + /// + Uri Uri { get; } + /// /// Module analysis. /// diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IPythonPropertyType.cs b/src/Analysis/Ast/Impl/Types/Definitions/IPythonPropertyType.cs index 20fc3c932..badcecb6b 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IPythonPropertyType.cs +++ b/src/Analysis/Ast/Impl/Types/Definitions/IPythonPropertyType.cs @@ -34,5 +34,10 @@ public interface IPythonPropertyType : IPythonClassMember { /// True if the property is read-only. /// bool IsReadOnly { get; } + + /// + /// Property return type. + /// + IMember ReturnType { get; } } } diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IPythonType.cs b/src/Analysis/Ast/Impl/Types/Definitions/IPythonType.cs index 2f3cb2aa0..a71590175 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IPythonType.cs +++ b/src/Analysis/Ast/Impl/Types/Definitions/IPythonType.cs @@ -25,6 +25,11 @@ public interface IPythonType : ILocatedMember, IMemberContainer { /// string Name { get; } + /// + /// Fully qualified type name. Used for analysis persistence. + /// + string QualifiedName { get; } + /// /// Indicates built-in type id such as 'int' or 'str' /// or 'type' for user-defined entities. diff --git a/src/Analysis/Ast/Impl/Types/ParameterInfo.cs b/src/Analysis/Ast/Impl/Types/ParameterInfo.cs index 07f5a5e5b..c03e8b56a 100644 --- a/src/Analysis/Ast/Impl/Types/ParameterInfo.cs +++ b/src/Analysis/Ast/Impl/Types/ParameterInfo.cs @@ -29,7 +29,7 @@ public ParameterInfo(PythonAst ast, Parameter p, IPythonType type, IMember defau } public ParameterInfo(string name, IPythonType type, ParameterKind? kind, IMember defaultValue) { - Name = name ?? throw new ArgumentNullException(nameof(name)); + Name = name ?? "*"; // ?? throw new ArgumentNullException(nameof(name)); Documentation = string.Empty; DefaultValue = defaultValue; Type = type; diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.cs index 850cf4893..b3e2de521 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.cs @@ -76,7 +76,7 @@ public override IMember GetMember(string name) { switch (name) { case "__mro__": case "mro": - return is3x ? PythonCollectionType.CreateList(DeclaringModule.Interpreter, Mro) : UnknownType; + return is3x ? PythonCollectionType.CreateList(DeclaringModule.Interpreter.ModuleResolution.BuiltinsModule, Mro) : UnknownType; case "__dict__": return is3x ? DeclaringModule.Interpreter.GetBuiltinType(BuiltinTypeId.Dict) : UnknownType; case @"__weakref__": @@ -132,18 +132,19 @@ public override string Documentation { // Constructor call public override IMember CreateInstance(string typeName, IArgumentSet args) { + var builtins = DeclaringModule.Interpreter.ModuleResolution.BuiltinsModule; // Specializations switch (typeName) { case "list": - return PythonCollectionType.CreateList(DeclaringModule.Interpreter, args); + return PythonCollectionType.CreateList(builtins, args); case "dict": { // self, then contents var contents = args.Values().Skip(1).FirstOrDefault(); - return new PythonDictionary(DeclaringModule.Interpreter, contents); + return new PythonDictionary(builtins, contents); } case "tuple": { var contents = args.Values(); - return PythonCollectionType.CreateTuple(DeclaringModule.Interpreter, contents); + return PythonCollectionType.CreateTuple(builtins, contents); } } return new PythonInstance(this); @@ -212,7 +213,7 @@ internal void SetBases(IEnumerable bases) { return; } - AddMember("__bases__", PythonCollectionType.CreateList(DeclaringModule.Interpreter, _bases), true); + AddMember("__bases__", PythonCollectionType.CreateList(DeclaringModule.Interpreter.ModuleResolution.BuiltinsModule, _bases), true); } /// diff --git a/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs b/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs index 82c1def63..865fdac58 100644 --- a/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs @@ -72,6 +72,8 @@ Location location public override PythonMemberType MemberType => TypeId == BuiltinTypeId.Function ? PythonMemberType.Function : PythonMemberType.Method; + public override string QualifiedName => this.GetQualifiedName(); + public override IMember Call(IPythonInstance instance, string memberName, IArgumentSet args) { // Now we can go and find overload with matching arguments. var overload = Overloads[args.OverloadIndex]; diff --git a/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs b/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs index f10078945..0eba0d916 100644 --- a/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs @@ -18,7 +18,7 @@ using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Types { - class PythonPropertyType : PythonType, IPythonPropertyType { + internal sealed class PythonPropertyType : PythonType, IPythonPropertyType { private IPythonFunctionOverload _getter; public PythonPropertyType(FunctionDefinition fd, Location location, IPythonType declaringType, bool isAbstract) @@ -34,6 +34,7 @@ public PythonPropertyType(string name, Location location, IPythonType declaringT #region IPythonType public override PythonMemberType MemberType => PythonMemberType.Property; + public override string QualifiedName => this.GetQualifiedName(); #endregion #region IPythonPropertyType @@ -41,13 +42,20 @@ public PythonPropertyType(string name, Location location, IPythonType declaringT public override bool IsAbstract { get; } public bool IsReadOnly => true; public IPythonType DeclaringType { get; } - public string Description - => Type == null ? Resources.PropertyOfUnknownType : Resources.PropertyOfType.FormatUI(Type.Name); + + public string Description { + get { + var typeName = ReturnType?.GetPythonType()?.Name; + return typeName != null ? Resources.PropertyOfType.FormatUI(typeName) : Resources.PropertyOfUnknownType; + } + } + public override IMember Call(IPythonInstance instance, string memberName, IArgumentSet args) - => _getter.Call(args, instance?.GetPythonType() ?? DeclaringType); + => _getter.Call(args, instance?.GetPythonType() ?? DeclaringType); + + public IMember ReturnType => _getter?.Call(ArgumentSet.Empty, DeclaringType); #endregion internal void AddOverload(IPythonFunctionOverload overload) => _getter = _getter ?? overload; - private IPythonType Type => _getter?.Call(ArgumentSet.Empty, DeclaringType)?.GetPythonType(); } } diff --git a/src/Analysis/Ast/Impl/Types/PythonType.cs b/src/Analysis/Ast/Impl/Types/PythonType.cs index 27c8ffaff..3365a057f 100644 --- a/src/Analysis/Ast/Impl/Types/PythonType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonType.cs @@ -17,6 +17,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core.Diagnostics; @@ -56,6 +57,12 @@ private PythonType(string name, Location location, BuiltinTypeId typeId) : base( #region IPythonType public virtual string Name => TypeId == BuiltinTypeId.Ellipsis ? "..." : _name; + + public virtual string QualifiedName + => DeclaringModule.ModuleType == ModuleType.Builtins + ? TypeId == BuiltinTypeId.Ellipsis ? "ellipsis" : Name + : $"{DeclaringModule.Name}:{Name}"; + public virtual string Documentation { get; private set; } public virtual BuiltinTypeId TypeId => _typeId; public bool IsBuiltin => DeclaringModule == null || DeclaringModule is IBuiltinsPythonModule; diff --git a/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs b/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs index 8058317cc..bb8c14e8b 100644 --- a/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs +++ b/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs @@ -16,7 +16,6 @@ using System; using System.Collections.Generic; using Microsoft.Python.Analysis.Values; -using Microsoft.Python.Core.Text; namespace Microsoft.Python.Analysis.Types { /// @@ -57,6 +56,7 @@ public PythonTypeWrapper(BuiltinTypeId builtinTypeId, IPythonModule declaringMod #region IPythonType public virtual string Name => InnerType.Name; + public virtual string QualifiedName => InnerType.QualifiedName; public IPythonModule DeclaringModule { get; } public virtual string Documentation => InnerType.Documentation; public virtual BuiltinTypeId TypeId => InnerType.TypeId; diff --git a/src/Analysis/Ast/Impl/Types/PythonUnionType.cs b/src/Analysis/Ast/Impl/Types/PythonUnionType.cs index c5f83c75f..8d1a871e6 100644 --- a/src/Analysis/Ast/Impl/Types/PythonUnionType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonUnionType.cs @@ -26,11 +26,13 @@ internal sealed class PythonUnionType : LocatedMember, IPythonUnionType { private readonly HashSet _types = new HashSet(PythonTypeComparer.Instance); private readonly object _lock = new object(); - public PythonUnionType(IEnumerable types, IPythonModule declaringModule) : base(declaringModule) { + public PythonUnionType(IEnumerable types, IPythonModule declaringModule) + : base(declaringModule.Interpreter.ModuleResolution.GetSpecializedModule("typing")) { _types.UnionWith(types); } - private PythonUnionType(IPythonType x, IPythonType y) : base(x.DeclaringModule) { + private PythonUnionType(IPythonType x, IPythonType y) + : base(x.DeclaringModule.Interpreter.ModuleResolution.GetSpecializedModule("typing")) { Check.Argument(nameof(x), () => !(x is IPythonUnionType)); Check.Argument(nameof(y), () => !(y is IPythonUnionType)); _types.Add(x); @@ -49,8 +51,12 @@ public string Name { } } - public override IPythonModule DeclaringModule { - get { lock (_lock) { return _types.First().DeclaringModule; } } + public string QualifiedName { + get { + lock (_lock) { + return CodeFormatter.FormatSequence("typing:Union", '[', _types.Select(t => t.QualifiedName).ToArray()); + } + } } public BuiltinTypeId TypeId => BuiltinTypeId.Type; diff --git a/src/Analysis/Ast/Impl/Extensions/QualifiedNameExtensions.cs b/src/Analysis/Ast/Impl/Utilities/ReentrancyGuard.cs similarity index 65% rename from src/Analysis/Ast/Impl/Extensions/QualifiedNameExtensions.cs rename to src/Analysis/Ast/Impl/Utilities/ReentrancyGuard.cs index 09e7d64a3..c168dc409 100644 --- a/src/Analysis/Ast/Impl/Extensions/QualifiedNameExtensions.cs +++ b/src/Analysis/Ast/Impl/Utilities/ReentrancyGuard.cs @@ -15,13 +15,18 @@ using System.Collections.Generic; -namespace Microsoft.Python.Analysis { - internal static class QualifiedNameExtensions { - public static string CombineNames(this KeyValuePair qualifiedNamePair, string sep = ".") { - if (string.IsNullOrEmpty(qualifiedNamePair.Key)) { - return qualifiedNamePair.Value; +namespace Microsoft.Python.Analysis.Utilities { + public sealed class ReentrancyGuard { + private readonly Stack _processing = new Stack(); + + public bool Push(T t) { + if (_processing.Contains(t)) { + return false; } - return qualifiedNamePair.Key + sep + qualifiedNamePair.Value; + _processing.Push(t); + return true; } + + public void Pop() => _processing.Pop(); } } diff --git a/src/Analysis/Ast/Impl/Values/Collections/PythonCollection.cs b/src/Analysis/Ast/Impl/Values/Collections/PythonCollection.cs index fb25819c9..5598bb4b3 100644 --- a/src/Analysis/Ast/Impl/Values/Collections/PythonCollection.cs +++ b/src/Analysis/Ast/Impl/Values/Collections/PythonCollection.cs @@ -25,7 +25,7 @@ internal class PythonCollection : PythonInstance, IPythonCollection { /// Collection type. /// Contents of the collection (typically elements from the initialization). /// If true and contents is a single element - /// True if the contents are an exact representation of the collection contents. + /// True if the contents are an exact representation of the collection contents. /// and is a sequence, the sequence elements are copied rather than creating /// a sequence of sequences with a single element. public PythonCollection( diff --git a/src/Analysis/Ast/Impl/Values/Collections/PythonDictionary.cs b/src/Analysis/Ast/Impl/Values/Collections/PythonDictionary.cs index 53d9fef35..95cc1a0c9 100644 --- a/src/Analysis/Ast/Impl/Values/Collections/PythonDictionary.cs +++ b/src/Analysis/Ast/Impl/Values/Collections/PythonDictionary.cs @@ -36,27 +36,27 @@ public PythonDictionary(PythonDictionaryType dictType, IReadOnlyDictionary(), exact: exact) { + public PythonDictionary(IPythonModule declaringModule, IMember contents, bool exact = false) : + base(new PythonDictionaryType(declaringModule), Array.Empty(), exact: exact) { if (contents is IPythonDictionary dict) { foreach (var key in dict.Keys) { _contents[key] = dict[key]; } Contents = _contents.Keys.ToArray(); } - _interpreter = interpreter; + _interpreter = declaringModule.Interpreter; } - public PythonDictionary(IPythonInterpreter interpreter, IReadOnlyDictionary contents, bool exact = false) : - this(new PythonDictionaryType(interpreter), contents, exact: exact) { - _interpreter = interpreter; + public PythonDictionary(IPythonModule declaringModule, IReadOnlyDictionary contents, bool exact = false) : + this(new PythonDictionaryType(declaringModule), contents, exact: exact) { + _interpreter = declaringModule.Interpreter; } public IEnumerable Keys => _contents.Keys.ToArray(); public IEnumerable Values => _contents.Values.ToArray(); public IReadOnlyList Items - => _contents.Select(kvp => PythonCollectionType.CreateTuple(Type.DeclaringModule.Interpreter, new[] { kvp.Key, kvp.Value })).ToArray(); + => _contents.Select(kvp => PythonCollectionType.CreateTuple(Type.DeclaringModule.Interpreter.ModuleResolution.BuiltinsModule, new[] { kvp.Key, kvp.Value })).ToArray(); public IMember this[IMember key] => _contents.TryGetValue(key, out var value) ? value : UnknownType; @@ -92,7 +92,7 @@ public override IMember Call(string memberName, IArgumentSet args) { } private IPythonCollection CreateList(IReadOnlyList items) - => PythonCollectionType.CreateList(Type.DeclaringModule.Interpreter, items, false); + => PythonCollectionType.CreateList(Type.DeclaringModule.Interpreter.ModuleResolution.BuiltinsModule, items, false); private sealed class KeyComparer : IEqualityComparer { public bool Equals(IMember x, IMember y) { diff --git a/src/Analysis/Ast/Impl/Values/Collections/PythonInstanceIterator.cs b/src/Analysis/Ast/Impl/Values/Collections/PythonInstanceIterator.cs index 9dbdafffe..53ec70cb4 100644 --- a/src/Analysis/Ast/Impl/Values/Collections/PythonInstanceIterator.cs +++ b/src/Analysis/Ast/Impl/Values/Collections/PythonInstanceIterator.cs @@ -25,7 +25,7 @@ internal sealed class PythonInstanceIterator : PythonInstance, IPythonIterator { private readonly IPythonFunctionType __next__; public PythonInstanceIterator(IMember instance, IPythonInterpreter interpreter) - : base(new PythonIteratorType(BuiltinTypeId.SetIterator, interpreter)) { + : base(new PythonIteratorType(BuiltinTypeId.SetIterator, interpreter.ModuleResolution.BuiltinsModule)) { __next__ = instance.GetPythonType().GetMember(@"__next__") as IPythonFunctionType; } diff --git a/src/Analysis/Ast/Impl/Values/Collections/PythonTypeIterator.cs b/src/Analysis/Ast/Impl/Values/Collections/PythonTypeIterator.cs index 05bf9fa76..e901a292e 100644 --- a/src/Analysis/Ast/Impl/Values/Collections/PythonTypeIterator.cs +++ b/src/Analysis/Ast/Impl/Values/Collections/PythonTypeIterator.cs @@ -20,7 +20,7 @@ namespace Microsoft.Python.Analysis.Values.Collections { internal sealed class PythonTypeIterator : PythonInstance, IPythonIterator { private readonly BuiltinTypeId _contentType; public PythonTypeIterator(BuiltinTypeId iteratorType, BuiltinTypeId contentType, IPythonInterpreter interpreter) - : base(new PythonIteratorType(iteratorType, interpreter)) { + : base(new PythonIteratorType(iteratorType, interpreter.ModuleResolution.BuiltinsModule)) { _contentType = contentType; } diff --git a/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionAssertions.cs index cd1d846dd..5ba32fa27 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionAssertions.cs @@ -13,12 +13,10 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System; using System.Linq; using FluentAssertions; using FluentAssertions.Execution; using FluentAssertions.Primitives; -using Microsoft.Python.Analysis.Extensions; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using static Microsoft.Python.Analysis.Tests.FluentAssertions.AssertionsUtilities; diff --git a/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj b/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj index 4a7a9f7a7..a8e1ccc30 100644 --- a/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj +++ b/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj @@ -24,7 +24,6 @@ - @@ -42,6 +41,9 @@ + + + diff --git a/src/Analysis/Ast/Test/Properties/AssemblyInfo.cs b/src/Analysis/Ast/Test/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..9d32fae0c --- /dev/null +++ b/src/Analysis/Ast/Test/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Microsoft.Python.Analysis.Caching.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] diff --git a/src/Analysis/Core/Impl/Interpreter/LibraryType.cs b/src/Analysis/Core/Impl/Interpreter/LibraryType.cs new file mode 100644 index 000000000..851ec7d29 --- /dev/null +++ b/src/Analysis/Core/Impl/Interpreter/LibraryType.cs @@ -0,0 +1,38 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +namespace Microsoft.Python.Analysis.Core.Interpreter { + public enum LibraryType { + /// + /// Module is not a library. + /// + None, + + /// + /// Library is part of the standard Python installation. + /// + Standard, + + /// + /// Library is installed in site-packages. + /// + SitePackages, + + /// + /// Other type of library. + /// + Other + } +} diff --git a/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs b/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs index cb9eecb27..d95e35cf1 100644 --- a/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs +++ b/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs @@ -18,7 +18,6 @@ using System.Diagnostics; using System.IO; using System.Linq; -using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; @@ -35,34 +34,42 @@ public sealed class PythonLibraryPath { @"(?[^|]+)\|(?stdlib)?\|(?[^|]+)?" ); - public PythonLibraryPath(string path, bool isStandardLibrary, string modulePrefix) { + public PythonLibraryPath(string path, LibraryType libraryType, string modulePrefix) { Path = path; - IsStandardLibrary = isStandardLibrary; + LibraryType = libraryType; _modulePrefix = modulePrefix; } public string Path { get; } - - public bool IsStandardLibrary { get; } + public LibraryType LibraryType { get; } public string ModulePrefix => _modulePrefix ?? string.Empty; public override string ToString() - => "{0}|{1}|{2}".FormatInvariant(Path, IsStandardLibrary ? "stdlib" : "", _modulePrefix ?? ""); + => "{0}|{1}|{2}".FormatInvariant(Path, LibraryType == LibraryType.Standard ? "stdlib" : "", _modulePrefix ?? string.Empty); - public static PythonLibraryPath Parse(string s) { + public static PythonLibraryPath FromLibraryPath(string s, IFileSystem fs, string standardLibraryPath) { if (string.IsNullOrEmpty(s)) { - throw new ArgumentNullException("source"); + throw new ArgumentNullException(nameof(s)); } var m = ParseRegex.Match(s); if (!m.Success || !m.Groups["path"].Success) { throw new FormatException(); } - + + var libraryType = LibraryType.Other; + var sitePackagesPath = GetSitePackagesPath(standardLibraryPath); + var path = m.Groups["path"].Value; + if (m.Groups["stdlib"].Success) { + libraryType = LibraryType.Standard; + } else if(fs.IsPathUnderRoot(sitePackagesPath, path)) { + libraryType = LibraryType.SitePackages; + } + return new PythonLibraryPath( m.Groups["path"].Value, - m.Groups["stdlib"].Success, + libraryType, m.Groups["prefix"].Success ? m.Groups["prefix"].Value : null ); } @@ -71,25 +78,24 @@ public static PythonLibraryPath Parse(string s) { /// Gets the default set of search paths based on the path to the root /// of the standard library. /// - /// Root of the standard library. + /// Root of the standard library. /// A list of search paths for the interpreter. - /// New in 2.2, moved in 3.3 - public static List GetDefaultSearchPaths(string library) { + public static List GetDefaultSearchPaths(string standardLibraryPath) { var result = new List(); - if (!Directory.Exists(library)) { + if (!Directory.Exists(standardLibraryPath)) { return result; } - result.Add(new PythonLibraryPath(library, true, null)); + result.Add(new PythonLibraryPath(standardLibraryPath, LibraryType.Standard, null)); - var sitePackages = IOPath.Combine(library, "site-packages"); + var sitePackages = GetSitePackagesPath(standardLibraryPath); if (!Directory.Exists(sitePackages)) { return result; } - result.Add(new PythonLibraryPath(sitePackages, false, null)); + result.Add(new PythonLibraryPath(sitePackages, LibraryType.SitePackages, null)); result.AddRange(ModulePath.ExpandPathFiles(sitePackages) - .Select(p => new PythonLibraryPath(p, false, null)) + .Select(p => new PythonLibraryPath(p, LibraryType.SitePackages, null)) ); return result; @@ -101,7 +107,7 @@ public static List GetDefaultSearchPaths(string library) { public static async Task> GetSearchPathsAsync(InterpreterConfiguration config, IFileSystem fs, IProcessServices ps, CancellationToken cancellationToken = default) { for (int retries = 5; retries > 0; --retries) { try { - return await GetSearchPathsFromInterpreterAsync(config.InterpreterPath, fs, ps, cancellationToken); + return await GetSearchPathsFromInterpreterAsync(config, fs, ps, cancellationToken); } catch (InvalidOperationException) { // Failed to get paths break; @@ -111,23 +117,34 @@ public static async Task> GetSearchPathsAsync(Interpret } } - var ospy = PathUtils.FindFile(config.LibraryPath, "os.py"); - if (!string.IsNullOrEmpty(ospy)) { - return GetDefaultSearchPaths(IOPath.GetDirectoryName(ospy)); + var standardLibraryPath = GetStandardLibraryPath(config); + if (!string.IsNullOrEmpty(standardLibraryPath)) { + return GetDefaultSearchPaths(standardLibraryPath); } return Array.Empty(); } + public static string GetStandardLibraryPath(InterpreterConfiguration config) { + var ospy = PathUtils.FindFile(config.LibraryPath, "os.py"); + return !string.IsNullOrEmpty(ospy) ? IOPath.GetDirectoryName(ospy) : string.Empty; + } + + public static string GetSitePackagesPath(InterpreterConfiguration config) + => GetSitePackagesPath(GetStandardLibraryPath(config)); + + public static string GetSitePackagesPath(string standardLibraryPath) + => !string.IsNullOrEmpty(standardLibraryPath) ? IOPath.Combine(standardLibraryPath, "site-packages") : string.Empty; + /// /// Gets the set of search paths by running the interpreter. /// - /// Path to the interpreter. + /// Interpreter configuration. /// File system services. /// Process services. /// Cancellation token. /// A list of search paths for the interpreter. - public static async Task> GetSearchPathsFromInterpreterAsync(string interpreter, IFileSystem fs, IProcessServices ps, CancellationToken cancellationToken = default) { + public static async Task> GetSearchPathsFromInterpreterAsync(InterpreterConfiguration config, IFileSystem fs, IProcessServices ps, CancellationToken cancellationToken = default) { // sys.path will include the working directory, so we make an empty // path that we can filter out later var tempWorkingDir = IOPath.Combine(IOPath.GetTempPath(), IOPath.GetRandomFileName()); @@ -139,7 +156,7 @@ public static async Task> GetSearchPathsFromInterpreterA File.Copy(srcGetSearchPaths, getSearchPaths); var startInfo = new ProcessStartInfo( - interpreter, + config.InterpreterPath, new[] { "-S", "-E", getSearchPaths }.AsQuotedArguments() ) { WorkingDirectory = tempWorkingDir, @@ -152,12 +169,13 @@ public static async Task> GetSearchPathsFromInterpreterA try { var output = await ps.ExecuteAndCaptureOutputAsync(startInfo, cancellationToken); + var standardLibraryPath = GetSitePackagesPath(config); return output.Split(new [] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).Select(s => { if (s.PathStartsWith(tempWorkingDir)) { return null; } try { - return Parse(s); + return FromLibraryPath(s, fs, standardLibraryPath); } catch (ArgumentException) { Debug.Fail("Invalid search path: " + (s ?? "")); return null; diff --git a/src/Caching/Impl/Factories/ClassFactory.cs b/src/Caching/Impl/Factories/ClassFactory.cs new file mode 100644 index 000000000..bb7cb3138 --- /dev/null +++ b/src/Caching/Impl/Factories/ClassFactory.cs @@ -0,0 +1,50 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using System.Linq; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Core; +using Microsoft.Python.Parsing; + +namespace Microsoft.Python.Analysis.Caching.Factories { + internal sealed class ClassFactory : FactoryBase { + public ClassFactory(IEnumerable classes, ModuleFactory mf) + : base(classes, mf) { + } + + protected override PythonClassType CreateMember(ClassModel cm, IPythonType declaringType) + => new PythonClassType(cm.Name, ModuleFactory.DefaultLocation); + + protected override void CreateMemberParts(ClassModel cm, PythonClassType cls) { + // In Python 3 exclude object since type creation will add it automatically. + var is3x = ModuleFactory.Module.Interpreter.LanguageVersion.Is3x(); + var bases = cm.Bases.Select(b => is3x && b == "object" ? null : TryCreate(b)).ExcludeDefault().ToArray(); + cls.SetBases(bases); + + foreach (var f in cm.Methods) { + cls.AddMember(f.Name, ModuleFactory.FunctionFactory.Construct(f, cls, false), false); + } + foreach (var p in cm.Properties) { + cls.AddMember(p.Name, ModuleFactory.PropertyFactory.Construct(p, cls), false); + } + foreach (var c in cm.InnerClasses) { + cls.AddMember(c.Name, Construct(c, cls, false), false); + } + // TODO: fields. Bypass variable cache! + } + } +} diff --git a/src/Caching/Impl/Factories/FactoryBase.cs b/src/Caching/Impl/Factories/FactoryBase.cs new file mode 100644 index 000000000..9456eade4 --- /dev/null +++ b/src/Caching/Impl/Factories/FactoryBase.cs @@ -0,0 +1,66 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Types; + +namespace Microsoft.Python.Analysis.Caching.Factories { + internal abstract class FactoryBase : IDisposable + where TModel : MemberModel + where TMember : IMember { + + private class ModelData { + public TModel Model; + public TMember Member; + } + + private readonly Dictionary _data; + + protected ModuleFactory ModuleFactory { get; } + + protected FactoryBase(IEnumerable models, ModuleFactory mf) { + ModuleFactory = mf; + _data = models.ToDictionary(k => k.Name, v => new ModelData { Model = v }); + } + + public TMember TryCreate(string name, IPythonType declaringType = null) + => _data.TryGetValue(name, out var data) ? Construct(data.Model, declaringType) : default; + + public TMember Construct(TModel cm, IPythonType declaringType = null, bool cached = true) { + TMember m; + + if (!cached) { + m = CreateMember(cm, declaringType); + CreateMemberParts(cm, m); + return m; + } + + var data = _data[cm.Name]; + if (data.Member == null) { + data.Member = CreateMember(data.Model, declaringType); + CreateMemberParts(cm, data.Member); + } + return data.Member; + } + + public virtual void Dispose() => _data.Clear(); + + protected abstract TMember CreateMember(TModel model, IPythonType declaringType); + protected virtual void CreateMemberParts(TModel model, TMember member) { } + } +} diff --git a/src/Caching/Impl/Factories/FunctionFactory.cs b/src/Caching/Impl/Factories/FunctionFactory.cs new file mode 100644 index 000000000..b6f13f446 --- /dev/null +++ b/src/Caching/Impl/Factories/FunctionFactory.cs @@ -0,0 +1,42 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using System.Linq; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Types; + +namespace Microsoft.Python.Analysis.Caching.Factories { + internal sealed class FunctionFactory: FactoryBase { + public FunctionFactory(IEnumerable classes, ModuleFactory mf) + : base(classes, mf) { + } + + protected override IPythonFunctionType CreateMember(FunctionModel fm, IPythonType declaringType) { + var f = new PythonFunctionType(fm.Name, ModuleFactory.DefaultLocation, declaringType, fm.Documentation); + foreach (var om in fm.Overloads) { + var o = new PythonFunctionOverload(fm.Name, ModuleFactory.DefaultLocation); + o.SetDocumentation(fm.Documentation); + o.SetReturnValue(ModuleFactory.ConstructMember(om.ReturnType), true); + o.SetParameters(om.Parameters.Select(ConstructParameter).ToArray()); + f.AddOverload(o); + } + return f; + } + + private IParameterInfo ConstructParameter(ParameterModel pm) + => new ParameterInfo(pm.Name, ModuleFactory.ConstructType(pm.Type), pm.Kind, ModuleFactory.ConstructMember(pm.DefaultValue)); + } +} diff --git a/src/Caching/Impl/Factories/ModuleFactory.cs b/src/Caching/Impl/Factories/ModuleFactory.cs new file mode 100644 index 000000000..ad0fe4d6c --- /dev/null +++ b/src/Caching/Impl/Factories/ModuleFactory.cs @@ -0,0 +1,152 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Specializations.Typing; +using Microsoft.Python.Analysis.Specializations.Typing.Types; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Utilities; +using Microsoft.Python.Analysis.Values; + +namespace Microsoft.Python.Analysis.Caching.Factories { + internal sealed class ModuleFactory : IDisposable { + private static readonly ReentrancyGuard _processing = new ReentrancyGuard(); + + public IPythonModule Module { get; } + public ClassFactory ClassFactory { get; } + public FunctionFactory FunctionFactory { get; } + public PropertyFactory PropertyFactory { get; } + public VariableFactory VariableFactory { get; } + public Location DefaultLocation { get; } + + public ModuleFactory(ModuleModel model, IPythonModule module) { + Module = module; + ClassFactory = new ClassFactory(model.Classes, this); + FunctionFactory = new FunctionFactory(model.Functions, this); + VariableFactory = new VariableFactory(model.Variables, this); + PropertyFactory = new PropertyFactory(this); + DefaultLocation = new Location(Module); + } + + public void Dispose() { + ClassFactory.Dispose(); + FunctionFactory.Dispose(); + VariableFactory.Dispose(); + } + + public IPythonType ConstructType(string qualifiedName) => ConstructMember(qualifiedName)?.GetPythonType(); + + public IMember ConstructMember(string qualifiedName) { + if (!TypeNames.DeconstructQualifiedName(qualifiedName, out var moduleName, out var memberNames, out var isInstance)) { + return null; + } + + // TODO: better resolve circular references. + if (!_processing.Push(qualifiedName) || memberNames.Count < 2) { + return null; + } + + try { + // See if member is a module first. + var module = moduleName == Module.Name ? Module : Module.Interpreter.ModuleResolution.GetOrLoadModule(moduleName); + if (module == null) { + return null; + } + + var member = moduleName == Module.Name + ? GetMemberFromThisModule(memberNames) + : GetMemberFromModule(module, memberNames); + + if (!isInstance) { + return member; + } + + var t = member.GetPythonType() ?? module.Interpreter.UnknownType; + return new PythonInstance(t); + } finally { + _processing.Pop(); + } + } + + private IMember GetMemberFromModule(IPythonModule module, IReadOnlyList memberNames) { + if (memberNames.Count == 0) { + return null; + } + + IMember member = module; + foreach (var memberName in memberNames) { + var typeArgs = GetTypeArguments(memberName, out _); + + var mc = member as IMemberContainer; + Debug.Assert(mc != null); + member = mc?.GetMember(memberName); + + if (member == null) { + Debug.Assert(member != null); + break; + } + + member = typeArgs.Any() && member is IGenericType gt + ? gt.CreateSpecificType(typeArgs) + : member; + } + + return member; + } + + private IMember GetMemberFromThisModule(IReadOnlyList memberNames) { + if (memberNames.Count == 0) { + return null; + } + + // TODO: nested classes, etc (traverse parts and recurse). + var name = memberNames[0]; + return ClassFactory.TryCreate(name) + ?? (FunctionFactory.TryCreate(name) + ?? (IMember)VariableFactory.TryCreate(name)); + } + + private IReadOnlyList GetTypeArguments(string memberName, out string typeName) { + typeName = null; + // TODO: better handle generics. + // https://github.com/microsoft/python-language-server/issues/1215 + // Determine generic type arguments, if any, so we can construct + // complex types from parts, such as Union[typing.Any, a.b.c]. + var typeArgs = new List(); + var openBracket = memberName.IndexOf('['); + if (openBracket > 0) { + var closeBracket = memberName.LastIndexOf(']'); + if (closeBracket > 0) { + var argumentString = memberName.Substring(openBracket + 1, closeBracket - openBracket - 1); + var arguments = argumentString.Split(',').Select(s => s.Trim()).ToArray(); + foreach (var a in arguments) { + var t = ConstructType(a); + // TODO: better handle generics type definitions from TypeVar. + // https://github.com/microsoft/python-language-server/issues/1214 + t = t ?? new GenericTypeParameter(a, Module, Array.Empty(), string.Empty, DefaultLocation.IndexSpan); + typeArgs.Add(t); + } + typeName = memberName.Substring(0, openBracket); + } + } + return typeArgs; + } + } +} diff --git a/src/Caching/Impl/Factories/PropertyFactory.cs b/src/Caching/Impl/Factories/PropertyFactory.cs new file mode 100644 index 000000000..5673583f9 --- /dev/null +++ b/src/Caching/Impl/Factories/PropertyFactory.cs @@ -0,0 +1,37 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Types; + +namespace Microsoft.Python.Analysis.Caching.Factories { + internal sealed class PropertyFactory { + private readonly ModuleFactory _mf; + + public PropertyFactory(ModuleFactory mf) { + _mf = mf; + } + + public IPythonPropertyType Construct(PropertyModel pm, IPythonClassType cls) { + var prop = new PythonPropertyType(pm.Name, _mf.DefaultLocation, cls, (pm.Attributes & FunctionAttributes.Abstract) != 0); + prop.SetDocumentation(pm.Documentation); + var o = new PythonFunctionOverload(pm.Name, _mf.DefaultLocation); + o.SetDocumentation(pm.Documentation); // TODO: own documentation? + o.SetReturnValue(_mf.ConstructMember(pm.ReturnType), true); + prop.AddOverload(o); + return prop; + } + } +} diff --git a/src/Caching/Impl/Factories/VariableFactory.cs b/src/Caching/Impl/Factories/VariableFactory.cs new file mode 100644 index 000000000..b4f7adb54 --- /dev/null +++ b/src/Caching/Impl/Factories/VariableFactory.cs @@ -0,0 +1,32 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; + +namespace Microsoft.Python.Analysis.Caching.Factories { + internal sealed class VariableFactory : FactoryBase { + public VariableFactory(IEnumerable models, ModuleFactory mf) + : base(models, mf) { + } + + protected override IVariable CreateMember(VariableModel vm, IPythonType declaringType) { + var m = ModuleFactory.ConstructMember(vm.Value); + return new Variable(vm.Name, m, VariableSource.Declaration, ModuleFactory.DefaultLocation); + } + } +} diff --git a/src/Caching/Impl/GlobalScope.cs b/src/Caching/Impl/GlobalScope.cs new file mode 100644 index 000000000..d484c0d66 --- /dev/null +++ b/src/Caching/Impl/GlobalScope.cs @@ -0,0 +1,73 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Python.Analysis.Caching.Factories; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; +using Microsoft.Python.Core; +using Microsoft.Python.Parsing.Ast; + +namespace Microsoft.Python.Analysis.Caching { + internal sealed class GlobalScope : IGlobalScope { + private readonly VariableCollection _scopeVariables = new VariableCollection(); + + public GlobalScope(ModuleModel model, IPythonModule module, IServiceContainer services) { + Module = module; + Name = model.Name; + + using (var mf = new ModuleFactory(model, module)) { + // TODO: store real location in models + + // Member creation may be non-linear. Consider function A returning instance + // of a class or type info of a function which hasn't been created yet. + // Thus check if member has already been created first. + foreach (var cm in model.Classes) { + var cls = mf.ClassFactory.Construct(cm, null); + _scopeVariables.DeclareVariable(cm.Name, cls, VariableSource.Declaration, mf.DefaultLocation); + } + + foreach (var fm in model.Functions) { + var ft = mf.FunctionFactory.Construct(fm, null); + _scopeVariables.DeclareVariable(fm.Name, ft, VariableSource.Declaration, mf.DefaultLocation); + } + + foreach (var vm in model.Variables) { + var v = mf.VariableFactory.Construct(vm, null); + _scopeVariables.DeclareVariable(vm.Name, v.Value, VariableSource.Declaration, mf.DefaultLocation); + } + // TODO: re-declare __doc__, __name__, etc. + } + } + + public string Name { get; } + public ScopeStatement Node => null; + public IScope OuterScope => null; + public IReadOnlyList Children => Array.Empty(); + public IEnumerable EnumerateTowardsGlobal => Enumerable.Empty(); + public IEnumerable EnumerateFromGlobal => Enumerable.Empty(); + public IVariableCollection Variables => _scopeVariables; + public IVariableCollection NonLocals => VariableCollection.Empty; + public IVariableCollection Globals => VariableCollection.Empty; + public IPythonModule Module { get; } + IGlobalScope IScope.GlobalScope => this; + + public void DeclareVariable(string name, IMember value, VariableSource source, Location location = default) { } + public void LinkVariable(string name, IVariable v, Location location) => throw new NotImplementedException() { }; + } +} diff --git a/src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj b/src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj new file mode 100644 index 000000000..e81ee3640 --- /dev/null +++ b/src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj @@ -0,0 +1,41 @@ + + + netstandard2.0 + Microsoft.Python.Analysis.Caching + Microsoft.Python.Analysis.Caching + + + + 1701;1702;$(NoWarn) + 7.2 + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + + + + + + diff --git a/src/Caching/Impl/Models/ClassModel.cs b/src/Caching/Impl/Models/ClassModel.cs new file mode 100644 index 000000000..066642855 --- /dev/null +++ b/src/Caching/Impl/Models/ClassModel.cs @@ -0,0 +1,96 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Utilities; +using Microsoft.Python.Analysis.Values; +using Microsoft.Python.Core; + +namespace Microsoft.Python.Analysis.Caching.Models { + [DebuggerDisplay("c:{Name}")] + internal sealed class ClassModel: MemberModel { + public string Documentation { get; set; } + public string[] Bases { get; set; } + public FunctionModel[] Methods { get; set; } + public PropertyModel[] Properties { get; set; } + public VariableModel[] Fields { get; set; } + public string[] GenericParameters { get; set; } + public ClassModel[] InnerClasses { get; set; } + + private readonly ReentrancyGuard _processing = new ReentrancyGuard(); + + public static ClassModel FromType(IPythonClassType cls) => new ClassModel(cls); + + public ClassModel() { } // For de-serializer from JSON + + private ClassModel(IPythonClassType cls) { + var methods = new List(); + var properties = new List(); + var fields = new List(); + var innerClasses = new List(); + + // Skip certain members in order to avoid infinite recursion. + foreach (var name in cls.GetMemberNames().Except(new[] { "__base__", "__bases__", "__class__", "mro" })) { + var m = cls.GetMember(name); + + // Only take members from this class, skip members from bases. + if (m is IPythonClassMember cm && !cls.Equals(cm.DeclaringType)) { + continue; + } + + if (!_processing.Push(m)) { + continue; + } + + try { + switch (m) { + case IPythonClassType ct when ct.Name == name: + if (!ct.DeclaringModule.Equals(cls.DeclaringModule)) { + continue; + } + innerClasses.Add(FromType(ct)); + break; + case IPythonFunctionType ft when ft.Name == name: + methods.Add(FunctionModel.FromType(ft)); + break; + case IPythonPropertyType prop when prop.Name == name: + properties.Add(PropertyModel.FromType(prop)); + break; + case IPythonInstance inst: + fields.Add(VariableModel.FromInstance(name, inst)); + break; + case IPythonType t: + fields.Add(VariableModel.FromType(name, t)); + break; + } + } finally { + _processing.Pop(); + } + } + + Name = cls.TypeId == BuiltinTypeId.Ellipsis ? "ellipsis" : cls.Name; + Id = Name.GetStableHash(); + Documentation = cls.Documentation; + Bases = cls.Bases.OfType().Select(t => t.GetQualifiedName()).ToArray(); + Methods = methods.ToArray(); + Properties = properties.ToArray(); + Fields = fields.ToArray(); + InnerClasses = innerClasses.ToArray(); + } + } +} diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IPythonFile.cs b/src/Caching/Impl/Models/FunctionAttributes.cs similarity index 71% rename from src/Analysis/Ast/Impl/Types/Definitions/IPythonFile.cs rename to src/Caching/Impl/Models/FunctionAttributes.cs index 897c7bf48..1c0f3da74 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IPythonFile.cs +++ b/src/Caching/Impl/Models/FunctionAttributes.cs @@ -15,16 +15,12 @@ using System; -namespace Microsoft.Python.Analysis.Types { - public interface IPythonFile { - /// - /// File path to the module. - /// - string FilePath { get; } - - /// - /// Module URI. - /// - Uri Uri { get; } +namespace Microsoft.Python.Analysis.Caching.Models { + [Flags] + internal enum FunctionAttributes { + Normal, + Abstract, + Static, + ClassMethod } } diff --git a/src/Caching/Impl/Models/FunctionModel.cs b/src/Caching/Impl/Models/FunctionModel.cs new file mode 100644 index 000000000..39bf2c374 --- /dev/null +++ b/src/Caching/Impl/Models/FunctionModel.cs @@ -0,0 +1,52 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Diagnostics; +using System.Linq; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Core; + +namespace Microsoft.Python.Analysis.Caching.Models { + [DebuggerDisplay("f:{Name}")] + internal sealed class FunctionModel: MemberModel { + public string Documentation { get; set; } + public OverloadModel[] Overloads { get; set; } + public FunctionAttributes Attributes { get; set; } + public string[] Classes { get; set; } + public string[] Functions { get; set; } + + public static FunctionModel FromType(IPythonFunctionType ft) { + return new FunctionModel { + Id = ft.Name.GetStableHash(), + Name = ft.Name, + Documentation = ft.Documentation, + Overloads = ft.Overloads.Select(FromOverload).ToArray() + // TODO: attributes, inner functions and inner classes. + }; + } + + private static OverloadModel FromOverload(IPythonFunctionOverload o) { + return new OverloadModel { + Parameters = o.Parameters.Select(p => new ParameterModel { + Name = p.Name, + Type = p.Type.GetQualifiedName(), + Kind = p.Kind, + DefaultValue = p.DefaultValue.GetQualifiedName(), + }).ToArray(), + ReturnType = o.StaticReturnValue.GetQualifiedName() + }; + } + } +} diff --git a/src/Caching/Impl/Models/MemberModel.cs b/src/Caching/Impl/Models/MemberModel.cs new file mode 100644 index 000000000..158d4ba44 --- /dev/null +++ b/src/Caching/Impl/Models/MemberModel.cs @@ -0,0 +1,21 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +namespace Microsoft.Python.Analysis.Caching.Models { + internal abstract class MemberModel { + public int Id { get; set; } + public string Name { get; set; } + } +} diff --git a/src/Caching/Impl/Models/ModuleModel.cs b/src/Caching/Impl/Models/ModuleModel.cs new file mode 100644 index 000000000..9a01a1a29 --- /dev/null +++ b/src/Caching/Impl/Models/ModuleModel.cs @@ -0,0 +1,80 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using System.Linq; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; +using Microsoft.Python.Core; + +namespace Microsoft.Python.Analysis.Caching.Models { + internal sealed class ModuleModel : MemberModel { + public string UniqueId { get; set; } + public string Documentation { get; set; } + public FunctionModel[] Functions { get; set; } + public VariableModel[] Variables { get; set; } + public ClassModel[] Classes { get; set; } + // TODO: TypeVars, ... + + public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceContainer services) { + var variables = new Dictionary(); + var functions = new Dictionary(); + var classes = new Dictionary(); + + // Go directly through variables which names are listed in GetMemberNames + // as well as variables that are declarations. + var exportedNames = new HashSet(analysis.Document.GetMemberNames()); + foreach (var v in analysis.GlobalScope.Variables + .Where(v => exportedNames.Contains(v.Name) || v.Source == VariableSource.Declaration || v.Source == VariableSource.Builtin)) { + // Create type model before variable since variable needs it. + string typeName = null; + + switch (v.Value) { + case IPythonFunctionType ft + when ft.DeclaringModule.Equals(analysis.Document) || ft.DeclaringModule.Equals(analysis.Document.Stub): + if (!functions.ContainsKey(ft.Name)) { + typeName = ft.Name; + functions[ft.Name] = FunctionModel.FromType(ft); + } + + break; + case IPythonClassType cls + when cls.DeclaringModule.Equals(analysis.Document) || cls.DeclaringModule.Equals(analysis.Document.Stub): + if (!classes.ContainsKey(cls.Name)) { + typeName = cls.Name; + classes[cls.Name] = ClassModel.FromType(cls); + } + break; + } + + // Do not re-declare classes and functions as variables in the model. + if (typeName == null && !variables.ContainsKey(v.Name)) { + variables[v.Name] = VariableModel.FromVariable(v); + } + } + + var uniqueId = analysis.Document.GetUniqieId(services); + return new ModuleModel { + Id = uniqueId.GetStableHash(), + UniqueId = uniqueId, + Name = analysis.Document.Name, + Documentation = analysis.Document.Documentation, + Functions = functions.Values.ToArray(), + Variables = variables.Values.ToArray(), + Classes = classes.Values.ToArray() + }; + } + } +} diff --git a/src/Caching/Impl/Models/OverloadModel.cs b/src/Caching/Impl/Models/OverloadModel.cs new file mode 100644 index 000000000..1f0014eef --- /dev/null +++ b/src/Caching/Impl/Models/OverloadModel.cs @@ -0,0 +1,21 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +namespace Microsoft.Python.Analysis.Caching.Models { + internal sealed class OverloadModel { + public ParameterModel[] Parameters { get; set; } + public string ReturnType { get; set; } + } +} diff --git a/src/Caching/Impl/Models/ParameterModel.cs b/src/Caching/Impl/Models/ParameterModel.cs new file mode 100644 index 000000000..6006b385b --- /dev/null +++ b/src/Caching/Impl/Models/ParameterModel.cs @@ -0,0 +1,25 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using Microsoft.Python.Parsing.Ast; + +namespace Microsoft.Python.Analysis.Caching.Models { + internal sealed class ParameterModel { + public string Name { get; set; } + public string Type { get; set; } + public string DefaultValue { get; set; } + public ParameterKind Kind { get; set; } + } +} diff --git a/src/Caching/Impl/Models/PropertyModel.cs b/src/Caching/Impl/Models/PropertyModel.cs new file mode 100644 index 000000000..9d67c3c09 --- /dev/null +++ b/src/Caching/Impl/Models/PropertyModel.cs @@ -0,0 +1,35 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Core; + +namespace Microsoft.Python.Analysis.Caching.Models { + internal sealed class PropertyModel: MemberModel { + public string Documentation { get; set; } + public string ReturnType { get; set; } + public FunctionAttributes Attributes { get; set; } + + public static PropertyModel FromType(IPythonPropertyType prop) { + return new PropertyModel { + Id = prop.Name.GetStableHash(), + Name = prop.Name, + Documentation = prop.Documentation, + ReturnType = prop.ReturnType.GetQualifiedName(), + // TODO: attributes. + }; + } + } +} diff --git a/src/Caching/Impl/Models/TypeVarModel.cs b/src/Caching/Impl/Models/TypeVarModel.cs new file mode 100644 index 000000000..eeae11354 --- /dev/null +++ b/src/Caching/Impl/Models/TypeVarModel.cs @@ -0,0 +1,24 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Diagnostics; + +namespace Microsoft.Python.Analysis.Caching.Models { + [DebuggerDisplay("t:{Name}")] + internal sealed class TypeVarModel { + public string Name { get; set; } + public string[] Constraints { get; set; } + } +} diff --git a/src/Caching/Impl/Models/VariableModel.cs b/src/Caching/Impl/Models/VariableModel.cs new file mode 100644 index 000000000..f80a41555 --- /dev/null +++ b/src/Caching/Impl/Models/VariableModel.cs @@ -0,0 +1,44 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Diagnostics; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; +using Microsoft.Python.Core; + +namespace Microsoft.Python.Analysis.Caching.Models { + [DebuggerDisplay("v:{Name} = {Value}")] + internal sealed class VariableModel: MemberModel { + public string Value { get; set; } + + public static VariableModel FromVariable(IVariable v) => new VariableModel { + Id = v.Name.GetStableHash(), + Name = v.Name, + Value = v.Value.GetQualifiedName() + }; + + public static VariableModel FromInstance(string name, IPythonInstance inst) => new VariableModel { + Id = name.GetStableHash(), + Name = name, + Value = inst.GetQualifiedName() + }; + + public static VariableModel FromType(string name, IPythonType t) => new VariableModel { + Id = name.GetStableHash(), + Name = name, + Value = t.QualifiedName + }; + } +} diff --git a/src/Caching/Impl/ModuleDatabase.cs b/src/Caching/Impl/ModuleDatabase.cs new file mode 100644 index 000000000..f8a1860f0 --- /dev/null +++ b/src/Caching/Impl/ModuleDatabase.cs @@ -0,0 +1,156 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using LiteDB; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Modules; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Core; +using Microsoft.Python.Core.IO; +using Microsoft.Python.Core.Logging; + +namespace Microsoft.Python.Analysis.Caching { + public sealed class ModuleDatabase : IModuleDatabaseService { + private const int _databaseFormatVersion = 1; + + private readonly IServiceContainer _services; + private readonly ILogger _log; + private readonly IFileSystem _fs; + private readonly string _databaseFolder; + + public ModuleDatabase(IServiceContainer services) { + _services = services; + _log = services.GetService(); + _fs = services.GetService(); + var cfs = services.GetService(); + _databaseFolder = Path.Combine(cfs.CacheFolder, $"analysis.v{_databaseFormatVersion}"); + } + + /// + /// Retrieves module representation from module index database + /// or null if module does not exist. + /// + /// Module name. If the name is not qualified + /// the module will ge resolved against active Python version. + /// Module file path. + /// Python module. + /// Module storage state + public ModuleStorageState TryCreateModule(string moduleName, string filePath, out IPythonModule module) { + module = null; + // We don't cache results here. Module resolution service decides when to call in here + // and it is responsible of overall management of the loaded Python modules. + for (var retries = 50; retries > 0; --retries) { + try { + // TODO: make combined db rather than per module? + var dbPath = FindDatabaseFile(moduleName, filePath); + if (string.IsNullOrEmpty(dbPath)) { + return ModuleStorageState.DoesNotExist; + } + + using (var db = new LiteDatabase(dbPath)) { + if (!db.CollectionExists("modules")) { + return ModuleStorageState.Corrupted; + } + + var modules = db.GetCollection("modules"); + var model = modules.Find(m => m.Name == moduleName).FirstOrDefault(); + if (model == null) { + return ModuleStorageState.DoesNotExist; + } + + module = new PythonDbModule(model, filePath, _services); + return ModuleStorageState.Complete; + } + } catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) { + Thread.Sleep(10); + } + } + return ModuleStorageState.DoesNotExist; + } + + public Task StoreModuleAnalysisAsync(IDocumentAnalysis analysis, CancellationToken cancellationToken = default) + => Task.Run(() => StoreModuleAnalysis(analysis, cancellationToken)); + + private void StoreModuleAnalysis(IDocumentAnalysis analysis, CancellationToken cancellationToken = default) { + var model = ModuleModel.FromAnalysis(analysis, _services); + Exception ex = null; + for (var retries = 50; retries > 0; --retries) { + cancellationToken.ThrowIfCancellationRequested(); + try { + if (!_fs.DirectoryExists(_databaseFolder)) { + _fs.CreateDirectory(_databaseFolder); + } + + cancellationToken.ThrowIfCancellationRequested(); + using (var db = new LiteDatabase(Path.Combine(_databaseFolder, $"{model.UniqueId}.db"))) { + var modules = db.GetCollection("modules"); + modules.Upsert(model); + return; + } + } catch (Exception ex1) when (ex1 is IOException || ex1 is UnauthorizedAccessException) { + ex = ex1; + Thread.Sleep(10); + } catch (Exception ex2) { + ex = ex2; + break; + } + } + + if (ex != null) { + _log?.Log(System.Diagnostics.TraceEventType.Warning, $"Unable to write analysis of {model.Name} to database. Exception {ex.Message}"); + if (ex.IsCriticalException()) { + throw ex; + } + } + } + + /// + /// Locates database file based on module information. Module is identified + /// by name, version, current Python interpreter version and/or hash of the + /// module content (typically file sizes). + /// + private string FindDatabaseFile(string moduleName, string filePath) { + var interpreter = _services.GetService(); + var uniqueId = ModuleUniqueId.GetUniqieId(moduleName, filePath, ModuleType.Specialized, _services); + if (string.IsNullOrEmpty(uniqueId)) { + return null; + } + + // Try module name as is. + var dbPath = Path.Combine(_databaseFolder, $"{uniqueId}.db"); + if (_fs.FileExists(dbPath)) { + return dbPath; + } + + // TODO: resolving to a different version can be an option + // Try with the major.minor Python version. + var pythonVersion = interpreter.Configuration.Version; + + dbPath = Path.Combine(_databaseFolder, $"{uniqueId}({pythonVersion.Major}.{pythonVersion.Minor}).db"); + if (_fs.FileExists(dbPath)) { + return dbPath; + } + + // Try with just the major Python version. + dbPath = Path.Combine(_databaseFolder, $"{uniqueId}({pythonVersion.Major}).db"); + return _fs.FileExists(dbPath) ? dbPath : null; + } + } +} diff --git a/src/Caching/Impl/ModuleUniqueId.cs b/src/Caching/Impl/ModuleUniqueId.cs new file mode 100644 index 000000000..7c5e7524d --- /dev/null +++ b/src/Caching/Impl/ModuleUniqueId.cs @@ -0,0 +1,88 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.IO; +using System.Linq; +using System.Security.Cryptography; +using Microsoft.Python.Analysis.Core.Interpreter; +using Microsoft.Python.Analysis.Modules; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Core; +using Microsoft.Python.Core.IO; + +namespace Microsoft.Python.Analysis.Caching { + internal static class ModuleUniqueId { + public static string GetUniqieId(this IPythonModule module, IServiceContainer services) + => GetUniqieId(module.Name, module.FilePath, module.ModuleType, services); + + public static string GetUniqieId(string moduleName, string filePath, ModuleType moduleType, IServiceContainer services) { + var interpreter = services.GetService(); + var fs = services.GetService(); + + if (moduleType == ModuleType.User) { + // Only for tests. + return $"{moduleName}"; + } + + var config = interpreter.Configuration; + var standardLibraryPath = PythonLibraryPath.GetStandardLibraryPath(config); + var sitePackagesPath = PythonLibraryPath.GetSitePackagesPath(config); + + if (!string.IsNullOrEmpty(filePath) && fs.IsPathUnderRoot(sitePackagesPath, filePath)) { + // If module is in site-packages and is versioned, then unique id = name + version + interpreter version. + // Example: 'requests' and 'requests-2.21.0.dist-info'. + var moduleFolder = Path.GetDirectoryName(Path.GetDirectoryName(filePath)); + + // TODO: for egg (https://github.com/microsoft/python-language-server/issues/196), consider *.egg-info + var folders = fs + .GetFileSystemEntries(moduleFolder, "*-*.dist-info", SearchOption.TopDirectoryOnly) + .Select(Path.GetFileName) + .Where(n => n.StartsWith(moduleName, StringComparison.OrdinalIgnoreCase)) // Module name can be capitalized differently. + .ToArray(); + + if (folders.Length == 1) { + var fileName = Path.GetFileNameWithoutExtension(folders[0]); + var dash = fileName.IndexOf('-'); + return $"{fileName.Substring(0, dash)}({fileName.Substring(dash + 1)})"; + } + } + + if (moduleType == ModuleType.Builtins || moduleType == ModuleType.CompiledBuiltin || + string.IsNullOrEmpty(filePath) || fs.IsPathUnderRoot(standardLibraryPath, filePath)) { + // If module is a standard library, unique id is its name + interpreter version. + return $"{moduleName}({config.Version.Major}.{config.Version.Minor})"; + } + + // If all else fails, hash module data. + return $"{moduleName}.{HashModuleContent(Path.GetDirectoryName(filePath), fs)}"; + } + + private static string HashModuleContent(string moduleFolder, IFileSystem fs) { + // Hash file sizes + using (var sha256 = SHA256.Create()) { + var total = fs + .GetFileSystemEntries(moduleFolder, "*.*", SearchOption.AllDirectories) + .Where(fs.FileExists) + .Select(fs.FileSize) + .Aggregate((hash, e) => unchecked(hash * 31 ^ e.GetHashCode())); + + return Convert + .ToBase64String(sha256.ComputeHash(BitConverter.GetBytes(total))) + .Replace('/', '_').Replace('+', '-'); + } + } + } +} diff --git a/src/Caching/Impl/Properties/AssemblyInfo.cs b/src/Caching/Impl/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..9d32fae0c --- /dev/null +++ b/src/Caching/Impl/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Microsoft.Python.Analysis.Caching.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] diff --git a/src/Caching/Impl/PythonDbModule.cs b/src/Caching/Impl/PythonDbModule.cs new file mode 100644 index 000000000..e54562f72 --- /dev/null +++ b/src/Caching/Impl/PythonDbModule.cs @@ -0,0 +1,35 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Modules; +using Microsoft.Python.Core; + +namespace Microsoft.Python.Analysis.Caching { + internal sealed class PythonDbModule : SpecializedModule { + public PythonDbModule(ModuleModel model, string filePath, IServiceContainer services) + : base(model.Name, string.Empty, services) { + FilePath = filePath; + GlobalScope = new GlobalScope(model, this, services); + Documentation = model.Documentation; + } + + protected override string LoadContent() => string.Empty; + + public override string Documentation { get; } + public override IEnumerable GetMemberNames() => GlobalScope.Variables.Names; + } +} diff --git a/src/Caching/Impl/TypeNames.cs b/src/Caching/Impl/TypeNames.cs new file mode 100644 index 000000000..5408d724f --- /dev/null +++ b/src/Caching/Impl/TypeNames.cs @@ -0,0 +1,117 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using Microsoft.Python.Analysis.Modules; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; + +namespace Microsoft.Python.Analysis.Caching { + internal static class TypeNames { + public static string GetQualifiedName(this IMember m) { + var t = m.GetPythonType(); + if (!t.IsUnknown()) { + switch (m) { + case IPythonInstance _: + return $"i:{t.QualifiedName}"; + case IPythonType pt when pt.DeclaringModule.ModuleType == ModuleType.Builtins: + return pt.TypeId == BuiltinTypeId.Ellipsis ? "ellipsis" : pt.Name; + case IPythonType pt: + return pt.QualifiedName; + case null: + break; + } + } + return null; + } + + /// + /// Splits qualified type name in form of i:A(3.6).B.C into parts. as well as determines if + /// qualified name designates instance (prefixed with 'i:'). + /// + /// Qualified name to split. May include instance prefix. + /// Module name. + /// Module member names such as 'A', 'B', 'C' from module:A.B.C. + /// If true, the qualified name describes instance of a type. + public static bool DeconstructQualifiedName(string qualifiedName, out string moduleName, out IReadOnlyList memberNames, out bool isInstance) { + moduleName = null; + memberNames = null; + isInstance = false; + + if (string.IsNullOrEmpty(qualifiedName)) { + return false; + } + + isInstance = qualifiedName.StartsWith("i:"); + qualifiedName = isInstance ? qualifiedName.Substring(2) : qualifiedName; + + if (qualifiedName == "..." || qualifiedName == "ellipsis") { + moduleName = @"builtins"; + memberNames = new[] { "ellipsis" }; + return true; + } + + var moduleSeparatorIndex = qualifiedName.IndexOf(':'); + if (moduleSeparatorIndex < 0) { + moduleName = @"builtins"; + memberNames = new[] { qualifiedName }; + return true; + } + + moduleName = qualifiedName.Substring(0, moduleSeparatorIndex); + // First chunk is qualified module name except dots in braces. + // Builtin types don't have module prefix. + memberNames = GetParts(qualifiedName.Substring(moduleSeparatorIndex+1)); + return !string.IsNullOrEmpty(moduleName); + } + + private static IReadOnlyList GetParts(string qualifiedTypeName) { + var parts = new List(); + for (var i = 0; i < qualifiedTypeName.Length; i++) { + var part = GetSubPart(qualifiedTypeName, ref i); + if (string.IsNullOrEmpty(part)) { + break; + } + parts.Add(part); + } + return parts; + } + + private static string GetSubPart(string s, ref int i) { + var braceCounter = new Stack(); + var start = i; + for (; i < s.Length; i++) { + var ch = s[i]; + + if (ch == '[') { + braceCounter.Push(ch); + continue; + } + + if (ch == ']') { + if (braceCounter.Count > 0) { + braceCounter.Pop(); + } + } + + if (braceCounter.Count == 0 && ch == '.') { + break; + } + } + + return s.Substring(start, i - start); + } + } +} diff --git a/src/Caching/Test/AnalysisCachingTestBase.cs b/src/Caching/Test/AnalysisCachingTestBase.cs new file mode 100644 index 000000000..e22be40a4 --- /dev/null +++ b/src/Caching/Test/AnalysisCachingTestBase.cs @@ -0,0 +1,46 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.IO; +using System.Reflection; +using System.Text; +using Microsoft.Python.Analysis.Tests; +using Microsoft.Python.Core.IO; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Newtonsoft.Json; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Caching.Tests { + public abstract class AnalysisCachingTestBase: AnalysisTestBase { + protected string ToJson(object model) { + var sb = new StringBuilder(); + using (var sw = new StringWriter(sb)) + using (var jw = new JsonTextWriter(sw)) { + jw.Formatting = Formatting.Indented; + var js = new JsonSerializer(); + js.Serialize(jw, model); + } + return sb.ToString(); + } + + protected string BaselineFilesFolder { + get { + var testAssembly = Assembly.GetExecutingAssembly().GetAssemblyPath(); + var outDirectory = Path.GetDirectoryName(testAssembly); + return Path.GetFullPath(Path.Combine(outDirectory, "..", "..", "..", "src", "Caching", "Test", "Files")); + } + } + } +} diff --git a/src/Caching/Test/AssemblySetup.cs b/src/Caching/Test/AssemblySetup.cs new file mode 100644 index 000000000..4e92972b6 --- /dev/null +++ b/src/Caching/Test/AssemblySetup.cs @@ -0,0 +1,34 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using Microsoft.Python.Core.Testing; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Caching.Tests { + [TestClass] + public sealed class AssemblySetup { + [AssemblyInitialize] + public static void Initialize(TestContext testContext) => AnalysisTestEnvironment.Initialize(); + + private class AnalysisTestEnvironment : TestEnvironmentImpl, ITestEnvironment { + public static void Initialize() { + var instance = new AnalysisTestEnvironment(); + Instance = instance; + TestEnvironment.Current = instance; + } + } + } +} diff --git a/src/Caching/Test/BasicTests.cs b/src/Caching/Test/BasicTests.cs new file mode 100644 index 000000000..277b60814 --- /dev/null +++ b/src/Caching/Test/BasicTests.cs @@ -0,0 +1,183 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.IO; +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Caching.Tests.FluentAssertions; +using Microsoft.Python.Analysis.Modules; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Core.IO; +using Microsoft.Python.Parsing.Tests; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Caching.Tests { + [TestClass] + public class BasicTests : AnalysisCachingTestBase { + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + private string BaselineFileName => Path.ChangeExtension(Path.Combine(BaselineFilesFolder, TestContext.TestName), "json"); + + [TestMethod, Priority(0)] + public async Task SmokeTest() { + const string code = @" +x = 'str' + +class C: + x: int + def __init__(self): + self.y = 1 + + def method(self): + return func() + + @property + def prop(self) -> int: + return x + +def func(): + return 2.0 + +c = C() +"; + var analysis = await GetAnalysisAsync(code); + var model = ModuleModel.FromAnalysis(analysis, Services); + var json = ToJson(model); + Baseline.CompareToFile(BaselineFileName, json); + } + + [TestMethod, Priority(0)] + public async Task NestedClasses() { + const string code = @" +x = 'str' + +class A: + def methodA(self): + return True + +class B: + x: int + + class C: + def __init__(self): + self.y = 1 + def methodC(self): + return False + + def methodB1(self): + return C() + + def methodB2(self): + return C().y + +c = B().methodB1() +"; + var analysis = await GetAnalysisAsync(code); + var model = ModuleModel.FromAnalysis(analysis, Services); + var json = ToJson(model); + Baseline.CompareToFile(BaselineFileName, json); + } + + [TestMethod, Priority(0)] + public async Task Builtins() { + var analysis = await GetAnalysisAsync(string.Empty); + var builtins = analysis.Document.Interpreter.ModuleResolution.BuiltinsModule; + var model = ModuleModel.FromAnalysis(builtins.Analysis, Services); + + var json = ToJson(model); + Baseline.CompareToFile(BaselineFileName, json); + + var dbModule = new PythonDbModule(model, null, Services); + dbModule.Should().HaveSameMembersAs(builtins); + } + + + [TestMethod, Priority(0)] + public async Task Sys() { + var analysis = await GetAnalysisAsync("import sys"); + var sys = analysis.Document.Interpreter.ModuleResolution.GetImportedModule("sys"); + var model = ModuleModel.FromAnalysis(sys.Analysis, Services); + + var json = ToJson(model); + Baseline.CompareToFile(BaselineFileName, json); + + using (var dbModule = new PythonDbModule(model, sys.FilePath, Services)) { + dbModule.Should().HaveSameMembersAs(sys); + } + } + + [TestMethod, Priority(0)] + public async Task Requests() { + const string code = @" +import requests +x = requests.get('microsoft.com') +"; + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + var v = analysis.GlobalScope.Variables["requests"]; + v.Should().NotBeNull(); + if (v.Value.GetPythonType().ModuleType == ModuleType.Unresolved) { + Assert.Inconclusive("'requests' package is not installed."); + } + + var rq = analysis.Document.Interpreter.ModuleResolution.GetImportedModule("requests"); + var model = ModuleModel.FromAnalysis(rq.Analysis, Services); + + var u = model.UniqueId; + u.Should().Contain("(").And.EndWith(")"); + var open = u.IndexOf('('); + // Verify this looks like a version. + new Version(u.Substring(open + 1, u.IndexOf(')') - open - 1)); + + var json = ToJson(model); + Baseline.CompareToFile(BaselineFileName, json); + + using (var dbModule = new PythonDbModule(model, rq.FilePath, Services)) { + dbModule.Should().HaveSameMembersAs(rq); + } + } + + [DataTestMethod, Priority(0)] + [DataRow("", null, null, false)] + [DataRow("str", "builtins", "str", false)] + [DataRow("i:str", "builtins", "str", true)] + [DataRow("i:...", "builtins", "ellipsis", true)] + [DataRow("ellipsis", "builtins", "ellipsis", false)] + [DataRow("i:builtins:str", "builtins", "str", true)] + [DataRow("i:mod:x", "mod", "x", true)] + [DataRow("typing:Union[str, tuple]", "typing", "Union[str, tuple]", false)] + [DataRow("typing:Union[typing:Any, mod:y]", "typing", "Union[typing:Any, mod:y]", false)] + [DataRow("typing:Union[typing:Union[str, int], mod:y]", "typing", "Union[typing:Union[str, int], mod:y]", false)] + public void QualifiedNames(string qualifiedName, string moduleName, string typeName, bool isInstance) { + TypeNames.DeconstructQualifiedName(qualifiedName, out var actualModuleName, out var actualMemberNames, out var actualIsInstance); + actualModuleName.Should().Be(moduleName); + if (string.IsNullOrEmpty(qualifiedName)) { + actualMemberNames.Should().BeNull(); + } else { + actualMemberNames[0].Should().Be(typeName); + } + actualIsInstance.Should().Be(isInstance); + } + } +} diff --git a/src/Caching/Test/Files/Builtins.json b/src/Caching/Test/Files/Builtins.json new file mode 100644 index 000000000..8fff2c8a0 --- /dev/null +++ b/src/Caching/Test/Files/Builtins.json @@ -0,0 +1,31830 @@ +{ + "UniqueId": "builtins(3.7)", + "Documentation": "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", + "Functions": [ + { + "Documentation": "", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24816593, + "Name": "type" + }, + { + "Documentation": "__build_class__(func, name, *bases, metaclass=None, **kwds) -> class\n\nInternal helper function used by the class statement.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "func", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bases", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "metaclass", + "Type": null, + "DefaultValue": null, + "Kind": 3 + }, + { + "Name": "kwds", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 186877360, + "Name": "__build_class__" + }, + { + "Documentation": "__import__(name, globals=None, locals=None, fromlist=(), level=0) -> module\n\nImport a module. Because this function is meant for use by the Python\ninterpreter and not for general use, it is better to use\nimportlib.import_module() to programmatically import a module.\n\nThe globals argument is only used to determine the context;\nthey are not modified. The locals argument is unused. The fromlist\nshould be a list of names to emulate ``from name import ...'', or an\nempty list to emulate ``import name''.\nWhen importing a module from a package, note that __import__('A.B', ...)\nreturns package A when fromlist is empty, but its submodule B when\nfromlist is not empty. The level argument is used to determine whether to\nperform absolute or relative imports: 0 is absolute, while a positive number\nis the number of parent directories to search relative to the current module.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "globals", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "locals", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "fromlist", + "Type": "tuple", + "DefaultValue": "i:tuple", + "Kind": 0 + }, + { + "Name": "level", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -200972932, + "Name": "__import__" + }, + { + "Documentation": "Return the absolute value of the argument.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "x", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 781563, + "Name": "abs" + }, + { + "Documentation": "Return True if bool(x) is True for all values x in the iterable.\n\nIf the iterable is empty, return True.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 781866, + "Name": "all" + }, + { + "Documentation": "Return True if bool(x) is True for any x in the iterable.\n\nIf the iterable is empty, return False.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 781941, + "Name": "any" + }, + { + "Documentation": "Return an ASCII-only representation of an object.\n\nAs repr(), return a string containing a printable representation of an\nobject, but escape the non-ASCII characters in the string returned by\nrepr() using \\\\x, \\\\u or \\\\U escapes. This generates a string similar\nto that returned by repr() in Python 2.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "obj", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 751576474, + "Name": "ascii" + }, + { + "Documentation": "Return the binary representation of an integer.\n\n >>> bin(2796202)\n '0b1010101010101010101010'", + "Overloads": [ + { + "Parameters": [ + { + "Name": "number", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 782736, + "Name": "bin" + }, + { + "Documentation": "breakpoint(*args, **kws)\n\nCall sys.breakpointhook(*args, **kws). sys.breakpointhook() must accept\nwhatever arguments are passed.\n\nBy default, this drops you into the pdb debugger.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kws", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1356147896, + "Name": "breakpoint" + }, + { + "Documentation": "Return whether the object is callable (i.e., some kind of function).\n\nNote that classes are callable, as are instances of classes with a\n__call__() method.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "obj", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1205971407, + "Name": "callable" + }, + { + "Documentation": "Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "i", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 783670, + "Name": "chr" + }, + { + "Documentation": "Compile source into a code object that can be executed by exec() or eval().\n\nThe source code may represent a Python module, statement or expression.\nThe filename will be used for run-time error messages.\nThe mode must be 'exec' to compile a module, 'single' to compile a\nsingle (interactive) statement, or 'eval' to compile an expression.\nThe flags argument, if present, controls which future statements influence\nthe compilation of the code.\nThe dont_inherit argument, if true, stops the compilation inheriting\nthe effects of any future statements in effect in the code calling\ncompile; if absent or false these statements do influence the compilation,\nin addition to any features explicitly specified.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "source", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "filename", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "mode", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "flags", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "dont_inherit", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "optimize", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1914543556, + "Name": "compile" + }, + { + "Documentation": "interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1298046352, + "Name": "copyright" + }, + { + "Documentation": "interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1836401501, + "Name": "credits" + }, + { + "Documentation": "Deletes the named attribute from the given object.\n\ndelattr(x, 'y') is equivalent to ``del x.y''", + "Overloads": [ + { + "Parameters": [ + { + "Name": "obj", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1314690939, + "Name": "delattr" + }, + { + "Documentation": "dir([object]) -> list of strings\n\nIf called without an argument, return the names in the current scope.\nElse, return an alphabetized list of names comprising (some of) the attributes\nof the given object, and of attributes reachable from it.\nIf the object supplies a method named __dir__, it will be used; otherwise\nthe default dir() logic is used and returns:\n for a module object: the module's attributes.\n for a class object: its attributes, and recursively the attributes\n of its bases.\n for any other object: its attributes, its class's attributes, and\n recursively the attributes of its class's base classes.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "object", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 784662, + "Name": "dir" + }, + { + "Documentation": "Return the tuple (x//y, x%y). Invariant: div*y + mod == x.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "x", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "y", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1901256616, + "Name": "divmod" + }, + { + "Documentation": "Evaluate the given source in the context of globals and locals.\n\nThe source may be a string representing a Python expression\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "source", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "globals", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "locals", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "object" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24366387, + "Name": "eval" + }, + { + "Documentation": "Execute the given source in the context of globals and locals.\n\nThe source may be a string representing one or more Python statements\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "source", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "globals", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "locals", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24368424, + "Name": "exec" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "code", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24368565, + "Name": "exit" + }, + { + "Documentation": "Return value.__format__(format_spec)\n\nformat_spec defaults to the empty string.\nSee the Format Specification Mini-Language section of help('FORMATTING') for\ndetails.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "format_spec", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1963936462, + "Name": "format" + }, + { + "Documentation": "getattr(object, name[, default]) -> value\n\nGet a named attribute from an object; getattr(x, 'y') is equivalent to x.y.\nWhen a default argument is given, it is returned when the attribute doesn't\nexist; without it, an exception is raised in that case.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "object", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "default", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1355208272, + "Name": "getattr" + }, + { + "Documentation": "Return the dictionary containing the current scope's global variables.\n\nNOTE: Updates to this dictionary *will* affect name lookups in the current\nglobal scope and vice-versa.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:dict" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1551006009, + "Name": "globals" + }, + { + "Documentation": "Return whether the object has an attribute with the given name.\n\nThis is done by calling getattr(obj, name) and catching AttributeError.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "obj", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2127271828, + "Name": "hasattr" + }, + { + "Documentation": "Return the hash value for the given object.\n\nTwo objects that compare equal must also have the same hash value, but the\nreverse is not necessarily true.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "obj", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24436133, + "Name": "hash" + }, + { + "Documentation": "Define the builtin 'help'.\n\n This is a wrapper around pydoc.help that provides a helpful message\n when 'help' is typed at the Python interactive prompt.\n\n Calling help() at the Python prompt starts an interactive help session.\n Calling help(thing) prints help for the python object 'thing'.\n ", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwds", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24439768, + "Name": "help" + }, + { + "Documentation": "Return the hexadecimal representation of an integer.\n\n >>> hex(12648430)\n '0xc0ffee'", + "Overloads": [ + { + "Parameters": [ + { + "Name": "number", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 788388, + "Name": "hex" + }, + { + "Documentation": "Return the identity of an object.\n\nThis is guaranteed to be unique among simultaneously existing objects.\n(CPython uses the object's memory address.)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "obj", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 25458, + "Name": "id" + }, + { + "Documentation": "Read a string from standard input. The trailing newline is stripped.\n\nThe prompt string, if given, is printed to standard output without a\ntrailing newline before reading input.\n\nIf the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.\nOn *nix systems, readline is used if available.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "prompt", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 758828563, + "Name": "input" + }, + { + "Documentation": "Return whether an object is an instance of a class or of a subclass thereof.\n\nA tuple, as in ``isinstance(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``isinstance(x, A) or isinstance(x, B)\nor ...`` etc.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "obj", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "class_or_tuple", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1317005078, + "Name": "isinstance" + }, + { + "Documentation": "Return whether 'cls' is a derived from another class or is the same class.\n\nA tuple, as in ``issubclass(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``issubclass(x, A) or issubclass(x, B)\nor ...`` etc.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "class_or_tuple", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1314249287, + "Name": "issubclass" + }, + { + "Documentation": "iter(iterable) -> iterator\niter(callable, sentinel) -> iterator\n\nGet an iterator from an object. In the first form, the argument must\nsupply its own iterator, or be a sequence.\nIn the second form, the callable is called until it returns the sentinel.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "callable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sentinel", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24483759, + "Name": "iter" + }, + { + "Documentation": "Return the number of items in a container.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "obj", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 792222, + "Name": "len" + }, + { + "Documentation": "interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1596689482, + "Name": "license" + }, + { + "Documentation": "Return a dictionary containing the current scope's local variables.\n\nNOTE: Whether or not updates to this dictionary will affect name lookups in\nthe local scope and vice-versa is *implementation dependent* and not\ncovered by any backwards compatibility guarantees.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:dict" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2135253311, + "Name": "locals" + }, + { + "Documentation": "max(iterable, *[, default=obj, key=func]) -> value\nmax(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its biggest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the largest argument.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "default", + "Type": null, + "DefaultValue": null, + "Kind": 3 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 3 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 793069, + "Name": "max" + }, + { + "Documentation": "min(iterable, *[, default=obj, key=func]) -> value\nmin(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its smallest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the smallest argument.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "default", + "Type": null, + "DefaultValue": null, + "Kind": 3 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 3 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 793307, + "Name": "min" + }, + { + "Documentation": "next(iterator[, default])\n\nReturn the next item from the iterator. If default is given and the iterator\nis exhausted, it is returned instead of raising StopIteration.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "iterator", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "default", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24618890, + "Name": "next" + }, + { + "Documentation": "Return the octal representation of an integer.\n\n >>> oct(342391)\n '0o1234567'", + "Overloads": [ + { + "Parameters": [ + { + "Name": "number", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 795049, + "Name": "oct" + }, + { + "Documentation": "Open file and return a stream. Raise OSError upon failure.\n\nfile is either a text or byte string giving the name (and the path\nif the file isn't in the current working directory) of the file to\nbe opened or an integer file descriptor of the file to be\nwrapped. (If a file descriptor is given, it is closed when the\nreturned I/O object is closed, unless closefd is set to False.)\n\nmode is an optional string that specifies the mode in which the file\nis opened. It defaults to 'r' which means open for reading in text\nmode. Other common values are 'w' for writing (truncating the file if\nit already exists), 'x' for creating and writing to a new file, and\n'a' for appending (which on some Unix systems, means that all writes\nappend to the end of the file regardless of the current seek position).\nIn text mode, if encoding is not specified the encoding used is platform\ndependent: locale.getpreferredencoding(False) is called to get the\ncurrent locale encoding. (For reading and writing raw bytes use binary\nmode and leave encoding unspecified.) The available modes are:\n\n========= ===============================================================\nCharacter Meaning\n--------- ---------------------------------------------------------------\n'r' open for reading (default)\n'w' open for writing, truncating the file first\n'x' create a new file and open it for writing\n'a' open for writing, appending to the end of the file if it exists\n'b' binary mode\n't' text mode (default)\n'+' open a disk file for updating (reading and writing)\n'U' universal newline mode (deprecated)\n========= ===============================================================\n\nThe default mode is 'rt' (open for reading text). For binary random\naccess, the mode 'w+b' opens and truncates the file to 0 bytes, while\n'r+b' opens the file without truncation. The 'x' mode implies 'w' and\nraises an `FileExistsError` if the file already exists.\n\nPython distinguishes between files opened in binary and text modes,\neven when the underlying operating system doesn't. Files opened in\nbinary mode (appending 'b' to the mode argument) return contents as\nbytes objects without any decoding. In text mode (the default, or when\n't' is appended to the mode argument), the contents of the file are\nreturned as strings, the bytes having been first decoded using a\nplatform-dependent encoding or using the specified encoding if given.\n\n'U' mode is deprecated and will raise an exception in future versions\nof Python. It has no effect in Python 3. Use newline to control\nuniversal newlines mode.\n\nbuffering is an optional integer used to set the buffering policy.\nPass 0 to switch buffering off (only allowed in binary mode), 1 to select\nline buffering (only usable in text mode), and an integer > 1 to indicate\nthe size of a fixed-size chunk buffer. When no buffering argument is\ngiven, the default buffering policy works as follows:\n\n* Binary files are buffered in fixed-size chunks; the size of the buffer\n is chosen using a heuristic trying to determine the underlying device's\n \"block size\" and falling back on `io.DEFAULT_BUFFER_SIZE`.\n On many systems, the buffer will typically be 4096 or 8192 bytes long.\n\n* \"Interactive\" text files (files for which isatty() returns True)\n use line buffering. Other text files use the policy described above\n for binary files.\n\nencoding is the name of the encoding used to decode or encode the\nfile. This should only be used in text mode. The default encoding is\nplatform dependent, but any encoding supported by Python can be\npassed. See the codecs module for the list of supported encodings.\n\nerrors is an optional string that specifies how encoding errors are to\nbe handled---this argument should not be used in binary mode. Pass\n'strict' to raise a ValueError exception if there is an encoding error\n(the default of None has the same effect), or pass 'ignore' to ignore\nerrors. (Note that ignoring encoding errors can lead to data loss.)\nSee the documentation for codecs.register or run 'help(codecs.Codec)'\nfor a list of the permitted encoding error strings.\n\nnewline controls how universal newlines works (it only applies to text\nmode). It can be None, '', '\\n', '\\r', and '\\r\\n'. It works as\nfollows:\n\n* On input, if newline is None, universal newlines mode is\n enabled. Lines in the input can end in '\\n', '\\r', or '\\r\\n', and\n these are translated into '\\n' before being returned to the\n caller. If it is '', universal newline mode is enabled, but line\n endings are returned to the caller untranslated. If it has any of\n the other legal values, input lines are only terminated by the given\n string, and the line ending is returned to the caller untranslated.\n\n* On output, if newline is None, any '\\n' characters written are\n translated to the system default line separator, os.linesep. If\n newline is '' or '\\n', no translation takes place. If newline is any\n of the other legal values, any '\\n' characters written are translated\n to the given string.\n\nIf closefd is False, the underlying file descriptor will be kept open\nwhen the file is closed. This does not work when a file name is given\nand must be True in that case.\n\nA custom opener can be used by passing a callable as *opener*. The\nunderlying file descriptor for the file object is then obtained by\ncalling *opener* with (*file*, *flags*). *opener* must return an open\nfile descriptor (passing os.open as *opener* results in functionality\nsimilar to passing None).\n\nopen() returns a file object whose type depends on the mode, and\nthrough which the standard file operations such as reading and writing\nare performed. When open() is used to open a file in a text mode ('w',\n'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open\na file in a binary mode, the returned class varies: in read binary\nmode, it returns a BufferedReader; in write binary and append binary\nmodes, it returns a BufferedWriter, and in read/write mode, it returns\na BufferedRandom.\n\nIt is also possible to use a string or bytearray as a file for both\nreading and writing. For strings StringIO can be used like a file\nopened in a text mode, and for bytes a BytesIO can be used like a file\nopened in a binary mode.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "file", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "mode", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "buffering", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "encoding", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "errors", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "newline", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "closefd", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "opener", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24658657, + "Name": "open" + }, + { + "Documentation": "Return the Unicode code point for a one-character string.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "c", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 795498, + "Name": "ord" + }, + { + "Documentation": "Equivalent to x**y (with two arguments) or x**y % z (with three arguments)\n\nSome types, such as ints, are able to use a more efficient algorithm when\ninvoked using the three argument form.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "x", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "y", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "z", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 796385, + "Name": "pow" + }, + { + "Documentation": "print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)\n\nPrints the values to a stream, or to sys.stdout by default.\nOptional keyword arguments:\nfile: a file-like object (stream); defaults to the current sys.stdout.\nsep: string inserted between values, default a space.\nend: string appended after the last value, default a newline.\nflush: whether to forcibly flush the stream.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 765405430, + "Name": "print" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "code", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24723174, + "Name": "quit" + }, + { + "Documentation": "", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 766750598, + "Name": "range" + }, + { + "Documentation": "Return the canonical string representation of the object.\n\nFor many object types, including most builtins, eval(repr(obj)) == obj.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "obj", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24737804, + "Name": "repr" + }, + { + "Documentation": "Round a number to a given precision in decimal digits.\n\nThe return value is an integer if ndigits is omitted or None. Otherwise\nthe return value has the same type as the number. ndigits may be negative.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "number", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "ndigits", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 767174615, + "Name": "round" + }, + { + "Documentation": "Sets the named attribute on the given object to the specified value.\n\nsetattr(x, 'y', v) is equivalent to ``x.y = v''", + "Overloads": [ + { + "Parameters": [ + { + "Name": "obj", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -879649444, + "Name": "setattr" + }, + { + "Documentation": "Return a new list containing all items from the iterable in ascending order.\n\nA custom key function can be supplied to customize the sort order, and the\nreverse flag can be set to request the result in descending order.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1958845036, + "Name": "sorted" + }, + { + "Documentation": "Return the sum of a 'start' value (default: 0) plus an iterable of numbers\n\nWhen the iterable is empty, return the start value.\nThis function is intended specifically for use with numeric values and may\nreject non-numeric types.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 799444, + "Name": "sum" + }, + { + "Documentation": "vars([object]) -> dictionary\n\nWithout arguments, equivalent to locals().\nWith an argument, equivalent to object.__dict__.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "object", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24853187, + "Name": "vars" + }, + { + "Documentation": "", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 783823, + "Name": "cmp" + } + ], + "Variables": [ + { + "Value": "object", + "Id": 376535734, + "Name": "__Object__" + }, + { + "Value": "int", + "Id": -1660953576, + "Name": "__Int__" + }, + { + "Value": "bool", + "Id": -149570207, + "Name": "__Bool__" + }, + { + "Value": "int", + "Id": 136686707, + "Name": "__Long__" + }, + { + "Value": "float", + "Id": -1172856571, + "Name": "__Float__" + }, + { + "Value": "complex", + "Id": -1125625831, + "Name": "__Complex__" + }, + { + "Value": "tuple", + "Id": -1373807759, + "Name": "__Tuple__" + }, + { + "Value": "list", + "Id": 131307029, + "Name": "__List__" + }, + { + "Value": "dict", + "Id": -98202835, + "Name": "__Dict__" + }, + { + "Value": "set", + "Id": -1651986485, + "Name": "__Set__" + }, + { + "Value": "frozenset", + "Id": -1845664181, + "Name": "__FrozenSet__" + }, + { + "Value": "bytes", + "Id": -50989228, + "Name": "__Bytes__" + }, + { + "Value": "bytes_iterator", + "Id": 1196082274, + "Name": "__BytesIterator__" + }, + { + "Value": "str", + "Id": -667382010, + "Name": "__Unicode__" + }, + { + "Value": "str_iterator", + "Id": 899385876, + "Name": "__UnicodeIterator__" + }, + { + "Value": "str", + "Id": -1651541542, + "Name": "__Str__" + }, + { + "Value": "str_iterator", + "Id": -1693163288, + "Name": "__StrIterator__" + }, + { + "Value": "module", + "Id": -318216541, + "Name": "__Module__" + }, + { + "Value": "function", + "Id": -56357041, + "Name": "__Function__" + }, + { + "Value": "wrapper_descriptor", + "Id": 2031680028, + "Name": "__BuiltinMethodDescriptor__" + }, + { + "Value": "builtin_function_or_method", + "Id": -998173500, + "Name": "__BuiltinFunction__" + }, + { + "Value": "generator", + "Id": 1086442300, + "Name": "__Generator__" + }, + { + "Value": "property", + "Id": -919605748, + "Name": "__Property__" + }, + { + "Value": "classmethod", + "Id": -991650526, + "Name": "__ClassMethod__" + }, + { + "Value": "staticmethod", + "Id": 1863225126, + "Name": "__StaticMethod__" + }, + { + "Value": "ellipsis", + "Id": 961323528, + "Name": "__Ellipsis__" + }, + { + "Value": "tuple_iterator", + "Id": 1754184575, + "Name": "__TupleIterator__" + }, + { + "Value": "list_iterator", + "Id": 692195875, + "Name": "__ListIterator__" + }, + { + "Value": "dict_keys", + "Id": -414283327, + "Name": "__DictKeys__" + }, + { + "Value": "dict_values", + "Id": -623419857, + "Name": "__DictValues__" + }, + { + "Value": "dict_items", + "Id": -1322081197, + "Name": "__DictItems__" + }, + { + "Value": "set_iterator", + "Id": 1366627801, + "Name": "__SetIterator__" + }, + { + "Value": "callable_iterator", + "Id": 1819825725, + "Name": "__CallableIterator__" + }, + { + "Value": null, + "Id": -2048509720, + "Name": "__builtin_module_names__" + }, + { + "Value": "i:ellipsis", + "Id": 1631567368, + "Name": "Ellipsis" + }, + { + "Value": "i:OSError", + "Id": 763574764, + "Name": "EnvironmentError" + }, + { + "Value": "i:OSError", + "Id": -172840821, + "Name": "IOError" + }, + { + "Value": "i:NotImplementedType", + "Id": -1818427354, + "Name": "NotImplemented" + }, + { + "Value": "i:OSError", + "Id": 1763918588, + "Name": "WindowsError" + }, + { + "Value": null, + "Id": -1636005055, + "Name": "__doc__" + }, + { + "Value": null, + "Id": 1097116834, + "Name": "__name__" + }, + { + "Value": null, + "Id": 75395663, + "Name": "__package__" + }, + { + "Value": "bool", + "Id": 23856709, + "Name": "True" + }, + { + "Value": "bool", + "Id": 726114124, + "Name": "False" + }, + { + "Value": "__NoneType__", + "Id": 23674863, + "Name": "None" + } + ], + "Classes": [ + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "NotImplementedType", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "NotImplementedType", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "NotImplementedType", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -544113923, + "Name": "__reduce__" + }, + { + "Documentation": "Return repr(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "NotImplementedType", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1215429388, + "Name": "__repr__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "NotImplementedType", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 2136768640, + "Name": "NotImplementedType" + }, + { + "Documentation": "", + "Bases": [], + "Methods": [], + "Properties": [], + "Fields": [ + { + "Value": null, + "Id": 1097116834, + "Name": "__name__" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 1423120691, + "Name": "__Unknown__" + }, + { + "Documentation": "the type of the None object", + "Bases": [], + "Methods": [], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 1499999113, + "Name": "__NoneType__" + }, + { + "Documentation": "The most base type", + "Bases": [], + "Methods": [ + { + "Documentation": "Implement delattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2095540485, + "Name": "__delattr__" + }, + { + "Documentation": "Default dir() implementation.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1636169386, + "Name": "__dir__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "Default object formatter.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "format_spec", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 695475534, + "Name": "__format__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "The most base type", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return self integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given. If x is a number, return x.__int__(). For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base. The literal can be preceded by '+' or '-' and be surrounded\nby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n>>> int('0b100', base=0)\n4", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "abs(self)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1639147525, + "Name": "__abs__" + }, + { + "Documentation": "Return self+value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1639102358, + "Name": "__add__" + }, + { + "Documentation": "Return self&value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1638804448, + "Name": "__and__" + }, + { + "Documentation": "self != 0", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 766562625, + "Name": "__bool__" + }, + { + "Documentation": "Ceiling of an Integral returns itself.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 785777820, + "Name": "__ceil__" + }, + { + "Documentation": "Return divmod(self, value).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 589685672, + "Name": "__divmod__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "float(self)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1457457445, + "Name": "__float__" + }, + { + "Documentation": "Flooring an Integral returns itself.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1457872597, + "Name": "__floor__" + }, + { + "Documentation": "Return self//value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 778272028, + "Name": "__floordiv__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "format_spec", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 695475534, + "Name": "__format__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "Return self converted to an integer, if self is suitable for use as an index into a list.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -127776229, + "Name": "__index__" + }, + { + "Documentation": "int([x]) -> integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given. If x is a number, return x.__int__(). For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base. The literal can be preceded by '+' or '-' and be surrounded\nby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n>>> int('0b100', base=0)\n4", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "x", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "base", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "int(self)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1631400904, + "Name": "__int__" + }, + { + "Documentation": "~self", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 849070445, + "Name": "__invert__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return self<>self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1555101003, + "Name": "__rrshift__" + }, + { + "Documentation": "Return self>>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -900426137, + "Name": "__rshift__" + }, + { + "Documentation": "Return value-self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1228492261, + "Name": "__rsub__" + }, + { + "Documentation": "Return value/self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1563284312, + "Name": "__rtruediv__" + }, + { + "Documentation": "Return value^self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1232946496, + "Name": "__rxor__" + }, + { + "Documentation": "Returns size in memory, in bytes.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1069167279, + "Name": "__sizeof__" + }, + { + "Documentation": "Return str(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1621988870, + "Name": "__str__" + }, + { + "Documentation": "Return self-value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1621974455, + "Name": "__sub__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + }, + { + "Documentation": "Return self/value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:float" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -375214324, + "Name": "__truediv__" + }, + { + "Documentation": "Truncating an Integral returns itself.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1175294069, + "Name": "__trunc__" + }, + { + "Documentation": "Return self^value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1617520220, + "Name": "__xor__" + }, + { + "Documentation": "Number of bits necessary to represent self in binary.\n\n>>> bin(37)\n'0b100101'\n>>> (37).bit_length()\n6", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 641823151, + "Name": "bit_length" + }, + { + "Documentation": "Returns self, the complex conjugate of any int.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:complex" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -903692703, + "Name": "conjugate" + }, + { + "Documentation": "Return the integer represented by the given array of bytes.\n\n bytes\n Holds the array of bytes to convert. The argument must either\n support the buffer protocol or be an iterable object producing bytes.\n Bytes and bytearray are examples of built-in objects that support the\n buffer protocol.\n byteorder\n The byte order used to represent the integer. If byteorder is 'big',\n the most significant byte is at the beginning of the byte array. If\n byteorder is 'little', the most significant byte is at the end of the\n byte array. To request the native byte order of the host system, use\n `sys.byteorder' as the byte order value.\n signed\n Indicates whether two's complement is used to represent the integer.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "type", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bytes", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "byteorder", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -190029075, + "Name": "from_bytes" + }, + { + "Documentation": "Return an array of bytes representing an integer.\n\n length\n Length of bytes object to use. An OverflowError is raised if the\n integer is not representable with the given number of bytes.\n byteorder\n The byte order used to represent the integer. If byteorder is 'big',\n the most significant byte is at the beginning of the byte array. If\n byteorder is 'little', the most significant byte is at the end of the\n byte array. To request the native byte order of the host system, use\n `sys.byteorder' as the byte order value.\n signed\n Determines whether two's complement is used to represent the integer.\n If signed is False and a negative integer is given, an OverflowError\n is raised.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "length", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "byteorder", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -71556418, + "Name": "to_bytes" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 985628143, + "Name": "denominator" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 24476897, + "Name": "imag" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 1522491474, + "Name": "numerator" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 24737333, + "Name": "real" + } + ], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 789624, + "Name": "int" + }, + { + "Documentation": "bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.", + "Bases": [ + "int" + ], + "Methods": [ + { + "Documentation": "Return self&value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1638804448, + "Name": "__and__" + }, + { + "Documentation": "bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "x", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return self|value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748671418, + "Name": "__or__" + }, + { + "Documentation": "Return value&self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1211662268, + "Name": "__rand__" + }, + { + "Documentation": "Return repr(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1215429388, + "Name": "__repr__" + }, + { + "Documentation": "Return value|self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1623061346, + "Name": "__ror__" + }, + { + "Documentation": "Return value^self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1232946496, + "Name": "__rxor__" + }, + { + "Documentation": "Return str(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1621988870, + "Name": "__str__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + }, + { + "Documentation": "Return self^value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1617520220, + "Name": "__xor__" + }, + { + "Documentation": "Return the integer represented by the given array of bytes.\n\n bytes\n Holds the array of bytes to convert. The argument must either\n support the buffer protocol or be an iterable object producing bytes.\n Bytes and bytearray are examples of built-in objects that support the\n buffer protocol.\n byteorder\n The byte order used to represent the integer. If byteorder is 'big',\n the most significant byte is at the beginning of the byte array. If\n byteorder is 'little', the most significant byte is at the end of the\n byte array. To request the native byte order of the host system, use\n `sys.byteorder' as the byte order value.\n signed\n Indicates whether two's complement is used to represent the integer.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "type", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bytes", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "byteorder", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -190029075, + "Name": "from_bytes" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 24270721, + "Name": "bool" + }, + { + "Documentation": "Convert a string or number to a floating point number, if possible.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "abs(self)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:float" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1639147525, + "Name": "__abs__" + }, + { + "Documentation": "Return self+value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:float" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1639102358, + "Name": "__add__" + }, + { + "Documentation": "self != 0", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 766562625, + "Name": "__bool__" + }, + { + "Documentation": "Return divmod(self, value).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 589685672, + "Name": "__divmod__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "float(self)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1457457445, + "Name": "__float__" + }, + { + "Documentation": "Return self//value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 778272028, + "Name": "__floordiv__" + }, + { + "Documentation": "Formats the float according to format_spec.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "format_spec", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 695475534, + "Name": "__format__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "You probably don't want to use this function.\n\n typestr\n Must be 'double' or 'float'.\n\nIt exists mainly to be used in Python's test suite.\n\nThis function returns whichever of 'unknown', 'IEEE, big-endian' or 'IEEE,\nlittle-endian' best describes the format of floating point numbers used by the\nC type named by typestr.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "type", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "typestr", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1018863830, + "Name": "__getformat__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "Convert a string or number to a floating point number, if possible.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "int(self)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1631400904, + "Name": "__int__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return self>> (10.0).as_integer_ratio()\n(10, 1)\n>>> (0.0).as_integer_ratio()\n(0, 1)\n>>> (-.25).as_integer_ratio()\n(-1, 4)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1148559724, + "Name": "as_integer_ratio" + }, + { + "Documentation": "Return self, the complex conjugate of any float.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:complex" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -903692703, + "Name": "conjugate" + }, + { + "Documentation": "Create a floating-point number from a hexadecimal string.\n\n>>> float.fromhex('0x1.ffffp10')\n2047.984375\n>>> float.fromhex('-0x1p-1074')\n-5e-324", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "type", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "string", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 835611450, + "Name": "fromhex" + }, + { + "Documentation": "Return a hexadecimal representation of a floating-point number.\n\n>>> (-0.1).hex()\n'-0x1.999999999999ap-4'\n>>> 3.14159.hex()\n'0x1.921f9f01b866ep+1'", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 788388, + "Name": "hex" + }, + { + "Documentation": "Return True if the float is an integer.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 783186560, + "Name": "is_integer" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 24476897, + "Name": "imag" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 24737333, + "Name": "real" + } + ], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 755996837, + "Name": "float" + }, + { + "Documentation": "Create a complex number from a real part and an optional imaginary part.\n\nThis is equivalent to (real + imag*1j) where imag defaults to 0.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "abs(self)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:complex" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1639147525, + "Name": "__abs__" + }, + { + "Documentation": "Return self+value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:complex" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1639102358, + "Name": "__add__" + }, + { + "Documentation": "self != 0", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 766562625, + "Name": "__bool__" + }, + { + "Documentation": "Return divmod(self, value).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 589685672, + "Name": "__divmod__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "float(self)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1457457445, + "Name": "__float__" + }, + { + "Documentation": "Return self//value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 778272028, + "Name": "__floordiv__" + }, + { + "Documentation": "complex.__format__() -> str\n\nConvert to a string according to format_spec.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "format_spec", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 695475534, + "Name": "__format__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "Create a complex number from a real part and an optional imaginary part.\n\nThis is equivalent to (real + imag*1j) where imag defaults to 0.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "int(self)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1631400904, + "Name": "__int__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return self complex\n\nReturn the complex conjugate of its argument. (3-4j).conjugate() == 3+4j.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "complex", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:complex" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -903692703, + "Name": "conjugate" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 24476897, + "Name": "imag" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 24737333, + "Name": "real" + } + ], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": -1914540871, + "Name": "complex" + }, + { + "Documentation": "Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return self+value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1639102358, + "Name": "__add__" + }, + { + "Documentation": "Return key in self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1841774666, + "Name": "__contains__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple_iterator" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "x.__getitem__(y) <==> x[y]", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "index", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Implement self+=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 953701999, + "Name": "__iadd__" + }, + { + "Documentation": "Implement self*=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965298386, + "Name": "__imul__" + }, + { + "Documentation": "Built-in mutable sequence.\n\nIf no argument is given, the constructor creates a new empty list.\nThe argument must be an iterable if specified.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "list", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list_iterator" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self new empty dictionary\ndict(mapping) -> new dictionary initialized from a mapping object's\n (key, value) pairs\ndict(iterable) -> new dictionary initialized as if via:\n d = {}\n for k, v in iterable:\n d[k] = v\ndict(**kwargs) -> new dictionary initialized with the name=value pairs\n in the keyword argument list. For example: dict(one=1, two=2)", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "True if the dictionary has the specified key, else False.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1841774666, + "Name": "__contains__" + }, + { + "Documentation": "Delete self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1970845273, + "Name": "__delitem__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "x.__getitem__(y) <==> x[y]", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "dict() -> new empty dictionary\ndict(mapping) -> new dictionary initialized from a mapping object's\n (key, value) pairs\ndict(iterable) -> new dictionary initialized as if via:\n d = {}\n for k, v in iterable:\n d[k] = v\ndict(**kwargs) -> new dictionary initialized with the name=value pairs\n in the keyword argument list. For example: dict(one=1, two=2)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict_keys" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self size of D in memory, in bytes", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1069167279, + "Name": "__sizeof__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + }, + { + "Documentation": "D.clear() -> None. Remove all items from D.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 753216662, + "Name": "clear" + }, + { + "Documentation": "D.copy() -> a shallow copy of D", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24300556, + "Name": "copy" + }, + { + "Documentation": "Create a new dictionary with keys from iterable and values set to value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "type", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 134240693, + "Name": "fromkeys" + }, + { + "Documentation": "Return the value for key if key is in the dictionary, else default.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "default", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 787423, + "Name": "get" + }, + { + "Documentation": "D.items() -> a set-like object providing a view on D's items", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict_items" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 758996489, + "Name": "items" + }, + { + "Documentation": "D.keys() -> a set-like object providing a view on D's keys", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict_keys" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24529547, + "Name": "keys" + }, + { + "Documentation": "D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\nIf key is not found, d is returned if given, otherwise KeyError is raised", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "k", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "d", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict_keys" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 796378, + "Name": "pop" + }, + { + "Documentation": "D.popitem() -> (k, v), remove and return some (key, value) pair as a\n2-tuple; but raise KeyError if D is empty.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "k", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "d", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict_items" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1035642093, + "Name": "popitem" + }, + { + "Documentation": "Insert key with a value of default if key is not in the dictionary.\n\nReturn the value for key if key is in the dictionary, else default.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "default", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 178640630, + "Name": "setdefault" + }, + { + "Documentation": "D.update([E, ]**F) -> None. Update D from dict/iterable E and F.\nIf E is present and has a .keys() method, then does: for k in E: D[k] = E[k]\nIf E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v\nIn either case, this is followed by: for k in F: D[k] = F[k]", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "d", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1901098080, + "Name": "update" + }, + { + "Documentation": "D.values() -> an object providing a view on D's values", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict_values" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1886064647, + "Name": "values" + } + ], + "Properties": [], + "Fields": [ + { + "Value": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 24324173, + "Name": "dict" + }, + { + "Documentation": "set() -> new empty set object\nset(iterable) -> new set object\n\nBuild an unordered collection of unique elements.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return self&value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:set" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1638804448, + "Name": "__and__" + }, + { + "Documentation": "x.__contains__(y) <==> y in x.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1841774666, + "Name": "__contains__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return self&=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 953999909, + "Name": "__iand__" + }, + { + "Documentation": "set() -> new empty set object\nset(iterable) -> new set object\n\nBuild an unordered collection of unique elements.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return self|=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1631373035, + "Name": "__ior__" + }, + { + "Documentation": "Return self-=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 970829902, + "Name": "__isub__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:set_iterator" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self^=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 975284137, + "Name": "__ixor__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self size of S in memory, in bytes", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1069167279, + "Name": "__sizeof__" + }, + { + "Documentation": "Return self-value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:set" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1621974455, + "Name": "__sub__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + }, + { + "Documentation": "Return self^value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:set" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1617520220, + "Name": "__xor__" + }, + { + "Documentation": "Add an element to a set.\n\nThis has no effect if the element is already present.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 781610, + "Name": "add" + }, + { + "Documentation": "Remove all elements from this set.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 753216662, + "Name": "clear" + }, + { + "Documentation": "Return a shallow copy of a set.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:set" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24300556, + "Name": "copy" + }, + { + "Documentation": "Return the difference of two or more sets as a new set.\n\n(i.e. all elements that are in this set but not the others.)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:set" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -946813804, + "Name": "difference" + }, + { + "Documentation": "Remove all elements of another set from this set.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "others", + "Type": null, + "DefaultValue": null, + "Kind": 1 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2053694164, + "Name": "difference_update" + }, + { + "Documentation": "Remove an element from a set if it is a member.\n\nIf the element is not a member, do nothing.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "elem", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1193668441, + "Name": "discard" + }, + { + "Documentation": "Return the intersection of two sets as a new set.\n\n(i.e. all elements that are in both sets.)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:set" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2011414560, + "Name": "intersection" + }, + { + "Documentation": "Update a set with the intersection of itself and another.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "others", + "Type": null, + "DefaultValue": null, + "Kind": 1 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1074130488, + "Name": "intersection_update" + }, + { + "Documentation": "Return True if two sets have a null intersection.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1041514301, + "Name": "isdisjoint" + }, + { + "Documentation": "Report whether another set contains this set.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2076857571, + "Name": "issubset" + }, + { + "Documentation": "Report whether this set contains another set.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -911398520, + "Name": "issuperset" + }, + { + "Documentation": "Remove and return an arbitrary set element.\nRaises KeyError if the set is empty.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 796378, + "Name": "pop" + }, + { + "Documentation": "Remove an element from a set; it must be a member.\n\nIf the element is not a member, raise a KeyError.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "elem", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1996862629, + "Name": "remove" + }, + { + "Documentation": "Return the symmetric difference of two sets as a new set.\n\n(i.e. all elements that are in exactly one of the sets.)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:set" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 796556764, + "Name": "symmetric_difference" + }, + { + "Documentation": "Update a set with the symmetric difference of itself and another.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "others", + "Type": null, + "DefaultValue": null, + "Kind": 1 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -81680244, + "Name": "symmetric_difference_update" + }, + { + "Documentation": "Return the union of sets as a new set.\n\n(i.e. all elements that are in either set.)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "others", + "Type": null, + "DefaultValue": null, + "Kind": 1 + } + ], + "ReturnType": "i:set" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 769903896, + "Name": "union" + }, + { + "Documentation": "Update a set with the union of itself and others.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "set", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "others", + "Type": null, + "DefaultValue": null, + "Kind": 1 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1901098080, + "Name": "update" + } + ], + "Properties": [], + "Fields": [ + { + "Value": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 798955, + "Name": "set" + }, + { + "Documentation": "frozenset() -> empty frozenset object\nfrozenset(iterable) -> frozenset object\n\nBuild an immutable unordered collection of unique elements.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return self&value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:frozenset" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1638804448, + "Name": "__and__" + }, + { + "Documentation": "x.__contains__(y) <==> y in x.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1841774666, + "Name": "__contains__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "frozenset() -> empty frozenset object\nfrozenset(iterable) -> frozenset object\n\nBuild an immutable unordered collection of unique elements.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:set_iterator" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self size of S in memory, in bytes", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1069167279, + "Name": "__sizeof__" + }, + { + "Documentation": "Return self-value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:frozenset" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1621974455, + "Name": "__sub__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + }, + { + "Documentation": "Return self^value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:frozenset" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1617520220, + "Name": "__xor__" + }, + { + "Documentation": "Return a shallow copy of a set.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:frozenset" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24300556, + "Name": "copy" + }, + { + "Documentation": "Return the difference of two or more sets as a new set.\n\n(i.e. all elements that are in this set but not the others.)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:frozenset" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -946813804, + "Name": "difference" + }, + { + "Documentation": "Return the intersection of two sets as a new set.\n\n(i.e. all elements that are in both sets.)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:frozenset" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2011414560, + "Name": "intersection" + }, + { + "Documentation": "Return True if two sets have a null intersection.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1041514301, + "Name": "isdisjoint" + }, + { + "Documentation": "Report whether another set contains this set.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2076857571, + "Name": "issubset" + }, + { + "Documentation": "Report whether this set contains another set.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -911398520, + "Name": "issuperset" + }, + { + "Documentation": "Return the symmetric difference of two sets as a new set.\n\n(i.e. all elements that are in exactly one of the sets.)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "other", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:frozenset" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 796556764, + "Name": "symmetric_difference" + }, + { + "Documentation": "Return the union of sets as a new set.\n\n(i.e. all elements that are in either set.)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "frozenset", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "others", + "Type": null, + "DefaultValue": null, + "Kind": 1 + } + ], + "ReturnType": "i:frozenset" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 769903896, + "Name": "union" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 233394059, + "Name": "frozenset" + }, + { + "Documentation": "bytes(iterable_of_ints) -> bytes\nbytes(string, encoding[, errors]) -> bytes\nbytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\nbytes(int) -> bytes object of size given by the parameter initialized with null bytes\nbytes() -> empty bytes object\n\nConstruct an immutable array of bytes from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - any object implementing the buffer API.\n - an integer", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return self+value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1639102358, + "Name": "__add__" + }, + { + "Documentation": "Return key in self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1841774666, + "Name": "__contains__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "bytes(iterable_of_ints) -> bytes\nbytes(string, encoding[, errors]) -> bytes\nbytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\nbytes(int) -> bytes object of size given by the parameter initialized with null bytes\nbytes() -> empty bytes object\n\nConstruct an immutable array of bytes from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - any object implementing the buffer API.\n - an integer", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "string", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "encoding", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "errors", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self copy of B\n\nReturn a copy of B with only its first character capitalized (ASCII)\nand the rest lower-cased.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -145846717, + "Name": "capitalize" + }, + { + "Documentation": "B.center(width[, fillchar]) -> copy of B\n\nReturn B centered in a string of length width. Padding is\ndone using the specified fill character (default is a space).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "width", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "fillbyte", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1868701484, + "Name": "center" + }, + { + "Documentation": "B.count(sub[, start[, end]]) -> int\n\nReturn the number of non-overlapping occurrences of subsection sub in\nbytes B[start:end]. Optional arguments start and end are interpreted\nas in slice notation.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 753321816, + "Name": "count" + }, + { + "Documentation": "Decode the bytes using the codec registered for encoding.\n\n encoding\n The encoding with which to decode the bytes.\n errors\n The error handling scheme to use for the handling of decoding errors.\n The default is 'strict' meaning that decoding errors raise a\n UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n as well as any other name registered with codecs.register_error that\n can handle UnicodeDecodeErrors.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "encoding", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "errors", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1896998085, + "Name": "decode" + }, + { + "Documentation": "B.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if B ends with the specified suffix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nsuffix can also be a tuple of bytes to try.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "suffix", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1172635435, + "Name": "endswith" + }, + { + "Documentation": "B.expandtabs(tabsize=8) -> copy of B\n\nReturn a copy of B where all tab characters are expanded using spaces.\nIf tabsize is not given, a tab size of 8 characters is assumed.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "tabsize", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -2134490001, + "Name": "expandtabs" + }, + { + "Documentation": "B.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24384080, + "Name": "find" + }, + { + "Documentation": "Create a bytes object from a string of hexadecimal numbers.\n\nSpaces between two numbers are accepted.\nExample: bytes.fromhex('B9 01EF') -> b'\\\\xb9\\\\x01\\\\xef'.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "type", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "string", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 835611450, + "Name": "fromhex" + }, + { + "Documentation": "B.hex() -> string\n\nCreate a string of hexadecimal numbers from a bytes object.\nExample: b'\\xb9\\x01\\xef'.hex() -> 'b901ef'.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 788388, + "Name": "hex" + }, + { + "Documentation": "B.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the subsection is not found.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 758816539, + "Name": "index" + }, + { + "Documentation": "B.isalnum() -> bool\n\nReturn True if all characters in B are alphanumeric\nand there is at least one character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -781168486, + "Name": "isalnum" + }, + { + "Documentation": "B.isalpha() -> bool\n\nReturn True if all characters in B are alphabetic\nand there is at least one character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -781166979, + "Name": "isalpha" + }, + { + "Documentation": "B.isascii() -> bool\n\nReturn True if B is empty or all characters in B are ASCII,\nFalse otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -780970896, + "Name": "isascii" + }, + { + "Documentation": "B.isdigit() -> bool\n\nReturn True if all characters in B are digits\nand there is at least one character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -778494388, + "Name": "isdigit" + }, + { + "Documentation": "B.islower() -> bool\n\nReturn True if all cased characters in B are lowercase and there is\nat least one cased character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -770912224, + "Name": "islower" + }, + { + "Documentation": "B.isspace() -> bool\n\nReturn True if all characters in B are whitespace\nand there is at least one character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -764439003, + "Name": "isspace" + }, + { + "Documentation": "B.istitle() -> bool\n\nReturn True if B is a titlecased string and there is at least one\ncharacter in B, i.e. uppercase characters may only follow uncased\ncharacters and lowercase characters only cased ones. Return False\notherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -763705481, + "Name": "istitle" + }, + { + "Documentation": "B.isupper() -> bool\n\nReturn True if all cased characters in B are uppercase and there is\nat least one cased character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -762577471, + "Name": "isupper" + }, + { + "Documentation": "Concatenate any number of bytes objects.\n\nThe bytes whose method is called is inserted in between each pair.\n\nThe result is returned as a new bytes object.\n\nExample: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "iterable_of_bytes", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24508865, + "Name": "join" + }, + { + "Documentation": "B.ljust(width[, fillchar]) -> copy of B\n\nReturn B left justified in a string of length width. Padding is\ndone using the specified fill character (default is a space).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "width", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "fillbyte", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 761484705, + "Name": "ljust" + }, + { + "Documentation": "B.lower() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to lowercase.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 761635146, + "Name": "lower" + }, + { + "Documentation": "Strip leading bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading ASCII whitespace.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bytes", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2139470083, + "Name": "lstrip" + }, + { + "Documentation": "Return a translation table useable for the bytes or bytearray translate method.\n\nThe returned table will be one where each byte in frm is mapped to the byte at\nthe same position in to.\n\nThe bytes objects frm and to must be of the same length.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "frm", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "to", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1060805443, + "Name": "maketrans" + }, + { + "Documentation": "Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original bytes\nobject and two empty bytes objects.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -2024653645, + "Name": "partition" + }, + { + "Documentation": "Return a copy with all occurrences of substring old replaced by new.\n\n count\n Maximum number of occurrences to replace.\n -1 (the default value) means replace all occurrences.\n\nIf the optional argument count is given, only the first count occurrences are\nreplaced.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "old", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "new", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "count", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1770538307, + "Name": "replace" + }, + { + "Documentation": "B.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 766894964, + "Name": "rfind" + }, + { + "Documentation": "B.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaise ValueError when the subsection is not found.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1993149833, + "Name": "rindex" + }, + { + "Documentation": "B.rjust(width[, fillchar]) -> copy of B\n\nReturn B right justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "width", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "fillbyte", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 767025831, + "Name": "rjust" + }, + { + "Documentation": "Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty bytes\nobjects and the original bytes object.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1107721713, + "Name": "rpartition" + }, + { + "Documentation": "Return a list of the sections in the bytes, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytes.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplitting is done starting at the end of the bytes and working to the front.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "maxsplit", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1983847233, + "Name": "rsplit" + }, + { + "Documentation": "Strip trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip trailing ASCII whitespace.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bytes", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1983722307, + "Name": "rstrip" + }, + { + "Documentation": "Return a list of the sections in the bytes, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytes.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "maxsplit", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 768119139, + "Name": "split" + }, + { + "Documentation": "Return a list of the lines in the bytes, breaking at line boundaries.\n\nLine breaks are not included in the resulting list unless keepends is given and\ntrue.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "keepends", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1291658108, + "Name": "splitlines" + }, + { + "Documentation": "B.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if B starts with the specified prefix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nprefix can also be a tuple of bytes to try.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "prefix", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 65206254, + "Name": "startswith" + }, + { + "Documentation": "Strip leading and trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading and trailing ASCII whitespace.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bytes", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 768244065, + "Name": "strip" + }, + { + "Documentation": "B.swapcase() -> copy of B\n\nReturn a copy of B with uppercase ASCII characters converted\nto lowercase ASCII and vice versa.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1060209754, + "Name": "swapcase" + }, + { + "Documentation": "B.title() -> copy of B\n\nReturn a titlecased version of B, i.e. ASCII words start with uppercase\ncharacters, all remaining cased characters have lowercase.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 768841889, + "Name": "title" + }, + { + "Documentation": "Return a copy with each character mapped by the given translation table.\n\n table\n Translation table, which must be a bytes object of length 256.\n\nAll characters occurring in the optional argument delete are removed.\nThe remaining characters are mapped through the given translation table.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "table", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "delete", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 827988759, + "Name": "translate" + }, + { + "Documentation": "B.upper() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to uppercase.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 769969899, + "Name": "upper" + }, + { + "Documentation": "B.zfill(width) -> copy of B\n\nPad a numeric string B with zeros on the left, to fill a field\nof the specified width. B is never truncated.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "width", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 774283078, + "Name": "zfill" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 752694964, + "Name": "bytes" + }, + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "bytes_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytes_iterator" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Private method returning an estimate of len(list(it)).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 358836041, + "Name": "__length_hint__" + }, + { + "Documentation": "Implement next(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1101153034, + "Name": "__next__" + }, + { + "Documentation": "Return state information for pickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -544113923, + "Name": "__reduce__" + }, + { + "Documentation": "Set state information for unpickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytes_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "state", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1719806726, + "Name": "__setstate__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "bytes_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": -1994109543, + "Name": "bytes_iterator" + }, + { + "Documentation": "str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return self+value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1639102358, + "Name": "__add__" + }, + { + "Documentation": "Return key in self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1841774666, + "Name": "__contains__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "Return a formatted version of the string as described by format_spec.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "format_spec", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 695475534, + "Name": "__format__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bytes_or_buffer", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "encoding", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "errors", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self int\n\nReturn the number of non-overlapping occurrences of substring sub in\nstring S[start:end]. Optional arguments start and end are\ninterpreted as in slice notation.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 753321816, + "Name": "count" + }, + { + "Documentation": "Encode the string using the codec registered for encoding.\n\n encoding\n The encoding in which to encode the string.\n errors\n The error handling scheme to use for encoding errors.\n The default is 'strict' meaning that encoding errors raise a\n UnicodeEncodeError. Other possible values are 'ignore', 'replace' and\n 'xmlcharrefreplace' as well as any other name registered with\n codecs.register_error that can handle UnicodeEncodeErrors.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "encoding", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "errors", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1933938925, + "Name": "encode" + }, + { + "Documentation": "S.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if S ends with the specified suffix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nsuffix can also be a tuple of strings to try.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "suffix", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1172635435, + "Name": "endswith" + }, + { + "Documentation": "Return a copy where all tab characters are expanded using spaces.\n\nIf tabsize is not given, a tab size of 8 characters is assumed.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "tabsize", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -2134490001, + "Name": "expandtabs" + }, + { + "Documentation": "S.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24384080, + "Name": "find" + }, + { + "Documentation": "S.format(*args, **kwargs) -> str\n\nReturn a formatted version of S, using substitutions from args and kwargs.\nThe substitutions are identified by braces ('{' and '}').", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1963936462, + "Name": "format" + }, + { + "Documentation": "S.format_map(mapping) -> str\n\nReturn a formatted version of S, using substitutions from mapping.\nThe substitutions are identified by braces ('{' and '}').", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "mapping", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1943930987, + "Name": "format_map" + }, + { + "Documentation": "S.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found, \nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 758816539, + "Name": "index" + }, + { + "Documentation": "Return True if the string is an alpha-numeric string, False otherwise.\n\nA string is alpha-numeric if all characters in the string are alpha-numeric and\nthere is at least one character in the string.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -781168486, + "Name": "isalnum" + }, + { + "Documentation": "Return True if the string is an alphabetic string, False otherwise.\n\nA string is alphabetic if all characters in the string are alphabetic and there\nis at least one character in the string.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -781166979, + "Name": "isalpha" + }, + { + "Documentation": "Return True if all characters in the string are ASCII, False otherwise.\n\nASCII characters have code points in the range U+0000-U+007F.\nEmpty string is ASCII too.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -780970896, + "Name": "isascii" + }, + { + "Documentation": "Return True if the string is a decimal string, False otherwise.\n\nA string is a decimal string if all characters in the string are decimal and\nthere is at least one character in the string.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -927011664, + "Name": "isdecimal" + }, + { + "Documentation": "Return True if the string is a digit string, False otherwise.\n\nA string is a digit string if all characters in the string are digits and there\nis at least one character in the string.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -778494388, + "Name": "isdigit" + }, + { + "Documentation": "Return True if the string is a valid Python identifier, False otherwise.\n\nUse keyword.iskeyword() to test for reserved identifiers such as \"def\" and\n\"class\".", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 401040106, + "Name": "isidentifier" + }, + { + "Documentation": "Return True if the string is a lowercase string, False otherwise.\n\nA string is lowercase if all cased characters in the string are lowercase and\nthere is at least one cased character in the string.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -770912224, + "Name": "islower" + }, + { + "Documentation": "Return True if the string is a numeric string, False otherwise.\n\nA string is numeric if all characters in the string are numeric and there is at\nleast one character in the string.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -174721940, + "Name": "isnumeric" + }, + { + "Documentation": "Return True if the string is printable, False otherwise.\n\nA string is printable if all of its characters are considered printable in\nrepr() or if it is empty.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 346760998, + "Name": "isprintable" + }, + { + "Documentation": "Return True if the string is a whitespace string, False otherwise.\n\nA string is whitespace if all characters in the string are whitespace and there\nis at least one character in the string.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -764439003, + "Name": "isspace" + }, + { + "Documentation": "Return True if the string is a title-cased string, False otherwise.\n\nIn a title-cased string, upper- and title-case characters may only\nfollow uncased characters and lowercase characters only cased ones.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -763705481, + "Name": "istitle" + }, + { + "Documentation": "Return True if the string is an uppercase string, False otherwise.\n\nA string is uppercase if all cased characters in the string are uppercase and\nthere is at least one cased character in the string.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -762577471, + "Name": "isupper" + }, + { + "Documentation": "Concatenate any number of strings.\n\nThe string whose method is called is inserted in between each given string.\nThe result is returned as a new string.\n\nExample: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24508865, + "Name": "join" + }, + { + "Documentation": "Return a left-justified string of length width.\n\nPadding is done using the specified fill character (default is a space).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "width", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "fillchar", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 761484705, + "Name": "ljust" + }, + { + "Documentation": "Return a copy of the string converted to lowercase.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 761635146, + "Name": "lower" + }, + { + "Documentation": "Return a copy of the string with leading whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "chars", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2139470083, + "Name": "lstrip" + }, + { + "Documentation": "Return a translation table usable for str.translate().\n\nIf there is only one argument, it must be a dictionary mapping Unicode\nordinals (integers) or characters to Unicode ordinals, strings or None.\nCharacter keys will be then converted to ordinals.\nIf there are two arguments, they must be strings of equal length, and\nin the resulting dictionary, each character in x will be mapped to the\ncharacter at the same position in y. If there is a third argument, it\nmust be a string, whose characters will be mapped to None in the result.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "x", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "y", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "z", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1060805443, + "Name": "maketrans" + }, + { + "Documentation": "Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original string\nand two empty strings.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -2024653645, + "Name": "partition" + }, + { + "Documentation": "Return a copy with all occurrences of substring old replaced by new.\n\n count\n Maximum number of occurrences to replace.\n -1 (the default value) means replace all occurrences.\n\nIf the optional argument count is given, only the first count occurrences are\nreplaced.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "old", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "new", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "count", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1770538307, + "Name": "replace" + }, + { + "Documentation": "S.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 766894964, + "Name": "rfind" + }, + { + "Documentation": "S.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1993149833, + "Name": "rindex" + }, + { + "Documentation": "Return a right-justified string of length width.\n\nPadding is done using the specified fill character (default is a space).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "width", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "fillchar", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 767025831, + "Name": "rjust" + }, + { + "Documentation": "Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty strings\nand the original string.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1107721713, + "Name": "rpartition" + }, + { + "Documentation": "Return a list of the words in the string, using sep as the delimiter string.\n\n sep\n The delimiter according which to split the string.\n None (the default value) means split according to any whitespace,\n and discard empty strings from the result.\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplits are done starting at the end of the string and working to the front.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "maxsplit", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1983847233, + "Name": "rsplit" + }, + { + "Documentation": "Return a copy of the string with trailing whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "chars", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1983722307, + "Name": "rstrip" + }, + { + "Documentation": "Return a list of the words in the string, using sep as the delimiter string.\n\n sep\n The delimiter according which to split the string.\n None (the default value) means split according to any whitespace,\n and discard empty strings from the result.\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "maxsplit", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 768119139, + "Name": "split" + }, + { + "Documentation": "Return a list of the lines in the string, breaking at line boundaries.\n\nLine breaks are not included in the resulting list unless keepends is given and\ntrue.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "keepends", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1291658108, + "Name": "splitlines" + }, + { + "Documentation": "S.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if S starts with the specified prefix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nprefix can also be a tuple of strings to try.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "prefix", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 65206254, + "Name": "startswith" + }, + { + "Documentation": "Return a copy of the string with leading and trailing whitespace remove.\n\nIf chars is given and not None, remove characters in chars instead.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "chars", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 768244065, + "Name": "strip" + }, + { + "Documentation": "Convert uppercase characters to lowercase and lowercase characters to uppercase.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1060209754, + "Name": "swapcase" + }, + { + "Documentation": "Return a version of the string where each word is titlecased.\n\nMore specifically, words start with uppercased characters and all remaining\ncased characters have lower case.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 768841889, + "Name": "title" + }, + { + "Documentation": "Replace each character in the string using the given translation table.\n\n table\n Translation table, which must be a mapping of Unicode ordinals to\n Unicode ordinals, strings, or None.\n\nThe table must implement lookup/indexing via __getitem__, for instance a\ndictionary or list. If this operation raises LookupError, the character is\nleft untouched. Characters mapped to None are deleted.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "table", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 827988759, + "Name": "translate" + }, + { + "Documentation": "Return a copy of the string converted to uppercase.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 769969899, + "Name": "upper" + }, + { + "Documentation": "Pad a numeric string with zeros on the left, to fill a field of the given width.\n\nThe string is never truncated.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "width", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 774283078, + "Name": "zfill" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 799418, + "Name": "str" + }, + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "str_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str_iterator" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Private method returning an estimate of len(list(it)).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 358836041, + "Name": "__length_hint__" + }, + { + "Documentation": "Implement next(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1101153034, + "Name": "__next__" + }, + { + "Documentation": "Return state information for pickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -544113923, + "Name": "__reduce__" + }, + { + "Documentation": "Set state information for unpickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "str_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "state", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1719806726, + "Name": "__setstate__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "str_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 1858697299, + "Name": "str_iterator" + }, + { + "Documentation": "Create a module object.\n\nThe name must be a string; the optional doc argument can have any type.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Implement delattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2095540485, + "Name": "__delattr__" + }, + { + "Documentation": "__dir__() -> list\nspecialized dir() implementation", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1636169386, + "Name": "__dir__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Create a module object.\n\nThe name must be a string; the optional doc argument can have any type.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "module", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return repr(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1215429388, + "Name": "__repr__" + }, + { + "Documentation": "Implement setattr(self, name, value).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -736377828, + "Name": "__setattr__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "module", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "i:dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": -2131035837, + "Name": "module" + }, + { + "Documentation": "Create a function object.\n\n code\n a code object\n globals\n the globals dictionary\n name\n a string that overrides the name from the code object\n argdefs\n a tuple that specifies the default argument values\n closure\n a tuple that supplies the bindings for free variables", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Call self as a function.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "function", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 782173109, + "Name": "__call__" + }, + { + "Documentation": "Return an attribute of instance, which is of type owner.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "function", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "instance", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "owner", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:function" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1633516065, + "Name": "__get__" + }, + { + "Documentation": "Create a function object.\n\n code\n a code object\n globals\n the globals dictionary\n name\n a string that overrides the name from the code object\n argdefs\n a tuple that specifies the default argument values\n closure\n a tuple that supplies the bindings for free variables", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "function", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "function", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return repr(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "function", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1215429388, + "Name": "__repr__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "function", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": "i:dict", + "Attributes": 0, + "Id": 1058045229, + "Name": "__annotations__" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 2101485316, + "Name": "__closure__" + }, + { + "Documentation": "", + "ReturnType": "i:object", + "Attributes": 0, + "Id": 794857348, + "Name": "__code__" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": -1308361943, + "Name": "__defaults__" + }, + { + "Documentation": "", + "ReturnType": "i:dict", + "Attributes": 0, + "Id": -1338696519, + "Name": "__globals__" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": -56184875, + "Name": "__kwdefaults__" + } + ], + "Fields": [ + { + "Value": "i:dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": null, + "Id": 1097116834, + "Name": "__name__" + }, + { + "Value": null, + "Id": -1879833807, + "Name": "__qualname__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": -1535808273, + "Name": "function" + }, + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Call self as a function.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "wrapper_descriptor", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 782173109, + "Name": "__call__" + }, + { + "Documentation": "Return an attribute of instance, which is of type owner.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "wrapper_descriptor", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "instance", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "owner", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:wrapper_descriptor" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1633516065, + "Name": "__get__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "wrapper_descriptor", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "wrapper_descriptor", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "wrapper_descriptor", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -544113923, + "Name": "__reduce__" + }, + { + "Documentation": "Return repr(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "wrapper_descriptor", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1215429388, + "Name": "__repr__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "wrapper_descriptor", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 1840816120, + "Name": "__objclass__" + } + ], + "Fields": [ + { + "Value": null, + "Id": 1097116834, + "Name": "__name__" + }, + { + "Value": null, + "Id": -1879833807, + "Name": "__qualname__" + }, + { + "Value": null, + "Id": 174109373, + "Name": "__text_signature__" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": -98573582, + "Name": "wrapper_descriptor" + }, + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Call self as a function.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "builtin_function_or_method", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 782173109, + "Name": "__call__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "builtin_function_or_method", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "builtin_function_or_method", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "builtin_function_or_method", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "builtin_function_or_method", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "builtin_function_or_method", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "builtin_function_or_method", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "builtin_function_or_method", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return self raise GeneratorExit inside generator.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "generator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 753226817, + "Name": "close" + }, + { + "Documentation": "send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "generator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24767519, + "Name": "send" + }, + { + "Documentation": "throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "generator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "type", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "traceback", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 768810287, + "Name": "throw" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 1450385203, + "Name": "gi_code" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 2015125735, + "Name": "gi_frame" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 1663620793, + "Name": "gi_running" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": -1949084879, + "Name": "gi_yieldfrom" + } + ], + "Fields": [ + { + "Value": null, + "Id": 1097116834, + "Name": "__name__" + }, + { + "Value": null, + "Id": -1879833807, + "Name": "__qualname__" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 62112924, + "Name": "generator" + }, + { + "Documentation": "Property attribute.\n\n fget\n function to be used for getting an attribute value\n fset\n function to be used for setting an attribute value\n fdel\n function to be used for del'ing an attribute\n doc\n docstring\n\nTypical use is to define a managed attribute x:\n\nclass C(object):\n def getx(self): return self._x\n def setx(self, value): self._x = value\n def delx(self): del self._x\n x = property(getx, setx, delx, \"I'm the 'x' property.\")\n\nDecorators make defining new properties or modifying existing ones easy:\n\nclass C(object):\n @property\n def x(self):\n \"I am the 'x' property.\"\n return self._x\n @x.setter\n def x(self, value):\n self._x = value\n @x.deleter\n def x(self):\n del self._x", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Delete an attribute of instance.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "property", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "instance", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1041108482, + "Name": "__delete__" + }, + { + "Documentation": "Return an attribute of instance, which is of type owner.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "property", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "instance", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "owner", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:property" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1633516065, + "Name": "__get__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "property", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Property attribute.\n\n fget\n function to be used for getting an attribute value\n fset\n function to be used for setting an attribute value\n fdel\n function to be used for del'ing an attribute\n doc\n docstring\n\nTypical use is to define a managed attribute x:\n\nclass C(object):\n def getx(self): return self._x\n def setx(self, value): self._x = value\n def delx(self): del self._x\n x = property(getx, setx, delx, \"I'm the 'x' property.\")\n\nDecorators make defining new properties or modifying existing ones easy:\n\nclass C(object):\n @property\n def x(self):\n \"I am the 'x' property.\"\n return self._x\n @x.setter\n def x(self, value):\n self._x = value\n @x.deleter\n def x(self):\n del self._x", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "property", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "property", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Set an attribute of instance to value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "property", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "instance", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1622433813, + "Name": "__set__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "property", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + }, + { + "Documentation": "Descriptor to change the deleter on a property.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "property", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "func", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1314572240, + "Name": "deleter" + }, + { + "Documentation": "Descriptor to change the getter on a property.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "property", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "func", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1983396834, + "Name": "getter" + }, + { + "Documentation": "Descriptor to change the setter on a property.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "property", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "func", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1968020650, + "Name": "setter" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 305214020, + "Name": "__isabstractmethod__" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 24379004, + "Name": "fdel" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 24381895, + "Name": "fget" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 24393427, + "Name": "fset" + } + ], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 385079020, + "Name": "property" + }, + { + "Documentation": "classmethod(function) -> method\n\nConvert a function to be a class method.\n\nA class method receives the class as implicit first argument,\njust like an instance method receives the instance.\nTo declare a class method, use this idiom:\n\n class C:\n @classmethod\n def f(cls, arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\nIf a class method is called for a derived class, the derived class\nobject is passed as the implied first argument.\n\nClass methods are different than C++ or Java static methods.\nIf you want those, see the staticmethod builtin.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return an attribute of instance, which is of type owner.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "classmethod", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "instance", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "owner", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:classmethod" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1633516065, + "Name": "__get__" + }, + { + "Documentation": "classmethod(function) -> method\n\nConvert a function to be a class method.\n\nA class method receives the class as implicit first argument,\njust like an instance method receives the instance.\nTo declare a class method, use this idiom:\n\n class C:\n @classmethod\n def f(cls, arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\nIf a class method is called for a derived class, the derived class\nobject is passed as the implied first argument.\n\nClass methods are different than C++ or Java static methods.\nIf you want those, see the staticmethod builtin.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "classmethod", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "function", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "classmethod", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "classmethod", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 886581915, + "Name": "__func__" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 305214020, + "Name": "__isabstractmethod__" + } + ], + "Fields": [ + { + "Value": "i:dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": -1347789854, + "Name": "classmethod" + }, + { + "Documentation": "staticmethod(function) -> method\n\nConvert a function to be a static method.\n\nA static method does not receive an implicit first argument.\nTo declare a static method, use this idiom:\n\n class C:\n @staticmethod\n def f(arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\n\nStatic methods in Python are similar to those found in Java or C++.\nFor a more advanced concept, see the classmethod builtin.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return an attribute of instance, which is of type owner.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "staticmethod", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "instance", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "owner", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:staticmethod" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1633516065, + "Name": "__get__" + }, + { + "Documentation": "staticmethod(function) -> method\n\nConvert a function to be a static method.\n\nA static method does not receive an implicit first argument.\nTo declare a static method, use this idiom:\n\n class C:\n @staticmethod\n def f(arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\n\nStatic methods in Python are similar to those found in Java or C++.\nFor a more advanced concept, see the classmethod builtin.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "staticmethod", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "function", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "staticmethod", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "staticmethod", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 886581915, + "Name": "__func__" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 305214020, + "Name": "__isabstractmethod__" + } + ], + "Fields": [ + { + "Value": "i:dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": -382457242, + "Name": "staticmethod" + }, + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "ellipsis", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "ellipsis", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "ellipsis", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "ellipsis", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -544113923, + "Name": "__reduce__" + }, + { + "Documentation": "Return repr(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "ellipsis", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1215429388, + "Name": "__repr__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "ellipsis", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 1566923240, + "Name": "ellipsis" + }, + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "tuple_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple_iterator" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Private method returning an estimate of len(list(it)).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 358836041, + "Name": "__length_hint__" + }, + { + "Documentation": "Implement next(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1101153034, + "Name": "__next__" + }, + { + "Documentation": "Return state information for pickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -544113923, + "Name": "__reduce__" + }, + { + "Documentation": "Set state information for unpickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "tuple_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "state", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1719806726, + "Name": "__setstate__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "tuple_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 1210482396, + "Name": "tuple_iterator" + }, + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "list_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list_iterator" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Private method returning an estimate of len(list(it)).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 358836041, + "Name": "__length_hint__" + }, + { + "Documentation": "Implement next(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1101153034, + "Name": "__next__" + }, + { + "Documentation": "Return state information for pickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list_iterator", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -544113923, + "Name": "__reduce__" + }, + { + "Documentation": "Set state information for unpickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "list_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "state", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1719806726, + "Name": "__setstate__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "list_iterator", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": -235571144, + "Name": "list_iterator" + }, + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return self&value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_keys", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict_keys" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1638804448, + "Name": "__and__" + }, + { + "Documentation": "Return key in self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_keys", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1841774666, + "Name": "__contains__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_keys", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_keys", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_keys", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_keys", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_keys", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "dict_keys", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_keys", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict_keys" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_keys", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_keys", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_items", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_items", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_items", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_items", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "dict_items", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_items", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:dict_items" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_items", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "dict_items", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self bytearray\nbytearray(string, encoding[, errors]) -> bytearray\nbytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer\nbytearray(int) -> bytes array of size given by the parameter initialized with null bytes\nbytearray() -> empty bytes array\n\nConstruct a mutable bytearray object from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - a bytes or a buffer object\n - any object implementing the buffer API.\n - an integer", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return self+value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1639102358, + "Name": "__add__" + }, + { + "Documentation": "B.__alloc__() -> int\n\nReturn the number of bytes actually allocated.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1312536510, + "Name": "__alloc__" + }, + { + "Documentation": "Return key in self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1841774666, + "Name": "__contains__" + }, + { + "Documentation": "Delete self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1970845273, + "Name": "__delitem__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Implement self+=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 953701999, + "Name": "__iadd__" + }, + { + "Documentation": "Implement self*=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965298386, + "Name": "__imul__" + }, + { + "Documentation": "bytearray(iterable_of_ints) -> bytearray\nbytearray(string, encoding[, errors]) -> bytearray\nbytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer\nbytearray(int) -> bytes array of size given by the parameter initialized with null bytes\nbytearray() -> empty bytes array\n\nConstruct a mutable bytearray object from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - a bytes or a buffer object\n - any object implementing the buffer API.\n - an integer", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "string", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "encoding", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "errors", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self copy of B\n\nReturn a copy of B with only its first character capitalized (ASCII)\nand the rest lower-cased.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -145846717, + "Name": "capitalize" + }, + { + "Documentation": "B.center(width[, fillchar]) -> copy of B\n\nReturn B centered in a string of length width. Padding is\ndone using the specified fill character (default is a space).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1868701484, + "Name": "center" + }, + { + "Documentation": "Remove all items from the bytearray.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 753216662, + "Name": "clear" + }, + { + "Documentation": "Return a copy of B.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24300556, + "Name": "copy" + }, + { + "Documentation": "B.count(sub[, start[, end]]) -> int\n\nReturn the number of non-overlapping occurrences of subsection sub in\nbytes B[start:end]. Optional arguments start and end are interpreted\nas in slice notation.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "x", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 753321816, + "Name": "count" + }, + { + "Documentation": "Decode the bytearray using the codec registered for encoding.\n\n encoding\n The encoding with which to decode the bytearray.\n errors\n The error handling scheme to use for the handling of decoding errors.\n The default is 'strict' meaning that decoding errors raise a\n UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n as well as any other name registered with codecs.register_error that\n can handle UnicodeDecodeErrors.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "encoding", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "errors", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1896998085, + "Name": "decode" + }, + { + "Documentation": "B.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if B ends with the specified suffix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nsuffix can also be a tuple of bytes to try.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "suffix", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1172635435, + "Name": "endswith" + }, + { + "Documentation": "B.expandtabs(tabsize=8) -> copy of B\n\nReturn a copy of B where all tab characters are expanded using spaces.\nIf tabsize is not given, a tab size of 8 characters is assumed.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "tabsize", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -2134490001, + "Name": "expandtabs" + }, + { + "Documentation": "Append all the items from the iterator or sequence to the end of the bytearray.\n\n iterable_of_ints\n The iterable of items to append.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "iterable_of_ints", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1943671281, + "Name": "extend" + }, + { + "Documentation": "B.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24384080, + "Name": "find" + }, + { + "Documentation": "Create a bytearray object from a string of hexadecimal numbers.\n\nSpaces between two numbers are accepted.\nExample: bytearray.fromhex('B9 01EF') -> bytearray(b'\\\\xb9\\\\x01\\\\xef')", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "type", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "string", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 835611450, + "Name": "fromhex" + }, + { + "Documentation": "B.hex() -> string\n\nCreate a string of hexadecimal numbers from a bytearray object.\nExample: bytearray([0xb9, 0x01, 0xef]).hex() -> 'b901ef'.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 788388, + "Name": "hex" + }, + { + "Documentation": "B.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the subsection is not found.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "v", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 758816539, + "Name": "index" + }, + { + "Documentation": "Insert a single item into the bytearray before the given index.\n\n index\n The index where the value is to be inserted.\n item\n The item to be inserted.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "index", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "item", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2048923024, + "Name": "insert" + }, + { + "Documentation": "B.isalnum() -> bool\n\nReturn True if all characters in B are alphanumeric\nand there is at least one character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -781168486, + "Name": "isalnum" + }, + { + "Documentation": "B.isalpha() -> bool\n\nReturn True if all characters in B are alphabetic\nand there is at least one character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -781166979, + "Name": "isalpha" + }, + { + "Documentation": "B.isascii() -> bool\n\nReturn True if B is empty or all characters in B are ASCII,\nFalse otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -780970896, + "Name": "isascii" + }, + { + "Documentation": "B.isdigit() -> bool\n\nReturn True if all characters in B are digits\nand there is at least one character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -778494388, + "Name": "isdigit" + }, + { + "Documentation": "B.islower() -> bool\n\nReturn True if all cased characters in B are lowercase and there is\nat least one cased character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -770912224, + "Name": "islower" + }, + { + "Documentation": "B.isspace() -> bool\n\nReturn True if all characters in B are whitespace\nand there is at least one character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -764439003, + "Name": "isspace" + }, + { + "Documentation": "B.istitle() -> bool\n\nReturn True if B is a titlecased string and there is at least one\ncharacter in B, i.e. uppercase characters may only follow uncased\ncharacters and lowercase characters only cased ones. Return False\notherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -763705481, + "Name": "istitle" + }, + { + "Documentation": "B.isupper() -> bool\n\nReturn True if all cased characters in B are uppercase and there is\nat least one cased character in B, False otherwise.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -762577471, + "Name": "isupper" + }, + { + "Documentation": "Concatenate any number of bytes/bytearray objects.\n\nThe bytearray whose method is called is inserted in between each pair.\n\nThe result is returned as a new bytearray object.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "iterable_of_bytes", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24508865, + "Name": "join" + }, + { + "Documentation": "B.ljust(width[, fillchar]) -> copy of B\n\nReturn B left justified in a string of length width. Padding is\ndone using the specified fill character (default is a space).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 761484705, + "Name": "ljust" + }, + { + "Documentation": "B.lower() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to lowercase.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 761635146, + "Name": "lower" + }, + { + "Documentation": "Strip leading bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading ASCII whitespace.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bytes", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2139470083, + "Name": "lstrip" + }, + { + "Documentation": "Return a translation table useable for the bytes or bytearray translate method.\n\nThe returned table will be one where each byte in frm is mapped to the byte at\nthe same position in to.\n\nThe bytes objects frm and to must be of the same length.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "frm", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "to", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1060805443, + "Name": "maketrans" + }, + { + "Documentation": "Partition the bytearray into three parts using the given separator.\n\nThis will search for the separator sep in the bytearray. If the separator is\nfound, returns a 3-tuple containing the part before the separator, the\nseparator itself, and the part after it as new bytearray objects.\n\nIf the separator is not found, returns a 3-tuple containing the copy of the\noriginal bytearray object and two empty bytearray objects.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -2024653645, + "Name": "partition" + }, + { + "Documentation": "Remove and return a single item from B.\n\n index\n The index from where to remove the item.\n -1 (the default value) means remove the last item.\n\nIf no index argument is given, will pop the last item.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "index", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 796378, + "Name": "pop" + }, + { + "Documentation": "Remove the first occurrence of a value in the bytearray.\n\n value\n The value to remove.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1996862629, + "Name": "remove" + }, + { + "Documentation": "Return a copy with all occurrences of substring old replaced by new.\n\n count\n Maximum number of occurrences to replace.\n -1 (the default value) means replace all occurrences.\n\nIf the optional argument count is given, only the first count occurrences are\nreplaced.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "old", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "new", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "count", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1770538307, + "Name": "replace" + }, + { + "Documentation": "Reverse the order of the values in B in place.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1765188885, + "Name": "reverse" + }, + { + "Documentation": "B.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 766894964, + "Name": "rfind" + }, + { + "Documentation": "B.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaise ValueError when the subsection is not found.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sub", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1993149833, + "Name": "rindex" + }, + { + "Documentation": "B.rjust(width[, fillchar]) -> copy of B\n\nReturn B right justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 767025831, + "Name": "rjust" + }, + { + "Documentation": "Partition the bytearray into three parts using the given separator.\n\nThis will search for the separator sep in the bytearray, starting at the end.\nIf the separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it as new bytearray\nobjects.\n\nIf the separator is not found, returns a 3-tuple containing two empty bytearray\nobjects and the copy of the original bytearray object.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1107721713, + "Name": "rpartition" + }, + { + "Documentation": "Return a list of the sections in the bytearray, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytearray.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplitting is done starting at the end of the bytearray and working to the front.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "maxsplit", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1983847233, + "Name": "rsplit" + }, + { + "Documentation": "Strip trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip trailing ASCII whitespace.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bytes", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1983722307, + "Name": "rstrip" + }, + { + "Documentation": "Return a list of the sections in the bytearray, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytearray.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "sep", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "maxsplit", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 768119139, + "Name": "split" + }, + { + "Documentation": "Return a list of the lines in the bytearray, breaking at line boundaries.\n\nLine breaks are not included in the resulting list unless keepends is given and\ntrue.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "keepends", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1291658108, + "Name": "splitlines" + }, + { + "Documentation": "B.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if B starts with the specified prefix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nprefix can also be a tuple of bytes to try.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "prefix", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "end", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 65206254, + "Name": "startswith" + }, + { + "Documentation": "Strip leading and trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading and trailing ASCII whitespace.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bytes", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 768244065, + "Name": "strip" + }, + { + "Documentation": "B.swapcase() -> copy of B\n\nReturn a copy of B with uppercase ASCII characters converted\nto lowercase ASCII and vice versa.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1060209754, + "Name": "swapcase" + }, + { + "Documentation": "B.title() -> copy of B\n\nReturn a titlecased version of B, i.e. ASCII words start with uppercase\ncharacters, all remaining cased characters have lowercase.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 768841889, + "Name": "title" + }, + { + "Documentation": "Return a copy with each character mapped by the given translation table.\n\n table\n Translation table, which must be a bytes object of length 256.\n\nAll characters occurring in the optional argument delete are removed.\nThe remaining characters are mapped through the given translation table.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "table", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "delete", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 827988759, + "Name": "translate" + }, + { + "Documentation": "B.upper() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to uppercase.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 769969899, + "Name": "upper" + }, + { + "Documentation": "B.zfill(width) -> copy of B\n\nPad a numeric string B with zeros on the left, to fill a field\nof the specified width. B is never truncated.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "bytearray", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "width", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bytearray" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 774283078, + "Name": "zfill" + } + ], + "Properties": [], + "Fields": [ + { + "Value": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 2020778010, + "Name": "bytearray" + }, + { + "Documentation": "Return an enumerate object.\n\n iterable\n an object supporting iteration\n\nThe enumerate object yields pairs containing a count (from start, which\ndefaults to zero) and a value yielded by the iterable argument.\n\nenumerate is useful for obtaining an indexed list:\n (0, seq[0]), (1, seq[1]), (2, seq[2]), ...", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "enumerate", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return an enumerate object.\n\n iterable\n an object supporting iteration\n\nThe enumerate object yields pairs containing a count (from start, which\ndefaults to zero) and a value yielded by the iterable argument.\n\nenumerate is useful for obtaining an indexed list:\n (0, seq[0]), (1, seq[1]), (2, seq[2]), ...", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "enumerate", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "enumerate", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "enumerate", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:enumerate" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Implement next(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "enumerate", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1101153034, + "Name": "__next__" + }, + { + "Documentation": "Return state information for pickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "enumerate", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -544113923, + "Name": "__reduce__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "enumerate", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 22552621, + "Name": "enumerate" + }, + { + "Documentation": "filter(function or None, iterable) --> filter object\n\nReturn an iterator yielding those items of iterable for which function(item)\nis true. If function is None, return the items that are true.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "filter", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "filter(function or None, iterable) --> filter object\n\nReturn an iterator yielding those items of iterable for which function(item)\nis true. If function is None, return the items that are true.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "filter", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "functionorNone", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "iterable", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "filter", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "filter", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:filter" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Implement next(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "filter", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1101153034, + "Name": "__next__" + }, + { + "Documentation": "Return state information for pickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "filter", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -544113923, + "Name": "__reduce__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "filter", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 1958223439, + "Name": "filter" + }, + { + "Documentation": "map(func, *iterables) --> map object\n\nMake an iterator that computes the function using arguments from\neach of the iterables. Stops when the shortest iterable is exhausted.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "map", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "map(func, *iterables) --> map object\n\nMake an iterator that computes the function using arguments from\neach of the iterables. Stops when the shortest iterable is exhausted.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "map", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "func", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "iterables", + "Type": null, + "DefaultValue": null, + "Kind": 1 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "map", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "map", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:map" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Implement next(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "map", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1101153034, + "Name": "__next__" + }, + { + "Documentation": "Return state information for pickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "map", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -544113923, + "Name": "__reduce__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "map", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 793061, + "Name": "map" + }, + { + "Documentation": "Create a new memoryview object which references the given object.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Delete self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1970845273, + "Name": "__delitem__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:memoryview" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 631946913, + "Name": "__enter__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 860590709, + "Name": "__exit__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "Create a new memoryview object which references the given object.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "memoryview", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "slice", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "slice", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "slice", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "slice(stop)\nslice(start, stop[, step])\n\nCreate a slice object. This is used for extended slicing (e.g. a[0:10:2]).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "slice", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "start", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "stop", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "step", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "slice", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "slice", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return self (start, stop, stride)\n\nAssuming a sequence of length len, calculate the start and stop\nindices, and the stride length of the extended slice described by\nS. Out of bounds indices are clipped in a manner consistent with the\nhandling of normal slices.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "slice", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -921644112, + "Name": "indices" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 768228011, + "Name": "start" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 24781667, + "Name": "step" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 24781977, + "Name": "stop" + } + ], + "Fields": [ + { + "Value": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 767996891, + "Name": "slice" + }, + { + "Documentation": "super() -> same as super(__class__, )\nsuper(type) -> unbound super object\nsuper(type, obj) -> bound super object; requires isinstance(obj, type)\nsuper(type, type2) -> bound super object; requires issubclass(type2, type)\nTypical use to call a cooperative superclass method:\nclass C(B):\n def meth(self, arg):\n super().meth(arg)\nThis works for class methods too:\nclass C(B):\n @classmethod\n def cmeth(cls, arg):\n super().cmeth(arg)\n", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return an attribute of instance, which is of type owner.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "super", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "instance", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "owner", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:super" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1633516065, + "Name": "__get__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "super", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "super() -> same as super(__class__, )\nsuper(type) -> unbound super object\nsuper(type, obj) -> bound super object; requires isinstance(obj, type)\nsuper(type, type2) -> bound super object; requires issubclass(type2, type)\nTypical use to call a cooperative superclass method:\nclass C(B):\n def meth(self, arg):\n super().meth(arg)\nThis works for class methods too:\nclass C(B):\n @classmethod\n def cmeth(cls, arg):\n super().cmeth(arg)\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "super", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "type", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "type2", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "super", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return repr(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "super", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1215429388, + "Name": "__repr__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "super", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 1243927843, + "Name": "__self__" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 2069653788, + "Name": "__self_class__" + }, + { + "Documentation": "", + "ReturnType": null, + "Attributes": 0, + "Id": 185188451, + "Name": "__thisclass__" + } + ], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 768271812, + "Name": "super" + }, + { + "Documentation": "zip(iter1 [,iter2 [...]]) --> zip object\n\nReturn a zip object whose .__next__() method returns a tuple where\nthe i-th element comes from the i-th iterable argument. The .__next__()\nmethod continues until the shortest iterable in the argument sequence\nis exhausted and then it raises StopIteration.", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "zip", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "zip(iter1 [,iter2 [...]]) --> zip object\n\nReturn a zip object whose .__next__() method returns a tuple where\nthe i-th element comes from the i-th iterable argument. The .__next__()\nmethod continues until the shortest iterable in the argument sequence\nis exhausted and then it raises StopIteration.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "zip", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "zip", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "zip", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:zip" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Implement next(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "zip", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1101153034, + "Name": "__next__" + }, + { + "Documentation": "Return state information for pickling.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "zip", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -544113923, + "Name": "__reduce__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "zip", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 805802, + "Name": "zip" + }, + { + "Documentation": "type(object_or_name, bases, dict)\ntype(object) -> the object's type\ntype(name, bases, dict) -> a new type", + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": "Call self as a function.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 782173109, + "Name": "__call__" + }, + { + "Documentation": "Implement delattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2095540485, + "Name": "__delattr__" + }, + { + "Documentation": "Specialized __dir__ implementation for types.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1636169386, + "Name": "__dir__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "type(object_or_name, bases, dict)\ntype(object) -> the object's type\ntype(name, bases, dict) -> a new type", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "object_or_name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bases", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "dict", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Check if an object is an instance.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "instance", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1213275748, + "Name": "__instancecheck__" + }, + { + "Documentation": "__prepare__() -> dict\nused to create the namespace for the class statement", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "bases", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "kwds", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1556881104, + "Name": "__prepare__" + }, + { + "Documentation": "Return repr(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1215429388, + "Name": "__repr__" + }, + { + "Documentation": "Implement setattr(self, name, value).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -736377828, + "Name": "__setattr__" + }, + { + "Documentation": "Return memory consumption of the type object.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1069167279, + "Name": "__sizeof__" + }, + { + "Documentation": "Check if a class is a subclass.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -25004647, + "Name": "__subclasscheck__" + }, + { + "Documentation": "Return a list of immediate subclasses.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1804067837, + "Name": "__subclasses__" + }, + { + "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "type", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "subclass", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1374911630, + "Name": "__subclasshook__" + } + ], + "Properties": [], + "Fields": [ + { + "Value": null, + "Id": -1388753224, + "Name": "__basicsize__" + }, + { + "Value": "i:dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": null, + "Id": -198224608, + "Name": "__dictoffset__" + }, + { + "Value": null, + "Id": 1444705936, + "Name": "__flags__" + }, + { + "Value": null, + "Id": 919460331, + "Name": "__itemsize__" + }, + { + "Value": "i:tuple", + "Id": -1627592461, + "Name": "__mro__" + }, + { + "Value": null, + "Id": 1097116834, + "Name": "__name__" + }, + { + "Value": null, + "Id": -1879833807, + "Name": "__qualname__" + }, + { + "Value": null, + "Id": 174109373, + "Name": "__text_signature__" + }, + { + "Value": null, + "Id": 1521523639, + "Name": "__weakrefoffset__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 24816593, + "Name": "type" + } + ], + "Id": -1981595346, + "Name": "builtins" +} \ No newline at end of file diff --git a/src/Caching/Test/Files/NestedClasses.json b/src/Caching/Test/Files/NestedClasses.json new file mode 100644 index 000000000..51771c683 --- /dev/null +++ b/src/Caching/Test/Files/NestedClasses.json @@ -0,0 +1,247 @@ +{ + "UniqueId": "module", + "Documentation": "", + "Functions": [], + "Variables": [ + { + "Value": "bool", + "Id": -529376420, + "Name": "__debug__" + }, + { + "Value": "str", + "Id": -1636005055, + "Name": "__doc__" + }, + { + "Value": "str", + "Id": 875442003, + "Name": "__file__" + }, + { + "Value": "str", + "Id": 1097116834, + "Name": "__name__" + }, + { + "Value": "str", + "Id": 75395663, + "Name": "__package__" + }, + { + "Value": "list", + "Id": 1154586556, + "Name": "__path__" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "i:str", + "Id": 833, + "Name": "x" + }, + { + "Value": "i:module:C", + "Id": 812, + "Name": "c" + } + ], + "Classes": [ + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module:A", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1909501047, + "Name": "methodA" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 778, + "Name": "A" + }, + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module:B", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:module:C" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 935009767, + "Name": "methodB1" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module:B", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 935009768, + "Name": "methodB2" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "i:int", + "Id": 833, + "Name": "x" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [ + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module:C", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module:C", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1909501045, + "Name": "methodC" + } + ], + "Properties": [], + "Fields": [ + { + "Value": "i:int", + "Id": 834, + "Name": "y" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 780, + "Name": "C" + } + ], + "Id": 779, + "Name": "B" + } + ], + "Id": -2131035837, + "Name": "module" +} \ No newline at end of file diff --git a/src/Caching/Test/Files/Requests.json b/src/Caching/Test/Files/Requests.json new file mode 100644 index 000000000..84f951687 --- /dev/null +++ b/src/Caching/Test/Files/Requests.json @@ -0,0 +1,279 @@ +{ + "UniqueId": "requests(2.21.0)", + "Documentation": "Requests HTTP Library\r\n~~~~~~~~~~~~~~~~~~~~~\r\n\r\nRequests is an HTTP library, written in Python, for human beings. Basic GET\r\nusage:\r\n\r\n >>> import requests\r\n >>> r = requests.get('https://www.python.org')\r\n >>> r.status_code\r\n 200\r\n >>> 'Python is a programming language' in r.content\r\n True\r\n\r\n... or POST:\r\n\r\n >>> payload = dict(key1='value1', key2='value2')\r\n >>> r = requests.post('https://httpbin.org/post', data=payload)\r\n >>> print(r.text)\r\n {\r\n ...\r\n \"form\": {\r\n \"key2\": \"value2\",\r\n \"key1\": \"value1\"\r\n },\r\n ...\r\n }\r\n\r\nThe other HTTP methods are supported - see `requests.api`. Full documentation\r\nis at .\r\n\r\n:copyright: (c) 2017 by Kenneth Reitz.\r\n:license: Apache 2.0, see LICENSE for more details.\r\n", + "Functions": [ + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "urllib3_version", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "chardet_version", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 435179778, + "Name": "check_compatibility" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "cryptography_version", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -399540245, + "Name": "_check_cryptography" + } + ], + "Variables": [ + { + "Value": "urllib3", + "Id": 1260465222, + "Name": "urllib3" + }, + { + "Value": "chardet", + "Id": -2125975290, + "Name": "chardet" + }, + { + "Value": "warnings", + "Id": 1876311406, + "Name": "warnings" + }, + { + "Value": "requests.exceptions:RequestsDependencyWarning", + "Id": -802098666, + "Name": "RequestsDependencyWarning" + }, + { + "Value": "urllib3.contrib.pyopenssl", + "Id": -1632802014, + "Name": "pyopenssl" + }, + { + "Value": "urllib3.exceptions:DependencyWarning", + "Id": -891041158, + "Name": "DependencyWarning" + }, + { + "Value": "i:str", + "Id": 916650529, + "Name": "__title__" + }, + { + "Value": "i:str", + "Id": -1883656187, + "Name": "__description__" + }, + { + "Value": "i:str", + "Id": -1620207176, + "Name": "__url__" + }, + { + "Value": "i:str", + "Id": 1161199201, + "Name": "__version__" + }, + { + "Value": "i:int", + "Id": -1840123721, + "Name": "__build__" + }, + { + "Value": "i:str", + "Id": 1654469090, + "Name": "__author__" + }, + { + "Value": "i:str", + "Id": -94198849, + "Name": "__author_email__" + }, + { + "Value": "i:str", + "Id": -386551926, + "Name": "__license__" + }, + { + "Value": "i:str", + "Id": 1739624272, + "Name": "__copyright__" + }, + { + "Value": "i:str", + "Id": 782136591, + "Name": "__cake__" + }, + { + "Value": "requests.utils", + "Id": 770082554, + "Name": "utils" + }, + { + "Value": "requests.packages", + "Id": 2129088004, + "Name": "packages" + }, + { + "Value": "requests.models:Request", + "Id": -104689032, + "Name": "Request" + }, + { + "Value": "requests.models:Response", + "Id": 1102541176, + "Name": "Response" + }, + { + "Value": "requests.models:PreparedRequest", + "Id": 1337118331, + "Name": "PreparedRequest" + }, + { + "Value": "requests.api:request", + "Id": -1769342312, + "Name": "request" + }, + { + "Value": "requests.api:get", + "Id": 787423, + "Name": "get" + }, + { + "Value": "requests.api:head", + "Id": 24439415, + "Name": "head" + }, + { + "Value": "requests.api:post", + "Id": 24687927, + "Name": "post" + }, + { + "Value": "requests.api:patch", + "Id": 764909201, + "Name": "patch" + }, + { + "Value": "requests.api:put", + "Id": 796568, + "Name": "put" + }, + { + "Value": "requests.api:delete", + "Id": 1897257090, + "Name": "delete" + }, + { + "Value": "requests.api:options", + "Id": 180457127, + "Name": "options" + }, + { + "Value": "requests.sessions:session", + "Id": -880047457, + "Name": "session" + }, + { + "Value": "requests.sessions:Session", + "Id": 784605823, + "Name": "Session" + }, + { + "Value": "i:typing:Any", + "Id": 753305199, + "Name": "codes" + }, + { + "Value": "requests.exceptions:RequestException", + "Id": 355509431, + "Name": "RequestException" + }, + { + "Value": "requests.exceptions:Timeout", + "Id": 1780673866, + "Name": "Timeout" + }, + { + "Value": "requests.exceptions:URLRequired", + "Id": 1361573271, + "Name": "URLRequired" + }, + { + "Value": "requests.exceptions:TooManyRedirects", + "Id": 511002043, + "Name": "TooManyRedirects" + }, + { + "Value": "requests.exceptions:HTTPError", + "Id": -1546903511, + "Name": "HTTPError" + }, + { + "Value": "requests.exceptions:ConnectionError", + "Id": 853386419, + "Name": "ConnectionError" + }, + { + "Value": "requests.exceptions:FileModeWarning", + "Id": 1675678790, + "Name": "FileModeWarning" + }, + { + "Value": "requests.exceptions:ConnectTimeout", + "Id": -1047738098, + "Name": "ConnectTimeout" + }, + { + "Value": "requests.exceptions:ReadTimeout", + "Id": -1711523244, + "Name": "ReadTimeout" + }, + { + "Value": "logging", + "Id": 1772213096, + "Name": "logging" + }, + { + "Value": "logging:NullHandler", + "Id": -1600735444, + "Name": "NullHandler" + }, + { + "Value": "typing:Any", + "Id": 751189, + "Name": "Any" + } + ], + "Classes": [], + "Id": -203071489, + "Name": "requests" +} \ No newline at end of file diff --git a/src/Caching/Test/Files/SmokeTest.json b/src/Caching/Test/Files/SmokeTest.json new file mode 100644 index 000000000..eb1096502 --- /dev/null +++ b/src/Caching/Test/Files/SmokeTest.json @@ -0,0 +1,156 @@ +{ + "UniqueId": "module", + "Documentation": "", + "Functions": [ + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:float" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24395611, + "Name": "func" + } + ], + "Variables": [ + { + "Value": "bool", + "Id": -529376420, + "Name": "__debug__" + }, + { + "Value": "str", + "Id": -1636005055, + "Name": "__doc__" + }, + { + "Value": "str", + "Id": 875442003, + "Name": "__file__" + }, + { + "Value": "str", + "Id": 1097116834, + "Name": "__name__" + }, + { + "Value": "str", + "Id": 75395663, + "Name": "__package__" + }, + { + "Value": "list", + "Id": 1154586556, + "Name": "__path__" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "i:str", + "Id": 833, + "Name": "x" + }, + { + "Value": "i:module:C", + "Id": 812, + "Name": "c" + } + ], + "Classes": [ + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module:C", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module:C", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:float" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -2139806792, + "Name": "method" + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": "i:int", + "Attributes": 0, + "Id": 24690682, + "Name": "prop" + } + ], + "Fields": [ + { + "Value": "i:int", + "Id": 833, + "Name": "x" + }, + { + "Value": "i:int", + "Id": 834, + "Name": "y" + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__" + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__" + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 780, + "Name": "C" + } + ], + "Id": -2131035837, + "Name": "module" +} \ No newline at end of file diff --git a/src/Caching/Test/Files/Sys.json b/src/Caching/Test/Files/Sys.json new file mode 100644 index 000000000..45eb533cb --- /dev/null +++ b/src/Caching/Test/Files/Sys.json @@ -0,0 +1,6840 @@ +{ + "UniqueId": "sys(3.7)", + "Documentation": "This module provides access to some objects used or maintained by the\ninterpreter and to functions that interact strongly with the interpreter.\n\nDynamic objects:\n\nargv -- command line arguments; argv[0] is the script pathname if known\npath -- module search path; path[0] is the script directory, else ''\nmodules -- dictionary of loaded modules\n\ndisplayhook -- called to show results in an interactive session\nexcepthook -- called to handle any uncaught exception other than SystemExit\n To customize printing in an interactive session or to install a custom\n top-level exception handler, assign other functions to replace these.\n\nstdin -- standard input file object; used by input()\nstdout -- standard output file object; used by print()\nstderr -- standard error object; used for error messages\n By assigning other file objects (or objects that behave like files)\n to these, it is possible to redirect all of the interpreter's I/O.\n\nlast_type -- type of last uncaught exception\nlast_value -- value of last uncaught exception\nlast_traceback -- traceback of last uncaught exception\n These three are only available in an interactive session after a\n traceback has been printed.\n\nStatic objects:\n\nbuiltin_module_names -- tuple of module names built into this interpreter\ncopyright -- copyright notice pertaining to this interpreter\nexec_prefix -- prefix used to find the machine-specific Python library\nexecutable -- absolute path of the executable binary of the Python interpreter\nfloat_info -- a struct sequence with information about the float implementation.\nfloat_repr_style -- string indicating the style of repr() output for floats\nhash_info -- a struct sequence with information about the hash algorithm.\nhexversion -- version information encoded as a single integer\nimplementation -- Python implementation information.\nint_info -- a struct sequence with information about the int implementation.\nmaxsize -- the largest supported length of containers.\nmaxunicode -- the value of the largest Unicode code point\nplatform -- platform identifier\nprefix -- prefix used to find the Python library\nthread_info -- a struct sequence with information about the thread implementation.\nversion -- the version of this interpreter as a string\nversion_info -- version information as a named tuple\ndllhandle -- [Windows only] integer handle of the Python DLL\nwinver -- [Windows only] version number of the Python DLL\n_enablelegacywindowsfsencoding -- [Windows only] \n__stdin__ -- the original stdin; don't touch!\n__stdout__ -- the original stdout; don't touch!\n__stderr__ -- the original stderr; don't touch!\n__displayhook__ -- the original displayhook; don't touch!\n__excepthook__ -- the original excepthook; don't touch!\n\nFunctions:\n\ndisplayhook() -- print an object to the screen, and save it in builtins._\nexcepthook() -- print an exception and its traceback to sys.stderr\nexc_info() -- return thread-safe information about the current exception\nexit() -- exit the interpreter by raising SystemExit\ngetdlopenflags() -- returns flags to be used for dlopen() calls\ngetprofile() -- get the global profiling function\ngetrefcount() -- return the reference count for an object (plus one :-)\ngetrecursionlimit() -- return the max recursion depth for the interpreter\ngetsizeof() -- return the size of an object in bytes\ngettrace() -- get the global debug tracing function\nsetcheckinterval() -- control how often the interpreter checks for events\nsetdlopenflags() -- set the flags to be used for dlopen() calls\nsetprofile() -- set the global profiling function\nsetrecursionlimit() -- set the max recursion depth for the interpreter\nsettrace() -- set the global debug tracing function\n", + "Functions": [ + { + "Documentation": "breakpointhook(*args, **kws)\n\nThis hook function is called by built-in breakpoint().\n", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1623088213, + "Name": "__breakpointhook__" + }, + { + "Documentation": "displayhook(object) -> None\n\nPrint an object to sys.stdout and also save it in builtins._\n", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 629764782, + "Name": "__displayhook__" + }, + { + "Documentation": "excepthook(exctype, value, traceback) -> None\n\nHandle an exception by displaying it with a traceback on sys.stderr.\n", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1425218131, + "Name": "__excepthook__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1727507378, + "Name": "__interactivehook__" + }, + { + "Documentation": "_clear_type_cache() -> None\nClear the internal type lookup cache.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:__NoneType__" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1527505257, + "Name": "_clear_type_cache" + }, + { + "Documentation": "_current_frames() -> dictionary\n\nReturn a dictionary mapping each current thread T's thread id to T's\ncurrent stack frame.\n\nThis function should be used for specialized purposes only.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:dict" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 813545300, + "Name": "_current_frames" + }, + { + "Documentation": "_debugmallocstats()\n\nPrint summary info to stderr about the state of\npymalloc's structures.\n\nIn Py_DEBUG mode, also perform some expensive internal consistency\nchecks.\n", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1370295892, + "Name": "_debugmallocstats" + }, + { + "Documentation": "_enablelegacywindowsfsencoding()\n\nChanges the default filesystem encoding to mbcs:replace for consistency\nwith earlier versions of Python. See PEP 529 for more information.\n\nThis is equivalent to defining the PYTHONLEGACYWINDOWSFSENCODING \nenvironment variable before launching Python.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1047770159, + "Name": "_enablelegacywindowsfsencoding" + }, + { + "Documentation": "_getframe([depth]) -> frameobject\n\nReturn a frame object from the call stack. If optional integer depth is\ngiven, return the frame object that many calls below the top of the stack.\nIf that is deeper than the call stack, ValueError is raised. The default\nfor depth is zero, returning the frame at the top of the call stack.\n\nThis function should be used for internal and specialized\npurposes only.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:types:FrameType" + }, + { + "Parameters": [ + { + "Name": "depth", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:types:FrameType" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1848744703, + "Name": "_getframe" + }, + { + "Documentation": "breakpointhook(*args, **kws)\n\nThis hook function is called by built-in breakpoint().\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kws", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1414470549, + "Name": "breakpointhook" + }, + { + "Documentation": "call_tracing(func, args) -> object\n\nCall func(*args), while tracing is enabled. The tracing state is\nsaved, and restored afterwards. This is intended to be called from\na debugger from a checkpoint, to recursively debug some other code.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "fn", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": "typing:Any", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:typing:_T" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1158985352, + "Name": "call_tracing" + }, + { + "Documentation": "callstats() -> tuple of integers\n\nReturn a tuple of function call statistics, if CALL_PROFILE was defined\nwhen Python was built. Otherwise, return None.\n\nWhen enabled, this function returns detailed, implementation-specific\ndetails about the number of function calls executed. The return value is\na 11-tuple where the entries in the tuple are counts of:\n0. all function calls\n1. calls to PyFunction_Type objects\n2. PyFunction calls that do not create an argument tuple\n3. PyFunction calls that do not create an argument tuple\n and bypass PyEval_EvalCodeEx()\n4. PyMethod calls\n5. PyMethod calls on bound methods\n6. PyType calls\n7. PyCFunction calls\n8. generator calls\n9. All other calls\n10. Number of stack pops performed by call_function()", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1252442422, + "Name": "callstats" + }, + { + "Documentation": "displayhook(object) -> None\n\nPrint an object to sys.stdout and also save it in builtins._\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "value", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:__NoneType__" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 388872302, + "Name": "displayhook" + }, + { + "Documentation": "exc_info() -> (type, value, traceback)\n\nReturn information about the most recent exception caught by an except\nclause in the current stack frame or in an older stack frame.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -935045484, + "Name": "exc_info" + }, + { + "Documentation": "excepthook(exctype, value, traceback) -> None\n\nHandle an exception by displaying it with a traceback on sys.stderr.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "type_", + "Type": "typing:Type[BaseException]", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": "BaseException", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "traceback", + "Type": "types:TracebackType", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:__NoneType__" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 305517843, + "Name": "excepthook" + }, + { + "Documentation": "exit([status])\n\nExit the interpreter by raising SystemExit(status).\nIf the status is omitted or None, it defaults to zero (i.e., success).\nIf the status is an integer, it will be used as the system exit status.\nIf it is another kind of object, it will be printed and the system\nexit status will be one (i.e., failure).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "arg", + "Type": "object", + "DefaultValue": "i:ellipsis", + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 24368565, + "Name": "exit" + }, + { + "Documentation": "get_asyncgen_hooks()\n\nReturn a namedtuple of installed asynchronous generators hooks (firstiter, finalizer).", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -932626587, + "Name": "get_asyncgen_hooks" + }, + { + "Documentation": "Check status of origin tracking for coroutine objects in this thread.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1605124845, + "Name": "get_coroutine_origin_tracking_depth" + }, + { + "Documentation": "get_coroutine_wrapper()\n\nReturn the wrapper for coroutine objects set by sys.set_coroutine_wrapper.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1829443124, + "Name": "get_coroutine_wrapper" + }, + { + "Documentation": "getallocatedblocks() -> integer\n\nReturn the number of memory blocks currently allocated, regardless of their\nsize.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1953654962, + "Name": "getallocatedblocks" + }, + { + "Documentation": "getcheckinterval() -> current check interval; see setcheckinterval().", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2065023054, + "Name": "getcheckinterval" + }, + { + "Documentation": "getdefaultencoding() -> string\n\nReturn the current default string encoding used by the Unicode \nimplementation.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1935348949, + "Name": "getdefaultencoding" + }, + { + "Documentation": "getfilesystemencodeerrors() -> string\n\nReturn the error mode used to convert Unicode filenames in\noperating system filenames.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 346962379, + "Name": "getfilesystemencodeerrors" + }, + { + "Documentation": "getfilesystemencoding() -> string\n\nReturn the encoding used to convert Unicode filenames in\noperating system filenames.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -946006243, + "Name": "getfilesystemencoding" + }, + { + "Documentation": "getprofile()\n\nReturn the profiling function set with sys.setprofile.\nSee the profiler chapter in the library manual.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 682573034, + "Name": "getprofile" + }, + { + "Documentation": "getrecursionlimit()\n\nReturn the current value of the recursion limit, the maximum depth\nof the Python interpreter stack. This limit prevents infinite\nrecursion from causing an overflow of the C stack and crashing Python.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 949225272, + "Name": "getrecursionlimit" + }, + { + "Documentation": "getrefcount(object) -> integer\n\nReturn the reference count of object. The count returned is generally\none higher than you might expect, because it includes the (temporary)\nreference as an argument to getrefcount().", + "Overloads": [ + { + "Parameters": [ + { + "Name": "arg", + "Type": "typing:Any", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -37310149, + "Name": "getrefcount" + }, + { + "Documentation": "getsizeof(object, default) -> int\n\nReturn the size of object in bytes.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "obj", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + }, + { + "Parameters": [ + { + "Name": "obj", + "Type": "object", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "default", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1485394487, + "Name": "getsizeof" + }, + { + "Documentation": "getswitchinterval() -> current thread switch interval; see setswitchinterval().", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:float" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1633191528, + "Name": "getswitchinterval" + }, + { + "Documentation": "gettrace()\n\nReturn the global debug tracing function set with sys.settrace.\nSee the debugger chapter in the library manual.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -920747834, + "Name": "gettrace" + }, + { + "Documentation": "getwindowsversion()\n\nReturn information about the running version of Windows as a named tuple.\nThe members are named: major, minor, build, platform, service_pack,\nservice_pack_major, service_pack_minor, suite_mask, and product_type. For\nbackward compatibility, only the first 5 items are available by indexing.\nAll elements are numbers, except service_pack and platform_type which are\nstrings, and platform_version which is a 3-tuple. Platform is always 2.\nProduct_type may be 1 for a workstation, 2 for a domain controller, 3 for a\nserver. Platform_version is a 3-tuple containing a version number that is\nintended for identifying the OS rather than feature detection.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:sys:_WinVersion" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1280212332, + "Name": "getwindowsversion" + }, + { + "Documentation": "intern(string) -> string\n\n``Intern'' the given string. This enters the string in the (global)\ntable of interned strings whose purpose is to speed up dictionary lookups.\nReturn the string itself or the previously interned string object with the\nsame value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "string", + "Type": "str", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2048952809, + "Name": "intern" + }, + { + "Documentation": "is_finalizing()\nReturn True if Python is exiting.", + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1710543065, + "Name": "is_finalizing" + }, + { + "Documentation": "set_asyncgen_hooks(*, firstiter=None, finalizer=None)\n\nSet a finalizer for async generators objects.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "firstiter", + "Type": null, + "DefaultValue": null, + "Kind": 3 + }, + { + "Name": "finalizer", + "Type": null, + "DefaultValue": null, + "Kind": 3 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -12592935, + "Name": "set_asyncgen_hooks" + }, + { + "Documentation": "Enable or disable origin tracking for coroutine objects in this thread.\n\nCoroutine objects will track 'depth' frames of traceback information about\nwhere they came from, available in their cr_origin attribute. Set depth of 0\nto disable.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "depth", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 836059129, + "Name": "set_coroutine_origin_tracking_depth" + }, + { + "Documentation": "set_coroutine_wrapper(wrapper)\n\nSet a wrapper for coroutine objects.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "wrapper", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 706767832, + "Name": "set_coroutine_wrapper" + }, + { + "Documentation": "setcheckinterval(n)\n\nTell the Python interpreter to check for asynchronous events every\nn instructions. This also affects how often thread switches occur.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "interval", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:__NoneType__" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 233580226, + "Name": "setcheckinterval" + }, + { + "Documentation": "setprofile(function)\n\nSet the profiling function. It will be called on each function call\nand return. See the profiler chapter in the library manual.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "profilefunc", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:__NoneType__" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1675589026, + "Name": "setprofile" + }, + { + "Documentation": "setrecursionlimit(n)\n\nSet the maximum depth of the Python interpreter stack to n. This\nlimit prevents infinite recursion from causing an overflow of the C\nstack and crashing Python. The highest possible limit is platform-\ndependent.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "limit", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:__NoneType__" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 9072452, + "Name": "setrecursionlimit" + }, + { + "Documentation": "setswitchinterval(n)\n\nSet the ideal thread switching delay inside the Python interpreter\nThe actual frequency of switching threads can be lower if the\ninterpreter executes long sequences of uninterruptible code\n(this is implementation-specific and workload-dependent).\n\nThe parameter must represent the desired switching delay in seconds\nA typical value is 0.005 (5 milliseconds).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "interval", + "Type": "float", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:__NoneType__" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1721622948, + "Name": "setswitchinterval" + }, + { + "Documentation": "settrace(function)\n\nSet the global debug tracing function. It will be called on each\nfunction call. See the debugger chapter in the library manual.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "tracefunc", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:__NoneType__" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1481860294, + "Name": "settrace" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 503242166, + "Name": "getdlopenflags" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "n", + "Type": "int", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:__NoneType__" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1268494038, + "Name": "setdlopenflags" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "on_flag", + "Type": "bool", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:__NoneType__" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1891924589, + "Name": "settscdump" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1618095583, + "Name": "gettotalrefcount" + } + ], + "Variables": [ + { + "Value": "_io", + "Id": 668243680, + "Name": "_mod__io" + }, + { + "Value": "builtins", + "Id": -1070584715, + "Name": "_mod_builtins" + }, + { + "Value": "types", + "Id": -2043043116, + "Name": "_mod_types" + }, + { + "Value": "i:str", + "Id": -1636005055, + "Name": "__doc__" + }, + { + "Value": "i:str", + "Id": 1097116834, + "Name": "__name__" + }, + { + "Value": "i:str", + "Id": 75395663, + "Name": "__package__" + }, + { + "Value": "i:_io:TextIOWrapper", + "Id": 1612032761, + "Name": "__stderr__" + }, + { + "Value": "i:_io:TextIOWrapper", + "Id": 329210449, + "Name": "__stdin__" + }, + { + "Value": "i:_io:TextIOWrapper", + "Id": 1621359266, + "Name": "__stdout__" + }, + { + "Value": "i:str", + "Id": 677051350, + "Name": "_framework" + }, + { + "Value": "i:tuple", + "Id": 24173482, + "Name": "_git" + }, + { + "Value": "i:NoneType", + "Id": 749413383, + "Name": "_home" + }, + { + "Value": "i:dict", + "Id": 1595009614, + "Name": "_xoptions" + }, + { + "Value": "i:int", + "Id": 1834311484, + "Name": "api_version" + }, + { + "Value": "i:list", + "Id": 24243575, + "Name": "argv" + }, + { + "Value": "i:str", + "Id": 1664944041, + "Name": "base_exec_prefix" + }, + { + "Value": "i:str", + "Id": 1039099721, + "Name": "base_prefix" + }, + { + "Value": "i:list", + "Id": 1963179240, + "Name": "builtin_module_names" + }, + { + "Value": "i:str", + "Id": 2033693967, + "Name": "byteorder" + }, + { + "Value": "i:str", + "Id": 1298046352, + "Name": "copyright" + }, + { + "Value": "i:int", + "Id": -1200168491, + "Name": "dllhandle" + }, + { + "Value": "i:bool", + "Id": 1675585612, + "Name": "dont_write_bytecode" + }, + { + "Value": "i:str", + "Id": 62274953, + "Name": "exec_prefix" + }, + { + "Value": "i:str", + "Id": -2135911519, + "Name": "executable" + }, + { + "Value": "i:str", + "Id": 92603457, + "Name": "float_repr_style" + }, + { + "Value": "i:int", + "Id": -471599948, + "Name": "hexversion" + }, + { + "Value": "i:_implementation", + "Id": 1997289353, + "Name": "implementation" + }, + { + "Value": "i:int", + "Id": -2020000914, + "Name": "maxsize" + }, + { + "Value": "i:int", + "Id": 842058832, + "Name": "maxunicode" + }, + { + "Value": "i:list", + "Id": -1294259224, + "Name": "meta_path" + }, + { + "Value": "i:dict", + "Id": -1637601392, + "Name": "modules" + }, + { + "Value": "i:list", + "Id": 24674492, + "Name": "path" + }, + { + "Value": "i:list", + "Id": -1506404755, + "Name": "path_hooks" + }, + { + "Value": "i:dict", + "Id": 376899064, + "Name": "path_importer_cache" + }, + { + "Value": "i:str", + "Id": -1042062966, + "Name": "platform" + }, + { + "Value": "i:str", + "Id": -2042362519, + "Name": "prefix" + }, + { + "Value": "i:_io:TextIOWrapper", + "Id": -1954658503, + "Name": "stderr" + }, + { + "Value": "i:_io:TextIOWrapper", + "Id": 768230609, + "Name": "stdin" + }, + { + "Value": "i:_io:TextIOWrapper", + "Id": -1954648798, + "Name": "stdout" + }, + { + "Value": "i:str", + "Id": 1781540065, + "Name": "version" + }, + { + "Value": "i:list", + "Id": -707130143, + "Name": "warnoptions" + }, + { + "Value": "i:str", + "Id": -1849986786, + "Name": "winver" + }, + { + "Value": "i:sys:__float_info", + "Id": 602612744, + "Name": "float_info" + }, + { + "Value": "i:sys:__hash_info", + "Id": 84475656, + "Name": "hash_info" + }, + { + "Value": "i:sys:__int_info", + "Id": 1942821909, + "Name": "int_info" + }, + { + "Value": "i:sys:__thread_info", + "Id": 604643660, + "Name": "thread_info" + }, + { + "Value": "i:sys:__version_info", + "Id": 1738857804, + "Name": "version_info" + }, + { + "Value": "typing:List", + "Id": 23609685, + "Name": "List" + }, + { + "Value": "typing:Sequence", + "Id": -1502554888, + "Name": "Sequence" + }, + { + "Value": "typing:Any", + "Id": 751189, + "Name": "Any" + }, + { + "Value": "typing:Dict", + "Id": 23370861, + "Name": "Dict" + }, + { + "Value": "typing:Tuple", + "Id": 739642865, + "Name": "Tuple" + }, + { + "Value": "typing:Optional", + "Id": 1363847319, + "Name": "Optional" + }, + { + "Value": "typing:Union", + "Id": 740351224, + "Name": "Union" + }, + { + "Value": "typing:TypeVar", + "Id": -2053481098, + "Name": "TypeVar" + }, + { + "Value": "typing:Type", + "Id": 23863281, + "Name": "Type" + }, + { + "Value": "types:FrameType", + "Id": -1970702352, + "Name": "FrameType" + }, + { + "Value": "_importlib_modulespec:ModuleType", + "Id": -1551859907, + "Name": "ModuleType" + }, + { + "Value": "types:TracebackType", + "Id": -612342225, + "Name": "TracebackType" + }, + { + "Value": "importlib.abc:MetaPathFinder", + "Id": -1792761721, + "Name": "MetaPathFinder" + }, + { + "Value": "typing:_T", + "Id": 25132, + "Name": "_T" + }, + { + "Value": "i:types:TracebackType", + "Id": 2060329242, + "Name": "last_traceback" + }, + { + "Value": "i:tuple", + "Id": -1174870545, + "Name": "subversion" + } + ], + "Classes": [ + { + "Documentation": "sys.flags\n\nFlags provided through command line arguments or environment vars.", + "Bases": [ + "tuple", + "object" + ], + "Methods": [ + { + "Documentation": "Return self+value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1639102358, + "Name": "__add__" + }, + { + "Documentation": "Return key in self.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1841774666, + "Name": "__contains__" + }, + { + "Documentation": "Implement delattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:NoneType" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 2095540485, + "Name": "__delattr__" + }, + { + "Documentation": "Default dir() implementation.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:list" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1636169386, + "Name": "__dir__" + }, + { + "Documentation": "Return self==value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748372547, + "Name": "__eq__" + }, + { + "Documentation": "Default object formatter.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "format_spec", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:str" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 695475534, + "Name": "__format__" + }, + { + "Documentation": "Return self>=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "sys.flags\n\nFlags provided through command line arguments or environment vars.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:NoneType" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__float_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__float_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__float_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "sys:__float_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__float_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__float_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "sys.float_info\n\nA structseq holding information about the float type. It contains low level\ninformation about the precision and internal representation. Please study\nyour system's :file:`float.h` for more information.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__float_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "sys:__float_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:NoneType" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__float_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__float_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__float_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__hash_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__hash_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__hash_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "sys:__hash_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__hash_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__hash_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "hash_info\n\nA struct sequence providing parameters used for computing\nhashes. The attributes are read only.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__hash_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "sys:__hash_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:NoneType" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__hash_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__hash_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__hash_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__int_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__int_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__int_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "sys:__int_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__int_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__int_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "sys.int_info\n\nA struct sequence that holds information about Python's\ninternal representation of integers. The attributes are read only.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__int_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "sys:__int_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:NoneType" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__int_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__int_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__int_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__thread_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__thread_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__thread_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "sys:__thread_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__thread_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__thread_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "sys.thread_info\n\nA struct sequence holding information about the thread implementation.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__thread_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "sys:__thread_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:NoneType" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Implement iter(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__thread_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 971292143, + "Name": "__iter__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__thread_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__thread_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__version_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748420597, + "Name": "__ge__" + }, + { + "Documentation": "Return getattr(self, name).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__version_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "name", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1329277859, + "Name": "__getattribute__" + }, + { + "Documentation": "Return self[key].", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__version_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "key", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -293179214, + "Name": "__getitem__" + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "sys:__version_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "self", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:tuple" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -488627138, + "Name": "__getnewargs__" + }, + { + "Documentation": "Return self>value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__version_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748435012, + "Name": "__gt__" + }, + { + "Documentation": "Return hash(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__version_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 925523557, + "Name": "__hash__" + }, + { + "Documentation": "sys.version_info\n\nVersion information as a named tuple.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__version_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "args", + "Type": null, + "DefaultValue": null, + "Kind": 1 + }, + { + "Name": "kwargs", + "Type": null, + "DefaultValue": null, + "Kind": 2 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__" + }, + { + "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", + "Overloads": [ + { + "Parameters": [ + { + "Name": "cls", + "Type": "sys:__version_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:NoneType" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1040523408, + "Name": "__init_subclass__" + }, + { + "Documentation": "Return self<=value.", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__version_info", + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "value", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:bool" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 1748569552, + "Name": "__le__" + }, + { + "Documentation": "Return len(self).", + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "sys:__version_info", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1628904226, + "Name": "__len__" + }, + { + "Documentation": "Return self new DocumentAnalysisAssertions(analysis); + public static MemberAssertions Should(this IMember member) => new MemberAssertions(member); + public static PythonFunctionAssertions Should(this IPythonFunctionType f) => new PythonFunctionAssertions(f); + public static PythonFunctionOverloadAssertions Should(this IPythonFunctionOverload f) => new PythonFunctionOverloadAssertions(f); + public static ParameterAssertions Should(this IParameterInfo p) => new ParameterAssertions(p); + + public static RangeAssertions Should(this Range? range) => new RangeAssertions(range); + + public static SourceSpanAssertions Should(this SourceSpan span) => new SourceSpanAssertions(span); + public static SourceSpanAssertions Should(this SourceSpan? span) => new SourceSpanAssertions(span.Value); + public static VariableAssertions Should(this IVariable v) => new VariableAssertions(v); + } +} diff --git a/src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj b/src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj new file mode 100644 index 000000000..f0fe11140 --- /dev/null +++ b/src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj @@ -0,0 +1,42 @@ + + + netcoreapp2.2 + Microsoft.Python.Analysis.Caching.Tests + Microsoft.Python.Analysis.Caching.Tests + + + + 1701;1702$(NoWarn) + 7.2 + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + + + + + + + + + + diff --git a/src/Core/Impl/Extensions/StringExtensions.cs b/src/Core/Impl/Extensions/StringExtensions.cs index 88ee18f16..378ffc3b8 100644 --- a/src/Core/Impl/Extensions/StringExtensions.cs +++ b/src/Core/Impl/Extensions/StringExtensions.cs @@ -302,5 +302,15 @@ public static string NormalizeLineEndings(this string s, string lineEnding = nul lineEnding = lineEnding ?? Environment.NewLine; return string.Join(lineEnding, s.SplitLines()); } + + public static int GetStableHash(this string s) { + unchecked { + var hash = 23; + foreach (var c in s) { + hash = hash * 31 + c; + } + return hash; + } + } } } diff --git a/src/Core/Test/Microsoft.Python.Core.Tests.csproj b/src/Core/Test/Microsoft.Python.Core.Tests.csproj index 1ca8be126..706f2130e 100644 --- a/src/Core/Test/Microsoft.Python.Core.Tests.csproj +++ b/src/Core/Test/Microsoft.Python.Core.Tests.csproj @@ -28,7 +28,6 @@ - diff --git a/src/LanguageServer/Impl/Documentation/DocstringConverter.cs b/src/LanguageServer/Impl/Documentation/DocstringConverter.cs index f5fcc7ad0..046488540 100644 --- a/src/LanguageServer/Impl/Documentation/DocstringConverter.cs +++ b/src/LanguageServer/Impl/Documentation/DocstringConverter.cs @@ -87,7 +87,7 @@ private int NextBlockIndent private string CurrentLineWithinBlock => CurrentLine.Substring(_blockIndent); private DocstringConverter(string input) { - _builder = new StringBuilder(input.Length); + _builder = new StringBuilder(input?.Length ?? 0); _state = ParseText; _lines = SplitDocstring(input); } diff --git a/src/LanguageServer/Impl/Implementation/Server.cs b/src/LanguageServer/Impl/Implementation/Server.cs index 39b1720d4..ea00a82c6 100644 --- a/src/LanguageServer/Impl/Implementation/Server.cs +++ b/src/LanguageServer/Impl/Implementation/Server.cs @@ -22,6 +22,7 @@ using System.Threading.Tasks; using Microsoft.Python.Analysis; using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Caching; using Microsoft.Python.Analysis.Core.Interpreter; using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Core; @@ -142,6 +143,10 @@ public async Task InitializeAsync(InitializeParams @params, Ca TypeshedPath = @params.initializationOptions.typeStubSearchPaths.FirstOrDefault() }; + if (@params.initializationOptions.enableAnalysCache != false) { + _services.AddService(new ModuleDatabase(_services)); + } + _interpreter = await PythonInterpreter.CreateAsync(configuration, _rootDir, _services, cancellationToken); _services.AddService(_interpreter); diff --git a/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj b/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj index 58b65f302..107026039 100644 --- a/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj +++ b/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj @@ -43,6 +43,7 @@ + diff --git a/src/LanguageServer/Impl/Protocol/Classes.cs b/src/LanguageServer/Impl/Protocol/Classes.cs index a83096d4b..37cb7a2cb 100644 --- a/src/LanguageServer/Impl/Protocol/Classes.cs +++ b/src/LanguageServer/Impl/Protocol/Classes.cs @@ -158,6 +158,11 @@ public sealed class InterpreterProperties { /// Path to a writable folder where analyzer can cache its data. /// public string cacheFolderPath; + + /// + /// Turns off analysis caching. + /// + public bool? enableAnalysCache; } [Serializable] diff --git a/src/PLS.sln b/src/PLS.sln index d19e7a2d0..2bceb6b86 100644 --- a/src/PLS.sln +++ b/src/PLS.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27929.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29003.217 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Python.LanguageServer", "LanguageServer\Impl\Microsoft.Python.LanguageServer.csproj", "{4E648207-0C9F-45DB-AA30-84BCDAFE698D}" EndProject @@ -27,6 +27,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Python.Analysis.T EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Python.LanguageServer.Tests", "LanguageServer\Test\Microsoft.Python.LanguageServer.Tests.csproj", "{3BAB87E1-79FD-45D1-8564-CAF87D4D16CA}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Python.Analysis.Caching", "Caching\Impl\Microsoft.Python.Analysis.Caching.csproj", "{42BD3C80-3E57-4847-8142-84F6B682EA8D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Python.Analysis.Caching.Tests", "Caching\Test\Microsoft.Python.Analysis.Caching.Tests.csproj", "{40CD3A74-B0B6-4A37-AE65-5B203C38D0E2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -73,6 +77,14 @@ Global {3BAB87E1-79FD-45D1-8564-CAF87D4D16CA}.Debug|Any CPU.Build.0 = Debug|Any CPU {3BAB87E1-79FD-45D1-8564-CAF87D4D16CA}.Release|Any CPU.ActiveCfg = Release|Any CPU {3BAB87E1-79FD-45D1-8564-CAF87D4D16CA}.Release|Any CPU.Build.0 = Release|Any CPU + {42BD3C80-3E57-4847-8142-84F6B682EA8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42BD3C80-3E57-4847-8142-84F6B682EA8D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42BD3C80-3E57-4847-8142-84F6B682EA8D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42BD3C80-3E57-4847-8142-84F6B682EA8D}.Release|Any CPU.Build.0 = Release|Any CPU + {40CD3A74-B0B6-4A37-AE65-5B203C38D0E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {40CD3A74-B0B6-4A37-AE65-5B203C38D0E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {40CD3A74-B0B6-4A37-AE65-5B203C38D0E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {40CD3A74-B0B6-4A37-AE65-5B203C38D0E2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -88,6 +100,8 @@ Global {2C8DE250-41F4-4FC5-A661-76E2A4172891} = {C465393D-145E-4695-A7DB-AF55951BD533} {D8D85896-5DB0-4FA6-B744-910A272C39F9} = {80AA38A1-3E82-4B87-BB21-FDEDD2CC87E6} {3BAB87E1-79FD-45D1-8564-CAF87D4D16CA} = {80AA38A1-3E82-4B87-BB21-FDEDD2CC87E6} + {42BD3C80-3E57-4847-8142-84F6B682EA8D} = {C465393D-145E-4695-A7DB-AF55951BD533} + {40CD3A74-B0B6-4A37-AE65-5B203C38D0E2} = {80AA38A1-3E82-4B87-BB21-FDEDD2CC87E6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {ABC12ED7-0EC8-4219-8A14-A058F7942D92} diff --git a/src/Parsing/Impl/Resources.Designer.cs b/src/Parsing/Impl/Resources.Designer.cs index 74403388e..507ec0381 100644 --- a/src/Parsing/Impl/Resources.Designer.cs +++ b/src/Parsing/Impl/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Microsoft.Python.Parsing { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/src/UnitTests/Core/Impl/Baseline.cs b/src/UnitTests/Core/Impl/Baseline.cs new file mode 100644 index 000000000..2d3d129e6 --- /dev/null +++ b/src/UnitTests/Core/Impl/Baseline.cs @@ -0,0 +1,124 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Text; +using FluentAssertions; + +namespace TestUtilities { + [ExcludeFromCodeCoverage] + public static class Baseline { + public static string CompareStrings(string expected, string actual) { + var result = new StringBuilder(); + + var length = Math.Min(expected.Length, actual.Length); + for (var i = 0; i < length; i++) { + if (expected[i] != actual[i]) { + result.AppendLine(FormattableString.Invariant($"Position: {i}: expected: '{expected[i]}', actual '{actual[i]}'")); + if (i > 6 && i < length - 6) { + result.Append(FormattableString.Invariant($"Context: {expected.Substring(i - 6, 12)} -> {actual.Substring(i - 6, 12)}")); + } + break; + } + + } + + if (expected.Length != actual.Length) { + result.Append(FormattableString.Invariant($"\r\nLength different. Expected: '{expected.Length}' , actual '{actual.Length}'")); + } + + return result.ToString(); + } + + public static void CompareStringLines(string expected, string actual) { + var line = CompareLines(expected, actual, out var baseLine, out var actualLine, out var index); + line.Should().Be(0, $@"there should be no difference at line {line} + Expected:{baseLine.Trim()} + Actual:{actualLine.Trim()} + Difference at position {index}{Environment.NewLine}"); + } + + public static int CompareLines(string expected, string actual, out string expectedLine, out string actualLine, out int index, bool ignoreCase = false) { + var actualReader = new StringReader(actual); + var expectedReader = new StringReader(expected); + + var lineNum = 1; + index = 0; + + for (; ; lineNum++) { + expectedLine = expectedReader.ReadLine(); + actualLine = actualReader.ReadLine(); + + if (expectedLine == null || actualLine == null) { + break; + } + + var minLength = Math.Min(expectedLine.Length, actualLine.Length); + for (var i = 0; i < minLength; i++) { + var act = actualLine[i]; + var exp = expectedLine[i]; + + if (ignoreCase) { + act = char.ToLowerInvariant(act); + exp = char.ToLowerInvariant(exp); + } + + if (act != exp) { + index = i + 1; + return lineNum; + } + } + + if (expectedLine.Length != actualLine.Length) { + index = minLength + 1; + return lineNum; + } + } + + if (expectedLine == null && actualLine == null) { + expectedLine = string.Empty; + actualLine = string.Empty; + + return 0; + } + + return lineNum; + } + + public static void CompareToFile(string baselineFile, string actual, bool regenerateBaseline = false, bool ignoreCase = false) { + if (regenerateBaseline) { + if (File.Exists(baselineFile)) { + File.SetAttributes(baselineFile, FileAttributes.Normal); + } + + File.WriteAllText(baselineFile, actual.Trim()); + return; + } + + actual = actual.Trim(); + var expected = File.ReadAllText(baselineFile).Trim(); + var line = CompareLines(expected, actual, out var baseLine, out var actualLine, out var index, ignoreCase); + line.Should().Be(0, + $@"there should be no difference at line {line} + Expected:{baseLine.Trim()} + Actual:{actualLine.Trim()} + BaselineFile:{Path.GetFileName(baselineFile)} + Difference at column {index}{Environment.NewLine}" + ); + } + } +} From b2c9afb7c0114694383409e054bdc5df097228dc Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Thu, 11 Jul 2019 13:29:47 -0700 Subject: [PATCH 02/60] Merge master into database branch (#1312) * Remove old qualified name * Node storage * Class and scope to use AST map * Library analysis * Fix SO * Keep small AST with imports * AST reduction * Final field * Initial * Reload * Ignore post-final requests * Drop AST * Remove local variables * Test fixes * Fix overload match * Tests * Add locks * Remove local variables * Drop file content to save memory * Cache PEP hints * Recreate AST * Fix specialization * Fix locations * usings * Test fixes * Add options to keep data in memory * Fix test * Fix lambda parameters * Fix argument set Fix global scope node * Fix overload doc * Fix stub merge errors * Fix async issues * Undo some changes * Fix test * Fix race condition * Partial * Models and views * Restore log null checks * Fix merge conflict * Fix merge issue * Null check * Partial * Partial * Partial * Fix test * Partial * Partial * First test * Baseline comparison * Builtins * Partial * Type fixes * Fix type names, part I * Qualified name * Properly write variables * Partial * Construct module from model * Test * Variable creations * Factories * Factories * Split construction * Restore * Save builtins * Test passes * Qualified name * Better export detection * Test fixes * More consistent qualified names * Sys test * Demo * Complete sys write/read * Partial * Partial * Test staility * Perf bug * Baseline, remove debug code, deactivate db * Test fixes * Test fix * Simplify a bit * Baselines and use : separator * Baselines * PR feedback * Merge master * Remove registry reference * PR feedback * Avoid empty node in empty global scope (#1226) * Add null checks * Avoid null node in empty global scope * Remove unrelated change * Lock content since it is locked in other cases (#1227) * Fix addBrackets setting (#1241) * Fix addBrackets * Remove unrelated change * Usings * Handle library analysis better (#1246) * Trying to augment argument set with Evaluator and Expression context (#1259) * Moving anyStr to its own method to prevent FromTypeVar from being called with an ArgumentSet that has no context * Trying to augment argument set with context wherever possible * Setting expression in argument set, removing null * Renaming to WithoutContext and updating comment * Check for null args in PythonFunctionOverload * When returning in init method, report a diagnostic error (#1261) * When returning in init method, report a diagnostic error * Adding check and tests for returning None before adding error for a return statement in the init function * Cleaning up tests * Give Diagnostic messages on improper usage of Generic (#1248) * Adding diagnostic message for improper use Generic. * Adding tests to make sure no diagnostics on valid uses of Generic * Adding diagnostic error on binary operations with incompatible types (#1254) * Adding diagnostic error for binary operations with incompatible types - e.g 5 + 'str' * When NewType is called and the first argument is not a string, make a diagnostic message (#1260) * Adding diagnostic error if the user calls NewType with the first arg not of string type * Fix typo in TROUBLESHOOTING.md (#1285) * Multiple analysis fixes (#1297) Multiple analysis fixes. - Fixes #1151: Reliable way to determine final analysis of a module - Fixes #1201: NRE in SymbolCollector.AddProperty - Fixes #1228: NRE in TryFindMissingDependencies - Fixes #1294: Handle valid case for reloading AST - Fixes #1295: FindReferences doesn't work on package init members - Fixes #1296: DependencyResolver graph misses intermediate imports - Part of the fix for #1174: All references are not listed when using ms language server (fixes in analysis itself are also required for this one) * Rework search path resolution (#1289) * first working path classfier, breaks existing path code for now * inherit Comparer instead of implementing both * don't do path depth comparison, preserve user ordering as before * switch to using new path classification code in main module resolution * fix typo * clean up comment about paths in Server.cs * use String.Split instead of regex when parsing script output * test ordering of user provided paths * add new normalize and trim helper, check preconditions as debug asserts rather than commenting on them * use Split extension, don't MaybeEnumerate paths * No diagnostic message when Generic is called with no args (#1305) * No diagnostic message when Generic is called with no args * When a class inherits from something that is not a class, give a diagnostic error (#1277) * When analyzing class definitions, give diagnostic if bases are not all class types * PR feedback --- TROUBLESHOOTING.md | 2 +- .../Ast/Impl/Analyzer/ActivityTracker.cs | 42 +-- .../Ast/Impl/Analyzer/AnalysisModuleKey.cs | 29 +- .../Impl/Analyzer/Definitions/IAnalyzable.cs | 3 +- .../Analyzer/Definitions/IPythonAnalyzer.cs | 3 +- .../Ast/Impl/Analyzer/EmptyAnalysis.cs | 2 +- .../Evaluation/ExpressionEval.Callables.cs | 10 +- .../Evaluation/ExpressionEval.Generics.cs | 74 ++-- .../Evaluation/ExpressionEval.Operators.cs | 34 +- .../Evaluation/ExpressionEval.Scopes.cs | 2 +- .../Analyzer/Evaluation/ExpressionEval.cs | 19 +- .../Analyzer/Handlers/AssignmentHandler.cs | 2 +- .../Analyzer/Handlers/FromImportHandler.cs | 4 +- .../Impl/Analyzer/Handlers/ImportHandler.cs | 11 +- .../Ast/Impl/Analyzer/LibraryAnalysis.cs | 11 +- .../Ast/Impl/Analyzer/ModuleWalker.cs | 4 +- .../Ast/Impl/Analyzer/PythonAnalyzer.cs | 41 +- .../Ast/Impl/Analyzer/PythonAnalyzerEntry.cs | 62 ++-- .../Impl/Analyzer/PythonAnalyzerSession.cs | 72 +++- .../Ast/Impl/Analyzer/PythonInterpreter.cs | 4 +- .../Impl/Analyzer/Symbols/ClassEvaluator.cs | 71 +++- .../Analyzer/Symbols/FunctionEvaluator.cs | 18 +- .../Impl/Dependencies/DependencyResolver.cs | 121 +++--- .../Ast/Impl/Dependencies/DependencyVertex.cs | 1 - .../Impl/Dependencies/IDependencyChainNode.cs | 15 +- .../Impl/Dependencies/IDependencyResolver.cs | 10 +- .../Ast/Impl/Dependencies/WalkingVertex.cs | 23 +- .../Ast/Impl/Diagnostics/ErrorCodes.cs | 5 + .../Impl/Documents/Definitions/IDocument.cs | 5 - .../Impl/Documents/RunningDocumentTable.cs | 3 +- .../Ast/Impl/Extensions/NodeExtensions.cs | 18 +- .../Impl/Extensions/PythonClassExtensions.cs | 2 + .../Impl/Extensions/PythonModuleExtensions.cs | 10 +- .../Ast/Impl/Extensions/ScopeExtensions.cs | 2 + .../UndefinedVariables/ExpressionWalker.cs | 2 +- .../Ast/Impl/Modules/BuiltinsPythonModule.cs | 2 +- .../Modules/Definitions/IAstNodeContainer.cs | 7 +- .../Ast/Impl/Modules/PythonModule.Analysis.cs | 128 ------- .../Ast/Impl/Modules/PythonModule.Ast.cs | 182 --------- .../Ast/Impl/Modules/PythonModule.Content.cs | 87 ----- .../Modules/PythonModule.Documentation.cs | 76 ---- src/Analysis/Ast/Impl/Modules/PythonModule.cs | 351 +++++++++++++++++- .../Resolution/MainModuleResolution.cs | 45 +-- src/Analysis/Ast/Impl/Resources.Designer.cs | 54 +++ src/Analysis/Ast/Impl/Resources.resx | 18 + .../BuiltinsSpecializations.cs | 2 +- .../Specializations/Typing/TypingModule.cs | 73 ++-- .../Typing/Values/TypingIterator.cs | 2 +- .../Typing/Values/TypingTuple.cs | 2 +- src/Analysis/Ast/Impl/Types/ArgumentSet.cs | 59 +-- .../Impl/Types/Definitions/IArgumentSet.cs | 7 +- src/Analysis/Ast/Impl/Types/LocatedMember.cs | 2 +- src/Analysis/Ast/Impl/Types/Location.cs | 2 +- .../Ast/Impl/Types/PythonClassType.cs | 5 +- .../Ast/Impl/Types/PythonFunctionOverload.cs | 2 +- .../Ast/Impl/Types/PythonFunctionType.cs | 2 +- .../Ast/Impl/Types/PythonPropertyType.cs | 2 +- .../Values/Collections/PythonDictionary.cs | 2 +- .../Collections/PythonInstanceIterator.cs | 2 +- src/Analysis/Ast/Impl/Values/GlobalScope.cs | 9 +- .../Ast/Impl/Values/PythonInstance.cs | 2 +- src/Analysis/Ast/Impl/Values/Scope.cs | 8 +- src/Analysis/Ast/Impl/get_search_paths.py | 10 +- src/Analysis/Ast/Test/ArgumentSetTests.cs | 6 +- src/Analysis/Ast/Test/ClassesTests.cs | 2 +- .../Ast/Test/DependencyResolverTests.cs | 304 +++++++++++++-- .../PythonFunctionOverloadAssertions.cs | 6 +- src/Analysis/Ast/Test/InheritNonClassTests.cs | 173 +++++++++ src/Analysis/Ast/Test/LintGenericTests.cs | 105 ++++++ src/Analysis/Ast/Test/LintNewTypeTests.cs | 130 +++++++ src/Analysis/Ast/Test/LintOperatorTests.cs | 86 +++++ .../Ast/Test/LintReturnInInitTests.cs | 127 +++++++ .../Ast/Test/PathClassificationTests.cs | 218 +++++++++++ .../Impl/DependencyResolution/AstUtilities.cs | 3 - .../Impl/Interpreter/PythonLibraryPath.cs | 203 +++++++--- src/Caching/Impl/Factories/ModuleFactory.cs | 1 - src/Core/Impl/Extensions/StringExtensions.cs | 3 + src/Core/Impl/IO/PathUtils.cs | 2 + .../Impl/Completion/CompletionItemSource.cs | 8 +- .../Impl/Completion/CompletionSource.cs | 5 + .../Impl/Completion/ExpressionCompletion.cs | 1 + .../Impl/Implementation/Server.Symbols.cs | 2 +- .../Impl/Implementation/Server.cs | 17 +- .../Indexing/MostRecentDocumentSymbols.cs | 3 +- src/LanguageServer/Impl/LanguageServer.cs | 2 +- src/LanguageServer/Test/CompletionTests.cs | 20 + src/LanguageServer/Test/ImportsTests.cs | 4 +- src/LanguageServer/Test/ReferencesTests.cs | 68 +++- src/LanguageServer/Test/RenameTests.cs | 56 +++ 89 files changed, 2429 insertions(+), 1006 deletions(-) delete mode 100644 src/Analysis/Ast/Impl/Modules/PythonModule.Analysis.cs delete mode 100644 src/Analysis/Ast/Impl/Modules/PythonModule.Ast.cs delete mode 100644 src/Analysis/Ast/Impl/Modules/PythonModule.Content.cs delete mode 100644 src/Analysis/Ast/Impl/Modules/PythonModule.Documentation.cs create mode 100644 src/Analysis/Ast/Test/InheritNonClassTests.cs create mode 100644 src/Analysis/Ast/Test/LintGenericTests.cs create mode 100644 src/Analysis/Ast/Test/LintNewTypeTests.cs create mode 100644 src/Analysis/Ast/Test/LintOperatorTests.cs create mode 100644 src/Analysis/Ast/Test/LintReturnInInitTests.cs create mode 100644 src/Analysis/Ast/Test/PathClassificationTests.cs diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 26dfceb52..3f87fb444 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -21,7 +21,7 @@ Python is a requirement for the language server to run. In VS Code, an interpret _must_ be selected in order for the language server to properly initialize. If your language server fails to start, be sure that you have selected an interpreter. -The language server can only run on platforms where the .NET Core can run. This rougly means: +The language server can only run on platforms where the .NET Core can run. This roughly means: - Windows, 32/64 bit - macOS, 64 bit diff --git a/src/Analysis/Ast/Impl/Analyzer/ActivityTracker.cs b/src/Analysis/Ast/Impl/Analyzer/ActivityTracker.cs index 2b5b22c83..937634006 100644 --- a/src/Analysis/Ast/Impl/Analyzer/ActivityTracker.cs +++ b/src/Analysis/Ast/Impl/Analyzer/ActivityTracker.cs @@ -19,48 +19,21 @@ namespace Microsoft.Python.Analysis.Analyzer { internal static class ActivityTracker { - private static readonly Dictionary _modules = new Dictionary(); + private static readonly HashSet _modules = new HashSet(); private static readonly object _lock = new object(); private static bool _tracking; private static Stopwatch _sw; - private struct AnalysisState { - public int Count; - public bool IsComplete; - } - public static void OnEnqueueModule(string path) { if (string.IsNullOrEmpty(path)) { return; } lock (_lock) { - if (!_modules.TryGetValue(path, out var st)) { - _modules[path] = default; - } else { - st.IsComplete = false; - } - } - } - - public static void OnModuleAnalysisComplete(string path) { - lock (_lock) { - if (_modules.TryGetValue(path, out var st)) { - st.Count++; - st.IsComplete = true; - } + _modules.Add(path); } } - public static bool IsAnalysisComplete { - get { - lock (_lock) { - return _modules.All(m => m.Value.IsComplete); - } - } - } - - public static void StartTracking() { lock (_lock) { if (!_tracking) { @@ -71,22 +44,15 @@ public static void StartTracking() { } } - public static void EndTracking() { + public static (int modulesCount, double totalMilliseconds) EndTracking() { lock (_lock) { if (_tracking) { _sw?.Stop(); _tracking = false; } - } - } - public static int ModuleCount { - get { - lock (_lock) { - return _modules.Count; - } + return (_modules.Count, _sw?.Elapsed.TotalMilliseconds ?? 0); } } - public static double MillisecondsElapsed => _sw?.Elapsed.TotalMilliseconds ?? 0; } } diff --git a/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs b/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs index 0365fad92..d62f11fe2 100644 --- a/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs +++ b/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs @@ -15,31 +15,48 @@ using System; using System.Diagnostics; +using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core; namespace Microsoft.Python.Analysis.Analyzer { [DebuggerDisplay("{Name} : {FilePath}")] - internal struct AnalysisModuleKey : IEquatable { + internal readonly struct AnalysisModuleKey : IEquatable { + private enum KeyType { Default, Typeshed, LibraryAsDocument } + + private readonly KeyType _type; public string Name { get; } public string FilePath { get; } - public bool IsTypeshed { get; } + public bool IsTypeshed => _type == KeyType.Typeshed; + public bool IsLibraryAsDocument => _type == KeyType.LibraryAsDocument; public AnalysisModuleKey(IPythonModule module) { Name = module.Name; FilePath = module.ModuleType == ModuleType.CompiledBuiltin ? null : module.FilePath; - IsTypeshed = module is StubPythonModule stub && stub.IsTypeshed; + _type = module is StubPythonModule stub && stub.IsTypeshed + ? KeyType.Typeshed + : module.ModuleType == ModuleType.Library && module is IDocument document && document.IsOpen + ? KeyType.LibraryAsDocument + : KeyType.Default; } public AnalysisModuleKey(string name, string filePath, bool isTypeshed) { Name = name; FilePath = filePath; - IsTypeshed = isTypeshed; + _type = isTypeshed ? KeyType.Typeshed : KeyType.Default; + } + + private AnalysisModuleKey(string name, string filePath, KeyType type) { + Name = name; + FilePath = filePath; + _type = type; } + public AnalysisModuleKey GetLibraryAsDocumentKey() => new AnalysisModuleKey(Name, FilePath, KeyType.LibraryAsDocument); + public bool Equals(AnalysisModuleKey other) - => Name.EqualsOrdinal(other.Name) && FilePath.PathEquals(other.FilePath) && IsTypeshed == other.IsTypeshed; + => Name.EqualsOrdinal(other.Name) && FilePath.PathEquals(other.FilePath) && _type == other._type; public override bool Equals(object obj) => obj is AnalysisModuleKey other && Equals(other); @@ -47,7 +64,7 @@ public override int GetHashCode() { unchecked { var hashCode = (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (FilePath != null ? FilePath.GetPathHashCode() : 0); - hashCode = (hashCode * 397) ^ IsTypeshed.GetHashCode(); + hashCode = (hashCode * 397) ^ _type.GetHashCode(); return hashCode; } } diff --git a/src/Analysis/Ast/Impl/Analyzer/Definitions/IAnalyzable.cs b/src/Analysis/Ast/Impl/Analyzer/Definitions/IAnalyzable.cs index bb1665b8d..8d4b9751d 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Definitions/IAnalyzable.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Definitions/IAnalyzable.cs @@ -26,6 +26,7 @@ internal interface IAnalyzable { /// /// Notifies document that its analysis is now complete. /// - void NotifyAnalysisComplete(int version, ModuleWalker walker, bool isFinalPass); + /// Document analysis + void NotifyAnalysisComplete(IDocumentAnalysis analysis); } } diff --git a/src/Analysis/Ast/Impl/Analyzer/Definitions/IPythonAnalyzer.cs b/src/Analysis/Ast/Impl/Analyzer/Definitions/IPythonAnalyzer.cs index 122992414..970c4bb3f 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Definitions/IPythonAnalyzer.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Definitions/IPythonAnalyzer.cs @@ -20,6 +20,7 @@ using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core.Collections; +using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Analyzer { public interface IPythonAnalyzer { @@ -27,7 +28,7 @@ public interface IPythonAnalyzer { /// /// Schedules module for analysis. Module will be scheduled if version of AST is greater than the one used to get previous analysis /// - void EnqueueDocumentForAnalysis(IPythonModule module, int version); + void EnqueueDocumentForAnalysis(IPythonModule module, PythonAst ast, int version); /// /// Schedules module for analysis for its existing AST, but with new dependencies. diff --git a/src/Analysis/Ast/Impl/Analyzer/EmptyAnalysis.cs b/src/Analysis/Ast/Impl/Analyzer/EmptyAnalysis.cs index b073f20b2..f5d836b0c 100644 --- a/src/Analysis/Ast/Impl/Analyzer/EmptyAnalysis.cs +++ b/src/Analysis/Ast/Impl/Analyzer/EmptyAnalysis.cs @@ -30,7 +30,7 @@ public EmptyAnalysis(IServiceContainer services, IDocument document) { Document = document ?? throw new ArgumentNullException(nameof(document)); GlobalScope = new EmptyGlobalScope(document); Ast = AstUtilities.MakeEmptyAst(document.Uri); - ExpressionEvaluator = new ExpressionEval(services, document); + ExpressionEvaluator = new ExpressionEval(services, document, Ast); } public IDocument Document { get; } diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Callables.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Callables.cs index 657ab23d2..863fb1af4 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Callables.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Callables.cs @@ -89,11 +89,11 @@ public IMember GetValueFromLambda(LambdaExpression expr) { public IMember GetValueFromClassCtor(IPythonClassType cls, CallExpression expr) { SymbolTable.Evaluate(cls.ClassDefinition); // Determine argument types - var args = ArgumentSet.Empty; + var args = ArgumentSet.Empty(expr, this); var init = cls.GetMember(@"__init__"); if (init != null) { using (OpenScope(cls.DeclaringModule, cls.ClassDefinition, out _)) { - var a = new ArgumentSet(init, 0, new PythonInstance(cls), expr, Module, this); + var a = new ArgumentSet(init, 0, new PythonInstance(cls), expr, this); if (a.Errors.Count > 0) { // AddDiagnostics(Module.Uri, a.Errors); } @@ -108,7 +108,7 @@ private IMember GetValueFromBound(IPythonBoundType t, CallExpression expr) { case IPythonFunctionType fn: return GetValueFromFunctionType(fn, t.Self, expr); case IPythonPropertyType p: - return GetValueFromProperty(p, t.Self); + return GetValueFromProperty(p, t.Self, expr); case IPythonIteratorType _ when t.Self is IPythonCollection seq: return seq.GetIterator(); } @@ -201,10 +201,10 @@ public IMember GetValueFromFunctionType(IPythonFunctionType fn, IPythonInstance return UnknownType; } - private IMember GetValueFromProperty(IPythonPropertyType p, IPythonInstance instance) { + private IMember GetValueFromProperty(IPythonPropertyType p, IPythonInstance instance, CallExpression expr) { // Function may not have been walked yet. Do it now. SymbolTable.Evaluate(p.FunctionDefinition); - return instance.Call(p.Name, ArgumentSet.Empty); + return instance.Call(p.Name, ArgumentSet.Empty(expr, this)); } diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs index e9ff23df2..514d1e735 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs @@ -16,12 +16,15 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Specializations.Typing.Types; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Ast; +using ErrorCodes = Microsoft.Python.Analysis.Diagnostics.ErrorCodes; namespace Microsoft.Python.Analysis.Analyzer.Evaluation { internal sealed partial class ExpressionEval { @@ -59,40 +62,58 @@ private IMember GetValueFromGeneric(IMember target, Expression expr) { } /// - /// Given generic type and list of indices in the expression like - /// Generic[T1, T2, ...] or List[str] creates generic class base - /// (if the former) on specific type (if the latter). + /// Returns whether the arguments to Generic are valid /// - private IMember CreateSpecificTypeFromIndex(IGenericType gt, IReadOnlyList indices, Expression expr) { - // See which ones are generic parameters as defined by TypeVar() - // and which are specific types. Normally there should not be a mix. - var genericTypeArgs = indices.OfType().ToArray(); - var specificTypes = indices.Where(i => !(i is IGenericTypeDefinition)).OfType().ToArray(); - - if (genericTypeArgs.Length > 0 && genericTypeArgs.Length != indices.Count) { - // TODO: report that some type arguments are not declared with TypeVar. + private bool GenericClassParameterValid(IReadOnlyList genericTypeArgs, IReadOnlyList args, Expression expr) { + // All arguments to Generic must be type parameters + // e.g. Generic[T, str] throws a runtime error + if (genericTypeArgs.Count != args.Count) { + ReportDiagnostics(Module.Uri, new DiagnosticsEntry( + Resources.GenericNotAllTypeParameters, + GetLocation(expr).Span, + ErrorCodes.TypingGenericArguments, + Severity.Error, + DiagnosticSource.Analysis)); + return false; } - if (specificTypes.Length > 0 && specificTypes.Length != indices.Count) { - // TODO: report that arguments are not specific types or are not declared. + + // All arguments to Generic must be distinct + if (genericTypeArgs.Distinct().Count() != genericTypeArgs.Count) { + ReportDiagnostics(Module.Uri, new DiagnosticsEntry( + Resources.GenericNotAllUnique, + GetLocation(expr).Span, + ErrorCodes.TypingGenericArguments, + Severity.Error, + DiagnosticSource.Analysis)); + return false; } + return true; + } + + /// + /// Given generic type and list of arguments in the expression like + /// Generic[T1, T2, ...] or List[str] creates generic class base + /// (if the former) on specific type (if the latter). + /// + private IMember CreateSpecificTypeFromIndex(IGenericType gt, IReadOnlyList args, Expression expr) { + var genericTypeArgs = args.OfType().ToArray(); + if (gt.Name.EqualsOrdinal("Generic")) { - // Generic[T1, T2, ...] expression. Create generic base for the class. - if (genericTypeArgs.Length > 0) { - return new GenericClassParameter(genericTypeArgs, Module); - } else { - // TODO: report too few type arguments for Generic[]. + if (!GenericClassParameterValid(genericTypeArgs, args, expr)) { return UnknownType; } + + // Generic[T1, T2, ...] expression. Create generic base for the class. + return new GenericClassParameter(genericTypeArgs, Module); } // For other types just use supplied arguments - if (indices.Count > 0) { - return gt.CreateSpecificType(new ArgumentSet(indices)); + if (args.Count > 0) { + return gt.CreateSpecificType(new ArgumentSet(args, expr, this)); } - // TODO: report too few type arguments for the generic expression. - return UnknownType; + return UnknownType; } private IReadOnlyList EvaluateIndex(IndexExpression expr) { @@ -104,7 +125,10 @@ private IReadOnlyList EvaluateIndex(IndexExpression expr) { } } else { var index = GetValueFromExpression(expr.Index); - indices.Add(index ?? UnknownType); + // Don't count null indexes as arguments + if (index != null) { + indices.Add(index); + } } return indices; } @@ -132,7 +156,7 @@ private IMember CreateClassInstance(PythonClassType cls, IReadOnlyList var argSet = initOverload != null ? new ArgumentSet(initFunc, 0, null, callExpr, this) - : new ArgumentSet(constructorArguments); + : new ArgumentSet(constructorArguments, callExpr, this); argSet.Evaluate(); var specificType = cls.CreateSpecificType(argSet); @@ -194,7 +218,7 @@ private static IReadOnlyList GetSpecificTypeFromArgumentValue(objec var itemType = iter.GetIterator().Next.GetPythonType(); if (!itemType.IsUnknown()) { specificTypes.Add(itemType); - } else if(argumentValue is IPythonInstance inst) { + } else if (argumentValue is IPythonInstance inst) { specificTypes.Add(inst.GetPythonType()); } break; diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Operators.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Operators.cs index 16f89c794..71a709bc1 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Operators.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Operators.cs @@ -13,13 +13,15 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System.Collections.Generic; +using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Types.Collections; using Microsoft.Python.Analysis.Values; +using Microsoft.Python.Core; using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Ast; +using ErrorCodes = Microsoft.Python.Analysis.Diagnostics.ErrorCodes; namespace Microsoft.Python.Analysis.Analyzer.Evaluation { internal sealed partial class ExpressionEval { @@ -47,7 +49,7 @@ private IMember GetValueFromUnaryOp(UnaryExpression expr, string op) { var fn = instance.GetPythonType()?.GetMember(op); // Process functions declared in code modules. Scraped/compiled/stub modules do not actually perform any operations. if (fn?.DeclaringModule != null && (fn.DeclaringModule.ModuleType == ModuleType.User || fn.DeclaringModule.ModuleType == ModuleType.Library)) { - var result = fn.Call(instance, op, ArgumentSet.Empty); + var result = fn.Call(instance, op, ArgumentSet.Empty(expr, this)); if (!result.IsUnknown()) { return result; } @@ -122,6 +124,9 @@ private IMember GetValueFromBinaryOp(Expression expr) { if (leftIsSupported && rightIsSupported) { if (TryGetValueFromBuiltinBinaryOp(op, leftTypeId, rightTypeId, Interpreter.LanguageVersion.Is3x(), out var member)) { + if (member.IsUnknown()) { + ReportOperatorDiagnostics(expr, leftType, rightType, op); + } return member; } } @@ -132,9 +137,9 @@ private IMember GetValueFromBinaryOp(Expression expr) { if (op.IsComparison()) { // If the op is a comparison, and the thing on the left is the builtin, // flip the operation and call it instead. - ret = CallOperator(op.InvertComparison(), right, rightType, left, leftType, tryRight: false); + ret = CallOperator(op.InvertComparison(), right, rightType, left, leftType, expr, tryRight: false); } else { - ret = CallOperator(op, left, leftType, right, rightType, tryLeft: false); + ret = CallOperator(op, left, leftType, right, rightType, expr, tryLeft: false); } if (!ret.IsUnknown()) { @@ -146,7 +151,7 @@ private IMember GetValueFromBinaryOp(Expression expr) { if (rightIsSupported) { // Try calling the function on the left side, otherwise just return right. - var ret = CallOperator(op, left, leftType, right, rightType, tryRight: false); + var ret = CallOperator(op, left, leftType, right, rightType, expr, tryRight: false); if (!ret.IsUnknown()) { return ret; @@ -155,13 +160,13 @@ private IMember GetValueFromBinaryOp(Expression expr) { return op.IsComparison() ? Interpreter.GetBuiltinType(BuiltinTypeId.Bool) : right; } - var callRet = CallOperator(op, left, leftType, right, rightType); + var callRet = CallOperator(op, left, leftType, right, rightType, expr); if (!callRet.IsUnknown()) { return callRet; } if (op.IsComparison()) { - callRet = CallOperator(op.InvertComparison(), right, rightType, left, leftType); + callRet = CallOperator(op.InvertComparison(), right, rightType, left, leftType, expr); if (!callRet.IsUnknown()) { return callRet; @@ -197,18 +202,18 @@ private IMember GetValueFromBinaryOp(Expression expr) { return left.IsUnknown() ? right : left; } - private IMember CallOperator(PythonOperator op, IMember left, IPythonType leftType, IMember right, IPythonType rightType, bool tryLeft = true, bool tryRight = true) { + private IMember CallOperator(PythonOperator op, IMember left, IPythonType leftType, IMember right, IPythonType rightType, Expression expr, bool tryLeft = true, bool tryRight = true) { var (funcName, swappedFuncName) = OpMethodName(op); if (tryLeft && funcName != null && left is IPythonInstance lpi) { - var ret = leftType.Call(lpi, funcName, new ArgumentSet(new[] { right })); + var ret = leftType.Call(lpi, funcName, new ArgumentSet(new[] { right }, expr, this)); if (!ret.IsUnknown()) { return ret; } } if (tryRight && swappedFuncName != null && right is IPythonInstance rpi) { - var ret = rightType.Call(rpi, swappedFuncName, new ArgumentSet(new[] { left })); + var ret = rightType.Call(rpi, swappedFuncName, new ArgumentSet(new[] { left }, expr, this)); if (!ret.IsUnknown()) { return ret; } @@ -435,5 +440,14 @@ private static (string name, string swappedName) OpMethodName(PythonOperator op) return (null, null); } + private void ReportOperatorDiagnostics(Expression expr, IPythonType leftType, IPythonType rightType, PythonOperator op) { + ReportDiagnostics(Module.Uri, new DiagnosticsEntry( + Resources.UnsupporedOperandType.FormatInvariant(op.ToCodeString(), leftType.Name, rightType.Name), + GetLocation(expr).Span, + ErrorCodes.UnsupportedOperandType, + Severity.Error, + DiagnosticSource.Analysis)); + } + } } diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Scopes.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Scopes.cs index c5baaa8ec..bd5760289 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Scopes.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Scopes.cs @@ -41,7 +41,7 @@ public void DeclareVariable(string name, IMember value, VariableSource source) => DeclareVariable(name, value, source, default(Location)); public void DeclareVariable(string name, IMember value, VariableSource source, IPythonModule module) - => DeclareVariable(name, value, source, new Location(module, default)); + => DeclareVariable(name, value, source, new Location(module)); public void DeclareVariable(string name, IMember value, VariableSource source, Node location, bool overwrite = false) => DeclareVariable(name, value, source, GetLocationOfName(location), overwrite); diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs index 6bf57caf0..f66170650 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs @@ -38,15 +38,12 @@ internal sealed partial class ExpressionEval : IExpressionEvaluator { private readonly object _lock = new object(); private readonly List _diagnostics = new List(); - public ExpressionEval(IServiceContainer services, IPythonModule module) - : this(services, module, new GlobalScope(module)) { } - - public ExpressionEval(IServiceContainer services, IPythonModule module, GlobalScope gs) { + public ExpressionEval(IServiceContainer services, IPythonModule module, PythonAst ast) { Services = services ?? throw new ArgumentNullException(nameof(services)); Module = module ?? throw new ArgumentNullException(nameof(module)); - Ast = module.GetAst(); + Ast = ast ?? throw new ArgumentNullException(nameof(ast)); - GlobalScope = gs; + GlobalScope = new GlobalScope(module, ast); CurrentScope = GlobalScope; DefaultLocation = new Location(module); //Log = services.GetService(); @@ -61,7 +58,7 @@ public ExpressionEval(IServiceContainer services, IPythonModule module, GlobalSc public Location DefaultLocation { get; } public IPythonModule BuiltinsModule => Interpreter.ModuleResolution.BuiltinsModule; - public LocationInfo GetLocationInfo(Node node) => node?.GetLocation(Module) ?? LocationInfo.Empty; + public LocationInfo GetLocationInfo(Node node) => node?.GetLocation(this) ?? LocationInfo.Empty; public Location GetLocationOfName(Node node) { if (node == null || (Module.ModuleType != ModuleType.User && Module.ModuleType != ModuleType.Library)) { @@ -104,7 +101,7 @@ public Location GetLocationOfName(Node node) { public IServiceContainer Services { get; } IScope IExpressionEvaluator.CurrentScope => CurrentScope; IGlobalScope IExpressionEvaluator.GlobalScope => GlobalScope; - public LocationInfo GetLocation(Node node) => node?.GetLocation(Module) ?? LocationInfo.Empty; + public LocationInfo GetLocation(Node node) => node?.GetLocation(this) ?? LocationInfo.Empty; public IEnumerable Diagnostics => _diagnostics; public void ReportDiagnostics(Uri documentUri, DiagnosticsEntry entry) { @@ -188,6 +185,10 @@ public IMember GetValueFromExpression(Expression expr, LookupOptions options = L case NamedExpression namedExpr: m = GetValueFromExpression(namedExpr.Value); break; + // indexing with nothing, e.g Generic[] + case ErrorExpression error: + m = null; + break; default: m = GetValueFromBinaryOp(expr) ?? GetConstantFromLiteral(expr, options); break; @@ -272,7 +273,7 @@ private IMember GetValueFromMember(MemberExpression expr) { case IPythonClassType _: return value; case IPythonPropertyType prop: - return prop.Call(instance, prop.Name, ArgumentSet.Empty); + return prop.Call(instance, prop.Name, ArgumentSet.Empty(expr, this)); case IPythonType p: return new PythonBoundType(p, instance); case null: diff --git a/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs b/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs index 1626e8c5d..5837a9d0c 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs @@ -116,7 +116,7 @@ private void HandleTypedVariable(IPythonType variableType, IMember value, Expres instance = value; } } - instance = instance ?? variableType?.CreateInstance(variableType.Name, ArgumentSet.Empty) ?? Eval.UnknownType; + instance = instance ?? variableType?.CreateInstance(variableType.Name, ArgumentSet.Empty(expr, Eval)) ?? Eval.UnknownType; if (expr is NameExpression ne) { Eval.DeclareVariable(ne.Name, instance, VariableSource.Declaration, ne); diff --git a/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs b/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs index cba333e73..6c330bfaa 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs @@ -125,8 +125,8 @@ private void SpecializeFuture(FromImportStatement node) { var printNameExpression = node.Names.FirstOrDefault(n => n?.Name == "print_function"); if (printNameExpression != null) { - var fn = new PythonFunctionType("print", new Location(Module, default), null, string.Empty); - var o = new PythonFunctionOverload(fn.Name, new Location(Module, default)); + var fn = new PythonFunctionType("print", new Location(Module), null, string.Empty); + var o = new PythonFunctionOverload(fn.Name, new Location(Module)); var parameters = new List { new ParameterInfo("*values", Interpreter.GetBuiltinType(BuiltinTypeId.Object), ParameterKind.List, null), new ParameterInfo("sep", Interpreter.GetBuiltinType(BuiltinTypeId.Str), ParameterKind.KeywordOnly, null), diff --git a/src/Analysis/Ast/Impl/Analyzer/Handlers/ImportHandler.cs b/src/Analysis/Ast/Impl/Analyzer/Handlers/ImportHandler.cs index 3562c7f12..341db6291 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Handlers/ImportHandler.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Handlers/ImportHandler.cs @@ -56,19 +56,22 @@ private void HandleImport(ModuleName moduleImportExpression, NameExpression asNa // import_module('fob.oar.baz') var importNames = ImmutableArray.Empty; var variableModule = default(PythonVariableModule); + var importedNamesCount = 0; foreach (var nameExpression in moduleImportExpression.Names) { importNames = importNames.Add(nameExpression.Name); var imports = ModuleResolution.CurrentPathResolver.GetImportsFromAbsoluteName(Module.FilePath, importNames, forceAbsolute); if (!HandleImportSearchResult(imports, variableModule, asNameExpression, moduleImportExpression, out variableModule)) { - return; + break; } + + importedNamesCount++; } // "import fob.oar.baz as baz" is handled as baz = import_module('fob.oar.baz') // "import fob.oar.baz" is handled as fob = import_module('fob') - if (!string.IsNullOrEmpty(asNameExpression?.Name)) { + if (!string.IsNullOrEmpty(asNameExpression?.Name) && importedNamesCount == moduleImportExpression.Names.Count) { Eval.DeclareVariable(asNameExpression.Name, variableModule, VariableSource.Import, asNameExpression); - } else if (importNames.Count > 0 && !string.IsNullOrEmpty(importNames[0]) && _variableModules.TryGetValue(importNames[0], out variableModule)) { + } else if (importedNamesCount > 0 && !string.IsNullOrEmpty(importNames[0]) && _variableModules.TryGetValue(importNames[0], out variableModule)) { var firstName = moduleImportExpression.Names[0]; Eval.DeclareVariable(importNames[0], variableModule, VariableSource.Import, firstName); } @@ -87,7 +90,7 @@ private bool HandleImportSearchResult(in IImportSearchResult imports, in PythonV case RelativeImportBeyondTopLevel importBeyondTopLevel: var message = Resources.ErrorRelativeImportBeyondTopLevel.FormatInvariant(importBeyondTopLevel.RelativeImportName); Eval.ReportDiagnostics(Eval.Module.Uri, - new DiagnosticsEntry(message, location.GetLocation(Eval.Module).Span, ErrorCodes.UnresolvedImport, Severity.Warning, DiagnosticSource.Analysis)); + new DiagnosticsEntry(message, location.GetLocation(Eval).Span, ErrorCodes.UnresolvedImport, Severity.Warning, DiagnosticSource.Analysis)); variableModule = default; return false; case ImportNotFound importNotFound: diff --git a/src/Analysis/Ast/Impl/Analyzer/LibraryAnalysis.cs b/src/Analysis/Ast/Impl/Analyzer/LibraryAnalysis.cs index 42caa54da..bf8f7df93 100644 --- a/src/Analysis/Ast/Impl/Analyzer/LibraryAnalysis.cs +++ b/src/Analysis/Ast/Impl/Analyzer/LibraryAnalysis.cs @@ -29,7 +29,7 @@ namespace Microsoft.Python.Analysis.Analyzer { /// Analysis of a library code. /// internal sealed class LibraryAnalysis : IDocumentAnalysis { - public LibraryAnalysis(IDocument document, int version, IServiceContainer services, GlobalScope globalScope, IReadOnlyList starImportMemberNames) { + public LibraryAnalysis(IDocument document, int version, IGlobalScope globalScope, IExpressionEvaluator eval, IReadOnlyList starImportMemberNames) { Check.ArgumentNotNull(nameof(document), document); Check.ArgumentNotNull(nameof(globalScope), globalScope); @@ -37,14 +37,7 @@ public LibraryAnalysis(IDocument document, int version, IServiceContainer servic Version = version; GlobalScope = globalScope; - var ast = Document.GetAst(); - ast.Reduce(x => x is ImportStatement || x is FromImportStatement); - var c = (IAstNodeContainer)Document; - c.ClearContent(); - c.ClearAst(); - c.AddAstNode(document, ast); - - ExpressionEvaluator = new ExpressionEval(services, document, globalScope); + ExpressionEvaluator = eval; StarImportMemberNames = starImportMemberNames; } diff --git a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs index 427845247..87834d78d 100644 --- a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs +++ b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs @@ -37,8 +37,8 @@ internal class ModuleWalker : AnalysisWalker { private int _allReferencesCount; private bool _allIsUsable = true; - public ModuleWalker(IServiceContainer services, IPythonModule module) - : base(new ExpressionEval(services, module)) { + public ModuleWalker(IServiceContainer services, IPythonModule module, PythonAst ast) + : base(new ExpressionEval(services, module, ast)) { _stubAnalysis = Module.Stub is IDocument doc ? doc.GetAnyAnalysis() : null; } diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs index d04f03978..0face4bd1 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs @@ -17,6 +17,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis.Caching; @@ -31,6 +32,7 @@ using Microsoft.Python.Core.Disposables; using Microsoft.Python.Core.Logging; using Microsoft.Python.Core.Services; +using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Analyzer { public sealed class PythonAnalyzer : IPythonAnalyzer, IDisposable { @@ -70,9 +72,9 @@ public Task WaitForCompleteAnalysisAsync(CancellationToken cancellationToken = d => _analysisCompleteEvent.WaitAsync(cancellationToken); public async Task GetAnalysisAsync(IPythonModule module, int waitTime, CancellationToken cancellationToken) { - var key = new AnalysisModuleKey(module); PythonAnalyzerEntry entry; lock (_syncObj) { + var key = new AnalysisModuleKey(module); if (!_analysisEntries.TryGetValue(key, out entry)) { var emptyAnalysis = new EmptyAnalysis(_services, (IDocument)module); entry = new PythonAnalyzerEntry(emptyAnalysis); @@ -122,11 +124,13 @@ public void InvalidateAnalysis(IPythonModule module) { } public void RemoveAnalysis(IPythonModule module) { + AnalysisModuleKey key; lock (_syncObj) { - _analysisEntries.Remove(new AnalysisModuleKey(module)); + key = new AnalysisModuleKey(module); + _analysisEntries.Remove(key); } - _dependencyResolver.Remove(new AnalysisModuleKey(module)); + _dependencyResolver.Remove(key); } public void EnqueueDocumentForAnalysis(IPythonModule module, ImmutableArray analysisDependencies) { @@ -146,16 +150,28 @@ public void EnqueueDocumentForAnalysis(IPythonModule module, ImmutableArray= bufferVersion) { return; } + + // It is possible that parsing request for the library has been started when document is open, + // but it is closed at the moment of analysis and then become open again. + // In this case, we still need to analyze the document, but using correct entry. + var libraryAsDocumentKey = key.GetLibraryAsDocumentKey(); + if (entry.PreviousAnalysis is LibraryAnalysis && _analysisEntries.TryGetValue(libraryAsDocumentKey, out var documentEntry)) { + key = libraryAsDocumentKey; + entry = documentEntry; + } + } else { entry = new PythonAnalyzerEntry(new EmptyAnalysis(_services, (IDocument)module)); _analysisEntries[key] = entry; @@ -163,7 +179,7 @@ public void EnqueueDocumentForAnalysis(IPythonModule module, int bufferVersion) } } - if (entry.Invalidate(module, bufferVersion, version, out var dependencies)) { + if (entry.Invalidate(module, ast, bufferVersion, version, out var dependencies)) { AnalyzeDocument(key, entry, dependencies); } } @@ -207,12 +223,12 @@ public IReadOnlyList LoadedModules { internal void RaiseAnalysisComplete(int moduleCount, double msElapsed) => AnalysisComplete?.Invoke(this, new AnalysisCompleteEventArgs(moduleCount, msElapsed)); - private void AnalyzeDocument(AnalysisModuleKey key, PythonAnalyzerEntry entry, ImmutableArray dependencies) { + private void AnalyzeDocument(in AnalysisModuleKey key, in PythonAnalyzerEntry entry, in ImmutableArray dependencies) { _analysisCompleteEvent.Reset(); ActivityTracker.StartTracking(); _log?.Log(TraceEventType.Verbose, $"Analysis of {entry.Module.Name}({entry.Module.ModuleType}) queued"); - var graphVersion = _dependencyResolver.ChangeValue(key, entry, entry.IsUserModule, dependencies); + var graphVersion = _dependencyResolver.ChangeValue(key, entry, entry.IsUserOrBuiltin || key.IsLibraryAsDocument, dependencies); lock (_syncObj) { if (_version > graphVersion) { @@ -228,7 +244,7 @@ private void AnalyzeDocument(AnalysisModuleKey key, PythonAnalyzerEntry entry, I } } - private bool TryCreateSession(int graphVersion, PythonAnalyzerEntry entry, out PythonAnalyzerSession session) { + private bool TryCreateSession(in int graphVersion, in PythonAnalyzerEntry entry, out PythonAnalyzerSession session) { var analyzeUserModuleOutOfOrder = false; lock (_syncObj) { if (_currentSession != null) { @@ -246,11 +262,6 @@ private bool TryCreateSession(int graphVersion, PythonAnalyzerEntry entry, out P } if (!_dependencyResolver.TryCreateWalker(graphVersion, 2, out var walker)) { - if (entry.Module.ModuleType == ModuleType.Builtins) { - session = CreateSession(null, entry); - return true; - } - session = null; return false; } @@ -292,7 +303,7 @@ private void StartNextSession(Task task) { session.Start(false); } - private PythonAnalyzerSession CreateSession(IDependencyChainWalker walker, PythonAnalyzerEntry entry) + private PythonAnalyzerSession CreateSession(in IDependencyChainWalker walker, in PythonAnalyzerEntry entry) => new PythonAnalyzerSession(_services, _progress, _analysisCompleteEvent, _startNextSession, _disposeToken.CancellationToken, walker, _version, entry); private void LoadMissingDocuments(IPythonInterpreter interpreter, ImmutableArray missingKeys) { diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs index 9e41c7ef4..cb00d93c7 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs @@ -20,6 +20,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis.Core.DependencyResolution; +using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core; @@ -32,13 +33,13 @@ internal sealed class PythonAnalyzerEntry { private readonly object _syncObj = new object(); private TaskCompletionSource _analysisTcs; private IPythonModule _module; - private bool _isUserModule; + private ModuleType _moduleType; + private PythonAst _ast; private IDocumentAnalysis _previousAnalysis; private HashSet _parserDependencies; private HashSet _analysisDependencies; private int _bufferVersion; private int _analysisVersion; - private int _depth; public IPythonModule Module { get { @@ -48,10 +49,18 @@ public IPythonModule Module { } } + public bool IsUserOrBuiltin { + get { + lock (_syncObj) { + return _moduleType == ModuleType.User || _moduleType == ModuleType.Builtins; + } + } + } + public bool IsUserModule { get { lock (_syncObj) { - return _isUserModule; + return _moduleType == ModuleType.User; } } } @@ -74,21 +83,12 @@ public int AnalysisVersion { } } - public int Depth { - get { - lock (_syncObj) { - return _depth; - } - } - } - public bool NotAnalyzed => PreviousAnalysis is EmptyAnalysis; public PythonAnalyzerEntry(EmptyAnalysis emptyAnalysis) { _previousAnalysis = emptyAnalysis; _module = emptyAnalysis.Document; - _isUserModule = emptyAnalysis.Document.ModuleType == ModuleType.User; - _depth = _isUserModule ? 0 : -1; + _moduleType = _module.ModuleType; _bufferVersion = -1; _analysisVersion = 0; @@ -101,12 +101,18 @@ public Task GetAnalysisAsync(CancellationToken cancellationTo public bool IsValidVersion(int version, out IPythonModule module, out PythonAst ast) { lock (_syncObj) { module = _module; - ast = module.GetAst(); - if (ast == null || module == null) { + ast = _ast; + + if (module == null) { return false; } - return _previousAnalysis is EmptyAnalysis || _isUserModule || _analysisVersion <= version; + if (ast == null) { + Debug.Assert(!(_previousAnalysis is LibraryAnalysis), $"Library module {module.Name} of type {module.ModuleType} has been analyzed already!"); + return false; + } + + return _previousAnalysis is EmptyAnalysis || _moduleType == ModuleType.User || _analysisVersion <= version; } } @@ -120,6 +126,11 @@ public void TrySetAnalysis(IDocumentAnalysis analysis, int version) { return; } + if (analysis is LibraryAnalysis) { + _ast = null; + _parserDependencies = null; + } + _analysisDependencies = null; UpdateAnalysisTcs(version); _previousAnalysis = analysis; @@ -209,20 +220,21 @@ public bool Invalidate(ImmutableArray analysisDependencies, int a } } - public bool Invalidate(IPythonModule module, int bufferVersion, int analysisVersion, out ImmutableArray dependencies) { + public bool Invalidate(IPythonModule module, PythonAst ast, int bufferVersion, int analysisVersion, out ImmutableArray dependencies) { dependencies = ImmutableArray.Empty; if (_bufferVersion >= bufferVersion) { return false; } - var dependenciesHashSet = FindDependencies(module, bufferVersion); + var dependenciesHashSet = FindDependencies(module, ast, bufferVersion); lock (_syncObj) { if (_analysisVersion >= analysisVersion && _bufferVersion >= bufferVersion) { return false; } + _ast = ast; _module = module; - _isUserModule = module.ModuleType == ModuleType.User; + _moduleType = module.ModuleType; _parserDependencies = dependenciesHashSet; Interlocked.Exchange(ref _bufferVersion, bufferVersion); @@ -234,13 +246,13 @@ public bool Invalidate(IPythonModule module, int bufferVersion, int analysisVers } } - private HashSet FindDependencies(IPythonModule module, int bufferVersion) { + private HashSet FindDependencies(IPythonModule module, PythonAst ast, int bufferVersion) { if (_bufferVersion > bufferVersion) { return new HashSet(); } var walker = new DependencyWalker(module); - module.GetAst().Walk(walker); + ast.Walk(walker); var dependencies = walker.Dependencies; dependencies.Remove(new AnalysisModuleKey(module)); return dependencies; @@ -285,8 +297,14 @@ public DependencyWalker(IPythonModule module) { } public override bool Walk(ImportStatement import) { + var forceAbsolute = import.ForceAbsolute; foreach (var moduleName in import.Names) { - HandleSearchResults(_pathResolver.FindImports(_module.FilePath, moduleName, import.ForceAbsolute)); + var importNames = ImmutableArray.Empty; + foreach (var nameExpression in moduleName.Names) { + importNames = importNames.Add(nameExpression.Name); + var imports = _pathResolver.GetImportsFromAbsoluteName(_module.FilePath, importNames, forceAbsolute); + HandleSearchResults(imports); + } } return false; diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index d2d9a58f1..a2347f281 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -19,14 +19,17 @@ using System.Runtime; using System.Threading; using System.Threading.Tasks; +using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Caching; using Microsoft.Python.Analysis.Dependencies; using Microsoft.Python.Analysis.Diagnostics; +using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core; using Microsoft.Python.Core.Logging; using Microsoft.Python.Core.Services; +using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Analyzer { internal sealed class PythonAnalyzerSession { @@ -147,9 +150,9 @@ private async Task StartAsync() { if (!isCanceled) { _progress.ReportRemaining(remaining); if (isFinal) { - ActivityTracker.EndTracking(); - (_analyzer as PythonAnalyzer)?.RaiseAnalysisComplete(ActivityTracker.ModuleCount, ActivityTracker.MillisecondsElapsed); - _log?.Log(TraceEventType.Verbose, $"Analysis complete: {ActivityTracker.ModuleCount} modules in { ActivityTracker.MillisecondsElapsed} ms."); + var (modulesCount, totalMilliseconds) = ActivityTracker.EndTracking(); + (_analyzer as PythonAnalyzer)?.RaiseAnalysisComplete(modulesCount, totalMilliseconds); + _log?.Log(TraceEventType.Verbose, $"Analysis complete: {modulesCount} modules in {totalMilliseconds} ms."); } } } @@ -194,7 +197,7 @@ private async Task AnalyzeAffectedEntriesAsync(Stopwatch stopWatch) { if (isCanceled && !node.Value.NotAnalyzed) { remaining++; - node.Skip(); + node.MoveNext(); continue; } @@ -247,25 +250,23 @@ private void Analyze(IDependencyChainNode node, AsyncCountd } _log?.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) canceled."); - node.Skip(); return; } var startTime = stopWatch.Elapsed; - AnalyzeEntry(entry, module, _walker.Version, node.IsComplete); - node.Commit(); - ActivityTracker.OnModuleAnalysisComplete(node.Value.Module.FilePath); + AnalyzeEntry(node, entry, module, ast, _walker.Version); - LogCompleted(module, stopWatch, startTime); + LogCompleted(node, module, stopWatch, startTime); } catch (OperationCanceledException oce) { node.Value.TryCancel(oce, _walker.Version); - node.Skip(); LogCanceled(node.Value.Module); } catch (Exception exception) { node.Value.TrySetException(exception, _walker.Version); - node.Commit(); + node.MarkWalked(); LogException(node.Value.Module, exception); } finally { + node.MoveNext(); + bool isCanceled; lock (_syncObj) { isCanceled = _isCanceled; @@ -294,9 +295,9 @@ private void AnalyzeEntry() { var startTime = stopWatch?.Elapsed ?? TimeSpan.Zero; - AnalyzeEntry(_entry, module, Version, true); + AnalyzeEntry(null, _entry, module, ast, Version); - LogCompleted(module, stopWatch, startTime); + LogCompleted(null, module, stopWatch, startTime); } catch (OperationCanceledException oce) { _entry.TryCancel(oce, Version); LogCanceled(_entry.Module); @@ -309,7 +310,7 @@ private void AnalyzeEntry() { } } - private void AnalyzeEntry(PythonAnalyzerEntry entry, IPythonModule module, int version, bool isFinalPass) { + private void AnalyzeEntry(IDependencyChainNode node, PythonAnalyzerEntry entry, IPythonModule module, PythonAst ast, int version) { if (entry.PreviousAnalysis is LibraryAnalysis) { _log?.Log(TraceEventType.Verbose, $"Request to re-analyze finalized {module.Name}."); } @@ -318,8 +319,7 @@ private void AnalyzeEntry(PythonAnalyzerEntry entry, IPythonModule module, int v var analyzable = module as IAnalyzable; analyzable?.NotifyAnalysisBegins(); - var ast = module.GetAst(); - var walker = new ModuleWalker(_services, module); + var walker = new ModuleWalker(_services, module, ast); ast.Walk(walker); _analyzerCancellationToken.ThrowIfCancellationRequested(); @@ -327,7 +327,18 @@ private void AnalyzeEntry(PythonAnalyzerEntry entry, IPythonModule module, int v walker.Complete(); _analyzerCancellationToken.ThrowIfCancellationRequested(); - analyzable?.NotifyAnalysisComplete(version, walker, isFinalPass); + bool isCanceled; + lock (_syncObj) { + isCanceled = _isCanceled; + } + + if (!isCanceled) { + node?.MarkWalked(); + } + + var analysis = CreateAnalysis(node, (IDocument)module, ast, version, walker, isCanceled); + + analyzable?.NotifyAnalysisComplete(analysis); entry.TrySetAnalysis(module.Analysis, version); if (module.ModuleType == ModuleType.User) { @@ -336,9 +347,13 @@ private void AnalyzeEntry(PythonAnalyzerEntry entry, IPythonModule module, int v } } - private void LogCompleted(IPythonModule module, Stopwatch stopWatch, TimeSpan startTime) { + private void LogCompleted(IDependencyChainNode node, IPythonModule module, Stopwatch stopWatch, TimeSpan startTime) { if (_log != null) { - _log.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) completed in {(stopWatch.Elapsed - startTime).TotalMilliseconds} ms."); + var completed = node != null && module.Analysis is LibraryAnalysis ? "completed for library" : "completed"; + var message = node != null + ? $"Analysis of {module.Name}({module.ModuleType}) on depth {node.VertexDepth} {completed} in {(stopWatch.Elapsed - startTime).TotalMilliseconds} ms." + : $"Out of order analysis of {module.Name}({module.ModuleType}) completed in {(stopWatch.Elapsed - startTime).TotalMilliseconds} ms."; + _log.Log(TraceEventType.Verbose, message); } } @@ -354,6 +369,25 @@ private void LogException(IPythonModule module, Exception exception) { } } + private IDocumentAnalysis CreateAnalysis(IDependencyChainNode node, IDocument document, PythonAst ast, int version, ModuleWalker walker, bool isCanceled) { + var createLibraryAnalysis = !isCanceled && + node != null && + !node.HasMissingDependencies && + document.ModuleType == ModuleType.Library && + !document.IsOpen && + node.HasOnlyWalkedDependencies && + node.IsValidVersion; + + if (!createLibraryAnalysis) { + return new DocumentAnalysis(document, version, walker.GlobalScope, walker.Eval, walker.StarImportMemberNames); + } + + ast.Reduce(x => x is ImportStatement || x is FromImportStatement); + document.SetAst(ast); + var eval = new ExpressionEval(walker.Eval.Services, document, ast); + return new LibraryAnalysis(document, version, walker.GlobalScope, eval, walker.StarImportMemberNames); + } + private enum State { NotStarted = 0, Started = 1, diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonInterpreter.cs b/src/Analysis/Ast/Impl/Analyzer/PythonInterpreter.cs index e7cd7c3f0..58b06e866 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonInterpreter.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonInterpreter.cs @@ -50,9 +50,9 @@ private async Task LoadBuiltinTypesAsync(string root, IServiceManager sm, Cancel lock (_lock) { var builtinModule = _moduleResolution.CreateBuiltinsModule(); _builtinTypes[BuiltinTypeId.NoneType] - = new PythonType("NoneType", new Location(builtinModule, default), string.Empty, BuiltinTypeId.NoneType); + = new PythonType("NoneType", new Location(builtinModule), string.Empty, BuiltinTypeId.NoneType); _builtinTypes[BuiltinTypeId.Unknown] - = UnknownType = new PythonType("Unknown", new Location(builtinModule, default), string.Empty); + = UnknownType = new PythonType("Unknown", new Location(builtinModule), string.Empty); } await _moduleResolution.InitializeAsync(cancellationToken); diff --git a/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs b/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs index c26067c0e..915008d07 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs @@ -13,12 +13,15 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System.Collections; using System.Collections.Generic; using System.Linq; using Microsoft.Python.Analysis.Analyzer.Evaluation; +using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Analyzer.Symbols { @@ -50,22 +53,12 @@ public void EvaluateClass() { EvaluateInnerClasses(_classDef); _class = classInfo; - // Set bases to the class. - var bases = new List(); - foreach (var a in _classDef.Bases.Where(a => string.IsNullOrEmpty(a.Name))) { - // We cheat slightly and treat base classes as annotations. - var b = Eval.GetTypeFromAnnotation(a.Expression); - if (b != null) { - var t = b.GetPythonType(); - bases.Add(t); - t.AddReference(Eval.GetLocationOfName(a.Expression)); - } - } - _class.SetBases(bases); + var bases = ProcessBases(outerScope); + + _class.SetBases(bases); // Declare __class__ variable in the scope. Eval.DeclareVariable("__class__", _class, VariableSource.Declaration); - ProcessClassBody(); } } @@ -118,6 +111,47 @@ private void ProcessClassBody() { UpdateClassMembers(); } + private IEnumerable ProcessBases(Scope outerScope) { + var bases = new List(); + foreach (var a in _classDef.Bases.Where(a => string.IsNullOrEmpty(a.Name))) { + var expr = a.Expression; + + switch (expr) { + // class declared in the current module + case NameExpression nameExpression: + var name = Eval.GetInScope(nameExpression.Name, outerScope); + switch (name) { + case PythonClassType classType: + bases.Add(classType); + break; + case IPythonConstant constant: + ReportInvalidBase(constant.Value); + break; + default: + TryAddBase(bases, a); + break; + } + break; + default: + TryAddBase(bases, a); + break; + } + } + return bases; + } + + private void TryAddBase(List bases, Arg arg) { + // We cheat slightly and treat base classes as annotations. + var b = Eval.GetTypeFromAnnotation(arg.Expression); + if (b != null) { + var t = b.GetPythonType(); + bases.Add(t); + t.AddReference(Eval.GetLocationOfName(arg.Expression)); + } else { + ReportInvalidBase(arg.ToCodeString(Eval.Ast, CodeFormattingOptions.Traditional)); + } + } + private void EvaluateConstructors(ClassDefinition cd) { // Do not use foreach since walker list is dynamically modified and walkers are removed // after processing. Handle __init__ and __new__ first so class variables are initialized. @@ -152,6 +186,17 @@ private void UpdateClassMembers() { _class.AddMembers(members, false); } + private void ReportInvalidBase(object argVal) { + Eval.ReportDiagnostics(Eval.Module.Uri, + new DiagnosticsEntry( + Resources.InheritNonClass.FormatInvariant(argVal), + _classDef.NameExpression.GetLocation(Eval)?.Span ?? default, + Diagnostics.ErrorCodes.InheritNonClass, + Severity.Error, + DiagnosticSource.Analysis + )); + } + // Classes and functions are walked by their respective evaluators public override bool Walk(ClassDefinition node) => false; public override bool Walk(FunctionDefinition node) => false; diff --git a/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs b/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs index 9732aea0e..342ffcfd2 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs @@ -18,12 +18,15 @@ using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Analyzer.Evaluation; +using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Analysis.Values.Collections; using Microsoft.Python.Core; +using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Ast; +using ErrorCodes = Microsoft.Python.Analysis.Diagnostics.ErrorCodes; namespace Microsoft.Python.Analysis.Analyzer.Symbols { [DebuggerDisplay("{FunctionDefinition.Name}")] @@ -34,7 +37,6 @@ internal sealed class FunctionEvaluator : MemberEvaluator { public FunctionEvaluator(ExpressionEval eval, PythonFunctionOverload overload) : base(eval, overload.FunctionDefinition) { - _overload = overload; _function = overload.ClassMember ?? throw new NullReferenceException(nameof(overload.ClassMember)); _self = _function.DeclaringType as PythonClassType; @@ -77,7 +79,7 @@ private IPythonType TryDetermineReturnValue() { if (!annotationType.IsUnknown()) { // Annotations are typically types while actually functions return // instances unless specifically annotated to a type such as Type[T]. - var t = annotationType.CreateInstance(annotationType.Name, ArgumentSet.Empty); + var t = annotationType.CreateInstance(annotationType.Name, ArgumentSet.WithoutContext); // If instance could not be created, such as when return type is List[T] and // type of T is not yet known, just use the type. var instance = t.IsUnknown() ? annotationType : t; @@ -116,6 +118,18 @@ public override bool Walk(AssignmentStatement node) { public override bool Walk(ReturnStatement node) { var value = Eval.GetValueFromExpression(node.Expression); if (value != null) { + // although technically legal, __init__ in a constructor should not have a not-none return value + if (FunctionDefinition.Name.EqualsOrdinal("__init__") && _function.DeclaringType.MemberType == PythonMemberType.Class + && !value.IsOfType(BuiltinTypeId.NoneType)) { + + Eval.ReportDiagnostics(Module.Uri, new Diagnostics.DiagnosticsEntry( + Resources.ReturnInInit, + node.GetLocation(Eval).Span, + ErrorCodes.ReturnInInit, + Severity.Warning, + DiagnosticSource.Analysis)); + } + _overload.AddReturnValue(value); } return true; // We want to evaluate all code so all private variables in __new__ get defined diff --git a/src/Analysis/Ast/Impl/Dependencies/DependencyResolver.cs b/src/Analysis/Ast/Impl/Dependencies/DependencyResolver.cs index 1d2e76c6b..1644a1db2 100644 --- a/src/Analysis/Ast/Impl/Dependencies/DependencyResolver.cs +++ b/src/Analysis/Ast/Impl/Dependencies/DependencyResolver.cs @@ -31,10 +31,10 @@ internal sealed class DependencyResolver : IDependencyResolver _version; - public int ChangeValue(TKey key, TValue value, bool isRoot, params TKey[] incomingKeys) + public int ChangeValue(in TKey key, in TValue value, in bool isRoot, params TKey[] incomingKeys) => ChangeValue(key, value, isRoot, ImmutableArray.Create(incomingKeys)); - public int ChangeValue(TKey key, TValue value, bool isRoot, ImmutableArray incomingKeys) { + public int ChangeValue(in TKey key, in TValue value, in bool isRoot, in ImmutableArray incomingKeys) { lock (_syncObj) { if (!_keys.TryGetValue(key, out var index)) { index = _keys.Count; @@ -47,7 +47,7 @@ public int ChangeValue(TKey key, TValue value, bool isRoot, ImmutableArray } } - public int TryAddValue(TKey key, TValue value, bool isRoot, ImmutableArray incomingKeys) { + public int TryAddValue(in TKey key, in TValue value, in bool isRoot, in ImmutableArray incomingKeys) { lock (_syncObj) { if (!_keys.TryGetValue(key, out var index)) { index = _keys.Count; @@ -62,7 +62,7 @@ public int TryAddValue(TKey key, TValue value, bool isRoot, ImmutableArray } } - public int Remove(TKey key) { + public int Remove(in TKey key) { lock (_syncObj) { if (!_keys.TryGetValue(key, out var index)) { return _version; @@ -71,14 +71,14 @@ public int Remove(TKey key) { var version = Interlocked.Increment(ref _version); var vertex = _vertices[index]; - _vertices[index] = default; - if (vertex == null) { + if (vertex == default) { return version; } - + + _vertices[index] = default; foreach (var incomingIndex in vertex.Incoming) { var incoming = _vertices[incomingIndex]; - if (incoming != null && incoming.IsSealed) { + if (incoming != default && incoming.IsSealed) { _vertices[incomingIndex] = new DependencyVertex(incoming, version, false); } } @@ -89,7 +89,7 @@ public int Remove(TKey key) { foreach (var outgoingIndex in vertex.Outgoing) { var outgoing = _vertices[outgoingIndex]; - if (outgoing != null && !outgoing.IsNew) { + if (outgoing != default && !outgoing.IsNew) { _vertices[outgoingIndex] = new DependencyVertex(outgoing, version, true); } } @@ -100,7 +100,7 @@ public int Remove(TKey key) { public int RemoveKeys(params TKey[] keys) => RemoveKeys(ImmutableArray.Create(keys)); - public int RemoveKeys(ImmutableArray keys) { + public int RemoveKeys(in ImmutableArray keys) { lock (_syncObj) { foreach (var key in keys) { if (_keys.TryGetValue(key, out var index)) { @@ -138,7 +138,7 @@ public int RemoveKeys(ImmutableArray keys) { } } - private void Update(TKey key, TValue value, bool isRoot, ImmutableArray incomingKeys, int index) { + private void Update(in TKey key, in TValue value, in bool isRoot, in ImmutableArray incomingKeys, in int index) { var version = Interlocked.Increment(ref _version); var incoming = EnsureKeys(index, incomingKeys, version); @@ -147,7 +147,7 @@ private void Update(TKey key, TValue value, bool isRoot, ImmutableArray in _keys[key] = index; } - private ImmutableArray EnsureKeys(int index, ImmutableArray keys, int version) { + private ImmutableArray EnsureKeys(in int index, in ImmutableArray keys, in int version) { var incoming = ImmutableArray.Empty; foreach (var key in keys) { @@ -175,7 +175,7 @@ public IDependencyChainWalker CreateWalker() { } } - public bool TryCreateWalker(int version, int walkerDepthLimit, out IDependencyChainWalker walker) { + public bool TryCreateWalker(in int version, in int walkerDepthLimit, out IDependencyChainWalker walker) { ImmutableArray> vertices; lock (_syncObj) { @@ -210,8 +210,7 @@ public bool TryCreateWalker(int version, int walkerDepthLimit, out IDependencyCh } // Iterate original graph to get starting vertices - var startingVertices = walkingGraph.Where(v => v.IncomingCount == 0); - if (!TryFindMissingDependencies(vertices, walkingGraph, version)) { + if (!TryFindMissingDependencies(vertices, walkingGraph, version, out var missingKeys)) { walker = default; return false; } @@ -222,26 +221,12 @@ public bool TryCreateWalker(int version, int walkerDepthLimit, out IDependencyCh } var affectedValues = walkingGraph.Select(v => v.DependencyVertex.Value); - var missingKeys = ImmutableArray.Empty; - - lock (_syncObj) { - if (version != _version) { - walker = default; - return false; - } - - foreach (var (key, index) in _keys) { - if (vertices[index] == default/* && depths[index] <= walkerDepthLimit*/) { - missingKeys = missingKeys.Add(key); - } - } - } - - walker = new DependencyChainWalker(startingVertices, affectedValues, depths, missingKeys, totalNodesCount, version); - return true; + var startingVertices = walkingGraph.Where(v => !v.HasIncoming); + walker = new DependencyChainWalker(this, startingVertices, affectedValues, depths, missingKeys, totalNodesCount, version); + return version == _version; } - private bool TryBuildReverseGraph(in ImmutableArray> vertices, int version) { + private bool TryBuildReverseGraph(in ImmutableArray> vertices, in int version) { var reverseGraphIsBuilt = true; foreach (var vertex in vertices) { if (vertex != null && !vertex.IsSealed) { @@ -256,7 +241,7 @@ private bool TryBuildReverseGraph(in ImmutableArray[vertices.Count]; foreach (var vertex in vertices) { - if (vertex == null) { + if (vertex == default) { continue; } @@ -283,7 +268,7 @@ private bool TryBuildReverseGraph(in ImmutableArray> vertices, ImmutableArray depths, int version, out ImmutableArray> analysisGraph) { + private bool TryCreateWalkingGraph(in ImmutableArray> vertices, in ImmutableArray depths, in int version, out ImmutableArray> analysisGraph) { if (version != _version) { analysisGraph = default; return false; @@ -326,7 +311,7 @@ private bool TryCreateWalkingGraph(in ImmutableArray vertex, } } - private bool TryFindMissingDependencies(in ImmutableArray> vertices, in ImmutableArray> walkingGraph, int version) { + private bool TryFindMissingDependencies(in ImmutableArray> vertices, in ImmutableArray> walkingGraph, int version, out ImmutableArray missingKeys) { var haveMissingDependencies = new bool[vertices.Count]; var queue = new Queue>(); + var missingIndicesHashSet = new HashSet(); + // First, go through all the vertices and find those that have missing incoming edges foreach (var vertex in vertices) { if (vertex == default) { continue; @@ -554,11 +541,14 @@ private bool TryFindMissingDependencies(in ImmutableArray.Empty; + + // From them, go through the edges and mark all reachable vertices while (queue.Count > 0) { if (version != _version) { return false; @@ -566,6 +556,10 @@ private bool TryFindMissingDependencies(in ImmutableArray { + private readonly DependencyResolver _dependencyResolver; private readonly ImmutableArray> _startingVertices; private readonly ImmutableArray _depths; private readonly object _syncObj; @@ -604,14 +607,16 @@ public int Remaining { } } - public DependencyChainWalker( + public DependencyChainWalker(in DependencyResolver dependencyResolver, in ImmutableArray> startingVertices, in ImmutableArray affectedValues, in ImmutableArray depths, in ImmutableArray missingKeys, in int totalNodesCount, in int version) { + _syncObj = new object(); + _dependencyResolver = dependencyResolver; _startingVertices = startingVertices; _depths = depths; AffectedValues = affectedValues; @@ -638,18 +643,18 @@ public Task> GetNextAsync(CancellationToken cancell return ppc.ConsumeAsync(cancellationToken); } - public void MarkCompleted(WalkingVertex vertex, bool commitChanges) { + public void MoveNext(WalkingVertex vertex) { var verticesToProduce = new List>(); var isCompleted = false; lock (_syncObj) { _remaining--; foreach (var outgoing in vertex.Outgoing) { - if (outgoing.IncomingCount == 0) { + if (!outgoing.HasIncoming) { continue; } - outgoing.DecrementIncoming(); - if (outgoing.IncomingCount > 0) { + outgoing.DecrementIncoming(vertex.HasOnlyWalkedIncoming); + if (outgoing.HasIncoming) { continue; } @@ -661,10 +666,6 @@ public void MarkCompleted(WalkingVertex vertex, bool commitChanges } } - if (commitChanges && vertex.SecondPass == null) { - vertex.DependencyVertex.MarkWalked(); - } - if (isCompleted) { _ppc.Produce(null); } else { @@ -673,15 +674,24 @@ public void MarkCompleted(WalkingVertex vertex, bool commitChanges } } } + + public bool IsValidVersion { + get { + lock (_dependencyResolver._syncObj) { + return _dependencyResolver._version == Version; + } + } + } } private sealed class DependencyChainNode : IDependencyChainNode { private readonly WalkingVertex _vertex; private DependencyChainWalker _walker; public TValue Value => _vertex.DependencyVertex.Value; - public bool HasMissingDependencies => _vertex.HasMissingDependencies; public int VertexDepth { get; } - public bool IsComplete => _vertex.SecondPass == null && !HasMissingDependencies; + public bool HasMissingDependencies => _vertex.HasMissingDependencies; + public bool HasOnlyWalkedDependencies => _vertex.HasOnlyWalkedIncoming && _vertex.SecondPass == default; + public bool IsValidVersion => _walker.IsValidVersion; public DependencyChainNode(DependencyChainWalker walker, WalkingVertex vertex, int depth) { _walker = walker; @@ -689,8 +699,13 @@ public DependencyChainNode(DependencyChainWalker walker, WalkingVertex Interlocked.Exchange(ref _walker, null)?.MarkCompleted(_vertex, true); - public void Skip() => Interlocked.Exchange(ref _walker, null)?.MarkCompleted(_vertex, false); + public void MarkWalked() { + if (_vertex.SecondPass == null) { + _vertex.DependencyVertex.MarkWalked(); + } + } + + public void MoveNext() => Interlocked.Exchange(ref _walker, null)?.MoveNext(_vertex); } } } diff --git a/src/Analysis/Ast/Impl/Dependencies/DependencyVertex.cs b/src/Analysis/Ast/Impl/Dependencies/DependencyVertex.cs index 03bffead2..ddbf9160d 100644 --- a/src/Analysis/Ast/Impl/Dependencies/DependencyVertex.cs +++ b/src/Analysis/Ast/Impl/Dependencies/DependencyVertex.cs @@ -13,7 +13,6 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading; diff --git a/src/Analysis/Ast/Impl/Dependencies/IDependencyChainNode.cs b/src/Analysis/Ast/Impl/Dependencies/IDependencyChainNode.cs index 299235cc6..a4f394d00 100644 --- a/src/Analysis/Ast/Impl/Dependencies/IDependencyChainNode.cs +++ b/src/Analysis/Ast/Impl/Dependencies/IDependencyChainNode.cs @@ -18,12 +18,19 @@ internal interface IDependencyChainNode { int VertexDepth { get; } /// - /// Shows if node has any direct or indirect dependencies that aren't added to the graph + /// Returns true if node has any direct or indirect dependencies that aren't added to the graph, otherwise false /// bool HasMissingDependencies { get; } + /// + /// Returns true if node has only direct and indirect dependencies that have been walked at least once, otherwise false + /// + bool HasOnlyWalkedDependencies { get; } + /// + /// Returns true if node version matches version of the walked graph + /// + bool IsValidVersion { get; } TValue Value { get; } - void Commit(); - void Skip(); - bool IsComplete { get; } + void MarkWalked(); + void MoveNext(); } } diff --git a/src/Analysis/Ast/Impl/Dependencies/IDependencyResolver.cs b/src/Analysis/Ast/Impl/Dependencies/IDependencyResolver.cs index a8328bfb9..02fdfbdfd 100644 --- a/src/Analysis/Ast/Impl/Dependencies/IDependencyResolver.cs +++ b/src/Analysis/Ast/Impl/Dependencies/IDependencyResolver.cs @@ -24,12 +24,12 @@ namespace Microsoft.Python.Analysis.Dependencies { /// concurrently. /// internal interface IDependencyResolver { - int TryAddValue(TKey key, TValue value, bool isRoot, ImmutableArray incomingKeys); - int ChangeValue(TKey key, TValue value, bool isRoot, ImmutableArray incomingKeys); - int Remove(TKey key); - int RemoveKeys(ImmutableArray keys); + int TryAddValue(in TKey key, in TValue value, in bool isRoot, in ImmutableArray incomingKeys); + int ChangeValue(in TKey key, in TValue value, in bool isRoot, in ImmutableArray incomingKeys); + int Remove(in TKey key); + int RemoveKeys(in ImmutableArray keys); IDependencyChainWalker CreateWalker(); - bool TryCreateWalker(int version, int walkerDepthLimit, out IDependencyChainWalker walker); + bool TryCreateWalker(in int version, in int walkerDepthLimit, out IDependencyChainWalker walker); } } diff --git a/src/Analysis/Ast/Impl/Dependencies/WalkingVertex.cs b/src/Analysis/Ast/Impl/Dependencies/WalkingVertex.cs index a2ddb90ca..d3debee4f 100644 --- a/src/Analysis/Ast/Impl/Dependencies/WalkingVertex.cs +++ b/src/Analysis/Ast/Impl/Dependencies/WalkingVertex.cs @@ -21,16 +21,19 @@ namespace Microsoft.Python.Analysis.Dependencies { [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] internal sealed class WalkingVertex { - public static Comparison> FirstPassIncomingComparison { get; } = (v1, v2) => v1.FirstPass.IncomingCount.CompareTo(v2.FirstPass.IncomingCount); + public static Comparison> FirstPassIncomingComparison { get; } = (v1, v2) => v1.FirstPass._incomingCount.CompareTo(v2.FirstPass._incomingCount); private readonly List> _outgoing; private bool _isSealed; + private int _incomingCount; + private int _walkedIncomingCount; public DependencyVertex DependencyVertex { get; } public IReadOnlyList> Outgoing => _outgoing; public int Index { get; set; } public int LoopNumber { get; set; } - public int IncomingCount { get; private set; } + public bool HasIncoming => _incomingCount != 0; + public bool HasOnlyWalkedIncoming => _walkedIncomingCount == 0; public bool HasMissingDependencies { get; private set; } public WalkingVertex FirstPass { get; } @@ -57,7 +60,8 @@ public void AddOutgoing(WalkingVertex outgoingVertex) { CheckNotSealed(); _outgoing.Add(outgoingVertex); - outgoingVertex.IncomingCount++; + outgoingVertex._incomingCount++; + outgoingVertex._walkedIncomingCount++; } public void AddOutgoing(HashSet> loop) { @@ -65,7 +69,8 @@ public void AddOutgoing(HashSet> loop) { _outgoing.AddRange(loop); foreach (var outgoingVertex in loop) { - outgoingVertex.IncomingCount++; + outgoingVertex._incomingCount++; + outgoingVertex._walkedIncomingCount++; } } @@ -74,7 +79,8 @@ public void RemoveOutgoingAt(int index) { var outgoingVertex = _outgoing[index]; _outgoing.RemoveAt(index); - outgoingVertex.IncomingCount--; + outgoingVertex._incomingCount--; + outgoingVertex._walkedIncomingCount--; } public WalkingVertex CreateSecondPassVertex() { @@ -86,9 +92,12 @@ public WalkingVertex CreateSecondPassVertex() { public void Seal() => _isSealed = true; - public void DecrementIncoming() { + public void DecrementIncoming(bool isWalkedIncoming) { CheckSealed(); - IncomingCount--; + _incomingCount--; + if (isWalkedIncoming) { + _walkedIncomingCount--; + } } private void CheckSealed() => Check.InvalidOperation(_isSealed); diff --git a/src/Analysis/Ast/Impl/Diagnostics/ErrorCodes.cs b/src/Analysis/Ast/Impl/Diagnostics/ErrorCodes.cs index 45c6a1407..6797c4044 100644 --- a/src/Analysis/Ast/Impl/Diagnostics/ErrorCodes.cs +++ b/src/Analysis/Ast/Impl/Diagnostics/ErrorCodes.cs @@ -25,5 +25,10 @@ public static class ErrorCodes { public const string UndefinedVariable = "undefined-variable"; public const string VariableNotDefinedGlobally= "variable-not-defined-globally"; public const string VariableNotDefinedNonLocal = "variable-not-defined-nonlocal"; + public const string UnsupportedOperandType = "unsupported-operand-type"; + public const string ReturnInInit = "return-in-init"; + public const string TypingNewTypeArguments = "typing-newtype-arguments"; + public const string TypingGenericArguments = "typing-generic-arguments"; + public const string InheritNonClass = "inherit-non-class"; } } diff --git a/src/Analysis/Ast/Impl/Documents/Definitions/IDocument.cs b/src/Analysis/Ast/Impl/Documents/Definitions/IDocument.cs index e03fdf3b6..dc1228ddb 100644 --- a/src/Analysis/Ast/Impl/Documents/Definitions/IDocument.cs +++ b/src/Analysis/Ast/Impl/Documents/Definitions/IDocument.cs @@ -51,11 +51,6 @@ public interface IDocument: IPythonModule, IDisposable { /// Task GetAnalysisAsync(int waitTime = 200, CancellationToken cancellationToken = default); - /// - /// Returns last known document AST. The AST may be out of date or null. - /// - PythonAst GetAnyAst(); - /// /// Returns last known document analysis. The analysis may be out of date. /// diff --git a/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs b/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs index 9fc6d389d..a88533762 100644 --- a/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs +++ b/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs @@ -103,7 +103,6 @@ public IDocument OpenDocument(Uri uri, string content, string filePath = null) { if (justOpened) { Opened?.Invoke(this, new DocumentEventArgs(document)); - _services.GetService().InvalidateAnalysis(document); } return document; @@ -248,8 +247,8 @@ private bool TryAddModulePath(ModuleCreationOptions mco) { private bool TryOpenDocument(DocumentEntry entry, string content) { if (!entry.Document.IsOpen) { - entry.Document.Reset(content); entry.Document.IsOpen = true; + entry.Document.Reset(content); entry.LockCount++; return true; } diff --git a/src/Analysis/Ast/Impl/Extensions/NodeExtensions.cs b/src/Analysis/Ast/Impl/Extensions/NodeExtensions.cs index e5ccb7bfb..aa82e938a 100644 --- a/src/Analysis/Ast/Impl/Extensions/NodeExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/NodeExtensions.cs @@ -13,18 +13,30 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using Microsoft.Python.Analysis.Analyzer; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis { public static class NodeExtensions { - public static LocationInfo GetLocation(this Node node, IPythonModule module) { + public static LocationInfo GetLocation(this Node node, IExpressionEvaluator eval) { if (node == null || node.StartIndex >= node.EndIndex) { return LocationInfo.Empty; } - var start = node.GetStart(module.GetAst()); - var end = node.GetEnd(module.GetAst()); + return GetLocation(node, eval.Ast, eval.Module); + } + public static LocationInfo GetLocation(this Node node, IDocumentAnalysis analysis) { + if (node == null || node.StartIndex >= node.EndIndex) { + return LocationInfo.Empty; + } + + return GetLocation(node, analysis.Ast, analysis.Document); + } + + private static LocationInfo GetLocation(Node node, PythonAst ast, IPythonModule module) { + var start = node.GetStart(ast); + var end = node.GetEnd(ast); return new LocationInfo(module.FilePath, module.Uri, start.Line, start.Column, end.Line, end.Column); } diff --git a/src/Analysis/Ast/Impl/Extensions/PythonClassExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonClassExtensions.cs index 107c5b41d..81442bc96 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonClassExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonClassExtensions.cs @@ -33,6 +33,8 @@ public static void AddMemberReference(this IPythonType type, string name, IExpre eval.LookupNameInScopes(name, out _, out var v, LookupOptions.Local); v?.AddReference(location); } + } else if (type is IPythonModule module && module.GlobalScope != null && module.GlobalScope.Variables.TryGetVariable(name, out var variable)) { + variable.AddReference(location); } } diff --git a/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs index c33b4620f..b2553b65c 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs @@ -20,10 +20,16 @@ namespace Microsoft.Python.Analysis { public static class PythonModuleExtensions { internal static PythonAst GetAst(this IPythonModule module) - => ((IAstNodeContainer)module).GetAstNode(module); + => (PythonAst)((IAstNodeContainer)module).GetAstNode(module); + + internal static void SetAst(this IPythonModule module, PythonAst ast) { + var contained = (IAstNodeContainer)module; + contained.ClearContent(); + contained.AddAstNode(module, ast); + } internal static T GetAstNode(this IPythonModule module, object o) where T : Node - => ((IAstNodeContainer)module).GetAstNode(o); + => (T)((IAstNodeContainer)module).GetAstNode(o); internal static void AddAstNode(this IPythonModule module, object o, Node n) => ((IAstNodeContainer)module).AddAstNode(o, n); } diff --git a/src/Analysis/Ast/Impl/Extensions/ScopeExtensions.cs b/src/Analysis/Ast/Impl/Extensions/ScopeExtensions.cs index 6ba17ce62..69a5d536a 100644 --- a/src/Analysis/Ast/Impl/Extensions/ScopeExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/ScopeExtensions.cs @@ -27,6 +27,8 @@ public static int GetBodyStartIndex(this IScope scope) { return cd.HeaderIndex; case FunctionDefinition fd: return fd.HeaderIndex; + case null: + return 0; default: return scope.Node.StartIndex; } diff --git a/src/Analysis/Ast/Impl/Linting/UndefinedVariables/ExpressionWalker.cs b/src/Analysis/Ast/Impl/Linting/UndefinedVariables/ExpressionWalker.cs index cc33b194e..5cdae2a1b 100644 --- a/src/Analysis/Ast/Impl/Linting/UndefinedVariables/ExpressionWalker.cs +++ b/src/Analysis/Ast/Impl/Linting/UndefinedVariables/ExpressionWalker.cs @@ -98,7 +98,7 @@ public override bool Walk(NameExpression node) { // y = x // x = 1 var variableDefinitionSpan = v.Definition.Span; - var nameUseLocation = node.GetLocation(analysis.Document); + var nameUseLocation = node.GetLocation(analysis); // Make sure we are in the same scope in order to avoid // def func(): diff --git a/src/Analysis/Ast/Impl/Modules/BuiltinsPythonModule.cs b/src/Analysis/Ast/Impl/Modules/BuiltinsPythonModule.cs index f792b565f..c86634ddf 100644 --- a/src/Analysis/Ast/Impl/Modules/BuiltinsPythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/BuiltinsPythonModule.cs @@ -121,7 +121,7 @@ private void SpecializeTypes() { _hiddenNames.Add("__builtin_module_names__"); - var location = new Location(this, default); + var location = new Location(this); if (_boolType != null) { Analysis.GlobalScope.DeclareVariable("True", _boolType, VariableSource.Builtin, location); Analysis.GlobalScope.DeclareVariable("False", _boolType, VariableSource.Builtin, location); diff --git a/src/Analysis/Ast/Impl/Modules/Definitions/IAstNodeContainer.cs b/src/Analysis/Ast/Impl/Modules/Definitions/IAstNodeContainer.cs index 0ed36cb97..deeb65c63 100644 --- a/src/Analysis/Ast/Impl/Modules/Definitions/IAstNodeContainer.cs +++ b/src/Analysis/Ast/Impl/Modules/Definitions/IAstNodeContainer.cs @@ -24,18 +24,13 @@ internal interface IAstNodeContainer { /// Nodes are not available for library modules as AST is not retained /// in libraries in order to conserve memory. /// - T GetAstNode(object o) where T : Node; + Node GetAstNode(object o); /// /// Associated AST node with the object. /// void AddAstNode(object o, Node n); - /// - /// Removes all AST node associations. - /// - void ClearAst(); - void ClearContent(); } } diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.Analysis.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.Analysis.cs deleted file mode 100644 index 07deffadd..000000000 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.Analysis.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System; -using System.Diagnostics; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Python.Analysis.Analyzer; -using Microsoft.Python.Analysis.Caching; -using Microsoft.Python.Analysis.Diagnostics; -using Microsoft.Python.Analysis.Types; -using Microsoft.Python.Analysis.Values; -using Microsoft.Python.Core; - -namespace Microsoft.Python.Analysis.Modules { - /// - /// Primary base for all modules and user documents. Provides access - /// to AST and the module analysis. - /// - [DebuggerDisplay("{Name} : {ModuleType}")] - internal partial class PythonModule { - public void NotifyAnalysisBegins() { - lock (AnalysisLock) { - if (Analysis is LibraryAnalysis) { - var sw = Log != null ? Stopwatch.StartNew() : null; - lock (AnalysisLock) { - _astMap[this] = RecreateAst(); - } - sw?.Stop(); - Log?.Log(TraceEventType.Verbose, $"Reloaded AST of {Name} in {sw?.Elapsed.TotalMilliseconds} ms"); - } - - if (_updated) { - _updated = false; - // In all variables find those imported, then traverse imported modules - // and remove references to this module. If variable refers to a module, - // recurse into module but only process global scope. - - if (GlobalScope == null) { - return; - } - - // TODO: Figure out where the nulls below are coming from. - var importedVariables = ((IScope)GlobalScope) - .TraverseDepthFirst(c => c?.Children ?? Enumerable.Empty()) - .SelectMany(s => s?.Variables ?? VariableCollection.Empty) - .Where(v => v?.Source == VariableSource.Import); - - foreach (var v in importedVariables) { - v.RemoveReferences(this); - if (v.Value is IPythonModule module) { - RemoveReferencesInModule(module); - } - } - } - } - } - - public void NotifyAnalysisComplete(int version, ModuleWalker walker, bool isFinalPass) { - lock (AnalysisLock) { - if (version < Analysis.Version) { - return; - } - - Analysis = CreateAnalysis(version, walker, isFinalPass); - GlobalScope = Analysis.GlobalScope; - - // Derived classes can override OnAnalysisComplete if they want - // to perform additional actions on the completed analysis such - // as declare additional variables, etc. - OnAnalysisComplete(); - ContentState = State.Analyzed; - - if (ModuleType != ModuleType.User) { - _buffer.Reset(_buffer.Version, string.Empty); - } - } - - // Do not report issues with libraries or stubs - if (ModuleType == ModuleType.User) { - _diagnosticsService?.Replace(Uri, Analysis.Diagnostics, DiagnosticSource.Analysis); - } - - NewAnalysis?.Invoke(this, EventArgs.Empty); - } - - protected virtual void OnAnalysisComplete() { } - - public IDocumentAnalysis GetAnyAnalysis() => Analysis; - - public Task GetAnalysisAsync(int waitTime = 200, CancellationToken cancellationToken = default) - => Services.GetService().GetAnalysisAsync(this, waitTime, cancellationToken); - - private IDocumentAnalysis CreateAnalysis(int version, ModuleWalker walker, bool isFinalPass) { - var analysis = ModuleType == ModuleType.Library && isFinalPass - ? new LibraryAnalysis(this, version, walker.Eval.Services, walker.GlobalScope, walker.StarImportMemberNames) - : (IDocumentAnalysis)new DocumentAnalysis(this, version, walker.GlobalScope, walker.Eval, walker.StarImportMemberNames); - - if (analysis.Document.ModuleType != ModuleType.Stub) { - var dbs = Services.GetService(); - dbs?.StoreModuleAnalysisAsync(analysis).DoNotWait(); - } - - return analysis; - } - - private void RemoveReferencesInModule(IPythonModule module) { - if (module.GlobalScope?.Variables != null) { - foreach (var v in module.GlobalScope.Variables) { - v.RemoveReferences(this); - } - } - } - } -} diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.Ast.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.Ast.cs deleted file mode 100644 index 08b69fd28..000000000 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.Ast.cs +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Python.Analysis.Analyzer; -using Microsoft.Python.Analysis.Diagnostics; -using Microsoft.Python.Core.Text; -using Microsoft.Python.Parsing; -using Microsoft.Python.Parsing.Ast; - -namespace Microsoft.Python.Analysis.Modules { - internal partial class PythonModule { - #region Parsing - /// - /// Returns document parse tree. - /// - public async Task GetAstAsync(CancellationToken cancellationToken = default) { - Task t = null; - while (true) { - lock (AnalysisLock) { - if (t == _parsingTask) { - break; - } - cancellationToken.ThrowIfCancellationRequested(); - t = _parsingTask; - } - try { - await (t ?? Task.CompletedTask); - break; - } catch (OperationCanceledException) { - // Parsing as canceled, try next task. - } - } - cancellationToken.ThrowIfCancellationRequested(); - return this.GetAst(); - } - - public PythonAst GetAnyAst() => GetAstNode(this); - - /// - /// Provides collection of parsing errors, if any. - /// - public IEnumerable GetParseErrors() => _parseErrors.ToArray(); - - private void Parse() { - _parseCts?.Cancel(); - _parseCts = new CancellationTokenSource(); - - _linkedParseCts?.Dispose(); - _linkedParseCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeToken.CancellationToken, _parseCts.Token); - - ContentState = State.Parsing; - _parsingTask = Task.Run(() => Parse(_linkedParseCts.Token), _linkedParseCts.Token); - } - - private void Parse(CancellationToken cancellationToken) { - CollectingErrorSink sink = null; - int version; - Parser parser; - - //Log?.Log(TraceEventType.Verbose, $"Parse begins: {Name}"); - - lock (AnalysisLock) { - version = _buffer.Version; - var options = new ParserOptions { - StubFile = FilePath != null && Path.GetExtension(FilePath).Equals(".pyi", FileSystem.StringComparison) - }; - if (ModuleType == ModuleType.User) { - sink = new CollectingErrorSink(); - options.ErrorSink = sink; - } - parser = Parser.CreateParser(new StringReader(_buffer.Text), Interpreter.LanguageVersion, options); - } - - var ast = parser.ParseFile(Uri); - - //Log?.Log(TraceEventType.Verbose, $"Parse complete: {Name}"); - - lock (AnalysisLock) { - cancellationToken.ThrowIfCancellationRequested(); - if (version != _buffer.Version) { - throw new OperationCanceledException(); - } - - // Stored nodes are no longer valid. - _astMap.Clear(); - _astMap[this] = ast; - - _parseErrors = sink?.Diagnostics ?? Array.Empty(); - - // Do not report issues with libraries or stubs - if (sink != null) { - _diagnosticsService?.Replace(Uri, _parseErrors, DiagnosticSource.Parser); - } - - ContentState = State.Parsed; - Analysis = new EmptyAnalysis(Services, this); - } - - NewAst?.Invoke(this, EventArgs.Empty); - - if (ContentState < State.Analyzing) { - ContentState = State.Analyzing; - - var analyzer = Services.GetService(); - analyzer.EnqueueDocumentForAnalysis(this, version); - } - - lock (AnalysisLock) { - _parsingTask = null; - } - } - - private class CollectingErrorSink : ErrorSink { - private readonly List _diagnostics = new List(); - - public IReadOnlyList Diagnostics => _diagnostics; - public override void Add(string message, SourceSpan span, int errorCode, Severity severity) - => _diagnostics.Add(new DiagnosticsEntry(message, span, $"parser-{errorCode}", severity, DiagnosticSource.Parser)); - } - #endregion - - #region IAstNodeContainer - public T GetAstNode(object o) where T : Node { - lock (AnalysisLock) { - return _astMap.TryGetValue(o, out var n) ? (T)n : null; - } - } - - public void AddAstNode(object o, Node n) { - lock (AnalysisLock) { - Debug.Assert(!_astMap.ContainsKey(o) || _astMap[o] == n); - _astMap[o] = n; - } - } - - public void ClearAst() { - lock (AnalysisLock) { - if (ModuleType != ModuleType.User) { - _astMap.Clear(); - } - } - } - public void ClearContent() { - lock (AnalysisLock) { - if (ModuleType != ModuleType.User) { - _buffer.Reset(_buffer.Version, string.Empty); - } - } - } - #endregion - - private PythonAst RecreateAst() { - lock (AnalysisLock) { - ContentState = State.None; - LoadContent(); - var parser = Parser.CreateParser(new StringReader(_buffer.Text), Interpreter.LanguageVersion, ParserOptions.Default); - var ast = parser.ParseFile(Uri); - ContentState = State.Parsed; - return ast; - } - } - } -} diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.Content.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.Content.cs deleted file mode 100644 index 911f604f8..000000000 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.Content.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading; -using Microsoft.Python.Analysis.Analyzer; -using Microsoft.Python.Analysis.Documents; -using Microsoft.Python.Core.IO; - -namespace Microsoft.Python.Analysis.Modules { - internal partial class PythonModule { - public void Update(IEnumerable changes) { - lock (AnalysisLock) { - _parseCts?.Cancel(); - _parseCts = new CancellationTokenSource(); - - _linkedParseCts?.Dispose(); - _linkedParseCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeToken.CancellationToken, _parseCts.Token); - - _buffer.Update(changes); - _updated = true; - - Parse(); - } - - Services.GetService().InvalidateAnalysis(this); - } - - public void Reset(string content) { - lock (AnalysisLock) { - if (content != Content) { - ContentState = State.None; - InitializeContent(content, _buffer.Version + 1); - } - } - - Services.GetService().InvalidateAnalysis(this); - } - - protected virtual string LoadContent() { - if (ContentState < State.Loading) { - ContentState = State.Loading; - try { - var code = FileSystem.ReadTextWithRetry(FilePath); - ContentState = State.Loaded; - return code; - } catch (IOException) { } catch (UnauthorizedAccessException) { } - } - return null; // Keep content as null so module can be loaded later. - } - - private void InitializeContent(string content, int version) { - lock (AnalysisLock) { - LoadContent(content, version); - - var startParse = ContentState < State.Parsing && (_parsingTask == null || version > 0); - if (startParse) { - Parse(); - } - } - } - - private void LoadContent(string content, int version) { - if (ContentState < State.Loading) { - try { - content = content ?? LoadContent(); - _buffer.Reset(version, content); - ContentState = State.Loaded; - } catch (IOException) { } catch (UnauthorizedAccessException) { } - } - } - } -} diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.Documentation.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.Documentation.cs deleted file mode 100644 index 121fd1320..000000000 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.Documentation.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System; -using System.IO; -using System.Linq; -using System.Text; -using Microsoft.Python.Core; - -namespace Microsoft.Python.Analysis.Modules { - /// - /// Primary base for all modules and user documents. Provides access - /// to AST and the module analysis. - /// - internal partial class PythonModule { - private string TryGetDocFromModuleInitFile() { - if (string.IsNullOrEmpty(FilePath) || !FileSystem.FileExists(FilePath)) { - return string.Empty; - } - - try { - using (var sr = new StreamReader(FilePath)) { - string quote = null; - string line; - while (true) { - line = sr.ReadLine()?.Trim(); - if (line == null) { - break; - } - if (line.Length == 0 || line.StartsWithOrdinal("#")) { - continue; - } - if (line.StartsWithOrdinal("\"\"\"") || line.StartsWithOrdinal("r\"\"\"")) { - quote = "\"\"\""; - } else if (line.StartsWithOrdinal("'''") || line.StartsWithOrdinal("r'''")) { - quote = "'''"; - } - break; - } - - if (line != null && quote != null) { - // Check if it is a single-liner, but do distinguish from """ - // Also, handle quadruple+ quotes. - line = line.Trim(); - line = line.All(c => c == quote[0]) ? quote : line; - if (line.EndsWithOrdinal(quote) && line.IndexOf(quote, StringComparison.Ordinal) < line.LastIndexOf(quote, StringComparison.Ordinal)) { - return line.Substring(quote.Length, line.Length - 2 * quote.Length).Trim(); - } - var sb = new StringBuilder(); - while (true) { - line = sr.ReadLine(); - if (line == null || line.EndsWithOrdinal(quote)) { - break; - } - sb.AppendLine(line); - } - return sb.ToString(); - } - } - } catch (IOException) { } catch (UnauthorizedAccessException) { } - return string.Empty; - } - } -} diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.cs index 47db6d93e..8bac52f07 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.cs @@ -16,7 +16,9 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.IO; using System.Linq; +using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis.Analyzer; @@ -30,6 +32,8 @@ using Microsoft.Python.Core.Disposables; using Microsoft.Python.Core.IO; using Microsoft.Python.Core.Logging; +using Microsoft.Python.Core.Text; +using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Modules { @@ -38,7 +42,7 @@ namespace Microsoft.Python.Analysis.Modules { /// to AST and the module analysis. /// [DebuggerDisplay("{Name} : {ModuleType}")] - internal partial class PythonModule : LocatedMember, IDocument, IAnalyzable, IEquatable, IAstNodeContainer { + internal class PythonModule : LocatedMember, IDocument, IAnalyzable, IEquatable, IAstNodeContainer { private enum State { None, Loading, @@ -51,6 +55,7 @@ private enum State { private readonly DocumentBuffer _buffer = new DocumentBuffer(); private readonly DisposeToken _disposeToken = DisposeToken.Create(); + private readonly object _syncObj = new object(); private IReadOnlyList _parseErrors = Array.Empty(); private readonly Dictionary _astMap = new Dictionary(); private readonly IDiagnosticsService _diagnosticsService; @@ -64,7 +69,6 @@ private enum State { protected ILogger Log { get; } protected IFileSystem FileSystem { get; } protected IServiceContainer Services { get; } - private object AnalysisLock { get; } = new object(); private State ContentState { get; set; } = State.None; protected PythonModule(string name, ModuleType moduleType, IServiceContainer services) : base(null) { @@ -75,7 +79,6 @@ protected PythonModule(string name, ModuleType moduleType, IServiceContainer ser Log = services.GetService(); Interpreter = services.GetService(); Analysis = new EmptyAnalysis(services, this); - GlobalScope = Analysis.GlobalScope; _diagnosticsService = services.GetService(); SetDeclaringModule(this); @@ -115,7 +118,6 @@ internal PythonModule(ModuleCreationOptions creationOptions, IServiceContainer s #region IPythonType public string Name { get; } public string QualifiedName => Name; - public BuiltinTypeId TypeId => BuiltinTypeId.Module; public bool IsBuiltin => true; public bool IsAbstract => false; @@ -148,10 +150,10 @@ public virtual string Documentation { #endregion #region IMemberContainer - public virtual IMember GetMember(string name) => GlobalScope.Variables[name]?.Value; + public virtual IMember GetMember(string name) => Analysis.GlobalScope.Variables[name]?.Value; public virtual IEnumerable GetMemberNames() { // drop imported modules and typing. - return GlobalScope.Variables + return Analysis.GlobalScope.Variables .Where(v => { // Instances are always fine. if (v.Value is IPythonInstance) { @@ -172,9 +174,10 @@ public virtual IEnumerable GetMemberNames() { public override LocationInfo Definition => new LocationInfo(Uri.ToAbsolutePath(), Uri, 0, 0); #endregion - #region IPythonModule public virtual string FilePath { get; protected set; } public virtual Uri Uri { get; } + + #region IPythonModule public IDocumentAnalysis Analysis { get; private set; } public IPythonInterpreter Interpreter { get; } @@ -188,7 +191,7 @@ public virtual IEnumerable GetMemberNames() { /// /// Global cope of the module. /// - public virtual IGlobalScope GlobalScope { get; protected set; } + public IGlobalScope GlobalScope { get; protected set; } /// /// If module is a stub points to the primary module. @@ -196,7 +199,6 @@ public virtual IEnumerable GetMemberNames() { /// wants to see library code and not a stub. /// public IPythonModule PrimaryModule { get; private set; } - #endregion #region IDisposable @@ -232,11 +234,340 @@ protected virtual void Dispose(bool disposing) { /// /// Returns module content (code). /// - public string Content => _buffer.Text; + public string Content { + get { + lock (_syncObj) { + return _buffer.Text; + } + } + } + + #endregion + + #region Parsing + /// + /// Returns document parse tree. + /// + public async Task GetAstAsync(CancellationToken cancellationToken = default) { + Task t = null; + while (true) { + lock (_syncObj) { + if (t == _parsingTask) { + break; + } + cancellationToken.ThrowIfCancellationRequested(); + t = _parsingTask; + } + try { + await (t ?? Task.CompletedTask); + break; + } catch (OperationCanceledException) { + // Parsing as canceled, try next task. + } + } + cancellationToken.ThrowIfCancellationRequested(); + return this.GetAst(); + } + + /// + /// Provides collection of parsing errors, if any. + /// + public IEnumerable GetParseErrors() => _parseErrors.ToArray(); + + public void Update(IEnumerable changes) { + lock (_syncObj) { + _parseCts?.Cancel(); + _parseCts = new CancellationTokenSource(); + + _linkedParseCts?.Dispose(); + _linkedParseCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeToken.CancellationToken, _parseCts.Token); + + _buffer.Update(changes); + _updated = true; + + Parse(); + } + + Services.GetService().InvalidateAnalysis(this); + } + + public void Reset(string content) { + lock (_syncObj) { + if (content != Content) { + ContentState = State.None; + InitializeContent(content, _buffer.Version + 1); + } + } + + Services.GetService().InvalidateAnalysis(this); + } + + private void Parse() { + _parseCts?.Cancel(); + _parseCts = new CancellationTokenSource(); + + _linkedParseCts?.Dispose(); + _linkedParseCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeToken.CancellationToken, _parseCts.Token); + + ContentState = State.Parsing; + _parsingTask = Task.Run(() => Parse(_linkedParseCts.Token), _linkedParseCts.Token); + } + + private void Parse(CancellationToken cancellationToken) { + CollectingErrorSink sink = null; + int version; + Parser parser; + + //Log?.Log(TraceEventType.Verbose, $"Parse begins: {Name}"); + + lock (_syncObj) { + version = _buffer.Version; + var options = new ParserOptions { + StubFile = FilePath != null && Path.GetExtension(FilePath).Equals(".pyi", FileSystem.StringComparison) + }; + if (ModuleType == ModuleType.User) { + sink = new CollectingErrorSink(); + options.ErrorSink = sink; + } + parser = Parser.CreateParser(new StringReader(_buffer.Text), Interpreter.LanguageVersion, options); + } + + var ast = parser.ParseFile(Uri); + + //Log?.Log(TraceEventType.Verbose, $"Parse complete: {Name}"); + + lock (_syncObj) { + cancellationToken.ThrowIfCancellationRequested(); + if (version != _buffer.Version) { + throw new OperationCanceledException(); + } + + // Stored nodes are no longer valid. + _astMap.Clear(); + _astMap[this] = ast; + + _parseErrors = sink?.Diagnostics ?? Array.Empty(); + + // Do not report issues with libraries or stubs + if (sink != null) { + _diagnosticsService?.Replace(Uri, _parseErrors, DiagnosticSource.Parser); + } + + ContentState = State.Parsed; + Analysis = new EmptyAnalysis(Services, this); + } + + NewAst?.Invoke(this, EventArgs.Empty); + + if (ContentState < State.Analyzing) { + ContentState = State.Analyzing; + + var analyzer = Services.GetService(); + analyzer.EnqueueDocumentForAnalysis(this, ast, version); + } + + lock (_syncObj) { + _parsingTask = null; + } + } + + private class CollectingErrorSink : ErrorSink { + private readonly List _diagnostics = new List(); + + public IReadOnlyList Diagnostics => _diagnostics; + public override void Add(string message, SourceSpan span, int errorCode, Severity severity) + => _diagnostics.Add(new DiagnosticsEntry(message, span, $"parser-{errorCode}", severity, DiagnosticSource.Parser)); + } + #endregion + + #region IAnalyzable + + public void NotifyAnalysisBegins() { + lock (_syncObj) { + if (_updated) { + _updated = false; + // In all variables find those imported, then traverse imported modules + // and remove references to this module. If variable refers to a module, + // recurse into module but only process global scope. + + if (GlobalScope == null) { + return; + } + + // TODO: Figure out where the nulls below are coming from. + var importedVariables = ((IScope)GlobalScope) + .TraverseDepthFirst(c => c?.Children ?? Enumerable.Empty()) + .SelectMany(s => s?.Variables ?? VariableCollection.Empty) + .Where(v => v?.Source == VariableSource.Import); + + foreach (var v in importedVariables) { + v.RemoveReferences(this); + if (v.Value is IPythonModule module) { + RemoveReferencesInModule(module); + } + } + } + } + } + + public void NotifyAnalysisComplete(IDocumentAnalysis analysis) { + lock (_syncObj) { + if (analysis.Version < Analysis.Version) { + return; + } + + Analysis = analysis; + GlobalScope = analysis.GlobalScope; + + // Derived classes can override OnAnalysisComplete if they want + // to perform additional actions on the completed analysis such + // as declare additional variables, etc. + OnAnalysisComplete(); + ContentState = State.Analyzed; + + if (ModuleType != ModuleType.User) { + _buffer.Reset(_buffer.Version, string.Empty); + } + } + + // Do not report issues with libraries or stubs + if (ModuleType == ModuleType.User) { + _diagnosticsService?.Replace(Uri, analysis.Diagnostics, DiagnosticSource.Analysis); + } + + NewAnalysis?.Invoke(this, EventArgs.Empty); + } + + protected virtual void OnAnalysisComplete() { } #endregion #region IEquatable public bool Equals(IPythonModule other) => Name.Equals(other?.Name) && FilePath.Equals(other?.FilePath); #endregion + + #region IAstNodeContainer + public Node GetAstNode(object o) { + lock (_syncObj) { + return _astMap.TryGetValue(o, out var n) ? n : null; + } + } + + public void AddAstNode(object o, Node n) { + lock (_syncObj) { + Debug.Assert(!_astMap.ContainsKey(o) || _astMap[o] == n); + _astMap[o] = n; + } + } + + public void ClearContent() { + lock (_syncObj) { + if (ModuleType != ModuleType.User) { + _buffer.Reset(_buffer.Version, string.Empty); + _astMap.Clear(); + } + } + } + #endregion + + #region Analysis + public IDocumentAnalysis GetAnyAnalysis() => Analysis; + + public Task GetAnalysisAsync(int waitTime = 200, CancellationToken cancellationToken = default) + => Services.GetService().GetAnalysisAsync(this, waitTime, cancellationToken); + + #endregion + + #region Content management + protected virtual string LoadContent() { + if (ContentState < State.Loading) { + ContentState = State.Loading; + try { + var code = FileSystem.ReadTextWithRetry(FilePath); + ContentState = State.Loaded; + return code; + } catch (IOException) { } catch (UnauthorizedAccessException) { } + } + return null; // Keep content as null so module can be loaded later. + } + + private void InitializeContent(string content, int version) { + lock (_syncObj) { + LoadContent(content, version); + + var startParse = ContentState < State.Parsing && (_parsingTask == null || version > 0); + if (startParse) { + Parse(); + } + } + } + + private void LoadContent(string content, int version) { + if (ContentState < State.Loading) { + try { + content = content ?? LoadContent(); + _buffer.Reset(version, content); + ContentState = State.Loaded; + } catch (IOException) { } catch (UnauthorizedAccessException) { } + } + } + #endregion + + #region Documentation + private string TryGetDocFromModuleInitFile() { + if (string.IsNullOrEmpty(FilePath) || !FileSystem.FileExists(FilePath)) { + return string.Empty; + } + + try { + using (var sr = new StreamReader(FilePath)) { + string quote = null; + string line; + while (true) { + line = sr.ReadLine()?.Trim(); + if (line == null) { + break; + } + if (line.Length == 0 || line.StartsWithOrdinal("#")) { + continue; + } + if (line.StartsWithOrdinal("\"\"\"") || line.StartsWithOrdinal("r\"\"\"")) { + quote = "\"\"\""; + } else if (line.StartsWithOrdinal("'''") || line.StartsWithOrdinal("r'''")) { + quote = "'''"; + } + break; + } + + if (line != null && quote != null) { + // Check if it is a single-liner, but do distinguish from """ + // Also, handle quadruple+ quotes. + line = line.Trim(); + line = line.All(c => c == quote[0]) ? quote : line; + if (line.EndsWithOrdinal(quote) && line.IndexOf(quote, StringComparison.Ordinal) < line.LastIndexOf(quote, StringComparison.Ordinal)) { + return line.Substring(quote.Length, line.Length - 2 * quote.Length).Trim(); + } + var sb = new StringBuilder(); + while (true) { + line = sr.ReadLine(); + if (line == null || line.EndsWithOrdinal(quote)) { + break; + } + sb.AppendLine(line); + } + return sb.ToString(); + } + } + } catch (IOException) { } catch (UnauthorizedAccessException) { } + return string.Empty; + } + #endregion + + private void RemoveReferencesInModule(IPythonModule module) { + if (module.GlobalScope?.Variables != null) { + foreach (var v in module.GlobalScope.Variables) { + v.RemoveReferences(this); + } + } + } } } diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs index c9eb9c936..9da8870d8 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs @@ -37,7 +37,6 @@ namespace Microsoft.Python.Analysis.Modules.Resolution { internal sealed class MainModuleResolution : ModuleResolutionBase, IModuleManagement { private readonly ConcurrentDictionary _specialized = new ConcurrentDictionary(); private IRunningDocumentTable _rdt; - private IReadOnlyList _searchPaths; public MainModuleResolution(string root, IServiceContainer services) : base(root, services) { } @@ -62,29 +61,6 @@ internal async Task InitializeAsync(CancellationToken cancellationToken = defaul cancellationToken.ThrowIfCancellationRequested(); } - public async Task> GetSearchPathsAsync(CancellationToken cancellationToken = default) { - if (_searchPaths != null) { - return _searchPaths; - } - - _searchPaths = await GetInterpreterSearchPathsAsync(cancellationToken); - Debug.Assert(_searchPaths != null, "Should have search paths"); - _searchPaths = _searchPaths ?? Array.Empty(); - - _log?.Log(TraceEventType.Verbose, "Python search paths:"); - foreach (var s in _searchPaths) { - _log?.Log(TraceEventType.Verbose, $" {s}"); - } - - var configurationSearchPaths = Configuration.SearchPaths ?? Array.Empty(); - - _log?.Log(TraceEventType.Verbose, "Configuration search paths:"); - foreach (var s in configurationSearchPaths) { - _log?.Log(TraceEventType.Verbose, $" {s}"); - } - return _searchPaths; - } - protected override IPythonModule CreateModule(string name) { var moduleImport = CurrentPathResolver.GetModuleImportFromModuleName(name); if (moduleImport == null) { @@ -140,11 +116,11 @@ protected override IPythonModule CreateModule(string name) { return GetRdt().AddModule(mco); } - private async Task> GetInterpreterSearchPathsAsync(CancellationToken cancellationToken = default) { + private async Task> GetInterpreterSearchPathsAsync(CancellationToken cancellationToken = default) { if (!_fs.FileExists(Configuration.InterpreterPath)) { _log?.Log(TraceEventType.Warning, "Interpreter does not exist:", Configuration.InterpreterPath); _ui?.ShowMessageAsync(Resources.InterpreterNotFound, TraceEventType.Error); - return Array.Empty(); + return Array.Empty(); } _log?.Log(TraceEventType.Information, "GetCurrentSearchPaths", Configuration.InterpreterPath); @@ -153,11 +129,11 @@ private async Task> GetInterpreterSearchPathsAsync(Cancell var ps = _services.GetService(); var paths = await PythonLibraryPath.GetSearchPathsAsync(Configuration, fs, ps, cancellationToken); cancellationToken.ThrowIfCancellationRequested(); - return paths.MaybeEnumerate().Select(p => p.Path).ToArray(); + return paths.ToArray(); } catch (InvalidOperationException ex) { _log?.Log(TraceEventType.Warning, "Exception getting search paths", ex); _ui?.ShowMessageAsync(Resources.ExceptionGettingSearchPaths, TraceEventType.Error); - return Array.Empty(); + return Array.Empty(); } } @@ -216,16 +192,13 @@ public async Task ReloadAsync(CancellationToken cancellationToken = default) { var addedRoots = new HashSet(); addedRoots.UnionWith(PathResolver.SetRoot(Root)); - InterpreterPaths = await GetSearchPathsAsync(cancellationToken); + var ps = _services.GetService(); - IEnumerable userSearchPaths = Configuration.SearchPaths; - InterpreterPaths = InterpreterPaths.Except(userSearchPaths, StringExtensions.PathsStringComparer).Where(p => !p.PathEquals(Root)); + var paths = await GetInterpreterSearchPathsAsync(cancellationToken); + var (interpreterPaths, userPaths) = PythonLibraryPath.ClassifyPaths(Root, _fs, paths, Configuration.SearchPaths); - if (Root != null) { - var underRoot = userSearchPaths.ToLookup(p => _fs.IsPathUnderRoot(Root, p)); - userSearchPaths = underRoot[true]; - InterpreterPaths = underRoot[false].Concat(InterpreterPaths); - } + InterpreterPaths = interpreterPaths.Select(p => p.Path); + var userSearchPaths = userPaths.Select(p => p.Path); _log?.Log(TraceEventType.Information, "Interpreter search paths:"); foreach (var s in InterpreterPaths) { diff --git a/src/Analysis/Ast/Impl/Resources.Designer.cs b/src/Analysis/Ast/Impl/Resources.Designer.cs index 785cbf9a8..1b1a34bad 100644 --- a/src/Analysis/Ast/Impl/Resources.Designer.cs +++ b/src/Analysis/Ast/Impl/Resources.Designer.cs @@ -222,6 +222,33 @@ internal static string ExceptionGettingSearchPaths { } } + /// + /// Looks up a localized string similar to Arguments to Generic must all be type parameters.. + /// + internal static string GenericNotAllTypeParameters { + get { + return ResourceManager.GetString("GenericNotAllTypeParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Arguments to Generic must all be unique.. + /// + internal static string GenericNotAllUnique { + get { + return ResourceManager.GetString("GenericNotAllUnique", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Inheriting '{0}', which is not a class.. + /// + internal static string InheritNonClass { + get { + return ResourceManager.GetString("InheritNonClass", resourceCulture); + } + } + /// /// Looks up a localized string similar to Interpreter does not exist; analysis will not be available.. /// @@ -231,6 +258,15 @@ internal static string InterpreterNotFound { } } + /// + /// Looks up a localized string similar to The first argument to NewType must be a string, but it is of type '{0}'.. + /// + internal static string NewTypeFirstArgNotString { + get { + return ResourceManager.GetString("NewTypeFirstArgNotString", resourceCulture); + } + } + /// /// Looks up a localized string similar to property of type {0}. /// @@ -249,6 +285,15 @@ internal static string PropertyOfUnknownType { } } + /// + /// Looks up a localized string similar to Explicit return in __init__ . + /// + internal static string ReturnInInit { + get { + return ResourceManager.GetString("ReturnInInit", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unable to determine analysis cache path. Using default '{0}'.. /// @@ -275,5 +320,14 @@ internal static string UndefinedVariable { return ResourceManager.GetString("UndefinedVariable", resourceCulture); } } + + /// + /// Looks up a localized string similar to Unsupported operand types for '{0}': '{1}' and '{2}'. + /// + internal static string UnsupporedOperandType { + get { + return ResourceManager.GetString("UnsupporedOperandType", resourceCulture); + } + } } } diff --git a/src/Analysis/Ast/Impl/Resources.resx b/src/Analysis/Ast/Impl/Resources.resx index 95cd89002..9fe003e70 100644 --- a/src/Analysis/Ast/Impl/Resources.resx +++ b/src/Analysis/Ast/Impl/Resources.resx @@ -189,4 +189,22 @@ Unable to determine analysis cache path. Exception: {0}. Using default '{1}'. + + The first argument to NewType must be a string, but it is of type '{0}'. + + + Unsupported operand types for '{0}': '{1}' and '{2}' + + + Explicit return in __init__ + + + Arguments to Generic must all be type parameters. + + + Arguments to Generic must all be unique. + + + Inheriting '{0}', which is not a class. + \ No newline at end of file diff --git a/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs b/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs index 54c905ed3..4ce6ee809 100644 --- a/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs +++ b/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs @@ -67,7 +67,7 @@ public static IMember Next(IPythonModule module, IPythonFunctionOverload overloa } public static IMember __iter__(IPythonInterpreter interpreter, BuiltinTypeId contentTypeId) { - var location = new Location(interpreter.ModuleResolution.BuiltinsModule, default); + var location = new Location(interpreter.ModuleResolution.BuiltinsModule); var fn = new PythonFunctionType(@"__iter__", location, null, string.Empty); var o = new PythonFunctionOverload(fn.Name, location); o.AddReturnValue(PythonTypeIterator.FromTypeId(interpreter, contentTypeId)); diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs b/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs index 8e280f25b..9977389eb 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs @@ -15,6 +15,7 @@ using System.Collections.Generic; using System.Linq; +using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Specializations.Typing.Types; using Microsoft.Python.Analysis.Types; @@ -43,7 +44,7 @@ public static IPythonModule Create(IServiceContainer services) { #endregion private void SpecializeMembers() { - var location = new Location(this, default); + var location = new Location(this); // TypeVar var fn = PythonFunctionType.Specialize("TypeVar", this, GetMemberDocumentation("TypeVar")); @@ -61,7 +62,7 @@ private void SpecializeMembers() { o = new PythonFunctionOverload(fn.Name, location); // When called, create generic parameter type. For documentation // use original TypeVar declaration so it appear as a tooltip. - o.SetReturnValueProvider((interpreter, overload, args) => CreateTypeAlias(args.Values())); + o.SetReturnValueProvider((interpreter, overload, args) => CreateTypeAlias(args)); fn.AddOverload(o); _members["NewType"] = fn; @@ -81,41 +82,41 @@ private void SpecializeMembers() { _members["Iterable"] = new GenericType("Iterable", typeArgs => CreateListType("Iterable", BuiltinTypeId.List, typeArgs, false), this); _members["Sequence"] = new GenericType("Sequence", typeArgs => CreateListType("Sequence", BuiltinTypeId.List, typeArgs, false), this); - _members["MutableSequence"] = new GenericType("MutableSequence", + _members["MutableSequence"] = new GenericType("MutableSequence", typeArgs => CreateListType("MutableSequence", BuiltinTypeId.List, typeArgs, true), this); - _members["List"] = new GenericType("List", + _members["List"] = new GenericType("List", typeArgs => CreateListType("List", BuiltinTypeId.List, typeArgs, true), this); - _members["MappingView"] = new GenericType("MappingView", + _members["MappingView"] = new GenericType("MappingView", typeArgs => CreateDictionary("MappingView", typeArgs, false), this); _members["KeysView"] = new GenericType("KeysView", CreateKeysViewType, this); _members["ValuesView"] = new GenericType("ValuesView", CreateValuesViewType, this); _members["ItemsView"] = new GenericType("ItemsView", CreateItemsViewType, this); - _members["Set"] = new GenericType("Set", + _members["Set"] = new GenericType("Set", typeArgs => CreateListType("Set", BuiltinTypeId.Set, typeArgs, true), this); - _members["MutableSet"] = new GenericType("MutableSet", + _members["MutableSet"] = new GenericType("MutableSet", typeArgs => CreateListType("MutableSet", BuiltinTypeId.Set, typeArgs, true), this); - _members["FrozenSet"] = new GenericType("FrozenSet", + _members["FrozenSet"] = new GenericType("FrozenSet", typeArgs => CreateListType("FrozenSet", BuiltinTypeId.Set, typeArgs, false), this); _members["Tuple"] = new GenericType("Tuple", CreateTupleType, this); - _members["Mapping"] = new GenericType("Mapping", + _members["Mapping"] = new GenericType("Mapping", typeArgs => CreateDictionary("Mapping", typeArgs, false), this); - _members["MutableMapping"] = new GenericType("MutableMapping", + _members["MutableMapping"] = new GenericType("MutableMapping", typeArgs => CreateDictionary("MutableMapping", typeArgs, true), this); - _members["Dict"] = new GenericType("Dict", + _members["Dict"] = new GenericType("Dict", typeArgs => CreateDictionary("Dict", typeArgs, true), this); - _members["OrderedDict"] = new GenericType("OrderedDict", + _members["OrderedDict"] = new GenericType("OrderedDict", typeArgs => CreateDictionary("OrderedDict", typeArgs, true), this); - _members["DefaultDict"] = new GenericType("DefaultDict", + _members["DefaultDict"] = new GenericType("DefaultDict", typeArgs => CreateDictionary("DefaultDict", typeArgs, true), this); _members["Union"] = new GenericType("Union", CreateUnion, this); - _members["Counter"] = Specialized.Function("Counter", this, GetMemberDocumentation("Counter"), + _members["Counter"] = Specialized.Function("Counter", this, GetMemberDocumentation("Counter"), new PythonInstance(Interpreter.GetBuiltinType(BuiltinTypeId.Int))); _members["SupportsInt"] = Interpreter.GetBuiltinType(BuiltinTypeId.Int); @@ -132,16 +133,7 @@ private void SpecializeMembers() { _members["Any"] = new AnyType(this); - // AnyStr - var str = Interpreter.GetBuiltinType(BuiltinTypeId.Str); - var bytes = Interpreter.GetBuiltinType(BuiltinTypeId.Bytes); - var unicode = Interpreter.GetBuiltinType(BuiltinTypeId.Unicode); - var anyStrName = new PythonConstant("AnyStr", str); - - var anyStrArgs = Interpreter.LanguageVersion.Is3x() - ? new IMember[] { anyStrName, str, bytes } - : new IMember[] { anyStrName, str, unicode }; - _members["AnyStr"] = GenericTypeParameter.FromTypeVar(new ArgumentSet(anyStrArgs), this); + _members["AnyStr"] = CreateAnyStr(); _members["Optional"] = new GenericType("Optional", CreateOptional, this); _members["Type"] = new GenericType("Type", CreateType, this); @@ -226,13 +218,25 @@ private IPythonType CreateItemsViewType(IReadOnlyList typeArgs) { return Interpreter.UnknownType; } - private IPythonType CreateTypeAlias(IReadOnlyList typeArgs) { + private IPythonType CreateTypeAlias(IArgumentSet args) { + var typeArgs = args.Values(); if (typeArgs.Count == 2) { var typeName = (typeArgs[0] as IPythonConstant)?.Value as string; if (!string.IsNullOrEmpty(typeName)) { return new TypeAlias(typeName, typeArgs[1].GetPythonType() ?? Interpreter.UnknownType); } - // TODO: report incorrect first argument to NewVar + + var firstArgType = (typeArgs[0] as PythonInstance)?.Type.Name; + var eval = args.Eval; + var expression = args.Expression; + + eval.ReportDiagnostics( + eval.Module?.Uri, + new DiagnosticsEntry(Resources.NewTypeFirstArgNotString.FormatInvariant(firstArgType), + expression?.GetLocation(eval)?.Span ?? default, + Diagnostics.ErrorCodes.TypingNewTypeArguments, + Severity.Error, DiagnosticSource.Analysis) + ); } // TODO: report wrong number of arguments return Interpreter.UnknownType; @@ -310,6 +314,21 @@ private IPythonType CreateType(IReadOnlyList typeArgs) { return Interpreter.UnknownType; } + private IPythonType CreateAnyStr() { + var str = Interpreter.GetBuiltinType(BuiltinTypeId.Str); + var bytes = Interpreter.GetBuiltinType(BuiltinTypeId.Bytes); + var unicode = Interpreter.GetBuiltinType(BuiltinTypeId.Unicode); + var name = "AnyStr"; + + var constraints = Interpreter.LanguageVersion.Is3x() + ? new IPythonType[] { str, bytes } + : new IPythonType[] { str, unicode }; + var docArgs = new[] { $"'{name}'" }.Concat(constraints.Select(c => c.Name)); + var documentation = CodeFormatter.FormatSequence("TypeVar", '(', docArgs); + + return new GenericTypeParameter(name, this, constraints, documentation, default); + } + private IPythonType CreateGenericClassParameter(IReadOnlyList typeArgs) { // Handle Generic[_T1, _T2, ...]. _T1, et al are IGenericTypeParameter from TypeVar. // Hold the parameter until concrete type is provided at the time of the class instantiation. @@ -325,7 +344,7 @@ private IPythonType CreateGenericClassParameter(IReadOnlyList typeA return Interpreter.UnknownType; } - private IPythonType ToGenericTemplate(string typeName, IGenericTypeDefinition[] typeArgs, BuiltinTypeId typeId) + private IPythonType ToGenericTemplate(string typeName, IGenericTypeDefinition[] typeArgs, BuiltinTypeId typeId) => _members[typeName] is GenericType gt ? new GenericType(CodeFormatter.FormatSequence(typeName, '[', typeArgs), gt.SpecificTypeConstructor, this, typeId, typeArgs) : Interpreter.UnknownType; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingIterator.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingIterator.cs index 16d172527..124c7c862 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingIterator.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingIterator.cs @@ -39,7 +39,7 @@ public override IMember Next { } else if (_index < _iteratorType.ItemTypes.Count) { itemType = _iteratorType.ItemTypes[_index++]; } - return itemType?.CreateInstance(itemType.Name, ArgumentSet.Empty) ?? UnknownType; + return itemType?.CreateInstance(itemType.Name, ArgumentSet.WithoutContext) ?? UnknownType; } } } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingTuple.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingTuple.cs index 93c9b52a2..52960406d 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingTuple.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Values/TypingTuple.cs @@ -33,6 +33,6 @@ public override IPythonIterator GetIterator() { } public override IMember Index(object index) - => _collectionType.Index(this, index).GetPythonType().CreateInstance(null, ArgumentSet.Empty); + => _collectionType.Index(this, index).GetPythonType().CreateInstance(null, ArgumentSet.WithoutContext); } } diff --git a/src/Analysis/Ast/Impl/Types/ArgumentSet.cs b/src/Analysis/Ast/Impl/Types/ArgumentSet.cs index e0acc25a7..5854abeda 100644 --- a/src/Analysis/Ast/Impl/Types/ArgumentSet.cs +++ b/src/Analysis/Ast/Impl/Types/ArgumentSet.cs @@ -17,8 +17,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.CompilerServices; using Microsoft.Python.Analysis.Analyzer; -using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; @@ -37,7 +37,7 @@ internal sealed class ArgumentSet : IArgumentSet { private readonly DictArg _dictArgument; private bool _evaluated; - public static IArgumentSet Empty = new ArgumentSet(); + public static IArgumentSet WithoutContext = new ArgumentSet(); /// Module that declares the function public IPythonModule DeclaringModule { get; } @@ -48,22 +48,39 @@ internal sealed class ArgumentSet : IArgumentSet { public int OverloadIndex { get; } public IExpressionEvaluator Eval { get; } + public Expression Expression { get; } private ArgumentSet() { } - public ArgumentSet(IReadOnlyList typeArgs) { - _arguments = typeArgs.Select(t => new Argument(t)).ToList(); - _evaluated = true; + /// + /// Creates an empty argument set with some context in how the argument set was used. + /// + /// Expression associated with argument set. + /// Evaluator for the expression involving the argument set. + /// + public static ArgumentSet Empty(Expression expr, IExpressionEvaluator eval) { + return new ArgumentSet(new List(), expr, eval); } + + /// + /// Creates a set of arguments for a call + /// + /// Use in the cases a corresponding function is unknown, but it is still convenient to have the context + /// of the expression which the arguments are needed for and the evaluator that is analyzing + /// that expression. + /// + /// + /// Arguments for the call. + /// Expression for the call. + /// Evaluator of the current analysis. + public ArgumentSet(IReadOnlyList args, Expression expr, IExpressionEvaluator eval) { + _arguments = args.Select(t => new Argument(t)).ToList(); + Expression = expr; + Eval = eval; - public ArgumentSet(IReadOnlyList memberArgs) { - _arguments = memberArgs.Select(t => new Argument(t)).ToList(); _evaluated = true; } - public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance instance, CallExpression callExpr, ExpressionEval eval) : - this(fn, overloadIndex, instance, callExpr, eval.Module, eval) { } - /// /// Creates set of arguments for a function call based on the call expression /// and the function signature. The result contains expressions @@ -74,12 +91,12 @@ public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance in /// Function overload to call. /// Type instance the function is bound to. For derived classes it is different from the declared type. /// Call expression that invokes the function. - /// Module that contains the call expression. /// Evaluator that can calculate values of arguments from their respective expressions. - public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance instance, CallExpression callExpr, IPythonModule module, IExpressionEvaluator eval) { + public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance instance, CallExpression callExpr, IExpressionEvaluator eval) { Eval = eval; OverloadIndex = overloadIndex; DeclaringModule = fn.DeclaringModule; + Expression = callExpr; if (callExpr == null) { // Typically invoked by specialization code without call expression in the code. @@ -107,7 +124,7 @@ public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance in return; } - var callLocation = callExpr.GetLocation(module); + var callLocation = callExpr.GetLocation(eval); // https://www.python.org/dev/peps/pep-3102/#id5 // For each formal parameter, there is a slot which will be used to contain @@ -158,7 +175,7 @@ public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance in if (formalParamIndex >= overload.Parameters.Count) { // We ran out of formal parameters and yet haven't seen // any sequence or dictionary ones. This looks like an error. - _errors.Add(new DiagnosticsEntry(Resources.Analysis_TooManyFunctionArguments, arg.GetLocation(module).Span, + _errors.Add(new DiagnosticsEntry(Resources.Analysis_TooManyFunctionArguments, arg.GetLocation(eval).Span, ErrorCodes.TooManyFunctionArguments, Severity.Warning, DiagnosticSource.Analysis)); return; } @@ -167,7 +184,7 @@ public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance in if (formalParam.Kind == ParameterKind.List) { if (string.IsNullOrEmpty(formalParam.Name)) { // If the next unfilled slot is a vararg slot, and it does not have a name, then it is an error. - _errors.Add(new DiagnosticsEntry(Resources.Analysis_TooManyPositionalArgumentBeforeStar, arg.GetLocation(module).Span, + _errors.Add(new DiagnosticsEntry(Resources.Analysis_TooManyPositionalArgumentBeforeStar, arg.GetLocation(eval).Span, ErrorCodes.TooManyPositionalArgumentsBeforeStar, Severity.Warning, DiagnosticSource.Analysis)); return; } @@ -175,7 +192,7 @@ public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance in // If the next unfilled slot is a vararg slot then all remaining // non-keyword arguments are placed into the vararg slot. if (_listArgument == null) { - _errors.Add(new DiagnosticsEntry(Resources.Analysis_TooManyFunctionArguments, arg.GetLocation(module).Span, + _errors.Add(new DiagnosticsEntry(Resources.Analysis_TooManyFunctionArguments, arg.GetLocation(eval).Span, ErrorCodes.TooManyFunctionArguments, Severity.Warning, DiagnosticSource.Analysis)); return; } @@ -195,7 +212,7 @@ public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance in if (formalParam.Kind == ParameterKind.Dictionary) { // Next slot is a dictionary slot, but we have positional arguments still. - _errors.Add(new DiagnosticsEntry(Resources.Analysis_TooManyPositionalArgumentBeforeStar, arg.GetLocation(module).Span, + _errors.Add(new DiagnosticsEntry(Resources.Analysis_TooManyPositionalArgumentBeforeStar, arg.GetLocation(eval).Span, ErrorCodes.TooManyPositionalArgumentsBeforeStar, Severity.Warning, DiagnosticSource.Analysis)); return; } @@ -209,7 +226,7 @@ public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance in var arg = callExpr.Args[callParamIndex]; if (string.IsNullOrEmpty(arg.Name)) { - _errors.Add(new DiagnosticsEntry(Resources.Analysis_PositionalArgumentAfterKeyword, arg.GetLocation(module).Span, + _errors.Add(new DiagnosticsEntry(Resources.Analysis_PositionalArgumentAfterKeyword, arg.GetLocation(eval).Span, ErrorCodes.PositionalArgumentAfterKeyword, Severity.Warning, DiagnosticSource.Analysis)); return; } @@ -221,13 +238,13 @@ public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance in // to the dictionary using the keyword name as the dictionary key, // unless there is already an entry with that key, in which case it is an error. if (_dictArgument == null) { - _errors.Add(new DiagnosticsEntry(Resources.Analysis_UnknownParameterName, arg.GetLocation(module).Span, + _errors.Add(new DiagnosticsEntry(Resources.Analysis_UnknownParameterName, arg.GetLocation(eval).Span, ErrorCodes.UnknownParameterName, Severity.Warning, DiagnosticSource.Analysis)); return; } if (_dictArgument.Arguments.ContainsKey(arg.Name)) { - _errors.Add(new DiagnosticsEntry(Resources.Analysis_ParameterAlreadySpecified.FormatUI(arg.Name), arg.GetLocation(module).Span, + _errors.Add(new DiagnosticsEntry(Resources.Analysis_ParameterAlreadySpecified.FormatUI(arg.Name), arg.GetLocation(eval).Span, ErrorCodes.ParameterAlreadySpecified, Severity.Warning, DiagnosticSource.Analysis)); return; } @@ -238,7 +255,7 @@ public ArgumentSet(IPythonFunctionType fn, int overloadIndex, IPythonInstance in if (nvp.ValueExpression != null || nvp.Value != null) { // Slot is already filled. - _errors.Add(new DiagnosticsEntry(Resources.Analysis_ParameterAlreadySpecified.FormatUI(arg.Name), arg.GetLocation(module).Span, + _errors.Add(new DiagnosticsEntry(Resources.Analysis_ParameterAlreadySpecified.FormatUI(arg.Name), arg.GetLocation(eval).Span, ErrorCodes.ParameterAlreadySpecified, Severity.Warning, DiagnosticSource.Analysis)); return; } diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IArgumentSet.cs b/src/Analysis/Ast/Impl/Types/Definitions/IArgumentSet.cs index bc1caa61b..4387b9efa 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IArgumentSet.cs +++ b/src/Analysis/Ast/Impl/Types/Definitions/IArgumentSet.cs @@ -138,8 +138,13 @@ public interface IArgumentSet { int OverloadIndex { get; } /// - /// Evaluator associated with the set. + /// Evaluator associated with the argument set. /// IExpressionEvaluator Eval { get; } + + /// + /// Expression associated with the argument set + /// + Expression Expression { get; } } } diff --git a/src/Analysis/Ast/Impl/Types/LocatedMember.cs b/src/Analysis/Ast/Impl/Types/LocatedMember.cs index d752e3f4f..36899d865 100644 --- a/src/Analysis/Ast/Impl/Types/LocatedMember.cs +++ b/src/Analysis/Ast/Impl/Types/LocatedMember.cs @@ -23,7 +23,7 @@ namespace Microsoft.Python.Analysis.Types { internal abstract class LocatedMember : ILocatedMember { private HashSet _references; - protected LocatedMember(IPythonModule module) : this(new Location(module, default)) { } + protected LocatedMember(IPythonModule module) : this(new Location(module)) { } protected LocatedMember(Location location) { Location = location; diff --git a/src/Analysis/Ast/Impl/Types/Location.cs b/src/Analysis/Ast/Impl/Types/Location.cs index fd2275707..2485d307d 100644 --- a/src/Analysis/Ast/Impl/Types/Location.cs +++ b/src/Analysis/Ast/Impl/Types/Location.cs @@ -17,7 +17,7 @@ using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Types { - public struct Location { + public readonly struct Location { public Location(IPythonModule module) : this(module, default) { } public Location(IPythonModule module, IndexSpan indexSpan) { diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.cs index b3e2de521..c8d72c3cd 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.cs @@ -17,6 +17,8 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types.Collections; @@ -191,6 +193,7 @@ internal void SetBases(IEnumerable bases) { } bases = bases != null ? bases.Where(b => !b.GetPythonType().IsUnknown()).ToArray() : Array.Empty(); + // For Python 3+ attach object as a base class by default except for the object class itself. if (DeclaringModule.Interpreter.LanguageVersion.Is3x() && DeclaringModule.ModuleType != ModuleType.Builtins) { var objectType = DeclaringModule.Interpreter.GetBuiltinType(BuiltinTypeId.Object); @@ -403,7 +406,7 @@ public IPythonType CreateSpecificType(IArgumentSet args) { .Where(p => !p.IsUnknown()) .ToArray(); if (st.Length > 0) { - var type = gt.CreateSpecificType(new ArgumentSet(st)); + var type = gt.CreateSpecificType(new ArgumentSet(st, args.Expression, args.Eval)); if (!type.IsUnknown()) { bases.Add(type); } diff --git a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs index 0e5f90a51..77187a780 100644 --- a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs +++ b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs @@ -167,7 +167,7 @@ private IMember CreateSpecificReturnFromClassType(IPythonClassType selfClassType } if (typeArgs != null) { - var specificReturnValue = returnClassType.CreateSpecificType(new ArgumentSet(typeArgs)); + var specificReturnValue = returnClassType.CreateSpecificType(new ArgumentSet(typeArgs, args?.Expression, args?.Eval)); return new PythonInstance(specificReturnValue); } diff --git a/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs b/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs index 865fdac58..a0f6079e2 100644 --- a/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs @@ -33,7 +33,7 @@ internal sealed class PythonFunctionType : PythonType, IPythonFunctionType { /// Creates function for specializations /// public static PythonFunctionType Specialize(string name, IPythonModule declaringModule, string documentation) - => new PythonFunctionType(name, new Location(declaringModule, default), documentation, true); + => new PythonFunctionType(name, new Location(declaringModule), documentation, true); private PythonFunctionType(string name, Location location, string documentation, bool isSpecialized = false) : base(name, location, documentation ?? string.Empty, BuiltinTypeId.Function) { diff --git a/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs b/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs index 0eba0d916..fdf4b7a66 100644 --- a/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs @@ -53,7 +53,7 @@ public string Description { public override IMember Call(IPythonInstance instance, string memberName, IArgumentSet args) => _getter.Call(args, instance?.GetPythonType() ?? DeclaringType); - public IMember ReturnType => _getter?.Call(ArgumentSet.Empty, DeclaringType); + public IMember ReturnType => _getter?.Call(ArgumentSet.WithoutContext, DeclaringType); #endregion internal void AddOverload(IPythonFunctionOverload overload) => _getter = _getter ?? overload; diff --git a/src/Analysis/Ast/Impl/Values/Collections/PythonDictionary.cs b/src/Analysis/Ast/Impl/Values/Collections/PythonDictionary.cs index 95cc1a0c9..4fe0697e9 100644 --- a/src/Analysis/Ast/Impl/Values/Collections/PythonDictionary.cs +++ b/src/Analysis/Ast/Impl/Values/Collections/PythonDictionary.cs @@ -62,7 +62,7 @@ public IReadOnlyList Items _contents.TryGetValue(key, out var value) ? value : UnknownType; public override IPythonIterator GetIterator() => - Call(@"iterkeys", ArgumentSet.Empty) as IPythonIterator ?? new EmptyIterator(Type.DeclaringModule.Interpreter.UnknownType); + Call(@"iterkeys", ArgumentSet.WithoutContext) as IPythonIterator ?? new EmptyIterator(Type.DeclaringModule.Interpreter.UnknownType); public override IMember Index(object key) => key is IMember m ? this[m] : UnknownType; diff --git a/src/Analysis/Ast/Impl/Values/Collections/PythonInstanceIterator.cs b/src/Analysis/Ast/Impl/Values/Collections/PythonInstanceIterator.cs index 53ec70cb4..ae3d16d7a 100644 --- a/src/Analysis/Ast/Impl/Values/Collections/PythonInstanceIterator.cs +++ b/src/Analysis/Ast/Impl/Values/Collections/PythonInstanceIterator.cs @@ -29,7 +29,7 @@ public PythonInstanceIterator(IMember instance, IPythonInterpreter interpreter) __next__ = instance.GetPythonType().GetMember(@"__next__") as IPythonFunctionType; } - public IMember Next => __next__?.Call(null, @"__next__", ArgumentSet.Empty) ?? UnknownType; + public IMember Next => __next__?.Call(null, @"__next__", ArgumentSet.WithoutContext) ?? UnknownType; public override IMember Call(string memberName, IArgumentSet args) { // Specializations diff --git a/src/Analysis/Ast/Impl/Values/GlobalScope.cs b/src/Analysis/Ast/Impl/Values/GlobalScope.cs index 699809d20..44f35bfd1 100644 --- a/src/Analysis/Ast/Impl/Values/GlobalScope.cs +++ b/src/Analysis/Ast/Impl/Values/GlobalScope.cs @@ -19,18 +19,21 @@ namespace Microsoft.Python.Analysis.Values { internal sealed class GlobalScope: Scope, IGlobalScope { - public GlobalScope(IPythonModule module): base(null, null, module) { + private readonly PythonAst _ast; + + public GlobalScope(IPythonModule module, PythonAst ast): base(null, null, module) { + _ast = ast; DeclareBuiltinVariables(); } - public override ScopeStatement Node => Module.GetAst(); + public override ScopeStatement Node => _ast; private void DeclareBuiltinVariables() { if (Module.ModuleType != ModuleType.User) { return; } - var location = new Location(Module, default); + var location = new Location(Module); var boolType = Module.Interpreter.GetBuiltinType(BuiltinTypeId.Bool); var strType = Module.Interpreter.GetBuiltinType(BuiltinTypeId.Str); diff --git a/src/Analysis/Ast/Impl/Values/PythonInstance.cs b/src/Analysis/Ast/Impl/Values/PythonInstance.cs index 2aed9f4cb..0da044063 100644 --- a/src/Analysis/Ast/Impl/Values/PythonInstance.cs +++ b/src/Analysis/Ast/Impl/Values/PythonInstance.cs @@ -56,7 +56,7 @@ public virtual IMember Call(string memberName, IArgumentSet args) { public virtual IPythonIterator GetIterator() { var iteratorFunc = Type.GetMember(@"__iter__") as IPythonFunctionType; var o = iteratorFunc?.Overloads.FirstOrDefault(); - var instance = o?.Call(ArgumentSet.Empty, Type); + var instance = o?.Call(ArgumentSet.WithoutContext, Type); if (instance != null) { return new PythonInstanceIterator(instance, Type.DeclaringModule.Interpreter); } diff --git a/src/Analysis/Ast/Impl/Values/Scope.cs b/src/Analysis/Ast/Impl/Values/Scope.cs index d517c4457..0ffeba6c5 100644 --- a/src/Analysis/Ast/Impl/Values/Scope.cs +++ b/src/Analysis/Ast/Impl/Values/Scope.cs @@ -42,7 +42,7 @@ public Scope(ScopeStatement node, IScope outerScope, IPythonModule module) { #region IScope public string Name => Node?.Name ?? ""; - public virtual ScopeStatement Node => Module.GetAstNode(this); + public virtual ScopeStatement Node => Module.GetAstNode(this) ?? Module.GetAst(); public IScope OuterScope { get; } public IPythonModule Module { get; } @@ -96,7 +96,7 @@ private void DeclareBuiltinVariables() { return; } - var location = new Location(Module, default); + var location = new Location(Module); var strType = Module.Interpreter.GetBuiltinType(BuiltinTypeId.Str); var objType = Module.Interpreter.GetBuiltinType(BuiltinTypeId.Object); @@ -126,9 +126,9 @@ public EmptyGlobalScope(IPythonModule module) { } public IPythonModule Module { get; } public string Name => string.Empty; - public ScopeStatement Node => null; + public ScopeStatement Node => Module.Analysis.Ast; public IScope OuterScope => null; - public IGlobalScope GlobalScope { get; protected set; } + public IGlobalScope GlobalScope { get; } public IReadOnlyList Children => Array.Empty(); public IEnumerable EnumerateTowardsGlobal => Enumerable.Repeat(this, 1); public IEnumerable EnumerateFromGlobal => Enumerable.Repeat(this, 1); diff --git a/src/Analysis/Ast/Impl/get_search_paths.py b/src/Analysis/Ast/Impl/get_search_paths.py index 290662f48..53cec1cf0 100644 --- a/src/Analysis/Ast/Impl/get_search_paths.py +++ b/src/Analysis/Ast/Impl/get_search_paths.py @@ -45,6 +45,11 @@ def clean(path): BEFORE_SITE = set(clean(p) for p in BEFORE_SITE) AFTER_SITE = set(clean(p) for p in AFTER_SITE) +try: + SITE_PKGS = set(clean(p) for p in site.getsitepackages()) +except AttributeError: + SITE_PKGS = set() + for prefix in [ sys.prefix, sys.exec_prefix, @@ -69,4 +74,7 @@ def clean(path): if p in BEFORE_SITE: print("%s|stdlib|" % p) elif p in AFTER_SITE: - print("%s||" % p) + if p in SITE_PKGS: + print("%s|site|" % p) + else: + print("%s|pth|" % p) diff --git a/src/Analysis/Ast/Test/ArgumentSetTests.cs b/src/Analysis/Ast/Test/ArgumentSetTests.cs index 2f4bee636..e0a3eb541 100644 --- a/src/Analysis/Ast/Test/ArgumentSetTests.cs +++ b/src/Analysis/Ast/Test/ArgumentSetTests.cs @@ -370,14 +370,14 @@ private async Task GetArgSetAsync(string code, string funcName = "f var analysis = await GetAnalysisAsync(code); var f = analysis.Should().HaveFunction(funcName).Which; var call = GetCall(analysis.Ast); - return new ArgumentSet(f, 0, null, call, analysis.Document, analysis.ExpressionEvaluator); + return new ArgumentSet(f, 0, null, call, analysis.ExpressionEvaluator); } private async Task GetUnboundArgSetAsync(string code, string funcName = "f") { var analysis = await GetAnalysisAsync(code); var f = analysis.Should().HaveVariable(funcName).Which; var call = GetCall(analysis.Ast); - return new ArgumentSet(f.Value.GetPythonType(), 0, null, call, analysis.Document, analysis.ExpressionEvaluator); + return new ArgumentSet(f.Value.GetPythonType(), 0, null, call, analysis.ExpressionEvaluator); } private async Task GetClassArgSetAsync(string code, string className = "A", string funcName = "f") { @@ -385,7 +385,7 @@ private async Task GetClassArgSetAsync(string code, string classNam var cls = analysis.Should().HaveClass(className).Which; var f = cls.Should().HaveMethod(funcName).Which; var call = GetCall(analysis.Ast); - return new ArgumentSet(f, 0, new PythonInstance(cls), call, analysis.Document, analysis.ExpressionEvaluator); + return new ArgumentSet(f, 0, new PythonInstance(cls), call, analysis.ExpressionEvaluator); } private CallExpression GetCall(PythonAst ast) { diff --git a/src/Analysis/Ast/Test/ClassesTests.cs b/src/Analysis/Ast/Test/ClassesTests.cs index 57400a6a1..19e6639d2 100644 --- a/src/Analysis/Ast/Test/ClassesTests.cs +++ b/src/Analysis/Ast/Test/ClassesTests.cs @@ -89,7 +89,7 @@ public async Task Mro() { var o = interpreter.GetBuiltinType(BuiltinTypeId.Object); var m = new SentinelModule("test", s); - var location = new Location(m, default); + var location = new Location(m); var O = new PythonClassType("O", location); var A = new PythonClassType("A", location); var B = new PythonClassType("B", location); diff --git a/src/Analysis/Ast/Test/DependencyResolverTests.cs b/src/Analysis/Ast/Test/DependencyResolverTests.cs index a9c476b66..8b5adae65 100644 --- a/src/Analysis/Ast/Test/DependencyResolverTests.cs +++ b/src/Analysis/Ast/Test/DependencyResolverTests.cs @@ -44,8 +44,8 @@ public void TestInitialize() [DataRow("A:C|C:B|B:A|D:AF|F:CE|E:BD", "ABCABCDEFDEF", "F")] [DataRow("A:BC|B:AC|C:BA|D:BC", "ACBACBD", "D")] [DataRow("A|B|C|D:AB|E:BC", "[ABC][DE]", "D|E")] - [DataRow("A:CE|B:A|C:B|D:BC|E|F:C", "[CE]ABCAB[DF]", "F")] - [DataRow("A:D|B:E|C:F|D:E|E:F|F:D", "DFEDFE[ABC]", "A")] + [DataRow("A:CE|B:A|C:B|D:BC|E|F:C", "[CE]ABCAB[DF]", "D|F")] + [DataRow("A:D|B:E|C:F|D:E|E:F|F:D", "DFEDFE[ABC]", "A|B|C")] // ReSharper restore StringLiteralTypo [DataTestMethod] public void ChangeValue(string input, string output, string root) { @@ -71,7 +71,8 @@ public void ChangeValue(string input, string output, string root) { foreach (var task in tasks) { result.Append(task.Result.Value[0]); - task.Result.Commit(); + task.Result.MarkWalked(); + task.Result.MoveNext(); } if (tasks.Count > 1) { @@ -87,7 +88,7 @@ public void ChangeValue(string input, string output, string root) { } [TestMethod] - public async Task ChangeValue_RepeatedChange() { + public async Task ChangeValue_ChangeToIdentical() { var resolver = new DependencyResolver(); resolver.ChangeValue("A", "A:B", true, "B"); resolver.ChangeValue("B", "B:C", false, "C"); @@ -98,7 +99,9 @@ public async Task ChangeValue_RepeatedChange() { while (walker.Remaining > 0) { var node = await walker.GetNextAsync(default); result.Append(node.Value[0]); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); } result.ToString().Should().Be("CBA"); @@ -110,14 +113,16 @@ public async Task ChangeValue_RepeatedChange() { while (walker.Remaining > 0) { var node = await walker.GetNextAsync(default); result.Append(node.Value[0]); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); } result.ToString().Should().Be("BA"); } [TestMethod] - public async Task ChangeValue_RepeatedChange2() { + public async Task ChangeValue_TwoChanges() { var resolver = new DependencyResolver(); resolver.ChangeValue("A", "A:B", true, "B"); resolver.ChangeValue("B", "B", true); @@ -129,7 +134,9 @@ public async Task ChangeValue_RepeatedChange2() { while (walker.Remaining > 0) { var node = await walker.GetNextAsync(default); result.Append(node.Value[0]); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); } result.ToString().Should().Be("BDAC"); @@ -142,7 +149,9 @@ public async Task ChangeValue_RepeatedChange2() { while (walker.Remaining > 0) { var node = await walker.GetNextAsync(default); result.Append(node.Value[0]); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); } result.ToString().Should().Be("DCBA"); @@ -159,12 +168,16 @@ public async Task ChangeValue_MissingKeys() { var result = new StringBuilder(); var node = await walker.GetNextAsync(default); result.Append(node.Value[0]); - node.Commit(); - + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + node = await walker.GetNextAsync(default); result.Append(node.Value[0]); - node.Commit(); - + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + walker.MissingKeys.Should().Equal("D"); result.ToString().Should().Be("BC"); @@ -189,10 +202,13 @@ public async Task ChangeValue_Add() { var node = await walker.GetNextAsync(default); node.Value.Should().Be("A:BD"); node.HasMissingDependencies.Should().BeTrue(); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); walker.Remaining.Should().Be(0); - + + // Add B resolver.ChangeValue("B", "B", false); walker = resolver.CreateWalker(); walker.MissingKeys.Should().Equal("D"); @@ -200,15 +216,20 @@ public async Task ChangeValue_Add() { node = await walker.GetNextAsync(default); node.Value.Should().Be("B"); node.HasMissingDependencies.Should().BeFalse(); - node.Commit(); - + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + node = await walker.GetNextAsync(default); node.Value.Should().Be("A:BD"); node.HasMissingDependencies.Should().BeTrue(); - node.Commit(); - + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + walker.Remaining.Should().Be(0); + // Add D resolver.ChangeValue("D", "D:C", false, "C"); walker = resolver.CreateWalker(); walker.MissingKeys.Should().BeEmpty(); @@ -216,18 +237,104 @@ public async Task ChangeValue_Add() { node = await walker.GetNextAsync(default); node.Value.Should().Be("C"); node.HasMissingDependencies.Should().BeFalse(); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); node = await walker.GetNextAsync(default); node.Value.Should().Be("D:C"); node.HasMissingDependencies.Should().BeFalse(); - node.Commit(); - + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + node = await walker.GetNextAsync(default); node.Value.Should().Be("A:BD"); node.HasMissingDependencies.Should().BeFalse(); - node.Commit(); - + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + + walker.Remaining.Should().Be(0); + } + + [TestMethod] + public async Task ChangeValue_Add_ParallelWalkers() { + var resolver = new DependencyResolver(); + resolver.ChangeValue("A", "A:BD", true, "B", "D"); + resolver.ChangeValue("B", "B:C", false, "C"); + resolver.ChangeValue("C", "C", false); + + var walker = resolver.CreateWalker(); + walker.MissingKeys.Should().Equal("D"); + + var node = await walker.GetNextAsync(default); + node.Value.Should().Be("C"); + node.HasMissingDependencies.Should().BeFalse(); + node.IsValidVersion.Should().BeTrue(); + + // Add D + resolver.ChangeValue("D", "D:C", false, "C"); + var newWalker = resolver.CreateWalker(); + newWalker.MissingKeys.Should().BeEmpty(); + + // MarkWalked node from old walker + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.IsValidVersion.Should().BeFalse(); + node.MarkWalked(); + node.MoveNext(); + + node = await walker.GetNextAsync(default); + node.Value.Should().Be("B:C"); + node.HasMissingDependencies.Should().BeFalse(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.IsValidVersion.Should().BeFalse(); + node.MarkWalked(); + node.MoveNext(); + + node = await walker.GetNextAsync(default); + node.Value.Should().Be("A:BD"); + node.HasMissingDependencies.Should().BeTrue(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.IsValidVersion.Should().BeFalse(); + node.MarkWalked(); + node.MoveNext(); + + walker.Remaining.Should().Be(0); + + // Walk new walker + node = await newWalker.GetNextAsync(default); + node.Value.Should().Be("C"); + node.HasMissingDependencies.Should().BeFalse(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.IsValidVersion.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + + node = await newWalker.GetNextAsync(default); + node.Value.Should().Be("B:C"); + node.HasMissingDependencies.Should().BeFalse(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.IsValidVersion.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + + node = await newWalker.GetNextAsync(default); + node.Value.Should().Be("D:C"); + node.HasMissingDependencies.Should().BeFalse(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.IsValidVersion.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + + node = await newWalker.GetNextAsync(default); + node.Value.Should().Be("A:BD"); + node.HasMissingDependencies.Should().BeFalse(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.IsValidVersion.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + walker.Remaining.Should().Be(0); } @@ -242,15 +349,21 @@ public async Task ChangeValue_Remove() { walker.MissingKeys.Should().BeEmpty(); var node = await walker.GetNextAsync(default); node.Value.Should().Be("C"); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); node = await walker.GetNextAsync(default); node.Value.Should().Be("B:C"); - node.Commit(); - + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + node = await walker.GetNextAsync(default); node.Value.Should().Be("A:BC"); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); resolver.Remove("B"); walker = resolver.CreateWalker(); @@ -258,7 +371,106 @@ public async Task ChangeValue_Remove() { node = await walker.GetNextAsync(default); node.Value.Should().Be("A:BC"); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + + walker.Remaining.Should().Be(0); + } + + [TestMethod] + public async Task ChangeValue_ChangeChangeRemove() { + var resolver = new DependencyResolver(); + resolver.ChangeValue("A", "A:B", true, "B"); + resolver.ChangeValue("B", "B:C", true, "C"); + resolver.ChangeValue("C", "C:AD", true, "A", "D"); + + var walker = resolver.CreateWalker(); + walker.MissingKeys.Should().Equal("D"); + walker.AffectedValues.Should().Equal("A:B", "B:C", "C:AD"); + walker.Remaining.Should().Be(6); + + //resolver.ChangeValue("D", "D:B", true, "B"); + resolver.ChangeValue("A", "A", true); + resolver.ChangeValue("B", "B", true); + resolver.Remove("B"); + + walker = resolver.CreateWalker(); + walker.MissingKeys.Should().Equal("D"); + walker.Remaining.Should().Be(2); + + var node = await walker.GetNextAsync(default); + node.Value.Should().Be("A"); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + + node = await walker.GetNextAsync(default); + node.Value.Should().Be("C:AD"); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + + walker.Remaining.Should().Be(0); + } + + [TestMethod] + public async Task ChangeValue_RemoveFromLoop() { + var resolver = new DependencyResolver(); + resolver.ChangeValue("A", "A:B", true, "B"); + resolver.ChangeValue("B", "B:C", false, "C"); + resolver.ChangeValue("C", "C:A", false, "A"); + + var walker = resolver.CreateWalker(); + walker.MissingKeys.Should().BeEmpty(); + + var node = await walker.GetNextAsync(default); + node.Value.Should().Be("A:B"); + node.HasOnlyWalkedDependencies.Should().BeFalse(); + node.MarkWalked(); + node.MoveNext(); + + node = await walker.GetNextAsync(default); + node.Value.Should().Be("C:A"); + node.HasOnlyWalkedDependencies.Should().BeFalse(); + node.MarkWalked(); + node.MoveNext(); + + node = await walker.GetNextAsync(default); + node.Value.Should().Be("B:C"); + node.HasOnlyWalkedDependencies.Should().BeFalse(); + node.MarkWalked(); + node.MoveNext(); + + node = await walker.GetNextAsync(default); + node.Value.Should().Be("A:B"); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + + node = await walker.GetNextAsync(default); + node.Value.Should().Be("C:A"); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + + node = await walker.GetNextAsync(default); + node.Value.Should().Be("B:C"); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + + walker.Remaining.Should().Be(0); + + resolver.Remove("B"); + walker = resolver.CreateWalker(); + walker.MissingKeys.Should().Equal("B"); + + node = await walker.GetNextAsync(default); + node.Value.Should().Be("A:B"); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); walker.Remaining.Should().Be(0); } @@ -275,19 +487,27 @@ public async Task ChangeValue_RemoveKeys() { walker.MissingKeys.Should().BeEmpty(); var node = await walker.GetNextAsync(default); node.Value.Should().Be("D"); - node.Commit(); - + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + node = await walker.GetNextAsync(default); node.Value.Should().Be("C:D"); - node.Commit(); - + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + node = await walker.GetNextAsync(default); node.Value.Should().Be("B:C"); - node.Commit(); - + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); + node = await walker.GetNextAsync(default); node.Value.Should().Be("A:BC"); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); resolver.RemoveKeys("B", "D"); walker = resolver.CreateWalker(); @@ -295,11 +515,15 @@ public async Task ChangeValue_RemoveKeys() { node = await walker.GetNextAsync(default); node.Value.Should().Be("C:D"); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); node = await walker.GetNextAsync(default); node.Value.Should().Be("A:BC"); - node.Commit(); + node.HasOnlyWalkedDependencies.Should().BeTrue(); + node.MarkWalked(); + node.MoveNext(); walker.Remaining.Should().Be(0); } @@ -316,11 +540,11 @@ public async Task ChangeValue_Skip() { var result = new StringBuilder(); var node = await walker.GetNextAsync(default); result.Append(node.Value[0]); - node.Skip(); + node.MoveNext(); node = await walker.GetNextAsync(default); result.Append(node.Value[0]); - node.Skip(); + node.MoveNext(); result.ToString().Should().Be("BD"); diff --git a/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionOverloadAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionOverloadAssertions.cs index 2744f69b3..6ab5b0f8e 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionOverloadAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionOverloadAssertions.cs @@ -31,7 +31,7 @@ public PythonFunctionOverloadAssertions(IPythonFunctionOverload pythonFunctionOv protected override string Identifier => nameof(IPythonFunctionOverload); public AndWhichConstraint HaveReturnType(string because = "", params object[] reasonArgs) { - var returnType = Subject.Call(ArgumentSet.Empty, null); + var returnType = Subject.Call(ArgumentSet.WithoutContext, null); Execute.Assertion.ForCondition(returnType != null) .BecauseOf(because, reasonArgs) .FailWith($"Expected {Subject.Name} overload to have a return type{{reason}}, but it has none."); @@ -40,7 +40,7 @@ public AndWhichConstraint HaveRet } public AndWhichConstraint HaveReturnType(BuiltinTypeId typeid, string because = "", params object[] reasonArgs) { - Subject.Call(ArgumentSet.Empty, null).GetPythonType().TypeId.Should().Be(typeid); + Subject.Call(ArgumentSet.WithoutContext, null).GetPythonType().TypeId.Should().Be(typeid); return new AndWhichConstraint(this, Subject); } @@ -106,7 +106,7 @@ public AndConstraint HaveNoParameters(string b => HaveParameters(Enumerable.Empty(), because, reasonArgs); public AndConstraint HaveReturnType(string type, string because = "", params object[] reasonArgs) { - var returnType = Subject.Call(ArgumentSet.Empty, null).GetPythonType(); + var returnType = Subject.Call(ArgumentSet.WithoutContext, null).GetPythonType(); Execute.Assertion.ForCondition(string.Equals(returnType.Name, type, StringComparison.Ordinal)) .BecauseOf(because, reasonArgs) .FailWith($"Expected {Subject.Name} to have return type [{type}]{{reason}}, but it has [{returnType}]."); diff --git a/src/Analysis/Ast/Test/InheritNonClassTests.cs b/src/Analysis/Ast/Test/InheritNonClassTests.cs new file mode 100644 index 000000000..8368f7f66 --- /dev/null +++ b/src/Analysis/Ast/Test/InheritNonClassTests.cs @@ -0,0 +1,173 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Analysis.Diagnostics; +using Microsoft.Python.Analysis.Tests.FluentAssertions; +using Microsoft.Python.Core; +using Microsoft.Python.Parsing.Tests; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Tests { + [TestClass] + public class InheritNonClassTests : AnalysisTestBase { + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + [TestMethod, Priority(0)] + public async Task InheritFromRenamedBuiltin() { + const string code = @" +tmp = str + +class C(tmp): + def method(self): + return 'test' +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().BeEmpty(); + } + + + [TestMethod, Priority(0)] + public async Task InheritFromBuiltin() { + const string code = @" +class C(str): + def method(self): + return 'test' +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().BeEmpty(); + } + + + [TestMethod, Priority(0)] + public async Task InheritFromUserClass() { + const string code = @" +class D: + def hello(self): + pass + +class C(D): + def method(self): + return 'test' +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().BeEmpty(); + } + + + [TestMethod, Priority(0)] + public async Task InheritFromConstant() { + const string code = @" +class C(5): + def method(self): + return 'test' +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + diagnostic.SourceSpan.Should().Be(2, 7, 2, 8); + diagnostic.Message.Should().Be(Resources.InheritNonClass.FormatInvariant("5")); + diagnostic.ErrorCode.Should().Be(ErrorCodes.InheritNonClass); + } + + + [TestMethod, Priority(0)] + public async Task InheritFromConstantVar() { + const string code = @" +x = 'str' + +class C(x): + def method(self): + return 'test' + +x = 5 + +class D(x): + def method(self): + return 'test' +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(2); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + diagnostic.SourceSpan.Should().Be(4, 7, 4, 8); + diagnostic.Message.Should().Be(Resources.InheritNonClass.FormatInvariant("str")); + diagnostic.ErrorCode.Should().Be(ErrorCodes.InheritNonClass); + + diagnostic = analysis.Diagnostics.ElementAt(1); + diagnostic.SourceSpan.Should().Be(10, 7, 10, 8); + diagnostic.Message.Should().Be(Resources.InheritNonClass.FormatInvariant("5")); + diagnostic.ErrorCode.Should().Be(ErrorCodes.InheritNonClass); + } + + [Ignore] + [TestMethod, Priority(0)] + public async Task InheritFromBinaryOp() { + const string code = @" +x = 5 + +class C(x + 2): + def method(self): + return 'test' +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + diagnostic.SourceSpan.Should().Be(4, 7, 4, 8); + diagnostic.Message.Should().Be(Resources.InheritNonClass.FormatInvariant("x + 2")); + diagnostic.ErrorCode.Should().Be(ErrorCodes.InheritNonClass); + } + + + [TestMethod, Priority(0)] + public async Task InheritFromOtherModule() { + const string code = @" +import typing + +class C(typing.TypeVar): + def method(self): + return 'test' +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().BeEmpty(); + } + + [TestMethod, Priority(0)] + public async Task InheritFromRenamedOtherModule() { + const string code = @" +import typing + +tmp = typing.TypeVar +class C(tmp): + def method(self): + return 'test' +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().BeEmpty(); + } + } +} diff --git a/src/Analysis/Ast/Test/LintGenericTests.cs b/src/Analysis/Ast/Test/LintGenericTests.cs new file mode 100644 index 000000000..e0ce8b18a --- /dev/null +++ b/src/Analysis/Ast/Test/LintGenericTests.cs @@ -0,0 +1,105 @@ +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Analysis.Tests.FluentAssertions; +using Microsoft.Python.Parsing.Tests; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + + +namespace Microsoft.Python.Analysis.Tests { + + [TestClass] + public class LintGenericTests : AnalysisTestBase { + + public const string GenericSetup = @" +from typing import Generic, TypeVar +T = TypeVar('T', int, str) +T1 = TypeVar('T1', int, str) + +_X = TypeVar('_X', str, int) +_T = _X +"; + + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + [DataRow("x = Generic[T, str]")] + [DataRow("x = Generic[T, T1, int]")] + [DataRow("x = Generic[T, str, int, T1]")] + [DataRow("x = Generic[str, int]")] + [DataRow("x = Generic[str]")] + [DataTestMethod, Priority(0)] + public async Task GenericNotAllTypeParameters(string decl) { + string code = GenericSetup + decl; + + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + var start = decl.IndexOf("Generic") + 1; + // adding 1 because SourceSpan.End is exclusive and another 1 because SourceSpan is 1-indexed + var end = decl.IndexOf("]", start) + 2; + + diagnostic.SourceSpan.Should().Be(8, start, 8, end); + diagnostic.ErrorCode.Should().Be(Diagnostics.ErrorCodes.TypingGenericArguments); + diagnostic.Message.Should().Be(Resources.GenericNotAllTypeParameters); + } + + [DataRow("x = Generic[_T, _X]")] + [DataRow("x = Generic[_T, T, T1, _X]")] + [DataRow("x = Generic[_T,_T, T]")] + [DataRow("x = Generic[T,T]")] + [DataTestMethod, Priority(0)] + public async Task GenericDuplicateArguments(string decl) { + string code = GenericSetup + decl; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + var start = decl.IndexOf("Generic") + 1; + // adding 1 because SourceSpan.End is exclusive and another 1 because SourceSpan is 1-indexed + var end = decl.IndexOf("]", start) + 2; + diagnostic.SourceSpan.Should().Be(8, start, 8, end); + + diagnostic.ErrorCode.Should().Be(Diagnostics.ErrorCodes.TypingGenericArguments); + diagnostic.Message.Should().Be(Resources.GenericNotAllUnique); + } + + [DataRow("x = Generic[_X, T]")] + [DataRow("x = Generic[T1, T]")] + [DataRow("x = Generic[T]")] + [DataRow("x = Generic[T,T1, _X]")] + [DataTestMethod, Priority(0)] + public async Task GenericArgumentsNoDiagnosticOnValid(string decl) { + string code = GenericSetup + decl; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().BeEmpty(); + } + + [TestMethod, Priority(0)] + public async Task GenericNoArgumentsNoDiagnostic() { + string code = GenericSetup + @" +x = Generic[] +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().BeEmpty(); + } + + + [TestMethod, Priority(0)] + public async Task GenericArgumentSpaceNoDiagnostic() { + string code = GenericSetup + @" +x = Generic[ ] +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().BeEmpty(); + } + } +} diff --git a/src/Analysis/Ast/Test/LintNewTypeTests.cs b/src/Analysis/Ast/Test/LintNewTypeTests.cs new file mode 100644 index 000000000..aacddbf87 --- /dev/null +++ b/src/Analysis/Ast/Test/LintNewTypeTests.cs @@ -0,0 +1,130 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Analysis.Tests.FluentAssertions; +using Microsoft.Python.Core; +using Microsoft.Python.Parsing.Tests; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Tests { + [TestClass] + public class LintNewTypeTests : AnalysisTestBase { + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + [TestMethod, Priority(0)] + public async Task NewTypeIntFirstArg() { + const string code = @" +from typing import NewType + +T = NewType(5, int) +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + diagnostic.SourceSpan.Should().Be(4, 5, 4, 20); + diagnostic.ErrorCode.Should().Be(Diagnostics.ErrorCodes.TypingNewTypeArguments); + diagnostic.Message.Should().Be(Resources.NewTypeFirstArgNotString.FormatInvariant("int")); + } + + [DataRow("float", "float")] + [DataRow("int", "int")] + [DataRow("complex", "str")] + [DataTestMethod, Priority(0)] + public async Task DifferentTypesFirstArg(string nameType, string type) { + string code = $@" +from typing import NewType + +T = NewType({nameType}(10), {type}) + +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + diagnostic.ErrorCode.Should().Be(Diagnostics.ErrorCodes.TypingNewTypeArguments); + diagnostic.Message.Should().Be(Resources.NewTypeFirstArgNotString.FormatInvariant(nameType)); + } + + [TestMethod, Priority(0)] + public async Task ObjectFirstArg() { + string code = $@" +from typing import NewType + +class X: + def hello(): + pass + +h = X() + +T = NewType(h, int) +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + diagnostic.SourceSpan.Should().Be(10, 5, 10, 20); + diagnostic.ErrorCode.Should().Be(Diagnostics.ErrorCodes.TypingNewTypeArguments); + diagnostic.Message.Should().Be(Resources.NewTypeFirstArgNotString.FormatInvariant("X")); + } + + [TestMethod, Priority(0)] + public async Task GenericFirstArg() { + string code = $@" +from typing import NewType, Generic, TypeVar + +T = TypeVar('T', str, int) + +class X(Generic[T]): + def __init__(self, p: T): + self.x = p + +h = X(5) +T = NewType(h, int) +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + diagnostic.SourceSpan.Should().Be(11, 5, 11, 20); + diagnostic.ErrorCode.Should().Be(Diagnostics.ErrorCodes.TypingNewTypeArguments); + diagnostic.Message.Should().Be(Resources.NewTypeFirstArgNotString.FormatInvariant("X[int]")); + } + + [DataRow("test", "float")] + [DataRow("testing", "int")] + [DataTestMethod, Priority(0)] + public async Task NoDiagnosticOnStringFirstArg(string name, string type) { + string code = $@" +from typing import NewType + +T = NewType('{name}', {type}) +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(0); + } + } +} diff --git a/src/Analysis/Ast/Test/LintOperatorTests.cs b/src/Analysis/Ast/Test/LintOperatorTests.cs new file mode 100644 index 000000000..0578dbdbd --- /dev/null +++ b/src/Analysis/Ast/Test/LintOperatorTests.cs @@ -0,0 +1,86 @@ +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Analysis.Tests.FluentAssertions; +using Microsoft.Python.Core; +using Microsoft.Python.Parsing.Tests; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Tests { + [TestClass] + public class LintOperatorTests : AnalysisTestBase { + + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + [TestMethod, Priority(0)] + public async Task IncompatibleTypesBinaryOpBasic() { + var code = $@" +a = 5 + 'str' +"; + + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + diagnostic.SourceSpan.Should().Be(2, 5, 2, 14); + diagnostic.ErrorCode.Should().Be(Diagnostics.ErrorCodes.UnsupportedOperandType); + diagnostic.Message.Should().Be(Resources.UnsupporedOperandType.FormatInvariant("+", "int", "str")); + } + + [DataRow("str", "int", "+")] + [DataRow("str", "int", "-")] + [DataRow("str", "int", "/")] + [DataRow("str", "float", "+")] + [DataRow("str", "float", "-")] + [DataRow("str", "float", "*")] + [DataTestMethod, Priority(0)] + public async Task IncompatibleTypesBinaryOp(string leftType, string rightType, string op) { + var code = $@" +x = 1 +y = 2 + +z = {leftType}(x) {op} {rightType}(y) +"; + + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + + + string line = $"z = {leftType}(x) {op} {rightType}(y)"; + // source span is 1 indexed + diagnostic.SourceSpan.Should().Be(5, line.IndexOf(leftType) + 1, 5, line.IndexOf("(y)") + 4); + diagnostic.ErrorCode.Should().Be(Diagnostics.ErrorCodes.UnsupportedOperandType); + diagnostic.Message.Should().Be(Resources.UnsupporedOperandType.FormatInvariant(op, leftType, rightType)); + } + + [DataRow("str", "str", "+")] + [DataRow("int", "int", "-")] + [DataRow("bool", "int", "/")] + [DataRow("float", "int", "+")] + [DataRow("complex", "float", "-")] + [DataRow("str", "int", "*")] + [DataTestMethod, Priority(0)] + public async Task CompatibleTypesBinaryOp(string leftType, string rightType, string op) { + var code = $@" +x = 1 +y = 2 + +z = {leftType}(x) {op} {rightType}(y) +"; + + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + analysis.Diagnostics.Should().BeEmpty(); + } + } + +} diff --git a/src/Analysis/Ast/Test/LintReturnInInitTests.cs b/src/Analysis/Ast/Test/LintReturnInInitTests.cs new file mode 100644 index 000000000..4ae7626a2 --- /dev/null +++ b/src/Analysis/Ast/Test/LintReturnInInitTests.cs @@ -0,0 +1,127 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Analysis.Tests.FluentAssertions; +using Microsoft.Python.Parsing; +using Microsoft.Python.Parsing.Tests; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Tests { + [TestClass] + public class LintReturnInInitTests : AnalysisTestBase { + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + [TestMethod, Priority(0)] + public async Task ReturnInInit() { + const string code = @" +class Rectangle: + def __init__(self, width, height): + self.width = width + self.height = height + self.area = width * height + return self.area + +r = Rectangle(10, 10) +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + diagnostic.SourceSpan.Should().Be(7, 9, 7, 25); + diagnostic.Severity.Should().Be(Severity.Warning); + diagnostic.ErrorCode.Should().Be(Diagnostics.ErrorCodes.ReturnInInit); + diagnostic.Message.Should().Be(Resources.ReturnInInit); + } + + [TestMethod, Priority(0)] + public async Task ReturnInitBasic() { + const string code = @" +class Rectangle: + def __init__(self, width, height): + return 2 + +r = Rectangle(10, 10) +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + diagnostic.SourceSpan.Should().Be(4, 9, 4, 17); + diagnostic.Severity.Should().Be(Severity.Warning); + diagnostic.ErrorCode.Should().Be(Diagnostics.ErrorCodes.ReturnInInit); + diagnostic.Message.Should().Be(Resources.ReturnInInit); + } + + [TestMethod, Priority(0)] + public async Task ReturnInInitConditional() { + const string code = @" +class A: + def __init__(self, x): + self.x = x + if x > 0: + return 10 + +a = A(1) +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().HaveCount(1); + + var diagnostic = analysis.Diagnostics.ElementAt(0); + diagnostic.SourceSpan.Should().Be(6, 13, 6, 22); + diagnostic.Severity.Should().Be(Severity.Warning); + diagnostic.ErrorCode.Should().Be(Diagnostics.ErrorCodes.ReturnInInit); + diagnostic.Message.Should().Be(Resources.ReturnInInit); + } + + [TestMethod, Priority(0)] + public async Task ReturnNoneInInit() { + const string code = @" +class A: + def __init__(self, x): + self.x = x + self.x += 1 + return None + +a = A(1) +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().BeEmpty(); + } + + [TestMethod, Priority(0)] + public async Task EmptyReturnInInit() { + const string code = @" +class A: + def __init__(self, x): + self.x = x + return +a = A(1) +"; + var analysis = await GetAnalysisAsync(code); + analysis.Diagnostics.Should().BeEmpty(); + } + } +} diff --git a/src/Analysis/Ast/Test/PathClassificationTests.cs b/src/Analysis/Ast/Test/PathClassificationTests.cs new file mode 100644 index 000000000..429df72b7 --- /dev/null +++ b/src/Analysis/Ast/Test/PathClassificationTests.cs @@ -0,0 +1,218 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.IO; +using FluentAssertions; +using Microsoft.Python.Analysis.Core.Interpreter; +using Microsoft.Python.Core.IO; +using Microsoft.Python.Core.OS; +using Microsoft.Python.Tests.Utilities.FluentAssertions; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Tests { + [TestClass] + public class PathClassificationTests { + private readonly FileSystem _fs = new FileSystem(new OSPlatform()); + + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + [TestMethod] + public void Plain() { + var appPath = TestData.GetTestSpecificPath("app.py"); + var root = Path.GetDirectoryName(appPath); + + var venv = Path.Combine(root, "venv"); + var venvLib = Path.Combine(venv, "Lib"); + var venvSitePackages = Path.Combine(venvLib, "site-packages"); + + var fromInterpreter = new[] { + new PythonLibraryPath(venvLib, PythonLibraryPathType.StdLib), + new PythonLibraryPath(venv, PythonLibraryPathType.StdLib), + new PythonLibraryPath(venvSitePackages, PythonLibraryPathType.Site), + }; + + var (interpreterPaths, userPaths) = PythonLibraryPath.ClassifyPaths(root, _fs, fromInterpreter, Array.Empty()); + + interpreterPaths.Should().BeEquivalentToWithStrictOrdering(new[] { + new PythonLibraryPath(venvLib, PythonLibraryPathType.StdLib), + new PythonLibraryPath(venv, PythonLibraryPathType.StdLib), + new PythonLibraryPath(venvSitePackages, PythonLibraryPathType.Site), + }); + + userPaths.Should().BeEmpty(); + } + + [TestMethod] + public void WithSrcDir() { + var appPath = TestData.GetTestSpecificPath("app.py"); + var root = Path.GetDirectoryName(appPath); + + var venv = Path.Combine(root, "venv"); + var venvLib = Path.Combine(venv, "Lib"); + var venvSitePackages = Path.Combine(venvLib, "site-packages"); + + var src = Path.Combine(root, "src"); + + var fromInterpreter = new[] { + new PythonLibraryPath(venvLib, PythonLibraryPathType.StdLib), + new PythonLibraryPath(venv, PythonLibraryPathType.StdLib), + new PythonLibraryPath(venvSitePackages, PythonLibraryPathType.Site), + }; + + var fromUser = new[] { + "./src", + }; + + var (interpreterPaths, userPaths) = PythonLibraryPath.ClassifyPaths(root, _fs, fromInterpreter, fromUser); + + interpreterPaths.Should().BeEquivalentToWithStrictOrdering(new[] { + new PythonLibraryPath(venvLib, PythonLibraryPathType.StdLib), + new PythonLibraryPath(venv, PythonLibraryPathType.StdLib), + new PythonLibraryPath(venvSitePackages, PythonLibraryPathType.Site), + }); + + userPaths.Should().BeEquivalentToWithStrictOrdering(new[] { + new PythonLibraryPath(src, PythonLibraryPathType.Unspecified), + }); + } + + [TestMethod] + public void NormalizeUser() { + var appPath = TestData.GetTestSpecificPath("app.py"); + var root = Path.GetDirectoryName(appPath); + + var src = Path.Combine(root, "src"); + + var fromUser = new[] { + "./src/", + }; + + var (interpreterPaths, userPaths) = PythonLibraryPath.ClassifyPaths(root, _fs, Array.Empty(), fromUser); + + interpreterPaths.Should().BeEmpty(); + + userPaths.Should().BeEquivalentToWithStrictOrdering(new[] { + new PythonLibraryPath(src, PythonLibraryPathType.Unspecified), + }); + } + + [TestMethod] + public void NestedUser() { + var appPath = TestData.GetTestSpecificPath("app.py"); + var root = Path.GetDirectoryName(appPath); + + var src = Path.Combine(root, "src"); + var srcSomething = Path.Combine(src, "something"); + var srcFoo = Path.Combine(src, "foo"); + var srcFooBar = Path.Combine(srcFoo, "bar"); + + var fromUser = new[] { + "./src", + "./src/something", + "./src/foo/bar", + "./src/foo", + }; + + var (interpreterPaths, userPaths) = PythonLibraryPath.ClassifyPaths(root, _fs, Array.Empty(), fromUser); + + interpreterPaths.Should().BeEmpty(); + + userPaths.Should().BeEquivalentToWithStrictOrdering(new[] { + new PythonLibraryPath(src, PythonLibraryPathType.Unspecified), + new PythonLibraryPath(srcSomething, PythonLibraryPathType.Unspecified), + new PythonLibraryPath(srcFooBar, PythonLibraryPathType.Unspecified), + new PythonLibraryPath(srcFoo, PythonLibraryPathType.Unspecified), + }); + } + + [TestMethod] + public void NestedUserOrdering() { + var appPath = TestData.GetTestSpecificPath("app.py"); + var root = Path.GetDirectoryName(appPath); + + var src = Path.Combine(root, "src"); + var srcSomething = Path.Combine(src, "something"); + var srcFoo = Path.Combine(src, "foo"); + var srcFooBar = Path.Combine(srcFoo, "bar"); + + var fromUser = new[] { + "./src/foo", + "./src/foo/bar", + "./src", + "./src/something", + }; + + var (interpreterPaths, userPaths) = PythonLibraryPath.ClassifyPaths(root, _fs, Array.Empty(), fromUser); + + interpreterPaths.Should().BeEmpty(); + + userPaths.Should().BeEquivalentToWithStrictOrdering(new[] { + new PythonLibraryPath(srcFoo, PythonLibraryPathType.Unspecified), + new PythonLibraryPath(srcFooBar, PythonLibraryPathType.Unspecified), + new PythonLibraryPath(src, PythonLibraryPathType.Unspecified), + new PythonLibraryPath(srcSomething, PythonLibraryPathType.Unspecified), + }); + } + + [TestMethod] + public void InsideStdLib() { + var appPath = TestData.GetTestSpecificPath("app.py"); + var root = Path.GetDirectoryName(appPath); + + var venv = Path.Combine(root, "venv"); + var venvLib = Path.Combine(venv, "Lib"); + var venvSitePackages = Path.Combine(venvLib, "site-packages"); + var inside = Path.Combine(venvSitePackages, "inside"); + var what = Path.Combine(venvSitePackages, "what"); + + var src = Path.Combine(root, "src"); + + var fromInterpreter = new[] { + new PythonLibraryPath(venvLib, PythonLibraryPathType.StdLib), + new PythonLibraryPath(venv, PythonLibraryPathType.StdLib), + new PythonLibraryPath(venvSitePackages, PythonLibraryPathType.Site), + new PythonLibraryPath(inside, PythonLibraryPathType.Pth), + }; + + var fromUser = new[] { + "./src", + "./venv/Lib/site-packages/what", + }; + + var (interpreterPaths, userPaths) = PythonLibraryPath.ClassifyPaths(root, _fs, fromInterpreter, fromUser); + + interpreterPaths.Should().BeEquivalentToWithStrictOrdering(new[] { + new PythonLibraryPath(venvLib, PythonLibraryPathType.StdLib), + new PythonLibraryPath(venv, PythonLibraryPathType.StdLib), + new PythonLibraryPath(what, PythonLibraryPathType.Unspecified), + new PythonLibraryPath(venvSitePackages, PythonLibraryPathType.Site), + new PythonLibraryPath(inside, PythonLibraryPathType.Pth), + }); + + userPaths.Should().BeEquivalentToWithStrictOrdering(new[] { + new PythonLibraryPath(src, PythonLibraryPathType.Unspecified), + }); + } + } +} diff --git a/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs b/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs index 85a3274c7..132d06ff1 100644 --- a/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs +++ b/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs @@ -18,9 +18,6 @@ namespace Microsoft.Python.Analysis.Core.DependencyResolution { public static class AstUtilities { - public static IImportSearchResult FindImports(this PathResolverSnapshot pathResolver, string modulePath, ModuleName importName, bool forceAbsolute) - => pathResolver.GetImportsFromAbsoluteName(modulePath, importName.Names.Select(n => n.Name), forceAbsolute); - public static IImportSearchResult FindImports(this PathResolverSnapshot pathResolver, string modulePath, FromImportStatement fromImportStatement) { var rootNames = fromImportStatement.Root.Names.Select(n => n.Name); return fromImportStatement.Root is RelativeModuleName relativeName diff --git a/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs b/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs index d95e35cf1..2c4106e13 100644 --- a/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs +++ b/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs @@ -18,7 +18,6 @@ using System.Diagnostics; using System.IO; using System.Linq; -using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Core; @@ -27,75 +26,103 @@ using IOPath = System.IO.Path; namespace Microsoft.Python.Analysis.Core.Interpreter { - public sealed class PythonLibraryPath { - private readonly string _modulePrefix; - - private static readonly Regex ParseRegex = new Regex( - @"(?[^|]+)\|(?stdlib)?\|(?[^|]+)?" - ); + public enum PythonLibraryPathType { + Unspecified, + StdLib, + Site, + Pth, + } - public PythonLibraryPath(string path, LibraryType libraryType, string modulePrefix) { - Path = path; - LibraryType = libraryType; - _modulePrefix = modulePrefix; + public sealed class PythonLibraryPath : IEquatable { + public PythonLibraryPath(string path, PythonLibraryPathType type = PythonLibraryPathType.Unspecified, string modulePrefix = null) { + Path = PathUtils.NormalizePathAndTrim(path); + Type = type; + ModulePrefix = modulePrefix ?? string.Empty; } + public PythonLibraryPath(string path, bool isStandardLibrary, string modulePrefix) : + this(path, isStandardLibrary ? PythonLibraryPathType.StdLib : PythonLibraryPathType.Unspecified, modulePrefix) { } + public string Path { get; } - public LibraryType LibraryType { get; } - public string ModulePrefix => _modulePrefix ?? string.Empty; + public PythonLibraryPathType Type { get; } + + public string ModulePrefix { get; } = string.Empty; + + public bool IsStandardLibrary => Type == PythonLibraryPathType.StdLib; + + public override string ToString() { + var type = string.Empty; + + switch (Type) { + case PythonLibraryPathType.StdLib: + type = "stdlib"; + break; + case PythonLibraryPathType.Site: + type = "site"; + break; + case PythonLibraryPathType.Pth: + type = "pth"; + break; + } - public override string ToString() - => "{0}|{1}|{2}".FormatInvariant(Path, LibraryType == LibraryType.Standard ? "stdlib" : "", _modulePrefix ?? string.Empty); + return "{0}|{1}|{2}".FormatInvariant(Path, type, ModulePrefix); + } - public static PythonLibraryPath FromLibraryPath(string s, IFileSystem fs, string standardLibraryPath) { + public static PythonLibraryPath Parse(string s) { if (string.IsNullOrEmpty(s)) { - throw new ArgumentNullException(nameof(s)); + throw new ArgumentNullException("source"); } - - var m = ParseRegex.Match(s); - if (!m.Success || !m.Groups["path"].Success) { + + var parts = s.Split(new[] { '|' }, 3); + if (parts.Length < 3) { throw new FormatException(); } - var libraryType = LibraryType.Other; - var sitePackagesPath = GetSitePackagesPath(standardLibraryPath); - var path = m.Groups["path"].Value; - if (m.Groups["stdlib"].Success) { - libraryType = LibraryType.Standard; - } else if(fs.IsPathUnderRoot(sitePackagesPath, path)) { - libraryType = LibraryType.SitePackages; + var path = parts[0]; + var ty = parts[1]; + var prefix = parts[2]; + + PythonLibraryPathType type = PythonLibraryPathType.Unspecified; + + switch (ty) { + case "stdlib": + type = PythonLibraryPathType.StdLib; + break; + case "site": + type = PythonLibraryPathType.Site; + break; + case "pth": + type = PythonLibraryPathType.Pth; + break; } - return new PythonLibraryPath( - m.Groups["path"].Value, - libraryType, - m.Groups["prefix"].Success ? m.Groups["prefix"].Value : null - ); + return new PythonLibraryPath(path, type, prefix); } /// /// Gets the default set of search paths based on the path to the root /// of the standard library. /// - /// Root of the standard library. + /// Root of the standard library. /// A list of search paths for the interpreter. - public static List GetDefaultSearchPaths(string standardLibraryPath) { + /// New in 2.2, moved in 3.3 + public static List GetDefaultSearchPaths(string library) { var result = new List(); - if (!Directory.Exists(standardLibraryPath)) { + if (!Directory.Exists(library)) { return result; } - result.Add(new PythonLibraryPath(standardLibraryPath, LibraryType.Standard, null)); + result.Add(new PythonLibraryPath(library, PythonLibraryPathType.StdLib)); - var sitePackages = GetSitePackagesPath(standardLibraryPath); + var sitePackages = IOPath.Combine(library, "site-packages"); if (!Directory.Exists(sitePackages)) { return result; } - result.Add(new PythonLibraryPath(sitePackages, LibraryType.SitePackages, null)); + result.Add(new PythonLibraryPath(sitePackages)); result.AddRange(ModulePath.ExpandPathFiles(sitePackages) - .Select(p => new PythonLibraryPath(p, LibraryType.SitePackages, null)) + .Select(p => new PythonLibraryPath(p)) ); return result; @@ -107,7 +134,7 @@ public static List GetDefaultSearchPaths(string standardLibra public static async Task> GetSearchPathsAsync(InterpreterConfiguration config, IFileSystem fs, IProcessServices ps, CancellationToken cancellationToken = default) { for (int retries = 5; retries > 0; --retries) { try { - return await GetSearchPathsFromInterpreterAsync(config, fs, ps, cancellationToken); + return await GetSearchPathsFromInterpreterAsync(config.InterpreterPath, fs, ps, cancellationToken); } catch (InvalidOperationException) { // Failed to get paths break; @@ -133,18 +160,18 @@ public static string GetStandardLibraryPath(InterpreterConfiguration config) { public static string GetSitePackagesPath(InterpreterConfiguration config) => GetSitePackagesPath(GetStandardLibraryPath(config)); - public static string GetSitePackagesPath(string standardLibraryPath) + public static string GetSitePackagesPath(string standardLibraryPath) => !string.IsNullOrEmpty(standardLibraryPath) ? IOPath.Combine(standardLibraryPath, "site-packages") : string.Empty; /// /// Gets the set of search paths by running the interpreter. /// - /// Interpreter configuration. + /// Path to the interpreter. /// File system services. /// Process services. /// Cancellation token. /// A list of search paths for the interpreter. - public static async Task> GetSearchPathsFromInterpreterAsync(InterpreterConfiguration config, IFileSystem fs, IProcessServices ps, CancellationToken cancellationToken = default) { + public static async Task> GetSearchPathsFromInterpreterAsync(string interpreter, IFileSystem fs, IProcessServices ps, CancellationToken cancellationToken = default) { // sys.path will include the working directory, so we make an empty // path that we can filter out later var tempWorkingDir = IOPath.Combine(IOPath.GetTempPath(), IOPath.GetRandomFileName()); @@ -156,7 +183,7 @@ public static async Task> GetSearchPathsFromInterpreterA File.Copy(srcGetSearchPaths, getSearchPaths); var startInfo = new ProcessStartInfo( - config.InterpreterPath, + interpreter, new[] { "-S", "-E", getSearchPaths }.AsQuotedArguments() ) { WorkingDirectory = tempWorkingDir, @@ -169,13 +196,12 @@ public static async Task> GetSearchPathsFromInterpreterA try { var output = await ps.ExecuteAndCaptureOutputAsync(startInfo, cancellationToken); - var standardLibraryPath = GetSitePackagesPath(config); - return output.Split(new [] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).Select(s => { + return output.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).Select(s => { if (s.PathStartsWith(tempWorkingDir)) { return null; } try { - return FromLibraryPath(s, fs, standardLibraryPath); + return Parse(s); } catch (ArgumentException) { Debug.Fail("Invalid search path: " + (s ?? "")); return null; @@ -188,5 +214,88 @@ public static async Task> GetSearchPathsFromInterpreterA fs.DeleteDirectory(tempWorkingDir, true); } } + + public static (IReadOnlyList interpreterPaths, IReadOnlyList userPaths) ClassifyPaths( + string root, + IFileSystem fs, + IEnumerable fromInterpreter, + IEnumerable fromUser + ) { +#if DEBUG + Debug.Assert(root == null || root.PathEquals(PathUtils.NormalizePathAndTrim(root))); + Debug.Assert(!fromInterpreter.Any(p => !p.Path.PathEquals(PathUtils.NormalizePathAndTrim(p.Path)))); +#endif + + // Clean up user configured paths. + // 1) Normalize paths. + // 2) If a path isn't rooted, then root it relative to the workspace root. If there is no root, just continue. + // 3) Trim off any ending separators for consistency. + // 4) Remove any empty paths, FS root paths (bad idea), or paths equal to the root. + // 5) Deduplicate, preserving the order specified by the user. + var fromUserList = fromUser + .Select(PathUtils.NormalizePath) + .Select(p => root == null || IOPath.IsPathRooted(p) ? p : IOPath.GetFullPath(IOPath.Combine(root, p))) // TODO: Replace with GetFullPath(p, root) when .NET Standard 2.1 is out. + .Select(PathUtils.TrimEndSeparator) + .Where(p => !string.IsNullOrWhiteSpace(p) && p != "/" && !p.PathEquals(root)) + .Distinct(PathEqualityComparer.Instance) + .ToList(); + + // Remove any interpreter paths specified in the user config so they can be reclassified. + // The user list is usually small; List.Contains should not be too slow. + fromInterpreter.Where(p => !fromUserList.Contains(p.Path, PathEqualityComparer.Instance)) + .Split(p => p.Type == PythonLibraryPathType.StdLib, out var stdlib, out var withoutStdlib); + + // Pull out stdlib paths, and make them always be interpreter paths. + var interpreterPaths = new List(stdlib); + + var userPaths = new List(); + + var allPaths = fromUserList.Select(p => new PythonLibraryPath(p)) + .Concat(withoutStdlib.Where(p => !p.Path.PathEquals(root))); + + foreach (var p in allPaths) { + // If path is within a stdlib path, then treat it as interpreter. + if (stdlib.Any(s => fs.IsPathUnderRoot(s.Path, p.Path))) { + interpreterPaths.Add(p); + continue; + } + + // If path is outside the workspace, then treat it as interpreter. + if (root == null || !fs.IsPathUnderRoot(root, p.Path)) { + interpreterPaths.Add(p); + continue; + } + + userPaths.Add(p); + } + + return (interpreterPaths, userPaths.ToList()); + } + + public override bool Equals(object obj) => obj is PythonLibraryPath other && Equals(other); + + public override int GetHashCode() { + // TODO: Replace with HashCode.Combine when .NET Standard 2.1 is out. + unchecked { + var hashCode = Path.GetHashCode(); + hashCode = (hashCode * 397) ^ Type.GetHashCode(); + hashCode = (hashCode * 397) ^ ModulePrefix.GetHashCode(); + return hashCode; + } + } + + public bool Equals(PythonLibraryPath other) { + if (other is null) { + return false; + } + + return Path.PathEquals(other.Path) + && Type == other.Type + && ModulePrefix == other.ModulePrefix; + } + + public static bool operator ==(PythonLibraryPath left, PythonLibraryPath right) => left?.Equals(right) ?? right is null; + + public static bool operator !=(PythonLibraryPath left, PythonLibraryPath right) => !(left?.Equals(right) ?? right is null); } } diff --git a/src/Caching/Impl/Factories/ModuleFactory.cs b/src/Caching/Impl/Factories/ModuleFactory.cs index ad0fe4d6c..a2ba630c3 100644 --- a/src/Caching/Impl/Factories/ModuleFactory.cs +++ b/src/Caching/Impl/Factories/ModuleFactory.cs @@ -14,7 +14,6 @@ // permissions and limitations under the License. using System; -using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/src/Core/Impl/Extensions/StringExtensions.cs b/src/Core/Impl/Extensions/StringExtensions.cs index 378ffc3b8..a023b3363 100644 --- a/src/Core/Impl/Extensions/StringExtensions.cs +++ b/src/Core/Impl/Extensions/StringExtensions.cs @@ -204,6 +204,9 @@ public static bool EqualsOrdinal(this string s, string other) public static bool PathEquals(this string s, string other) => string.Equals(s, other, PathsStringComparison); + public static int PathCompare(this string s, string other) + => string.Compare(s, other, PathsStringComparison); + public static bool EqualsOrdinal(this string s, int index, string other, int otherIndex, int length, bool ignoreCase = false) => string.Compare(s, index, other, otherIndex, length, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal) == 0; public static bool ContainsOrdinal(this string s, string value, bool ignoreCase = false) diff --git a/src/Core/Impl/IO/PathUtils.cs b/src/Core/Impl/IO/PathUtils.cs index a9513ee59..a5140c1a0 100644 --- a/src/Core/Impl/IO/PathUtils.cs +++ b/src/Core/Impl/IO/PathUtils.cs @@ -493,5 +493,7 @@ public static string NormalizePath(string path) { ); return isDir ? EnsureEndSeparator(newPath) : newPath; } + + public static string NormalizePathAndTrim(string path) => TrimEndSeparator(NormalizePath(path)); } } diff --git a/src/LanguageServer/Impl/Completion/CompletionItemSource.cs b/src/LanguageServer/Impl/Completion/CompletionItemSource.cs index f202be5c4..60e43e7a2 100644 --- a/src/LanguageServer/Impl/Completion/CompletionItemSource.cs +++ b/src/LanguageServer/Impl/Completion/CompletionItemSource.cs @@ -28,13 +28,14 @@ internal class CompletionItemSource { public static readonly CompletionItem Star = CreateCompletionItem("*", CompletionItemKind.Keyword); private readonly IDocumentationSource _docSource; - private readonly ServerSettings.PythonCompletionOptions _options; public CompletionItemSource(IDocumentationSource docSource, ServerSettings.PythonCompletionOptions options) { _docSource = docSource; - _options = options; + Options = options; } + public ServerSettings.PythonCompletionOptions Options { get; set; } + public CompletionItem CreateCompletionItem(string text, IMember member, IPythonType self = null, string label = null) => CreateCompletionItem(text, ToCompletionItemKind(member?.MemberType ?? PythonMemberType.Class), member, self, label); @@ -42,7 +43,8 @@ public CompletionItemEx CreateCompletionItem(string text, CompletionItemKind kin var t = member?.GetPythonType(); var docFormat = _docSource.DocumentationFormat; - if (_options.addBrackets && (kind == CompletionItemKind.Constructor || kind == CompletionItemKind.Function || kind == CompletionItemKind.Method)) { + if (Options.addBrackets && (kind == CompletionItemKind.Constructor || kind == CompletionItemKind.Function || kind == CompletionItemKind.Method)) { + label = text; text += "($0)"; docFormat = InsertTextFormat.Snippet; } diff --git a/src/LanguageServer/Impl/Completion/CompletionSource.cs b/src/LanguageServer/Impl/Completion/CompletionSource.cs index 7f635c5c3..7b9d51cf4 100644 --- a/src/LanguageServer/Impl/Completion/CompletionSource.cs +++ b/src/LanguageServer/Impl/Completion/CompletionSource.cs @@ -29,6 +29,11 @@ public CompletionSource(IDocumentationSource docSource, ServerSettings.PythonCom _itemSource = new CompletionItemSource(docSource, completionSettings); } + public ServerSettings.PythonCompletionOptions Options { + get => _itemSource.Options; + set => _itemSource.Options = value; + } + public CompletionResult GetCompletions(IDocumentAnalysis analysis, SourceLocation location) { if(analysis.Document.ModuleType != ModuleType.User) { return CompletionResult.Empty; diff --git a/src/LanguageServer/Impl/Completion/ExpressionCompletion.cs b/src/LanguageServer/Impl/Completion/ExpressionCompletion.cs index d95d8366d..a199acae7 100644 --- a/src/LanguageServer/Impl/Completion/ExpressionCompletion.cs +++ b/src/LanguageServer/Impl/Completion/ExpressionCompletion.cs @@ -76,6 +76,7 @@ private static IEnumerable GetClassItems(IPythonClassType cls, E if (m is IVariable v && v.Source != VariableSource.Declaration) { continue; } + // If this is class member completion, unmangle private member names. var unmangledName = cls.UnmangleMemberName(t); if (!string.IsNullOrEmpty(unmangledName)) { diff --git a/src/LanguageServer/Impl/Implementation/Server.Symbols.cs b/src/LanguageServer/Impl/Implementation/Server.Symbols.cs index 09a000228..f9318f06e 100644 --- a/src/LanguageServer/Impl/Implementation/Server.Symbols.cs +++ b/src/LanguageServer/Impl/Implementation/Server.Symbols.cs @@ -36,7 +36,7 @@ public async Task HierarchicalDocumentSymbol(DocumentSymbolPar var path = @params.textDocument.uri.AbsolutePath; var symbols = await _indexManager.HierarchicalDocumentSymbolsAsync(path, cancellationToken); cancellationToken.ThrowIfCancellationRequested(); - return symbols.Select(hSym => MakeDocumentSymbol(hSym)).ToArray(); + return symbols.Select(MakeDocumentSymbol).ToArray(); } private static SymbolInformation MakeSymbolInfo(FlatSymbol s) { diff --git a/src/LanguageServer/Impl/Implementation/Server.cs b/src/LanguageServer/Impl/Implementation/Server.cs index ea00a82c6..3f655f73a 100644 --- a/src/LanguageServer/Impl/Implementation/Server.cs +++ b/src/LanguageServer/Impl/Implementation/Server.cs @@ -116,8 +116,7 @@ public async Task InitializeAsync(InitializeParams @params, Ca _rootDir = @params.rootUri != null ? @params.rootUri.ToAbsolutePath() : @params.rootPath; if (_rootDir != null) { - _rootDir = PathUtils.NormalizePath(_rootDir); - _rootDir = PathUtils.TrimEndSeparator(_rootDir); + _rootDir = PathUtils.NormalizePathAndTrim(_rootDir); } Version.TryParse(@params.initializationOptions.interpreter.properties?.Version, out var version); @@ -126,19 +125,10 @@ public async Task InitializeAsync(InitializeParams @params, Ca interpreterPath: @params.initializationOptions.interpreter.properties?.InterpreterPath, version: version ) { - // 1) Split on ';' to support older VS Code extension versions which send paths as a single entry separated by ';'. TODO: Eventually remove. - // 2) Normalize paths. - // 3) If a path isn't rooted, then root it relative to the workspace root. If _rootDir is null, then accept the path as-is. - // 4) Trim off any ending separator for a consistent style. - // 5) Filter out any entries which are the same as the workspace root; they are redundant. Also ignore "/" to work around the extension (for now). - // 6) Remove duplicates. + // Split on ';' to support older VS Code extension versions which send paths as a single entry separated by ';'. TODO: Eventually remove. + // Note that the actual classification of these paths as user/library is done later in MainModuleResolution.ReloadAsync. SearchPaths = @params.initializationOptions.searchPaths .Select(p => p.Split(';', StringSplitOptions.RemoveEmptyEntries)).SelectMany() - .Select(PathUtils.NormalizePath) - .Select(p => _rootDir == null || Path.IsPathRooted(p) ? p : Path.GetFullPath(p, _rootDir)) - .Select(PathUtils.TrimEndSeparator) - .Where(p => !string.IsNullOrWhiteSpace(p) && p != "/" && !p.PathEquals(_rootDir)) - .Distinct(PathEqualityComparer.Instance) .ToList(), TypeshedPath = @params.initializationOptions.typeStubSearchPaths.FirstOrDefault() }; @@ -214,6 +204,7 @@ private bool HandleConfigurationChanges(ServerSettings newSettings) { Settings = newSettings; _symbolHierarchyMaxSymbols = Settings.analysis.symbolsHierarchyMaxSymbols; + _completionSource.Options = Settings.completion; if (oldSettings == null) { return true; diff --git a/src/LanguageServer/Impl/Indexing/MostRecentDocumentSymbols.cs b/src/LanguageServer/Impl/Indexing/MostRecentDocumentSymbols.cs index 277267d09..2096e26fc 100644 --- a/src/LanguageServer/Impl/Indexing/MostRecentDocumentSymbols.cs +++ b/src/LanguageServer/Impl/Indexing/MostRecentDocumentSymbols.cs @@ -119,8 +119,7 @@ public void Dispose() { } } - private async Task> IndexAsync(IDocument doc, - CancellationToken indexCt) { + private async Task> IndexAsync(IDocument doc, CancellationToken indexCt) { var ast = await doc.GetAstAsync(indexCt); indexCt.ThrowIfCancellationRequested(); var walker = new SymbolIndexWalker(ast); diff --git a/src/LanguageServer/Impl/LanguageServer.cs b/src/LanguageServer/Impl/LanguageServer.cs index cb172f7c1..f61e951ce 100644 --- a/src/LanguageServer/Impl/LanguageServer.cs +++ b/src/LanguageServer/Impl/LanguageServer.cs @@ -432,7 +432,7 @@ private async Task ConsumerLoop() { return item.Task; } - private struct QueueItem { + private readonly struct QueueItem { private readonly TaskCompletionSource _tcs; public Task Task => _tcs.Task; public bool IsAwaitable { get; } diff --git a/src/LanguageServer/Test/CompletionTests.cs b/src/LanguageServer/Test/CompletionTests.cs index 93eb1e189..8b0416bb2 100644 --- a/src/LanguageServer/Test/CompletionTests.cs +++ b/src/LanguageServer/Test/CompletionTests.cs @@ -1194,5 +1194,25 @@ def test(x: Foo = func()): var comps = cs.GetCompletions(analysis, new SourceLocation(13, 7)); comps.Should().HaveLabels("name", "z"); } + + [TestMethod, Priority(0)] + public async Task AddBrackets() { + const string code = @"prin"; + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + + ServerSettings.completion.addBrackets = true; + var cs = new CompletionSource(new PlainTextDocumentationSource(), ServerSettings.completion); + + var comps = cs.GetCompletions(analysis, new SourceLocation(1, 5)); + var print = comps.Completions.FirstOrDefault(x => x.label == "print"); + print.Should().NotBeNull(); + print.insertText.Should().Be("print($0)"); + + cs.Options.addBrackets = false; + comps = cs.GetCompletions(analysis, new SourceLocation(1, 5)); + print = comps.Completions.FirstOrDefault(x => x.label == "print"); + print.Should().NotBeNull(); + print.insertText.Should().Be("print"); + } } } diff --git a/src/LanguageServer/Test/ImportsTests.cs b/src/LanguageServer/Test/ImportsTests.cs index bc9d10265..1df363597 100644 --- a/src/LanguageServer/Test/ImportsTests.cs +++ b/src/LanguageServer/Test/ImportsTests.cs @@ -229,8 +229,8 @@ public async Task UncSearchPaths() { [TestMethod, Priority(0)] public async Task UserSearchPathsInsideWorkspace() { - var folder1 = TestData.GetTestSpecificPath("folder1"); - var folder2 = TestData.GetTestSpecificPath("folder2"); + var folder2 = TestData.GetTestSpecificPath("src"); + var folder1 = TestData.GetTestSpecificPath("src", "virtualenv"); var packageInFolder1 = Path.Combine(folder1, "package"); var packageInFolder2 = Path.Combine(folder2, "package"); var module1Path = Path.Combine(packageInFolder1, "module1.py"); diff --git a/src/LanguageServer/Test/ReferencesTests.cs b/src/LanguageServer/Test/ReferencesTests.cs index cd53d92f4..405808b5c 100644 --- a/src/LanguageServer/Test/ReferencesTests.cs +++ b/src/LanguageServer/Test/ReferencesTests.cs @@ -61,49 +61,79 @@ def func(x): } [TestMethod, Priority(0)] - public async Task TwoOpenFiles() { + public async Task FindAllReferences_MultipleOpenFiles() { const string code1 = @" x = 1 def func(x): return x +class cls: + f = 3 + +c = cls() y = func(x) x = 2 "; - var code2 = $@" -from module1 import x -y = x -"; + var code2 = @" +from module1 import x, c +y = x, +f = c.f"; + + var code3 = @" +from package import module2 as m +from package.module2 import x +a = m.x +b = m.y +c = x"; + var uri1 = await TestData.CreateTestSpecificFileAsync("module1.py", code1); - var uri2 = await TestData.CreateTestSpecificFileAsync("module2.py", code2); + var uri2 = await TestData.CreateTestSpecificFileAsync(Path.Combine("package", "module2.py"), code2); + var uri3 = await TestData.CreateTestSpecificFileAsync("module3.py", code3); - await CreateServicesAsync(PythonVersions.LatestAvailable3X, uri1.AbsolutePath); + await CreateServicesAsync(PythonVersions.LatestAvailable3X); var rdt = Services.GetService(); - rdt.OpenDocument(uri1, code1); - rdt.OpenDocument(uri2, code2); + var doc1 = rdt.OpenDocument(uri1, code1); + var doc2 = rdt.OpenDocument(uri2, code2); + var doc3 = rdt.OpenDocument(uri3, code3); - var doc1 = rdt.GetDocument(uri1); - var analysis = await GetDocumentAnalysisAsync(doc1); + await doc1.GetAnalysisAsync(); + await doc2.GetAnalysisAsync(); + await doc3.GetAnalysisAsync(); var rs = new ReferenceSource(Services); - var refs = await rs.FindAllReferencesAsync(analysis.Document.Uri, new SourceLocation(7, 10), ReferenceSearchOptions.All); + var refs = await rs.FindAllReferencesAsync(uri1, new SourceLocation(11, 10), ReferenceSearchOptions.All); - refs.Should().HaveCount(5); + refs.Should().HaveCount(8); refs[0].range.Should().Be(1, 0, 1, 1); refs[0].uri.Should().Be(uri1); - refs[1].range.Should().Be(6, 9, 6, 10); + refs[1].range.Should().Be(10, 9, 10, 10); refs[1].uri.Should().Be(uri1); - refs[2].range.Should().Be(7, 0, 7, 1); + refs[2].range.Should().Be(11, 0, 11, 1); refs[2].uri.Should().Be(uri1); - refs[3].range.Should().Be(1, 20, 1, 21); - refs[3].uri.Should().Be(uri2); - refs[4].range.Should().Be(2, 4, 2, 5); - refs[4].uri.Should().Be(uri2); + refs[3].range.Should().Be(2, 28, 2, 29); + refs[3].uri.Should().Be(uri3); + refs[4].range.Should().Be(3, 6, 3, 7); + refs[4].uri.Should().Be(uri3); + refs[5].range.Should().Be(5, 4, 5, 5); + refs[5].uri.Should().Be(uri3); + + refs[6].range.Should().Be(1, 20, 1, 21); + refs[6].uri.Should().Be(uri2); + refs[7].range.Should().Be(2, 4, 2, 5); + refs[7].uri.Should().Be(uri2); + + refs = await rs.FindAllReferencesAsync(uri1, new SourceLocation(8, 5), ReferenceSearchOptions.All); + refs.Should().HaveCount(2); + + refs[0].range.Should().Be(7, 4, 7, 5); + refs[0].uri.Should().Be(uri1); + refs[1].range.Should().Be(3, 6, 3, 7); + refs[1].uri.Should().Be(uri2); } [TestMethod, Priority(0)] diff --git a/src/LanguageServer/Test/RenameTests.cs b/src/LanguageServer/Test/RenameTests.cs index a69d5755c..6b6bcb2f5 100644 --- a/src/LanguageServer/Test/RenameTests.cs +++ b/src/LanguageServer/Test/RenameTests.cs @@ -149,6 +149,62 @@ from module import x wse.changes[uri3][1].range.Should().Be(2, 4, 2, 5); } + [TestMethod, Priority(0)] + public async Task Rename_ImportInitPy() { + const string packageInitCode = @"x = 1"; + const string moduleCode = @"import package +y = package.x"; + var initPyUri = TestData.GetTestSpecificUri("package", "__init__.py"); + var moduleUri = TestData.GetTestSpecificUri("module.py"); + + await CreateServicesAsync(PythonVersions.LatestAvailable3X); + var rdt = Services.GetService(); + var initPy = rdt.OpenDocument(initPyUri, packageInitCode); + var module = rdt.OpenDocument(moduleUri, moduleCode); + + await initPy.GetAnalysisAsync(); + await module.GetAnalysisAsync(); + + var rs = new RenameSource(Services); + var wse = await rs.RenameAsync(initPyUri, new SourceLocation(1, 1), "z"); + + wse.changes.Should().HaveCount(2); + + wse.changes[initPyUri].Should().HaveCount(1); + wse.changes[initPyUri][0].range.Should().Be(0, 0, 0, 1); + + wse.changes[moduleUri].Should().HaveCount(1); + wse.changes[moduleUri][0].range.Should().Be(1, 12, 1, 13); + } + + [TestMethod, Priority(0)] + public async Task Rename_ImportSubmodule() { + const string packageInitCode = @"x = 1"; + const string moduleCode = @"import package.submodule +y = package.x"; + var initPyUri = TestData.GetTestSpecificUri("package", "__init__.py"); + var moduleUri = TestData.GetTestSpecificUri("module.py"); + + await CreateServicesAsync(PythonVersions.LatestAvailable3X); + var rdt = Services.GetService(); + var initPy = rdt.OpenDocument(initPyUri, packageInitCode); + var module = rdt.OpenDocument(moduleUri, moduleCode); + + await initPy.GetAnalysisAsync(); + await module.GetAnalysisAsync(); + + var rs = new RenameSource(Services); + var wse = await rs.RenameAsync(initPyUri, new SourceLocation(1, 1), "z"); + + wse.changes.Should().HaveCount(2); + + wse.changes[initPyUri].Should().HaveCount(1); + wse.changes[initPyUri][0].range.Should().Be(0, 0, 0, 1); + + wse.changes[moduleUri].Should().HaveCount(1); + wse.changes[moduleUri][0].range.Should().Be(1, 12, 1, 13); + } + [TestMethod, Priority(0)] public async Task NoRenameInCompiled() { const string code = "from sys import path"; From 4a2fd79d3f21155744cbff4f691bdb2013c49bb2 Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Tue, 23 Jul 2019 08:31:07 -0700 Subject: [PATCH 03/60] Treat persistent module as regular specialized (#1334) * Remove old qualified name * Node storage * Class and scope to use AST map * Library analysis * Fix SO * Keep small AST with imports * AST reduction * Final field * Initial * Reload * Ignore post-final requests * Drop AST * Remove local variables * Test fixes * Fix overload match * Tests * Add locks * Remove local variables * Drop file content to save memory * Cache PEP hints * Recreate AST * Fix specialization * Fix locations * usings * Test fixes * Add options to keep data in memory * Fix test * Fix lambda parameters * Fix argument set Fix global scope node * Fix overload doc * Fix stub merge errors * Fix async issues * Undo some changes * Fix test * Fix race condition * Partial * Models and views * Restore log null checks * Fix merge conflict * Fix merge issue * Null check * Partial * Partial * Partial * Fix test * Partial * Partial * First test * Baseline comparison * Builtins * Partial * Type fixes * Fix type names, part I * Qualified name * Properly write variables * Partial * Construct module from model * Test * Variable creations * Factories * Factories * Split construction * Restore * Save builtins * Test passes * Qualified name * Better export detection * Test fixes * More consistent qualified names * Sys test * Demo * Complete sys write/read * Partial * Partial * Test staility * Perf bug * Baseline, remove debug code, deactivate db * Test fixes * Test fix * Simplify a bit * Baselines and use : separator * Baselines * PR feedback * Merge master * Remove registry reference * PR feedback * PR feedback * Restore persistence + update test * Better handle persistent module in dependencies * Undo * Fix merge issue * Remove debug code --- .../Ast/Impl/Analyzer/AnalysisModuleKey.cs | 2 +- .../Ast/Impl/Analyzer/PythonAnalyzerEntry.cs | 9 ++++---- .../Impl/Analyzer/PythonAnalyzerSession.cs | 9 ++++++-- .../Ast/Impl/Extensions/NodeExtensions.cs | 1 - .../Modules/Definitions/IModuleManagement.cs | 2 +- src/Analysis/Ast/Impl/Modules/PythonModule.cs | 7 ++++-- .../Resolution/MainModuleResolution.cs | 22 +++++++++++++------ .../Resolution/ModuleResolutionBase.cs | 1 - .../Ast/Impl/Types/PythonPropertyType.cs | 4 ++-- src/Caching/Test/Files/Requests.json | 2 +- 10 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs b/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs index d62f11fe2..944c6a9e9 100644 --- a/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs +++ b/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs @@ -34,7 +34,7 @@ private enum KeyType { Default, Typeshed, LibraryAsDocument } public AnalysisModuleKey(IPythonModule module) { Name = module.Name; FilePath = module.ModuleType == ModuleType.CompiledBuiltin ? null : module.FilePath; - _type = module is StubPythonModule stub && stub.IsTypeshed + _type = module is StubPythonModule stub && stub.IsTypeshed ? KeyType.Typeshed : module.ModuleType == ModuleType.Library && module is IDocument document && document.IsOpen ? KeyType.LibraryAsDocument diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs index 2179e1565..844d46a26 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs @@ -20,7 +20,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis.Core.DependencyResolution; -using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core; @@ -264,8 +263,8 @@ private HashSet FindDependencies(IPythonModule module, Python return dependencies; } - private static bool Ignore(IModuleManagement moduleResolution, string name) - => moduleResolution.BuiltinModuleName.EqualsOrdinal(name) || moduleResolution.GetSpecializedModule(name) != null; + private static bool Ignore(IModuleManagement moduleResolution, string fullName, string modulePath) + => moduleResolution.BuiltinModuleName.EqualsOrdinal(fullName) || moduleResolution.GetSpecializedModule(fullName, modulePath) != null; private void UpdateAnalysisTcs(int analysisVersion) { _analysisVersion = analysisVersion; @@ -332,10 +331,10 @@ public override bool Walk(FromImportStatement fromImport) { private void HandleSearchResults(IImportSearchResult searchResult) { switch (searchResult) { - case ModuleImport moduleImport when !Ignore(_moduleResolution, moduleImport.FullName): + case ModuleImport moduleImport when !Ignore(_moduleResolution, moduleImport.FullName, moduleImport.ModulePath): Dependencies.Add(new AnalysisModuleKey(moduleImport.FullName, moduleImport.ModulePath, _isTypeshed)); return; - case PossibleModuleImport possibleModuleImport when !Ignore(_moduleResolution, possibleModuleImport.PrecedingModuleFullName): + case PossibleModuleImport possibleModuleImport when !Ignore(_moduleResolution, possibleModuleImport.PrecedingModuleFullName, possibleModuleImport.PrecedingModulePath): Dependencies.Add(new AnalysisModuleKey(possibleModuleImport.PrecedingModuleFullName, possibleModuleImport.PrecedingModulePath, _isTypeshed)); return; default: diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index 919880435..753a3ef92 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -47,6 +47,7 @@ internal sealed class PythonAnalyzerSession { private readonly IPythonAnalyzer _analyzer; private readonly ILogger _log; private readonly ITelemetryService _telemetry; + private readonly IModuleDatabaseService _moduleDatabaseService; private State _state; private bool _isCanceled; @@ -86,6 +87,7 @@ public PythonAnalyzerSession(IServiceManager services, _analyzer = _services.GetService(); _log = _services.GetService(); _telemetry = _services.GetService(); + _moduleDatabaseService = _services.GetService(); _progress = progress; } @@ -297,7 +299,6 @@ private void AnalyzeEntry() { } var startTime = stopWatch?.Elapsed ?? TimeSpan.Zero; - AnalyzeEntry(null, _entry, module, ast, Version); LogCompleted(null, module, stopWatch, startTime); @@ -383,8 +384,12 @@ private IDocumentAnalysis CreateAnalysis(IDependencyChainNode x is ImportStatement || x is FromImportStatement); document.SetAst(ast); + var eval = new ExpressionEval(walker.Eval.Services, document, ast); - return new LibraryAnalysis(document, version, walker.GlobalScope, eval, walker.StarImportMemberNames); + var analysis = new LibraryAnalysis(document, version, walker.GlobalScope, eval, walker.StarImportMemberNames); + + _moduleDatabaseService?.StoreModuleAnalysisAsync(analysis, CancellationToken.None).DoNotWait(); + return analysis; } private enum State { diff --git a/src/Analysis/Ast/Impl/Extensions/NodeExtensions.cs b/src/Analysis/Ast/Impl/Extensions/NodeExtensions.cs index fa8c46d9d..aa82e938a 100644 --- a/src/Analysis/Ast/Impl/Extensions/NodeExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/NodeExtensions.cs @@ -26,7 +26,6 @@ public static LocationInfo GetLocation(this Node node, IExpressionEvaluator eval return GetLocation(node, eval.Ast, eval.Module); } - public static LocationInfo GetLocation(this Node node, IDocumentAnalysis analysis) { if (node == null || node.StartIndex >= node.EndIndex) { return LocationInfo.Empty; diff --git a/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs b/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs index 89d31d696..ea729b030 100644 --- a/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs +++ b/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs @@ -56,7 +56,7 @@ public interface IModuleManagement: IModuleResolution { /// /// Returns specialized module, if any. /// - IPythonModule GetSpecializedModule(string name); + IPythonModule GetSpecializedModule(string name, string modulePath = null); /// /// Root directory of the path resolver. diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.cs index 366fe8f46..67262f3a9 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.cs @@ -79,6 +79,7 @@ protected PythonModule(string name, ModuleType moduleType, IServiceContainer ser Log = services.GetService(); Interpreter = services.GetService(); Analysis = new EmptyAnalysis(services, this); + GlobalScope = Analysis.GlobalScope; _diagnosticsService = services.GetService(); SetDeclaringModule(this); @@ -150,10 +151,10 @@ public virtual string Documentation { #endregion #region IMemberContainer - public virtual IMember GetMember(string name) => Analysis.GlobalScope.Variables[name]?.Value; + public virtual IMember GetMember(string name) => GlobalScope.Variables[name]?.Value; public virtual IEnumerable GetMemberNames() { // drop imported modules and typing. - return Analysis.GlobalScope.Variables + return GlobalScope.Variables .Where(v => { // Instances are always fine. if (v.Value is IPythonInstance) { @@ -209,6 +210,8 @@ protected virtual void Dispose(bool disposing) { _disposeToken.TryMarkDisposed(); var analyzer = Services.GetService(); analyzer.RemoveAnalysis(this); + _parseCts?.Dispose(); + _linkedParseCts?.Dispose(); } #endregion diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs index 244443906..fe51b0f87 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs @@ -36,6 +36,7 @@ namespace Microsoft.Python.Analysis.Modules.Resolution { internal sealed class MainModuleResolution : ModuleResolutionBase, IModuleManagement { private readonly ConcurrentDictionary _specialized = new ConcurrentDictionary(); + private IModuleDatabaseService _dbService; private IRunningDocumentTable _rdt; public MainModuleResolution(string root, IServiceContainer services) @@ -76,11 +77,6 @@ protected override IPythonModule CreateModule(string name) { } } - var dbs = _services.GetService(); - if (dbs != null && dbs.TryCreateModule(name, moduleImport.ModulePath, out var m) != ModuleStorageState.DoesNotExist && m != null) { - return m; - } - // If there is a stub, make sure it is loaded and attached // First check stub next to the module. if (!TryCreateModuleStub(name, moduleImport.ModulePath, out var stub)) { @@ -156,8 +152,17 @@ public IPythonModule SpecializeModule(string name, Func s /// /// Returns specialized module, if any. /// - public IPythonModule GetSpecializedModule(string name) - => _specialized.TryGetValue(name, out var module) ? module : null; + public IPythonModule GetSpecializedModule(string fullName, string modulePath = null) { + if (_specialized.TryGetValue(fullName, out var module)) { + return module; + } + var dbs = GetDbService(); + if (dbs != null && dbs.TryCreateModule(fullName, modulePath, out module) != ModuleStorageState.DoesNotExist && module != null) { + SpecializeModule(fullName, s => module); + return module; + } + return null; + } internal async Task LoadBuiltinTypesAsync(CancellationToken cancellationToken = default) { var analyzer = _services.GetService(); @@ -237,5 +242,8 @@ private bool TryCreateModuleStub(string name, string modulePath, out IPythonModu private IRunningDocumentTable GetRdt() => _rdt ?? (_rdt = _services.GetService()); + + private IModuleDatabaseService GetDbService() + => _dbService ?? (_dbService = _services.GetService()); } } diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs b/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs index 06dfe6802..b532f4f5e 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs @@ -21,7 +21,6 @@ using Microsoft.Python.Analysis.Caching; using Microsoft.Python.Analysis.Core.DependencyResolution; using Microsoft.Python.Analysis.Core.Interpreter; -using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core; using Microsoft.Python.Core.IO; diff --git a/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs b/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs index e92e34b48..fdf4b7a66 100644 --- a/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs @@ -51,9 +51,9 @@ public string Description { } public override IMember Call(IPythonInstance instance, string memberName, IArgumentSet args) - => _getter?.Call(args, instance?.GetPythonType() ?? DeclaringType); + => _getter.Call(args, instance?.GetPythonType() ?? DeclaringType); - public IMember ReturnType => _getter?.Call(ArgumentSet.WithoutContext, DeclaringType)?.GetPythonType(); + public IMember ReturnType => _getter?.Call(ArgumentSet.WithoutContext, DeclaringType); #endregion internal void AddOverload(IPythonFunctionOverload overload) => _getter = _getter ?? overload; diff --git a/src/Caching/Test/Files/Requests.json b/src/Caching/Test/Files/Requests.json index 84f951687..fb7bb1831 100644 --- a/src/Caching/Test/Files/Requests.json +++ b/src/Caching/Test/Files/Requests.json @@ -208,7 +208,7 @@ "Name": "Session" }, { - "Value": "i:typing:Any", + "Value": "i:requests.structures:LookupDict", "Id": 753305199, "Name": "codes" }, From da3eb704fbc048743a5fc5e704c0ae86eb39e3ed Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Thu, 25 Jul 2019 19:37:16 -0700 Subject: [PATCH 04/60] Store location of module members in the database (#1339) * Remove old qualified name * Node storage * Class and scope to use AST map * Library analysis * Fix SO * Keep small AST with imports * AST reduction * Final field * Initial * Reload * Ignore post-final requests * Drop AST * Remove local variables * Test fixes * Fix overload match * Tests * Add locks * Remove local variables * Drop file content to save memory * Cache PEP hints * Recreate AST * Fix specialization * Fix locations * usings * Test fixes * Add options to keep data in memory * Fix test * Fix lambda parameters * Fix argument set Fix global scope node * Fix overload doc * Fix stub merge errors * Fix async issues * Undo some changes * Fix test * Fix race condition * Partial * Models and views * Restore log null checks * Fix merge conflict * Fix merge issue * Null check * Partial * Partial * Partial * Fix test * Partial * Partial * First test * Baseline comparison * Builtins * Partial * Type fixes * Fix type names, part I * Qualified name * Properly write variables * Partial * Construct module from model * Test * Variable creations * Factories * Factories * Split construction * Restore * Save builtins * Test passes * Qualified name * Better export detection * Test fixes * More consistent qualified names * Sys test * Demo * Complete sys write/read * Partial * Partial * Test staility * Perf bug * Baseline, remove debug code, deactivate db * Test fixes * Test fix * Simplify a bit * Baselines and use : separator * Baselines * PR feedback * Merge master * Remove registry reference * PR feedback * PR feedback * Restore persistence + update test * Better handle persistent module in dependencies * Undo * Add location converter abstraction * Store member location * Basic locations test * Navigation * Add test * Update baselines * Port changes from dbtype --- .../Ast/Impl/Analyzer/PythonAnalyzerEntry.cs | 2 +- .../Definitions/IModuleDatabaseService.cs | 5 + .../Impl/Extensions/PythonModuleExtensions.cs | 2 +- .../Modules/Definitions/IModuleManagement.cs | 13 +- src/Analysis/Ast/Impl/Modules/PythonModule.cs | 7 +- .../Ast/Impl/Modules/PythonVariableModule.cs | 8 +- .../Resolution/MainModuleResolution.cs | 28 +- .../Resolution/ModuleResolutionBase.cs | 16 +- src/Analysis/Ast/Impl/Types/ArgumentSet.cs | 2 +- src/Analysis/Ast/Impl/Types/Location.cs | 5 +- .../Ast/Impl/Types/PythonFunctionOverload.cs | 2 +- .../Impl/Extensions/IndexSpanExtensions.cs | 27 + src/Caching/Impl/Factories/ClassFactory.cs | 2 +- src/Caching/Impl/Factories/FunctionFactory.cs | 4 +- src/Caching/Impl/Factories/PropertyFactory.cs | 2 +- src/Caching/Impl/Factories/VariableFactory.cs | 2 +- src/Caching/Impl/Models/ClassModel.cs | 2 + src/Caching/Impl/Models/FunctionModel.cs | 1 + src/Caching/Impl/Models/IndexSpanModel.cs | 26 + src/Caching/Impl/Models/MemberModel.cs | 3 + src/Caching/Impl/Models/ModuleModel.cs | 28 +- src/Caching/Impl/Models/NewLineModel.cs | 24 + src/Caching/Impl/Models/PropertyModel.cs | 1 + src/Caching/Impl/Models/VariableModel.cs | 2 + src/Caching/Impl/ModuleDatabase.cs | 20 +- src/Caching/Impl/PythonDbModule.cs | 17 +- src/Caching/Test/AnalysisCachingTestBase.cs | 4 +- src/Caching/Test/ClassesTests.cs | 67 + src/Caching/Test/CoreTests.cs | 87 + src/Caching/Test/Files/Builtins.json | 31222 +++++++++++++++- src/Caching/Test/Files/MemberLocations.json | 371 + src/Caching/Test/Files/NestedClasses.json | 242 +- src/Caching/Test/Files/Requests.json | 806 +- src/Caching/Test/Files/SmokeTest.json | 184 +- src/Caching/Test/Files/Sys.json | 6633 +++- .../{BasicTests.cs => LibraryModulesTests.cs} | 88 +- src/Caching/Test/ReferencesTests.cs | 125 + src/Core/Impl/Text/ILocationConverter.cs | 26 + src/Core/Impl/Text/IndexSpan.cs | 14 +- .../Impl/Sources/DefinitionSource.cs | 14 +- src/Parsing/Impl/Ast/PythonAst.cs | 4 +- .../Impl/Ast/SourceLocationExtensions.cs | 14 +- src/Parsing/Impl/Tokens/NewLineKind.cs | 24 + .../Impl/Tokens/NewLineKindExtensions.cs | 39 + src/Parsing/Impl/Tokens/NewLineLocation.cs | 120 + src/Parsing/Impl/{ => Tokens}/Token.cs | 0 .../Impl/{ => Tokens}/TokenCategory.cs | 0 src/Parsing/Impl/{ => Tokens}/TokenInfo.cs | 0 .../Impl/{ => Tokens}/TokenKind.Generated.cs | 0 .../Impl/{ => Tokens}/TokenTriggers.cs | 0 src/Parsing/Impl/{ => Tokens}/Tokenizer.cs | 130 - .../Impl/{ => Tokens}/TokenizerOptions.cs | 0 52 files changed, 38104 insertions(+), 2361 deletions(-) create mode 100644 src/Caching/Impl/Extensions/IndexSpanExtensions.cs create mode 100644 src/Caching/Impl/Models/IndexSpanModel.cs create mode 100644 src/Caching/Impl/Models/NewLineModel.cs create mode 100644 src/Caching/Test/ClassesTests.cs create mode 100644 src/Caching/Test/CoreTests.cs create mode 100644 src/Caching/Test/Files/MemberLocations.json rename src/Caching/Test/{BasicTests.cs => LibraryModulesTests.cs} (58%) create mode 100644 src/Caching/Test/ReferencesTests.cs create mode 100644 src/Core/Impl/Text/ILocationConverter.cs create mode 100644 src/Parsing/Impl/Tokens/NewLineKind.cs create mode 100644 src/Parsing/Impl/Tokens/NewLineKindExtensions.cs create mode 100644 src/Parsing/Impl/Tokens/NewLineLocation.cs rename src/Parsing/Impl/{ => Tokens}/Token.cs (100%) rename src/Parsing/Impl/{ => Tokens}/TokenCategory.cs (100%) rename src/Parsing/Impl/{ => Tokens}/TokenInfo.cs (100%) rename src/Parsing/Impl/{ => Tokens}/TokenKind.Generated.cs (100%) rename src/Parsing/Impl/{ => Tokens}/TokenTriggers.cs (100%) rename src/Parsing/Impl/{ => Tokens}/Tokenizer.cs (95%) rename src/Parsing/Impl/{ => Tokens}/TokenizerOptions.cs (100%) diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs index 844d46a26..0fae952d4 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs @@ -264,7 +264,7 @@ private HashSet FindDependencies(IPythonModule module, Python } private static bool Ignore(IModuleManagement moduleResolution, string fullName, string modulePath) - => moduleResolution.BuiltinModuleName.EqualsOrdinal(fullName) || moduleResolution.GetSpecializedModule(fullName, modulePath) != null; + => moduleResolution.BuiltinModuleName.EqualsOrdinal(fullName) || moduleResolution.IsSpecializedModule(fullName, modulePath); private void UpdateAnalysisTcs(int analysisVersion) { _analysisVersion = analysisVersion; diff --git a/src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs b/src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs index 243e65776..bd1989aa1 100644 --- a/src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs +++ b/src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs @@ -33,5 +33,10 @@ internal interface IModuleDatabaseService { /// Writes module data to the database. /// Task StoreModuleAnalysisAsync(IDocumentAnalysis analysis, CancellationToken cancellationToken = default); + + /// + /// Determines if module analysis exists in the storage. + /// + bool ModuleExistsInStorage(string moduleName, string filePath); } } diff --git a/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs index b2553b65c..33cee4afb 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs @@ -20,7 +20,7 @@ namespace Microsoft.Python.Analysis { public static class PythonModuleExtensions { internal static PythonAst GetAst(this IPythonModule module) - => (PythonAst)((IAstNodeContainer)module).GetAstNode(module); + => (PythonAst)(module as IAstNodeContainer)?.GetAstNode(module); internal static void SetAst(this IPythonModule module, PythonAst ast) { var contained = (IAstNodeContainer)module; diff --git a/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs b/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs index ea729b030..84833d141 100644 --- a/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs +++ b/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs @@ -48,15 +48,20 @@ public interface IModuleManagement: IModuleResolution { /// content is loaded and analyzed only for class/functions definitions /// so the original documentation can be extracted. /// - /// Module to specialize. + /// Module to specialize. /// Specialized module constructor. /// Original (library) module loaded as stub, if any. - IPythonModule SpecializeModule(string name, Func specializationConstructor); + IPythonModule SpecializeModule(string fullName, Func specializationConstructor); /// - /// Returns specialized module, if any. + /// Returns specialized module, if any. Will attempt to load module from persistent state. /// - IPythonModule GetSpecializedModule(string name, string modulePath = null); + IPythonModule GetSpecializedModule(string fullName, bool allowCreation = false, string modulePath = null); + + /// + /// Determines of module is specialized or exists in the database. + /// + bool IsSpecializedModule(string fullName, string modulePath = null); /// /// Root directory of the path resolver. diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.cs index 67262f3a9..e495cb816 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.cs @@ -42,7 +42,7 @@ namespace Microsoft.Python.Analysis.Modules { /// to AST and the module analysis. /// [DebuggerDisplay("{Name} : {ModuleType}")] - internal class PythonModule : LocatedMember, IDocument, IAnalyzable, IEquatable, IAstNodeContainer { + internal class PythonModule : LocatedMember, IDocument, IAnalyzable, IEquatable, IAstNodeContainer, ILocationConverter { private enum State { None, Loading, @@ -565,6 +565,11 @@ private string TryGetDocFromModuleInitFile() { } #endregion + #region ILocationConverter + public virtual SourceLocation IndexToLocation(int index) => this.GetAst()?.IndexToLocation(index) ?? default; + public virtual int LocationToIndex(SourceLocation location) => this.GetAst()?.LocationToIndex(location) ?? default; + #endregion + private void RemoveReferencesInModule(IPythonModule module) { if (module.GlobalScope?.Variables != null) { foreach (var v in module.GlobalScope.Variables) { diff --git a/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs b/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs index e5ca3cc2b..74efc4f56 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs @@ -19,6 +19,7 @@ using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +using Microsoft.Python.Core.Text; namespace Microsoft.Python.Analysis.Modules { /// @@ -26,7 +27,7 @@ namespace Microsoft.Python.Analysis.Modules { /// Contains either module members, members + imported children of explicit package or imported implicit package children /// Instance is unique for each module analysis /// - internal sealed class PythonVariableModule : LocatedMember, IPythonModule, IEquatable { + internal sealed class PythonVariableModule : LocatedMember, IPythonModule, IEquatable, ILocationConverter { private readonly Dictionary _children = new Dictionary(); public string Name { get; } @@ -71,5 +72,10 @@ public PythonVariableModule(IPythonModule module): base(module) { public IMember CreateInstance(string typeName = null, IArgumentSet args = null) => this; public bool Equals(IPythonModule other) => other is PythonVariableModule module && Name.EqualsOrdinal(module.Name); + + #region ILocationConverter + public SourceLocation IndexToLocation(int index) => (Module as ILocationConverter)?.IndexToLocation(index) ?? default; + public int LocationToIndex(SourceLocation location) => (Module as ILocationConverter)?.LocationToIndex(location) ?? default; + #endregion } } diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs index fe51b0f87..a96b5818d 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs @@ -69,14 +69,21 @@ protected override IPythonModule CreateModule(string name) { return null; } + IPythonModule module; if (moduleImport.ModulePath != null) { - var module = GetRdt().GetDocument(new Uri(moduleImport.ModulePath)); + module = GetRdt().GetDocument(new Uri(moduleImport.ModulePath)); if (module != null) { GetRdt().LockDocument(module.Uri); return module; } } + var dbs = GetDbService(); + if (dbs != null && dbs.TryCreateModule(name, moduleImport.ModulePath, out module) != ModuleStorageState.DoesNotExist && module != null) { + SpecializeModule(name, s => module); + return module; + } + // If there is a stub, make sure it is loaded and attached // First check stub next to the module. if (!TryCreateModuleStub(name, moduleImport.ModulePath, out var stub)) { @@ -152,17 +159,14 @@ public IPythonModule SpecializeModule(string name, Func s /// /// Returns specialized module, if any. /// - public IPythonModule GetSpecializedModule(string fullName, string modulePath = null) { - if (_specialized.TryGetValue(fullName, out var module)) { - return module; - } - var dbs = GetDbService(); - if (dbs != null && dbs.TryCreateModule(fullName, modulePath, out module) != ModuleStorageState.DoesNotExist && module != null) { - SpecializeModule(fullName, s => module); - return module; - } - return null; - } + public IPythonModule GetSpecializedModule(string fullName, bool allowCreation = false, string modulePath = null) + => _specialized.TryGetValue(fullName, out var module) ? module : null; + + /// + /// Determines of module is specialized or exists in the database. + /// + public bool IsSpecializedModule(string fullName, string modulePath = null) + => _specialized.ContainsKey(fullName) || GetDbService()?.ModuleExistsInStorage(fullName, modulePath) == true; internal async Task LoadBuiltinTypesAsync(CancellationToken cancellationToken = default) { var analyzer = _services.GetService(); diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs b/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs index b532f4f5e..a9e699d11 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs @@ -86,15 +86,25 @@ public IPythonModule GetImportedModule(string name) => Modules.TryGetValue(name, out var moduleRef) ? moduleRef.Value : _interpreter.ModuleResolution.GetSpecializedModule(name); public IPythonModule GetOrLoadModule(string name) { - if (Modules.TryGetValue(name, out var moduleRef)) { - return moduleRef.GetOrCreate(name, this); + // Specialized should always win. However, we don't want + // to allow loading from the database just yet since module + // may already exist in the analyzed state. + var module = GetImportedModule(name); + if (module != null) { + return module; } - var module = _interpreter.ModuleResolution.GetSpecializedModule(name); + // Now try restoring from the database. + module = _interpreter.ModuleResolution.GetSpecializedModule(name, true); if (module != null) { return module; } + // Now try regular case. + if (Modules.TryGetValue(name, out var moduleRef)) { + return moduleRef.GetOrCreate(name, this); + } + moduleRef = Modules.GetOrAdd(name, new ModuleRef()); return moduleRef.GetOrCreate(name, this); } diff --git a/src/Analysis/Ast/Impl/Types/ArgumentSet.cs b/src/Analysis/Ast/Impl/Types/ArgumentSet.cs index 5854abeda..7a26ffce6 100644 --- a/src/Analysis/Ast/Impl/Types/ArgumentSet.cs +++ b/src/Analysis/Ast/Impl/Types/ArgumentSet.cs @@ -328,7 +328,7 @@ private IMember GetArgumentValue(Argument arg) { } if (arg.ValueIsDefault) { - using (Eval.OpenScope(DeclaringModule.Analysis.GlobalScope)) { + using (Eval.OpenScope(DeclaringModule.GlobalScope)) { return Eval.GetValueFromExpression(arg.ValueExpression) ?? Eval.UnknownType; } } diff --git a/src/Analysis/Ast/Impl/Types/Location.cs b/src/Analysis/Ast/Impl/Types/Location.cs index 2485d307d..e7f49e0bd 100644 --- a/src/Analysis/Ast/Impl/Types/Location.cs +++ b/src/Analysis/Ast/Impl/Types/Location.cs @@ -30,9 +30,8 @@ public Location(IPythonModule module, IndexSpan indexSpan) { public LocationInfo LocationInfo { get { - var ast = Module?.GetAst(); - if (ast != null && !string.IsNullOrEmpty(Module?.FilePath) && Module?.Uri != null) { - return new LocationInfo(Module.FilePath, Module.Uri, IndexSpan.ToSourceSpan(ast)); + if (Module is ILocationConverter lc && !string.IsNullOrEmpty(Module?.FilePath) && Module?.Uri != null) { + return new LocationInfo(Module.FilePath, Module.Uri, IndexSpan.ToSourceSpan(lc)); } return LocationInfo.Empty; } diff --git a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs index 77187a780..1e17c62fb 100644 --- a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs +++ b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs @@ -182,7 +182,7 @@ private IMember CreateSpecificReturnFromTypeVar(IPythonClassType selfClassType, // Try returning the constraint // TODO: improve this, the heuristic is pretty basic and tailored to simple func(_T) -> _T var name = StaticReturnValue.GetPythonType()?.Name; - var typeDefVar = DeclaringModule.Analysis.GlobalScope.Variables[name]; + var typeDefVar = DeclaringModule.GlobalScope.Variables[name]; if (typeDefVar?.Value is IGenericTypeDefinition gtp2) { // See if the instance (self) type satisfies one of the constraints. return selfClassType.Mro.Any(b => gtp2.Constraints.Any(c => c.Equals(b))) diff --git a/src/Caching/Impl/Extensions/IndexSpanExtensions.cs b/src/Caching/Impl/Extensions/IndexSpanExtensions.cs new file mode 100644 index 000000000..44f43d018 --- /dev/null +++ b/src/Caching/Impl/Extensions/IndexSpanExtensions.cs @@ -0,0 +1,27 @@ +// Python Tools for Visual Studio +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Core.Text; + +namespace Microsoft.Python.Analysis.Caching { + internal static class IndexSpanExtensions { + public static IndexSpanModel ToModel(this IndexSpan span) => new IndexSpanModel { + Start = span.Start, + Length = span.Length + }; + } +} diff --git a/src/Caching/Impl/Factories/ClassFactory.cs b/src/Caching/Impl/Factories/ClassFactory.cs index bb7cb3138..0e790279e 100644 --- a/src/Caching/Impl/Factories/ClassFactory.cs +++ b/src/Caching/Impl/Factories/ClassFactory.cs @@ -27,7 +27,7 @@ public ClassFactory(IEnumerable classes, ModuleFactory mf) } protected override PythonClassType CreateMember(ClassModel cm, IPythonType declaringType) - => new PythonClassType(cm.Name, ModuleFactory.DefaultLocation); + => new PythonClassType(cm.Name, new Location(ModuleFactory.Module, cm.IndexSpan.ToSpan())); protected override void CreateMemberParts(ClassModel cm, PythonClassType cls) { // In Python 3 exclude object since type creation will add it automatically. diff --git a/src/Caching/Impl/Factories/FunctionFactory.cs b/src/Caching/Impl/Factories/FunctionFactory.cs index b6f13f446..b4cdb25bc 100644 --- a/src/Caching/Impl/Factories/FunctionFactory.cs +++ b/src/Caching/Impl/Factories/FunctionFactory.cs @@ -25,9 +25,9 @@ public FunctionFactory(IEnumerable classes, ModuleFactory mf) } protected override IPythonFunctionType CreateMember(FunctionModel fm, IPythonType declaringType) { - var f = new PythonFunctionType(fm.Name, ModuleFactory.DefaultLocation, declaringType, fm.Documentation); + var f = new PythonFunctionType(fm.Name, new Location(ModuleFactory.Module, fm.IndexSpan.ToSpan()), declaringType, fm.Documentation); foreach (var om in fm.Overloads) { - var o = new PythonFunctionOverload(fm.Name, ModuleFactory.DefaultLocation); + var o = new PythonFunctionOverload(fm.Name, new Location(ModuleFactory.Module, fm.IndexSpan.ToSpan())); o.SetDocumentation(fm.Documentation); o.SetReturnValue(ModuleFactory.ConstructMember(om.ReturnType), true); o.SetParameters(om.Parameters.Select(ConstructParameter).ToArray()); diff --git a/src/Caching/Impl/Factories/PropertyFactory.cs b/src/Caching/Impl/Factories/PropertyFactory.cs index 5673583f9..dfbfb51f0 100644 --- a/src/Caching/Impl/Factories/PropertyFactory.cs +++ b/src/Caching/Impl/Factories/PropertyFactory.cs @@ -25,7 +25,7 @@ public PropertyFactory(ModuleFactory mf) { } public IPythonPropertyType Construct(PropertyModel pm, IPythonClassType cls) { - var prop = new PythonPropertyType(pm.Name, _mf.DefaultLocation, cls, (pm.Attributes & FunctionAttributes.Abstract) != 0); + var prop = new PythonPropertyType(pm.Name, new Location(_mf.Module, pm.IndexSpan.ToSpan()), cls, (pm.Attributes & FunctionAttributes.Abstract) != 0); prop.SetDocumentation(pm.Documentation); var o = new PythonFunctionOverload(pm.Name, _mf.DefaultLocation); o.SetDocumentation(pm.Documentation); // TODO: own documentation? diff --git a/src/Caching/Impl/Factories/VariableFactory.cs b/src/Caching/Impl/Factories/VariableFactory.cs index b4f7adb54..45a497970 100644 --- a/src/Caching/Impl/Factories/VariableFactory.cs +++ b/src/Caching/Impl/Factories/VariableFactory.cs @@ -26,7 +26,7 @@ public VariableFactory(IEnumerable models, ModuleFactory mf) protected override IVariable CreateMember(VariableModel vm, IPythonType declaringType) { var m = ModuleFactory.ConstructMember(vm.Value); - return new Variable(vm.Name, m, VariableSource.Declaration, ModuleFactory.DefaultLocation); + return new Variable(vm.Name, m, VariableSource.Declaration, new Location(ModuleFactory.Module, vm.IndexSpan.ToSpan())); } } } diff --git a/src/Caching/Impl/Models/ClassModel.cs b/src/Caching/Impl/Models/ClassModel.cs index 066642855..9787f7e61 100644 --- a/src/Caching/Impl/Models/ClassModel.cs +++ b/src/Caching/Impl/Models/ClassModel.cs @@ -85,6 +85,8 @@ private ClassModel(IPythonClassType cls) { Name = cls.TypeId == BuiltinTypeId.Ellipsis ? "ellipsis" : cls.Name; Id = Name.GetStableHash(); + IndexSpan = cls.Location.IndexSpan.ToModel(); + Documentation = cls.Documentation; Bases = cls.Bases.OfType().Select(t => t.GetQualifiedName()).ToArray(); Methods = methods.ToArray(); diff --git a/src/Caching/Impl/Models/FunctionModel.cs b/src/Caching/Impl/Models/FunctionModel.cs index 39bf2c374..9cebb7005 100644 --- a/src/Caching/Impl/Models/FunctionModel.cs +++ b/src/Caching/Impl/Models/FunctionModel.cs @@ -31,6 +31,7 @@ public static FunctionModel FromType(IPythonFunctionType ft) { return new FunctionModel { Id = ft.Name.GetStableHash(), Name = ft.Name, + IndexSpan = ft.Location.IndexSpan.ToModel(), Documentation = ft.Documentation, Overloads = ft.Overloads.Select(FromOverload).ToArray() // TODO: attributes, inner functions and inner classes. diff --git a/src/Caching/Impl/Models/IndexSpanModel.cs b/src/Caching/Impl/Models/IndexSpanModel.cs new file mode 100644 index 000000000..e6af970ba --- /dev/null +++ b/src/Caching/Impl/Models/IndexSpanModel.cs @@ -0,0 +1,26 @@ +// Python Tools for Visual Studio +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using Microsoft.Python.Core.Text; + +namespace Microsoft.Python.Analysis.Caching.Models { + internal sealed class IndexSpanModel { + public int Start { get; set; } + public int Length { get; set; } + + public IndexSpan ToSpan() => new IndexSpan(Start, Length); + } +} diff --git a/src/Caching/Impl/Models/MemberModel.cs b/src/Caching/Impl/Models/MemberModel.cs index 158d4ba44..1a4561e94 100644 --- a/src/Caching/Impl/Models/MemberModel.cs +++ b/src/Caching/Impl/Models/MemberModel.cs @@ -13,9 +13,12 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using Microsoft.Python.Core.Text; + namespace Microsoft.Python.Analysis.Caching.Models { internal abstract class MemberModel { public int Id { get; set; } public string Name { get; set; } + public IndexSpanModel IndexSpan { get; set; } } } diff --git a/src/Caching/Impl/Models/ModuleModel.cs b/src/Caching/Impl/Models/ModuleModel.cs index 9a01a1a29..46d3dee73 100644 --- a/src/Caching/Impl/Models/ModuleModel.cs +++ b/src/Caching/Impl/Models/ModuleModel.cs @@ -18,14 +18,31 @@ using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +using Microsoft.Python.Parsing; namespace Microsoft.Python.Analysis.Caching.Models { internal sealed class ModuleModel : MemberModel { + /// + /// Module unique id that includes version. + /// public string UniqueId { get; set; } + public string Documentation { get; set; } public FunctionModel[] Functions { get; set; } public VariableModel[] Variables { get; set; } public ClassModel[] Classes { get; set; } + + /// + /// Collection of new line information for conversion of linear spans + /// to line/columns in navigation to member definitions and references. + /// + public NewLineModel[] NewLines { get; set; } + + /// + /// Length of the original module file. Used in conversion of indices to line/columns. + /// + public int FileSize { get; set; } + // TODO: TypeVars, ... public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceContainer services) { @@ -42,7 +59,7 @@ public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceConta string typeName = null; switch (v.Value) { - case IPythonFunctionType ft + case IPythonFunctionType ft when ft.DeclaringModule.Equals(analysis.Document) || ft.DeclaringModule.Equals(analysis.Document.Stub): if (!functions.ContainsKey(ft.Name)) { typeName = ft.Name; @@ -50,7 +67,7 @@ when ft.DeclaringModule.Equals(analysis.Document) || ft.DeclaringModule.Equals(a } break; - case IPythonClassType cls + case IPythonClassType cls when cls.DeclaringModule.Equals(analysis.Document) || cls.DeclaringModule.Equals(analysis.Document.Stub): if (!classes.ContainsKey(cls.Name)) { typeName = cls.Name; @@ -73,7 +90,12 @@ when cls.DeclaringModule.Equals(analysis.Document) || cls.DeclaringModule.Equals Documentation = analysis.Document.Documentation, Functions = functions.Values.ToArray(), Variables = variables.Values.ToArray(), - Classes = classes.Values.ToArray() + Classes = classes.Values.ToArray(), + NewLines = analysis.Ast.NewLineLocations.Select(l => new NewLineModel { + EndIndex = l.EndIndex, + Kind = l.Kind + }).ToArray(), + FileSize = analysis.Ast.EndIndex }; } } diff --git a/src/Caching/Impl/Models/NewLineModel.cs b/src/Caching/Impl/Models/NewLineModel.cs new file mode 100644 index 000000000..b3021102d --- /dev/null +++ b/src/Caching/Impl/Models/NewLineModel.cs @@ -0,0 +1,24 @@ +// Python Tools for Visual Studio +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using Microsoft.Python.Parsing; + +namespace Microsoft.Python.Analysis.Caching.Models { + internal sealed class NewLineModel { + public int EndIndex { get; set; } + public NewLineKind Kind { get; set; } + } +} diff --git a/src/Caching/Impl/Models/PropertyModel.cs b/src/Caching/Impl/Models/PropertyModel.cs index 9d67c3c09..2937cecbd 100644 --- a/src/Caching/Impl/Models/PropertyModel.cs +++ b/src/Caching/Impl/Models/PropertyModel.cs @@ -26,6 +26,7 @@ public static PropertyModel FromType(IPythonPropertyType prop) { return new PropertyModel { Id = prop.Name.GetStableHash(), Name = prop.Name, + IndexSpan = prop.Location.IndexSpan.ToModel(), Documentation = prop.Documentation, ReturnType = prop.ReturnType.GetQualifiedName(), // TODO: attributes. diff --git a/src/Caching/Impl/Models/VariableModel.cs b/src/Caching/Impl/Models/VariableModel.cs index f80a41555..c44b3eb77 100644 --- a/src/Caching/Impl/Models/VariableModel.cs +++ b/src/Caching/Impl/Models/VariableModel.cs @@ -26,6 +26,7 @@ internal sealed class VariableModel: MemberModel { public static VariableModel FromVariable(IVariable v) => new VariableModel { Id = v.Name.GetStableHash(), Name = v.Name, + IndexSpan = v.Location.IndexSpan.ToModel(), Value = v.Value.GetQualifiedName() }; @@ -38,6 +39,7 @@ internal sealed class VariableModel: MemberModel { public static VariableModel FromType(string name, IPythonType t) => new VariableModel { Id = name.GetStableHash(), Name = name, + IndexSpan = t.Location.IndexSpan.ToModel(), Value = t.QualifiedName }; } diff --git a/src/Caching/Impl/ModuleDatabase.cs b/src/Caching/Impl/ModuleDatabase.cs index f8a1860f0..85c82e9f6 100644 --- a/src/Caching/Impl/ModuleDatabase.cs +++ b/src/Caching/Impl/ModuleDatabase.cs @@ -85,10 +85,28 @@ public ModuleStorageState TryCreateModule(string moduleName, string filePath, ou return ModuleStorageState.DoesNotExist; } + /// + /// Writes module data to the database. + /// public Task StoreModuleAnalysisAsync(IDocumentAnalysis analysis, CancellationToken cancellationToken = default) => Task.Run(() => StoreModuleAnalysis(analysis, cancellationToken)); - private void StoreModuleAnalysis(IDocumentAnalysis analysis, CancellationToken cancellationToken = default) { + /// + /// Determines if module analysis exists in the storage. + /// + public bool ModuleExistsInStorage(string moduleName, string filePath) { + for (var retries = 50; retries > 0; --retries) { + try { + var dbPath = FindDatabaseFile(moduleName, filePath); + return !string.IsNullOrEmpty(dbPath); + } catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) { + Thread.Sleep(10); + } + } + return false; + } + + private void StoreModuleAnalysis(IDocumentAnalysis analysis, CancellationToken cancellationToken = default) { var model = ModuleModel.FromAnalysis(analysis, _services); Exception ex = null; for (var retries = 50; retries > 0; --retries) { diff --git a/src/Caching/Impl/PythonDbModule.cs b/src/Caching/Impl/PythonDbModule.cs index e54562f72..91a8defa6 100644 --- a/src/Caching/Impl/PythonDbModule.cs +++ b/src/Caching/Impl/PythonDbModule.cs @@ -14,22 +14,35 @@ // permissions and limitations under the License. using System.Collections.Generic; +using System.Linq; using Microsoft.Python.Analysis.Caching.Models; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Core; +using Microsoft.Python.Core.Text; +using Microsoft.Python.Parsing; namespace Microsoft.Python.Analysis.Caching { internal sealed class PythonDbModule : SpecializedModule { + private readonly NewLineLocation[] _newLines; + private readonly int _fileSize; + public PythonDbModule(ModuleModel model, string filePath, IServiceContainer services) - : base(model.Name, string.Empty, services) { - FilePath = filePath; + : base(model.Name, filePath, services) { GlobalScope = new GlobalScope(model, this, services); Documentation = model.Documentation; + + _newLines = model.NewLines.Select(nl => new NewLineLocation(nl.EndIndex, nl.Kind)).ToArray(); + _fileSize = model.FileSize; } protected override string LoadContent() => string.Empty; public override string Documentation { get; } public override IEnumerable GetMemberNames() => GlobalScope.Variables.Names; + + #region ILocationConverter + public override SourceLocation IndexToLocation(int index) => NewLineLocation.IndexToLocation(_newLines, index); + public override int LocationToIndex(SourceLocation location) => NewLineLocation.LocationToIndex(_newLines, location, _fileSize); + #endregion } } diff --git a/src/Caching/Test/AnalysisCachingTestBase.cs b/src/Caching/Test/AnalysisCachingTestBase.cs index e22be40a4..afb91091c 100644 --- a/src/Caching/Test/AnalysisCachingTestBase.cs +++ b/src/Caching/Test/AnalysisCachingTestBase.cs @@ -17,8 +17,6 @@ using System.Reflection; using System.Text; using Microsoft.Python.Analysis.Tests; -using Microsoft.Python.Core.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using TestUtilities; @@ -42,5 +40,7 @@ protected string BaselineFilesFolder { return Path.GetFullPath(Path.Combine(outDirectory, "..", "..", "..", "src", "Caching", "Test", "Files")); } } + + protected string GetBaselineFileName(string testName) => Path.ChangeExtension(Path.Combine(BaselineFilesFolder, testName), "json"); } } diff --git a/src/Caching/Test/ClassesTests.cs b/src/Caching/Test/ClassesTests.cs new file mode 100644 index 000000000..f0b06de74 --- /dev/null +++ b/src/Caching/Test/ClassesTests.cs @@ -0,0 +1,67 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Threading.Tasks; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Caching.Tests { + [TestClass] + public class ClassesTests : AnalysisCachingTestBase { + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + private string BaselineFileName => GetBaselineFileName(TestContext.TestName); + + [TestMethod, Priority(0)] + public async Task NestedClasses() { + const string code = @" +x = 'str' + +class A: + def methodA(self): + return True + +class B: + x: int + + class C: + def __init__(self): + self.y = 1 + def methodC(self): + return False + + def methodB1(self): + return C() + + def methodB2(self): + return C().y + +c = B().methodB1() +"; + var analysis = await GetAnalysisAsync(code); + var model = ModuleModel.FromAnalysis(analysis, Services); + var json = ToJson(model); + Baseline.CompareToFile(BaselineFileName, json); + } + } +} diff --git a/src/Caching/Test/CoreTests.cs b/src/Caching/Test/CoreTests.cs new file mode 100644 index 000000000..38bb3b3c0 --- /dev/null +++ b/src/Caching/Test/CoreTests.cs @@ -0,0 +1,87 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Caching.Tests { + [TestClass] + public class CoreTests : AnalysisCachingTestBase { + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + private string BaselineFileName => GetBaselineFileName(TestContext.TestName); + + [TestMethod, Priority(0)] + public async Task SmokeTest() { + const string code = @" +x = 'str' + +class C: + x: int + def __init__(self): + self.y = 1 + + def method(self): + return func() + + @property + def prop(self) -> int: + return x + +def func(): + return 2.0 + +c = C() +"; + var analysis = await GetAnalysisAsync(code); + var model = ModuleModel.FromAnalysis(analysis, Services); + var json = ToJson(model); + Baseline.CompareToFile(BaselineFileName, json); + } + + + [DataTestMethod, Priority(0)] + [DataRow("", null, null, false)] + [DataRow("str", "builtins", "str", false)] + [DataRow("i:str", "builtins", "str", true)] + [DataRow("i:...", "builtins", "ellipsis", true)] + [DataRow("ellipsis", "builtins", "ellipsis", false)] + [DataRow("i:builtins:str", "builtins", "str", true)] + [DataRow("i:mod:x", "mod", "x", true)] + [DataRow("typing:Union[str, tuple]", "typing", "Union[str, tuple]", false)] + [DataRow("typing:Union[typing:Any, mod:y]", "typing", "Union[typing:Any, mod:y]", false)] + [DataRow("typing:Union[typing:Union[str, int], mod:y]", "typing", "Union[typing:Union[str, int], mod:y]", false)] + public void QualifiedNames(string qualifiedName, string moduleName, string typeName, bool isInstance) { + TypeNames.DeconstructQualifiedName(qualifiedName, out var actualModuleName, out var actualMemberNames, out var actualIsInstance); + actualModuleName.Should().Be(moduleName); + if (string.IsNullOrEmpty(qualifiedName)) { + actualMemberNames.Should().BeNull(); + } else { + actualMemberNames[0].Should().Be(typeName); + } + actualIsInstance.Should().Be(isInstance); + } + } +} diff --git a/src/Caching/Test/Files/Builtins.json b/src/Caching/Test/Files/Builtins.json index 8fff2c8a0..8a5415c33 100644 --- a/src/Caching/Test/Files/Builtins.json +++ b/src/Caching/Test/Files/Builtins.json @@ -14,7 +14,11 @@ "Classes": null, "Functions": null, "Id": 24816593, - "Name": "type" + "Name": "type", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "__build_class__(func, name, *bases, metaclass=None, **kwds) -> class\n\nInternal helper function used by the class statement.", @@ -59,7 +63,11 @@ "Classes": null, "Functions": null, "Id": 186877360, - "Name": "__build_class__" + "Name": "__build_class__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "__import__(name, globals=None, locals=None, fromlist=(), level=0) -> module\n\nImport a module. Because this function is meant for use by the Python\ninterpreter and not for general use, it is better to use\nimportlib.import_module() to programmatically import a module.\n\nThe globals argument is only used to determine the context;\nthey are not modified. The locals argument is unused. The fromlist\nshould be a list of names to emulate ``from name import ...'', or an\nempty list to emulate ``import name''.\nWhen importing a module from a package, note that __import__('A.B', ...)\nreturns package A when fromlist is empty, but its submodule B when\nfromlist is not empty. The level argument is used to determine whether to\nperform absolute or relative imports: 0 is absolute, while a positive number\nis the number of parent directories to search relative to the current module.", @@ -104,7 +112,11 @@ "Classes": null, "Functions": null, "Id": -200972932, - "Name": "__import__" + "Name": "__import__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the absolute value of the argument.", @@ -125,7 +137,11 @@ "Classes": null, "Functions": null, "Id": 781563, - "Name": "abs" + "Name": "abs", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if bool(x) is True for all values x in the iterable.\n\nIf the iterable is empty, return True.", @@ -146,7 +162,11 @@ "Classes": null, "Functions": null, "Id": 781866, - "Name": "all" + "Name": "all", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if bool(x) is True for any x in the iterable.\n\nIf the iterable is empty, return False.", @@ -167,7 +187,11 @@ "Classes": null, "Functions": null, "Id": 781941, - "Name": "any" + "Name": "any", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return an ASCII-only representation of an object.\n\nAs repr(), return a string containing a printable representation of an\nobject, but escape the non-ASCII characters in the string returned by\nrepr() using \\\\x, \\\\u or \\\\U escapes. This generates a string similar\nto that returned by repr() in Python 2.", @@ -188,7 +212,11 @@ "Classes": null, "Functions": null, "Id": 751576474, - "Name": "ascii" + "Name": "ascii", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the binary representation of an integer.\n\n >>> bin(2796202)\n '0b1010101010101010101010'", @@ -209,7 +237,11 @@ "Classes": null, "Functions": null, "Id": 782736, - "Name": "bin" + "Name": "bin", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "breakpoint(*args, **kws)\n\nCall sys.breakpointhook(*args, **kws). sys.breakpointhook() must accept\nwhatever arguments are passed.\n\nBy default, this drops you into the pdb debugger.", @@ -236,7 +268,11 @@ "Classes": null, "Functions": null, "Id": -1356147896, - "Name": "breakpoint" + "Name": "breakpoint", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return whether the object is callable (i.e., some kind of function).\n\nNote that classes are callable, as are instances of classes with a\n__call__() method.", @@ -257,7 +293,11 @@ "Classes": null, "Functions": null, "Id": 1205971407, - "Name": "callable" + "Name": "callable", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff.", @@ -278,7 +318,11 @@ "Classes": null, "Functions": null, "Id": 783670, - "Name": "chr" + "Name": "chr", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Compile source into a code object that can be executed by exec() or eval().\n\nThe source code may represent a Python module, statement or expression.\nThe filename will be used for run-time error messages.\nThe mode must be 'exec' to compile a module, 'single' to compile a\nsingle (interactive) statement, or 'eval' to compile an expression.\nThe flags argument, if present, controls which future statements influence\nthe compilation of the code.\nThe dont_inherit argument, if true, stops the compilation inheriting\nthe effects of any future statements in effect in the code calling\ncompile; if absent or false these statements do influence the compilation,\nin addition to any features explicitly specified.", @@ -329,7 +373,11 @@ "Classes": null, "Functions": null, "Id": -1914543556, - "Name": "compile" + "Name": "compile", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.", @@ -350,7 +398,11 @@ "Classes": null, "Functions": null, "Id": 1298046352, - "Name": "copyright" + "Name": "copyright", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.", @@ -371,7 +423,11 @@ "Classes": null, "Functions": null, "Id": -1836401501, - "Name": "credits" + "Name": "credits", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Deletes the named attribute from the given object.\n\ndelattr(x, 'y') is equivalent to ``del x.y''", @@ -398,7 +454,11 @@ "Classes": null, "Functions": null, "Id": -1314690939, - "Name": "delattr" + "Name": "delattr", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "dir([object]) -> list of strings\n\nIf called without an argument, return the names in the current scope.\nElse, return an alphabetized list of names comprising (some of) the attributes\nof the given object, and of attributes reachable from it.\nIf the object supplies a method named __dir__, it will be used; otherwise\nthe default dir() logic is used and returns:\n for a module object: the module's attributes.\n for a class object: its attributes, and recursively the attributes\n of its bases.\n for any other object: its attributes, its class's attributes, and\n recursively the attributes of its class's base classes.", @@ -419,7 +479,11 @@ "Classes": null, "Functions": null, "Id": 784662, - "Name": "dir" + "Name": "dir", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the tuple (x//y, x%y). Invariant: div*y + mod == x.", @@ -446,7 +510,11 @@ "Classes": null, "Functions": null, "Id": 1901256616, - "Name": "divmod" + "Name": "divmod", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Evaluate the given source in the context of globals and locals.\n\nThe source may be a string representing a Python expression\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it.", @@ -479,7 +547,11 @@ "Classes": null, "Functions": null, "Id": 24366387, - "Name": "eval" + "Name": "eval", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Execute the given source in the context of globals and locals.\n\nThe source may be a string representing one or more Python statements\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it.", @@ -512,7 +584,11 @@ "Classes": null, "Functions": null, "Id": 24368424, - "Name": "exec" + "Name": "exec", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -539,7 +615,11 @@ "Classes": null, "Functions": null, "Id": 24368565, - "Name": "exit" + "Name": "exit", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return value.__format__(format_spec)\n\nformat_spec defaults to the empty string.\nSee the Format Specification Mini-Language section of help('FORMATTING') for\ndetails.", @@ -566,7 +646,11 @@ "Classes": null, "Functions": null, "Id": 1963936462, - "Name": "format" + "Name": "format", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getattr(object, name[, default]) -> value\n\nGet a named attribute from an object; getattr(x, 'y') is equivalent to x.y.\nWhen a default argument is given, it is returned when the attribute doesn't\nexist; without it, an exception is raised in that case.", @@ -599,7 +683,11 @@ "Classes": null, "Functions": null, "Id": 1355208272, - "Name": "getattr" + "Name": "getattr", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the dictionary containing the current scope's global variables.\n\nNOTE: Updates to this dictionary *will* affect name lookups in the current\nglobal scope and vice-versa.", @@ -613,7 +701,11 @@ "Classes": null, "Functions": null, "Id": 1551006009, - "Name": "globals" + "Name": "globals", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return whether the object has an attribute with the given name.\n\nThis is done by calling getattr(obj, name) and catching AttributeError.", @@ -640,7 +732,11 @@ "Classes": null, "Functions": null, "Id": 2127271828, - "Name": "hasattr" + "Name": "hasattr", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the hash value for the given object.\n\nTwo objects that compare equal must also have the same hash value, but the\nreverse is not necessarily true.", @@ -661,7 +757,11 @@ "Classes": null, "Functions": null, "Id": 24436133, - "Name": "hash" + "Name": "hash", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Define the builtin 'help'.\n\n This is a wrapper around pydoc.help that provides a helpful message\n when 'help' is typed at the Python interactive prompt.\n\n Calling help() at the Python prompt starts an interactive help session.\n Calling help(thing) prints help for the python object 'thing'.\n ", @@ -694,7 +794,11 @@ "Classes": null, "Functions": null, "Id": 24439768, - "Name": "help" + "Name": "help", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the hexadecimal representation of an integer.\n\n >>> hex(12648430)\n '0xc0ffee'", @@ -715,7 +819,11 @@ "Classes": null, "Functions": null, "Id": 788388, - "Name": "hex" + "Name": "hex", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the identity of an object.\n\nThis is guaranteed to be unique among simultaneously existing objects.\n(CPython uses the object's memory address.)", @@ -736,7 +844,11 @@ "Classes": null, "Functions": null, "Id": 25458, - "Name": "id" + "Name": "id", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Read a string from standard input. The trailing newline is stripped.\n\nThe prompt string, if given, is printed to standard output without a\ntrailing newline before reading input.\n\nIf the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.\nOn *nix systems, readline is used if available.", @@ -757,7 +869,11 @@ "Classes": null, "Functions": null, "Id": 758828563, - "Name": "input" + "Name": "input", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return whether an object is an instance of a class or of a subclass thereof.\n\nA tuple, as in ``isinstance(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``isinstance(x, A) or isinstance(x, B)\nor ...`` etc.", @@ -784,7 +900,11 @@ "Classes": null, "Functions": null, "Id": 1317005078, - "Name": "isinstance" + "Name": "isinstance", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return whether 'cls' is a derived from another class or is the same class.\n\nA tuple, as in ``issubclass(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``issubclass(x, A) or issubclass(x, B)\nor ...`` etc.", @@ -811,7 +931,11 @@ "Classes": null, "Functions": null, "Id": -1314249287, - "Name": "issubclass" + "Name": "issubclass", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "iter(iterable) -> iterator\niter(callable, sentinel) -> iterator\n\nGet an iterator from an object. In the first form, the argument must\nsupply its own iterator, or be a sequence.\nIn the second form, the callable is called until it returns the sentinel.", @@ -838,7 +962,11 @@ "Classes": null, "Functions": null, "Id": 24483759, - "Name": "iter" + "Name": "iter", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the number of items in a container.", @@ -859,7 +987,11 @@ "Classes": null, "Functions": null, "Id": 792222, - "Name": "len" + "Name": "len", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.", @@ -880,7 +1012,11 @@ "Classes": null, "Functions": null, "Id": 1596689482, - "Name": "license" + "Name": "license", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a dictionary containing the current scope's local variables.\n\nNOTE: Whether or not updates to this dictionary will affect name lookups in\nthe local scope and vice-versa is *implementation dependent* and not\ncovered by any backwards compatibility guarantees.", @@ -894,7 +1030,11 @@ "Classes": null, "Functions": null, "Id": 2135253311, - "Name": "locals" + "Name": "locals", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "max(iterable, *[, default=obj, key=func]) -> value\nmax(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its biggest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the largest argument.", @@ -933,7 +1073,11 @@ "Classes": null, "Functions": null, "Id": 793069, - "Name": "max" + "Name": "max", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "min(iterable, *[, default=obj, key=func]) -> value\nmin(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its smallest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the smallest argument.", @@ -972,7 +1116,11 @@ "Classes": null, "Functions": null, "Id": 793307, - "Name": "min" + "Name": "min", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "next(iterator[, default])\n\nReturn the next item from the iterator. If default is given and the iterator\nis exhausted, it is returned instead of raising StopIteration.", @@ -999,7 +1147,11 @@ "Classes": null, "Functions": null, "Id": 24618890, - "Name": "next" + "Name": "next", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the octal representation of an integer.\n\n >>> oct(342391)\n '0o1234567'", @@ -1020,7 +1172,11 @@ "Classes": null, "Functions": null, "Id": 795049, - "Name": "oct" + "Name": "oct", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Open file and return a stream. Raise OSError upon failure.\n\nfile is either a text or byte string giving the name (and the path\nif the file isn't in the current working directory) of the file to\nbe opened or an integer file descriptor of the file to be\nwrapped. (If a file descriptor is given, it is closed when the\nreturned I/O object is closed, unless closefd is set to False.)\n\nmode is an optional string that specifies the mode in which the file\nis opened. It defaults to 'r' which means open for reading in text\nmode. Other common values are 'w' for writing (truncating the file if\nit already exists), 'x' for creating and writing to a new file, and\n'a' for appending (which on some Unix systems, means that all writes\nappend to the end of the file regardless of the current seek position).\nIn text mode, if encoding is not specified the encoding used is platform\ndependent: locale.getpreferredencoding(False) is called to get the\ncurrent locale encoding. (For reading and writing raw bytes use binary\nmode and leave encoding unspecified.) The available modes are:\n\n========= ===============================================================\nCharacter Meaning\n--------- ---------------------------------------------------------------\n'r' open for reading (default)\n'w' open for writing, truncating the file first\n'x' create a new file and open it for writing\n'a' open for writing, appending to the end of the file if it exists\n'b' binary mode\n't' text mode (default)\n'+' open a disk file for updating (reading and writing)\n'U' universal newline mode (deprecated)\n========= ===============================================================\n\nThe default mode is 'rt' (open for reading text). For binary random\naccess, the mode 'w+b' opens and truncates the file to 0 bytes, while\n'r+b' opens the file without truncation. The 'x' mode implies 'w' and\nraises an `FileExistsError` if the file already exists.\n\nPython distinguishes between files opened in binary and text modes,\neven when the underlying operating system doesn't. Files opened in\nbinary mode (appending 'b' to the mode argument) return contents as\nbytes objects without any decoding. In text mode (the default, or when\n't' is appended to the mode argument), the contents of the file are\nreturned as strings, the bytes having been first decoded using a\nplatform-dependent encoding or using the specified encoding if given.\n\n'U' mode is deprecated and will raise an exception in future versions\nof Python. It has no effect in Python 3. Use newline to control\nuniversal newlines mode.\n\nbuffering is an optional integer used to set the buffering policy.\nPass 0 to switch buffering off (only allowed in binary mode), 1 to select\nline buffering (only usable in text mode), and an integer > 1 to indicate\nthe size of a fixed-size chunk buffer. When no buffering argument is\ngiven, the default buffering policy works as follows:\n\n* Binary files are buffered in fixed-size chunks; the size of the buffer\n is chosen using a heuristic trying to determine the underlying device's\n \"block size\" and falling back on `io.DEFAULT_BUFFER_SIZE`.\n On many systems, the buffer will typically be 4096 or 8192 bytes long.\n\n* \"Interactive\" text files (files for which isatty() returns True)\n use line buffering. Other text files use the policy described above\n for binary files.\n\nencoding is the name of the encoding used to decode or encode the\nfile. This should only be used in text mode. The default encoding is\nplatform dependent, but any encoding supported by Python can be\npassed. See the codecs module for the list of supported encodings.\n\nerrors is an optional string that specifies how encoding errors are to\nbe handled---this argument should not be used in binary mode. Pass\n'strict' to raise a ValueError exception if there is an encoding error\n(the default of None has the same effect), or pass 'ignore' to ignore\nerrors. (Note that ignoring encoding errors can lead to data loss.)\nSee the documentation for codecs.register or run 'help(codecs.Codec)'\nfor a list of the permitted encoding error strings.\n\nnewline controls how universal newlines works (it only applies to text\nmode). It can be None, '', '\\n', '\\r', and '\\r\\n'. It works as\nfollows:\n\n* On input, if newline is None, universal newlines mode is\n enabled. Lines in the input can end in '\\n', '\\r', or '\\r\\n', and\n these are translated into '\\n' before being returned to the\n caller. If it is '', universal newline mode is enabled, but line\n endings are returned to the caller untranslated. If it has any of\n the other legal values, input lines are only terminated by the given\n string, and the line ending is returned to the caller untranslated.\n\n* On output, if newline is None, any '\\n' characters written are\n translated to the system default line separator, os.linesep. If\n newline is '' or '\\n', no translation takes place. If newline is any\n of the other legal values, any '\\n' characters written are translated\n to the given string.\n\nIf closefd is False, the underlying file descriptor will be kept open\nwhen the file is closed. This does not work when a file name is given\nand must be True in that case.\n\nA custom opener can be used by passing a callable as *opener*. The\nunderlying file descriptor for the file object is then obtained by\ncalling *opener* with (*file*, *flags*). *opener* must return an open\nfile descriptor (passing os.open as *opener* results in functionality\nsimilar to passing None).\n\nopen() returns a file object whose type depends on the mode, and\nthrough which the standard file operations such as reading and writing\nare performed. When open() is used to open a file in a text mode ('w',\n'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open\na file in a binary mode, the returned class varies: in read binary\nmode, it returns a BufferedReader; in write binary and append binary\nmodes, it returns a BufferedWriter, and in read/write mode, it returns\na BufferedRandom.\n\nIt is also possible to use a string or bytearray as a file for both\nreading and writing. For strings StringIO can be used like a file\nopened in a text mode, and for bytes a BytesIO can be used like a file\nopened in a binary mode.", @@ -1083,7 +1239,11 @@ "Classes": null, "Functions": null, "Id": 24658657, - "Name": "open" + "Name": "open", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the Unicode code point for a one-character string.", @@ -1104,7 +1264,11 @@ "Classes": null, "Functions": null, "Id": 795498, - "Name": "ord" + "Name": "ord", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Equivalent to x**y (with two arguments) or x**y % z (with three arguments)\n\nSome types, such as ints, are able to use a more efficient algorithm when\ninvoked using the three argument form.", @@ -1137,7 +1301,11 @@ "Classes": null, "Functions": null, "Id": 796385, - "Name": "pow" + "Name": "pow", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)\n\nPrints the values to a stream, or to sys.stdout by default.\nOptional keyword arguments:\nfile: a file-like object (stream); defaults to the current sys.stdout.\nsep: string inserted between values, default a space.\nend: string appended after the last value, default a newline.\nflush: whether to forcibly flush the stream.", @@ -1151,7 +1319,11 @@ "Classes": null, "Functions": null, "Id": 765405430, - "Name": "print" + "Name": "print", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -1178,7 +1350,11 @@ "Classes": null, "Functions": null, "Id": 24723174, - "Name": "quit" + "Name": "quit", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", @@ -1192,7 +1368,11 @@ "Classes": null, "Functions": null, "Id": 766750598, - "Name": "range" + "Name": "range", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the canonical string representation of the object.\n\nFor many object types, including most builtins, eval(repr(obj)) == obj.", @@ -1213,7 +1393,11 @@ "Classes": null, "Functions": null, "Id": 24737804, - "Name": "repr" + "Name": "repr", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Round a number to a given precision in decimal digits.\n\nThe return value is an integer if ndigits is omitted or None. Otherwise\nthe return value has the same type as the number. ndigits may be negative.", @@ -1240,7 +1424,11 @@ "Classes": null, "Functions": null, "Id": 767174615, - "Name": "round" + "Name": "round", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Sets the named attribute on the given object to the specified value.\n\nsetattr(x, 'y', v) is equivalent to ``x.y = v''", @@ -1273,7 +1461,11 @@ "Classes": null, "Functions": null, "Id": -879649444, - "Name": "setattr" + "Name": "setattr", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a new list containing all items from the iterable in ascending order.\n\nA custom key function can be supplied to customize the sort order, and the\nreverse flag can be set to request the result in descending order.", @@ -1294,7 +1486,11 @@ "Classes": null, "Functions": null, "Id": -1958845036, - "Name": "sorted" + "Name": "sorted", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the sum of a 'start' value (default: 0) plus an iterable of numbers\n\nWhen the iterable is empty, return the start value.\nThis function is intended specifically for use with numeric values and may\nreject non-numeric types.", @@ -1321,7 +1517,11 @@ "Classes": null, "Functions": null, "Id": 799444, - "Name": "sum" + "Name": "sum", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "vars([object]) -> dictionary\n\nWithout arguments, equivalent to locals().\nWith an argument, equivalent to object.__dict__.", @@ -1342,7 +1542,11 @@ "Classes": null, "Functions": null, "Id": 24853187, - "Name": "vars" + "Name": "vars", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", @@ -1356,234 +1560,418 @@ "Classes": null, "Functions": null, "Id": 783823, - "Name": "cmp" + "Name": "cmp", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Variables": [ { "Value": "object", "Id": 376535734, - "Name": "__Object__" + "Name": "__Object__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "int", "Id": -1660953576, - "Name": "__Int__" + "Name": "__Int__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "bool", "Id": -149570207, - "Name": "__Bool__" + "Name": "__Bool__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "int", "Id": 136686707, - "Name": "__Long__" + "Name": "__Long__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "float", "Id": -1172856571, - "Name": "__Float__" + "Name": "__Float__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "complex", "Id": -1125625831, - "Name": "__Complex__" + "Name": "__Complex__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "tuple", "Id": -1373807759, - "Name": "__Tuple__" + "Name": "__Tuple__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "list", "Id": 131307029, - "Name": "__List__" + "Name": "__List__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "dict", "Id": -98202835, - "Name": "__Dict__" + "Name": "__Dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "set", "Id": -1651986485, - "Name": "__Set__" + "Name": "__Set__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "frozenset", "Id": -1845664181, - "Name": "__FrozenSet__" + "Name": "__FrozenSet__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "bytes", "Id": -50989228, - "Name": "__Bytes__" + "Name": "__Bytes__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "bytes_iterator", "Id": 1196082274, - "Name": "__BytesIterator__" + "Name": "__BytesIterator__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str", "Id": -667382010, - "Name": "__Unicode__" + "Name": "__Unicode__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str_iterator", "Id": 899385876, - "Name": "__UnicodeIterator__" + "Name": "__UnicodeIterator__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str", "Id": -1651541542, - "Name": "__Str__" + "Name": "__Str__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str_iterator", "Id": -1693163288, - "Name": "__StrIterator__" + "Name": "__StrIterator__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "module", "Id": -318216541, - "Name": "__Module__" + "Name": "__Module__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "function", "Id": -56357041, - "Name": "__Function__" + "Name": "__Function__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "wrapper_descriptor", "Id": 2031680028, - "Name": "__BuiltinMethodDescriptor__" + "Name": "__BuiltinMethodDescriptor__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "builtin_function_or_method", "Id": -998173500, - "Name": "__BuiltinFunction__" + "Name": "__BuiltinFunction__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "generator", "Id": 1086442300, - "Name": "__Generator__" + "Name": "__Generator__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "property", "Id": -919605748, - "Name": "__Property__" + "Name": "__Property__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "classmethod", "Id": -991650526, - "Name": "__ClassMethod__" + "Name": "__ClassMethod__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "staticmethod", "Id": 1863225126, - "Name": "__StaticMethod__" + "Name": "__StaticMethod__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "ellipsis", "Id": 961323528, - "Name": "__Ellipsis__" + "Name": "__Ellipsis__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "tuple_iterator", "Id": 1754184575, - "Name": "__TupleIterator__" + "Name": "__TupleIterator__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "list_iterator", "Id": 692195875, - "Name": "__ListIterator__" + "Name": "__ListIterator__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "dict_keys", "Id": -414283327, - "Name": "__DictKeys__" + "Name": "__DictKeys__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "dict_values", "Id": -623419857, - "Name": "__DictValues__" + "Name": "__DictValues__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "dict_items", "Id": -1322081197, - "Name": "__DictItems__" + "Name": "__DictItems__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "set_iterator", "Id": 1366627801, - "Name": "__SetIterator__" + "Name": "__SetIterator__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "callable_iterator", "Id": 1819825725, - "Name": "__CallableIterator__" + "Name": "__CallableIterator__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": null, "Id": -2048509720, - "Name": "__builtin_module_names__" + "Name": "__builtin_module_names__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:ellipsis", "Id": 1631567368, - "Name": "Ellipsis" + "Name": "Ellipsis", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:OSError", "Id": 763574764, - "Name": "EnvironmentError" + "Name": "EnvironmentError", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:OSError", "Id": -172840821, - "Name": "IOError" + "Name": "IOError", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:NotImplementedType", "Id": -1818427354, - "Name": "NotImplemented" + "Name": "NotImplemented", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:OSError", "Id": 1763918588, - "Name": "WindowsError" + "Name": "WindowsError", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": null, "Id": -1636005055, - "Name": "__doc__" + "Name": "__doc__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": null, "Id": 1097116834, - "Name": "__name__" + "Name": "__name__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": null, "Id": 75395663, - "Name": "__package__" + "Name": "__package__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "bool", "Id": 23856709, - "Name": "True" + "Name": "True", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "bool", "Id": 726114124, - "Name": "False" + "Name": "False", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "__NoneType__", "Id": 23674863, - "Name": "None" + "Name": "None", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Classes": [ @@ -1624,7 +2012,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -1645,7 +2037,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -1666,7 +2062,11 @@ "Classes": null, "Functions": null, "Id": -544113923, - "Name": "__reduce__" + "Name": "__reduce__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return repr(self).", @@ -1687,7 +2087,11 @@ "Classes": null, "Functions": null, "Id": 1215429388, - "Name": "__repr__" + "Name": "__repr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -1714,7 +2118,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -1722,18 +2130,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 2136768640, - "Name": "NotImplementedType" + "Name": "NotImplementedType", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", @@ -1744,23 +2164,36 @@ { "Value": null, "Id": 1097116834, - "Name": "__name__" + "Name": "__name__", + "IndexSpan": null }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 1423120691, - "Name": "__Unknown__" + "Name": "__Unknown__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "the type of the None object", @@ -1771,18 +2204,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 1499999113, - "Name": "__NoneType__" + "Name": "__NoneType__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "The most base type", @@ -1813,7 +2258,11 @@ "Classes": null, "Functions": null, "Id": 2095540485, - "Name": "__delattr__" + "Name": "__delattr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Default dir() implementation.", @@ -1834,7 +2283,11 @@ "Classes": null, "Functions": null, "Id": -1636169386, - "Name": "__dir__" + "Name": "__dir__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -1861,7 +2314,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Default object formatter.", @@ -1888,7 +2345,11 @@ "Classes": null, "Functions": null, "Id": 695475534, - "Name": "__format__" + "Name": "__format__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -1915,7 +2376,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -1942,7 +2407,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -1969,7 +2438,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -1990,7 +2463,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "The most base type", @@ -2023,7 +2500,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -2044,7 +2525,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -2071,7 +2556,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given. If x is a number, return x.__int__(). For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base. The literal can be preceded by '+' or '-' and be surrounded\nby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n>>> int('0b100', base=0)\n4", @@ -2342,7 +2879,11 @@ "Classes": null, "Functions": null, "Id": -1639147525, - "Name": "__abs__" + "Name": "__abs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self+value.", @@ -2369,7 +2910,11 @@ "Classes": null, "Functions": null, "Id": -1639102358, - "Name": "__add__" + "Name": "__add__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self&value.", @@ -2396,7 +2941,11 @@ "Classes": null, "Functions": null, "Id": -1638804448, - "Name": "__and__" + "Name": "__and__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "self != 0", @@ -2417,7 +2966,11 @@ "Classes": null, "Functions": null, "Id": 766562625, - "Name": "__bool__" + "Name": "__bool__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Ceiling of an Integral returns itself.", @@ -2438,7 +2991,11 @@ "Classes": null, "Functions": null, "Id": 785777820, - "Name": "__ceil__" + "Name": "__ceil__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return divmod(self, value).", @@ -2465,7 +3022,11 @@ "Classes": null, "Functions": null, "Id": 589685672, - "Name": "__divmod__" + "Name": "__divmod__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -2492,7 +3053,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "float(self)", @@ -2513,7 +3078,11 @@ "Classes": null, "Functions": null, "Id": 1457457445, - "Name": "__float__" + "Name": "__float__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Flooring an Integral returns itself.", @@ -2534,7 +3103,11 @@ "Classes": null, "Functions": null, "Id": 1457872597, - "Name": "__floor__" + "Name": "__floor__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self//value.", @@ -2561,7 +3134,11 @@ "Classes": null, "Functions": null, "Id": 778272028, - "Name": "__floordiv__" + "Name": "__floordiv__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -2588,7 +3165,11 @@ "Classes": null, "Functions": null, "Id": 695475534, - "Name": "__format__" + "Name": "__format__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -2615,7 +3196,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -2642,7 +3227,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -2663,7 +3252,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -2690,7 +3283,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -2711,7 +3308,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self converted to an integer, if self is suitable for use as an index into a list.", @@ -2732,7 +3333,11 @@ "Classes": null, "Functions": null, "Id": -127776229, - "Name": "__index__" + "Name": "__index__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "int([x]) -> integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given. If x is a number, return x.__int__(). For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base. The literal can be preceded by '+' or '-' and be surrounded\nby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n>>> int('0b100', base=0)\n4", @@ -2765,7 +3370,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -2786,7 +3395,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "int(self)", @@ -2807,7 +3420,11 @@ "Classes": null, "Functions": null, "Id": -1631400904, - "Name": "__int__" + "Name": "__int__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "~self", @@ -2828,7 +3445,11 @@ "Classes": null, "Functions": null, "Id": 849070445, - "Name": "__invert__" + "Name": "__invert__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -2855,7 +3476,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<>self.", @@ -3416,7 +4121,11 @@ "Classes": null, "Functions": null, "Id": 1555101003, - "Name": "__rrshift__" + "Name": "__rrshift__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>>value.", @@ -3443,7 +4152,11 @@ "Classes": null, "Functions": null, "Id": -900426137, - "Name": "__rshift__" + "Name": "__rshift__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return value-self.", @@ -3470,7 +4183,11 @@ "Classes": null, "Functions": null, "Id": 1228492261, - "Name": "__rsub__" + "Name": "__rsub__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return value/self.", @@ -3497,7 +4214,11 @@ "Classes": null, "Functions": null, "Id": -1563284312, - "Name": "__rtruediv__" + "Name": "__rtruediv__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return value^self.", @@ -3524,7 +4245,11 @@ "Classes": null, "Functions": null, "Id": 1232946496, - "Name": "__rxor__" + "Name": "__rxor__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Returns size in memory, in bytes.", @@ -3545,7 +4270,11 @@ "Classes": null, "Functions": null, "Id": 1069167279, - "Name": "__sizeof__" + "Name": "__sizeof__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return str(self).", @@ -3566,7 +4295,11 @@ "Classes": null, "Functions": null, "Id": -1621988870, - "Name": "__str__" + "Name": "__str__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self-value.", @@ -3593,7 +4326,11 @@ "Classes": null, "Functions": null, "Id": -1621974455, - "Name": "__sub__" + "Name": "__sub__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -3620,7 +4357,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self/value.", @@ -3647,7 +4388,11 @@ "Classes": null, "Functions": null, "Id": -375214324, - "Name": "__truediv__" + "Name": "__truediv__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Truncating an Integral returns itself.", @@ -3668,7 +4413,11 @@ "Classes": null, "Functions": null, "Id": 1175294069, - "Name": "__trunc__" + "Name": "__trunc__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self^value.", @@ -3695,7 +4444,11 @@ "Classes": null, "Functions": null, "Id": -1617520220, - "Name": "__xor__" + "Name": "__xor__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Number of bits necessary to represent self in binary.\n\n>>> bin(37)\n'0b100101'\n>>> (37).bit_length()\n6", @@ -3716,7 +4469,11 @@ "Classes": null, "Functions": null, "Id": 641823151, - "Name": "bit_length" + "Name": "bit_length", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Returns self, the complex conjugate of any int.", @@ -3737,7 +4494,11 @@ "Classes": null, "Functions": null, "Id": -903692703, - "Name": "conjugate" + "Name": "conjugate", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the integer represented by the given array of bytes.\n\n bytes\n Holds the array of bytes to convert. The argument must either\n support the buffer protocol or be an iterable object producing bytes.\n Bytes and bytearray are examples of built-in objects that support the\n buffer protocol.\n byteorder\n The byte order used to represent the integer. If byteorder is 'big',\n the most significant byte is at the beginning of the byte array. If\n byteorder is 'little', the most significant byte is at the end of the\n byte array. To request the native byte order of the host system, use\n `sys.byteorder' as the byte order value.\n signed\n Indicates whether two's complement is used to represent the integer.", @@ -3776,7 +4537,11 @@ "Classes": null, "Functions": null, "Id": -190029075, - "Name": "from_bytes" + "Name": "from_bytes", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return an array of bytes representing an integer.\n\n length\n Length of bytes object to use. An OverflowError is raised if the\n integer is not representable with the given number of bytes.\n byteorder\n The byte order used to represent the integer. If byteorder is 'big',\n the most significant byte is at the beginning of the byte array. If\n byteorder is 'little', the most significant byte is at the end of the\n byte array. To request the native byte order of the host system, use\n `sys.byteorder' as the byte order value.\n signed\n Determines whether two's complement is used to represent the integer.\n If signed is False and a negative integer is given, an OverflowError\n is raised.", @@ -3809,7 +4574,11 @@ "Classes": null, "Functions": null, "Id": -71556418, - "Name": "to_bytes" + "Name": "to_bytes", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [ @@ -3818,46 +4587,74 @@ "ReturnType": null, "Attributes": 0, "Id": 985628143, - "Name": "denominator" + "Name": "denominator", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 24476897, - "Name": "imag" + "Name": "imag", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 1522491474, - "Name": "numerator" + "Name": "numerator", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 24737333, - "Name": "real" + "Name": "real", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Fields": [ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 789624, - "Name": "int" + "Name": "int", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.", @@ -3890,7 +4687,11 @@ "Classes": null, "Functions": null, "Id": -1638804448, - "Name": "__and__" + "Name": "__and__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.", @@ -3917,7 +4718,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -3938,7 +4743,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self|value.", @@ -3965,7 +4774,11 @@ "Classes": null, "Functions": null, "Id": 1748671418, - "Name": "__or__" + "Name": "__or__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return value&self.", @@ -3992,7 +4805,11 @@ "Classes": null, "Functions": null, "Id": 1211662268, - "Name": "__rand__" + "Name": "__rand__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return repr(self).", @@ -4013,7 +4830,11 @@ "Classes": null, "Functions": null, "Id": 1215429388, - "Name": "__repr__" + "Name": "__repr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return value|self.", @@ -4040,7 +4861,11 @@ "Classes": null, "Functions": null, "Id": -1623061346, - "Name": "__ror__" + "Name": "__ror__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return value^self.", @@ -4067,7 +4892,11 @@ "Classes": null, "Functions": null, "Id": 1232946496, - "Name": "__rxor__" + "Name": "__rxor__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return str(self).", @@ -4088,7 +4917,11 @@ "Classes": null, "Functions": null, "Id": -1621988870, - "Name": "__str__" + "Name": "__str__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -4115,7 +4948,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self^value.", @@ -4142,7 +4979,11 @@ "Classes": null, "Functions": null, "Id": -1617520220, - "Name": "__xor__" + "Name": "__xor__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the integer represented by the given array of bytes.\n\n bytes\n Holds the array of bytes to convert. The argument must either\n support the buffer protocol or be an iterable object producing bytes.\n Bytes and bytearray are examples of built-in objects that support the\n buffer protocol.\n byteorder\n The byte order used to represent the integer. If byteorder is 'big',\n the most significant byte is at the beginning of the byte array. If\n byteorder is 'little', the most significant byte is at the end of the\n byte array. To request the native byte order of the host system, use\n `sys.byteorder' as the byte order value.\n signed\n Indicates whether two's complement is used to represent the integer.", @@ -4181,7 +5022,11 @@ "Classes": null, "Functions": null, "Id": -190029075, - "Name": "from_bytes" + "Name": "from_bytes", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -4189,18 +5034,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 24270721, - "Name": "bool" + "Name": "bool", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Convert a string or number to a floating point number, if possible.", @@ -4227,7 +5084,11 @@ "Classes": null, "Functions": null, "Id": -1639147525, - "Name": "__abs__" + "Name": "__abs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self+value.", @@ -4254,7 +5115,11 @@ "Classes": null, "Functions": null, "Id": -1639102358, - "Name": "__add__" + "Name": "__add__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "self != 0", @@ -4275,7 +5140,11 @@ "Classes": null, "Functions": null, "Id": 766562625, - "Name": "__bool__" + "Name": "__bool__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return divmod(self, value).", @@ -4302,7 +5171,11 @@ "Classes": null, "Functions": null, "Id": 589685672, - "Name": "__divmod__" + "Name": "__divmod__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -4329,7 +5202,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "float(self)", @@ -4350,7 +5227,11 @@ "Classes": null, "Functions": null, "Id": 1457457445, - "Name": "__float__" + "Name": "__float__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self//value.", @@ -4377,7 +5258,11 @@ "Classes": null, "Functions": null, "Id": 778272028, - "Name": "__floordiv__" + "Name": "__floordiv__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Formats the float according to format_spec.", @@ -4404,7 +5289,11 @@ "Classes": null, "Functions": null, "Id": 695475534, - "Name": "__format__" + "Name": "__format__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -4431,7 +5320,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -4458,7 +5351,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "You probably don't want to use this function.\n\n typestr\n Must be 'double' or 'float'.\n\nIt exists mainly to be used in Python's test suite.\n\nThis function returns whichever of 'unknown', 'IEEE, big-endian' or 'IEEE,\nlittle-endian' best describes the format of floating point numbers used by the\nC type named by typestr.", @@ -4491,7 +5388,11 @@ "Classes": null, "Functions": null, "Id": 1018863830, - "Name": "__getformat__" + "Name": "__getformat__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -4512,7 +5413,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -4539,7 +5444,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -4560,7 +5469,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Convert a string or number to a floating point number, if possible.", @@ -4593,7 +5506,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -4614,7 +5531,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "int(self)", @@ -4635,7 +5556,11 @@ "Classes": null, "Functions": null, "Id": -1631400904, - "Name": "__int__" + "Name": "__int__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -4662,7 +5587,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>> (10.0).as_integer_ratio()\n(10, 1)\n>>> (0.0).as_integer_ratio()\n(0, 1)\n>>> (-.25).as_integer_ratio()\n(-1, 4)", @@ -5298,7 +6319,11 @@ "Classes": null, "Functions": null, "Id": -1148559724, - "Name": "as_integer_ratio" + "Name": "as_integer_ratio", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self, the complex conjugate of any float.", @@ -5319,7 +6344,11 @@ "Classes": null, "Functions": null, "Id": -903692703, - "Name": "conjugate" + "Name": "conjugate", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a floating-point number from a hexadecimal string.\n\n>>> float.fromhex('0x1.ffffp10')\n2047.984375\n>>> float.fromhex('-0x1p-1074')\n-5e-324", @@ -5352,7 +6381,11 @@ "Classes": null, "Functions": null, "Id": 835611450, - "Name": "fromhex" + "Name": "fromhex", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a hexadecimal representation of a floating-point number.\n\n>>> (-0.1).hex()\n'-0x1.999999999999ap-4'\n>>> 3.14159.hex()\n'0x1.921f9f01b866ep+1'", @@ -5373,7 +6406,11 @@ "Classes": null, "Functions": null, "Id": 788388, - "Name": "hex" + "Name": "hex", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the float is an integer.", @@ -5394,7 +6431,11 @@ "Classes": null, "Functions": null, "Id": 783186560, - "Name": "is_integer" + "Name": "is_integer", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [ @@ -5403,32 +6444,52 @@ "ReturnType": null, "Attributes": 0, "Id": 24476897, - "Name": "imag" + "Name": "imag", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 24737333, - "Name": "real" + "Name": "real", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Fields": [ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 755996837, - "Name": "float" + "Name": "float", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a complex number from a real part and an optional imaginary part.\n\nThis is equivalent to (real + imag*1j) where imag defaults to 0.", @@ -5455,7 +6516,11 @@ "Classes": null, "Functions": null, "Id": -1639147525, - "Name": "__abs__" + "Name": "__abs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self+value.", @@ -5482,7 +6547,11 @@ "Classes": null, "Functions": null, "Id": -1639102358, - "Name": "__add__" + "Name": "__add__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "self != 0", @@ -5503,7 +6572,11 @@ "Classes": null, "Functions": null, "Id": 766562625, - "Name": "__bool__" + "Name": "__bool__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return divmod(self, value).", @@ -5530,7 +6603,11 @@ "Classes": null, "Functions": null, "Id": 589685672, - "Name": "__divmod__" + "Name": "__divmod__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -5557,7 +6634,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "float(self)", @@ -5578,7 +6659,11 @@ "Classes": null, "Functions": null, "Id": 1457457445, - "Name": "__float__" + "Name": "__float__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self//value.", @@ -5605,7 +6690,11 @@ "Classes": null, "Functions": null, "Id": 778272028, - "Name": "__floordiv__" + "Name": "__floordiv__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "complex.__format__() -> str\n\nConvert to a string according to format_spec.", @@ -5632,7 +6721,11 @@ "Classes": null, "Functions": null, "Id": 695475534, - "Name": "__format__" + "Name": "__format__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -5659,7 +6752,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -5686,7 +6783,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -5707,7 +6808,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -5734,7 +6839,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -5755,7 +6864,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a complex number from a real part and an optional imaginary part.\n\nThis is equivalent to (real + imag*1j) where imag defaults to 0.", @@ -5788,7 +6901,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -5809,7 +6926,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "int(self)", @@ -5830,7 +6951,11 @@ "Classes": null, "Functions": null, "Id": -1631400904, - "Name": "__int__" + "Name": "__int__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -5857,7 +6982,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self complex\n\nReturn the complex conjugate of its argument. (3-4j).conjugate() == 3+4j.", @@ -6406,7 +7615,11 @@ "Classes": null, "Functions": null, "Id": -903692703, - "Name": "conjugate" + "Name": "conjugate", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [ @@ -6415,32 +7628,52 @@ "ReturnType": null, "Attributes": 0, "Id": 24476897, - "Name": "imag" + "Name": "imag", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 24737333, - "Name": "real" + "Name": "real", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Fields": [ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": -1914540871, - "Name": "complex" + "Name": "complex", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object.", @@ -6473,7 +7706,11 @@ "Classes": null, "Functions": null, "Id": -1639102358, - "Name": "__add__" + "Name": "__add__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return key in self.", @@ -6500,7 +7737,11 @@ "Classes": null, "Functions": null, "Id": -1841774666, - "Name": "__contains__" + "Name": "__contains__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -6527,7 +7768,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -6554,7 +7799,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -6581,7 +7830,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self[key].", @@ -6608,7 +7861,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -6629,7 +7886,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -6656,7 +7917,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -6677,7 +7942,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object.", @@ -6710,7 +7979,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -6731,7 +8004,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -6752,7 +8029,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -6779,7 +8060,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -6800,7 +8085,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self=value.", @@ -7182,7 +8531,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -7209,7 +8562,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "x.__getitem__(y) <==> x[y]", @@ -7236,7 +8593,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -7263,7 +8624,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement self+=value.", @@ -7290,7 +8655,11 @@ "Classes": null, "Functions": null, "Id": 953701999, - "Name": "__iadd__" + "Name": "__iadd__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement self*=value.", @@ -7317,7 +8686,11 @@ "Classes": null, "Functions": null, "Id": 965298386, - "Name": "__imul__" + "Name": "__imul__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Built-in mutable sequence.\n\nIf no argument is given, the constructor creates a new empty list.\nThe argument must be an iterable if specified.", @@ -7350,7 +8723,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -7371,7 +8748,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -7392,7 +8773,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -7419,7 +8804,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -7440,7 +8829,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self new empty dictionary\ndict(mapping) -> new dictionary initialized from a mapping object's\n (key, value) pairs\ndict(iterable) -> new dictionary initialized as if via:\n d = {}\n for k, v in iterable:\n d[k] = v\ndict(**kwargs) -> new dictionary initialized with the name=value pairs\n in the keyword argument list. For example: dict(one=1, two=2)", @@ -8019,7 +9505,11 @@ "Classes": null, "Functions": null, "Id": -1841774666, - "Name": "__contains__" + "Name": "__contains__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Delete self[key].", @@ -8046,7 +9536,11 @@ "Classes": null, "Functions": null, "Id": -1970845273, - "Name": "__delitem__" + "Name": "__delitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -8073,7 +9567,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -8100,7 +9598,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -8127,7 +9629,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "x.__getitem__(y) <==> x[y]", @@ -8154,7 +9660,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -8181,7 +9691,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "dict() -> new empty dictionary\ndict(mapping) -> new dictionary initialized from a mapping object's\n (key, value) pairs\ndict(iterable) -> new dictionary initialized as if via:\n d = {}\n for k, v in iterable:\n d[k] = v\ndict(**kwargs) -> new dictionary initialized with the name=value pairs\n in the keyword argument list. For example: dict(one=1, two=2)", @@ -8208,7 +9722,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -8229,7 +9747,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -8250,7 +9772,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -8277,7 +9803,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -8298,7 +9828,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self size of D in memory, in bytes", @@ -8427,7 +9977,11 @@ "Classes": null, "Functions": null, "Id": 1069167279, - "Name": "__sizeof__" + "Name": "__sizeof__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -8454,7 +10008,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "D.clear() -> None. Remove all items from D.", @@ -8475,7 +10033,11 @@ "Classes": null, "Functions": null, "Id": 753216662, - "Name": "clear" + "Name": "clear", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "D.copy() -> a shallow copy of D", @@ -8496,7 +10058,11 @@ "Classes": null, "Functions": null, "Id": 24300556, - "Name": "copy" + "Name": "copy", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a new dictionary with keys from iterable and values set to value.", @@ -8535,7 +10101,11 @@ "Classes": null, "Functions": null, "Id": 134240693, - "Name": "fromkeys" + "Name": "fromkeys", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the value for key if key is in the dictionary, else default.", @@ -8568,7 +10138,11 @@ "Classes": null, "Functions": null, "Id": 787423, - "Name": "get" + "Name": "get", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "D.items() -> a set-like object providing a view on D's items", @@ -8589,7 +10163,11 @@ "Classes": null, "Functions": null, "Id": 758996489, - "Name": "items" + "Name": "items", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "D.keys() -> a set-like object providing a view on D's keys", @@ -8610,7 +10188,11 @@ "Classes": null, "Functions": null, "Id": 24529547, - "Name": "keys" + "Name": "keys", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\nIf key is not found, d is returned if given, otherwise KeyError is raised", @@ -8643,7 +10225,11 @@ "Classes": null, "Functions": null, "Id": 796378, - "Name": "pop" + "Name": "pop", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "D.popitem() -> (k, v), remove and return some (key, value) pair as a\n2-tuple; but raise KeyError if D is empty.", @@ -8676,7 +10262,11 @@ "Classes": null, "Functions": null, "Id": 1035642093, - "Name": "popitem" + "Name": "popitem", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Insert key with a value of default if key is not in the dictionary.\n\nReturn the value for key if key is in the dictionary, else default.", @@ -8709,7 +10299,11 @@ "Classes": null, "Functions": null, "Id": 178640630, - "Name": "setdefault" + "Name": "setdefault", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "D.update([E, ]**F) -> None. Update D from dict/iterable E and F.\nIf E is present and has a .keys() method, then does: for k in E: D[k] = E[k]\nIf E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v\nIn either case, this is followed by: for k in F: D[k] = F[k]", @@ -8736,7 +10330,11 @@ "Classes": null, "Functions": null, "Id": -1901098080, - "Name": "update" + "Name": "update", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "D.values() -> an object providing a view on D's values", @@ -8757,7 +10355,11 @@ "Classes": null, "Functions": null, "Id": -1886064647, - "Name": "values" + "Name": "values", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -8765,23 +10367,36 @@ { "Value": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": null }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 24324173, - "Name": "dict" + "Name": "dict", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "set() -> new empty set object\nset(iterable) -> new set object\n\nBuild an unordered collection of unique elements.", @@ -8814,7 +10429,11 @@ "Classes": null, "Functions": null, "Id": -1638804448, - "Name": "__and__" + "Name": "__and__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "x.__contains__(y) <==> y in x.", @@ -8841,7 +10460,11 @@ "Classes": null, "Functions": null, "Id": -1841774666, - "Name": "__contains__" + "Name": "__contains__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -8868,7 +10491,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -8895,7 +10522,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -8922,7 +10553,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -8949,7 +10584,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self&=value.", @@ -8976,7 +10615,11 @@ "Classes": null, "Functions": null, "Id": 953999909, - "Name": "__iand__" + "Name": "__iand__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "set() -> new empty set object\nset(iterable) -> new set object\n\nBuild an unordered collection of unique elements.", @@ -9003,7 +10646,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -9024,7 +10671,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self|=value.", @@ -9051,7 +10702,11 @@ "Classes": null, "Functions": null, "Id": -1631373035, - "Name": "__ior__" + "Name": "__ior__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self-=value.", @@ -9078,7 +10733,11 @@ "Classes": null, "Functions": null, "Id": 970829902, - "Name": "__isub__" + "Name": "__isub__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -9099,7 +10758,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self^=value.", @@ -9126,7 +10789,11 @@ "Classes": null, "Functions": null, "Id": 975284137, - "Name": "__ixor__" + "Name": "__ixor__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -9153,7 +10820,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -9174,7 +10845,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self size of S in memory, in bytes", @@ -9426,7 +11137,11 @@ "Classes": null, "Functions": null, "Id": 1069167279, - "Name": "__sizeof__" + "Name": "__sizeof__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self-value.", @@ -9453,7 +11168,11 @@ "Classes": null, "Functions": null, "Id": -1621974455, - "Name": "__sub__" + "Name": "__sub__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -9480,7 +11199,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self^value.", @@ -9507,7 +11230,11 @@ "Classes": null, "Functions": null, "Id": -1617520220, - "Name": "__xor__" + "Name": "__xor__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Add an element to a set.\n\nThis has no effect if the element is already present.", @@ -9534,7 +11261,11 @@ "Classes": null, "Functions": null, "Id": 781610, - "Name": "add" + "Name": "add", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Remove all elements from this set.", @@ -9555,7 +11286,11 @@ "Classes": null, "Functions": null, "Id": 753216662, - "Name": "clear" + "Name": "clear", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a shallow copy of a set.", @@ -9576,7 +11311,11 @@ "Classes": null, "Functions": null, "Id": 24300556, - "Name": "copy" + "Name": "copy", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the difference of two or more sets as a new set.\n\n(i.e. all elements that are in this set but not the others.)", @@ -9603,7 +11342,11 @@ "Classes": null, "Functions": null, "Id": -946813804, - "Name": "difference" + "Name": "difference", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Remove all elements of another set from this set.", @@ -9630,7 +11373,11 @@ "Classes": null, "Functions": null, "Id": 2053694164, - "Name": "difference_update" + "Name": "difference_update", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Remove an element from a set if it is a member.\n\nIf the element is not a member, do nothing.", @@ -9657,7 +11404,11 @@ "Classes": null, "Functions": null, "Id": -1193668441, - "Name": "discard" + "Name": "discard", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the intersection of two sets as a new set.\n\n(i.e. all elements that are in both sets.)", @@ -9684,7 +11435,11 @@ "Classes": null, "Functions": null, "Id": 2011414560, - "Name": "intersection" + "Name": "intersection", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Update a set with the intersection of itself and another.", @@ -9711,7 +11466,11 @@ "Classes": null, "Functions": null, "Id": -1074130488, - "Name": "intersection_update" + "Name": "intersection_update", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if two sets have a null intersection.", @@ -9738,7 +11497,11 @@ "Classes": null, "Functions": null, "Id": 1041514301, - "Name": "isdisjoint" + "Name": "isdisjoint", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Report whether another set contains this set.", @@ -9765,7 +11528,11 @@ "Classes": null, "Functions": null, "Id": 2076857571, - "Name": "issubset" + "Name": "issubset", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Report whether this set contains another set.", @@ -9792,7 +11559,11 @@ "Classes": null, "Functions": null, "Id": -911398520, - "Name": "issuperset" + "Name": "issuperset", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Remove and return an arbitrary set element.\nRaises KeyError if the set is empty.", @@ -9813,7 +11584,11 @@ "Classes": null, "Functions": null, "Id": 796378, - "Name": "pop" + "Name": "pop", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Remove an element from a set; it must be a member.\n\nIf the element is not a member, raise a KeyError.", @@ -9840,7 +11615,11 @@ "Classes": null, "Functions": null, "Id": -1996862629, - "Name": "remove" + "Name": "remove", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the symmetric difference of two sets as a new set.\n\n(i.e. all elements that are in exactly one of the sets.)", @@ -9867,7 +11646,11 @@ "Classes": null, "Functions": null, "Id": 796556764, - "Name": "symmetric_difference" + "Name": "symmetric_difference", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Update a set with the symmetric difference of itself and another.", @@ -9894,7 +11677,11 @@ "Classes": null, "Functions": null, "Id": -81680244, - "Name": "symmetric_difference_update" + "Name": "symmetric_difference_update", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the union of sets as a new set.\n\n(i.e. all elements that are in either set.)", @@ -9921,7 +11708,11 @@ "Classes": null, "Functions": null, "Id": 769903896, - "Name": "union" + "Name": "union", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Update a set with the union of itself and others.", @@ -9948,7 +11739,11 @@ "Classes": null, "Functions": null, "Id": -1901098080, - "Name": "update" + "Name": "update", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -9956,23 +11751,36 @@ { "Value": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": null }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 798955, - "Name": "set" + "Name": "set", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "frozenset() -> empty frozenset object\nfrozenset(iterable) -> frozenset object\n\nBuild an immutable unordered collection of unique elements.", @@ -10005,7 +11813,11 @@ "Classes": null, "Functions": null, "Id": -1638804448, - "Name": "__and__" + "Name": "__and__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "x.__contains__(y) <==> y in x.", @@ -10032,7 +11844,11 @@ "Classes": null, "Functions": null, "Id": -1841774666, - "Name": "__contains__" + "Name": "__contains__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -10059,7 +11875,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -10086,7 +11906,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -10113,7 +11937,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -10140,7 +11968,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -10161,7 +11993,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "frozenset() -> empty frozenset object\nfrozenset(iterable) -> frozenset object\n\nBuild an immutable unordered collection of unique elements.", @@ -10188,7 +12024,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -10209,7 +12049,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -10230,7 +12074,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -10257,7 +12105,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -10278,7 +12130,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self size of S in memory, in bytes", @@ -10530,7 +12422,11 @@ "Classes": null, "Functions": null, "Id": 1069167279, - "Name": "__sizeof__" + "Name": "__sizeof__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self-value.", @@ -10557,7 +12453,11 @@ "Classes": null, "Functions": null, "Id": -1621974455, - "Name": "__sub__" + "Name": "__sub__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -10584,7 +12484,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self^value.", @@ -10611,7 +12515,11 @@ "Classes": null, "Functions": null, "Id": -1617520220, - "Name": "__xor__" + "Name": "__xor__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a shallow copy of a set.", @@ -10632,7 +12540,11 @@ "Classes": null, "Functions": null, "Id": 24300556, - "Name": "copy" + "Name": "copy", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the difference of two or more sets as a new set.\n\n(i.e. all elements that are in this set but not the others.)", @@ -10659,7 +12571,11 @@ "Classes": null, "Functions": null, "Id": -946813804, - "Name": "difference" + "Name": "difference", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the intersection of two sets as a new set.\n\n(i.e. all elements that are in both sets.)", @@ -10686,7 +12602,11 @@ "Classes": null, "Functions": null, "Id": 2011414560, - "Name": "intersection" + "Name": "intersection", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if two sets have a null intersection.", @@ -10713,7 +12633,11 @@ "Classes": null, "Functions": null, "Id": 1041514301, - "Name": "isdisjoint" + "Name": "isdisjoint", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Report whether another set contains this set.", @@ -10740,7 +12664,11 @@ "Classes": null, "Functions": null, "Id": 2076857571, - "Name": "issubset" + "Name": "issubset", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Report whether this set contains another set.", @@ -10767,7 +12695,11 @@ "Classes": null, "Functions": null, "Id": -911398520, - "Name": "issuperset" + "Name": "issuperset", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the symmetric difference of two sets as a new set.\n\n(i.e. all elements that are in exactly one of the sets.)", @@ -10794,7 +12726,11 @@ "Classes": null, "Functions": null, "Id": 796556764, - "Name": "symmetric_difference" + "Name": "symmetric_difference", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return the union of sets as a new set.\n\n(i.e. all elements that are in either set.)", @@ -10821,7 +12757,11 @@ "Classes": null, "Functions": null, "Id": 769903896, - "Name": "union" + "Name": "union", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -10829,18 +12769,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 233394059, - "Name": "frozenset" + "Name": "frozenset", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "bytes(iterable_of_ints) -> bytes\nbytes(string, encoding[, errors]) -> bytes\nbytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\nbytes(int) -> bytes object of size given by the parameter initialized with null bytes\nbytes() -> empty bytes object\n\nConstruct an immutable array of bytes from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - any object implementing the buffer API.\n - an integer", @@ -10873,7 +12825,11 @@ "Classes": null, "Functions": null, "Id": -1639102358, - "Name": "__add__" + "Name": "__add__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return key in self.", @@ -10900,7 +12856,11 @@ "Classes": null, "Functions": null, "Id": -1841774666, - "Name": "__contains__" + "Name": "__contains__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -10927,7 +12887,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -10954,7 +12918,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -10981,7 +12949,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self[key].", @@ -11008,7 +12980,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -11029,7 +13005,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -11056,7 +13036,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -11077,7 +13061,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "bytes(iterable_of_ints) -> bytes\nbytes(string, encoding[, errors]) -> bytes\nbytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\nbytes(int) -> bytes object of size given by the parameter initialized with null bytes\nbytes() -> empty bytes object\n\nConstruct an immutable array of bytes from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - any object implementing the buffer API.\n - an integer", @@ -11116,7 +13104,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -11137,7 +13129,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -11164,7 +13160,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -11185,7 +13185,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self copy of B\n\nReturn a copy of B with only its first character capitalized (ASCII)\nand the rest lower-cased.", @@ -11437,7 +13477,11 @@ "Classes": null, "Functions": null, "Id": -145846717, - "Name": "capitalize" + "Name": "capitalize", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.center(width[, fillchar]) -> copy of B\n\nReturn B centered in a string of length width. Padding is\ndone using the specified fill character (default is a space).", @@ -11470,7 +13514,11 @@ "Classes": null, "Functions": null, "Id": 1868701484, - "Name": "center" + "Name": "center", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.count(sub[, start[, end]]) -> int\n\nReturn the number of non-overlapping occurrences of subsection sub in\nbytes B[start:end]. Optional arguments start and end are interpreted\nas in slice notation.", @@ -11509,7 +13557,11 @@ "Classes": null, "Functions": null, "Id": 753321816, - "Name": "count" + "Name": "count", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Decode the bytes using the codec registered for encoding.\n\n encoding\n The encoding with which to decode the bytes.\n errors\n The error handling scheme to use for the handling of decoding errors.\n The default is 'strict' meaning that decoding errors raise a\n UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n as well as any other name registered with codecs.register_error that\n can handle UnicodeDecodeErrors.", @@ -11542,7 +13594,11 @@ "Classes": null, "Functions": null, "Id": 1896998085, - "Name": "decode" + "Name": "decode", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if B ends with the specified suffix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nsuffix can also be a tuple of bytes to try.", @@ -11581,7 +13637,11 @@ "Classes": null, "Functions": null, "Id": -1172635435, - "Name": "endswith" + "Name": "endswith", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.expandtabs(tabsize=8) -> copy of B\n\nReturn a copy of B where all tab characters are expanded using spaces.\nIf tabsize is not given, a tab size of 8 characters is assumed.", @@ -11608,7 +13668,11 @@ "Classes": null, "Functions": null, "Id": -2134490001, - "Name": "expandtabs" + "Name": "expandtabs", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", @@ -11647,7 +13711,11 @@ "Classes": null, "Functions": null, "Id": 24384080, - "Name": "find" + "Name": "find", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a bytes object from a string of hexadecimal numbers.\n\nSpaces between two numbers are accepted.\nExample: bytes.fromhex('B9 01EF') -> b'\\\\xb9\\\\x01\\\\xef'.", @@ -11680,7 +13748,11 @@ "Classes": null, "Functions": null, "Id": 835611450, - "Name": "fromhex" + "Name": "fromhex", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.hex() -> string\n\nCreate a string of hexadecimal numbers from a bytes object.\nExample: b'\\xb9\\x01\\xef'.hex() -> 'b901ef'.", @@ -11701,7 +13773,11 @@ "Classes": null, "Functions": null, "Id": 788388, - "Name": "hex" + "Name": "hex", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the subsection is not found.", @@ -11740,7 +13816,11 @@ "Classes": null, "Functions": null, "Id": 758816539, - "Name": "index" + "Name": "index", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isalnum() -> bool\n\nReturn True if all characters in B are alphanumeric\nand there is at least one character in B, False otherwise.", @@ -11761,7 +13841,11 @@ "Classes": null, "Functions": null, "Id": -781168486, - "Name": "isalnum" + "Name": "isalnum", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isalpha() -> bool\n\nReturn True if all characters in B are alphabetic\nand there is at least one character in B, False otherwise.", @@ -11782,7 +13866,11 @@ "Classes": null, "Functions": null, "Id": -781166979, - "Name": "isalpha" + "Name": "isalpha", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isascii() -> bool\n\nReturn True if B is empty or all characters in B are ASCII,\nFalse otherwise.", @@ -11803,7 +13891,11 @@ "Classes": null, "Functions": null, "Id": -780970896, - "Name": "isascii" + "Name": "isascii", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isdigit() -> bool\n\nReturn True if all characters in B are digits\nand there is at least one character in B, False otherwise.", @@ -11824,7 +13916,11 @@ "Classes": null, "Functions": null, "Id": -778494388, - "Name": "isdigit" + "Name": "isdigit", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.islower() -> bool\n\nReturn True if all cased characters in B are lowercase and there is\nat least one cased character in B, False otherwise.", @@ -11845,7 +13941,11 @@ "Classes": null, "Functions": null, "Id": -770912224, - "Name": "islower" + "Name": "islower", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isspace() -> bool\n\nReturn True if all characters in B are whitespace\nand there is at least one character in B, False otherwise.", @@ -11866,7 +13966,11 @@ "Classes": null, "Functions": null, "Id": -764439003, - "Name": "isspace" + "Name": "isspace", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.istitle() -> bool\n\nReturn True if B is a titlecased string and there is at least one\ncharacter in B, i.e. uppercase characters may only follow uncased\ncharacters and lowercase characters only cased ones. Return False\notherwise.", @@ -11887,7 +13991,11 @@ "Classes": null, "Functions": null, "Id": -763705481, - "Name": "istitle" + "Name": "istitle", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isupper() -> bool\n\nReturn True if all cased characters in B are uppercase and there is\nat least one cased character in B, False otherwise.", @@ -11908,7 +14016,11 @@ "Classes": null, "Functions": null, "Id": -762577471, - "Name": "isupper" + "Name": "isupper", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Concatenate any number of bytes objects.\n\nThe bytes whose method is called is inserted in between each pair.\n\nThe result is returned as a new bytes object.\n\nExample: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'.", @@ -11935,7 +14047,11 @@ "Classes": null, "Functions": null, "Id": 24508865, - "Name": "join" + "Name": "join", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.ljust(width[, fillchar]) -> copy of B\n\nReturn B left justified in a string of length width. Padding is\ndone using the specified fill character (default is a space).", @@ -11968,7 +14084,11 @@ "Classes": null, "Functions": null, "Id": 761484705, - "Name": "ljust" + "Name": "ljust", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.lower() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to lowercase.", @@ -11989,7 +14109,11 @@ "Classes": null, "Functions": null, "Id": 761635146, - "Name": "lower" + "Name": "lower", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Strip leading bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading ASCII whitespace.", @@ -12016,7 +14140,11 @@ "Classes": null, "Functions": null, "Id": 2139470083, - "Name": "lstrip" + "Name": "lstrip", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a translation table useable for the bytes or bytearray translate method.\n\nThe returned table will be one where each byte in frm is mapped to the byte at\nthe same position in to.\n\nThe bytes objects frm and to must be of the same length.", @@ -12049,7 +14177,11 @@ "Classes": null, "Functions": null, "Id": 1060805443, - "Name": "maketrans" + "Name": "maketrans", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original bytes\nobject and two empty bytes objects.", @@ -12076,7 +14208,11 @@ "Classes": null, "Functions": null, "Id": -2024653645, - "Name": "partition" + "Name": "partition", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy with all occurrences of substring old replaced by new.\n\n count\n Maximum number of occurrences to replace.\n -1 (the default value) means replace all occurrences.\n\nIf the optional argument count is given, only the first count occurrences are\nreplaced.", @@ -12115,7 +14251,11 @@ "Classes": null, "Functions": null, "Id": -1770538307, - "Name": "replace" + "Name": "replace", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", @@ -12154,7 +14294,11 @@ "Classes": null, "Functions": null, "Id": 766894964, - "Name": "rfind" + "Name": "rfind", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaise ValueError when the subsection is not found.", @@ -12193,7 +14337,11 @@ "Classes": null, "Functions": null, "Id": -1993149833, - "Name": "rindex" + "Name": "rindex", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.rjust(width[, fillchar]) -> copy of B\n\nReturn B right justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)", @@ -12226,7 +14374,11 @@ "Classes": null, "Functions": null, "Id": 767025831, - "Name": "rjust" + "Name": "rjust", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty bytes\nobjects and the original bytes object.", @@ -12253,7 +14405,11 @@ "Classes": null, "Functions": null, "Id": -1107721713, - "Name": "rpartition" + "Name": "rpartition", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a list of the sections in the bytes, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytes.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplitting is done starting at the end of the bytes and working to the front.", @@ -12286,7 +14442,11 @@ "Classes": null, "Functions": null, "Id": -1983847233, - "Name": "rsplit" + "Name": "rsplit", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Strip trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip trailing ASCII whitespace.", @@ -12313,7 +14473,11 @@ "Classes": null, "Functions": null, "Id": -1983722307, - "Name": "rstrip" + "Name": "rstrip", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a list of the sections in the bytes, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytes.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.", @@ -12346,7 +14510,11 @@ "Classes": null, "Functions": null, "Id": 768119139, - "Name": "split" + "Name": "split", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a list of the lines in the bytes, breaking at line boundaries.\n\nLine breaks are not included in the resulting list unless keepends is given and\ntrue.", @@ -12373,7 +14541,11 @@ "Classes": null, "Functions": null, "Id": 1291658108, - "Name": "splitlines" + "Name": "splitlines", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if B starts with the specified prefix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nprefix can also be a tuple of bytes to try.", @@ -12412,7 +14584,11 @@ "Classes": null, "Functions": null, "Id": 65206254, - "Name": "startswith" + "Name": "startswith", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Strip leading and trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading and trailing ASCII whitespace.", @@ -12439,7 +14615,11 @@ "Classes": null, "Functions": null, "Id": 768244065, - "Name": "strip" + "Name": "strip", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.swapcase() -> copy of B\n\nReturn a copy of B with uppercase ASCII characters converted\nto lowercase ASCII and vice versa.", @@ -12460,7 +14640,11 @@ "Classes": null, "Functions": null, "Id": 1060209754, - "Name": "swapcase" + "Name": "swapcase", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.title() -> copy of B\n\nReturn a titlecased version of B, i.e. ASCII words start with uppercase\ncharacters, all remaining cased characters have lowercase.", @@ -12481,7 +14665,11 @@ "Classes": null, "Functions": null, "Id": 768841889, - "Name": "title" + "Name": "title", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy with each character mapped by the given translation table.\n\n table\n Translation table, which must be a bytes object of length 256.\n\nAll characters occurring in the optional argument delete are removed.\nThe remaining characters are mapped through the given translation table.", @@ -12514,7 +14702,11 @@ "Classes": null, "Functions": null, "Id": 827988759, - "Name": "translate" + "Name": "translate", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.upper() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to uppercase.", @@ -12535,7 +14727,11 @@ "Classes": null, "Functions": null, "Id": 769969899, - "Name": "upper" + "Name": "upper", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.zfill(width) -> copy of B\n\nPad a numeric string B with zeros on the left, to fill a field\nof the specified width. B is never truncated.", @@ -12562,7 +14758,11 @@ "Classes": null, "Functions": null, "Id": 774283078, - "Name": "zfill" + "Name": "zfill", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -12570,18 +14770,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 752694964, - "Name": "bytes" + "Name": "bytes", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -12614,7 +14826,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -12647,7 +14863,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -12668,7 +14888,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -12689,7 +14913,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Private method returning an estimate of len(list(it)).", @@ -12710,7 +14938,11 @@ "Classes": null, "Functions": null, "Id": 358836041, - "Name": "__length_hint__" + "Name": "__length_hint__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement next(self).", @@ -12731,7 +14963,11 @@ "Classes": null, "Functions": null, "Id": 1101153034, - "Name": "__next__" + "Name": "__next__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return state information for pickling.", @@ -12752,7 +14988,11 @@ "Classes": null, "Functions": null, "Id": -544113923, - "Name": "__reduce__" + "Name": "__reduce__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Set state information for unpickling.", @@ -12779,7 +15019,11 @@ "Classes": null, "Functions": null, "Id": 1719806726, - "Name": "__setstate__" + "Name": "__setstate__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -12806,7 +15050,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -12814,18 +15062,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": -1994109543, - "Name": "bytes_iterator" + "Name": "bytes_iterator", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.", @@ -12858,7 +15118,11 @@ "Classes": null, "Functions": null, "Id": -1639102358, - "Name": "__add__" + "Name": "__add__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return key in self.", @@ -12885,7 +15149,11 @@ "Classes": null, "Functions": null, "Id": -1841774666, - "Name": "__contains__" + "Name": "__contains__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -12912,7 +15180,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a formatted version of the string as described by format_spec.", @@ -12939,7 +15211,11 @@ "Classes": null, "Functions": null, "Id": 695475534, - "Name": "__format__" + "Name": "__format__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -12966,7 +15242,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -12993,7 +15273,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self[key].", @@ -13020,7 +15304,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -13041,7 +15329,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -13068,7 +15360,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -13089,7 +15385,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.", @@ -13128,7 +15428,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -13149,7 +15453,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -13176,7 +15484,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -13197,7 +15509,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self int\n\nReturn the number of non-overlapping occurrences of substring sub in\nstring S[start:end]. Optional arguments start and end are\ninterpreted as in slice notation.", @@ -13563,7 +15931,11 @@ "Classes": null, "Functions": null, "Id": 753321816, - "Name": "count" + "Name": "count", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Encode the string using the codec registered for encoding.\n\n encoding\n The encoding in which to encode the string.\n errors\n The error handling scheme to use for encoding errors.\n The default is 'strict' meaning that encoding errors raise a\n UnicodeEncodeError. Other possible values are 'ignore', 'replace' and\n 'xmlcharrefreplace' as well as any other name registered with\n codecs.register_error that can handle UnicodeEncodeErrors.", @@ -13596,7 +15968,11 @@ "Classes": null, "Functions": null, "Id": 1933938925, - "Name": "encode" + "Name": "encode", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "S.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if S ends with the specified suffix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nsuffix can also be a tuple of strings to try.", @@ -13635,7 +16011,11 @@ "Classes": null, "Functions": null, "Id": -1172635435, - "Name": "endswith" + "Name": "endswith", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy where all tab characters are expanded using spaces.\n\nIf tabsize is not given, a tab size of 8 characters is assumed.", @@ -13662,7 +16042,11 @@ "Classes": null, "Functions": null, "Id": -2134490001, - "Name": "expandtabs" + "Name": "expandtabs", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "S.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", @@ -13701,7 +16085,11 @@ "Classes": null, "Functions": null, "Id": 24384080, - "Name": "find" + "Name": "find", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "S.format(*args, **kwargs) -> str\n\nReturn a formatted version of S, using substitutions from args and kwargs.\nThe substitutions are identified by braces ('{' and '}').", @@ -13734,7 +16122,11 @@ "Classes": null, "Functions": null, "Id": 1963936462, - "Name": "format" + "Name": "format", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "S.format_map(mapping) -> str\n\nReturn a formatted version of S, using substitutions from mapping.\nThe substitutions are identified by braces ('{' and '}').", @@ -13761,7 +16153,11 @@ "Classes": null, "Functions": null, "Id": 1943930987, - "Name": "format_map" + "Name": "format_map", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "S.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found, \nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found.", @@ -13800,7 +16196,11 @@ "Classes": null, "Functions": null, "Id": 758816539, - "Name": "index" + "Name": "index", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the string is an alpha-numeric string, False otherwise.\n\nA string is alpha-numeric if all characters in the string are alpha-numeric and\nthere is at least one character in the string.", @@ -13821,7 +16221,11 @@ "Classes": null, "Functions": null, "Id": -781168486, - "Name": "isalnum" + "Name": "isalnum", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the string is an alphabetic string, False otherwise.\n\nA string is alphabetic if all characters in the string are alphabetic and there\nis at least one character in the string.", @@ -13842,7 +16246,11 @@ "Classes": null, "Functions": null, "Id": -781166979, - "Name": "isalpha" + "Name": "isalpha", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if all characters in the string are ASCII, False otherwise.\n\nASCII characters have code points in the range U+0000-U+007F.\nEmpty string is ASCII too.", @@ -13863,7 +16271,11 @@ "Classes": null, "Functions": null, "Id": -780970896, - "Name": "isascii" + "Name": "isascii", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the string is a decimal string, False otherwise.\n\nA string is a decimal string if all characters in the string are decimal and\nthere is at least one character in the string.", @@ -13884,7 +16296,11 @@ "Classes": null, "Functions": null, "Id": -927011664, - "Name": "isdecimal" + "Name": "isdecimal", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the string is a digit string, False otherwise.\n\nA string is a digit string if all characters in the string are digits and there\nis at least one character in the string.", @@ -13905,7 +16321,11 @@ "Classes": null, "Functions": null, "Id": -778494388, - "Name": "isdigit" + "Name": "isdigit", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the string is a valid Python identifier, False otherwise.\n\nUse keyword.iskeyword() to test for reserved identifiers such as \"def\" and\n\"class\".", @@ -13926,7 +16346,11 @@ "Classes": null, "Functions": null, "Id": 401040106, - "Name": "isidentifier" + "Name": "isidentifier", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the string is a lowercase string, False otherwise.\n\nA string is lowercase if all cased characters in the string are lowercase and\nthere is at least one cased character in the string.", @@ -13947,7 +16371,11 @@ "Classes": null, "Functions": null, "Id": -770912224, - "Name": "islower" + "Name": "islower", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the string is a numeric string, False otherwise.\n\nA string is numeric if all characters in the string are numeric and there is at\nleast one character in the string.", @@ -13968,7 +16396,11 @@ "Classes": null, "Functions": null, "Id": -174721940, - "Name": "isnumeric" + "Name": "isnumeric", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the string is printable, False otherwise.\n\nA string is printable if all of its characters are considered printable in\nrepr() or if it is empty.", @@ -13989,7 +16421,11 @@ "Classes": null, "Functions": null, "Id": 346760998, - "Name": "isprintable" + "Name": "isprintable", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the string is a whitespace string, False otherwise.\n\nA string is whitespace if all characters in the string are whitespace and there\nis at least one character in the string.", @@ -14010,7 +16446,11 @@ "Classes": null, "Functions": null, "Id": -764439003, - "Name": "isspace" + "Name": "isspace", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the string is a title-cased string, False otherwise.\n\nIn a title-cased string, upper- and title-case characters may only\nfollow uncased characters and lowercase characters only cased ones.", @@ -14031,7 +16471,11 @@ "Classes": null, "Functions": null, "Id": -763705481, - "Name": "istitle" + "Name": "istitle", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return True if the string is an uppercase string, False otherwise.\n\nA string is uppercase if all cased characters in the string are uppercase and\nthere is at least one cased character in the string.", @@ -14052,7 +16496,11 @@ "Classes": null, "Functions": null, "Id": -762577471, - "Name": "isupper" + "Name": "isupper", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Concatenate any number of strings.\n\nThe string whose method is called is inserted in between each given string.\nThe result is returned as a new string.\n\nExample: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'", @@ -14079,7 +16527,11 @@ "Classes": null, "Functions": null, "Id": 24508865, - "Name": "join" + "Name": "join", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a left-justified string of length width.\n\nPadding is done using the specified fill character (default is a space).", @@ -14112,7 +16564,11 @@ "Classes": null, "Functions": null, "Id": 761484705, - "Name": "ljust" + "Name": "ljust", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy of the string converted to lowercase.", @@ -14133,7 +16589,11 @@ "Classes": null, "Functions": null, "Id": 761635146, - "Name": "lower" + "Name": "lower", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy of the string with leading whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead.", @@ -14160,7 +16620,11 @@ "Classes": null, "Functions": null, "Id": 2139470083, - "Name": "lstrip" + "Name": "lstrip", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a translation table usable for str.translate().\n\nIf there is only one argument, it must be a dictionary mapping Unicode\nordinals (integers) or characters to Unicode ordinals, strings or None.\nCharacter keys will be then converted to ordinals.\nIf there are two arguments, they must be strings of equal length, and\nin the resulting dictionary, each character in x will be mapped to the\ncharacter at the same position in y. If there is a third argument, it\nmust be a string, whose characters will be mapped to None in the result.", @@ -14199,7 +16663,11 @@ "Classes": null, "Functions": null, "Id": 1060805443, - "Name": "maketrans" + "Name": "maketrans", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original string\nand two empty strings.", @@ -14226,7 +16694,11 @@ "Classes": null, "Functions": null, "Id": -2024653645, - "Name": "partition" + "Name": "partition", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy with all occurrences of substring old replaced by new.\n\n count\n Maximum number of occurrences to replace.\n -1 (the default value) means replace all occurrences.\n\nIf the optional argument count is given, only the first count occurrences are\nreplaced.", @@ -14265,7 +16737,11 @@ "Classes": null, "Functions": null, "Id": -1770538307, - "Name": "replace" + "Name": "replace", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "S.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", @@ -14304,7 +16780,11 @@ "Classes": null, "Functions": null, "Id": 766894964, - "Name": "rfind" + "Name": "rfind", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "S.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found.", @@ -14343,7 +16823,11 @@ "Classes": null, "Functions": null, "Id": -1993149833, - "Name": "rindex" + "Name": "rindex", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a right-justified string of length width.\n\nPadding is done using the specified fill character (default is a space).", @@ -14376,7 +16860,11 @@ "Classes": null, "Functions": null, "Id": 767025831, - "Name": "rjust" + "Name": "rjust", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty strings\nand the original string.", @@ -14403,7 +16891,11 @@ "Classes": null, "Functions": null, "Id": -1107721713, - "Name": "rpartition" + "Name": "rpartition", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a list of the words in the string, using sep as the delimiter string.\n\n sep\n The delimiter according which to split the string.\n None (the default value) means split according to any whitespace,\n and discard empty strings from the result.\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplits are done starting at the end of the string and working to the front.", @@ -14436,7 +16928,11 @@ "Classes": null, "Functions": null, "Id": -1983847233, - "Name": "rsplit" + "Name": "rsplit", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy of the string with trailing whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead.", @@ -14463,7 +16959,11 @@ "Classes": null, "Functions": null, "Id": -1983722307, - "Name": "rstrip" + "Name": "rstrip", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a list of the words in the string, using sep as the delimiter string.\n\n sep\n The delimiter according which to split the string.\n None (the default value) means split according to any whitespace,\n and discard empty strings from the result.\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.", @@ -14496,7 +16996,11 @@ "Classes": null, "Functions": null, "Id": 768119139, - "Name": "split" + "Name": "split", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a list of the lines in the string, breaking at line boundaries.\n\nLine breaks are not included in the resulting list unless keepends is given and\ntrue.", @@ -14523,7 +17027,11 @@ "Classes": null, "Functions": null, "Id": 1291658108, - "Name": "splitlines" + "Name": "splitlines", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "S.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if S starts with the specified prefix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nprefix can also be a tuple of strings to try.", @@ -14562,7 +17070,11 @@ "Classes": null, "Functions": null, "Id": 65206254, - "Name": "startswith" + "Name": "startswith", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy of the string with leading and trailing whitespace remove.\n\nIf chars is given and not None, remove characters in chars instead.", @@ -14589,7 +17101,11 @@ "Classes": null, "Functions": null, "Id": 768244065, - "Name": "strip" + "Name": "strip", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Convert uppercase characters to lowercase and lowercase characters to uppercase.", @@ -14610,7 +17126,11 @@ "Classes": null, "Functions": null, "Id": 1060209754, - "Name": "swapcase" + "Name": "swapcase", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a version of the string where each word is titlecased.\n\nMore specifically, words start with uppercased characters and all remaining\ncased characters have lower case.", @@ -14631,7 +17151,11 @@ "Classes": null, "Functions": null, "Id": 768841889, - "Name": "title" + "Name": "title", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Replace each character in the string using the given translation table.\n\n table\n Translation table, which must be a mapping of Unicode ordinals to\n Unicode ordinals, strings, or None.\n\nThe table must implement lookup/indexing via __getitem__, for instance a\ndictionary or list. If this operation raises LookupError, the character is\nleft untouched. Characters mapped to None are deleted.", @@ -14658,7 +17182,11 @@ "Classes": null, "Functions": null, "Id": 827988759, - "Name": "translate" + "Name": "translate", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy of the string converted to uppercase.", @@ -14679,7 +17207,11 @@ "Classes": null, "Functions": null, "Id": 769969899, - "Name": "upper" + "Name": "upper", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Pad a numeric string with zeros on the left, to fill a field of the given width.\n\nThe string is never truncated.", @@ -14706,7 +17238,11 @@ "Classes": null, "Functions": null, "Id": 774283078, - "Name": "zfill" + "Name": "zfill", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -14714,18 +17250,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 799418, - "Name": "str" + "Name": "str", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -14758,7 +17306,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -14791,7 +17343,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -14812,7 +17368,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -14833,7 +17393,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Private method returning an estimate of len(list(it)).", @@ -14854,7 +17418,11 @@ "Classes": null, "Functions": null, "Id": 358836041, - "Name": "__length_hint__" + "Name": "__length_hint__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement next(self).", @@ -14875,7 +17443,11 @@ "Classes": null, "Functions": null, "Id": 1101153034, - "Name": "__next__" + "Name": "__next__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return state information for pickling.", @@ -14896,7 +17468,11 @@ "Classes": null, "Functions": null, "Id": -544113923, - "Name": "__reduce__" + "Name": "__reduce__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Set state information for unpickling.", @@ -14923,7 +17499,11 @@ "Classes": null, "Functions": null, "Id": 1719806726, - "Name": "__setstate__" + "Name": "__setstate__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -14950,7 +17530,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -14958,18 +17542,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 1858697299, - "Name": "str_iterator" + "Name": "str_iterator", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a module object.\n\nThe name must be a string; the optional doc argument can have any type.", @@ -15002,7 +17598,11 @@ "Classes": null, "Functions": null, "Id": 2095540485, - "Name": "__delattr__" + "Name": "__delattr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "__dir__() -> list\nspecialized dir() implementation", @@ -15023,7 +17623,11 @@ "Classes": null, "Functions": null, "Id": -1636169386, - "Name": "__dir__" + "Name": "__dir__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -15050,7 +17654,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a module object.\n\nThe name must be a string; the optional doc argument can have any type.", @@ -15083,7 +17691,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -15104,7 +17716,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return repr(self).", @@ -15125,7 +17741,11 @@ "Classes": null, "Functions": null, "Id": 1215429388, - "Name": "__repr__" + "Name": "__repr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement setattr(self, name, value).", @@ -15158,7 +17778,11 @@ "Classes": null, "Functions": null, "Id": -736377828, - "Name": "__setattr__" + "Name": "__setattr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -15185,7 +17809,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -15193,18 +17821,27 @@ { "Value": "i:dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": null }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": -2131035837, - "Name": "module" + "Name": "module", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a function object.\n\n code\n a code object\n globals\n the globals dictionary\n name\n a string that overrides the name from the code object\n argdefs\n a tuple that specifies the default argument values\n closure\n a tuple that supplies the bindings for free variables", @@ -15243,7 +17880,11 @@ "Classes": null, "Functions": null, "Id": 782173109, - "Name": "__call__" + "Name": "__call__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return an attribute of instance, which is of type owner.", @@ -15276,7 +17917,11 @@ "Classes": null, "Functions": null, "Id": -1633516065, - "Name": "__get__" + "Name": "__get__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a function object.\n\n code\n a code object\n globals\n the globals dictionary\n name\n a string that overrides the name from the code object\n argdefs\n a tuple that specifies the default argument values\n closure\n a tuple that supplies the bindings for free variables", @@ -15309,7 +17954,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -15330,7 +17979,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return repr(self).", @@ -15351,7 +18004,11 @@ "Classes": null, "Functions": null, "Id": 1215429388, - "Name": "__repr__" + "Name": "__repr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -15378,7 +18035,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [ @@ -15387,70 +18048,105 @@ "ReturnType": "i:dict", "Attributes": 0, "Id": 1058045229, - "Name": "__annotations__" + "Name": "__annotations__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 2101485316, - "Name": "__closure__" + "Name": "__closure__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": "i:object", "Attributes": 0, "Id": 794857348, - "Name": "__code__" + "Name": "__code__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": -1308361943, - "Name": "__defaults__" + "Name": "__defaults__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": "i:dict", "Attributes": 0, "Id": -1338696519, - "Name": "__globals__" + "Name": "__globals__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": -56184875, - "Name": "__kwdefaults__" + "Name": "__kwdefaults__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Fields": [ { "Value": "i:dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": null }, { "Value": null, "Id": 1097116834, - "Name": "__name__" + "Name": "__name__", + "IndexSpan": null }, { "Value": null, "Id": -1879833807, - "Name": "__qualname__" + "Name": "__qualname__", + "IndexSpan": null }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": -1535808273, - "Name": "function" + "Name": "function", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -15489,7 +18185,11 @@ "Classes": null, "Functions": null, "Id": 782173109, - "Name": "__call__" + "Name": "__call__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return an attribute of instance, which is of type owner.", @@ -15522,7 +18222,11 @@ "Classes": null, "Functions": null, "Id": -1633516065, - "Name": "__get__" + "Name": "__get__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -15549,7 +18253,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -15570,7 +18278,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -15591,7 +18303,11 @@ "Classes": null, "Functions": null, "Id": -544113923, - "Name": "__reduce__" + "Name": "__reduce__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return repr(self).", @@ -15612,7 +18328,11 @@ "Classes": null, "Functions": null, "Id": 1215429388, - "Name": "__repr__" + "Name": "__repr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -15639,7 +18359,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [ @@ -15648,40 +18372,59 @@ "ReturnType": null, "Attributes": 0, "Id": 1840816120, - "Name": "__objclass__" + "Name": "__objclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Fields": [ { "Value": null, "Id": 1097116834, - "Name": "__name__" + "Name": "__name__", + "IndexSpan": null }, { "Value": null, "Id": -1879833807, - "Name": "__qualname__" + "Name": "__qualname__", + "IndexSpan": null }, { "Value": null, "Id": 174109373, - "Name": "__text_signature__" + "Name": "__text_signature__", + "IndexSpan": null }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": -98573582, - "Name": "wrapper_descriptor" + "Name": "wrapper_descriptor", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -15720,7 +18463,11 @@ "Classes": null, "Functions": null, "Id": 782173109, - "Name": "__call__" + "Name": "__call__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -15747,7 +18494,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -15774,7 +18525,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -15801,7 +18556,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -15828,7 +18587,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -15849,7 +18612,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -15870,7 +18637,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -15897,7 +18668,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self raise GeneratorExit inside generator.", @@ -16281,7 +19127,11 @@ "Classes": null, "Functions": null, "Id": 753226817, - "Name": "close" + "Name": "close", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.", @@ -16308,7 +19158,11 @@ "Classes": null, "Functions": null, "Id": 24767519, - "Name": "send" + "Name": "send", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.", @@ -16347,7 +19201,11 @@ "Classes": null, "Functions": null, "Id": 768810287, - "Name": "throw" + "Name": "throw", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [ @@ -16356,56 +19214,86 @@ "ReturnType": null, "Attributes": 0, "Id": 1450385203, - "Name": "gi_code" + "Name": "gi_code", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 2015125735, - "Name": "gi_frame" + "Name": "gi_frame", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 1663620793, - "Name": "gi_running" + "Name": "gi_running", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": -1949084879, - "Name": "gi_yieldfrom" + "Name": "gi_yieldfrom", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Fields": [ { "Value": null, "Id": 1097116834, - "Name": "__name__" + "Name": "__name__", + "IndexSpan": null }, { "Value": null, "Id": -1879833807, - "Name": "__qualname__" + "Name": "__qualname__", + "IndexSpan": null }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 62112924, - "Name": "generator" + "Name": "generator", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Property attribute.\n\n fget\n function to be used for getting an attribute value\n fset\n function to be used for setting an attribute value\n fdel\n function to be used for del'ing an attribute\n doc\n docstring\n\nTypical use is to define a managed attribute x:\n\nclass C(object):\n def getx(self): return self._x\n def setx(self, value): self._x = value\n def delx(self): del self._x\n x = property(getx, setx, delx, \"I'm the 'x' property.\")\n\nDecorators make defining new properties or modifying existing ones easy:\n\nclass C(object):\n @property\n def x(self):\n \"I am the 'x' property.\"\n return self._x\n @x.setter\n def x(self, value):\n self._x = value\n @x.deleter\n def x(self):\n del self._x", @@ -16438,7 +19326,11 @@ "Classes": null, "Functions": null, "Id": 1041108482, - "Name": "__delete__" + "Name": "__delete__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return an attribute of instance, which is of type owner.", @@ -16471,7 +19363,11 @@ "Classes": null, "Functions": null, "Id": -1633516065, - "Name": "__get__" + "Name": "__get__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -16498,7 +19394,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Property attribute.\n\n fget\n function to be used for getting an attribute value\n fset\n function to be used for setting an attribute value\n fdel\n function to be used for del'ing an attribute\n doc\n docstring\n\nTypical use is to define a managed attribute x:\n\nclass C(object):\n def getx(self): return self._x\n def setx(self, value): self._x = value\n def delx(self): del self._x\n x = property(getx, setx, delx, \"I'm the 'x' property.\")\n\nDecorators make defining new properties or modifying existing ones easy:\n\nclass C(object):\n @property\n def x(self):\n \"I am the 'x' property.\"\n return self._x\n @x.setter\n def x(self, value):\n self._x = value\n @x.deleter\n def x(self):\n del self._x", @@ -16531,7 +19431,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -16552,7 +19456,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Set an attribute of instance to value.", @@ -16585,7 +19493,11 @@ "Classes": null, "Functions": null, "Id": -1622433813, - "Name": "__set__" + "Name": "__set__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -16612,7 +19524,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Descriptor to change the deleter on a property.", @@ -16639,7 +19555,11 @@ "Classes": null, "Functions": null, "Id": -1314572240, - "Name": "deleter" + "Name": "deleter", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Descriptor to change the getter on a property.", @@ -16666,7 +19586,11 @@ "Classes": null, "Functions": null, "Id": 1983396834, - "Name": "getter" + "Name": "getter", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Descriptor to change the setter on a property.", @@ -16693,7 +19617,11 @@ "Classes": null, "Functions": null, "Id": -1968020650, - "Name": "setter" + "Name": "setter", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [ @@ -16702,46 +19630,74 @@ "ReturnType": null, "Attributes": 0, "Id": 305214020, - "Name": "__isabstractmethod__" + "Name": "__isabstractmethod__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 24379004, - "Name": "fdel" + "Name": "fdel", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 24381895, - "Name": "fget" + "Name": "fget", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 24393427, - "Name": "fset" + "Name": "fset", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Fields": [ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 385079020, - "Name": "property" + "Name": "property", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "classmethod(function) -> method\n\nConvert a function to be a class method.\n\nA class method receives the class as implicit first argument,\njust like an instance method receives the instance.\nTo declare a class method, use this idiom:\n\n class C:\n @classmethod\n def f(cls, arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\nIf a class method is called for a derived class, the derived class\nobject is passed as the implied first argument.\n\nClass methods are different than C++ or Java static methods.\nIf you want those, see the staticmethod builtin.", @@ -16780,7 +19736,11 @@ "Classes": null, "Functions": null, "Id": -1633516065, - "Name": "__get__" + "Name": "__get__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "classmethod(function) -> method\n\nConvert a function to be a class method.\n\nA class method receives the class as implicit first argument,\njust like an instance method receives the instance.\nTo declare a class method, use this idiom:\n\n class C:\n @classmethod\n def f(cls, arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\nIf a class method is called for a derived class, the derived class\nobject is passed as the implied first argument.\n\nClass methods are different than C++ or Java static methods.\nIf you want those, see the staticmethod builtin.", @@ -16807,7 +19767,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -16828,7 +19792,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -16855,7 +19823,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [ @@ -16864,32 +19836,49 @@ "ReturnType": null, "Attributes": 0, "Id": 886581915, - "Name": "__func__" + "Name": "__func__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 305214020, - "Name": "__isabstractmethod__" + "Name": "__isabstractmethod__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Fields": [ { "Value": "i:dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": null }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": -1347789854, - "Name": "classmethod" + "Name": "classmethod", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "staticmethod(function) -> method\n\nConvert a function to be a static method.\n\nA static method does not receive an implicit first argument.\nTo declare a static method, use this idiom:\n\n class C:\n @staticmethod\n def f(arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\n\nStatic methods in Python are similar to those found in Java or C++.\nFor a more advanced concept, see the classmethod builtin.", @@ -16928,7 +19917,11 @@ "Classes": null, "Functions": null, "Id": -1633516065, - "Name": "__get__" + "Name": "__get__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "staticmethod(function) -> method\n\nConvert a function to be a static method.\n\nA static method does not receive an implicit first argument.\nTo declare a static method, use this idiom:\n\n class C:\n @staticmethod\n def f(arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\n\nStatic methods in Python are similar to those found in Java or C++.\nFor a more advanced concept, see the classmethod builtin.", @@ -16955,7 +19948,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -16976,7 +19973,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -17003,7 +20004,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [ @@ -17012,32 +20017,49 @@ "ReturnType": null, "Attributes": 0, "Id": 886581915, - "Name": "__func__" + "Name": "__func__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 305214020, - "Name": "__isabstractmethod__" + "Name": "__isabstractmethod__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Fields": [ { "Value": "i:dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": null }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": -382457242, - "Name": "staticmethod" + "Name": "staticmethod", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -17070,7 +20092,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -17103,7 +20129,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -17124,7 +20154,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -17145,7 +20179,11 @@ "Classes": null, "Functions": null, "Id": -544113923, - "Name": "__reduce__" + "Name": "__reduce__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return repr(self).", @@ -17166,7 +20204,11 @@ "Classes": null, "Functions": null, "Id": 1215429388, - "Name": "__repr__" + "Name": "__repr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -17193,7 +20235,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -17201,18 +20247,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 1566923240, - "Name": "ellipsis" + "Name": "ellipsis", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -17245,7 +20303,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -17278,7 +20340,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -17299,7 +20365,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -17320,7 +20390,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Private method returning an estimate of len(list(it)).", @@ -17341,7 +20415,11 @@ "Classes": null, "Functions": null, "Id": 358836041, - "Name": "__length_hint__" + "Name": "__length_hint__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement next(self).", @@ -17362,7 +20440,11 @@ "Classes": null, "Functions": null, "Id": 1101153034, - "Name": "__next__" + "Name": "__next__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return state information for pickling.", @@ -17383,7 +20465,11 @@ "Classes": null, "Functions": null, "Id": -544113923, - "Name": "__reduce__" + "Name": "__reduce__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Set state information for unpickling.", @@ -17410,7 +20496,11 @@ "Classes": null, "Functions": null, "Id": 1719806726, - "Name": "__setstate__" + "Name": "__setstate__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -17437,7 +20527,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -17445,18 +20539,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 1210482396, - "Name": "tuple_iterator" + "Name": "tuple_iterator", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -17489,7 +20595,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -17522,7 +20632,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -17543,7 +20657,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -17564,7 +20682,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Private method returning an estimate of len(list(it)).", @@ -17585,7 +20707,11 @@ "Classes": null, "Functions": null, "Id": 358836041, - "Name": "__length_hint__" + "Name": "__length_hint__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement next(self).", @@ -17606,7 +20732,11 @@ "Classes": null, "Functions": null, "Id": 1101153034, - "Name": "__next__" + "Name": "__next__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return state information for pickling.", @@ -17627,7 +20757,11 @@ "Classes": null, "Functions": null, "Id": -544113923, - "Name": "__reduce__" + "Name": "__reduce__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Set state information for unpickling.", @@ -17654,7 +20788,11 @@ "Classes": null, "Functions": null, "Id": 1719806726, - "Name": "__setstate__" + "Name": "__setstate__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -17681,7 +20819,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -17689,18 +20831,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": -235571144, - "Name": "list_iterator" + "Name": "list_iterator", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -17733,7 +20887,11 @@ "Classes": null, "Functions": null, "Id": -1638804448, - "Name": "__and__" + "Name": "__and__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return key in self.", @@ -17760,7 +20918,11 @@ "Classes": null, "Functions": null, "Id": -1841774666, - "Name": "__contains__" + "Name": "__contains__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -17787,7 +20949,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -17814,7 +20980,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -17841,7 +21011,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -17868,7 +21042,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -17901,7 +21079,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -17922,7 +21104,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -17943,7 +21129,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -17970,7 +21160,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -17991,7 +21185,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self=value.", @@ -18643,7 +21954,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -18670,7 +21985,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -18697,7 +22016,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -18730,7 +22053,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -18751,7 +22078,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -18772,7 +22103,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -18799,7 +22134,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -18820,7 +22159,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self bytearray\nbytearray(string, encoding[, errors]) -> bytearray\nbytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer\nbytearray(int) -> bytes array of size given by the parameter initialized with null bytes\nbytearray() -> empty bytes array\n\nConstruct a mutable bytearray object from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - a bytes or a buffer object\n - any object implementing the buffer API.\n - an integer", @@ -27017,7 +32065,11 @@ "Classes": null, "Functions": null, "Id": -1639102358, - "Name": "__add__" + "Name": "__add__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.__alloc__() -> int\n\nReturn the number of bytes actually allocated.", @@ -27038,7 +32090,11 @@ "Classes": null, "Functions": null, "Id": 1312536510, - "Name": "__alloc__" + "Name": "__alloc__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return key in self.", @@ -27065,7 +32121,11 @@ "Classes": null, "Functions": null, "Id": -1841774666, - "Name": "__contains__" + "Name": "__contains__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Delete self[key].", @@ -27092,7 +32152,11 @@ "Classes": null, "Functions": null, "Id": -1970845273, - "Name": "__delitem__" + "Name": "__delitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -27119,7 +32183,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -27146,7 +32214,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -27173,7 +32245,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self[key].", @@ -27200,7 +32276,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -27227,7 +32307,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement self+=value.", @@ -27254,7 +32338,11 @@ "Classes": null, "Functions": null, "Id": 953701999, - "Name": "__iadd__" + "Name": "__iadd__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement self*=value.", @@ -27281,7 +32369,11 @@ "Classes": null, "Functions": null, "Id": 965298386, - "Name": "__imul__" + "Name": "__imul__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "bytearray(iterable_of_ints) -> bytearray\nbytearray(string, encoding[, errors]) -> bytearray\nbytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer\nbytearray(int) -> bytes array of size given by the parameter initialized with null bytes\nbytearray() -> empty bytes array\n\nConstruct a mutable bytearray object from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - a bytes or a buffer object\n - any object implementing the buffer API.\n - an integer", @@ -27320,7 +32412,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -27341,7 +32437,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -27362,7 +32462,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -27389,7 +32493,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -27410,7 +32518,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self copy of B\n\nReturn a copy of B with only its first character capitalized (ASCII)\nand the rest lower-cased.", @@ -27791,7 +32959,11 @@ "Classes": null, "Functions": null, "Id": -145846717, - "Name": "capitalize" + "Name": "capitalize", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.center(width[, fillchar]) -> copy of B\n\nReturn B centered in a string of length width. Padding is\ndone using the specified fill character (default is a space).", @@ -27812,7 +32984,11 @@ "Classes": null, "Functions": null, "Id": 1868701484, - "Name": "center" + "Name": "center", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Remove all items from the bytearray.", @@ -27833,7 +33009,11 @@ "Classes": null, "Functions": null, "Id": 753216662, - "Name": "clear" + "Name": "clear", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy of B.", @@ -27854,7 +33034,11 @@ "Classes": null, "Functions": null, "Id": 24300556, - "Name": "copy" + "Name": "copy", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.count(sub[, start[, end]]) -> int\n\nReturn the number of non-overlapping occurrences of subsection sub in\nbytes B[start:end]. Optional arguments start and end are interpreted\nas in slice notation.", @@ -27881,7 +33065,11 @@ "Classes": null, "Functions": null, "Id": 753321816, - "Name": "count" + "Name": "count", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Decode the bytearray using the codec registered for encoding.\n\n encoding\n The encoding with which to decode the bytearray.\n errors\n The error handling scheme to use for the handling of decoding errors.\n The default is 'strict' meaning that decoding errors raise a\n UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n as well as any other name registered with codecs.register_error that\n can handle UnicodeDecodeErrors.", @@ -27914,7 +33102,11 @@ "Classes": null, "Functions": null, "Id": 1896998085, - "Name": "decode" + "Name": "decode", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if B ends with the specified suffix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nsuffix can also be a tuple of bytes to try.", @@ -27953,7 +33145,11 @@ "Classes": null, "Functions": null, "Id": -1172635435, - "Name": "endswith" + "Name": "endswith", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.expandtabs(tabsize=8) -> copy of B\n\nReturn a copy of B where all tab characters are expanded using spaces.\nIf tabsize is not given, a tab size of 8 characters is assumed.", @@ -27980,7 +33176,11 @@ "Classes": null, "Functions": null, "Id": -2134490001, - "Name": "expandtabs" + "Name": "expandtabs", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Append all the items from the iterator or sequence to the end of the bytearray.\n\n iterable_of_ints\n The iterable of items to append.", @@ -28007,7 +33207,11 @@ "Classes": null, "Functions": null, "Id": 1943671281, - "Name": "extend" + "Name": "extend", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", @@ -28046,7 +33250,11 @@ "Classes": null, "Functions": null, "Id": 24384080, - "Name": "find" + "Name": "find", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a bytearray object from a string of hexadecimal numbers.\n\nSpaces between two numbers are accepted.\nExample: bytearray.fromhex('B9 01EF') -> bytearray(b'\\\\xb9\\\\x01\\\\xef')", @@ -28079,7 +33287,11 @@ "Classes": null, "Functions": null, "Id": 835611450, - "Name": "fromhex" + "Name": "fromhex", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.hex() -> string\n\nCreate a string of hexadecimal numbers from a bytearray object.\nExample: bytearray([0xb9, 0x01, 0xef]).hex() -> 'b901ef'.", @@ -28100,7 +33312,11 @@ "Classes": null, "Functions": null, "Id": 788388, - "Name": "hex" + "Name": "hex", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the subsection is not found.", @@ -28127,7 +33343,11 @@ "Classes": null, "Functions": null, "Id": 758816539, - "Name": "index" + "Name": "index", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Insert a single item into the bytearray before the given index.\n\n index\n The index where the value is to be inserted.\n item\n The item to be inserted.", @@ -28160,7 +33380,11 @@ "Classes": null, "Functions": null, "Id": 2048923024, - "Name": "insert" + "Name": "insert", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isalnum() -> bool\n\nReturn True if all characters in B are alphanumeric\nand there is at least one character in B, False otherwise.", @@ -28181,7 +33405,11 @@ "Classes": null, "Functions": null, "Id": -781168486, - "Name": "isalnum" + "Name": "isalnum", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isalpha() -> bool\n\nReturn True if all characters in B are alphabetic\nand there is at least one character in B, False otherwise.", @@ -28202,7 +33430,11 @@ "Classes": null, "Functions": null, "Id": -781166979, - "Name": "isalpha" + "Name": "isalpha", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isascii() -> bool\n\nReturn True if B is empty or all characters in B are ASCII,\nFalse otherwise.", @@ -28223,7 +33455,11 @@ "Classes": null, "Functions": null, "Id": -780970896, - "Name": "isascii" + "Name": "isascii", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isdigit() -> bool\n\nReturn True if all characters in B are digits\nand there is at least one character in B, False otherwise.", @@ -28244,7 +33480,11 @@ "Classes": null, "Functions": null, "Id": -778494388, - "Name": "isdigit" + "Name": "isdigit", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.islower() -> bool\n\nReturn True if all cased characters in B are lowercase and there is\nat least one cased character in B, False otherwise.", @@ -28265,7 +33505,11 @@ "Classes": null, "Functions": null, "Id": -770912224, - "Name": "islower" + "Name": "islower", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isspace() -> bool\n\nReturn True if all characters in B are whitespace\nand there is at least one character in B, False otherwise.", @@ -28286,7 +33530,11 @@ "Classes": null, "Functions": null, "Id": -764439003, - "Name": "isspace" + "Name": "isspace", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.istitle() -> bool\n\nReturn True if B is a titlecased string and there is at least one\ncharacter in B, i.e. uppercase characters may only follow uncased\ncharacters and lowercase characters only cased ones. Return False\notherwise.", @@ -28307,7 +33555,11 @@ "Classes": null, "Functions": null, "Id": -763705481, - "Name": "istitle" + "Name": "istitle", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.isupper() -> bool\n\nReturn True if all cased characters in B are uppercase and there is\nat least one cased character in B, False otherwise.", @@ -28328,7 +33580,11 @@ "Classes": null, "Functions": null, "Id": -762577471, - "Name": "isupper" + "Name": "isupper", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Concatenate any number of bytes/bytearray objects.\n\nThe bytearray whose method is called is inserted in between each pair.\n\nThe result is returned as a new bytearray object.", @@ -28355,7 +33611,11 @@ "Classes": null, "Functions": null, "Id": 24508865, - "Name": "join" + "Name": "join", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.ljust(width[, fillchar]) -> copy of B\n\nReturn B left justified in a string of length width. Padding is\ndone using the specified fill character (default is a space).", @@ -28376,7 +33636,11 @@ "Classes": null, "Functions": null, "Id": 761484705, - "Name": "ljust" + "Name": "ljust", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.lower() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to lowercase.", @@ -28397,7 +33661,11 @@ "Classes": null, "Functions": null, "Id": 761635146, - "Name": "lower" + "Name": "lower", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Strip leading bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading ASCII whitespace.", @@ -28424,7 +33692,11 @@ "Classes": null, "Functions": null, "Id": 2139470083, - "Name": "lstrip" + "Name": "lstrip", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a translation table useable for the bytes or bytearray translate method.\n\nThe returned table will be one where each byte in frm is mapped to the byte at\nthe same position in to.\n\nThe bytes objects frm and to must be of the same length.", @@ -28457,7 +33729,11 @@ "Classes": null, "Functions": null, "Id": 1060805443, - "Name": "maketrans" + "Name": "maketrans", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Partition the bytearray into three parts using the given separator.\n\nThis will search for the separator sep in the bytearray. If the separator is\nfound, returns a 3-tuple containing the part before the separator, the\nseparator itself, and the part after it as new bytearray objects.\n\nIf the separator is not found, returns a 3-tuple containing the copy of the\noriginal bytearray object and two empty bytearray objects.", @@ -28484,7 +33760,11 @@ "Classes": null, "Functions": null, "Id": -2024653645, - "Name": "partition" + "Name": "partition", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Remove and return a single item from B.\n\n index\n The index from where to remove the item.\n -1 (the default value) means remove the last item.\n\nIf no index argument is given, will pop the last item.", @@ -28511,7 +33791,11 @@ "Classes": null, "Functions": null, "Id": 796378, - "Name": "pop" + "Name": "pop", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Remove the first occurrence of a value in the bytearray.\n\n value\n The value to remove.", @@ -28538,7 +33822,11 @@ "Classes": null, "Functions": null, "Id": -1996862629, - "Name": "remove" + "Name": "remove", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy with all occurrences of substring old replaced by new.\n\n count\n Maximum number of occurrences to replace.\n -1 (the default value) means replace all occurrences.\n\nIf the optional argument count is given, only the first count occurrences are\nreplaced.", @@ -28577,7 +33865,11 @@ "Classes": null, "Functions": null, "Id": -1770538307, - "Name": "replace" + "Name": "replace", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Reverse the order of the values in B in place.", @@ -28598,7 +33890,11 @@ "Classes": null, "Functions": null, "Id": -1765188885, - "Name": "reverse" + "Name": "reverse", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", @@ -28637,7 +33933,11 @@ "Classes": null, "Functions": null, "Id": 766894964, - "Name": "rfind" + "Name": "rfind", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaise ValueError when the subsection is not found.", @@ -28676,7 +33976,11 @@ "Classes": null, "Functions": null, "Id": -1993149833, - "Name": "rindex" + "Name": "rindex", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.rjust(width[, fillchar]) -> copy of B\n\nReturn B right justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)", @@ -28697,7 +34001,11 @@ "Classes": null, "Functions": null, "Id": 767025831, - "Name": "rjust" + "Name": "rjust", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Partition the bytearray into three parts using the given separator.\n\nThis will search for the separator sep in the bytearray, starting at the end.\nIf the separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it as new bytearray\nobjects.\n\nIf the separator is not found, returns a 3-tuple containing two empty bytearray\nobjects and the copy of the original bytearray object.", @@ -28724,7 +34032,11 @@ "Classes": null, "Functions": null, "Id": -1107721713, - "Name": "rpartition" + "Name": "rpartition", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a list of the sections in the bytearray, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytearray.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplitting is done starting at the end of the bytearray and working to the front.", @@ -28757,7 +34069,11 @@ "Classes": null, "Functions": null, "Id": -1983847233, - "Name": "rsplit" + "Name": "rsplit", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Strip trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip trailing ASCII whitespace.", @@ -28784,7 +34100,11 @@ "Classes": null, "Functions": null, "Id": -1983722307, - "Name": "rstrip" + "Name": "rstrip", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a list of the sections in the bytearray, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytearray.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.", @@ -28817,7 +34137,11 @@ "Classes": null, "Functions": null, "Id": 768119139, - "Name": "split" + "Name": "split", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a list of the lines in the bytearray, breaking at line boundaries.\n\nLine breaks are not included in the resulting list unless keepends is given and\ntrue.", @@ -28844,7 +34168,11 @@ "Classes": null, "Functions": null, "Id": 1291658108, - "Name": "splitlines" + "Name": "splitlines", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if B starts with the specified prefix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nprefix can also be a tuple of bytes to try.", @@ -28883,7 +34211,11 @@ "Classes": null, "Functions": null, "Id": 65206254, - "Name": "startswith" + "Name": "startswith", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Strip leading and trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading and trailing ASCII whitespace.", @@ -28910,7 +34242,11 @@ "Classes": null, "Functions": null, "Id": 768244065, - "Name": "strip" + "Name": "strip", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.swapcase() -> copy of B\n\nReturn a copy of B with uppercase ASCII characters converted\nto lowercase ASCII and vice versa.", @@ -28931,7 +34267,11 @@ "Classes": null, "Functions": null, "Id": 1060209754, - "Name": "swapcase" + "Name": "swapcase", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.title() -> copy of B\n\nReturn a titlecased version of B, i.e. ASCII words start with uppercase\ncharacters, all remaining cased characters have lowercase.", @@ -28952,7 +34292,11 @@ "Classes": null, "Functions": null, "Id": 768841889, - "Name": "title" + "Name": "title", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a copy with each character mapped by the given translation table.\n\n table\n Translation table, which must be a bytes object of length 256.\n\nAll characters occurring in the optional argument delete are removed.\nThe remaining characters are mapped through the given translation table.", @@ -28985,7 +34329,11 @@ "Classes": null, "Functions": null, "Id": 827988759, - "Name": "translate" + "Name": "translate", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.upper() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to uppercase.", @@ -29006,7 +34354,11 @@ "Classes": null, "Functions": null, "Id": 769969899, - "Name": "upper" + "Name": "upper", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "B.zfill(width) -> copy of B\n\nPad a numeric string B with zeros on the left, to fill a field\nof the specified width. B is never truncated.", @@ -29033,7 +34385,11 @@ "Classes": null, "Functions": null, "Id": 774283078, - "Name": "zfill" + "Name": "zfill", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -29041,23 +34397,36 @@ { "Value": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": null }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 2020778010, - "Name": "bytearray" + "Name": "bytearray", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return an enumerate object.\n\n iterable\n an object supporting iteration\n\nThe enumerate object yields pairs containing a count (from start, which\ndefaults to zero) and a value yielded by the iterable argument.\n\nenumerate is useful for obtaining an indexed list:\n (0, seq[0]), (1, seq[1]), (2, seq[2]), ...", @@ -29090,7 +34459,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return an enumerate object.\n\n iterable\n an object supporting iteration\n\nThe enumerate object yields pairs containing a count (from start, which\ndefaults to zero) and a value yielded by the iterable argument.\n\nenumerate is useful for obtaining an indexed list:\n (0, seq[0]), (1, seq[1]), (2, seq[2]), ...", @@ -29123,7 +34496,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -29144,7 +34521,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -29165,7 +34546,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement next(self).", @@ -29186,7 +34571,11 @@ "Classes": null, "Functions": null, "Id": 1101153034, - "Name": "__next__" + "Name": "__next__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return state information for pickling.", @@ -29207,7 +34596,11 @@ "Classes": null, "Functions": null, "Id": -544113923, - "Name": "__reduce__" + "Name": "__reduce__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -29234,7 +34627,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -29242,18 +34639,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 22552621, - "Name": "enumerate" + "Name": "enumerate", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "filter(function or None, iterable) --> filter object\n\nReturn an iterator yielding those items of iterable for which function(item)\nis true. If function is None, return the items that are true.", @@ -29286,7 +34695,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "filter(function or None, iterable) --> filter object\n\nReturn an iterator yielding those items of iterable for which function(item)\nis true. If function is None, return the items that are true.", @@ -29319,7 +34732,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -29340,7 +34757,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -29361,7 +34782,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement next(self).", @@ -29382,7 +34807,11 @@ "Classes": null, "Functions": null, "Id": 1101153034, - "Name": "__next__" + "Name": "__next__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return state information for pickling.", @@ -29403,7 +34832,11 @@ "Classes": null, "Functions": null, "Id": -544113923, - "Name": "__reduce__" + "Name": "__reduce__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -29430,7 +34863,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -29438,18 +34875,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 1958223439, - "Name": "filter" + "Name": "filter", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "map(func, *iterables) --> map object\n\nMake an iterator that computes the function using arguments from\neach of the iterables. Stops when the shortest iterable is exhausted.", @@ -29482,7 +34931,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "map(func, *iterables) --> map object\n\nMake an iterator that computes the function using arguments from\neach of the iterables. Stops when the shortest iterable is exhausted.", @@ -29515,7 +34968,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -29536,7 +34993,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -29557,7 +35018,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement next(self).", @@ -29578,7 +35043,11 @@ "Classes": null, "Functions": null, "Id": 1101153034, - "Name": "__next__" + "Name": "__next__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return state information for pickling.", @@ -29599,7 +35068,11 @@ "Classes": null, "Functions": null, "Id": -544113923, - "Name": "__reduce__" + "Name": "__reduce__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -29626,7 +35099,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -29634,18 +35111,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 793061, - "Name": "map" + "Name": "map", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a new memoryview object which references the given object.", @@ -29678,7 +35167,11 @@ "Classes": null, "Functions": null, "Id": -1970845273, - "Name": "__delitem__" + "Name": "__delitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -29699,7 +35192,11 @@ "Classes": null, "Functions": null, "Id": 631946913, - "Name": "__enter__" + "Name": "__enter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -29726,7 +35223,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -29747,7 +35248,11 @@ "Classes": null, "Functions": null, "Id": 860590709, - "Name": "__exit__" + "Name": "__exit__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -29774,7 +35279,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -29801,7 +35310,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self[key].", @@ -29828,7 +35341,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -29855,7 +35372,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -29876,7 +35397,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Create a new memoryview object which references the given object.", @@ -29909,7 +35434,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -29930,7 +35459,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -29957,7 +35490,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -29978,7 +35515,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self=value.", @@ -30632,7 +36325,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -30659,7 +36356,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -30686,7 +36387,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "slice(stop)\nslice(start, stop[, step])\n\nCreate a slice object. This is used for extended slicing (e.g. a[0:10:2]).", @@ -30725,7 +36430,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -30746,7 +36455,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -30773,7 +36486,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self (start, stop, stride)\n\nAssuming a sequence of length len, calculate the start and stop\nindices, and the stride length of the extended slice described by\nS. Out of bounds indices are clipped in a manner consistent with the\nhandling of normal slices.", @@ -30917,7 +36654,11 @@ "Classes": null, "Functions": null, "Id": -921644112, - "Name": "indices" + "Name": "indices", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [ @@ -30926,44 +36667,69 @@ "ReturnType": null, "Attributes": 0, "Id": 768228011, - "Name": "start" + "Name": "start", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 24781667, - "Name": "step" + "Name": "step", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 24781977, - "Name": "stop" + "Name": "stop", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Fields": [ { "Value": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": null }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 767996891, - "Name": "slice" + "Name": "slice", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "super() -> same as super(__class__, )\nsuper(type) -> unbound super object\nsuper(type, obj) -> bound super object; requires isinstance(obj, type)\nsuper(type, type2) -> bound super object; requires issubclass(type2, type)\nTypical use to call a cooperative superclass method:\nclass C(B):\n def meth(self, arg):\n super().meth(arg)\nThis works for class methods too:\nclass C(B):\n @classmethod\n def cmeth(cls, arg):\n super().cmeth(arg)\n", @@ -31002,7 +36768,11 @@ "Classes": null, "Functions": null, "Id": -1633516065, - "Name": "__get__" + "Name": "__get__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -31029,7 +36799,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "super() -> same as super(__class__, )\nsuper(type) -> unbound super object\nsuper(type, obj) -> bound super object; requires isinstance(obj, type)\nsuper(type, type2) -> bound super object; requires issubclass(type2, type)\nTypical use to call a cooperative superclass method:\nclass C(B):\n def meth(self, arg):\n super().meth(arg)\nThis works for class methods too:\nclass C(B):\n @classmethod\n def cmeth(cls, arg):\n super().cmeth(arg)\n", @@ -31062,7 +36836,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -31083,7 +36861,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return repr(self).", @@ -31104,7 +36886,11 @@ "Classes": null, "Functions": null, "Id": 1215429388, - "Name": "__repr__" + "Name": "__repr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -31131,7 +36917,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [ @@ -31140,39 +36930,63 @@ "ReturnType": null, "Attributes": 0, "Id": 1243927843, - "Name": "__self__" + "Name": "__self__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 2069653788, - "Name": "__self_class__" + "Name": "__self_class__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "", "ReturnType": null, "Attributes": 0, "Id": 185188451, - "Name": "__thisclass__" + "Name": "__thisclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Fields": [ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 768271812, - "Name": "super" + "Name": "super", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "zip(iter1 [,iter2 [...]]) --> zip object\n\nReturn a zip object whose .__next__() method returns a tuple where\nthe i-th element comes from the i-th iterable argument. The .__next__()\nmethod continues until the shortest iterable in the argument sequence\nis exhausted and then it raises StopIteration.", @@ -31205,7 +37019,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "zip(iter1 [,iter2 [...]]) --> zip object\n\nReturn a zip object whose .__next__() method returns a tuple where\nthe i-th element comes from the i-th iterable argument. The .__next__()\nmethod continues until the shortest iterable in the argument sequence\nis exhausted and then it raises StopIteration.", @@ -31238,7 +37056,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -31259,7 +37081,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -31280,7 +37106,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement next(self).", @@ -31301,7 +37131,11 @@ "Classes": null, "Functions": null, "Id": 1101153034, - "Name": "__next__" + "Name": "__next__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return state information for pickling.", @@ -31322,7 +37156,11 @@ "Classes": null, "Functions": null, "Id": -544113923, - "Name": "__reduce__" + "Name": "__reduce__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -31349,7 +37187,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -31357,18 +37199,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 805802, - "Name": "zip" + "Name": "zip", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "type(object_or_name, bases, dict)\ntype(object) -> the object's type\ntype(name, bases, dict) -> a new type", @@ -31407,7 +37261,11 @@ "Classes": null, "Functions": null, "Id": 782173109, - "Name": "__call__" + "Name": "__call__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement delattr(self, name).", @@ -31434,7 +37292,11 @@ "Classes": null, "Functions": null, "Id": 2095540485, - "Name": "__delattr__" + "Name": "__delattr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Specialized __dir__ implementation for types.", @@ -31455,7 +37317,11 @@ "Classes": null, "Functions": null, "Id": -1636169386, - "Name": "__dir__" + "Name": "__dir__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -31482,7 +37348,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "type(object_or_name, bases, dict)\ntype(object) -> the object's type\ntype(name, bases, dict) -> a new type", @@ -31521,7 +37391,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -31542,7 +37416,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Check if an object is an instance.", @@ -31569,7 +37447,11 @@ "Classes": null, "Functions": null, "Id": -1213275748, - "Name": "__instancecheck__" + "Name": "__instancecheck__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "__prepare__() -> dict\nused to create the namespace for the class statement", @@ -31608,7 +37490,11 @@ "Classes": null, "Functions": null, "Id": 1556881104, - "Name": "__prepare__" + "Name": "__prepare__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return repr(self).", @@ -31629,7 +37515,11 @@ "Classes": null, "Functions": null, "Id": 1215429388, - "Name": "__repr__" + "Name": "__repr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement setattr(self, name, value).", @@ -31662,7 +37552,11 @@ "Classes": null, "Functions": null, "Id": -736377828, - "Name": "__setattr__" + "Name": "__setattr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return memory consumption of the type object.", @@ -31683,7 +37577,11 @@ "Classes": null, "Functions": null, "Id": 1069167279, - "Name": "__sizeof__" + "Name": "__sizeof__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Check if a class is a subclass.", @@ -31710,7 +37608,11 @@ "Classes": null, "Functions": null, "Id": -25004647, - "Name": "__subclasscheck__" + "Name": "__subclasscheck__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return a list of immediate subclasses.", @@ -31731,7 +37633,11 @@ "Classes": null, "Functions": null, "Id": 1804067837, - "Name": "__subclasses__" + "Name": "__subclasses__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", @@ -31758,7 +37664,11 @@ "Classes": null, "Functions": null, "Id": -1374911630, - "Name": "__subclasshook__" + "Name": "__subclasshook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Properties": [], @@ -31766,65 +37676,22267 @@ { "Value": null, "Id": -1388753224, - "Name": "__basicsize__" + "Name": "__basicsize__", + "IndexSpan": null }, { "Value": "i:dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": null }, { "Value": null, "Id": -198224608, - "Name": "__dictoffset__" + "Name": "__dictoffset__", + "IndexSpan": null }, { "Value": null, "Id": 1444705936, - "Name": "__flags__" + "Name": "__flags__", + "IndexSpan": null }, { "Value": null, "Id": 919460331, - "Name": "__itemsize__" + "Name": "__itemsize__", + "IndexSpan": null }, { "Value": "i:tuple", "Id": -1627592461, - "Name": "__mro__" + "Name": "__mro__", + "IndexSpan": null }, { "Value": null, "Id": 1097116834, - "Name": "__name__" + "Name": "__name__", + "IndexSpan": null }, { "Value": null, "Id": -1879833807, - "Name": "__qualname__" + "Name": "__qualname__", + "IndexSpan": null }, { "Value": null, "Id": 174109373, - "Name": "__text_signature__" + "Name": "__text_signature__", + "IndexSpan": null }, { "Value": null, "Id": 1521523639, - "Name": "__weakrefoffset__" + "Name": "__weakrefoffset__", + "IndexSpan": null }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 24816593, - "Name": "type" + "Name": "type", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], + "NewLines": [ + { + "EndIndex": 35, + "Kind": 3 + }, + { + "EndIndex": 71, + "Kind": 3 + }, + { + "EndIndex": 113, + "Kind": 3 + }, + { + "EndIndex": 127, + "Kind": 3 + }, + { + "EndIndex": 133, + "Kind": 3 + }, + { + "EndIndex": 151, + "Kind": 3 + }, + { + "EndIndex": 184, + "Kind": 3 + }, + { + "EndIndex": 335, + "Kind": 3 + }, + { + "EndIndex": 356, + "Kind": 3 + }, + { + "EndIndex": 362, + "Kind": 3 + }, + { + "EndIndex": 389, + "Kind": 3 + }, + { + "EndIndex": 419, + "Kind": 3 + }, + { + "EndIndex": 425, + "Kind": 3 + }, + { + "EndIndex": 450, + "Kind": 3 + }, + { + "EndIndex": 480, + "Kind": 3 + }, + { + "EndIndex": 499, + "Kind": 3 + }, + { + "EndIndex": 505, + "Kind": 3 + }, + { + "EndIndex": 523, + "Kind": 3 + }, + { + "EndIndex": 565, + "Kind": 3 + }, + { + "EndIndex": 891, + "Kind": 3 + }, + { + "EndIndex": 913, + "Kind": 3 + }, + { + "EndIndex": 919, + "Kind": 3 + }, + { + "EndIndex": 921, + "Kind": 3 + }, + { + "EndIndex": 941, + "Kind": 3 + }, + { + "EndIndex": 958, + "Kind": 3 + }, + { + "EndIndex": 986, + "Kind": 3 + }, + { + "EndIndex": 988, + "Kind": 3 + }, + { + "EndIndex": 1009, + "Kind": 3 + }, + { + "EndIndex": 1044, + "Kind": 3 + }, + { + "EndIndex": 1046, + "Kind": 3 + }, + { + "EndIndex": 1061, + "Kind": 3 + }, + { + "EndIndex": 1087, + "Kind": 3 + }, + { + "EndIndex": 1111, + "Kind": 3 + }, + { + "EndIndex": 1145, + "Kind": 3 + }, + { + "EndIndex": 1187, + "Kind": 3 + }, + { + "EndIndex": 1208, + "Kind": 3 + }, + { + "EndIndex": 1214, + "Kind": 3 + }, + { + "EndIndex": 1238, + "Kind": 3 + }, + { + "EndIndex": 1279, + "Kind": 3 + }, + { + "EndIndex": 1300, + "Kind": 3 + }, + { + "EndIndex": 1306, + "Kind": 3 + }, + { + "EndIndex": 1336, + "Kind": 3 + }, + { + "EndIndex": 1367, + "Kind": 3 + }, + { + "EndIndex": 1389, + "Kind": 3 + }, + { + "EndIndex": 1395, + "Kind": 3 + }, + { + "EndIndex": 1435, + "Kind": 3 + }, + { + "EndIndex": 1472, + "Kind": 3 + }, + { + "EndIndex": 1491, + "Kind": 3 + }, + { + "EndIndex": 1497, + "Kind": 3 + }, + { + "EndIndex": 1527, + "Kind": 3 + }, + { + "EndIndex": 1558, + "Kind": 3 + }, + { + "EndIndex": 1580, + "Kind": 3 + }, + { + "EndIndex": 1586, + "Kind": 3 + }, + { + "EndIndex": 1625, + "Kind": 3 + }, + { + "EndIndex": 1664, + "Kind": 3 + }, + { + "EndIndex": 1678, + "Kind": 3 + }, + { + "EndIndex": 1684, + "Kind": 3 + }, + { + "EndIndex": 1714, + "Kind": 3 + }, + { + "EndIndex": 1744, + "Kind": 3 + }, + { + "EndIndex": 1766, + "Kind": 3 + }, + { + "EndIndex": 1772, + "Kind": 3 + }, + { + "EndIndex": 1797, + "Kind": 3 + }, + { + "EndIndex": 1827, + "Kind": 3 + }, + { + "EndIndex": 1845, + "Kind": 3 + }, + { + "EndIndex": 1851, + "Kind": 3 + }, + { + "EndIndex": 1893, + "Kind": 3 + }, + { + "EndIndex": 1923, + "Kind": 3 + }, + { + "EndIndex": 1937, + "Kind": 3 + }, + { + "EndIndex": 1943, + "Kind": 3 + }, + { + "EndIndex": 1961, + "Kind": 3 + }, + { + "EndIndex": 1994, + "Kind": 3 + }, + { + "EndIndex": 2145, + "Kind": 3 + }, + { + "EndIndex": 2166, + "Kind": 3 + }, + { + "EndIndex": 2172, + "Kind": 3 + }, + { + "EndIndex": 2202, + "Kind": 3 + }, + { + "EndIndex": 2233, + "Kind": 3 + }, + { + "EndIndex": 2255, + "Kind": 3 + }, + { + "EndIndex": 2261, + "Kind": 3 + }, + { + "EndIndex": 2291, + "Kind": 3 + }, + { + "EndIndex": 2321, + "Kind": 3 + }, + { + "EndIndex": 2343, + "Kind": 3 + }, + { + "EndIndex": 2349, + "Kind": 3 + }, + { + "EndIndex": 2379, + "Kind": 3 + }, + { + "EndIndex": 2410, + "Kind": 3 + }, + { + "EndIndex": 2432, + "Kind": 3 + }, + { + "EndIndex": 2438, + "Kind": 3 + }, + { + "EndIndex": 2465, + "Kind": 3 + }, + { + "EndIndex": 2495, + "Kind": 3 + }, + { + "EndIndex": 2525, + "Kind": 3 + }, + { + "EndIndex": 2531, + "Kind": 3 + }, + { + "EndIndex": 2571, + "Kind": 3 + }, + { + "EndIndex": 2601, + "Kind": 3 + }, + { + "EndIndex": 2631, + "Kind": 3 + }, + { + "EndIndex": 2637, + "Kind": 3 + }, + { + "EndIndex": 2662, + "Kind": 3 + }, + { + "EndIndex": 2692, + "Kind": 3 + }, + { + "EndIndex": 2711, + "Kind": 3 + }, + { + "EndIndex": 2717, + "Kind": 3 + }, + { + "EndIndex": 2758, + "Kind": 3 + }, + { + "EndIndex": 2807, + "Kind": 3 + }, + { + "EndIndex": 2828, + "Kind": 3 + }, + { + "EndIndex": 2834, + "Kind": 3 + }, + { + "EndIndex": 2861, + "Kind": 3 + }, + { + "EndIndex": 2908, + "Kind": 3 + }, + { + "EndIndex": 2926, + "Kind": 3 + }, + { + "EndIndex": 2932, + "Kind": 3 + }, + { + "EndIndex": 2956, + "Kind": 3 + }, + { + "EndIndex": 2985, + "Kind": 3 + }, + { + "EndIndex": 3004, + "Kind": 3 + }, + { + "EndIndex": 3010, + "Kind": 3 + }, + { + "EndIndex": 3028, + "Kind": 3 + }, + { + "EndIndex": 3070, + "Kind": 3 + }, + { + "EndIndex": 3396, + "Kind": 3 + }, + { + "EndIndex": 3418, + "Kind": 3 + }, + { + "EndIndex": 3424, + "Kind": 3 + }, + { + "EndIndex": 3426, + "Kind": 3 + }, + { + "EndIndex": 3447, + "Kind": 3 + }, + { + "EndIndex": 3468, + "Kind": 3 + }, + { + "EndIndex": 3583, + "Kind": 3 + }, + { + "EndIndex": 3608, + "Kind": 3 + }, + { + "EndIndex": 3628, + "Kind": 3 + }, + { + "EndIndex": 3653, + "Kind": 3 + }, + { + "EndIndex": 3695, + "Kind": 3 + }, + { + "EndIndex": 3731, + "Kind": 3 + }, + { + "EndIndex": 3753, + "Kind": 3 + }, + { + "EndIndex": 3759, + "Kind": 3 + }, + { + "EndIndex": 3781, + "Kind": 3 + }, + { + "EndIndex": 3815, + "Kind": 3 + }, + { + "EndIndex": 3857, + "Kind": 3 + }, + { + "EndIndex": 3878, + "Kind": 3 + }, + { + "EndIndex": 3884, + "Kind": 3 + }, + { + "EndIndex": 3903, + "Kind": 3 + }, + { + "EndIndex": 3929, + "Kind": 3 + }, + { + "EndIndex": 3953, + "Kind": 3 + }, + { + "EndIndex": 4010, + "Kind": 3 + }, + { + "EndIndex": 4031, + "Kind": 3 + }, + { + "EndIndex": 4037, + "Kind": 3 + }, + { + "EndIndex": 4066, + "Kind": 3 + }, + { + "EndIndex": 4105, + "Kind": 3 + }, + { + "EndIndex": 4144, + "Kind": 3 + }, + { + "EndIndex": 4158, + "Kind": 3 + }, + { + "EndIndex": 4164, + "Kind": 3 + }, + { + "EndIndex": 4218, + "Kind": 3 + }, + { + "EndIndex": 4337, + "Kind": 3 + }, + { + "EndIndex": 4351, + "Kind": 3 + }, + { + "EndIndex": 4357, + "Kind": 3 + }, + { + "EndIndex": 4375, + "Kind": 3 + }, + { + "EndIndex": 4408, + "Kind": 3 + }, + { + "EndIndex": 4559, + "Kind": 3 + }, + { + "EndIndex": 4580, + "Kind": 3 + }, + { + "EndIndex": 4586, + "Kind": 3 + }, + { + "EndIndex": 4630, + "Kind": 3 + }, + { + "EndIndex": 4676, + "Kind": 3 + }, + { + "EndIndex": 4698, + "Kind": 3 + }, + { + "EndIndex": 4704, + "Kind": 3 + }, + { + "EndIndex": 4727, + "Kind": 3 + }, + { + "EndIndex": 4745, + "Kind": 3 + }, + { + "EndIndex": 4768, + "Kind": 3 + }, + { + "EndIndex": 4786, + "Kind": 3 + }, + { + "EndIndex": 4834, + "Kind": 3 + }, + { + "EndIndex": 4921, + "Kind": 3 + }, + { + "EndIndex": 4942, + "Kind": 3 + }, + { + "EndIndex": 4948, + "Kind": 3 + }, + { + "EndIndex": 4975, + "Kind": 3 + }, + { + "EndIndex": 5000, + "Kind": 3 + }, + { + "EndIndex": 5030, + "Kind": 3 + }, + { + "EndIndex": 5049, + "Kind": 3 + }, + { + "EndIndex": 5055, + "Kind": 3 + }, + { + "EndIndex": 5096, + "Kind": 3 + }, + { + "EndIndex": 5145, + "Kind": 3 + }, + { + "EndIndex": 5166, + "Kind": 3 + }, + { + "EndIndex": 5172, + "Kind": 3 + }, + { + "EndIndex": 5199, + "Kind": 3 + }, + { + "EndIndex": 5256, + "Kind": 3 + }, + { + "EndIndex": 5274, + "Kind": 3 + }, + { + "EndIndex": 5280, + "Kind": 3 + }, + { + "EndIndex": 5324, + "Kind": 3 + }, + { + "EndIndex": 5367, + "Kind": 3 + }, + { + "EndIndex": 5389, + "Kind": 3 + }, + { + "EndIndex": 5395, + "Kind": 3 + }, + { + "EndIndex": 5426, + "Kind": 3 + }, + { + "EndIndex": 5476, + "Kind": 3 + }, + { + "EndIndex": 5499, + "Kind": 3 + }, + { + "EndIndex": 5505, + "Kind": 3 + }, + { + "EndIndex": 5523, + "Kind": 3 + }, + { + "EndIndex": 5565, + "Kind": 3 + }, + { + "EndIndex": 5891, + "Kind": 3 + }, + { + "EndIndex": 5913, + "Kind": 3 + }, + { + "EndIndex": 5919, + "Kind": 3 + }, + { + "EndIndex": 5950, + "Kind": 3 + }, + { + "EndIndex": 5979, + "Kind": 3 + }, + { + "EndIndex": 5999, + "Kind": 3 + }, + { + "EndIndex": 6051, + "Kind": 3 + }, + { + "EndIndex": 6080, + "Kind": 3 + }, + { + "EndIndex": 6086, + "Kind": 3 + }, + { + "EndIndex": 6088, + "Kind": 3 + }, + { + "EndIndex": 6105, + "Kind": 3 + }, + { + "EndIndex": 6125, + "Kind": 3 + }, + { + "EndIndex": 6751, + "Kind": 3 + }, + { + "EndIndex": 6775, + "Kind": 3 + }, + { + "EndIndex": 6796, + "Kind": 3 + }, + { + "EndIndex": 6818, + "Kind": 3 + }, + { + "EndIndex": 6824, + "Kind": 3 + }, + { + "EndIndex": 6855, + "Kind": 3 + }, + { + "EndIndex": 6885, + "Kind": 3 + }, + { + "EndIndex": 6907, + "Kind": 3 + }, + { + "EndIndex": 6913, + "Kind": 3 + }, + { + "EndIndex": 6944, + "Kind": 3 + }, + { + "EndIndex": 6974, + "Kind": 3 + }, + { + "EndIndex": 6996, + "Kind": 3 + }, + { + "EndIndex": 7002, + "Kind": 3 + }, + { + "EndIndex": 7027, + "Kind": 3 + }, + { + "EndIndex": 7048, + "Kind": 3 + }, + { + "EndIndex": 7070, + "Kind": 3 + }, + { + "EndIndex": 7076, + "Kind": 3 + }, + { + "EndIndex": 7101, + "Kind": 3 + }, + { + "EndIndex": 7151, + "Kind": 3 + }, + { + "EndIndex": 7173, + "Kind": 3 + }, + { + "EndIndex": 7179, + "Kind": 3 + }, + { + "EndIndex": 7200, + "Kind": 3 + }, + { + "EndIndex": 7234, + "Kind": 3 + }, + { + "EndIndex": 7273, + "Kind": 3 + }, + { + "EndIndex": 7296, + "Kind": 3 + }, + { + "EndIndex": 7302, + "Kind": 3 + }, + { + "EndIndex": 7332, + "Kind": 3 + }, + { + "EndIndex": 7363, + "Kind": 3 + }, + { + "EndIndex": 7385, + "Kind": 3 + }, + { + "EndIndex": 7391, + "Kind": 3 + }, + { + "EndIndex": 7417, + "Kind": 3 + }, + { + "EndIndex": 7440, + "Kind": 3 + }, + { + "EndIndex": 7460, + "Kind": 3 + }, + { + "EndIndex": 7466, + "Kind": 3 + }, + { + "EndIndex": 7492, + "Kind": 3 + }, + { + "EndIndex": 7540, + "Kind": 3 + }, + { + "EndIndex": 7562, + "Kind": 3 + }, + { + "EndIndex": 7568, + "Kind": 3 + }, + { + "EndIndex": 7604, + "Kind": 3 + }, + { + "EndIndex": 7635, + "Kind": 3 + }, + { + "EndIndex": 7653, + "Kind": 3 + }, + { + "EndIndex": 7659, + "Kind": 3 + }, + { + "EndIndex": 7699, + "Kind": 3 + }, + { + "EndIndex": 7718, + "Kind": 3 + }, + { + "EndIndex": 7724, + "Kind": 3 + }, + { + "EndIndex": 7754, + "Kind": 3 + }, + { + "EndIndex": 7785, + "Kind": 3 + }, + { + "EndIndex": 7807, + "Kind": 3 + }, + { + "EndIndex": 7813, + "Kind": 3 + }, + { + "EndIndex": 7852, + "Kind": 3 + }, + { + "EndIndex": 7891, + "Kind": 3 + }, + { + "EndIndex": 7905, + "Kind": 3 + }, + { + "EndIndex": 7911, + "Kind": 3 + }, + { + "EndIndex": 7942, + "Kind": 3 + }, + { + "EndIndex": 7961, + "Kind": 3 + }, + { + "EndIndex": 7967, + "Kind": 3 + }, + { + "EndIndex": 7997, + "Kind": 3 + }, + { + "EndIndex": 8027, + "Kind": 3 + }, + { + "EndIndex": 8049, + "Kind": 3 + }, + { + "EndIndex": 8055, + "Kind": 3 + }, + { + "EndIndex": 8080, + "Kind": 3 + }, + { + "EndIndex": 8110, + "Kind": 3 + }, + { + "EndIndex": 8128, + "Kind": 3 + }, + { + "EndIndex": 8134, + "Kind": 3 + }, + { + "EndIndex": 8160, + "Kind": 3 + }, + { + "EndIndex": 8261, + "Kind": 3 + }, + { + "EndIndex": 8279, + "Kind": 3 + }, + { + "EndIndex": 8285, + "Kind": 3 + }, + { + "EndIndex": 8322, + "Kind": 3 + }, + { + "EndIndex": 8952, + "Kind": 3 + }, + { + "EndIndex": 8966, + "Kind": 3 + }, + { + "EndIndex": 8972, + "Kind": 3 + }, + { + "EndIndex": 8990, + "Kind": 3 + }, + { + "EndIndex": 9023, + "Kind": 3 + }, + { + "EndIndex": 9174, + "Kind": 3 + }, + { + "EndIndex": 9195, + "Kind": 3 + }, + { + "EndIndex": 9201, + "Kind": 3 + }, + { + "EndIndex": 9225, + "Kind": 3 + }, + { + "EndIndex": 9246, + "Kind": 3 + }, + { + "EndIndex": 9264, + "Kind": 3 + }, + { + "EndIndex": 9270, + "Kind": 3 + }, + { + "EndIndex": 9297, + "Kind": 3 + }, + { + "EndIndex": 9314, + "Kind": 3 + }, + { + "EndIndex": 9336, + "Kind": 3 + }, + { + "EndIndex": 9342, + "Kind": 3 + }, + { + "EndIndex": 9372, + "Kind": 3 + }, + { + "EndIndex": 9403, + "Kind": 3 + }, + { + "EndIndex": 9425, + "Kind": 3 + }, + { + "EndIndex": 9431, + "Kind": 3 + }, + { + "EndIndex": 9465, + "Kind": 3 + }, + { + "EndIndex": 9496, + "Kind": 3 + }, + { + "EndIndex": 9518, + "Kind": 3 + }, + { + "EndIndex": 9524, + "Kind": 3 + }, + { + "EndIndex": 9554, + "Kind": 3 + }, + { + "EndIndex": 9584, + "Kind": 3 + }, + { + "EndIndex": 9606, + "Kind": 3 + }, + { + "EndIndex": 9612, + "Kind": 3 + }, + { + "EndIndex": 9643, + "Kind": 3 + }, + { + "EndIndex": 9673, + "Kind": 3 + }, + { + "EndIndex": 9695, + "Kind": 3 + }, + { + "EndIndex": 9701, + "Kind": 3 + }, + { + "EndIndex": 9732, + "Kind": 3 + }, + { + "EndIndex": 9762, + "Kind": 3 + }, + { + "EndIndex": 9784, + "Kind": 3 + }, + { + "EndIndex": 9790, + "Kind": 3 + }, + { + "EndIndex": 9820, + "Kind": 3 + }, + { + "EndIndex": 9851, + "Kind": 3 + }, + { + "EndIndex": 9873, + "Kind": 3 + }, + { + "EndIndex": 9879, + "Kind": 3 + }, + { + "EndIndex": 9903, + "Kind": 3 + }, + { + "EndIndex": 9920, + "Kind": 3 + }, + { + "EndIndex": 9942, + "Kind": 3 + }, + { + "EndIndex": 9948, + "Kind": 3 + }, + { + "EndIndex": 9978, + "Kind": 3 + }, + { + "EndIndex": 10008, + "Kind": 3 + }, + { + "EndIndex": 10030, + "Kind": 3 + }, + { + "EndIndex": 10036, + "Kind": 3 + }, + { + "EndIndex": 10060, + "Kind": 3 + }, + { + "EndIndex": 10077, + "Kind": 3 + }, + { + "EndIndex": 10099, + "Kind": 3 + }, + { + "EndIndex": 10105, + "Kind": 3 + }, + { + "EndIndex": 10141, + "Kind": 3 + }, + { + "EndIndex": 10182, + "Kind": 3 + }, + { + "EndIndex": 10204, + "Kind": 3 + }, + { + "EndIndex": 10210, + "Kind": 3 + }, + { + "EndIndex": 10242, + "Kind": 3 + }, + { + "EndIndex": 10272, + "Kind": 3 + }, + { + "EndIndex": 10294, + "Kind": 3 + }, + { + "EndIndex": 10300, + "Kind": 3 + }, + { + "EndIndex": 10332, + "Kind": 3 + }, + { + "EndIndex": 10362, + "Kind": 3 + }, + { + "EndIndex": 10384, + "Kind": 3 + }, + { + "EndIndex": 10390, + "Kind": 3 + }, + { + "EndIndex": 10425, + "Kind": 3 + }, + { + "EndIndex": 10464, + "Kind": 3 + }, + { + "EndIndex": 10487, + "Kind": 3 + }, + { + "EndIndex": 10493, + "Kind": 3 + }, + { + "EndIndex": 10518, + "Kind": 3 + }, + { + "EndIndex": 10548, + "Kind": 3 + }, + { + "EndIndex": 10567, + "Kind": 3 + }, + { + "EndIndex": 10573, + "Kind": 3 + }, + { + "EndIndex": 10610, + "Kind": 3 + }, + { + "EndIndex": 10641, + "Kind": 3 + }, + { + "EndIndex": 10663, + "Kind": 3 + }, + { + "EndIndex": 10669, + "Kind": 3 + }, + { + "EndIndex": 10704, + "Kind": 3 + }, + { + "EndIndex": 10735, + "Kind": 3 + }, + { + "EndIndex": 10757, + "Kind": 3 + }, + { + "EndIndex": 10763, + "Kind": 3 + }, + { + "EndIndex": 10795, + "Kind": 3 + }, + { + "EndIndex": 10825, + "Kind": 3 + }, + { + "EndIndex": 10847, + "Kind": 3 + }, + { + "EndIndex": 10853, + "Kind": 3 + }, + { + "EndIndex": 10885, + "Kind": 3 + }, + { + "EndIndex": 10915, + "Kind": 3 + }, + { + "EndIndex": 10937, + "Kind": 3 + }, + { + "EndIndex": 10943, + "Kind": 3 + }, + { + "EndIndex": 10974, + "Kind": 3 + }, + { + "EndIndex": 11004, + "Kind": 3 + }, + { + "EndIndex": 11026, + "Kind": 3 + }, + { + "EndIndex": 11032, + "Kind": 3 + }, + { + "EndIndex": 11069, + "Kind": 3 + }, + { + "EndIndex": 11177, + "Kind": 3 + }, + { + "EndIndex": 11199, + "Kind": 3 + }, + { + "EndIndex": 11205, + "Kind": 3 + }, + { + "EndIndex": 11242, + "Kind": 3 + }, + { + "EndIndex": 11283, + "Kind": 3 + }, + { + "EndIndex": 11305, + "Kind": 3 + }, + { + "EndIndex": 11311, + "Kind": 3 + }, + { + "EndIndex": 11346, + "Kind": 3 + }, + { + "EndIndex": 11377, + "Kind": 3 + }, + { + "EndIndex": 11399, + "Kind": 3 + }, + { + "EndIndex": 11405, + "Kind": 3 + }, + { + "EndIndex": 11439, + "Kind": 3 + }, + { + "EndIndex": 11470, + "Kind": 3 + }, + { + "EndIndex": 11492, + "Kind": 3 + }, + { + "EndIndex": 11498, + "Kind": 3 + }, + { + "EndIndex": 11530, + "Kind": 3 + }, + { + "EndIndex": 11560, + "Kind": 3 + }, + { + "EndIndex": 11582, + "Kind": 3 + }, + { + "EndIndex": 11588, + "Kind": 3 + }, + { + "EndIndex": 11624, + "Kind": 3 + }, + { + "EndIndex": 11654, + "Kind": 3 + }, + { + "EndIndex": 11676, + "Kind": 3 + }, + { + "EndIndex": 11682, + "Kind": 3 + }, + { + "EndIndex": 11714, + "Kind": 3 + }, + { + "EndIndex": 11744, + "Kind": 3 + }, + { + "EndIndex": 11766, + "Kind": 3 + }, + { + "EndIndex": 11772, + "Kind": 3 + }, + { + "EndIndex": 11799, + "Kind": 3 + }, + { + "EndIndex": 11844, + "Kind": 3 + }, + { + "EndIndex": 11862, + "Kind": 3 + }, + { + "EndIndex": 11868, + "Kind": 3 + }, + { + "EndIndex": 11892, + "Kind": 3 + }, + { + "EndIndex": 11921, + "Kind": 3 + }, + { + "EndIndex": 11940, + "Kind": 3 + }, + { + "EndIndex": 11946, + "Kind": 3 + }, + { + "EndIndex": 11977, + "Kind": 3 + }, + { + "EndIndex": 12007, + "Kind": 3 + }, + { + "EndIndex": 12029, + "Kind": 3 + }, + { + "EndIndex": 12035, + "Kind": 3 + }, + { + "EndIndex": 12053, + "Kind": 3 + }, + { + "EndIndex": 12095, + "Kind": 3 + }, + { + "EndIndex": 12421, + "Kind": 3 + }, + { + "EndIndex": 12443, + "Kind": 3 + }, + { + "EndIndex": 12449, + "Kind": 3 + }, + { + "EndIndex": 12484, + "Kind": 3 + }, + { + "EndIndex": 12514, + "Kind": 3 + }, + { + "EndIndex": 12542, + "Kind": 3 + }, + { + "EndIndex": 12548, + "Kind": 3 + }, + { + "EndIndex": 12574, + "Kind": 3 + }, + { + "EndIndex": 12624, + "Kind": 3 + }, + { + "EndIndex": 12646, + "Kind": 3 + }, + { + "EndIndex": 12652, + "Kind": 3 + }, + { + "EndIndex": 12683, + "Kind": 3 + }, + { + "EndIndex": 12713, + "Kind": 3 + }, + { + "EndIndex": 12735, + "Kind": 3 + }, + { + "EndIndex": 12741, + "Kind": 3 + }, + { + "EndIndex": 12768, + "Kind": 3 + }, + { + "EndIndex": 12886, + "Kind": 3 + }, + { + "EndIndex": 12904, + "Kind": 3 + }, + { + "EndIndex": 12910, + "Kind": 3 + }, + { + "EndIndex": 12936, + "Kind": 3 + }, + { + "EndIndex": 12995, + "Kind": 3 + }, + { + "EndIndex": 13025, + "Kind": 3 + }, + { + "EndIndex": 13031, + "Kind": 3 + }, + { + "EndIndex": 13046, + "Kind": 3 + }, + { + "EndIndex": 13074, + "Kind": 3 + }, + { + "EndIndex": 13138, + "Kind": 3 + }, + { + "EndIndex": 13152, + "Kind": 3 + }, + { + "EndIndex": 13158, + "Kind": 3 + }, + { + "EndIndex": 13176, + "Kind": 3 + }, + { + "EndIndex": 13226, + "Kind": 3 + }, + { + "EndIndex": 13990, + "Kind": 3 + }, + { + "EndIndex": 14008, + "Kind": 3 + }, + { + "EndIndex": 14014, + "Kind": 3 + }, + { + "EndIndex": 14029, + "Kind": 3 + }, + { + "EndIndex": 14050, + "Kind": 3 + }, + { + "EndIndex": 14100, + "Kind": 3 + }, + { + "EndIndex": 14114, + "Kind": 3 + }, + { + "EndIndex": 14120, + "Kind": 3 + }, + { + "EndIndex": 14135, + "Kind": 3 + }, + { + "EndIndex": 14161, + "Kind": 3 + }, + { + "EndIndex": 14223, + "Kind": 3 + }, + { + "EndIndex": 14237, + "Kind": 3 + }, + { + "EndIndex": 14243, + "Kind": 3 + }, + { + "EndIndex": 14258, + "Kind": 3 + }, + { + "EndIndex": 14279, + "Kind": 3 + }, + { + "EndIndex": 14324, + "Kind": 3 + }, + { + "EndIndex": 14338, + "Kind": 3 + }, + { + "EndIndex": 14344, + "Kind": 3 + }, + { + "EndIndex": 14388, + "Kind": 3 + }, + { + "EndIndex": 15131, + "Kind": 3 + }, + { + "EndIndex": 15151, + "Kind": 3 + }, + { + "EndIndex": 15157, + "Kind": 3 + }, + { + "EndIndex": 15159, + "Kind": 3 + }, + { + "EndIndex": 15174, + "Kind": 3 + }, + { + "EndIndex": 15192, + "Kind": 3 + }, + { + "EndIndex": 15426, + "Kind": 3 + }, + { + "EndIndex": 15457, + "Kind": 3 + }, + { + "EndIndex": 15487, + "Kind": 3 + }, + { + "EndIndex": 15510, + "Kind": 3 + }, + { + "EndIndex": 15516, + "Kind": 3 + }, + { + "EndIndex": 15538, + "Kind": 3 + }, + { + "EndIndex": 15566, + "Kind": 3 + }, + { + "EndIndex": 15804, + "Kind": 3 + }, + { + "EndIndex": 15818, + "Kind": 3 + }, + { + "EndIndex": 15824, + "Kind": 3 + }, + { + "EndIndex": 15842, + "Kind": 3 + }, + { + "EndIndex": 15875, + "Kind": 3 + }, + { + "EndIndex": 16026, + "Kind": 3 + }, + { + "EndIndex": 16047, + "Kind": 3 + }, + { + "EndIndex": 16053, + "Kind": 3 + }, + { + "EndIndex": 16083, + "Kind": 3 + }, + { + "EndIndex": 16113, + "Kind": 3 + }, + { + "EndIndex": 16136, + "Kind": 3 + }, + { + "EndIndex": 16142, + "Kind": 3 + }, + { + "EndIndex": 16174, + "Kind": 3 + }, + { + "EndIndex": 16204, + "Kind": 3 + }, + { + "EndIndex": 16227, + "Kind": 3 + }, + { + "EndIndex": 16233, + "Kind": 3 + }, + { + "EndIndex": 16258, + "Kind": 3 + }, + { + "EndIndex": 16288, + "Kind": 3 + }, + { + "EndIndex": 16307, + "Kind": 3 + }, + { + "EndIndex": 16313, + "Kind": 3 + }, + { + "EndIndex": 16344, + "Kind": 3 + }, + { + "EndIndex": 16374, + "Kind": 3 + }, + { + "EndIndex": 16397, + "Kind": 3 + }, + { + "EndIndex": 16403, + "Kind": 3 + }, + { + "EndIndex": 16435, + "Kind": 3 + }, + { + "EndIndex": 16465, + "Kind": 3 + }, + { + "EndIndex": 16488, + "Kind": 3 + }, + { + "EndIndex": 16494, + "Kind": 3 + }, + { + "EndIndex": 16518, + "Kind": 3 + }, + { + "EndIndex": 16547, + "Kind": 3 + }, + { + "EndIndex": 16566, + "Kind": 3 + }, + { + "EndIndex": 16572, + "Kind": 3 + }, + { + "EndIndex": 16590, + "Kind": 3 + }, + { + "EndIndex": 16632, + "Kind": 3 + }, + { + "EndIndex": 16958, + "Kind": 3 + }, + { + "EndIndex": 16980, + "Kind": 3 + }, + { + "EndIndex": 16986, + "Kind": 3 + }, + { + "EndIndex": 17017, + "Kind": 3 + }, + { + "EndIndex": 17047, + "Kind": 3 + }, + { + "EndIndex": 17070, + "Kind": 3 + }, + { + "EndIndex": 17076, + "Kind": 3 + }, + { + "EndIndex": 17094, + "Kind": 3 + }, + { + "EndIndex": 17144, + "Kind": 3 + }, + { + "EndIndex": 17908, + "Kind": 3 + }, + { + "EndIndex": 17930, + "Kind": 3 + }, + { + "EndIndex": 17936, + "Kind": 3 + }, + { + "EndIndex": 17938, + "Kind": 3 + }, + { + "EndIndex": 17955, + "Kind": 3 + }, + { + "EndIndex": 17975, + "Kind": 3 + }, + { + "EndIndex": 17997, + "Kind": 3 + }, + { + "EndIndex": 18072, + "Kind": 3 + }, + { + "EndIndex": 18096, + "Kind": 3 + }, + { + "EndIndex": 18117, + "Kind": 3 + }, + { + "EndIndex": 18141, + "Kind": 3 + }, + { + "EndIndex": 18147, + "Kind": 3 + }, + { + "EndIndex": 18178, + "Kind": 3 + }, + { + "EndIndex": 18208, + "Kind": 3 + }, + { + "EndIndex": 18232, + "Kind": 3 + }, + { + "EndIndex": 18238, + "Kind": 3 + }, + { + "EndIndex": 18263, + "Kind": 3 + }, + { + "EndIndex": 18284, + "Kind": 3 + }, + { + "EndIndex": 18306, + "Kind": 3 + }, + { + "EndIndex": 18312, + "Kind": 3 + }, + { + "EndIndex": 18335, + "Kind": 3 + }, + { + "EndIndex": 18369, + "Kind": 3 + }, + { + "EndIndex": 18408, + "Kind": 3 + }, + { + "EndIndex": 18431, + "Kind": 3 + }, + { + "EndIndex": 18437, + "Kind": 3 + }, + { + "EndIndex": 18467, + "Kind": 3 + }, + { + "EndIndex": 18498, + "Kind": 3 + }, + { + "EndIndex": 18520, + "Kind": 3 + }, + { + "EndIndex": 18526, + "Kind": 3 + }, + { + "EndIndex": 18552, + "Kind": 3 + }, + { + "EndIndex": 18575, + "Kind": 3 + }, + { + "EndIndex": 18595, + "Kind": 3 + }, + { + "EndIndex": 18601, + "Kind": 3 + }, + { + "EndIndex": 18637, + "Kind": 3 + }, + { + "EndIndex": 18668, + "Kind": 3 + }, + { + "EndIndex": 18686, + "Kind": 3 + }, + { + "EndIndex": 18692, + "Kind": 3 + }, + { + "EndIndex": 18732, + "Kind": 3 + }, + { + "EndIndex": 18787, + "Kind": 3 + }, + { + "EndIndex": 18806, + "Kind": 3 + }, + { + "EndIndex": 18812, + "Kind": 3 + }, + { + "EndIndex": 18842, + "Kind": 3 + }, + { + "EndIndex": 18873, + "Kind": 3 + }, + { + "EndIndex": 18895, + "Kind": 3 + }, + { + "EndIndex": 18901, + "Kind": 3 + }, + { + "EndIndex": 18940, + "Kind": 3 + }, + { + "EndIndex": 18979, + "Kind": 3 + }, + { + "EndIndex": 18993, + "Kind": 3 + }, + { + "EndIndex": 18999, + "Kind": 3 + }, + { + "EndIndex": 19017, + "Kind": 3 + }, + { + "EndIndex": 19061, + "Kind": 3 + }, + { + "EndIndex": 19404, + "Kind": 3 + }, + { + "EndIndex": 19423, + "Kind": 3 + }, + { + "EndIndex": 19429, + "Kind": 3 + }, + { + "EndIndex": 19460, + "Kind": 3 + }, + { + "EndIndex": 19479, + "Kind": 3 + }, + { + "EndIndex": 19485, + "Kind": 3 + }, + { + "EndIndex": 19515, + "Kind": 3 + }, + { + "EndIndex": 19545, + "Kind": 3 + }, + { + "EndIndex": 19567, + "Kind": 3 + }, + { + "EndIndex": 19573, + "Kind": 3 + }, + { + "EndIndex": 19598, + "Kind": 3 + }, + { + "EndIndex": 19628, + "Kind": 3 + }, + { + "EndIndex": 19646, + "Kind": 3 + }, + { + "EndIndex": 19652, + "Kind": 3 + }, + { + "EndIndex": 19694, + "Kind": 3 + }, + { + "EndIndex": 19773, + "Kind": 3 + }, + { + "EndIndex": 19787, + "Kind": 3 + }, + { + "EndIndex": 19793, + "Kind": 3 + }, + { + "EndIndex": 19811, + "Kind": 3 + }, + { + "EndIndex": 19844, + "Kind": 3 + }, + { + "EndIndex": 19995, + "Kind": 3 + }, + { + "EndIndex": 20016, + "Kind": 3 + }, + { + "EndIndex": 20022, + "Kind": 3 + }, + { + "EndIndex": 20046, + "Kind": 3 + }, + { + "EndIndex": 20067, + "Kind": 3 + }, + { + "EndIndex": 20085, + "Kind": 3 + }, + { + "EndIndex": 20091, + "Kind": 3 + }, + { + "EndIndex": 20121, + "Kind": 3 + }, + { + "EndIndex": 20152, + "Kind": 3 + }, + { + "EndIndex": 20174, + "Kind": 3 + }, + { + "EndIndex": 20180, + "Kind": 3 + }, + { + "EndIndex": 20210, + "Kind": 3 + }, + { + "EndIndex": 20240, + "Kind": 3 + }, + { + "EndIndex": 20262, + "Kind": 3 + }, + { + "EndIndex": 20268, + "Kind": 3 + }, + { + "EndIndex": 20299, + "Kind": 3 + }, + { + "EndIndex": 20329, + "Kind": 3 + }, + { + "EndIndex": 20353, + "Kind": 3 + }, + { + "EndIndex": 20359, + "Kind": 3 + }, + { + "EndIndex": 20390, + "Kind": 3 + }, + { + "EndIndex": 20420, + "Kind": 3 + }, + { + "EndIndex": 20444, + "Kind": 3 + }, + { + "EndIndex": 20450, + "Kind": 3 + }, + { + "EndIndex": 20480, + "Kind": 3 + }, + { + "EndIndex": 20511, + "Kind": 3 + }, + { + "EndIndex": 20533, + "Kind": 3 + }, + { + "EndIndex": 20539, + "Kind": 3 + }, + { + "EndIndex": 20563, + "Kind": 3 + }, + { + "EndIndex": 20580, + "Kind": 3 + }, + { + "EndIndex": 20604, + "Kind": 3 + }, + { + "EndIndex": 20610, + "Kind": 3 + }, + { + "EndIndex": 20634, + "Kind": 3 + }, + { + "EndIndex": 20651, + "Kind": 3 + }, + { + "EndIndex": 20675, + "Kind": 3 + }, + { + "EndIndex": 20681, + "Kind": 3 + }, + { + "EndIndex": 20717, + "Kind": 3 + }, + { + "EndIndex": 20758, + "Kind": 3 + }, + { + "EndIndex": 20782, + "Kind": 3 + }, + { + "EndIndex": 20788, + "Kind": 3 + }, + { + "EndIndex": 20820, + "Kind": 3 + }, + { + "EndIndex": 20850, + "Kind": 3 + }, + { + "EndIndex": 20874, + "Kind": 3 + }, + { + "EndIndex": 20880, + "Kind": 3 + }, + { + "EndIndex": 20915, + "Kind": 3 + }, + { + "EndIndex": 20954, + "Kind": 3 + }, + { + "EndIndex": 20977, + "Kind": 3 + }, + { + "EndIndex": 20983, + "Kind": 3 + }, + { + "EndIndex": 21008, + "Kind": 3 + }, + { + "EndIndex": 21038, + "Kind": 3 + }, + { + "EndIndex": 21057, + "Kind": 3 + }, + { + "EndIndex": 21063, + "Kind": 3 + }, + { + "EndIndex": 21100, + "Kind": 3 + }, + { + "EndIndex": 21131, + "Kind": 3 + }, + { + "EndIndex": 21155, + "Kind": 3 + }, + { + "EndIndex": 21161, + "Kind": 3 + }, + { + "EndIndex": 21193, + "Kind": 3 + }, + { + "EndIndex": 21223, + "Kind": 3 + }, + { + "EndIndex": 21247, + "Kind": 3 + }, + { + "EndIndex": 21253, + "Kind": 3 + }, + { + "EndIndex": 21285, + "Kind": 3 + }, + { + "EndIndex": 21315, + "Kind": 3 + }, + { + "EndIndex": 21339, + "Kind": 3 + }, + { + "EndIndex": 21345, + "Kind": 3 + }, + { + "EndIndex": 21380, + "Kind": 3 + }, + { + "EndIndex": 21521, + "Kind": 3 + }, + { + "EndIndex": 21545, + "Kind": 3 + }, + { + "EndIndex": 21551, + "Kind": 3 + }, + { + "EndIndex": 21588, + "Kind": 3 + }, + { + "EndIndex": 21629, + "Kind": 3 + }, + { + "EndIndex": 21653, + "Kind": 3 + }, + { + "EndIndex": 21659, + "Kind": 3 + }, + { + "EndIndex": 21691, + "Kind": 3 + }, + { + "EndIndex": 21721, + "Kind": 3 + }, + { + "EndIndex": 21745, + "Kind": 3 + }, + { + "EndIndex": 21751, + "Kind": 3 + }, + { + "EndIndex": 21787, + "Kind": 3 + }, + { + "EndIndex": 21817, + "Kind": 3 + }, + { + "EndIndex": 21841, + "Kind": 3 + }, + { + "EndIndex": 21847, + "Kind": 3 + }, + { + "EndIndex": 21865, + "Kind": 3 + }, + { + "EndIndex": 21915, + "Kind": 3 + }, + { + "EndIndex": 22405, + "Kind": 3 + }, + { + "EndIndex": 22419, + "Kind": 3 + }, + { + "EndIndex": 22425, + "Kind": 3 + }, + { + "EndIndex": 22449, + "Kind": 3 + }, + { + "EndIndex": 22478, + "Kind": 3 + }, + { + "EndIndex": 22497, + "Kind": 3 + }, + { + "EndIndex": 22503, + "Kind": 3 + }, + { + "EndIndex": 22534, + "Kind": 3 + }, + { + "EndIndex": 22564, + "Kind": 3 + }, + { + "EndIndex": 22588, + "Kind": 3 + }, + { + "EndIndex": 22594, + "Kind": 3 + }, + { + "EndIndex": 22612, + "Kind": 3 + }, + { + "EndIndex": 22654, + "Kind": 3 + }, + { + "EndIndex": 22980, + "Kind": 3 + }, + { + "EndIndex": 23002, + "Kind": 3 + }, + { + "EndIndex": 23008, + "Kind": 3 + }, + { + "EndIndex": 23043, + "Kind": 3 + }, + { + "EndIndex": 23073, + "Kind": 3 + }, + { + "EndIndex": 23101, + "Kind": 3 + }, + { + "EndIndex": 23107, + "Kind": 3 + }, + { + "EndIndex": 23133, + "Kind": 3 + }, + { + "EndIndex": 23194, + "Kind": 3 + }, + { + "EndIndex": 23218, + "Kind": 3 + }, + { + "EndIndex": 23224, + "Kind": 3 + }, + { + "EndIndex": 23257, + "Kind": 3 + }, + { + "EndIndex": 23588, + "Kind": 3 + }, + { + "EndIndex": 23611, + "Kind": 3 + }, + { + "EndIndex": 23617, + "Kind": 3 + }, + { + "EndIndex": 23643, + "Kind": 3 + }, + { + "EndIndex": 23703, + "Kind": 3 + }, + { + "EndIndex": 23733, + "Kind": 3 + }, + { + "EndIndex": 23739, + "Kind": 3 + }, + { + "EndIndex": 23757, + "Kind": 3 + }, + { + "EndIndex": 23794, + "Kind": 3 + }, + { + "EndIndex": 23954, + "Kind": 3 + }, + { + "EndIndex": 23974, + "Kind": 3 + }, + { + "EndIndex": 23980, + "Kind": 3 + }, + { + "EndIndex": 24000, + "Kind": 3 + }, + { + "EndIndex": 24163, + "Kind": 3 + }, + { + "EndIndex": 24182, + "Kind": 3 + }, + { + "EndIndex": 24188, + "Kind": 3 + }, + { + "EndIndex": 24203, + "Kind": 3 + }, + { + "EndIndex": 24224, + "Kind": 3 + }, + { + "EndIndex": 24274, + "Kind": 3 + }, + { + "EndIndex": 24288, + "Kind": 3 + }, + { + "EndIndex": 24294, + "Kind": 3 + }, + { + "EndIndex": 24321, + "Kind": 3 + }, + { + "EndIndex": 24372, + "Kind": 3 + }, + { + "EndIndex": 24394, + "Kind": 3 + }, + { + "EndIndex": 24400, + "Kind": 3 + }, + { + "EndIndex": 24415, + "Kind": 3 + }, + { + "EndIndex": 24436, + "Kind": 3 + }, + { + "EndIndex": 24481, + "Kind": 3 + }, + { + "EndIndex": 24495, + "Kind": 3 + }, + { + "EndIndex": 24501, + "Kind": 3 + }, + { + "EndIndex": 24503, + "Kind": 3 + }, + { + "EndIndex": 24522, + "Kind": 3 + }, + { + "EndIndex": 24546, + "Kind": 3 + }, + { + "EndIndex": 24694, + "Kind": 3 + }, + { + "EndIndex": 24718, + "Kind": 3 + }, + { + "EndIndex": 24739, + "Kind": 3 + }, + { + "EndIndex": 24765, + "Kind": 3 + }, + { + "EndIndex": 24771, + "Kind": 3 + }, + { + "EndIndex": 24802, + "Kind": 3 + }, + { + "EndIndex": 24832, + "Kind": 3 + }, + { + "EndIndex": 24858, + "Kind": 3 + }, + { + "EndIndex": 24864, + "Kind": 3 + }, + { + "EndIndex": 24889, + "Kind": 3 + }, + { + "EndIndex": 24910, + "Kind": 3 + }, + { + "EndIndex": 24932, + "Kind": 3 + }, + { + "EndIndex": 24938, + "Kind": 3 + }, + { + "EndIndex": 24963, + "Kind": 3 + }, + { + "EndIndex": 24997, + "Kind": 3 + }, + { + "EndIndex": 25036, + "Kind": 3 + }, + { + "EndIndex": 25059, + "Kind": 3 + }, + { + "EndIndex": 25065, + "Kind": 3 + }, + { + "EndIndex": 25095, + "Kind": 3 + }, + { + "EndIndex": 25126, + "Kind": 3 + }, + { + "EndIndex": 25148, + "Kind": 3 + }, + { + "EndIndex": 25154, + "Kind": 3 + }, + { + "EndIndex": 25180, + "Kind": 3 + }, + { + "EndIndex": 25203, + "Kind": 3 + }, + { + "EndIndex": 25223, + "Kind": 3 + }, + { + "EndIndex": 25229, + "Kind": 3 + }, + { + "EndIndex": 25265, + "Kind": 3 + }, + { + "EndIndex": 25296, + "Kind": 3 + }, + { + "EndIndex": 25314, + "Kind": 3 + }, + { + "EndIndex": 25320, + "Kind": 3 + }, + { + "EndIndex": 25360, + "Kind": 3 + }, + { + "EndIndex": 25448, + "Kind": 3 + }, + { + "EndIndex": 25467, + "Kind": 3 + }, + { + "EndIndex": 25473, + "Kind": 3 + }, + { + "EndIndex": 25503, + "Kind": 3 + }, + { + "EndIndex": 25534, + "Kind": 3 + }, + { + "EndIndex": 25556, + "Kind": 3 + }, + { + "EndIndex": 25562, + "Kind": 3 + }, + { + "EndIndex": 25601, + "Kind": 3 + }, + { + "EndIndex": 25640, + "Kind": 3 + }, + { + "EndIndex": 25654, + "Kind": 3 + }, + { + "EndIndex": 25660, + "Kind": 3 + }, + { + "EndIndex": 25691, + "Kind": 3 + }, + { + "EndIndex": 25710, + "Kind": 3 + }, + { + "EndIndex": 25716, + "Kind": 3 + }, + { + "EndIndex": 25746, + "Kind": 3 + }, + { + "EndIndex": 25776, + "Kind": 3 + }, + { + "EndIndex": 25798, + "Kind": 3 + }, + { + "EndIndex": 25804, + "Kind": 3 + }, + { + "EndIndex": 25829, + "Kind": 3 + }, + { + "EndIndex": 25859, + "Kind": 3 + }, + { + "EndIndex": 25877, + "Kind": 3 + }, + { + "EndIndex": 25883, + "Kind": 3 + }, + { + "EndIndex": 25925, + "Kind": 3 + }, + { + "EndIndex": 26077, + "Kind": 3 + }, + { + "EndIndex": 26091, + "Kind": 3 + }, + { + "EndIndex": 26097, + "Kind": 3 + }, + { + "EndIndex": 26115, + "Kind": 3 + }, + { + "EndIndex": 26148, + "Kind": 3 + }, + { + "EndIndex": 26299, + "Kind": 3 + }, + { + "EndIndex": 26320, + "Kind": 3 + }, + { + "EndIndex": 26326, + "Kind": 3 + }, + { + "EndIndex": 26350, + "Kind": 3 + }, + { + "EndIndex": 26371, + "Kind": 3 + }, + { + "EndIndex": 26389, + "Kind": 3 + }, + { + "EndIndex": 26395, + "Kind": 3 + }, + { + "EndIndex": 26425, + "Kind": 3 + }, + { + "EndIndex": 26456, + "Kind": 3 + }, + { + "EndIndex": 26478, + "Kind": 3 + }, + { + "EndIndex": 26484, + "Kind": 3 + }, + { + "EndIndex": 26514, + "Kind": 3 + }, + { + "EndIndex": 26544, + "Kind": 3 + }, + { + "EndIndex": 26566, + "Kind": 3 + }, + { + "EndIndex": 26572, + "Kind": 3 + }, + { + "EndIndex": 26603, + "Kind": 3 + }, + { + "EndIndex": 26633, + "Kind": 3 + }, + { + "EndIndex": 26659, + "Kind": 3 + }, + { + "EndIndex": 26665, + "Kind": 3 + }, + { + "EndIndex": 26696, + "Kind": 3 + }, + { + "EndIndex": 26726, + "Kind": 3 + }, + { + "EndIndex": 26752, + "Kind": 3 + }, + { + "EndIndex": 26758, + "Kind": 3 + }, + { + "EndIndex": 26788, + "Kind": 3 + }, + { + "EndIndex": 26819, + "Kind": 3 + }, + { + "EndIndex": 26841, + "Kind": 3 + }, + { + "EndIndex": 26847, + "Kind": 3 + }, + { + "EndIndex": 26871, + "Kind": 3 + }, + { + "EndIndex": 26888, + "Kind": 3 + }, + { + "EndIndex": 26914, + "Kind": 3 + }, + { + "EndIndex": 26920, + "Kind": 3 + }, + { + "EndIndex": 26944, + "Kind": 3 + }, + { + "EndIndex": 26961, + "Kind": 3 + }, + { + "EndIndex": 26987, + "Kind": 3 + }, + { + "EndIndex": 26993, + "Kind": 3 + }, + { + "EndIndex": 27029, + "Kind": 3 + }, + { + "EndIndex": 27070, + "Kind": 3 + }, + { + "EndIndex": 27096, + "Kind": 3 + }, + { + "EndIndex": 27102, + "Kind": 3 + }, + { + "EndIndex": 27134, + "Kind": 3 + }, + { + "EndIndex": 27164, + "Kind": 3 + }, + { + "EndIndex": 27190, + "Kind": 3 + }, + { + "EndIndex": 27196, + "Kind": 3 + }, + { + "EndIndex": 27231, + "Kind": 3 + }, + { + "EndIndex": 27270, + "Kind": 3 + }, + { + "EndIndex": 27293, + "Kind": 3 + }, + { + "EndIndex": 27299, + "Kind": 3 + }, + { + "EndIndex": 27324, + "Kind": 3 + }, + { + "EndIndex": 27354, + "Kind": 3 + }, + { + "EndIndex": 27373, + "Kind": 3 + }, + { + "EndIndex": 27379, + "Kind": 3 + }, + { + "EndIndex": 27416, + "Kind": 3 + }, + { + "EndIndex": 27447, + "Kind": 3 + }, + { + "EndIndex": 27473, + "Kind": 3 + }, + { + "EndIndex": 27479, + "Kind": 3 + }, + { + "EndIndex": 27511, + "Kind": 3 + }, + { + "EndIndex": 27541, + "Kind": 3 + }, + { + "EndIndex": 27567, + "Kind": 3 + }, + { + "EndIndex": 27573, + "Kind": 3 + }, + { + "EndIndex": 27605, + "Kind": 3 + }, + { + "EndIndex": 27635, + "Kind": 3 + }, + { + "EndIndex": 27661, + "Kind": 3 + }, + { + "EndIndex": 27667, + "Kind": 3 + }, + { + "EndIndex": 27704, + "Kind": 3 + }, + { + "EndIndex": 27745, + "Kind": 3 + }, + { + "EndIndex": 27771, + "Kind": 3 + }, + { + "EndIndex": 27777, + "Kind": 3 + }, + { + "EndIndex": 27809, + "Kind": 3 + }, + { + "EndIndex": 27839, + "Kind": 3 + }, + { + "EndIndex": 27865, + "Kind": 3 + }, + { + "EndIndex": 27871, + "Kind": 3 + }, + { + "EndIndex": 27907, + "Kind": 3 + }, + { + "EndIndex": 27937, + "Kind": 3 + }, + { + "EndIndex": 27963, + "Kind": 3 + }, + { + "EndIndex": 27969, + "Kind": 3 + }, + { + "EndIndex": 27993, + "Kind": 3 + }, + { + "EndIndex": 28022, + "Kind": 3 + }, + { + "EndIndex": 28041, + "Kind": 3 + }, + { + "EndIndex": 28047, + "Kind": 3 + }, + { + "EndIndex": 28078, + "Kind": 3 + }, + { + "EndIndex": 28108, + "Kind": 3 + }, + { + "EndIndex": 28134, + "Kind": 3 + }, + { + "EndIndex": 28140, + "Kind": 3 + }, + { + "EndIndex": 28158, + "Kind": 3 + }, + { + "EndIndex": 28200, + "Kind": 3 + }, + { + "EndIndex": 28526, + "Kind": 3 + }, + { + "EndIndex": 28548, + "Kind": 3 + }, + { + "EndIndex": 28554, + "Kind": 3 + }, + { + "EndIndex": 28589, + "Kind": 3 + }, + { + "EndIndex": 28619, + "Kind": 3 + }, + { + "EndIndex": 28647, + "Kind": 3 + }, + { + "EndIndex": 28653, + "Kind": 3 + }, + { + "EndIndex": 28679, + "Kind": 3 + }, + { + "EndIndex": 28798, + "Kind": 3 + }, + { + "EndIndex": 28828, + "Kind": 3 + }, + { + "EndIndex": 28834, + "Kind": 3 + }, + { + "EndIndex": 28849, + "Kind": 3 + }, + { + "EndIndex": 28870, + "Kind": 3 + }, + { + "EndIndex": 28920, + "Kind": 3 + }, + { + "EndIndex": 28934, + "Kind": 3 + }, + { + "EndIndex": 28940, + "Kind": 3 + }, + { + "EndIndex": 28955, + "Kind": 3 + }, + { + "EndIndex": 28976, + "Kind": 3 + }, + { + "EndIndex": 29021, + "Kind": 3 + }, + { + "EndIndex": 29035, + "Kind": 3 + }, + { + "EndIndex": 29041, + "Kind": 3 + }, + { + "EndIndex": 29043, + "Kind": 3 + }, + { + "EndIndex": 29066, + "Kind": 3 + }, + { + "EndIndex": 29088, + "Kind": 3 + }, + { + "EndIndex": 29334, + "Kind": 3 + }, + { + "EndIndex": 29365, + "Kind": 3 + }, + { + "EndIndex": 29395, + "Kind": 3 + }, + { + "EndIndex": 29419, + "Kind": 3 + }, + { + "EndIndex": 29425, + "Kind": 3 + }, + { + "EndIndex": 29448, + "Kind": 3 + }, + { + "EndIndex": 29482, + "Kind": 3 + }, + { + "EndIndex": 29513, + "Kind": 3 + }, + { + "EndIndex": 29535, + "Kind": 3 + }, + { + "EndIndex": 29541, + "Kind": 3 + }, + { + "EndIndex": 29571, + "Kind": 3 + }, + { + "EndIndex": 29602, + "Kind": 3 + }, + { + "EndIndex": 29624, + "Kind": 3 + }, + { + "EndIndex": 29630, + "Kind": 3 + }, + { + "EndIndex": 29660, + "Kind": 3 + }, + { + "EndIndex": 29691, + "Kind": 3 + }, + { + "EndIndex": 29713, + "Kind": 3 + }, + { + "EndIndex": 29719, + "Kind": 3 + }, + { + "EndIndex": 29758, + "Kind": 3 + }, + { + "EndIndex": 29797, + "Kind": 3 + }, + { + "EndIndex": 29811, + "Kind": 3 + }, + { + "EndIndex": 29817, + "Kind": 3 + }, + { + "EndIndex": 29850, + "Kind": 3 + }, + { + "EndIndex": 29879, + "Kind": 3 + }, + { + "EndIndex": 29893, + "Kind": 3 + }, + { + "EndIndex": 29899, + "Kind": 3 + }, + { + "EndIndex": 29930, + "Kind": 3 + }, + { + "EndIndex": 29949, + "Kind": 3 + }, + { + "EndIndex": 29955, + "Kind": 3 + }, + { + "EndIndex": 29985, + "Kind": 3 + }, + { + "EndIndex": 30015, + "Kind": 3 + }, + { + "EndIndex": 30037, + "Kind": 3 + }, + { + "EndIndex": 30043, + "Kind": 3 + }, + { + "EndIndex": 30068, + "Kind": 3 + }, + { + "EndIndex": 30098, + "Kind": 3 + }, + { + "EndIndex": 30116, + "Kind": 3 + }, + { + "EndIndex": 30122, + "Kind": 3 + }, + { + "EndIndex": 30164, + "Kind": 3 + }, + { + "EndIndex": 30414, + "Kind": 3 + }, + { + "EndIndex": 30428, + "Kind": 3 + }, + { + "EndIndex": 30434, + "Kind": 3 + }, + { + "EndIndex": 30452, + "Kind": 3 + }, + { + "EndIndex": 30485, + "Kind": 3 + }, + { + "EndIndex": 30636, + "Kind": 3 + }, + { + "EndIndex": 30657, + "Kind": 3 + }, + { + "EndIndex": 30663, + "Kind": 3 + }, + { + "EndIndex": 30688, + "Kind": 3 + }, + { + "EndIndex": 30721, + "Kind": 3 + }, + { + "EndIndex": 30757, + "Kind": 3 + }, + { + "EndIndex": 30763, + "Kind": 3 + }, + { + "EndIndex": 30793, + "Kind": 3 + }, + { + "EndIndex": 30824, + "Kind": 3 + }, + { + "EndIndex": 30846, + "Kind": 3 + }, + { + "EndIndex": 30852, + "Kind": 3 + }, + { + "EndIndex": 30876, + "Kind": 3 + }, + { + "EndIndex": 30905, + "Kind": 3 + }, + { + "EndIndex": 30923, + "Kind": 3 + }, + { + "EndIndex": 30929, + "Kind": 3 + }, + { + "EndIndex": 30959, + "Kind": 3 + }, + { + "EndIndex": 30989, + "Kind": 3 + }, + { + "EndIndex": 31011, + "Kind": 3 + }, + { + "EndIndex": 31017, + "Kind": 3 + }, + { + "EndIndex": 31048, + "Kind": 3 + }, + { + "EndIndex": 31078, + "Kind": 3 + }, + { + "EndIndex": 31102, + "Kind": 3 + }, + { + "EndIndex": 31108, + "Kind": 3 + }, + { + "EndIndex": 31138, + "Kind": 3 + }, + { + "EndIndex": 31169, + "Kind": 3 + }, + { + "EndIndex": 31191, + "Kind": 3 + }, + { + "EndIndex": 31197, + "Kind": 3 + }, + { + "EndIndex": 31222, + "Kind": 3 + }, + { + "EndIndex": 31252, + "Kind": 3 + }, + { + "EndIndex": 31271, + "Kind": 3 + }, + { + "EndIndex": 31277, + "Kind": 3 + }, + { + "EndIndex": 31309, + "Kind": 3 + }, + { + "EndIndex": 31339, + "Kind": 3 + }, + { + "EndIndex": 31363, + "Kind": 3 + }, + { + "EndIndex": 31369, + "Kind": 3 + }, + { + "EndIndex": 31387, + "Kind": 3 + }, + { + "EndIndex": 31429, + "Kind": 3 + }, + { + "EndIndex": 31755, + "Kind": 3 + }, + { + "EndIndex": 31777, + "Kind": 3 + }, + { + "EndIndex": 31783, + "Kind": 3 + }, + { + "EndIndex": 31812, + "Kind": 3 + }, + { + "EndIndex": 31862, + "Kind": 3 + }, + { + "EndIndex": 31880, + "Kind": 3 + }, + { + "EndIndex": 31886, + "Kind": 3 + }, + { + "EndIndex": 31928, + "Kind": 3 + }, + { + "EndIndex": 32018, + "Kind": 3 + }, + { + "EndIndex": 32036, + "Kind": 3 + }, + { + "EndIndex": 32042, + "Kind": 3 + }, + { + "EndIndex": 32044, + "Kind": 3 + }, + { + "EndIndex": 32063, + "Kind": 3 + }, + { + "EndIndex": 32084, + "Kind": 3 + }, + { + "EndIndex": 32236, + "Kind": 3 + }, + { + "EndIndex": 32267, + "Kind": 3 + }, + { + "EndIndex": 32297, + "Kind": 3 + }, + { + "EndIndex": 32320, + "Kind": 3 + }, + { + "EndIndex": 32326, + "Kind": 3 + }, + { + "EndIndex": 32348, + "Kind": 3 + }, + { + "EndIndex": 32382, + "Kind": 3 + }, + { + "EndIndex": 32413, + "Kind": 3 + }, + { + "EndIndex": 32435, + "Kind": 3 + }, + { + "EndIndex": 32441, + "Kind": 3 + }, + { + "EndIndex": 32474, + "Kind": 3 + }, + { + "EndIndex": 32503, + "Kind": 3 + }, + { + "EndIndex": 32524, + "Kind": 3 + }, + { + "EndIndex": 32530, + "Kind": 3 + }, + { + "EndIndex": 32560, + "Kind": 3 + }, + { + "EndIndex": 32591, + "Kind": 3 + }, + { + "EndIndex": 32613, + "Kind": 3 + }, + { + "EndIndex": 32619, + "Kind": 3 + }, + { + "EndIndex": 32649, + "Kind": 3 + }, + { + "EndIndex": 32680, + "Kind": 3 + }, + { + "EndIndex": 32702, + "Kind": 3 + }, + { + "EndIndex": 32708, + "Kind": 3 + }, + { + "EndIndex": 32747, + "Kind": 3 + }, + { + "EndIndex": 32786, + "Kind": 3 + }, + { + "EndIndex": 32800, + "Kind": 3 + }, + { + "EndIndex": 32806, + "Kind": 3 + }, + { + "EndIndex": 32841, + "Kind": 3 + }, + { + "EndIndex": 32879, + "Kind": 3 + }, + { + "EndIndex": 32893, + "Kind": 3 + }, + { + "EndIndex": 32899, + "Kind": 3 + }, + { + "EndIndex": 32929, + "Kind": 3 + }, + { + "EndIndex": 32959, + "Kind": 3 + }, + { + "EndIndex": 32981, + "Kind": 3 + }, + { + "EndIndex": 32987, + "Kind": 3 + }, + { + "EndIndex": 33008, + "Kind": 3 + }, + { + "EndIndex": 33040, + "Kind": 3 + }, + { + "EndIndex": 33074, + "Kind": 3 + }, + { + "EndIndex": 33095, + "Kind": 3 + }, + { + "EndIndex": 33101, + "Kind": 3 + }, + { + "EndIndex": 33133, + "Kind": 3 + }, + { + "EndIndex": 33167, + "Kind": 3 + }, + { + "EndIndex": 33188, + "Kind": 3 + }, + { + "EndIndex": 33194, + "Kind": 3 + }, + { + "EndIndex": 33236, + "Kind": 3 + }, + { + "EndIndex": 33392, + "Kind": 3 + }, + { + "EndIndex": 33406, + "Kind": 3 + }, + { + "EndIndex": 33412, + "Kind": 3 + }, + { + "EndIndex": 33430, + "Kind": 3 + }, + { + "EndIndex": 33463, + "Kind": 3 + }, + { + "EndIndex": 33614, + "Kind": 3 + }, + { + "EndIndex": 33635, + "Kind": 3 + }, + { + "EndIndex": 33641, + "Kind": 3 + }, + { + "EndIndex": 33666, + "Kind": 3 + }, + { + "EndIndex": 33699, + "Kind": 3 + }, + { + "EndIndex": 33734, + "Kind": 3 + }, + { + "EndIndex": 33740, + "Kind": 3 + }, + { + "EndIndex": 33770, + "Kind": 3 + }, + { + "EndIndex": 33801, + "Kind": 3 + }, + { + "EndIndex": 33823, + "Kind": 3 + }, + { + "EndIndex": 33829, + "Kind": 3 + }, + { + "EndIndex": 33853, + "Kind": 3 + }, + { + "EndIndex": 33882, + "Kind": 3 + }, + { + "EndIndex": 33900, + "Kind": 3 + }, + { + "EndIndex": 33906, + "Kind": 3 + }, + { + "EndIndex": 33936, + "Kind": 3 + }, + { + "EndIndex": 33966, + "Kind": 3 + }, + { + "EndIndex": 33988, + "Kind": 3 + }, + { + "EndIndex": 33994, + "Kind": 3 + }, + { + "EndIndex": 34025, + "Kind": 3 + }, + { + "EndIndex": 34055, + "Kind": 3 + }, + { + "EndIndex": 34078, + "Kind": 3 + }, + { + "EndIndex": 34084, + "Kind": 3 + }, + { + "EndIndex": 34114, + "Kind": 3 + }, + { + "EndIndex": 34145, + "Kind": 3 + }, + { + "EndIndex": 34167, + "Kind": 3 + }, + { + "EndIndex": 34173, + "Kind": 3 + }, + { + "EndIndex": 34198, + "Kind": 3 + }, + { + "EndIndex": 34228, + "Kind": 3 + }, + { + "EndIndex": 34247, + "Kind": 3 + }, + { + "EndIndex": 34253, + "Kind": 3 + }, + { + "EndIndex": 34282, + "Kind": 3 + }, + { + "EndIndex": 34334, + "Kind": 3 + }, + { + "EndIndex": 34369, + "Kind": 3 + }, + { + "EndIndex": 34375, + "Kind": 3 + }, + { + "EndIndex": 34407, + "Kind": 3 + }, + { + "EndIndex": 34437, + "Kind": 3 + }, + { + "EndIndex": 34460, + "Kind": 3 + }, + { + "EndIndex": 34466, + "Kind": 3 + }, + { + "EndIndex": 34506, + "Kind": 3 + }, + { + "EndIndex": 34541, + "Kind": 3 + }, + { + "EndIndex": 34562, + "Kind": 3 + }, + { + "EndIndex": 34568, + "Kind": 3 + }, + { + "EndIndex": 34595, + "Kind": 3 + }, + { + "EndIndex": 34655, + "Kind": 3 + }, + { + "EndIndex": 34673, + "Kind": 3 + }, + { + "EndIndex": 34679, + "Kind": 3 + }, + { + "EndIndex": 34697, + "Kind": 3 + }, + { + "EndIndex": 34739, + "Kind": 3 + }, + { + "EndIndex": 35065, + "Kind": 3 + }, + { + "EndIndex": 35087, + "Kind": 3 + }, + { + "EndIndex": 35093, + "Kind": 3 + }, + { + "EndIndex": 35124, + "Kind": 3 + }, + { + "EndIndex": 35173, + "Kind": 3 + }, + { + "EndIndex": 35194, + "Kind": 3 + }, + { + "EndIndex": 35200, + "Kind": 3 + }, + { + "EndIndex": 35222, + "Kind": 3 + }, + { + "EndIndex": 35261, + "Kind": 3 + }, + { + "EndIndex": 35282, + "Kind": 3 + }, + { + "EndIndex": 35288, + "Kind": 3 + }, + { + "EndIndex": 35309, + "Kind": 3 + }, + { + "EndIndex": 35355, + "Kind": 3 + }, + { + "EndIndex": 35378, + "Kind": 3 + }, + { + "EndIndex": 35384, + "Kind": 3 + }, + { + "EndIndex": 35413, + "Kind": 3 + }, + { + "EndIndex": 35463, + "Kind": 3 + }, + { + "EndIndex": 35481, + "Kind": 3 + }, + { + "EndIndex": 35487, + "Kind": 3 + }, + { + "EndIndex": 35520, + "Kind": 3 + }, + { + "EndIndex": 35584, + "Kind": 3 + }, + { + "EndIndex": 35605, + "Kind": 3 + }, + { + "EndIndex": 35611, + "Kind": 3 + }, + { + "EndIndex": 35653, + "Kind": 3 + }, + { + "EndIndex": 35743, + "Kind": 3 + }, + { + "EndIndex": 35761, + "Kind": 3 + }, + { + "EndIndex": 35767, + "Kind": 3 + }, + { + "EndIndex": 35805, + "Kind": 3 + }, + { + "EndIndex": 35844, + "Kind": 3 + }, + { + "EndIndex": 35865, + "Kind": 3 + }, + { + "EndIndex": 35871, + "Kind": 3 + }, + { + "EndIndex": 35898, + "Kind": 3 + }, + { + "EndIndex": 36021, + "Kind": 3 + }, + { + "EndIndex": 36045, + "Kind": 3 + }, + { + "EndIndex": 36051, + "Kind": 3 + }, + { + "EndIndex": 36081, + "Kind": 3 + }, + { + "EndIndex": 36176, + "Kind": 3 + }, + { + "EndIndex": 36197, + "Kind": 3 + }, + { + "EndIndex": 36203, + "Kind": 3 + }, + { + "EndIndex": 36227, + "Kind": 3 + }, + { + "EndIndex": 36258, + "Kind": 3 + }, + { + "EndIndex": 36279, + "Kind": 3 + }, + { + "EndIndex": 36285, + "Kind": 3 + }, + { + "EndIndex": 36306, + "Kind": 3 + }, + { + "EndIndex": 36341, + "Kind": 3 + }, + { + "EndIndex": 36362, + "Kind": 3 + }, + { + "EndIndex": 36368, + "Kind": 3 + }, + { + "EndIndex": 36370, + "Kind": 3 + }, + { + "EndIndex": 36387, + "Kind": 3 + }, + { + "EndIndex": 36408, + "Kind": 3 + }, + { + "EndIndex": 36794, + "Kind": 3 + }, + { + "EndIndex": 36816, + "Kind": 3 + }, + { + "EndIndex": 36850, + "Kind": 3 + }, + { + "EndIndex": 36919, + "Kind": 3 + }, + { + "EndIndex": 36941, + "Kind": 3 + }, + { + "EndIndex": 36947, + "Kind": 3 + }, + { + "EndIndex": 36980, + "Kind": 3 + }, + { + "EndIndex": 37009, + "Kind": 3 + }, + { + "EndIndex": 37030, + "Kind": 3 + }, + { + "EndIndex": 37036, + "Kind": 3 + }, + { + "EndIndex": 37066, + "Kind": 3 + }, + { + "EndIndex": 37097, + "Kind": 3 + }, + { + "EndIndex": 37119, + "Kind": 3 + }, + { + "EndIndex": 37125, + "Kind": 3 + }, + { + "EndIndex": 37155, + "Kind": 3 + }, + { + "EndIndex": 37186, + "Kind": 3 + }, + { + "EndIndex": 37208, + "Kind": 3 + }, + { + "EndIndex": 37214, + "Kind": 3 + }, + { + "EndIndex": 37253, + "Kind": 3 + }, + { + "EndIndex": 37292, + "Kind": 3 + }, + { + "EndIndex": 37306, + "Kind": 3 + }, + { + "EndIndex": 37312, + "Kind": 3 + }, + { + "EndIndex": 37345, + "Kind": 3 + }, + { + "EndIndex": 37383, + "Kind": 3 + }, + { + "EndIndex": 37397, + "Kind": 3 + }, + { + "EndIndex": 37403, + "Kind": 3 + }, + { + "EndIndex": 37433, + "Kind": 3 + }, + { + "EndIndex": 37463, + "Kind": 3 + }, + { + "EndIndex": 37485, + "Kind": 3 + }, + { + "EndIndex": 37491, + "Kind": 3 + }, + { + "EndIndex": 37512, + "Kind": 3 + }, + { + "EndIndex": 37547, + "Kind": 3 + }, + { + "EndIndex": 37937, + "Kind": 3 + }, + { + "EndIndex": 37951, + "Kind": 3 + }, + { + "EndIndex": 37957, + "Kind": 3 + }, + { + "EndIndex": 37975, + "Kind": 3 + }, + { + "EndIndex": 38008, + "Kind": 3 + }, + { + "EndIndex": 38159, + "Kind": 3 + }, + { + "EndIndex": 38180, + "Kind": 3 + }, + { + "EndIndex": 38186, + "Kind": 3 + }, + { + "EndIndex": 38211, + "Kind": 3 + }, + { + "EndIndex": 38244, + "Kind": 3 + }, + { + "EndIndex": 38275, + "Kind": 3 + }, + { + "EndIndex": 38281, + "Kind": 3 + }, + { + "EndIndex": 38311, + "Kind": 3 + }, + { + "EndIndex": 38342, + "Kind": 3 + }, + { + "EndIndex": 38364, + "Kind": 3 + }, + { + "EndIndex": 38370, + "Kind": 3 + }, + { + "EndIndex": 38394, + "Kind": 3 + }, + { + "EndIndex": 38423, + "Kind": 3 + }, + { + "EndIndex": 38441, + "Kind": 3 + }, + { + "EndIndex": 38447, + "Kind": 3 + }, + { + "EndIndex": 38477, + "Kind": 3 + }, + { + "EndIndex": 38507, + "Kind": 3 + }, + { + "EndIndex": 38529, + "Kind": 3 + }, + { + "EndIndex": 38535, + "Kind": 3 + }, + { + "EndIndex": 38565, + "Kind": 3 + }, + { + "EndIndex": 38596, + "Kind": 3 + }, + { + "EndIndex": 38618, + "Kind": 3 + }, + { + "EndIndex": 38624, + "Kind": 3 + }, + { + "EndIndex": 38649, + "Kind": 3 + }, + { + "EndIndex": 38679, + "Kind": 3 + }, + { + "EndIndex": 38698, + "Kind": 3 + }, + { + "EndIndex": 38704, + "Kind": 3 + }, + { + "EndIndex": 38744, + "Kind": 3 + }, + { + "EndIndex": 38779, + "Kind": 3 + }, + { + "EndIndex": 38800, + "Kind": 3 + }, + { + "EndIndex": 38806, + "Kind": 3 + }, + { + "EndIndex": 38833, + "Kind": 3 + }, + { + "EndIndex": 38892, + "Kind": 3 + }, + { + "EndIndex": 38910, + "Kind": 3 + }, + { + "EndIndex": 38916, + "Kind": 3 + }, + { + "EndIndex": 38934, + "Kind": 3 + }, + { + "EndIndex": 38976, + "Kind": 3 + }, + { + "EndIndex": 39302, + "Kind": 3 + }, + { + "EndIndex": 39324, + "Kind": 3 + }, + { + "EndIndex": 39330, + "Kind": 3 + }, + { + "EndIndex": 39352, + "Kind": 3 + }, + { + "EndIndex": 39408, + "Kind": 3 + }, + { + "EndIndex": 39429, + "Kind": 3 + }, + { + "EndIndex": 39435, + "Kind": 3 + }, + { + "EndIndex": 39456, + "Kind": 3 + }, + { + "EndIndex": 39499, + "Kind": 3 + }, + { + "EndIndex": 39522, + "Kind": 3 + }, + { + "EndIndex": 39528, + "Kind": 3 + }, + { + "EndIndex": 39546, + "Kind": 3 + }, + { + "EndIndex": 39593, + "Kind": 3 + }, + { + "EndIndex": 39677, + "Kind": 3 + }, + { + "EndIndex": 39696, + "Kind": 3 + }, + { + "EndIndex": 39702, + "Kind": 3 + }, + { + "EndIndex": 39736, + "Kind": 3 + }, + { + "EndIndex": 39815, + "Kind": 3 + }, + { + "EndIndex": 39839, + "Kind": 3 + }, + { + "EndIndex": 39845, + "Kind": 3 + }, + { + "EndIndex": 39867, + "Kind": 3 + }, + { + "EndIndex": 39939, + "Kind": 3 + }, + { + "EndIndex": 39971, + "Kind": 3 + }, + { + "EndIndex": 39977, + "Kind": 3 + }, + { + "EndIndex": 39998, + "Kind": 3 + }, + { + "EndIndex": 40068, + "Kind": 3 + }, + { + "EndIndex": 40099, + "Kind": 3 + }, + { + "EndIndex": 40105, + "Kind": 3 + }, + { + "EndIndex": 40136, + "Kind": 3 + }, + { + "EndIndex": 40298, + "Kind": 3 + }, + { + "EndIndex": 40329, + "Kind": 3 + }, + { + "EndIndex": 40335, + "Kind": 3 + }, + { + "EndIndex": 40370, + "Kind": 3 + }, + { + "EndIndex": 40494, + "Kind": 3 + }, + { + "EndIndex": 40526, + "Kind": 3 + }, + { + "EndIndex": 40532, + "Kind": 3 + }, + { + "EndIndex": 40573, + "Kind": 3 + }, + { + "EndIndex": 40723, + "Kind": 3 + }, + { + "EndIndex": 40747, + "Kind": 3 + }, + { + "EndIndex": 40753, + "Kind": 3 + }, + { + "EndIndex": 40779, + "Kind": 3 + }, + { + "EndIndex": 41079, + "Kind": 3 + }, + { + "EndIndex": 41100, + "Kind": 3 + }, + { + "EndIndex": 41106, + "Kind": 3 + }, + { + "EndIndex": 41129, + "Kind": 3 + }, + { + "EndIndex": 41195, + "Kind": 3 + }, + { + "EndIndex": 41228, + "Kind": 3 + }, + { + "EndIndex": 41234, + "Kind": 3 + }, + { + "EndIndex": 41236, + "Kind": 3 + }, + { + "EndIndex": 41253, + "Kind": 3 + }, + { + "EndIndex": 41273, + "Kind": 3 + }, + { + "EndIndex": 41396, + "Kind": 3 + }, + { + "EndIndex": 41427, + "Kind": 3 + }, + { + "EndIndex": 41457, + "Kind": 3 + }, + { + "EndIndex": 41479, + "Kind": 3 + }, + { + "EndIndex": 41485, + "Kind": 3 + }, + { + "EndIndex": 41506, + "Kind": 3 + }, + { + "EndIndex": 41542, + "Kind": 3 + }, + { + "EndIndex": 41584, + "Kind": 3 + }, + { + "EndIndex": 41606, + "Kind": 3 + }, + { + "EndIndex": 41612, + "Kind": 3 + }, + { + "EndIndex": 41642, + "Kind": 3 + }, + { + "EndIndex": 41673, + "Kind": 3 + }, + { + "EndIndex": 41695, + "Kind": 3 + }, + { + "EndIndex": 41701, + "Kind": 3 + }, + { + "EndIndex": 41731, + "Kind": 3 + }, + { + "EndIndex": 41762, + "Kind": 3 + }, + { + "EndIndex": 41784, + "Kind": 3 + }, + { + "EndIndex": 41790, + "Kind": 3 + }, + { + "EndIndex": 41829, + "Kind": 3 + }, + { + "EndIndex": 41868, + "Kind": 3 + }, + { + "EndIndex": 41882, + "Kind": 3 + }, + { + "EndIndex": 41888, + "Kind": 3 + }, + { + "EndIndex": 41918, + "Kind": 3 + }, + { + "EndIndex": 41948, + "Kind": 3 + }, + { + "EndIndex": 41970, + "Kind": 3 + }, + { + "EndIndex": 41976, + "Kind": 3 + }, + { + "EndIndex": 41997, + "Kind": 3 + }, + { + "EndIndex": 42029, + "Kind": 3 + }, + { + "EndIndex": 42060, + "Kind": 3 + }, + { + "EndIndex": 42081, + "Kind": 3 + }, + { + "EndIndex": 42087, + "Kind": 3 + }, + { + "EndIndex": 42122, + "Kind": 3 + }, + { + "EndIndex": 42249, + "Kind": 3 + }, + { + "EndIndex": 42263, + "Kind": 3 + }, + { + "EndIndex": 42269, + "Kind": 3 + }, + { + "EndIndex": 42287, + "Kind": 3 + }, + { + "EndIndex": 42320, + "Kind": 3 + }, + { + "EndIndex": 42471, + "Kind": 3 + }, + { + "EndIndex": 42492, + "Kind": 3 + }, + { + "EndIndex": 42498, + "Kind": 3 + }, + { + "EndIndex": 42529, + "Kind": 3 + }, + { + "EndIndex": 42560, + "Kind": 3 + }, + { + "EndIndex": 42581, + "Kind": 3 + }, + { + "EndIndex": 42587, + "Kind": 3 + }, + { + "EndIndex": 42619, + "Kind": 3 + }, + { + "EndIndex": 42650, + "Kind": 3 + }, + { + "EndIndex": 42671, + "Kind": 3 + }, + { + "EndIndex": 42677, + "Kind": 3 + }, + { + "EndIndex": 42702, + "Kind": 3 + }, + { + "EndIndex": 42735, + "Kind": 3 + }, + { + "EndIndex": 42769, + "Kind": 3 + }, + { + "EndIndex": 42775, + "Kind": 3 + }, + { + "EndIndex": 42807, + "Kind": 3 + }, + { + "EndIndex": 42838, + "Kind": 3 + }, + { + "EndIndex": 42859, + "Kind": 3 + }, + { + "EndIndex": 42865, + "Kind": 3 + }, + { + "EndIndex": 42895, + "Kind": 3 + }, + { + "EndIndex": 42926, + "Kind": 3 + }, + { + "EndIndex": 42948, + "Kind": 3 + }, + { + "EndIndex": 42954, + "Kind": 3 + }, + { + "EndIndex": 42978, + "Kind": 3 + }, + { + "EndIndex": 43007, + "Kind": 3 + }, + { + "EndIndex": 43025, + "Kind": 3 + }, + { + "EndIndex": 43031, + "Kind": 3 + }, + { + "EndIndex": 43061, + "Kind": 3 + }, + { + "EndIndex": 43091, + "Kind": 3 + }, + { + "EndIndex": 43113, + "Kind": 3 + }, + { + "EndIndex": 43119, + "Kind": 3 + }, + { + "EndIndex": 43149, + "Kind": 3 + }, + { + "EndIndex": 43180, + "Kind": 3 + }, + { + "EndIndex": 43202, + "Kind": 3 + }, + { + "EndIndex": 43208, + "Kind": 3 + }, + { + "EndIndex": 43238, + "Kind": 3 + }, + { + "EndIndex": 43268, + "Kind": 3 + }, + { + "EndIndex": 43290, + "Kind": 3 + }, + { + "EndIndex": 43296, + "Kind": 3 + }, + { + "EndIndex": 43328, + "Kind": 3 + }, + { + "EndIndex": 43358, + "Kind": 3 + }, + { + "EndIndex": 43380, + "Kind": 3 + }, + { + "EndIndex": 43386, + "Kind": 3 + }, + { + "EndIndex": 43413, + "Kind": 3 + }, + { + "EndIndex": 43463, + "Kind": 3 + }, + { + "EndIndex": 43493, + "Kind": 3 + }, + { + "EndIndex": 43499, + "Kind": 3 + }, + { + "EndIndex": 43524, + "Kind": 3 + }, + { + "EndIndex": 43554, + "Kind": 3 + }, + { + "EndIndex": 43573, + "Kind": 3 + }, + { + "EndIndex": 43579, + "Kind": 3 + }, + { + "EndIndex": 43610, + "Kind": 3 + }, + { + "EndIndex": 43640, + "Kind": 3 + }, + { + "EndIndex": 43662, + "Kind": 3 + }, + { + "EndIndex": 43668, + "Kind": 3 + }, + { + "EndIndex": 43700, + "Kind": 3 + }, + { + "EndIndex": 43730, + "Kind": 3 + }, + { + "EndIndex": 43752, + "Kind": 3 + }, + { + "EndIndex": 43758, + "Kind": 3 + }, + { + "EndIndex": 43790, + "Kind": 3 + }, + { + "EndIndex": 43820, + "Kind": 3 + }, + { + "EndIndex": 43842, + "Kind": 3 + }, + { + "EndIndex": 43848, + "Kind": 3 + }, + { + "EndIndex": 43875, + "Kind": 3 + }, + { + "EndIndex": 43934, + "Kind": 3 + }, + { + "EndIndex": 43952, + "Kind": 3 + }, + { + "EndIndex": 43958, + "Kind": 3 + }, + { + "EndIndex": 43989, + "Kind": 3 + }, + { + "EndIndex": 44019, + "Kind": 3 + }, + { + "EndIndex": 44041, + "Kind": 3 + }, + { + "EndIndex": 44047, + "Kind": 3 + }, + { + "EndIndex": 44065, + "Kind": 3 + }, + { + "EndIndex": 44107, + "Kind": 3 + }, + { + "EndIndex": 44433, + "Kind": 3 + }, + { + "EndIndex": 44455, + "Kind": 3 + }, + { + "EndIndex": 44461, + "Kind": 3 + }, + { + "EndIndex": 44492, + "Kind": 3 + }, + { + "EndIndex": 44522, + "Kind": 3 + }, + { + "EndIndex": 44544, + "Kind": 3 + }, + { + "EndIndex": 44550, + "Kind": 3 + }, + { + "EndIndex": 44577, + "Kind": 3 + }, + { + "EndIndex": 44670, + "Kind": 3 + }, + { + "EndIndex": 44691, + "Kind": 3 + }, + { + "EndIndex": 44697, + "Kind": 3 + }, + { + "EndIndex": 44719, + "Kind": 3 + }, + { + "EndIndex": 44765, + "Kind": 3 + }, + { + "EndIndex": 44786, + "Kind": 3 + }, + { + "EndIndex": 44792, + "Kind": 3 + }, + { + "EndIndex": 44813, + "Kind": 3 + }, + { + "EndIndex": 44856, + "Kind": 3 + }, + { + "EndIndex": 44878, + "Kind": 3 + }, + { + "EndIndex": 44884, + "Kind": 3 + }, + { + "EndIndex": 44918, + "Kind": 3 + }, + { + "EndIndex": 45049, + "Kind": 3 + }, + { + "EndIndex": 45071, + "Kind": 3 + }, + { + "EndIndex": 45077, + "Kind": 3 + }, + { + "EndIndex": 45120, + "Kind": 3 + }, + { + "EndIndex": 45181, + "Kind": 3 + }, + { + "EndIndex": 45202, + "Kind": 3 + }, + { + "EndIndex": 45208, + "Kind": 3 + }, + { + "EndIndex": 45238, + "Kind": 3 + }, + { + "EndIndex": 45344, + "Kind": 3 + }, + { + "EndIndex": 45365, + "Kind": 3 + }, + { + "EndIndex": 45371, + "Kind": 3 + }, + { + "EndIndex": 45407, + "Kind": 3 + }, + { + "EndIndex": 45514, + "Kind": 3 + }, + { + "EndIndex": 45536, + "Kind": 3 + }, + { + "EndIndex": 45542, + "Kind": 3 + }, + { + "EndIndex": 45587, + "Kind": 3 + }, + { + "EndIndex": 45656, + "Kind": 3 + }, + { + "EndIndex": 45677, + "Kind": 3 + }, + { + "EndIndex": 45683, + "Kind": 3 + }, + { + "EndIndex": 45717, + "Kind": 3 + }, + { + "EndIndex": 45778, + "Kind": 3 + }, + { + "EndIndex": 45800, + "Kind": 3 + }, + { + "EndIndex": 45806, + "Kind": 3 + }, + { + "EndIndex": 45838, + "Kind": 3 + }, + { + "EndIndex": 45895, + "Kind": 3 + }, + { + "EndIndex": 45917, + "Kind": 3 + }, + { + "EndIndex": 45923, + "Kind": 3 + }, + { + "EndIndex": 45957, + "Kind": 3 + }, + { + "EndIndex": 46014, + "Kind": 3 + }, + { + "EndIndex": 46036, + "Kind": 3 + }, + { + "EndIndex": 46042, + "Kind": 3 + }, + { + "EndIndex": 46062, + "Kind": 3 + }, + { + "EndIndex": 46155, + "Kind": 3 + }, + { + "EndIndex": 46169, + "Kind": 3 + }, + { + "EndIndex": 46175, + "Kind": 3 + }, + { + "EndIndex": 46204, + "Kind": 3 + }, + { + "EndIndex": 46319, + "Kind": 3 + }, + { + "EndIndex": 46340, + "Kind": 3 + }, + { + "EndIndex": 46346, + "Kind": 3 + }, + { + "EndIndex": 46390, + "Kind": 3 + }, + { + "EndIndex": 46519, + "Kind": 3 + }, + { + "EndIndex": 46541, + "Kind": 3 + }, + { + "EndIndex": 46547, + "Kind": 3 + }, + { + "EndIndex": 46600, + "Kind": 3 + }, + { + "EndIndex": 46677, + "Kind": 3 + }, + { + "EndIndex": 46698, + "Kind": 3 + }, + { + "EndIndex": 46704, + "Kind": 3 + }, + { + "EndIndex": 46735, + "Kind": 3 + }, + { + "EndIndex": 46832, + "Kind": 3 + }, + { + "EndIndex": 46854, + "Kind": 3 + }, + { + "EndIndex": 46860, + "Kind": 3 + }, + { + "EndIndex": 46892, + "Kind": 3 + }, + { + "EndIndex": 46953, + "Kind": 3 + }, + { + "EndIndex": 46974, + "Kind": 3 + }, + { + "EndIndex": 46980, + "Kind": 3 + }, + { + "EndIndex": 46982, + "Kind": 3 + }, + { + "EndIndex": 46997, + "Kind": 3 + }, + { + "EndIndex": 47023, + "Kind": 3 + }, + { + "EndIndex": 47172, + "Kind": 3 + }, + { + "EndIndex": 47203, + "Kind": 3 + }, + { + "EndIndex": 47233, + "Kind": 3 + }, + { + "EndIndex": 47261, + "Kind": 3 + }, + { + "EndIndex": 47267, + "Kind": 3 + }, + { + "EndIndex": 47294, + "Kind": 3 + }, + { + "EndIndex": 47330, + "Kind": 3 + }, + { + "EndIndex": 47372, + "Kind": 3 + }, + { + "EndIndex": 47394, + "Kind": 3 + }, + { + "EndIndex": 47400, + "Kind": 3 + }, + { + "EndIndex": 47430, + "Kind": 3 + }, + { + "EndIndex": 47461, + "Kind": 3 + }, + { + "EndIndex": 47483, + "Kind": 3 + }, + { + "EndIndex": 47489, + "Kind": 3 + }, + { + "EndIndex": 47519, + "Kind": 3 + }, + { + "EndIndex": 47550, + "Kind": 3 + }, + { + "EndIndex": 47572, + "Kind": 3 + }, + { + "EndIndex": 47578, + "Kind": 3 + }, + { + "EndIndex": 47617, + "Kind": 3 + }, + { + "EndIndex": 47656, + "Kind": 3 + }, + { + "EndIndex": 47670, + "Kind": 3 + }, + { + "EndIndex": 47676, + "Kind": 3 + }, + { + "EndIndex": 47706, + "Kind": 3 + }, + { + "EndIndex": 47736, + "Kind": 3 + }, + { + "EndIndex": 47758, + "Kind": 3 + }, + { + "EndIndex": 47764, + "Kind": 3 + }, + { + "EndIndex": 47789, + "Kind": 3 + }, + { + "EndIndex": 47819, + "Kind": 3 + }, + { + "EndIndex": 47837, + "Kind": 3 + }, + { + "EndIndex": 47843, + "Kind": 3 + }, + { + "EndIndex": 47878, + "Kind": 3 + }, + { + "EndIndex": 48031, + "Kind": 3 + }, + { + "EndIndex": 48045, + "Kind": 3 + }, + { + "EndIndex": 48051, + "Kind": 3 + }, + { + "EndIndex": 48069, + "Kind": 3 + }, + { + "EndIndex": 48102, + "Kind": 3 + }, + { + "EndIndex": 48253, + "Kind": 3 + }, + { + "EndIndex": 48274, + "Kind": 3 + }, + { + "EndIndex": 48280, + "Kind": 3 + }, + { + "EndIndex": 48305, + "Kind": 3 + }, + { + "EndIndex": 48338, + "Kind": 3 + }, + { + "EndIndex": 48372, + "Kind": 3 + }, + { + "EndIndex": 48378, + "Kind": 3 + }, + { + "EndIndex": 48408, + "Kind": 3 + }, + { + "EndIndex": 48439, + "Kind": 3 + }, + { + "EndIndex": 48461, + "Kind": 3 + }, + { + "EndIndex": 48467, + "Kind": 3 + }, + { + "EndIndex": 48491, + "Kind": 3 + }, + { + "EndIndex": 48520, + "Kind": 3 + }, + { + "EndIndex": 48538, + "Kind": 3 + }, + { + "EndIndex": 48544, + "Kind": 3 + }, + { + "EndIndex": 48574, + "Kind": 3 + }, + { + "EndIndex": 48604, + "Kind": 3 + }, + { + "EndIndex": 48626, + "Kind": 3 + }, + { + "EndIndex": 48632, + "Kind": 3 + }, + { + "EndIndex": 48662, + "Kind": 3 + }, + { + "EndIndex": 48693, + "Kind": 3 + }, + { + "EndIndex": 48715, + "Kind": 3 + }, + { + "EndIndex": 48721, + "Kind": 3 + }, + { + "EndIndex": 48751, + "Kind": 3 + }, + { + "EndIndex": 48781, + "Kind": 3 + }, + { + "EndIndex": 48809, + "Kind": 3 + }, + { + "EndIndex": 48815, + "Kind": 3 + }, + { + "EndIndex": 48847, + "Kind": 3 + }, + { + "EndIndex": 48877, + "Kind": 3 + }, + { + "EndIndex": 48905, + "Kind": 3 + }, + { + "EndIndex": 48911, + "Kind": 3 + }, + { + "EndIndex": 48938, + "Kind": 3 + }, + { + "EndIndex": 48988, + "Kind": 3 + }, + { + "EndIndex": 49018, + "Kind": 3 + }, + { + "EndIndex": 49024, + "Kind": 3 + }, + { + "EndIndex": 49049, + "Kind": 3 + }, + { + "EndIndex": 49079, + "Kind": 3 + }, + { + "EndIndex": 49098, + "Kind": 3 + }, + { + "EndIndex": 49104, + "Kind": 3 + }, + { + "EndIndex": 49135, + "Kind": 3 + }, + { + "EndIndex": 49165, + "Kind": 3 + }, + { + "EndIndex": 49193, + "Kind": 3 + }, + { + "EndIndex": 49199, + "Kind": 3 + }, + { + "EndIndex": 49231, + "Kind": 3 + }, + { + "EndIndex": 49261, + "Kind": 3 + }, + { + "EndIndex": 49289, + "Kind": 3 + }, + { + "EndIndex": 49295, + "Kind": 3 + }, + { + "EndIndex": 49327, + "Kind": 3 + }, + { + "EndIndex": 49357, + "Kind": 3 + }, + { + "EndIndex": 49385, + "Kind": 3 + }, + { + "EndIndex": 49391, + "Kind": 3 + }, + { + "EndIndex": 49418, + "Kind": 3 + }, + { + "EndIndex": 49477, + "Kind": 3 + }, + { + "EndIndex": 49495, + "Kind": 3 + }, + { + "EndIndex": 49501, + "Kind": 3 + }, + { + "EndIndex": 49532, + "Kind": 3 + }, + { + "EndIndex": 49562, + "Kind": 3 + }, + { + "EndIndex": 49590, + "Kind": 3 + }, + { + "EndIndex": 49596, + "Kind": 3 + }, + { + "EndIndex": 49614, + "Kind": 3 + }, + { + "EndIndex": 49656, + "Kind": 3 + }, + { + "EndIndex": 49982, + "Kind": 3 + }, + { + "EndIndex": 50004, + "Kind": 3 + }, + { + "EndIndex": 50010, + "Kind": 3 + }, + { + "EndIndex": 50041, + "Kind": 3 + }, + { + "EndIndex": 50071, + "Kind": 3 + }, + { + "EndIndex": 50099, + "Kind": 3 + }, + { + "EndIndex": 50105, + "Kind": 3 + }, + { + "EndIndex": 50126, + "Kind": 3 + }, + { + "EndIndex": 50169, + "Kind": 3 + }, + { + "EndIndex": 50197, + "Kind": 3 + }, + { + "EndIndex": 50203, + "Kind": 3 + }, + { + "EndIndex": 50237, + "Kind": 3 + }, + { + "EndIndex": 50368, + "Kind": 3 + }, + { + "EndIndex": 50396, + "Kind": 3 + }, + { + "EndIndex": 50402, + "Kind": 3 + }, + { + "EndIndex": 50438, + "Kind": 3 + }, + { + "EndIndex": 50545, + "Kind": 3 + }, + { + "EndIndex": 50573, + "Kind": 3 + }, + { + "EndIndex": 50579, + "Kind": 3 + }, + { + "EndIndex": 50613, + "Kind": 3 + }, + { + "EndIndex": 50674, + "Kind": 3 + }, + { + "EndIndex": 50696, + "Kind": 3 + }, + { + "EndIndex": 50702, + "Kind": 3 + }, + { + "EndIndex": 50734, + "Kind": 3 + }, + { + "EndIndex": 50791, + "Kind": 3 + }, + { + "EndIndex": 50813, + "Kind": 3 + }, + { + "EndIndex": 50819, + "Kind": 3 + }, + { + "EndIndex": 50853, + "Kind": 3 + }, + { + "EndIndex": 50910, + "Kind": 3 + }, + { + "EndIndex": 50932, + "Kind": 3 + }, + { + "EndIndex": 50938, + "Kind": 3 + }, + { + "EndIndex": 50982, + "Kind": 3 + }, + { + "EndIndex": 51111, + "Kind": 3 + }, + { + "EndIndex": 51139, + "Kind": 3 + }, + { + "EndIndex": 51145, + "Kind": 3 + }, + { + "EndIndex": 51176, + "Kind": 3 + }, + { + "EndIndex": 51273, + "Kind": 3 + }, + { + "EndIndex": 51301, + "Kind": 3 + }, + { + "EndIndex": 51307, + "Kind": 3 + }, + { + "EndIndex": 51309, + "Kind": 3 + }, + { + "EndIndex": 51336, + "Kind": 3 + }, + { + "EndIndex": 51358, + "Kind": 3 + }, + { + "EndIndex": 51834, + "Kind": 3 + }, + { + "EndIndex": 51865, + "Kind": 3 + }, + { + "EndIndex": 51895, + "Kind": 3 + }, + { + "EndIndex": 51919, + "Kind": 3 + }, + { + "EndIndex": 51925, + "Kind": 3 + }, + { + "EndIndex": 51948, + "Kind": 3 + }, + { + "EndIndex": 51982, + "Kind": 3 + }, + { + "EndIndex": 52013, + "Kind": 3 + }, + { + "EndIndex": 52035, + "Kind": 3 + }, + { + "EndIndex": 52041, + "Kind": 3 + }, + { + "EndIndex": 52071, + "Kind": 3 + }, + { + "EndIndex": 52102, + "Kind": 3 + }, + { + "EndIndex": 52124, + "Kind": 3 + }, + { + "EndIndex": 52130, + "Kind": 3 + }, + { + "EndIndex": 52160, + "Kind": 3 + }, + { + "EndIndex": 52191, + "Kind": 3 + }, + { + "EndIndex": 52213, + "Kind": 3 + }, + { + "EndIndex": 52219, + "Kind": 3 + }, + { + "EndIndex": 52258, + "Kind": 3 + }, + { + "EndIndex": 52297, + "Kind": 3 + }, + { + "EndIndex": 52311, + "Kind": 3 + }, + { + "EndIndex": 52317, + "Kind": 3 + }, + { + "EndIndex": 52350, + "Kind": 3 + }, + { + "EndIndex": 52379, + "Kind": 3 + }, + { + "EndIndex": 52403, + "Kind": 3 + }, + { + "EndIndex": 52409, + "Kind": 3 + }, + { + "EndIndex": 52440, + "Kind": 3 + }, + { + "EndIndex": 52459, + "Kind": 3 + }, + { + "EndIndex": 52465, + "Kind": 3 + }, + { + "EndIndex": 52495, + "Kind": 3 + }, + { + "EndIndex": 52525, + "Kind": 3 + }, + { + "EndIndex": 52547, + "Kind": 3 + }, + { + "EndIndex": 52553, + "Kind": 3 + }, + { + "EndIndex": 52578, + "Kind": 3 + }, + { + "EndIndex": 52608, + "Kind": 3 + }, + { + "EndIndex": 52626, + "Kind": 3 + }, + { + "EndIndex": 52632, + "Kind": 3 + }, + { + "EndIndex": 52688, + "Kind": 3 + }, + { + "EndIndex": 53168, + "Kind": 3 + }, + { + "EndIndex": 53182, + "Kind": 3 + }, + { + "EndIndex": 53188, + "Kind": 3 + }, + { + "EndIndex": 53206, + "Kind": 3 + }, + { + "EndIndex": 53239, + "Kind": 3 + }, + { + "EndIndex": 53390, + "Kind": 3 + }, + { + "EndIndex": 53411, + "Kind": 3 + }, + { + "EndIndex": 53417, + "Kind": 3 + }, + { + "EndIndex": 53442, + "Kind": 3 + }, + { + "EndIndex": 53475, + "Kind": 3 + }, + { + "EndIndex": 53511, + "Kind": 3 + }, + { + "EndIndex": 53517, + "Kind": 3 + }, + { + "EndIndex": 53547, + "Kind": 3 + }, + { + "EndIndex": 53578, + "Kind": 3 + }, + { + "EndIndex": 53600, + "Kind": 3 + }, + { + "EndIndex": 53606, + "Kind": 3 + }, + { + "EndIndex": 53630, + "Kind": 3 + }, + { + "EndIndex": 53659, + "Kind": 3 + }, + { + "EndIndex": 53677, + "Kind": 3 + }, + { + "EndIndex": 53683, + "Kind": 3 + }, + { + "EndIndex": 53713, + "Kind": 3 + }, + { + "EndIndex": 53743, + "Kind": 3 + }, + { + "EndIndex": 53765, + "Kind": 3 + }, + { + "EndIndex": 53771, + "Kind": 3 + }, + { + "EndIndex": 53802, + "Kind": 3 + }, + { + "EndIndex": 53832, + "Kind": 3 + }, + { + "EndIndex": 53856, + "Kind": 3 + }, + { + "EndIndex": 53862, + "Kind": 3 + }, + { + "EndIndex": 53893, + "Kind": 3 + }, + { + "EndIndex": 53923, + "Kind": 3 + }, + { + "EndIndex": 53947, + "Kind": 3 + }, + { + "EndIndex": 53953, + "Kind": 3 + }, + { + "EndIndex": 53983, + "Kind": 3 + }, + { + "EndIndex": 54014, + "Kind": 3 + }, + { + "EndIndex": 54036, + "Kind": 3 + }, + { + "EndIndex": 54042, + "Kind": 3 + }, + { + "EndIndex": 54067, + "Kind": 3 + }, + { + "EndIndex": 54097, + "Kind": 3 + }, + { + "EndIndex": 54116, + "Kind": 3 + }, + { + "EndIndex": 54122, + "Kind": 3 + }, + { + "EndIndex": 54154, + "Kind": 3 + }, + { + "EndIndex": 54184, + "Kind": 3 + }, + { + "EndIndex": 54208, + "Kind": 3 + }, + { + "EndIndex": 54214, + "Kind": 3 + }, + { + "EndIndex": 54246, + "Kind": 3 + }, + { + "EndIndex": 54276, + "Kind": 3 + }, + { + "EndIndex": 54300, + "Kind": 3 + }, + { + "EndIndex": 54306, + "Kind": 3 + }, + { + "EndIndex": 54330, + "Kind": 3 + }, + { + "EndIndex": 54359, + "Kind": 3 + }, + { + "EndIndex": 54378, + "Kind": 3 + }, + { + "EndIndex": 54384, + "Kind": 3 + }, + { + "EndIndex": 54402, + "Kind": 3 + }, + { + "EndIndex": 54444, + "Kind": 3 + }, + { + "EndIndex": 54770, + "Kind": 3 + }, + { + "EndIndex": 54792, + "Kind": 3 + }, + { + "EndIndex": 54798, + "Kind": 3 + }, + { + "EndIndex": 54825, + "Kind": 3 + }, + { + "EndIndex": 54963, + "Kind": 3 + }, + { + "EndIndex": 54987, + "Kind": 3 + }, + { + "EndIndex": 54993, + "Kind": 3 + }, + { + "EndIndex": 55038, + "Kind": 3 + }, + { + "EndIndex": 55215, + "Kind": 3 + }, + { + "EndIndex": 55239, + "Kind": 3 + }, + { + "EndIndex": 55245, + "Kind": 3 + }, + { + "EndIndex": 55289, + "Kind": 3 + }, + { + "EndIndex": 55503, + "Kind": 3 + }, + { + "EndIndex": 55521, + "Kind": 3 + }, + { + "EndIndex": 55527, + "Kind": 3 + }, + { + "EndIndex": 55568, + "Kind": 3 + }, + { + "EndIndex": 56037, + "Kind": 3 + }, + { + "EndIndex": 56056, + "Kind": 3 + }, + { + "EndIndex": 56062, + "Kind": 3 + }, + { + "EndIndex": 56112, + "Kind": 3 + }, + { + "EndIndex": 56392, + "Kind": 3 + }, + { + "EndIndex": 56414, + "Kind": 3 + }, + { + "EndIndex": 56420, + "Kind": 3 + }, + { + "EndIndex": 56458, + "Kind": 3 + }, + { + "EndIndex": 56645, + "Kind": 3 + }, + { + "EndIndex": 56669, + "Kind": 3 + }, + { + "EndIndex": 56675, + "Kind": 3 + }, + { + "EndIndex": 56718, + "Kind": 3 + }, + { + "EndIndex": 56974, + "Kind": 3 + }, + { + "EndIndex": 56992, + "Kind": 3 + }, + { + "EndIndex": 56998, + "Kind": 3 + }, + { + "EndIndex": 57016, + "Kind": 3 + }, + { + "EndIndex": 57053, + "Kind": 3 + }, + { + "EndIndex": 57232, + "Kind": 3 + }, + { + "EndIndex": 57252, + "Kind": 3 + }, + { + "EndIndex": 57258, + "Kind": 3 + }, + { + "EndIndex": 57278, + "Kind": 3 + }, + { + "EndIndex": 57418, + "Kind": 3 + }, + { + "EndIndex": 57437, + "Kind": 3 + }, + { + "EndIndex": 57443, + "Kind": 3 + }, + { + "EndIndex": 57487, + "Kind": 3 + }, + { + "EndIndex": 57774, + "Kind": 3 + }, + { + "EndIndex": 57792, + "Kind": 3 + }, + { + "EndIndex": 57798, + "Kind": 3 + }, + { + "EndIndex": 57822, + "Kind": 3 + }, + { + "EndIndex": 57968, + "Kind": 3 + }, + { + "EndIndex": 57990, + "Kind": 3 + }, + { + "EndIndex": 57996, + "Kind": 3 + }, + { + "EndIndex": 58020, + "Kind": 3 + }, + { + "EndIndex": 58164, + "Kind": 3 + }, + { + "EndIndex": 58186, + "Kind": 3 + }, + { + "EndIndex": 58192, + "Kind": 3 + }, + { + "EndIndex": 58216, + "Kind": 3 + }, + { + "EndIndex": 58328, + "Kind": 3 + }, + { + "EndIndex": 58349, + "Kind": 3 + }, + { + "EndIndex": 58355, + "Kind": 3 + }, + { + "EndIndex": 58379, + "Kind": 3 + }, + { + "EndIndex": 58519, + "Kind": 3 + }, + { + "EndIndex": 58541, + "Kind": 3 + }, + { + "EndIndex": 58547, + "Kind": 3 + }, + { + "EndIndex": 58571, + "Kind": 3 + }, + { + "EndIndex": 58726, + "Kind": 3 + }, + { + "EndIndex": 58748, + "Kind": 3 + }, + { + "EndIndex": 58754, + "Kind": 3 + }, + { + "EndIndex": 58778, + "Kind": 3 + }, + { + "EndIndex": 58922, + "Kind": 3 + }, + { + "EndIndex": 58944, + "Kind": 3 + }, + { + "EndIndex": 58950, + "Kind": 3 + }, + { + "EndIndex": 58974, + "Kind": 3 + }, + { + "EndIndex": 59220, + "Kind": 3 + }, + { + "EndIndex": 59242, + "Kind": 3 + }, + { + "EndIndex": 59248, + "Kind": 3 + }, + { + "EndIndex": 59272, + "Kind": 3 + }, + { + "EndIndex": 59427, + "Kind": 3 + }, + { + "EndIndex": 59449, + "Kind": 3 + }, + { + "EndIndex": 59455, + "Kind": 3 + }, + { + "EndIndex": 59495, + "Kind": 3 + }, + { + "EndIndex": 59727, + "Kind": 3 + }, + { + "EndIndex": 59747, + "Kind": 3 + }, + { + "EndIndex": 59753, + "Kind": 3 + }, + { + "EndIndex": 59797, + "Kind": 3 + }, + { + "EndIndex": 59978, + "Kind": 3 + }, + { + "EndIndex": 60002, + "Kind": 3 + }, + { + "EndIndex": 60008, + "Kind": 3 + }, + { + "EndIndex": 60030, + "Kind": 3 + }, + { + "EndIndex": 60136, + "Kind": 3 + }, + { + "EndIndex": 60160, + "Kind": 3 + }, + { + "EndIndex": 60166, + "Kind": 3 + }, + { + "EndIndex": 60196, + "Kind": 3 + }, + { + "EndIndex": 60326, + "Kind": 3 + }, + { + "EndIndex": 60350, + "Kind": 3 + }, + { + "EndIndex": 60356, + "Kind": 3 + }, + { + "EndIndex": 60374, + "Kind": 3 + }, + { + "EndIndex": 60408, + "Kind": 3 + }, + { + "EndIndex": 60667, + "Kind": 3 + }, + { + "EndIndex": 60687, + "Kind": 3 + }, + { + "EndIndex": 60693, + "Kind": 3 + }, + { + "EndIndex": 60724, + "Kind": 3 + }, + { + "EndIndex": 61108, + "Kind": 3 + }, + { + "EndIndex": 61152, + "Kind": 3 + }, + { + "EndIndex": 61158, + "Kind": 3 + }, + { + "EndIndex": 61199, + "Kind": 3 + }, + { + "EndIndex": 61488, + "Kind": 3 + }, + { + "EndIndex": 61512, + "Kind": 3 + }, + { + "EndIndex": 61518, + "Kind": 3 + }, + { + "EndIndex": 61562, + "Kind": 3 + }, + { + "EndIndex": 61820, + "Kind": 3 + }, + { + "EndIndex": 61838, + "Kind": 3 + }, + { + "EndIndex": 61844, + "Kind": 3 + }, + { + "EndIndex": 61889, + "Kind": 3 + }, + { + "EndIndex": 62177, + "Kind": 3 + }, + { + "EndIndex": 62195, + "Kind": 3 + }, + { + "EndIndex": 62201, + "Kind": 3 + }, + { + "EndIndex": 62245, + "Kind": 3 + }, + { + "EndIndex": 62426, + "Kind": 3 + }, + { + "EndIndex": 62450, + "Kind": 3 + }, + { + "EndIndex": 62456, + "Kind": 3 + }, + { + "EndIndex": 62488, + "Kind": 3 + }, + { + "EndIndex": 62893, + "Kind": 3 + }, + { + "EndIndex": 62937, + "Kind": 3 + }, + { + "EndIndex": 62943, + "Kind": 3 + }, + { + "EndIndex": 62981, + "Kind": 3 + }, + { + "EndIndex": 63434, + "Kind": 3 + }, + { + "EndIndex": 63460, + "Kind": 3 + }, + { + "EndIndex": 63466, + "Kind": 3 + }, + { + "EndIndex": 63496, + "Kind": 3 + }, + { + "EndIndex": 63627, + "Kind": 3 + }, + { + "EndIndex": 63651, + "Kind": 3 + }, + { + "EndIndex": 63657, + "Kind": 3 + }, + { + "EndIndex": 63694, + "Kind": 3 + }, + { + "EndIndex": 64067, + "Kind": 3 + }, + { + "EndIndex": 64093, + "Kind": 3 + }, + { + "EndIndex": 64099, + "Kind": 3 + }, + { + "EndIndex": 64136, + "Kind": 3 + }, + { + "EndIndex": 64307, + "Kind": 3 + }, + { + "EndIndex": 64332, + "Kind": 3 + }, + { + "EndIndex": 64338, + "Kind": 3 + }, + { + "EndIndex": 64390, + "Kind": 3 + }, + { + "EndIndex": 64674, + "Kind": 3 + }, + { + "EndIndex": 64696, + "Kind": 3 + }, + { + "EndIndex": 64702, + "Kind": 3 + }, + { + "EndIndex": 64731, + "Kind": 3 + }, + { + "EndIndex": 64886, + "Kind": 3 + }, + { + "EndIndex": 64910, + "Kind": 3 + }, + { + "EndIndex": 64916, + "Kind": 3 + }, + { + "EndIndex": 64941, + "Kind": 3 + }, + { + "EndIndex": 65078, + "Kind": 3 + }, + { + "EndIndex": 65102, + "Kind": 3 + }, + { + "EndIndex": 65108, + "Kind": 3 + }, + { + "EndIndex": 65130, + "Kind": 3 + }, + { + "EndIndex": 65299, + "Kind": 3 + }, + { + "EndIndex": 65323, + "Kind": 3 + }, + { + "EndIndex": 65329, + "Kind": 3 + }, + { + "EndIndex": 65370, + "Kind": 3 + }, + { + "EndIndex": 65680, + "Kind": 3 + }, + { + "EndIndex": 65704, + "Kind": 3 + }, + { + "EndIndex": 65710, + "Kind": 3 + }, + { + "EndIndex": 65732, + "Kind": 3 + }, + { + "EndIndex": 65838, + "Kind": 3 + }, + { + "EndIndex": 65862, + "Kind": 3 + }, + { + "EndIndex": 65868, + "Kind": 3 + }, + { + "EndIndex": 65897, + "Kind": 3 + }, + { + "EndIndex": 66050, + "Kind": 3 + }, + { + "EndIndex": 66074, + "Kind": 3 + }, + { + "EndIndex": 66080, + "Kind": 3 + }, + { + "EndIndex": 66082, + "Kind": 3 + }, + { + "EndIndex": 66101, + "Kind": 3 + }, + { + "EndIndex": 66132, + "Kind": 3 + }, + { + "EndIndex": 66164, + "Kind": 3 + }, + { + "EndIndex": 66203, + "Kind": 3 + }, + { + "EndIndex": 66242, + "Kind": 3 + }, + { + "EndIndex": 66256, + "Kind": 3 + }, + { + "EndIndex": 66262, + "Kind": 3 + }, + { + "EndIndex": 66304, + "Kind": 3 + }, + { + "EndIndex": 66318, + "Kind": 3 + }, + { + "EndIndex": 66324, + "Kind": 3 + }, + { + "EndIndex": 66342, + "Kind": 3 + }, + { + "EndIndex": 66375, + "Kind": 3 + }, + { + "EndIndex": 66526, + "Kind": 3 + }, + { + "EndIndex": 66547, + "Kind": 3 + }, + { + "EndIndex": 66553, + "Kind": 3 + }, + { + "EndIndex": 66578, + "Kind": 3 + }, + { + "EndIndex": 66611, + "Kind": 3 + }, + { + "EndIndex": 66644, + "Kind": 3 + }, + { + "EndIndex": 66650, + "Kind": 3 + }, + { + "EndIndex": 66682, + "Kind": 3 + }, + { + "EndIndex": 66748, + "Kind": 3 + }, + { + "EndIndex": 66766, + "Kind": 3 + }, + { + "EndIndex": 66772, + "Kind": 3 + }, + { + "EndIndex": 66797, + "Kind": 3 + }, + { + "EndIndex": 66830, + "Kind": 3 + }, + { + "EndIndex": 66848, + "Kind": 3 + }, + { + "EndIndex": 66854, + "Kind": 3 + }, + { + "EndIndex": 66881, + "Kind": 3 + }, + { + "EndIndex": 66931, + "Kind": 3 + }, + { + "EndIndex": 66961, + "Kind": 3 + }, + { + "EndIndex": 66967, + "Kind": 3 + }, + { + "EndIndex": 67003, + "Kind": 3 + }, + { + "EndIndex": 67052, + "Kind": 3 + }, + { + "EndIndex": 67073, + "Kind": 3 + }, + { + "EndIndex": 67079, + "Kind": 3 + }, + { + "EndIndex": 67097, + "Kind": 3 + }, + { + "EndIndex": 67139, + "Kind": 3 + }, + { + "EndIndex": 67465, + "Kind": 3 + }, + { + "EndIndex": 67487, + "Kind": 3 + }, + { + "EndIndex": 67493, + "Kind": 3 + }, + { + "EndIndex": 67495, + "Kind": 3 + }, + { + "EndIndex": 67531, + "Kind": 3 + }, + { + "EndIndex": 67551, + "Kind": 3 + }, + { + "EndIndex": 67989, + "Kind": 3 + }, + { + "EndIndex": 68020, + "Kind": 3 + }, + { + "EndIndex": 68050, + "Kind": 3 + }, + { + "EndIndex": 68072, + "Kind": 3 + }, + { + "EndIndex": 68078, + "Kind": 3 + }, + { + "EndIndex": 68099, + "Kind": 3 + }, + { + "EndIndex": 68133, + "Kind": 3 + }, + { + "EndIndex": 68164, + "Kind": 3 + }, + { + "EndIndex": 68186, + "Kind": 3 + }, + { + "EndIndex": 68192, + "Kind": 3 + }, + { + "EndIndex": 68222, + "Kind": 3 + }, + { + "EndIndex": 68253, + "Kind": 3 + }, + { + "EndIndex": 68275, + "Kind": 3 + }, + { + "EndIndex": 68281, + "Kind": 3 + }, + { + "EndIndex": 68321, + "Kind": 3 + }, + { + "EndIndex": 68402, + "Kind": 3 + }, + { + "EndIndex": 68421, + "Kind": 3 + }, + { + "EndIndex": 68427, + "Kind": 3 + }, + { + "EndIndex": 68457, + "Kind": 3 + }, + { + "EndIndex": 68488, + "Kind": 3 + }, + { + "EndIndex": 68510, + "Kind": 3 + }, + { + "EndIndex": 68516, + "Kind": 3 + }, + { + "EndIndex": 68555, + "Kind": 3 + }, + { + "EndIndex": 68594, + "Kind": 3 + }, + { + "EndIndex": 68608, + "Kind": 3 + }, + { + "EndIndex": 68614, + "Kind": 3 + }, + { + "EndIndex": 68647, + "Kind": 3 + }, + { + "EndIndex": 68676, + "Kind": 3 + }, + { + "EndIndex": 68698, + "Kind": 3 + }, + { + "EndIndex": 68704, + "Kind": 3 + }, + { + "EndIndex": 68735, + "Kind": 3 + }, + { + "EndIndex": 68754, + "Kind": 3 + }, + { + "EndIndex": 68760, + "Kind": 3 + }, + { + "EndIndex": 68790, + "Kind": 3 + }, + { + "EndIndex": 68820, + "Kind": 3 + }, + { + "EndIndex": 68842, + "Kind": 3 + }, + { + "EndIndex": 68848, + "Kind": 3 + }, + { + "EndIndex": 68873, + "Kind": 3 + }, + { + "EndIndex": 68903, + "Kind": 3 + }, + { + "EndIndex": 68921, + "Kind": 3 + }, + { + "EndIndex": 68927, + "Kind": 3 + }, + { + "EndIndex": 68997, + "Kind": 3 + }, + { + "EndIndex": 69439, + "Kind": 3 + }, + { + "EndIndex": 69453, + "Kind": 3 + }, + { + "EndIndex": 69459, + "Kind": 3 + }, + { + "EndIndex": 69477, + "Kind": 3 + }, + { + "EndIndex": 69510, + "Kind": 3 + }, + { + "EndIndex": 69661, + "Kind": 3 + }, + { + "EndIndex": 69682, + "Kind": 3 + }, + { + "EndIndex": 69688, + "Kind": 3 + }, + { + "EndIndex": 69713, + "Kind": 3 + }, + { + "EndIndex": 69746, + "Kind": 3 + }, + { + "EndIndex": 69784, + "Kind": 3 + }, + { + "EndIndex": 69790, + "Kind": 3 + }, + { + "EndIndex": 69820, + "Kind": 3 + }, + { + "EndIndex": 69851, + "Kind": 3 + }, + { + "EndIndex": 69873, + "Kind": 3 + }, + { + "EndIndex": 69879, + "Kind": 3 + }, + { + "EndIndex": 69903, + "Kind": 3 + }, + { + "EndIndex": 69932, + "Kind": 3 + }, + { + "EndIndex": 69950, + "Kind": 3 + }, + { + "EndIndex": 69956, + "Kind": 3 + }, + { + "EndIndex": 69986, + "Kind": 3 + }, + { + "EndIndex": 70016, + "Kind": 3 + }, + { + "EndIndex": 70038, + "Kind": 3 + }, + { + "EndIndex": 70044, + "Kind": 3 + }, + { + "EndIndex": 70075, + "Kind": 3 + }, + { + "EndIndex": 70105, + "Kind": 3 + }, + { + "EndIndex": 70127, + "Kind": 3 + }, + { + "EndIndex": 70133, + "Kind": 3 + }, + { + "EndIndex": 70164, + "Kind": 3 + }, + { + "EndIndex": 70194, + "Kind": 3 + }, + { + "EndIndex": 70216, + "Kind": 3 + }, + { + "EndIndex": 70222, + "Kind": 3 + }, + { + "EndIndex": 70252, + "Kind": 3 + }, + { + "EndIndex": 70283, + "Kind": 3 + }, + { + "EndIndex": 70305, + "Kind": 3 + }, + { + "EndIndex": 70311, + "Kind": 3 + }, + { + "EndIndex": 70336, + "Kind": 3 + }, + { + "EndIndex": 70366, + "Kind": 3 + }, + { + "EndIndex": 70385, + "Kind": 3 + }, + { + "EndIndex": 70391, + "Kind": 3 + }, + { + "EndIndex": 70423, + "Kind": 3 + }, + { + "EndIndex": 70453, + "Kind": 3 + }, + { + "EndIndex": 70475, + "Kind": 3 + }, + { + "EndIndex": 70481, + "Kind": 3 + }, + { + "EndIndex": 70513, + "Kind": 3 + }, + { + "EndIndex": 70543, + "Kind": 3 + }, + { + "EndIndex": 70565, + "Kind": 3 + }, + { + "EndIndex": 70571, + "Kind": 3 + }, + { + "EndIndex": 70598, + "Kind": 3 + }, + { + "EndIndex": 70660, + "Kind": 3 + }, + { + "EndIndex": 70678, + "Kind": 3 + }, + { + "EndIndex": 70684, + "Kind": 3 + }, + { + "EndIndex": 70708, + "Kind": 3 + }, + { + "EndIndex": 70737, + "Kind": 3 + }, + { + "EndIndex": 70756, + "Kind": 3 + }, + { + "EndIndex": 70762, + "Kind": 3 + }, + { + "EndIndex": 70780, + "Kind": 3 + }, + { + "EndIndex": 70822, + "Kind": 3 + }, + { + "EndIndex": 71148, + "Kind": 3 + }, + { + "EndIndex": 71170, + "Kind": 3 + }, + { + "EndIndex": 71176, + "Kind": 3 + }, + { + "EndIndex": 71203, + "Kind": 3 + }, + { + "EndIndex": 71347, + "Kind": 3 + }, + { + "EndIndex": 71369, + "Kind": 3 + }, + { + "EndIndex": 71375, + "Kind": 3 + }, + { + "EndIndex": 71400, + "Kind": 3 + }, + { + "EndIndex": 71477, + "Kind": 3 + }, + { + "EndIndex": 71499, + "Kind": 3 + }, + { + "EndIndex": 71505, + "Kind": 3 + }, + { + "EndIndex": 71545, + "Kind": 3 + }, + { + "EndIndex": 71674, + "Kind": 3 + }, + { + "EndIndex": 71696, + "Kind": 3 + }, + { + "EndIndex": 71702, + "Kind": 3 + }, + { + "EndIndex": 71746, + "Kind": 3 + }, + { + "EndIndex": 71960, + "Kind": 3 + }, + { + "EndIndex": 71978, + "Kind": 3 + }, + { + "EndIndex": 71984, + "Kind": 3 + }, + { + "EndIndex": 72025, + "Kind": 3 + }, + { + "EndIndex": 72500, + "Kind": 3 + }, + { + "EndIndex": 72520, + "Kind": 3 + }, + { + "EndIndex": 72526, + "Kind": 3 + }, + { + "EndIndex": 72576, + "Kind": 3 + }, + { + "EndIndex": 72858, + "Kind": 3 + }, + { + "EndIndex": 72880, + "Kind": 3 + }, + { + "EndIndex": 72886, + "Kind": 3 + }, + { + "EndIndex": 72922, + "Kind": 3 + }, + { + "EndIndex": 73066, + "Kind": 3 + }, + { + "EndIndex": 73088, + "Kind": 3 + }, + { + "EndIndex": 73094, + "Kind": 3 + }, + { + "EndIndex": 73137, + "Kind": 3 + }, + { + "EndIndex": 73392, + "Kind": 3 + }, + { + "EndIndex": 73410, + "Kind": 3 + }, + { + "EndIndex": 73416, + "Kind": 3 + }, + { + "EndIndex": 73456, + "Kind": 3 + }, + { + "EndIndex": 73637, + "Kind": 3 + }, + { + "EndIndex": 73659, + "Kind": 3 + }, + { + "EndIndex": 73665, + "Kind": 3 + }, + { + "EndIndex": 73701, + "Kind": 3 + }, + { + "EndIndex": 73870, + "Kind": 3 + }, + { + "EndIndex": 73892, + "Kind": 3 + }, + { + "EndIndex": 73898, + "Kind": 3 + }, + { + "EndIndex": 73942, + "Kind": 3 + }, + { + "EndIndex": 74228, + "Kind": 3 + }, + { + "EndIndex": 74246, + "Kind": 3 + }, + { + "EndIndex": 74252, + "Kind": 3 + }, + { + "EndIndex": 74276, + "Kind": 3 + }, + { + "EndIndex": 74489, + "Kind": 3 + }, + { + "EndIndex": 74511, + "Kind": 3 + }, + { + "EndIndex": 74517, + "Kind": 3 + }, + { + "EndIndex": 74541, + "Kind": 3 + }, + { + "EndIndex": 74745, + "Kind": 3 + }, + { + "EndIndex": 74767, + "Kind": 3 + }, + { + "EndIndex": 74773, + "Kind": 3 + }, + { + "EndIndex": 74797, + "Kind": 3 + }, + { + "EndIndex": 74973, + "Kind": 3 + }, + { + "EndIndex": 74987, + "Kind": 3 + }, + { + "EndIndex": 74993, + "Kind": 3 + }, + { + "EndIndex": 75019, + "Kind": 3 + }, + { + "EndIndex": 75222, + "Kind": 3 + }, + { + "EndIndex": 75244, + "Kind": 3 + }, + { + "EndIndex": 75250, + "Kind": 3 + }, + { + "EndIndex": 75274, + "Kind": 3 + }, + { + "EndIndex": 75472, + "Kind": 3 + }, + { + "EndIndex": 75494, + "Kind": 3 + }, + { + "EndIndex": 75500, + "Kind": 3 + }, + { + "EndIndex": 75529, + "Kind": 3 + }, + { + "EndIndex": 75701, + "Kind": 3 + }, + { + "EndIndex": 75723, + "Kind": 3 + }, + { + "EndIndex": 75729, + "Kind": 3 + }, + { + "EndIndex": 75753, + "Kind": 3 + }, + { + "EndIndex": 75965, + "Kind": 3 + }, + { + "EndIndex": 75987, + "Kind": 3 + }, + { + "EndIndex": 75993, + "Kind": 3 + }, + { + "EndIndex": 76019, + "Kind": 3 + }, + { + "EndIndex": 76213, + "Kind": 3 + }, + { + "EndIndex": 76235, + "Kind": 3 + }, + { + "EndIndex": 76241, + "Kind": 3 + }, + { + "EndIndex": 76269, + "Kind": 3 + }, + { + "EndIndex": 76442, + "Kind": 3 + }, + { + "EndIndex": 76464, + "Kind": 3 + }, + { + "EndIndex": 76470, + "Kind": 3 + }, + { + "EndIndex": 76494, + "Kind": 3 + }, + { + "EndIndex": 76697, + "Kind": 3 + }, + { + "EndIndex": 76719, + "Kind": 3 + }, + { + "EndIndex": 76725, + "Kind": 3 + }, + { + "EndIndex": 76749, + "Kind": 3 + }, + { + "EndIndex": 76967, + "Kind": 3 + }, + { + "EndIndex": 76989, + "Kind": 3 + }, + { + "EndIndex": 76995, + "Kind": 3 + }, + { + "EndIndex": 77019, + "Kind": 3 + }, + { + "EndIndex": 77232, + "Kind": 3 + }, + { + "EndIndex": 77254, + "Kind": 3 + }, + { + "EndIndex": 77260, + "Kind": 3 + }, + { + "EndIndex": 77291, + "Kind": 3 + }, + { + "EndIndex": 77512, + "Kind": 3 + }, + { + "EndIndex": 77531, + "Kind": 3 + }, + { + "EndIndex": 77537, + "Kind": 3 + }, + { + "EndIndex": 77576, + "Kind": 3 + }, + { + "EndIndex": 77711, + "Kind": 3 + }, + { + "EndIndex": 77733, + "Kind": 3 + }, + { + "EndIndex": 77739, + "Kind": 3 + }, + { + "EndIndex": 77761, + "Kind": 3 + }, + { + "EndIndex": 77824, + "Kind": 3 + }, + { + "EndIndex": 77846, + "Kind": 3 + }, + { + "EndIndex": 77852, + "Kind": 3 + }, + { + "EndIndex": 77882, + "Kind": 3 + }, + { + "EndIndex": 78025, + "Kind": 3 + }, + { + "EndIndex": 78047, + "Kind": 3 + }, + { + "EndIndex": 78053, + "Kind": 3 + }, + { + "EndIndex": 78071, + "Kind": 3 + }, + { + "EndIndex": 78105, + "Kind": 3 + }, + { + "EndIndex": 78658, + "Kind": 3 + }, + { + "EndIndex": 78677, + "Kind": 3 + }, + { + "EndIndex": 78683, + "Kind": 3 + }, + { + "EndIndex": 78714, + "Kind": 3 + }, + { + "EndIndex": 79085, + "Kind": 3 + }, + { + "EndIndex": 79123, + "Kind": 3 + }, + { + "EndIndex": 79129, + "Kind": 3 + }, + { + "EndIndex": 79170, + "Kind": 3 + }, + { + "EndIndex": 79459, + "Kind": 3 + }, + { + "EndIndex": 79481, + "Kind": 3 + }, + { + "EndIndex": 79487, + "Kind": 3 + }, + { + "EndIndex": 79531, + "Kind": 3 + }, + { + "EndIndex": 79788, + "Kind": 3 + }, + { + "EndIndex": 79806, + "Kind": 3 + }, + { + "EndIndex": 79812, + "Kind": 3 + }, + { + "EndIndex": 79857, + "Kind": 3 + }, + { + "EndIndex": 80144, + "Kind": 3 + }, + { + "EndIndex": 80162, + "Kind": 3 + }, + { + "EndIndex": 80168, + "Kind": 3 + }, + { + "EndIndex": 80207, + "Kind": 3 + }, + { + "EndIndex": 80343, + "Kind": 3 + }, + { + "EndIndex": 80365, + "Kind": 3 + }, + { + "EndIndex": 80371, + "Kind": 3 + }, + { + "EndIndex": 80403, + "Kind": 3 + }, + { + "EndIndex": 80794, + "Kind": 3 + }, + { + "EndIndex": 80832, + "Kind": 3 + }, + { + "EndIndex": 80838, + "Kind": 3 + }, + { + "EndIndex": 80876, + "Kind": 3 + }, + { + "EndIndex": 81320, + "Kind": 3 + }, + { + "EndIndex": 81344, + "Kind": 3 + }, + { + "EndIndex": 81350, + "Kind": 3 + }, + { + "EndIndex": 81380, + "Kind": 3 + }, + { + "EndIndex": 81524, + "Kind": 3 + }, + { + "EndIndex": 81546, + "Kind": 3 + }, + { + "EndIndex": 81552, + "Kind": 3 + }, + { + "EndIndex": 81589, + "Kind": 3 + }, + { + "EndIndex": 81954, + "Kind": 3 + }, + { + "EndIndex": 81978, + "Kind": 3 + }, + { + "EndIndex": 81984, + "Kind": 3 + }, + { + "EndIndex": 82021, + "Kind": 3 + }, + { + "EndIndex": 82193, + "Kind": 3 + }, + { + "EndIndex": 82218, + "Kind": 3 + }, + { + "EndIndex": 82224, + "Kind": 3 + }, + { + "EndIndex": 82276, + "Kind": 3 + }, + { + "EndIndex": 82562, + "Kind": 3 + }, + { + "EndIndex": 82584, + "Kind": 3 + }, + { + "EndIndex": 82590, + "Kind": 3 + }, + { + "EndIndex": 82619, + "Kind": 3 + }, + { + "EndIndex": 82774, + "Kind": 3 + }, + { + "EndIndex": 82796, + "Kind": 3 + }, + { + "EndIndex": 82802, + "Kind": 3 + }, + { + "EndIndex": 82827, + "Kind": 3 + }, + { + "EndIndex": 82919, + "Kind": 3 + }, + { + "EndIndex": 82941, + "Kind": 3 + }, + { + "EndIndex": 82947, + "Kind": 3 + }, + { + "EndIndex": 82969, + "Kind": 3 + }, + { + "EndIndex": 83156, + "Kind": 3 + }, + { + "EndIndex": 83178, + "Kind": 3 + }, + { + "EndIndex": 83184, + "Kind": 3 + }, + { + "EndIndex": 83217, + "Kind": 3 + }, + { + "EndIndex": 83633, + "Kind": 3 + }, + { + "EndIndex": 83655, + "Kind": 3 + }, + { + "EndIndex": 83661, + "Kind": 3 + }, + { + "EndIndex": 83683, + "Kind": 3 + }, + { + "EndIndex": 83746, + "Kind": 3 + }, + { + "EndIndex": 83768, + "Kind": 3 + }, + { + "EndIndex": 83774, + "Kind": 3 + }, + { + "EndIndex": 83803, + "Kind": 3 + }, + { + "EndIndex": 83929, + "Kind": 3 + }, + { + "EndIndex": 83951, + "Kind": 3 + }, + { + "EndIndex": 83957, + "Kind": 3 + }, + { + "EndIndex": 83959, + "Kind": 3 + }, + { + "EndIndex": 83978, + "Kind": 3 + }, + { + "EndIndex": 84007, + "Kind": 3 + }, + { + "EndIndex": 84037, + "Kind": 3 + }, + { + "EndIndex": 84076, + "Kind": 3 + }, + { + "EndIndex": 84115, + "Kind": 3 + }, + { + "EndIndex": 84129, + "Kind": 3 + }, + { + "EndIndex": 84135, + "Kind": 3 + }, + { + "EndIndex": 84177, + "Kind": 3 + }, + { + "EndIndex": 84191, + "Kind": 3 + }, + { + "EndIndex": 84197, + "Kind": 3 + }, + { + "EndIndex": 84215, + "Kind": 3 + }, + { + "EndIndex": 84248, + "Kind": 3 + }, + { + "EndIndex": 84399, + "Kind": 3 + }, + { + "EndIndex": 84420, + "Kind": 3 + }, + { + "EndIndex": 84426, + "Kind": 3 + }, + { + "EndIndex": 84451, + "Kind": 3 + }, + { + "EndIndex": 84484, + "Kind": 3 + }, + { + "EndIndex": 84515, + "Kind": 3 + }, + { + "EndIndex": 84521, + "Kind": 3 + }, + { + "EndIndex": 84553, + "Kind": 3 + }, + { + "EndIndex": 84619, + "Kind": 3 + }, + { + "EndIndex": 84637, + "Kind": 3 + }, + { + "EndIndex": 84643, + "Kind": 3 + }, + { + "EndIndex": 84668, + "Kind": 3 + }, + { + "EndIndex": 84701, + "Kind": 3 + }, + { + "EndIndex": 84731, + "Kind": 3 + }, + { + "EndIndex": 84737, + "Kind": 3 + }, + { + "EndIndex": 84764, + "Kind": 3 + }, + { + "EndIndex": 84814, + "Kind": 3 + }, + { + "EndIndex": 84844, + "Kind": 3 + }, + { + "EndIndex": 84850, + "Kind": 3 + }, + { + "EndIndex": 84886, + "Kind": 3 + }, + { + "EndIndex": 84935, + "Kind": 3 + }, + { + "EndIndex": 84956, + "Kind": 3 + }, + { + "EndIndex": 84962, + "Kind": 3 + }, + { + "EndIndex": 84980, + "Kind": 3 + }, + { + "EndIndex": 85022, + "Kind": 3 + }, + { + "EndIndex": 85348, + "Kind": 3 + }, + { + "EndIndex": 85370, + "Kind": 3 + }, + { + "EndIndex": 85376, + "Kind": 3 + }, + { + "EndIndex": 85378, + "Kind": 3 + }, + { + "EndIndex": 85414, + "Kind": 3 + }, + { + "EndIndex": 85437, + "Kind": 3 + }, + { + "EndIndex": 85476, + "Kind": 3 + }, + { + "EndIndex": 85499, + "Kind": 3 + }, + { + "EndIndex": 85605, + "Kind": 3 + }, + { + "EndIndex": 85629, + "Kind": 3 + }, + { + "EndIndex": 85663, + "Kind": 3 + }, + { + "EndIndex": 85705, + "Kind": 3 + }, + { + "EndIndex": 85726, + "Kind": 3 + }, + { + "EndIndex": 85732, + "Kind": 3 + }, + { + "EndIndex": 85751, + "Kind": 3 + }, + { + "EndIndex": 85775, + "Kind": 3 + }, + { + "EndIndex": 85838, + "Kind": 3 + }, + { + "EndIndex": 85859, + "Kind": 3 + }, + { + "EndIndex": 85865, + "Kind": 3 + }, + { + "EndIndex": 85904, + "Kind": 3 + }, + { + "EndIndex": 85943, + "Kind": 3 + }, + { + "EndIndex": 85957, + "Kind": 3 + }, + { + "EndIndex": 85963, + "Kind": 3 + }, + { + "EndIndex": 86005, + "Kind": 3 + }, + { + "EndIndex": 86115, + "Kind": 3 + }, + { + "EndIndex": 86129, + "Kind": 3 + }, + { + "EndIndex": 86135, + "Kind": 3 + }, + { + "EndIndex": 86153, + "Kind": 3 + }, + { + "EndIndex": 86186, + "Kind": 3 + }, + { + "EndIndex": 86337, + "Kind": 3 + }, + { + "EndIndex": 86358, + "Kind": 3 + }, + { + "EndIndex": 86364, + "Kind": 3 + }, + { + "EndIndex": 86389, + "Kind": 3 + }, + { + "EndIndex": 86419, + "Kind": 3 + }, + { + "EndIndex": 86438, + "Kind": 3 + }, + { + "EndIndex": 86444, + "Kind": 3 + }, + { + "EndIndex": 86485, + "Kind": 3 + }, + { + "EndIndex": 86534, + "Kind": 3 + }, + { + "EndIndex": 86555, + "Kind": 3 + }, + { + "EndIndex": 86561, + "Kind": 3 + }, + { + "EndIndex": 86579, + "Kind": 3 + }, + { + "EndIndex": 86621, + "Kind": 3 + }, + { + "EndIndex": 86947, + "Kind": 3 + }, + { + "EndIndex": 86969, + "Kind": 3 + }, + { + "EndIndex": 86975, + "Kind": 3 + }, + { + "EndIndex": 86977, + "Kind": 3 + }, + { + "EndIndex": 86998, + "Kind": 3 + }, + { + "EndIndex": 87023, + "Kind": 3 + }, + { + "EndIndex": 87328, + "Kind": 3 + }, + { + "EndIndex": 87343, + "Kind": 3 + }, + { + "EndIndex": 87375, + "Kind": 3 + }, + { + "EndIndex": 87394, + "Kind": 3 + }, + { + "EndIndex": 87400, + "Kind": 3 + }, + { + "EndIndex": 87442, + "Kind": 3 + }, + { + "EndIndex": 87478, + "Kind": 3 + }, + { + "EndIndex": 87492, + "Kind": 3 + }, + { + "EndIndex": 87498, + "Kind": 3 + }, + { + "EndIndex": 87524, + "Kind": 3 + }, + { + "EndIndex": 87539, + "Kind": 3 + }, + { + "EndIndex": 87567, + "Kind": 3 + }, + { + "EndIndex": 87581, + "Kind": 3 + }, + { + "EndIndex": 87587, + "Kind": 3 + }, + { + "EndIndex": 87602, + "Kind": 3 + }, + { + "EndIndex": 87627, + "Kind": 3 + }, + { + "EndIndex": 87652, + "Kind": 3 + }, + { + "EndIndex": 87658, + "Kind": 3 + }, + { + "EndIndex": 87673, + "Kind": 3 + }, + { + "EndIndex": 87702, + "Kind": 3 + }, + { + "EndIndex": 87716, + "Kind": 3 + }, + { + "EndIndex": 87722, + "Kind": 3 + }, + { + "EndIndex": 87741, + "Kind": 3 + }, + { + "EndIndex": 87782, + "Kind": 3 + }, + { + "EndIndex": 87850, + "Kind": 3 + }, + { + "EndIndex": 87877, + "Kind": 3 + }, + { + "EndIndex": 87883, + "Kind": 3 + }, + { + "EndIndex": 87898, + "Kind": 3 + }, + { + "EndIndex": 87926, + "Kind": 3 + }, + { + "EndIndex": 87945, + "Kind": 3 + }, + { + "EndIndex": 87951, + "Kind": 3 + }, + { + "EndIndex": 87993, + "Kind": 3 + }, + { + "EndIndex": 88302, + "Kind": 3 + }, + { + "EndIndex": 88316, + "Kind": 3 + }, + { + "EndIndex": 88322, + "Kind": 3 + }, + { + "EndIndex": 88340, + "Kind": 3 + }, + { + "EndIndex": 88373, + "Kind": 3 + }, + { + "EndIndex": 88524, + "Kind": 3 + }, + { + "EndIndex": 88545, + "Kind": 3 + }, + { + "EndIndex": 88551, + "Kind": 3 + }, + { + "EndIndex": 88566, + "Kind": 3 + }, + { + "EndIndex": 88597, + "Kind": 3 + }, + { + "EndIndex": 88611, + "Kind": 3 + }, + { + "EndIndex": 88617, + "Kind": 3 + }, + { + "EndIndex": 88644, + "Kind": 3 + }, + { + "EndIndex": 88675, + "Kind": 3 + }, + { + "EndIndex": 88700, + "Kind": 3 + }, + { + "EndIndex": 88730, + "Kind": 3 + }, + { + "EndIndex": 88749, + "Kind": 3 + }, + { + "EndIndex": 88755, + "Kind": 3 + }, + { + "EndIndex": 88773, + "Kind": 3 + }, + { + "EndIndex": 88815, + "Kind": 3 + }, + { + "EndIndex": 89141, + "Kind": 3 + }, + { + "EndIndex": 89163, + "Kind": 3 + }, + { + "EndIndex": 89169, + "Kind": 3 + }, + { + "EndIndex": 89171, + "Kind": 3 + }, + { + "EndIndex": 89196, + "Kind": 3 + }, + { + "EndIndex": 89231, + "Kind": 3 + }, + { + "EndIndex": 89273, + "Kind": 3 + }, + { + "EndIndex": 89309, + "Kind": 3 + }, + { + "EndIndex": 89323, + "Kind": 3 + }, + { + "EndIndex": 89329, + "Kind": 3 + }, + { + "EndIndex": 89365, + "Kind": 3 + }, + { + "EndIndex": 89406, + "Kind": 3 + }, + { + "EndIndex": 89474, + "Kind": 3 + }, + { + "EndIndex": 89511, + "Kind": 3 + }, + { + "EndIndex": 89517, + "Kind": 3 + }, + { + "EndIndex": 89556, + "Kind": 3 + }, + { + "EndIndex": 89595, + "Kind": 3 + }, + { + "EndIndex": 89609, + "Kind": 3 + }, + { + "EndIndex": 89615, + "Kind": 3 + }, + { + "EndIndex": 89633, + "Kind": 3 + }, + { + "EndIndex": 89666, + "Kind": 3 + }, + { + "EndIndex": 89817, + "Kind": 3 + }, + { + "EndIndex": 89838, + "Kind": 3 + }, + { + "EndIndex": 89844, + "Kind": 3 + }, + { + "EndIndex": 89881, + "Kind": 3 + }, + { + "EndIndex": 89896, + "Kind": 3 + }, + { + "EndIndex": 89925, + "Kind": 3 + }, + { + "EndIndex": 89939, + "Kind": 3 + }, + { + "EndIndex": 89945, + "Kind": 3 + }, + { + "EndIndex": 89986, + "Kind": 3 + }, + { + "EndIndex": 90013, + "Kind": 3 + }, + { + "EndIndex": 90043, + "Kind": 3 + }, + { + "EndIndex": 90049, + "Kind": 3 + }, + { + "EndIndex": 90074, + "Kind": 3 + }, + { + "EndIndex": 90104, + "Kind": 3 + }, + { + "EndIndex": 90123, + "Kind": 3 + }, + { + "EndIndex": 90129, + "Kind": 3 + }, + { + "EndIndex": 90147, + "Kind": 3 + }, + { + "EndIndex": 90189, + "Kind": 3 + }, + { + "EndIndex": 90515, + "Kind": 3 + }, + { + "EndIndex": 90537, + "Kind": 3 + }, + { + "EndIndex": 90543, + "Kind": 3 + }, + { + "EndIndex": 90574, + "Kind": 3 + }, + { + "EndIndex": 90576, + "Kind": 3 + }, + { + "EndIndex": 90626, + "Kind": 3 + }, + { + "EndIndex": 90669, + "Kind": 3 + }, + { + "EndIndex": 90711, + "Kind": 3 + }, + { + "EndIndex": 90747, + "Kind": 3 + }, + { + "EndIndex": 90761, + "Kind": 3 + }, + { + "EndIndex": 90767, + "Kind": 3 + }, + { + "EndIndex": 90811, + "Kind": 3 + }, + { + "EndIndex": 90841, + "Kind": 3 + }, + { + "EndIndex": 90872, + "Kind": 3 + }, + { + "EndIndex": 90894, + "Kind": 3 + }, + { + "EndIndex": 90900, + "Kind": 3 + }, + { + "EndIndex": 90930, + "Kind": 3 + }, + { + "EndIndex": 90961, + "Kind": 3 + }, + { + "EndIndex": 90983, + "Kind": 3 + }, + { + "EndIndex": 90989, + "Kind": 3 + }, + { + "EndIndex": 91028, + "Kind": 3 + }, + { + "EndIndex": 91067, + "Kind": 3 + }, + { + "EndIndex": 91081, + "Kind": 3 + }, + { + "EndIndex": 91087, + "Kind": 3 + }, + { + "EndIndex": 91117, + "Kind": 3 + }, + { + "EndIndex": 91147, + "Kind": 3 + }, + { + "EndIndex": 91169, + "Kind": 3 + }, + { + "EndIndex": 91175, + "Kind": 3 + }, + { + "EndIndex": 91200, + "Kind": 3 + }, + { + "EndIndex": 91230, + "Kind": 3 + }, + { + "EndIndex": 91248, + "Kind": 3 + }, + { + "EndIndex": 91254, + "Kind": 3 + }, + { + "EndIndex": 91272, + "Kind": 3 + }, + { + "EndIndex": 91305, + "Kind": 3 + }, + { + "EndIndex": 91456, + "Kind": 3 + }, + { + "EndIndex": 91477, + "Kind": 3 + }, + { + "EndIndex": 91483, + "Kind": 3 + }, + { + "EndIndex": 91513, + "Kind": 3 + }, + { + "EndIndex": 91544, + "Kind": 3 + }, + { + "EndIndex": 91566, + "Kind": 3 + }, + { + "EndIndex": 91572, + "Kind": 3 + }, + { + "EndIndex": 91602, + "Kind": 3 + }, + { + "EndIndex": 91632, + "Kind": 3 + }, + { + "EndIndex": 91654, + "Kind": 3 + }, + { + "EndIndex": 91660, + "Kind": 3 + }, + { + "EndIndex": 91705, + "Kind": 3 + }, + { + "EndIndex": 91735, + "Kind": 3 + }, + { + "EndIndex": 91766, + "Kind": 3 + }, + { + "EndIndex": 91788, + "Kind": 3 + }, + { + "EndIndex": 91794, + "Kind": 3 + }, + { + "EndIndex": 91843, + "Kind": 3 + }, + { + "EndIndex": 91870, + "Kind": 3 + }, + { + "EndIndex": 91900, + "Kind": 3 + }, + { + "EndIndex": 91906, + "Kind": 3 + }, + { + "EndIndex": 91931, + "Kind": 3 + }, + { + "EndIndex": 91961, + "Kind": 3 + }, + { + "EndIndex": 91980, + "Kind": 3 + }, + { + "EndIndex": 91986, + "Kind": 3 + }, + { + "EndIndex": 92001, + "Kind": 3 + }, + { + "EndIndex": 92026, + "Kind": 3 + }, + { + "EndIndex": 92040, + "Kind": 3 + }, + { + "EndIndex": 92046, + "Kind": 3 + }, + { + "EndIndex": 92064, + "Kind": 3 + }, + { + "EndIndex": 92106, + "Kind": 3 + }, + { + "EndIndex": 92432, + "Kind": 3 + }, + { + "EndIndex": 92454, + "Kind": 3 + }, + { + "EndIndex": 92460, + "Kind": 3 + }, + { + "EndIndex": 92491, + "Kind": 3 + }, + { + "EndIndex": 92493, + "Kind": 3 + }, + { + "EndIndex": 92543, + "Kind": 3 + }, + { + "EndIndex": 92569, + "Kind": 3 + }, + { + "EndIndex": 92596, + "Kind": 3 + }, + { + "EndIndex": 92620, + "Kind": 3 + }, + { + "EndIndex": 92641, + "Kind": 3 + }, + { + "EndIndex": 92647, + "Kind": 3 + }, + { + "EndIndex": 92686, + "Kind": 3 + }, + { + "EndIndex": 92725, + "Kind": 3 + }, + { + "EndIndex": 92739, + "Kind": 3 + }, + { + "EndIndex": 92745, + "Kind": 3 + }, + { + "EndIndex": 92787, + "Kind": 3 + }, + { + "EndIndex": 92801, + "Kind": 3 + }, + { + "EndIndex": 92807, + "Kind": 3 + }, + { + "EndIndex": 92825, + "Kind": 3 + }, + { + "EndIndex": 92858, + "Kind": 3 + }, + { + "EndIndex": 93009, + "Kind": 3 + }, + { + "EndIndex": 93030, + "Kind": 3 + }, + { + "EndIndex": 93036, + "Kind": 3 + }, + { + "EndIndex": 93061, + "Kind": 3 + }, + { + "EndIndex": 93094, + "Kind": 3 + }, + { + "EndIndex": 93122, + "Kind": 3 + }, + { + "EndIndex": 93128, + "Kind": 3 + }, + { + "EndIndex": 93156, + "Kind": 3 + }, + { + "EndIndex": 93181, + "Kind": 3 + }, + { + "EndIndex": 93214, + "Kind": 3 + }, + { + "EndIndex": 93228, + "Kind": 3 + }, + { + "EndIndex": 93234, + "Kind": 3 + }, + { + "EndIndex": 93266, + "Kind": 3 + }, + { + "EndIndex": 93291, + "Kind": 3 + }, + { + "EndIndex": 93321, + "Kind": 3 + }, + { + "EndIndex": 93340, + "Kind": 3 + }, + { + "EndIndex": 93346, + "Kind": 3 + }, + { + "EndIndex": 93364, + "Kind": 3 + }, + { + "EndIndex": 93406, + "Kind": 3 + }, + { + "EndIndex": 93732, + "Kind": 3 + }, + { + "EndIndex": 93754, + "Kind": 3 + }, + { + "EndIndex": 93760, + "Kind": 3 + }, + { + "EndIndex": 93782, + "Kind": 3 + }, + { + "EndIndex": 93842, + "Kind": 3 + }, + { + "EndIndex": 93863, + "Kind": 3 + }, + { + "EndIndex": 93869, + "Kind": 3 + }, + { + "EndIndex": 93884, + "Kind": 3 + }, + { + "EndIndex": 93908, + "Kind": 3 + }, + { + "EndIndex": 93922, + "Kind": 3 + }, + { + "EndIndex": 93928, + "Kind": 3 + }, + { + "EndIndex": 93943, + "Kind": 3 + }, + { + "EndIndex": 93968, + "Kind": 3 + }, + { + "EndIndex": 93982, + "Kind": 3 + }, + { + "EndIndex": 93988, + "Kind": 3 + }, + { + "EndIndex": 94003, + "Kind": 3 + }, + { + "EndIndex": 94030, + "Kind": 3 + }, + { + "EndIndex": 94044, + "Kind": 3 + }, + { + "EndIndex": 94050, + "Kind": 3 + }, + { + "EndIndex": 94065, + "Kind": 3 + }, + { + "EndIndex": 94094, + "Kind": 3 + }, + { + "EndIndex": 94150, + "Kind": 3 + }, + { + "EndIndex": 94164, + "Kind": 3 + }, + { + "EndIndex": 94170, + "Kind": 3 + }, + { + "EndIndex": 94198, + "Kind": 3 + }, + { + "EndIndex": 94300, + "Kind": 3 + }, + { + "EndIndex": 94332, + "Kind": 3 + }, + { + "EndIndex": 94338, + "Kind": 3 + }, + { + "EndIndex": 94394, + "Kind": 3 + }, + { + "EndIndex": 94511, + "Kind": 3 + }, + { + "EndIndex": 94532, + "Kind": 3 + }, + { + "EndIndex": 94538, + "Kind": 3 + }, + { + "EndIndex": 94540, + "Kind": 3 + }, + { + "EndIndex": 94567, + "Kind": 3 + }, + { + "EndIndex": 94592, + "Kind": 3 + }, + { + "EndIndex": 95387, + "Kind": 3 + }, + { + "EndIndex": 95413, + "Kind": 3 + }, + { + "EndIndex": 95450, + "Kind": 3 + }, + { + "EndIndex": 95494, + "Kind": 3 + }, + { + "EndIndex": 95515, + "Kind": 3 + }, + { + "EndIndex": 95521, + "Kind": 3 + }, + { + "EndIndex": 95562, + "Kind": 3 + }, + { + "EndIndex": 95630, + "Kind": 3 + }, + { + "EndIndex": 95657, + "Kind": 3 + }, + { + "EndIndex": 95663, + "Kind": 3 + }, + { + "EndIndex": 95702, + "Kind": 3 + }, + { + "EndIndex": 95741, + "Kind": 3 + }, + { + "EndIndex": 95755, + "Kind": 3 + }, + { + "EndIndex": 95761, + "Kind": 3 + }, + { + "EndIndex": 95803, + "Kind": 3 + }, + { + "EndIndex": 96602, + "Kind": 3 + }, + { + "EndIndex": 96616, + "Kind": 3 + }, + { + "EndIndex": 96622, + "Kind": 3 + }, + { + "EndIndex": 96640, + "Kind": 3 + }, + { + "EndIndex": 96673, + "Kind": 3 + }, + { + "EndIndex": 96824, + "Kind": 3 + }, + { + "EndIndex": 96845, + "Kind": 3 + }, + { + "EndIndex": 96851, + "Kind": 3 + }, + { + "EndIndex": 96866, + "Kind": 3 + }, + { + "EndIndex": 96903, + "Kind": 3 + }, + { + "EndIndex": 96917, + "Kind": 3 + }, + { + "EndIndex": 96923, + "Kind": 3 + }, + { + "EndIndex": 96964, + "Kind": 3 + }, + { + "EndIndex": 97014, + "Kind": 3 + }, + { + "EndIndex": 97035, + "Kind": 3 + }, + { + "EndIndex": 97041, + "Kind": 3 + }, + { + "EndIndex": 97059, + "Kind": 3 + }, + { + "EndIndex": 97101, + "Kind": 3 + }, + { + "EndIndex": 97427, + "Kind": 3 + }, + { + "EndIndex": 97449, + "Kind": 3 + }, + { + "EndIndex": 97455, + "Kind": 3 + }, + { + "EndIndex": 97485, + "Kind": 3 + }, + { + "EndIndex": 97544, + "Kind": 3 + }, + { + "EndIndex": 97565, + "Kind": 3 + }, + { + "EndIndex": 97571, + "Kind": 3 + }, + { + "EndIndex": 97586, + "Kind": 3 + }, + { + "EndIndex": 97607, + "Kind": 3 + }, + { + "EndIndex": 97621, + "Kind": 3 + }, + { + "EndIndex": 97627, + "Kind": 3 + }, + { + "EndIndex": 97642, + "Kind": 3 + }, + { + "EndIndex": 97663, + "Kind": 3 + }, + { + "EndIndex": 97677, + "Kind": 3 + }, + { + "EndIndex": 97683, + "Kind": 3 + }, + { + "EndIndex": 97698, + "Kind": 3 + }, + { + "EndIndex": 97719, + "Kind": 3 + }, + { + "EndIndex": 97733, + "Kind": 3 + }, + { + "EndIndex": 97739, + "Kind": 3 + }, + { + "EndIndex": 97768, + "Kind": 3 + }, + { + "EndIndex": 97826, + "Kind": 3 + }, + { + "EndIndex": 97847, + "Kind": 3 + }, + { + "EndIndex": 97853, + "Kind": 3 + }, + { + "EndIndex": 97882, + "Kind": 3 + }, + { + "EndIndex": 97940, + "Kind": 3 + }, + { + "EndIndex": 97961, + "Kind": 3 + }, + { + "EndIndex": 97967, + "Kind": 3 + }, + { + "EndIndex": 97969, + "Kind": 3 + }, + { + "EndIndex": 97994, + "Kind": 3 + }, + { + "EndIndex": 98022, + "Kind": 3 + }, + { + "EndIndex": 98718, + "Kind": 3 + }, + { + "EndIndex": 98747, + "Kind": 3 + }, + { + "EndIndex": 98766, + "Kind": 3 + }, + { + "EndIndex": 98781, + "Kind": 3 + }, + { + "EndIndex": 98806, + "Kind": 3 + }, + { + "EndIndex": 98820, + "Kind": 3 + }, + { + "EndIndex": 98826, + "Kind": 3 + }, + { + "EndIndex": 98867, + "Kind": 3 + }, + { + "EndIndex": 98935, + "Kind": 3 + }, + { + "EndIndex": 98965, + "Kind": 3 + }, + { + "EndIndex": 98971, + "Kind": 3 + }, + { + "EndIndex": 99006, + "Kind": 3 + }, + { + "EndIndex": 99706, + "Kind": 3 + }, + { + "EndIndex": 99720, + "Kind": 3 + }, + { + "EndIndex": 99726, + "Kind": 3 + }, + { + "EndIndex": 99744, + "Kind": 3 + }, + { + "EndIndex": 99777, + "Kind": 3 + }, + { + "EndIndex": 99928, + "Kind": 3 + }, + { + "EndIndex": 99949, + "Kind": 3 + }, + { + "EndIndex": 99955, + "Kind": 3 + }, + { + "EndIndex": 99970, + "Kind": 3 + }, + { + "EndIndex": 100007, + "Kind": 3 + }, + { + "EndIndex": 100021, + "Kind": 3 + }, + { + "EndIndex": 100027, + "Kind": 3 + }, + { + "EndIndex": 100045, + "Kind": 3 + }, + { + "EndIndex": 100087, + "Kind": 3 + }, + { + "EndIndex": 100413, + "Kind": 3 + }, + { + "EndIndex": 100435, + "Kind": 3 + }, + { + "EndIndex": 100441, + "Kind": 3 + }, + { + "EndIndex": 100443, + "Kind": 3 + }, + { + "EndIndex": 100474, + "Kind": 3 + }, + { + "EndIndex": 100503, + "Kind": 3 + }, + { + "EndIndex": 101055, + "Kind": 3 + }, + { + "EndIndex": 101085, + "Kind": 3 + }, + { + "EndIndex": 101104, + "Kind": 3 + }, + { + "EndIndex": 101119, + "Kind": 3 + }, + { + "EndIndex": 101144, + "Kind": 3 + }, + { + "EndIndex": 101158, + "Kind": 3 + }, + { + "EndIndex": 101164, + "Kind": 3 + }, + { + "EndIndex": 101205, + "Kind": 3 + }, + { + "EndIndex": 101273, + "Kind": 3 + }, + { + "EndIndex": 101304, + "Kind": 3 + }, + { + "EndIndex": 101310, + "Kind": 3 + }, + { + "EndIndex": 101345, + "Kind": 3 + }, + { + "EndIndex": 101901, + "Kind": 3 + }, + { + "EndIndex": 101915, + "Kind": 3 + }, + { + "EndIndex": 101921, + "Kind": 3 + }, + { + "EndIndex": 101939, + "Kind": 3 + }, + { + "EndIndex": 101972, + "Kind": 3 + }, + { + "EndIndex": 102123, + "Kind": 3 + }, + { + "EndIndex": 102144, + "Kind": 3 + }, + { + "EndIndex": 102150, + "Kind": 3 + }, + { + "EndIndex": 102165, + "Kind": 3 + }, + { + "EndIndex": 102202, + "Kind": 3 + }, + { + "EndIndex": 102216, + "Kind": 3 + }, + { + "EndIndex": 102222, + "Kind": 3 + }, + { + "EndIndex": 102240, + "Kind": 3 + }, + { + "EndIndex": 102282, + "Kind": 3 + }, + { + "EndIndex": 102608, + "Kind": 3 + }, + { + "EndIndex": 102630, + "Kind": 3 + }, + { + "EndIndex": 102636, + "Kind": 3 + }, + { + "EndIndex": 102638, + "Kind": 3 + }, + { + "EndIndex": 102671, + "Kind": 3 + }, + { + "EndIndex": 102696, + "Kind": 3 + }, + { + "EndIndex": 102722, + "Kind": 3 + }, + { + "EndIndex": 102761, + "Kind": 3 + }, + { + "EndIndex": 102800, + "Kind": 3 + }, + { + "EndIndex": 102814, + "Kind": 3 + }, + { + "EndIndex": 102820, + "Kind": 3 + }, + { + "EndIndex": 102862, + "Kind": 3 + }, + { + "EndIndex": 102876, + "Kind": 3 + }, + { + "EndIndex": 102882, + "Kind": 3 + }, + { + "EndIndex": 102900, + "Kind": 3 + }, + { + "EndIndex": 102933, + "Kind": 3 + }, + { + "EndIndex": 103084, + "Kind": 3 + }, + { + "EndIndex": 103105, + "Kind": 3 + }, + { + "EndIndex": 103111, + "Kind": 3 + }, + { + "EndIndex": 103138, + "Kind": 3 + }, + { + "EndIndex": 103168, + "Kind": 3 + }, + { + "EndIndex": 103174, + "Kind": 3 + }, + { + "EndIndex": 103199, + "Kind": 3 + }, + { + "EndIndex": 103229, + "Kind": 3 + }, + { + "EndIndex": 103248, + "Kind": 3 + }, + { + "EndIndex": 103254, + "Kind": 3 + }, + { + "EndIndex": 103272, + "Kind": 3 + }, + { + "EndIndex": 103314, + "Kind": 3 + }, + { + "EndIndex": 103640, + "Kind": 3 + }, + { + "EndIndex": 103662, + "Kind": 3 + }, + { + "EndIndex": 103668, + "Kind": 3 + }, + { + "EndIndex": 103670, + "Kind": 3 + }, + { + "EndIndex": 103695, + "Kind": 3 + }, + { + "EndIndex": 103726, + "Kind": 3 + }, + { + "EndIndex": 103758, + "Kind": 3 + }, + { + "EndIndex": 103797, + "Kind": 3 + }, + { + "EndIndex": 103836, + "Kind": 3 + }, + { + "EndIndex": 103850, + "Kind": 3 + }, + { + "EndIndex": 103856, + "Kind": 3 + }, + { + "EndIndex": 103898, + "Kind": 3 + }, + { + "EndIndex": 103912, + "Kind": 3 + }, + { + "EndIndex": 103918, + "Kind": 3 + }, + { + "EndIndex": 103936, + "Kind": 3 + }, + { + "EndIndex": 103969, + "Kind": 3 + }, + { + "EndIndex": 104120, + "Kind": 3 + }, + { + "EndIndex": 104141, + "Kind": 3 + }, + { + "EndIndex": 104147, + "Kind": 3 + }, + { + "EndIndex": 104172, + "Kind": 3 + }, + { + "EndIndex": 104205, + "Kind": 3 + }, + { + "EndIndex": 104238, + "Kind": 3 + }, + { + "EndIndex": 104244, + "Kind": 3 + }, + { + "EndIndex": 104276, + "Kind": 3 + }, + { + "EndIndex": 104342, + "Kind": 3 + }, + { + "EndIndex": 104360, + "Kind": 3 + }, + { + "EndIndex": 104366, + "Kind": 3 + }, + { + "EndIndex": 104391, + "Kind": 3 + }, + { + "EndIndex": 104424, + "Kind": 3 + }, + { + "EndIndex": 104438, + "Kind": 3 + }, + { + "EndIndex": 104444, + "Kind": 3 + }, + { + "EndIndex": 104471, + "Kind": 3 + }, + { + "EndIndex": 104521, + "Kind": 3 + }, + { + "EndIndex": 104551, + "Kind": 3 + }, + { + "EndIndex": 104557, + "Kind": 3 + }, + { + "EndIndex": 104593, + "Kind": 3 + }, + { + "EndIndex": 104642, + "Kind": 3 + }, + { + "EndIndex": 104663, + "Kind": 3 + }, + { + "EndIndex": 104669, + "Kind": 3 + }, + { + "EndIndex": 104687, + "Kind": 3 + }, + { + "EndIndex": 104729, + "Kind": 3 + }, + { + "EndIndex": 105055, + "Kind": 3 + }, + { + "EndIndex": 105077, + "Kind": 3 + }, + { + "EndIndex": 105083, + "Kind": 3 + }, + { + "EndIndex": 105085, + "Kind": 3 + }, + { + "EndIndex": 105121, + "Kind": 3 + }, + { + "EndIndex": 105151, + "Kind": 3 + }, + { + "EndIndex": 105182, + "Kind": 3 + }, + { + "EndIndex": 105221, + "Kind": 3 + }, + { + "EndIndex": 105260, + "Kind": 3 + }, + { + "EndIndex": 105274, + "Kind": 3 + }, + { + "EndIndex": 105280, + "Kind": 3 + }, + { + "EndIndex": 105322, + "Kind": 3 + }, + { + "EndIndex": 105336, + "Kind": 3 + }, + { + "EndIndex": 105342, + "Kind": 3 + }, + { + "EndIndex": 105360, + "Kind": 3 + }, + { + "EndIndex": 105393, + "Kind": 3 + }, + { + "EndIndex": 105544, + "Kind": 3 + }, + { + "EndIndex": 105565, + "Kind": 3 + }, + { + "EndIndex": 105571, + "Kind": 3 + }, + { + "EndIndex": 105596, + "Kind": 3 + }, + { + "EndIndex": 105629, + "Kind": 3 + }, + { + "EndIndex": 105661, + "Kind": 3 + }, + { + "EndIndex": 105667, + "Kind": 3 + }, + { + "EndIndex": 105699, + "Kind": 3 + }, + { + "EndIndex": 105765, + "Kind": 3 + }, + { + "EndIndex": 105783, + "Kind": 3 + }, + { + "EndIndex": 105789, + "Kind": 3 + }, + { + "EndIndex": 105814, + "Kind": 3 + }, + { + "EndIndex": 105847, + "Kind": 3 + }, + { + "EndIndex": 105861, + "Kind": 3 + }, + { + "EndIndex": 105867, + "Kind": 3 + }, + { + "EndIndex": 105894, + "Kind": 3 + }, + { + "EndIndex": 105944, + "Kind": 3 + }, + { + "EndIndex": 105974, + "Kind": 3 + }, + { + "EndIndex": 105980, + "Kind": 3 + }, + { + "EndIndex": 106016, + "Kind": 3 + }, + { + "EndIndex": 106065, + "Kind": 3 + }, + { + "EndIndex": 106086, + "Kind": 3 + }, + { + "EndIndex": 106092, + "Kind": 3 + }, + { + "EndIndex": 106110, + "Kind": 3 + }, + { + "EndIndex": 106152, + "Kind": 3 + }, + { + "EndIndex": 106478, + "Kind": 3 + }, + { + "EndIndex": 106500, + "Kind": 3 + }, + { + "EndIndex": 106506, + "Kind": 3 + }, + { + "EndIndex": 106508, + "Kind": 3 + }, + { + "EndIndex": 106542, + "Kind": 3 + }, + { + "EndIndex": 106568, + "Kind": 3 + }, + { + "EndIndex": 106599, + "Kind": 3 + }, + { + "EndIndex": 106629, + "Kind": 3 + }, + { + "EndIndex": 106657, + "Kind": 3 + }, + { + "EndIndex": 106663, + "Kind": 3 + }, + { + "EndIndex": 106690, + "Kind": 3 + }, + { + "EndIndex": 106724, + "Kind": 3 + }, + { + "EndIndex": 106755, + "Kind": 3 + }, + { + "EndIndex": 106777, + "Kind": 3 + }, + { + "EndIndex": 106783, + "Kind": 3 + }, + { + "EndIndex": 106813, + "Kind": 3 + }, + { + "EndIndex": 106844, + "Kind": 3 + }, + { + "EndIndex": 106866, + "Kind": 3 + }, + { + "EndIndex": 106872, + "Kind": 3 + }, + { + "EndIndex": 106902, + "Kind": 3 + }, + { + "EndIndex": 106933, + "Kind": 3 + }, + { + "EndIndex": 106955, + "Kind": 3 + }, + { + "EndIndex": 106961, + "Kind": 3 + }, + { + "EndIndex": 107000, + "Kind": 3 + }, + { + "EndIndex": 107039, + "Kind": 3 + }, + { + "EndIndex": 107053, + "Kind": 3 + }, + { + "EndIndex": 107059, + "Kind": 3 + }, + { + "EndIndex": 107089, + "Kind": 3 + }, + { + "EndIndex": 107119, + "Kind": 3 + }, + { + "EndIndex": 107141, + "Kind": 3 + }, + { + "EndIndex": 107147, + "Kind": 3 + }, + { + "EndIndex": 107168, + "Kind": 3 + }, + { + "EndIndex": 107210, + "Kind": 3 + }, + { + "EndIndex": 107224, + "Kind": 3 + }, + { + "EndIndex": 107230, + "Kind": 3 + }, + { + "EndIndex": 107248, + "Kind": 3 + }, + { + "EndIndex": 107281, + "Kind": 3 + }, + { + "EndIndex": 107432, + "Kind": 3 + }, + { + "EndIndex": 107453, + "Kind": 3 + }, + { + "EndIndex": 107459, + "Kind": 3 + }, + { + "EndIndex": 107484, + "Kind": 3 + }, + { + "EndIndex": 107517, + "Kind": 3 + }, + { + "EndIndex": 107545, + "Kind": 3 + }, + { + "EndIndex": 107551, + "Kind": 3 + }, + { + "EndIndex": 107581, + "Kind": 3 + }, + { + "EndIndex": 107612, + "Kind": 3 + }, + { + "EndIndex": 107634, + "Kind": 3 + }, + { + "EndIndex": 107640, + "Kind": 3 + }, + { + "EndIndex": 107664, + "Kind": 3 + }, + { + "EndIndex": 107693, + "Kind": 3 + }, + { + "EndIndex": 107711, + "Kind": 3 + }, + { + "EndIndex": 107717, + "Kind": 3 + }, + { + "EndIndex": 107747, + "Kind": 3 + }, + { + "EndIndex": 107777, + "Kind": 3 + }, + { + "EndIndex": 107799, + "Kind": 3 + }, + { + "EndIndex": 107805, + "Kind": 3 + }, + { + "EndIndex": 107835, + "Kind": 3 + }, + { + "EndIndex": 107866, + "Kind": 3 + }, + { + "EndIndex": 107888, + "Kind": 3 + }, + { + "EndIndex": 107894, + "Kind": 3 + }, + { + "EndIndex": 107924, + "Kind": 3 + }, + { + "EndIndex": 107954, + "Kind": 3 + }, + { + "EndIndex": 107982, + "Kind": 3 + }, + { + "EndIndex": 107988, + "Kind": 3 + }, + { + "EndIndex": 108020, + "Kind": 3 + }, + { + "EndIndex": 108050, + "Kind": 3 + }, + { + "EndIndex": 108078, + "Kind": 3 + }, + { + "EndIndex": 108084, + "Kind": 3 + }, + { + "EndIndex": 108109, + "Kind": 3 + }, + { + "EndIndex": 108139, + "Kind": 3 + }, + { + "EndIndex": 108158, + "Kind": 3 + }, + { + "EndIndex": 108164, + "Kind": 3 + }, + { + "EndIndex": 108195, + "Kind": 3 + }, + { + "EndIndex": 108225, + "Kind": 3 + }, + { + "EndIndex": 108253, + "Kind": 3 + }, + { + "EndIndex": 108259, + "Kind": 3 + }, + { + "EndIndex": 108291, + "Kind": 3 + }, + { + "EndIndex": 108321, + "Kind": 3 + }, + { + "EndIndex": 108349, + "Kind": 3 + }, + { + "EndIndex": 108355, + "Kind": 3 + }, + { + "EndIndex": 108387, + "Kind": 3 + }, + { + "EndIndex": 108417, + "Kind": 3 + }, + { + "EndIndex": 108445, + "Kind": 3 + }, + { + "EndIndex": 108451, + "Kind": 3 + }, + { + "EndIndex": 108482, + "Kind": 3 + }, + { + "EndIndex": 108512, + "Kind": 3 + }, + { + "EndIndex": 108540, + "Kind": 3 + }, + { + "EndIndex": 108546, + "Kind": 3 + }, + { + "EndIndex": 108564, + "Kind": 3 + }, + { + "EndIndex": 108606, + "Kind": 3 + }, + { + "EndIndex": 108932, + "Kind": 3 + }, + { + "EndIndex": 108954, + "Kind": 3 + }, + { + "EndIndex": 108960, + "Kind": 3 + }, + { + "EndIndex": 108991, + "Kind": 3 + }, + { + "EndIndex": 109021, + "Kind": 3 + }, + { + "EndIndex": 109049, + "Kind": 3 + }, + { + "EndIndex": 109055, + "Kind": 3 + }, + { + "EndIndex": 109089, + "Kind": 3 + }, + { + "EndIndex": 109173, + "Kind": 3 + }, + { + "EndIndex": 109195, + "Kind": 3 + }, + { + "EndIndex": 109201, + "Kind": 3 + }, + { + "EndIndex": 109203, + "Kind": 3 + }, + { + "EndIndex": 109229, + "Kind": 3 + }, + { + "EndIndex": 109257, + "Kind": 3 + }, + { + "EndIndex": 109286, + "Kind": 3 + }, + { + "EndIndex": 109325, + "Kind": 3 + }, + { + "EndIndex": 109364, + "Kind": 3 + }, + { + "EndIndex": 109378, + "Kind": 3 + }, + { + "EndIndex": 109384, + "Kind": 3 + }, + { + "EndIndex": 109426, + "Kind": 3 + }, + { + "EndIndex": 109440, + "Kind": 3 + }, + { + "EndIndex": 109446, + "Kind": 3 + }, + { + "EndIndex": 109464, + "Kind": 3 + }, + { + "EndIndex": 109497, + "Kind": 3 + }, + { + "EndIndex": 109648, + "Kind": 3 + }, + { + "EndIndex": 109669, + "Kind": 3 + }, + { + "EndIndex": 109675, + "Kind": 3 + }, + { + "EndIndex": 109700, + "Kind": 3 + }, + { + "EndIndex": 109733, + "Kind": 3 + }, + { + "EndIndex": 109763, + "Kind": 3 + }, + { + "EndIndex": 109769, + "Kind": 3 + }, + { + "EndIndex": 109793, + "Kind": 3 + }, + { + "EndIndex": 109822, + "Kind": 3 + }, + { + "EndIndex": 109840, + "Kind": 3 + }, + { + "EndIndex": 109846, + "Kind": 3 + }, + { + "EndIndex": 109871, + "Kind": 3 + }, + { + "EndIndex": 109901, + "Kind": 3 + }, + { + "EndIndex": 109920, + "Kind": 3 + }, + { + "EndIndex": 109926, + "Kind": 3 + }, + { + "EndIndex": 109944, + "Kind": 3 + }, + { + "EndIndex": 109986, + "Kind": 3 + }, + { + "EndIndex": 110312, + "Kind": 3 + }, + { + "EndIndex": 110334, + "Kind": 3 + }, + { + "EndIndex": 110340, + "Kind": 3 + }, + { + "EndIndex": 110342, + "Kind": 3 + }, + { + "EndIndex": 110372, + "Kind": 3 + }, + { + "EndIndex": 110399, + "Kind": 3 + }, + { + "EndIndex": 110430, + "Kind": 3 + }, + { + "EndIndex": 110460, + "Kind": 3 + }, + { + "EndIndex": 110489, + "Kind": 3 + }, + { + "EndIndex": 110495, + "Kind": 3 + }, + { + "EndIndex": 110523, + "Kind": 3 + }, + { + "EndIndex": 110557, + "Kind": 3 + }, + { + "EndIndex": 110588, + "Kind": 3 + }, + { + "EndIndex": 110610, + "Kind": 3 + }, + { + "EndIndex": 110616, + "Kind": 3 + }, + { + "EndIndex": 110646, + "Kind": 3 + }, + { + "EndIndex": 110677, + "Kind": 3 + }, + { + "EndIndex": 110699, + "Kind": 3 + }, + { + "EndIndex": 110705, + "Kind": 3 + }, + { + "EndIndex": 110735, + "Kind": 3 + }, + { + "EndIndex": 110766, + "Kind": 3 + }, + { + "EndIndex": 110788, + "Kind": 3 + }, + { + "EndIndex": 110794, + "Kind": 3 + }, + { + "EndIndex": 110833, + "Kind": 3 + }, + { + "EndIndex": 110872, + "Kind": 3 + }, + { + "EndIndex": 110886, + "Kind": 3 + }, + { + "EndIndex": 110892, + "Kind": 3 + }, + { + "EndIndex": 110922, + "Kind": 3 + }, + { + "EndIndex": 110952, + "Kind": 3 + }, + { + "EndIndex": 110974, + "Kind": 3 + }, + { + "EndIndex": 110980, + "Kind": 3 + }, + { + "EndIndex": 111001, + "Kind": 3 + }, + { + "EndIndex": 111043, + "Kind": 3 + }, + { + "EndIndex": 111057, + "Kind": 3 + }, + { + "EndIndex": 111063, + "Kind": 3 + }, + { + "EndIndex": 111081, + "Kind": 3 + }, + { + "EndIndex": 111114, + "Kind": 3 + }, + { + "EndIndex": 111265, + "Kind": 3 + }, + { + "EndIndex": 111286, + "Kind": 3 + }, + { + "EndIndex": 111292, + "Kind": 3 + }, + { + "EndIndex": 111317, + "Kind": 3 + }, + { + "EndIndex": 111350, + "Kind": 3 + }, + { + "EndIndex": 111379, + "Kind": 3 + }, + { + "EndIndex": 111385, + "Kind": 3 + }, + { + "EndIndex": 111415, + "Kind": 3 + }, + { + "EndIndex": 111446, + "Kind": 3 + }, + { + "EndIndex": 111468, + "Kind": 3 + }, + { + "EndIndex": 111474, + "Kind": 3 + }, + { + "EndIndex": 111498, + "Kind": 3 + }, + { + "EndIndex": 111527, + "Kind": 3 + }, + { + "EndIndex": 111545, + "Kind": 3 + }, + { + "EndIndex": 111551, + "Kind": 3 + }, + { + "EndIndex": 111581, + "Kind": 3 + }, + { + "EndIndex": 111611, + "Kind": 3 + }, + { + "EndIndex": 111633, + "Kind": 3 + }, + { + "EndIndex": 111639, + "Kind": 3 + }, + { + "EndIndex": 111669, + "Kind": 3 + }, + { + "EndIndex": 111700, + "Kind": 3 + }, + { + "EndIndex": 111722, + "Kind": 3 + }, + { + "EndIndex": 111728, + "Kind": 3 + }, + { + "EndIndex": 111758, + "Kind": 3 + }, + { + "EndIndex": 111788, + "Kind": 3 + }, + { + "EndIndex": 111817, + "Kind": 3 + }, + { + "EndIndex": 111823, + "Kind": 3 + }, + { + "EndIndex": 111855, + "Kind": 3 + }, + { + "EndIndex": 111885, + "Kind": 3 + }, + { + "EndIndex": 111914, + "Kind": 3 + }, + { + "EndIndex": 111920, + "Kind": 3 + }, + { + "EndIndex": 111945, + "Kind": 3 + }, + { + "EndIndex": 111975, + "Kind": 3 + }, + { + "EndIndex": 111994, + "Kind": 3 + }, + { + "EndIndex": 112000, + "Kind": 3 + }, + { + "EndIndex": 112031, + "Kind": 3 + }, + { + "EndIndex": 112061, + "Kind": 3 + }, + { + "EndIndex": 112090, + "Kind": 3 + }, + { + "EndIndex": 112096, + "Kind": 3 + }, + { + "EndIndex": 112128, + "Kind": 3 + }, + { + "EndIndex": 112158, + "Kind": 3 + }, + { + "EndIndex": 112187, + "Kind": 3 + }, + { + "EndIndex": 112193, + "Kind": 3 + }, + { + "EndIndex": 112225, + "Kind": 3 + }, + { + "EndIndex": 112255, + "Kind": 3 + }, + { + "EndIndex": 112284, + "Kind": 3 + }, + { + "EndIndex": 112290, + "Kind": 3 + }, + { + "EndIndex": 112321, + "Kind": 3 + }, + { + "EndIndex": 112351, + "Kind": 3 + }, + { + "EndIndex": 112380, + "Kind": 3 + }, + { + "EndIndex": 112386, + "Kind": 3 + }, + { + "EndIndex": 112404, + "Kind": 3 + }, + { + "EndIndex": 112446, + "Kind": 3 + }, + { + "EndIndex": 112772, + "Kind": 3 + }, + { + "EndIndex": 112794, + "Kind": 3 + }, + { + "EndIndex": 112800, + "Kind": 3 + }, + { + "EndIndex": 112831, + "Kind": 3 + }, + { + "EndIndex": 112861, + "Kind": 3 + }, + { + "EndIndex": 112890, + "Kind": 3 + }, + { + "EndIndex": 112896, + "Kind": 3 + }, + { + "EndIndex": 112930, + "Kind": 3 + }, + { + "EndIndex": 113014, + "Kind": 3 + }, + { + "EndIndex": 113036, + "Kind": 3 + }, + { + "EndIndex": 113042, + "Kind": 3 + }, + { + "EndIndex": 113044, + "Kind": 3 + }, + { + "EndIndex": 113072, + "Kind": 3 + }, + { + "EndIndex": 113101, + "Kind": 3 + }, + { + "EndIndex": 113131, + "Kind": 3 + }, + { + "EndIndex": 113170, + "Kind": 3 + }, + { + "EndIndex": 113209, + "Kind": 3 + }, + { + "EndIndex": 113223, + "Kind": 3 + }, + { + "EndIndex": 113229, + "Kind": 3 + }, + { + "EndIndex": 113271, + "Kind": 3 + }, + { + "EndIndex": 113285, + "Kind": 3 + }, + { + "EndIndex": 113291, + "Kind": 3 + }, + { + "EndIndex": 113309, + "Kind": 3 + }, + { + "EndIndex": 113342, + "Kind": 3 + }, + { + "EndIndex": 113493, + "Kind": 3 + }, + { + "EndIndex": 113514, + "Kind": 3 + }, + { + "EndIndex": 113520, + "Kind": 3 + }, + { + "EndIndex": 113545, + "Kind": 3 + }, + { + "EndIndex": 113578, + "Kind": 3 + }, + { + "EndIndex": 113609, + "Kind": 3 + }, + { + "EndIndex": 113615, + "Kind": 3 + }, + { + "EndIndex": 113647, + "Kind": 3 + }, + { + "EndIndex": 113713, + "Kind": 3 + }, + { + "EndIndex": 113731, + "Kind": 3 + }, + { + "EndIndex": 113737, + "Kind": 3 + }, + { + "EndIndex": 113762, + "Kind": 3 + }, + { + "EndIndex": 113795, + "Kind": 3 + }, + { + "EndIndex": 113809, + "Kind": 3 + }, + { + "EndIndex": 113815, + "Kind": 3 + }, + { + "EndIndex": 113842, + "Kind": 3 + }, + { + "EndIndex": 113892, + "Kind": 3 + }, + { + "EndIndex": 113922, + "Kind": 3 + }, + { + "EndIndex": 113928, + "Kind": 3 + }, + { + "EndIndex": 113946, + "Kind": 3 + }, + { + "EndIndex": 113988, + "Kind": 3 + }, + { + "EndIndex": 114314, + "Kind": 3 + }, + { + "EndIndex": 114336, + "Kind": 3 + }, + { + "EndIndex": 114342, + "Kind": 3 + }, + { + "EndIndex": 114344, + "Kind": 3 + }, + { + "EndIndex": 114376, + "Kind": 3 + }, + { + "EndIndex": 114410, + "Kind": 3 + }, + { + "EndIndex": 114445, + "Kind": 3 + }, + { + "EndIndex": 114484, + "Kind": 3 + }, + { + "EndIndex": 114523, + "Kind": 3 + }, + { + "EndIndex": 114537, + "Kind": 3 + }, + { + "EndIndex": 114543, + "Kind": 3 + }, + { + "EndIndex": 114585, + "Kind": 3 + }, + { + "EndIndex": 114599, + "Kind": 3 + }, + { + "EndIndex": 114605, + "Kind": 3 + }, + { + "EndIndex": 114623, + "Kind": 3 + }, + { + "EndIndex": 114656, + "Kind": 3 + }, + { + "EndIndex": 114807, + "Kind": 3 + }, + { + "EndIndex": 114828, + "Kind": 3 + }, + { + "EndIndex": 114834, + "Kind": 3 + }, + { + "EndIndex": 114859, + "Kind": 3 + }, + { + "EndIndex": 114892, + "Kind": 3 + }, + { + "EndIndex": 114928, + "Kind": 3 + }, + { + "EndIndex": 114934, + "Kind": 3 + }, + { + "EndIndex": 114959, + "Kind": 3 + }, + { + "EndIndex": 114992, + "Kind": 3 + }, + { + "EndIndex": 115006, + "Kind": 3 + }, + { + "EndIndex": 115012, + "Kind": 3 + }, + { + "EndIndex": 115039, + "Kind": 3 + }, + { + "EndIndex": 115089, + "Kind": 3 + }, + { + "EndIndex": 115119, + "Kind": 3 + }, + { + "EndIndex": 115125, + "Kind": 3 + }, + { + "EndIndex": 115143, + "Kind": 3 + }, + { + "EndIndex": 115185, + "Kind": 3 + }, + { + "EndIndex": 115511, + "Kind": 3 + }, + { + "EndIndex": 115533, + "Kind": 3 + }, + { + "EndIndex": 115539, + "Kind": 3 + }, + { + "EndIndex": 115541, + "Kind": 3 + }, + { + "EndIndex": 115583, + "Kind": 3 + }, + { + "EndIndex": 116124, + "Kind": 3 + }, + { + "EndIndex": 116159, + "Kind": 3 + }, + { + "EndIndex": 116200, + "Kind": 3 + }, + { + "EndIndex": 116233, + "Kind": 3 + }, + { + "EndIndex": 116252, + "Kind": 3 + }, + { + "EndIndex": 116294, + "Kind": 3 + }, + { + "EndIndex": 116339, + "Kind": 3 + }, + { + "EndIndex": 116353, + "Kind": 3 + }, + { + "EndIndex": 116359, + "Kind": 3 + }, + { + "EndIndex": 116377, + "Kind": 3 + }, + { + "EndIndex": 116410, + "Kind": 3 + }, + { + "EndIndex": 116561, + "Kind": 3 + }, + { + "EndIndex": 116582, + "Kind": 3 + }, + { + "EndIndex": 116588, + "Kind": 3 + }, + { + "EndIndex": 116606, + "Kind": 3 + }, + { + "EndIndex": 116648, + "Kind": 3 + }, + { + "EndIndex": 116974, + "Kind": 3 + }, + { + "EndIndex": 116996, + "Kind": 3 + }, + { + "EndIndex": 117002, + "Kind": 3 + }, + { + "EndIndex": 117004, + "Kind": 3 + }, + { + "EndIndex": 117038, + "Kind": 3 + }, + { + "EndIndex": 117063, + "Kind": 3 + }, + { + "EndIndex": 117095, + "Kind": 3 + }, + { + "EndIndex": 117114, + "Kind": 3 + }, + { + "EndIndex": 117156, + "Kind": 3 + }, + { + "EndIndex": 117185, + "Kind": 3 + }, + { + "EndIndex": 117199, + "Kind": 3 + }, + { + "EndIndex": 117205, + "Kind": 3 + }, + { + "EndIndex": 117223, + "Kind": 3 + }, + { + "EndIndex": 117256, + "Kind": 3 + }, + { + "EndIndex": 117407, + "Kind": 3 + }, + { + "EndIndex": 117428, + "Kind": 3 + }, + { + "EndIndex": 117434, + "Kind": 3 + }, + { + "EndIndex": 117452, + "Kind": 3 + }, + { + "EndIndex": 117494, + "Kind": 3 + }, + { + "EndIndex": 117820, + "Kind": 3 + }, + { + "EndIndex": 117842, + "Kind": 3 + }, + { + "EndIndex": 117848, + "Kind": 3 + }, + { + "EndIndex": 117850, + "Kind": 3 + }, + { + "EndIndex": 117884, + "Kind": 3 + }, + { + "EndIndex": 117912, + "Kind": 3 + }, + { + "EndIndex": 117944, + "Kind": 3 + }, + { + "EndIndex": 117963, + "Kind": 3 + }, + { + "EndIndex": 118005, + "Kind": 3 + }, + { + "EndIndex": 118037, + "Kind": 3 + }, + { + "EndIndex": 118051, + "Kind": 3 + }, + { + "EndIndex": 118057, + "Kind": 3 + }, + { + "EndIndex": 118075, + "Kind": 3 + }, + { + "EndIndex": 118108, + "Kind": 3 + }, + { + "EndIndex": 118259, + "Kind": 3 + }, + { + "EndIndex": 118280, + "Kind": 3 + }, + { + "EndIndex": 118286, + "Kind": 3 + }, + { + "EndIndex": 118304, + "Kind": 3 + }, + { + "EndIndex": 118346, + "Kind": 3 + }, + { + "EndIndex": 118672, + "Kind": 3 + }, + { + "EndIndex": 118694, + "Kind": 3 + }, + { + "EndIndex": 118700, + "Kind": 3 + }, + { + "EndIndex": 118702, + "Kind": 3 + }, + { + "EndIndex": 118732, + "Kind": 3 + }, + { + "EndIndex": 118776, + "Kind": 3 + }, + { + "EndIndex": 118791, + "Kind": 3 + }, + { + "EndIndex": 118817, + "Kind": 3 + }, + { + "EndIndex": 118844, + "Kind": 3 + }, + { + "EndIndex": 118858, + "Kind": 3 + }, + { + "EndIndex": 118864, + "Kind": 3 + }, + { + "EndIndex": 118895, + "Kind": 3 + }, + { + "EndIndex": 118910, + "Kind": 3 + }, + { + "EndIndex": 118938, + "Kind": 3 + }, + { + "EndIndex": 118967, + "Kind": 3 + }, + { + "EndIndex": 118981, + "Kind": 3 + }, + { + "EndIndex": 118987, + "Kind": 3 + }, + { + "EndIndex": 119021, + "Kind": 3 + }, + { + "EndIndex": 119063, + "Kind": 3 + }, + { + "EndIndex": 119084, + "Kind": 3 + }, + { + "EndIndex": 119090, + "Kind": 3 + }, + { + "EndIndex": 119109, + "Kind": 3 + }, + { + "EndIndex": 119148, + "Kind": 3 + }, + { + "EndIndex": 119187, + "Kind": 3 + }, + { + "EndIndex": 119201, + "Kind": 3 + }, + { + "EndIndex": 119207, + "Kind": 3 + }, + { + "EndIndex": 119249, + "Kind": 3 + }, + { + "EndIndex": 119297, + "Kind": 3 + }, + { + "EndIndex": 119311, + "Kind": 3 + }, + { + "EndIndex": 119317, + "Kind": 3 + }, + { + "EndIndex": 119335, + "Kind": 3 + }, + { + "EndIndex": 119368, + "Kind": 3 + }, + { + "EndIndex": 119519, + "Kind": 3 + }, + { + "EndIndex": 119540, + "Kind": 3 + }, + { + "EndIndex": 119546, + "Kind": 3 + }, + { + "EndIndex": 119573, + "Kind": 3 + }, + { + "EndIndex": 119603, + "Kind": 3 + }, + { + "EndIndex": 119609, + "Kind": 3 + }, + { + "EndIndex": 119634, + "Kind": 3 + }, + { + "EndIndex": 119664, + "Kind": 3 + }, + { + "EndIndex": 119683, + "Kind": 3 + }, + { + "EndIndex": 119689, + "Kind": 3 + }, + { + "EndIndex": 119730, + "Kind": 3 + }, + { + "EndIndex": 119779, + "Kind": 3 + }, + { + "EndIndex": 119800, + "Kind": 3 + }, + { + "EndIndex": 119806, + "Kind": 3 + }, + { + "EndIndex": 119842, + "Kind": 3 + }, + { + "EndIndex": 119863, + "Kind": 3 + }, + { + "EndIndex": 119869, + "Kind": 3 + }, + { + "EndIndex": 119893, + "Kind": 3 + }, + { + "EndIndex": 119922, + "Kind": 3 + }, + { + "EndIndex": 119941, + "Kind": 3 + }, + { + "EndIndex": 119947, + "Kind": 3 + }, + { + "EndIndex": 119965, + "Kind": 3 + }, + { + "EndIndex": 120007, + "Kind": 3 + }, + { + "EndIndex": 120333, + "Kind": 3 + }, + { + "EndIndex": 120355, + "Kind": 3 + }, + { + "EndIndex": 120361, + "Kind": 3 + }, + { + "EndIndex": 120376, + "Kind": 3 + }, + { + "EndIndex": 120413, + "Kind": 3 + }, + { + "EndIndex": 120427, + "Kind": 3 + }, + { + "EndIndex": 120433, + "Kind": 3 + }, + { + "EndIndex": 120448, + "Kind": 3 + }, + { + "EndIndex": 120478, + "Kind": 3 + }, + { + "EndIndex": 120492, + "Kind": 3 + }, + { + "EndIndex": 120498, + "Kind": 3 + }, + { + "EndIndex": 120513, + "Kind": 3 + }, + { + "EndIndex": 120534, + "Kind": 3 + }, + { + "EndIndex": 120548, + "Kind": 3 + }, + { + "EndIndex": 120554, + "Kind": 3 + }, + { + "EndIndex": 120585, + "Kind": 3 + }, + { + "EndIndex": 120679, + "Kind": 3 + }, + { + "EndIndex": 120693, + "Kind": 3 + }, + { + "EndIndex": 120699, + "Kind": 3 + }, + { + "EndIndex": 120701, + "Kind": 3 + }, + { + "EndIndex": 120734, + "Kind": 3 + }, + { + "EndIndex": 120768, + "Kind": 3 + }, + { + "EndIndex": 120801, + "Kind": 3 + }, + { + "EndIndex": 120820, + "Kind": 3 + }, + { + "EndIndex": 120862, + "Kind": 3 + }, + { + "EndIndex": 120900, + "Kind": 3 + }, + { + "EndIndex": 120914, + "Kind": 3 + }, + { + "EndIndex": 120920, + "Kind": 3 + }, + { + "EndIndex": 120938, + "Kind": 3 + }, + { + "EndIndex": 120971, + "Kind": 3 + }, + { + "EndIndex": 121122, + "Kind": 3 + }, + { + "EndIndex": 121143, + "Kind": 3 + }, + { + "EndIndex": 121149, + "Kind": 3 + }, + { + "EndIndex": 121167, + "Kind": 3 + }, + { + "EndIndex": 121209, + "Kind": 3 + }, + { + "EndIndex": 121535, + "Kind": 3 + }, + { + "EndIndex": 121557, + "Kind": 3 + }, + { + "EndIndex": 121563, + "Kind": 3 + }, + { + "EndIndex": 121565, + "Kind": 3 + }, + { + "EndIndex": 121606, + "Kind": 3 + }, + { + "EndIndex": 121626, + "Kind": 3 + }, + { + "EndIndex": 121659, + "Kind": 3 + }, + { + "EndIndex": 121678, + "Kind": 3 + }, + { + "EndIndex": 121720, + "Kind": 3 + }, + { + "EndIndex": 121744, + "Kind": 3 + }, + { + "EndIndex": 121758, + "Kind": 3 + }, + { + "EndIndex": 121764, + "Kind": 3 + }, + { + "EndIndex": 121782, + "Kind": 3 + }, + { + "EndIndex": 121815, + "Kind": 3 + }, + { + "EndIndex": 121966, + "Kind": 3 + }, + { + "EndIndex": 121987, + "Kind": 3 + }, + { + "EndIndex": 121993, + "Kind": 3 + }, + { + "EndIndex": 122011, + "Kind": 3 + }, + { + "EndIndex": 122053, + "Kind": 3 + }, + { + "EndIndex": 122379, + "Kind": 3 + }, + { + "EndIndex": 122401, + "Kind": 3 + }, + { + "EndIndex": 122407, + "Kind": 3 + }, + { + "EndIndex": 122409, + "Kind": 3 + }, + { + "EndIndex": 122440, + "Kind": 3 + }, + { + "EndIndex": 122461, + "Kind": 3 + }, + { + "EndIndex": 122490, + "Kind": 3 + }, + { + "EndIndex": 122509, + "Kind": 3 + }, + { + "EndIndex": 122551, + "Kind": 3 + }, + { + "EndIndex": 122576, + "Kind": 3 + }, + { + "EndIndex": 122590, + "Kind": 3 + }, + { + "EndIndex": 122596, + "Kind": 3 + }, + { + "EndIndex": 122614, + "Kind": 3 + }, + { + "EndIndex": 122647, + "Kind": 3 + }, + { + "EndIndex": 122798, + "Kind": 3 + }, + { + "EndIndex": 122819, + "Kind": 3 + }, + { + "EndIndex": 122825, + "Kind": 3 + }, + { + "EndIndex": 122843, + "Kind": 3 + }, + { + "EndIndex": 122885, + "Kind": 3 + }, + { + "EndIndex": 123211, + "Kind": 3 + }, + { + "EndIndex": 123233, + "Kind": 3 + }, + { + "EndIndex": 123239, + "Kind": 3 + }, + { + "EndIndex": 123241, + "Kind": 3 + }, + { + "EndIndex": 123271, + "Kind": 3 + }, + { + "EndIndex": 123403, + "Kind": 3 + }, + { + "EndIndex": 123433, + "Kind": 3 + }, + { + "EndIndex": 123452, + "Kind": 3 + }, + { + "EndIndex": 123494, + "Kind": 3 + }, + { + "EndIndex": 123630, + "Kind": 3 + }, + { + "EndIndex": 123644, + "Kind": 3 + }, + { + "EndIndex": 123650, + "Kind": 3 + }, + { + "EndIndex": 123668, + "Kind": 3 + }, + { + "EndIndex": 123701, + "Kind": 3 + }, + { + "EndIndex": 123852, + "Kind": 3 + }, + { + "EndIndex": 123873, + "Kind": 3 + }, + { + "EndIndex": 123879, + "Kind": 3 + }, + { + "EndIndex": 123897, + "Kind": 3 + }, + { + "EndIndex": 123939, + "Kind": 3 + }, + { + "EndIndex": 124265, + "Kind": 3 + }, + { + "EndIndex": 124287, + "Kind": 3 + }, + { + "EndIndex": 124293, + "Kind": 3 + }, + { + "EndIndex": 124295, + "Kind": 3 + }, + { + "EndIndex": 124330, + "Kind": 3 + }, + { + "EndIndex": 124358, + "Kind": 3 + }, + { + "EndIndex": 124393, + "Kind": 3 + }, + { + "EndIndex": 124412, + "Kind": 3 + }, + { + "EndIndex": 124454, + "Kind": 3 + }, + { + "EndIndex": 124486, + "Kind": 3 + }, + { + "EndIndex": 124500, + "Kind": 3 + }, + { + "EndIndex": 124506, + "Kind": 3 + }, + { + "EndIndex": 124524, + "Kind": 3 + }, + { + "EndIndex": 124557, + "Kind": 3 + }, + { + "EndIndex": 124708, + "Kind": 3 + }, + { + "EndIndex": 124729, + "Kind": 3 + }, + { + "EndIndex": 124735, + "Kind": 3 + }, + { + "EndIndex": 124753, + "Kind": 3 + }, + { + "EndIndex": 124795, + "Kind": 3 + }, + { + "EndIndex": 125121, + "Kind": 3 + }, + { + "EndIndex": 125143, + "Kind": 3 + }, + { + "EndIndex": 125149, + "Kind": 3 + }, + { + "EndIndex": 125151, + "Kind": 3 + }, + { + "EndIndex": 125199, + "Kind": 3 + }, + { + "EndIndex": 125226, + "Kind": 3 + }, + { + "EndIndex": 125266, + "Kind": 3 + }, + { + "EndIndex": 125285, + "Kind": 3 + }, + { + "EndIndex": 125327, + "Kind": 3 + }, + { + "EndIndex": 125358, + "Kind": 3 + }, + { + "EndIndex": 125372, + "Kind": 3 + }, + { + "EndIndex": 125378, + "Kind": 3 + }, + { + "EndIndex": 125396, + "Kind": 3 + }, + { + "EndIndex": 125429, + "Kind": 3 + }, + { + "EndIndex": 125580, + "Kind": 3 + }, + { + "EndIndex": 125601, + "Kind": 3 + }, + { + "EndIndex": 125607, + "Kind": 3 + }, + { + "EndIndex": 125625, + "Kind": 3 + }, + { + "EndIndex": 125667, + "Kind": 3 + }, + { + "EndIndex": 125993, + "Kind": 3 + }, + { + "EndIndex": 126015, + "Kind": 3 + }, + { + "EndIndex": 126021, + "Kind": 3 + }, + { + "EndIndex": 126023, + "Kind": 3 + }, + { + "EndIndex": 126056, + "Kind": 3 + }, + { + "EndIndex": 126081, + "Kind": 3 + }, + { + "EndIndex": 126114, + "Kind": 3 + }, + { + "EndIndex": 126133, + "Kind": 3 + }, + { + "EndIndex": 126175, + "Kind": 3 + }, + { + "EndIndex": 126204, + "Kind": 3 + }, + { + "EndIndex": 126218, + "Kind": 3 + }, + { + "EndIndex": 126224, + "Kind": 3 + }, + { + "EndIndex": 126242, + "Kind": 3 + }, + { + "EndIndex": 126275, + "Kind": 3 + }, + { + "EndIndex": 126426, + "Kind": 3 + }, + { + "EndIndex": 126447, + "Kind": 3 + }, + { + "EndIndex": 126453, + "Kind": 3 + }, + { + "EndIndex": 126471, + "Kind": 3 + }, + { + "EndIndex": 126513, + "Kind": 3 + }, + { + "EndIndex": 126839, + "Kind": 3 + }, + { + "EndIndex": 126861, + "Kind": 3 + }, + { + "EndIndex": 126867, + "Kind": 3 + }, + { + "EndIndex": 126869, + "Kind": 3 + }, + { + "EndIndex": 126917, + "Kind": 3 + }, + { + "EndIndex": 126944, + "Kind": 3 + }, + { + "EndIndex": 126984, + "Kind": 3 + }, + { + "EndIndex": 127003, + "Kind": 3 + }, + { + "EndIndex": 127045, + "Kind": 3 + }, + { + "EndIndex": 127076, + "Kind": 3 + }, + { + "EndIndex": 127090, + "Kind": 3 + }, + { + "EndIndex": 127096, + "Kind": 3 + }, + { + "EndIndex": 127114, + "Kind": 3 + }, + { + "EndIndex": 127147, + "Kind": 3 + }, + { + "EndIndex": 127298, + "Kind": 3 + }, + { + "EndIndex": 127319, + "Kind": 3 + }, + { + "EndIndex": 127325, + "Kind": 3 + }, + { + "EndIndex": 127343, + "Kind": 3 + }, + { + "EndIndex": 127385, + "Kind": 3 + }, + { + "EndIndex": 127711, + "Kind": 3 + }, + { + "EndIndex": 127733, + "Kind": 3 + }, + { + "EndIndex": 127739, + "Kind": 3 + }, + { + "EndIndex": 127741, + "Kind": 3 + }, + { + "EndIndex": 127787, + "Kind": 3 + }, + { + "EndIndex": 127812, + "Kind": 3 + }, + { + "EndIndex": 127850, + "Kind": 3 + }, + { + "EndIndex": 127869, + "Kind": 3 + }, + { + "EndIndex": 127911, + "Kind": 3 + }, + { + "EndIndex": 127940, + "Kind": 3 + }, + { + "EndIndex": 127954, + "Kind": 3 + }, + { + "EndIndex": 127960, + "Kind": 3 + }, + { + "EndIndex": 127978, + "Kind": 3 + }, + { + "EndIndex": 128011, + "Kind": 3 + }, + { + "EndIndex": 128162, + "Kind": 3 + }, + { + "EndIndex": 128183, + "Kind": 3 + }, + { + "EndIndex": 128189, + "Kind": 3 + }, + { + "EndIndex": 128207, + "Kind": 3 + }, + { + "EndIndex": 128249, + "Kind": 3 + }, + { + "EndIndex": 128575, + "Kind": 3 + }, + { + "EndIndex": 128597, + "Kind": 3 + }, + { + "EndIndex": 128603, + "Kind": 3 + }, + { + "EndIndex": 128605, + "Kind": 3 + }, + { + "EndIndex": 128641, + "Kind": 3 + }, + { + "EndIndex": 128699, + "Kind": 3 + }, + { + "EndIndex": 128735, + "Kind": 3 + }, + { + "EndIndex": 128754, + "Kind": 3 + }, + { + "EndIndex": 128796, + "Kind": 3 + }, + { + "EndIndex": 128858, + "Kind": 3 + }, + { + "EndIndex": 128872, + "Kind": 3 + }, + { + "EndIndex": 128878, + "Kind": 3 + }, + { + "EndIndex": 128896, + "Kind": 3 + }, + { + "EndIndex": 128929, + "Kind": 3 + }, + { + "EndIndex": 129080, + "Kind": 3 + }, + { + "EndIndex": 129101, + "Kind": 3 + }, + { + "EndIndex": 129107, + "Kind": 3 + }, + { + "EndIndex": 129125, + "Kind": 3 + }, + { + "EndIndex": 129167, + "Kind": 3 + }, + { + "EndIndex": 129493, + "Kind": 3 + }, + { + "EndIndex": 129515, + "Kind": 3 + }, + { + "EndIndex": 129521, + "Kind": 3 + }, + { + "EndIndex": 129523, + "Kind": 3 + }, + { + "EndIndex": 129551, + "Kind": 3 + }, + { + "EndIndex": 129583, + "Kind": 3 + }, + { + "EndIndex": 129609, + "Kind": 3 + }, + { + "EndIndex": 129628, + "Kind": 3 + }, + { + "EndIndex": 129670, + "Kind": 3 + }, + { + "EndIndex": 129706, + "Kind": 3 + }, + { + "EndIndex": 129720, + "Kind": 3 + }, + { + "EndIndex": 129726, + "Kind": 3 + }, + { + "EndIndex": 129744, + "Kind": 3 + }, + { + "EndIndex": 129777, + "Kind": 3 + }, + { + "EndIndex": 129928, + "Kind": 3 + }, + { + "EndIndex": 129949, + "Kind": 3 + }, + { + "EndIndex": 129955, + "Kind": 3 + }, + { + "EndIndex": 129973, + "Kind": 3 + }, + { + "EndIndex": 130015, + "Kind": 3 + }, + { + "EndIndex": 130341, + "Kind": 3 + }, + { + "EndIndex": 130363, + "Kind": 3 + }, + { + "EndIndex": 130369, + "Kind": 3 + }, + { + "EndIndex": 130371, + "Kind": 3 + }, + { + "EndIndex": 130394, + "Kind": 3 + }, + { + "EndIndex": 130424, + "Kind": 3 + }, + { + "EndIndex": 130457, + "Kind": 3 + }, + { + "EndIndex": 130511, + "Kind": 3 + }, + { + "EndIndex": 130538, + "Kind": 3 + }, + { + "EndIndex": 130557, + "Kind": 3 + }, + { + "EndIndex": 130599, + "Kind": 3 + }, + { + "EndIndex": 130657, + "Kind": 3 + }, + { + "EndIndex": 130671, + "Kind": 3 + }, + { + "EndIndex": 130677, + "Kind": 3 + }, + { + "EndIndex": 130695, + "Kind": 3 + }, + { + "EndIndex": 130728, + "Kind": 3 + }, + { + "EndIndex": 130879, + "Kind": 3 + }, + { + "EndIndex": 130900, + "Kind": 3 + }, + { + "EndIndex": 130906, + "Kind": 3 + }, + { + "EndIndex": 130924, + "Kind": 3 + }, + { + "EndIndex": 130966, + "Kind": 3 + }, + { + "EndIndex": 131292, + "Kind": 3 + }, + { + "EndIndex": 131314, + "Kind": 3 + }, + { + "EndIndex": 131320, + "Kind": 3 + }, + { + "EndIndex": 131322, + "Kind": 3 + }, + { + "EndIndex": 131355, + "Kind": 3 + }, + { + "EndIndex": 131383, + "Kind": 3 + }, + { + "EndIndex": 131416, + "Kind": 3 + }, + { + "EndIndex": 131435, + "Kind": 3 + }, + { + "EndIndex": 131477, + "Kind": 3 + }, + { + "EndIndex": 131509, + "Kind": 3 + }, + { + "EndIndex": 131523, + "Kind": 3 + }, + { + "EndIndex": 131529, + "Kind": 3 + }, + { + "EndIndex": 131547, + "Kind": 3 + }, + { + "EndIndex": 131580, + "Kind": 3 + }, + { + "EndIndex": 131731, + "Kind": 3 + }, + { + "EndIndex": 131752, + "Kind": 3 + }, + { + "EndIndex": 131758, + "Kind": 3 + }, + { + "EndIndex": 131776, + "Kind": 3 + }, + { + "EndIndex": 131818, + "Kind": 3 + }, + { + "EndIndex": 132144, + "Kind": 3 + }, + { + "EndIndex": 132166, + "Kind": 3 + }, + { + "EndIndex": 132172, + "Kind": 3 + }, + { + "EndIndex": 132174, + "Kind": 3 + }, + { + "EndIndex": 132209, + "Kind": 3 + }, + { + "EndIndex": 132232, + "Kind": 3 + }, + { + "EndIndex": 132267, + "Kind": 3 + }, + { + "EndIndex": 132286, + "Kind": 3 + }, + { + "EndIndex": 132328, + "Kind": 3 + }, + { + "EndIndex": 132355, + "Kind": 3 + }, + { + "EndIndex": 132369, + "Kind": 3 + }, + { + "EndIndex": 132375, + "Kind": 3 + }, + { + "EndIndex": 132393, + "Kind": 3 + }, + { + "EndIndex": 132426, + "Kind": 3 + }, + { + "EndIndex": 132577, + "Kind": 3 + }, + { + "EndIndex": 132598, + "Kind": 3 + }, + { + "EndIndex": 132604, + "Kind": 3 + }, + { + "EndIndex": 132622, + "Kind": 3 + }, + { + "EndIndex": 132664, + "Kind": 3 + }, + { + "EndIndex": 132990, + "Kind": 3 + }, + { + "EndIndex": 133012, + "Kind": 3 + }, + { + "EndIndex": 133018, + "Kind": 3 + }, + { + "EndIndex": 133020, + "Kind": 3 + }, + { + "EndIndex": 133064, + "Kind": 3 + }, + { + "EndIndex": 133104, + "Kind": 3 + }, + { + "EndIndex": 133140, + "Kind": 3 + }, + { + "EndIndex": 133159, + "Kind": 3 + }, + { + "EndIndex": 133201, + "Kind": 3 + }, + { + "EndIndex": 133245, + "Kind": 3 + }, + { + "EndIndex": 133259, + "Kind": 3 + }, + { + "EndIndex": 133265, + "Kind": 3 + }, + { + "EndIndex": 133283, + "Kind": 3 + }, + { + "EndIndex": 133316, + "Kind": 3 + }, + { + "EndIndex": 133467, + "Kind": 3 + }, + { + "EndIndex": 133488, + "Kind": 3 + }, + { + "EndIndex": 133494, + "Kind": 3 + }, + { + "EndIndex": 133512, + "Kind": 3 + }, + { + "EndIndex": 133554, + "Kind": 3 + }, + { + "EndIndex": 133880, + "Kind": 3 + }, + { + "EndIndex": 133902, + "Kind": 3 + }, + { + "EndIndex": 133908, + "Kind": 3 + }, + { + "EndIndex": 133910, + "Kind": 3 + }, + { + "EndIndex": 133941, + "Kind": 3 + }, + { + "EndIndex": 134035, + "Kind": 3 + }, + { + "EndIndex": 134066, + "Kind": 3 + }, + { + "EndIndex": 134085, + "Kind": 3 + }, + { + "EndIndex": 134127, + "Kind": 3 + }, + { + "EndIndex": 134225, + "Kind": 3 + }, + { + "EndIndex": 134239, + "Kind": 3 + }, + { + "EndIndex": 134245, + "Kind": 3 + }, + { + "EndIndex": 134263, + "Kind": 3 + }, + { + "EndIndex": 134296, + "Kind": 3 + }, + { + "EndIndex": 134447, + "Kind": 3 + }, + { + "EndIndex": 134468, + "Kind": 3 + }, + { + "EndIndex": 134474, + "Kind": 3 + }, + { + "EndIndex": 134492, + "Kind": 3 + }, + { + "EndIndex": 134534, + "Kind": 3 + }, + { + "EndIndex": 134860, + "Kind": 3 + }, + { + "EndIndex": 134882, + "Kind": 3 + }, + { + "EndIndex": 134888, + "Kind": 3 + }, + { + "EndIndex": 134890, + "Kind": 3 + }, + { + "EndIndex": 134927, + "Kind": 3 + }, + { + "EndIndex": 134965, + "Kind": 3 + }, + { + "EndIndex": 134996, + "Kind": 3 + }, + { + "EndIndex": 135015, + "Kind": 3 + }, + { + "EndIndex": 135057, + "Kind": 3 + }, + { + "EndIndex": 135099, + "Kind": 3 + }, + { + "EndIndex": 135113, + "Kind": 3 + }, + { + "EndIndex": 135119, + "Kind": 3 + }, + { + "EndIndex": 135137, + "Kind": 3 + }, + { + "EndIndex": 135170, + "Kind": 3 + }, + { + "EndIndex": 135321, + "Kind": 3 + }, + { + "EndIndex": 135342, + "Kind": 3 + }, + { + "EndIndex": 135348, + "Kind": 3 + }, + { + "EndIndex": 135366, + "Kind": 3 + }, + { + "EndIndex": 135408, + "Kind": 3 + }, + { + "EndIndex": 135734, + "Kind": 3 + }, + { + "EndIndex": 135756, + "Kind": 3 + }, + { + "EndIndex": 135762, + "Kind": 3 + }, + { + "EndIndex": 135764, + "Kind": 3 + }, + { + "EndIndex": 135785, + "Kind": 3 + }, + { + "EndIndex": 135816, + "Kind": 3 + }, + { + "EndIndex": 135879, + "Kind": 3 + }, + { + "EndIndex": 135908, + "Kind": 3 + }, + { + "EndIndex": 135927, + "Kind": 3 + }, + { + "EndIndex": 135969, + "Kind": 3 + }, + { + "EndIndex": 136036, + "Kind": 3 + }, + { + "EndIndex": 136050, + "Kind": 3 + }, + { + "EndIndex": 136056, + "Kind": 3 + }, + { + "EndIndex": 136074, + "Kind": 3 + }, + { + "EndIndex": 136107, + "Kind": 3 + }, + { + "EndIndex": 136258, + "Kind": 3 + }, + { + "EndIndex": 136279, + "Kind": 3 + }, + { + "EndIndex": 136285, + "Kind": 3 + }, + { + "EndIndex": 136312, + "Kind": 3 + }, + { + "EndIndex": 136342, + "Kind": 3 + }, + { + "EndIndex": 136348, + "Kind": 3 + }, + { + "EndIndex": 136372, + "Kind": 3 + }, + { + "EndIndex": 136401, + "Kind": 3 + }, + { + "EndIndex": 136420, + "Kind": 3 + }, + { + "EndIndex": 136426, + "Kind": 3 + }, + { + "EndIndex": 136444, + "Kind": 3 + }, + { + "EndIndex": 136486, + "Kind": 3 + }, + { + "EndIndex": 136812, + "Kind": 3 + }, + { + "EndIndex": 136834, + "Kind": 3 + }, + { + "EndIndex": 136840, + "Kind": 3 + }, + { + "EndIndex": 136855, + "Kind": 3 + }, + { + "EndIndex": 136875, + "Kind": 3 + }, + { + "EndIndex": 136904, + "Kind": 3 + }, + { + "EndIndex": 136918, + "Kind": 3 + }, + { + "EndIndex": 136924, + "Kind": 3 + }, + { + "EndIndex": 136939, + "Kind": 3 + }, + { + "EndIndex": 136960, + "Kind": 3 + }, + { + "EndIndex": 136983, + "Kind": 3 + }, + { + "EndIndex": 136997, + "Kind": 3 + }, + { + "EndIndex": 137003, + "Kind": 3 + }, + { + "EndIndex": 137018, + "Kind": 3 + }, + { + "EndIndex": 137039, + "Kind": 3 + }, + { + "EndIndex": 137062, + "Kind": 3 + }, + { + "EndIndex": 137076, + "Kind": 3 + }, + { + "EndIndex": 137082, + "Kind": 3 + }, + { + "EndIndex": 137084, + "Kind": 3 + }, + { + "EndIndex": 137115, + "Kind": 3 + }, + { + "EndIndex": 137188, + "Kind": 3 + }, + { + "EndIndex": 137219, + "Kind": 3 + }, + { + "EndIndex": 137238, + "Kind": 3 + }, + { + "EndIndex": 137280, + "Kind": 3 + }, + { + "EndIndex": 137357, + "Kind": 3 + }, + { + "EndIndex": 137371, + "Kind": 3 + }, + { + "EndIndex": 137377, + "Kind": 3 + }, + { + "EndIndex": 137395, + "Kind": 3 + }, + { + "EndIndex": 137428, + "Kind": 3 + }, + { + "EndIndex": 137579, + "Kind": 3 + }, + { + "EndIndex": 137600, + "Kind": 3 + }, + { + "EndIndex": 137606, + "Kind": 3 + }, + { + "EndIndex": 137624, + "Kind": 3 + }, + { + "EndIndex": 137666, + "Kind": 3 + }, + { + "EndIndex": 137992, + "Kind": 3 + }, + { + "EndIndex": 138014, + "Kind": 3 + }, + { + "EndIndex": 138020, + "Kind": 3 + }, + { + "EndIndex": 138022, + "Kind": 3 + }, + { + "EndIndex": 138060, + "Kind": 3 + }, + { + "EndIndex": 138089, + "Kind": 3 + }, + { + "EndIndex": 138123, + "Kind": 3 + }, + { + "EndIndex": 138142, + "Kind": 3 + }, + { + "EndIndex": 138184, + "Kind": 3 + }, + { + "EndIndex": 138217, + "Kind": 3 + }, + { + "EndIndex": 138231, + "Kind": 3 + }, + { + "EndIndex": 138237, + "Kind": 3 + }, + { + "EndIndex": 138255, + "Kind": 3 + }, + { + "EndIndex": 138288, + "Kind": 3 + }, + { + "EndIndex": 138439, + "Kind": 3 + }, + { + "EndIndex": 138460, + "Kind": 3 + }, + { + "EndIndex": 138466, + "Kind": 3 + }, + { + "EndIndex": 138484, + "Kind": 3 + }, + { + "EndIndex": 138526, + "Kind": 3 + }, + { + "EndIndex": 138852, + "Kind": 3 + }, + { + "EndIndex": 138874, + "Kind": 3 + }, + { + "EndIndex": 138880, + "Kind": 3 + }, + { + "EndIndex": 138882, + "Kind": 3 + }, + { + "EndIndex": 138914, + "Kind": 3 + }, + { + "EndIndex": 138950, + "Kind": 3 + }, + { + "EndIndex": 138978, + "Kind": 3 + }, + { + "EndIndex": 138997, + "Kind": 3 + }, + { + "EndIndex": 139039, + "Kind": 3 + }, + { + "EndIndex": 139079, + "Kind": 3 + }, + { + "EndIndex": 139093, + "Kind": 3 + }, + { + "EndIndex": 139099, + "Kind": 3 + }, + { + "EndIndex": 139117, + "Kind": 3 + }, + { + "EndIndex": 139150, + "Kind": 3 + }, + { + "EndIndex": 139301, + "Kind": 3 + }, + { + "EndIndex": 139322, + "Kind": 3 + }, + { + "EndIndex": 139328, + "Kind": 3 + }, + { + "EndIndex": 139346, + "Kind": 3 + }, + { + "EndIndex": 139388, + "Kind": 3 + }, + { + "EndIndex": 139714, + "Kind": 3 + }, + { + "EndIndex": 139736, + "Kind": 3 + }, + { + "EndIndex": 139742, + "Kind": 3 + }, + { + "EndIndex": 139744, + "Kind": 3 + }, + { + "EndIndex": 139778, + "Kind": 3 + }, + { + "EndIndex": 139808, + "Kind": 3 + }, + { + "EndIndex": 139842, + "Kind": 3 + }, + { + "EndIndex": 139861, + "Kind": 3 + }, + { + "EndIndex": 139903, + "Kind": 3 + }, + { + "EndIndex": 139937, + "Kind": 3 + }, + { + "EndIndex": 139951, + "Kind": 3 + }, + { + "EndIndex": 139957, + "Kind": 3 + }, + { + "EndIndex": 139975, + "Kind": 3 + }, + { + "EndIndex": 140008, + "Kind": 3 + }, + { + "EndIndex": 140159, + "Kind": 3 + }, + { + "EndIndex": 140180, + "Kind": 3 + }, + { + "EndIndex": 140186, + "Kind": 3 + }, + { + "EndIndex": 140204, + "Kind": 3 + }, + { + "EndIndex": 140246, + "Kind": 3 + }, + { + "EndIndex": 140572, + "Kind": 3 + }, + { + "EndIndex": 140594, + "Kind": 3 + }, + { + "EndIndex": 140600, + "Kind": 3 + }, + { + "EndIndex": 140602, + "Kind": 3 + }, + { + "EndIndex": 140637, + "Kind": 3 + }, + { + "EndIndex": 140683, + "Kind": 3 + }, + { + "EndIndex": 140718, + "Kind": 3 + }, + { + "EndIndex": 140737, + "Kind": 3 + }, + { + "EndIndex": 140779, + "Kind": 3 + }, + { + "EndIndex": 140829, + "Kind": 3 + }, + { + "EndIndex": 140843, + "Kind": 3 + }, + { + "EndIndex": 140849, + "Kind": 3 + }, + { + "EndIndex": 140867, + "Kind": 3 + }, + { + "EndIndex": 140900, + "Kind": 3 + }, + { + "EndIndex": 141051, + "Kind": 3 + }, + { + "EndIndex": 141072, + "Kind": 3 + }, + { + "EndIndex": 141078, + "Kind": 3 + }, + { + "EndIndex": 141096, + "Kind": 3 + }, + { + "EndIndex": 141138, + "Kind": 3 + }, + { + "EndIndex": 141464, + "Kind": 3 + }, + { + "EndIndex": 141486, + "Kind": 3 + }, + { + "EndIndex": 141492, + "Kind": 3 + }, + { + "EndIndex": 141494, + "Kind": 3 + }, + { + "EndIndex": 141524, + "Kind": 3 + }, + { + "EndIndex": 141554, + "Kind": 3 + }, + { + "EndIndex": 141580, + "Kind": 3 + }, + { + "EndIndex": 141599, + "Kind": 3 + }, + { + "EndIndex": 141641, + "Kind": 3 + }, + { + "EndIndex": 141675, + "Kind": 3 + }, + { + "EndIndex": 141689, + "Kind": 3 + }, + { + "EndIndex": 141695, + "Kind": 3 + }, + { + "EndIndex": 141713, + "Kind": 3 + }, + { + "EndIndex": 141746, + "Kind": 3 + }, + { + "EndIndex": 141897, + "Kind": 3 + }, + { + "EndIndex": 141918, + "Kind": 3 + }, + { + "EndIndex": 141924, + "Kind": 3 + }, + { + "EndIndex": 141948, + "Kind": 3 + }, + { + "EndIndex": 141977, + "Kind": 3 + }, + { + "EndIndex": 141996, + "Kind": 3 + }, + { + "EndIndex": 142002, + "Kind": 3 + }, + { + "EndIndex": 142020, + "Kind": 3 + }, + { + "EndIndex": 142062, + "Kind": 3 + }, + { + "EndIndex": 142388, + "Kind": 3 + }, + { + "EndIndex": 142410, + "Kind": 3 + }, + { + "EndIndex": 142416, + "Kind": 3 + }, + { + "EndIndex": 142418, + "Kind": 3 + }, + { + "EndIndex": 142459, + "Kind": 3 + }, + { + "EndIndex": 142495, + "Kind": 3 + }, + { + "EndIndex": 142530, + "Kind": 3 + }, + { + "EndIndex": 142549, + "Kind": 3 + }, + { + "EndIndex": 142591, + "Kind": 3 + }, + { + "EndIndex": 142631, + "Kind": 3 + }, + { + "EndIndex": 142645, + "Kind": 3 + }, + { + "EndIndex": 142651, + "Kind": 3 + }, + { + "EndIndex": 142669, + "Kind": 3 + }, + { + "EndIndex": 142702, + "Kind": 3 + }, + { + "EndIndex": 142853, + "Kind": 3 + }, + { + "EndIndex": 142874, + "Kind": 3 + }, + { + "EndIndex": 142880, + "Kind": 3 + }, + { + "EndIndex": 142898, + "Kind": 3 + }, + { + "EndIndex": 142940, + "Kind": 3 + }, + { + "EndIndex": 143266, + "Kind": 3 + }, + { + "EndIndex": 143288, + "Kind": 3 + }, + { + "EndIndex": 143294, + "Kind": 3 + }, + { + "EndIndex": 143296, + "Kind": 3 + }, + { + "EndIndex": 143327, + "Kind": 3 + }, + { + "EndIndex": 143364, + "Kind": 3 + }, + { + "EndIndex": 143393, + "Kind": 3 + }, + { + "EndIndex": 143412, + "Kind": 3 + }, + { + "EndIndex": 143454, + "Kind": 3 + }, + { + "EndIndex": 143495, + "Kind": 3 + }, + { + "EndIndex": 143509, + "Kind": 3 + }, + { + "EndIndex": 143515, + "Kind": 3 + }, + { + "EndIndex": 143533, + "Kind": 3 + }, + { + "EndIndex": 143566, + "Kind": 3 + }, + { + "EndIndex": 143717, + "Kind": 3 + }, + { + "EndIndex": 143738, + "Kind": 3 + }, + { + "EndIndex": 143744, + "Kind": 3 + }, + { + "EndIndex": 143762, + "Kind": 3 + }, + { + "EndIndex": 143804, + "Kind": 3 + }, + { + "EndIndex": 144130, + "Kind": 3 + }, + { + "EndIndex": 144152, + "Kind": 3 + }, + { + "EndIndex": 144158, + "Kind": 3 + }, + { + "EndIndex": 144160, + "Kind": 3 + }, + { + "EndIndex": 144191, + "Kind": 3 + }, + { + "EndIndex": 144213, + "Kind": 3 + }, + { + "EndIndex": 144242, + "Kind": 3 + }, + { + "EndIndex": 144261, + "Kind": 3 + }, + { + "EndIndex": 144303, + "Kind": 3 + }, + { + "EndIndex": 144329, + "Kind": 3 + }, + { + "EndIndex": 144343, + "Kind": 3 + }, + { + "EndIndex": 144349, + "Kind": 3 + }, + { + "EndIndex": 144367, + "Kind": 3 + }, + { + "EndIndex": 144400, + "Kind": 3 + }, + { + "EndIndex": 144551, + "Kind": 3 + }, + { + "EndIndex": 144572, + "Kind": 3 + }, + { + "EndIndex": 144578, + "Kind": 3 + }, + { + "EndIndex": 144596, + "Kind": 3 + }, + { + "EndIndex": 144638, + "Kind": 3 + }, + { + "EndIndex": 144964, + "Kind": 3 + }, + { + "EndIndex": 144986, + "Kind": 3 + }, + { + "EndIndex": 144992, + "Kind": 3 + }, + { + "EndIndex": 144994, + "Kind": 3 + }, + { + "EndIndex": 145035, + "Kind": 3 + }, + { + "EndIndex": 145060, + "Kind": 3 + }, + { + "EndIndex": 145097, + "Kind": 3 + }, + { + "EndIndex": 145116, + "Kind": 3 + }, + { + "EndIndex": 145158, + "Kind": 3 + }, + { + "EndIndex": 145187, + "Kind": 3 + }, + { + "EndIndex": 145201, + "Kind": 3 + }, + { + "EndIndex": 145207, + "Kind": 3 + }, + { + "EndIndex": 145225, + "Kind": 3 + }, + { + "EndIndex": 145258, + "Kind": 3 + }, + { + "EndIndex": 145409, + "Kind": 3 + }, + { + "EndIndex": 145430, + "Kind": 3 + }, + { + "EndIndex": 145436, + "Kind": 3 + }, + { + "EndIndex": 145454, + "Kind": 3 + }, + { + "EndIndex": 145496, + "Kind": 3 + }, + { + "EndIndex": 145822, + "Kind": 3 + }, + { + "EndIndex": 145844, + "Kind": 3 + }, + { + "EndIndex": 145850, + "Kind": 3 + }, + { + "EndIndex": 145852, + "Kind": 3 + }, + { + "EndIndex": 145881, + "Kind": 3 + }, + { + "EndIndex": 145913, + "Kind": 3 + }, + { + "EndIndex": 145940, + "Kind": 3 + }, + { + "EndIndex": 145959, + "Kind": 3 + }, + { + "EndIndex": 146001, + "Kind": 3 + }, + { + "EndIndex": 146037, + "Kind": 3 + }, + { + "EndIndex": 146051, + "Kind": 3 + }, + { + "EndIndex": 146057, + "Kind": 3 + }, + { + "EndIndex": 146075, + "Kind": 3 + }, + { + "EndIndex": 146108, + "Kind": 3 + }, + { + "EndIndex": 146259, + "Kind": 3 + }, + { + "EndIndex": 146280, + "Kind": 3 + }, + { + "EndIndex": 146286, + "Kind": 3 + }, + { + "EndIndex": 146304, + "Kind": 3 + }, + { + "EndIndex": 146346, + "Kind": 3 + }, + { + "EndIndex": 146672, + "Kind": 3 + }, + { + "EndIndex": 146694, + "Kind": 3 + }, + { + "EndIndex": 146700, + "Kind": 3 + }, + { + "EndIndex": 146702, + "Kind": 3 + }, + { + "EndIndex": 146738, + "Kind": 3 + }, + { + "EndIndex": 146782, + "Kind": 3 + }, + { + "EndIndex": 146818, + "Kind": 3 + }, + { + "EndIndex": 146837, + "Kind": 3 + }, + { + "EndIndex": 146879, + "Kind": 3 + }, + { + "EndIndex": 146927, + "Kind": 3 + }, + { + "EndIndex": 146941, + "Kind": 3 + }, + { + "EndIndex": 146947, + "Kind": 3 + }, + { + "EndIndex": 146965, + "Kind": 3 + }, + { + "EndIndex": 146998, + "Kind": 3 + }, + { + "EndIndex": 147149, + "Kind": 3 + }, + { + "EndIndex": 147170, + "Kind": 3 + }, + { + "EndIndex": 147176, + "Kind": 3 + }, + { + "EndIndex": 147194, + "Kind": 3 + }, + { + "EndIndex": 147236, + "Kind": 3 + }, + { + "EndIndex": 147562, + "Kind": 3 + }, + { + "EndIndex": 147584, + "Kind": 3 + }, + { + "EndIndex": 147590, + "Kind": 3 + }, + { + "EndIndex": 147592, + "Kind": 3 + }, + { + "EndIndex": 147631, + "Kind": 3 + }, + { + "EndIndex": 147673, + "Kind": 3 + }, + { + "EndIndex": 147728, + "Kind": 3 + }, + { + "EndIndex": 147765, + "Kind": 3 + }, + { + "EndIndex": 147784, + "Kind": 3 + }, + { + "EndIndex": 147826, + "Kind": 3 + }, + { + "EndIndex": 147885, + "Kind": 3 + }, + { + "EndIndex": 147899, + "Kind": 3 + }, + { + "EndIndex": 147905, + "Kind": 3 + }, + { + "EndIndex": 147923, + "Kind": 3 + }, + { + "EndIndex": 147956, + "Kind": 3 + }, + { + "EndIndex": 148107, + "Kind": 3 + }, + { + "EndIndex": 148128, + "Kind": 3 + }, + { + "EndIndex": 148134, + "Kind": 3 + }, + { + "EndIndex": 148152, + "Kind": 3 + }, + { + "EndIndex": 148194, + "Kind": 3 + }, + { + "EndIndex": 148520, + "Kind": 3 + }, + { + "EndIndex": 148542, + "Kind": 3 + }, + { + "EndIndex": 148548, + "Kind": 3 + }, + { + "EndIndex": 148550, + "Kind": 3 + }, + { + "EndIndex": 148577, + "Kind": 3 + }, + { + "EndIndex": 148619, + "Kind": 3 + }, + { + "EndIndex": 148644, + "Kind": 3 + }, + { + "EndIndex": 148663, + "Kind": 3 + }, + { + "EndIndex": 148705, + "Kind": 3 + }, + { + "EndIndex": 148751, + "Kind": 3 + }, + { + "EndIndex": 148765, + "Kind": 3 + }, + { + "EndIndex": 148771, + "Kind": 3 + }, + { + "EndIndex": 148789, + "Kind": 3 + }, + { + "EndIndex": 148822, + "Kind": 3 + }, + { + "EndIndex": 148973, + "Kind": 3 + }, + { + "EndIndex": 148994, + "Kind": 3 + }, + { + "EndIndex": 149000, + "Kind": 3 + }, + { + "EndIndex": 149027, + "Kind": 3 + }, + { + "EndIndex": 149057, + "Kind": 3 + }, + { + "EndIndex": 149063, + "Kind": 3 + }, + { + "EndIndex": 149087, + "Kind": 3 + }, + { + "EndIndex": 149116, + "Kind": 3 + }, + { + "EndIndex": 149135, + "Kind": 3 + }, + { + "EndIndex": 149141, + "Kind": 3 + }, + { + "EndIndex": 149159, + "Kind": 3 + }, + { + "EndIndex": 149201, + "Kind": 3 + }, + { + "EndIndex": 149527, + "Kind": 3 + }, + { + "EndIndex": 149549, + "Kind": 3 + }, + { + "EndIndex": 149555, + "Kind": 3 + }, + { + "EndIndex": 149570, + "Kind": 3 + }, + { + "EndIndex": 149605, + "Kind": 3 + }, + { + "EndIndex": 149619, + "Kind": 3 + }, + { + "EndIndex": 149625, + "Kind": 3 + }, + { + "EndIndex": 149640, + "Kind": 3 + }, + { + "EndIndex": 149662, + "Kind": 3 + }, + { + "EndIndex": 149694, + "Kind": 3 + }, + { + "EndIndex": 149708, + "Kind": 3 + }, + { + "EndIndex": 149714, + "Kind": 3 + }, + { + "EndIndex": 149729, + "Kind": 3 + }, + { + "EndIndex": 149754, + "Kind": 3 + }, + { + "EndIndex": 149784, + "Kind": 3 + }, + { + "EndIndex": 149798, + "Kind": 3 + }, + { + "EndIndex": 149804, + "Kind": 3 + }, + { + "EndIndex": 149819, + "Kind": 3 + }, + { + "EndIndex": 149845, + "Kind": 3 + }, + { + "EndIndex": 149882, + "Kind": 3 + }, + { + "EndIndex": 149896, + "Kind": 3 + }, + { + "EndIndex": 149902, + "Kind": 3 + }, + { + "EndIndex": 149917, + "Kind": 3 + }, + { + "EndIndex": 149942, + "Kind": 3 + }, + { + "EndIndex": 149972, + "Kind": 3 + }, + { + "EndIndex": 149986, + "Kind": 3 + }, + { + "EndIndex": 149992, + "Kind": 3 + }, + { + "EndIndex": 150007, + "Kind": 3 + }, + { + "EndIndex": 150032, + "Kind": 3 + }, + { + "EndIndex": 150064, + "Kind": 3 + }, + { + "EndIndex": 150078, + "Kind": 3 + }, + { + "EndIndex": 150084, + "Kind": 3 + }, + { + "EndIndex": 150086, + "Kind": 3 + }, + { + "EndIndex": 150125, + "Kind": 3 + }, + { + "EndIndex": 150168, + "Kind": 3 + }, + { + "EndIndex": 150199, + "Kind": 3 + }, + { + "EndIndex": 150218, + "Kind": 3 + }, + { + "EndIndex": 150260, + "Kind": 3 + }, + { + "EndIndex": 150307, + "Kind": 3 + }, + { + "EndIndex": 150321, + "Kind": 3 + }, + { + "EndIndex": 150327, + "Kind": 3 + }, + { + "EndIndex": 150345, + "Kind": 3 + }, + { + "EndIndex": 150378, + "Kind": 3 + }, + { + "EndIndex": 150529, + "Kind": 3 + }, + { + "EndIndex": 150550, + "Kind": 3 + }, + { + "EndIndex": 150556, + "Kind": 3 + }, + { + "EndIndex": 150574, + "Kind": 3 + }, + { + "EndIndex": 150616, + "Kind": 3 + }, + { + "EndIndex": 150942, + "Kind": 3 + }, + { + "EndIndex": 150964, + "Kind": 3 + }, + { + "EndIndex": 150970, + "Kind": 3 + }, + { + "EndIndex": 150972, + "Kind": 3 + }, + { + "EndIndex": 151015, + "Kind": 3 + }, + { + "EndIndex": 151102, + "Kind": 3 + }, + { + "EndIndex": 151145, + "Kind": 3 + }, + { + "EndIndex": 151164, + "Kind": 3 + }, + { + "EndIndex": 151206, + "Kind": 3 + }, + { + "EndIndex": 151297, + "Kind": 3 + }, + { + "EndIndex": 151311, + "Kind": 3 + }, + { + "EndIndex": 151317, + "Kind": 3 + }, + { + "EndIndex": 151335, + "Kind": 3 + }, + { + "EndIndex": 151368, + "Kind": 3 + }, + { + "EndIndex": 151519, + "Kind": 3 + }, + { + "EndIndex": 151540, + "Kind": 3 + }, + { + "EndIndex": 151546, + "Kind": 3 + }, + { + "EndIndex": 151564, + "Kind": 3 + }, + { + "EndIndex": 151606, + "Kind": 3 + }, + { + "EndIndex": 151932, + "Kind": 3 + }, + { + "EndIndex": 151954, + "Kind": 3 + }, + { + "EndIndex": 151960, + "Kind": 3 + }, + { + "EndIndex": 151962, + "Kind": 3 + }, + { + "EndIndex": 151995, + "Kind": 3 + }, + { + "EndIndex": 152026, + "Kind": 3 + }, + { + "EndIndex": 152059, + "Kind": 3 + }, + { + "EndIndex": 152078, + "Kind": 3 + }, + { + "EndIndex": 152120, + "Kind": 3 + }, + { + "EndIndex": 152155, + "Kind": 3 + }, + { + "EndIndex": 152169, + "Kind": 3 + }, + { + "EndIndex": 152175, + "Kind": 3 + }, + { + "EndIndex": 152193, + "Kind": 3 + }, + { + "EndIndex": 152226, + "Kind": 3 + }, + { + "EndIndex": 152377, + "Kind": 3 + }, + { + "EndIndex": 152398, + "Kind": 3 + }, + { + "EndIndex": 152404, + "Kind": 3 + }, + { + "EndIndex": 152422, + "Kind": 3 + }, + { + "EndIndex": 152464, + "Kind": 3 + }, + { + "EndIndex": 152790, + "Kind": 3 + }, + { + "EndIndex": 152812, + "Kind": 3 + }, + { + "EndIndex": 152818, + "Kind": 3 + }, + { + "EndIndex": 152820, + "Kind": 3 + }, + { + "EndIndex": 152856, + "Kind": 3 + }, + { + "EndIndex": 152882, + "Kind": 3 + }, + { + "EndIndex": 152918, + "Kind": 3 + }, + { + "EndIndex": 152937, + "Kind": 3 + }, + { + "EndIndex": 152979, + "Kind": 3 + }, + { + "EndIndex": 153009, + "Kind": 3 + }, + { + "EndIndex": 153023, + "Kind": 3 + }, + { + "EndIndex": 153029, + "Kind": 3 + }, + { + "EndIndex": 153047, + "Kind": 3 + }, + { + "EndIndex": 153080, + "Kind": 3 + }, + { + "EndIndex": 153231, + "Kind": 3 + }, + { + "EndIndex": 153252, + "Kind": 3 + }, + { + "EndIndex": 153258, + "Kind": 3 + }, + { + "EndIndex": 153276, + "Kind": 3 + }, + { + "EndIndex": 153318, + "Kind": 3 + }, + { + "EndIndex": 153644, + "Kind": 3 + }, + { + "EndIndex": 153666, + "Kind": 3 + }, + { + "EndIndex": 153672, + "Kind": 3 + }, + { + "EndIndex": 153674, + "Kind": 3 + }, + { + "EndIndex": 153711, + "Kind": 3 + }, + { + "EndIndex": 153744, + "Kind": 3 + }, + { + "EndIndex": 153776, + "Kind": 3 + }, + { + "EndIndex": 153795, + "Kind": 3 + }, + { + "EndIndex": 153837, + "Kind": 3 + }, + { + "EndIndex": 153874, + "Kind": 3 + }, + { + "EndIndex": 153888, + "Kind": 3 + }, + { + "EndIndex": 153894, + "Kind": 3 + }, + { + "EndIndex": 153912, + "Kind": 3 + }, + { + "EndIndex": 153945, + "Kind": 3 + }, + { + "EndIndex": 154096, + "Kind": 3 + }, + { + "EndIndex": 154117, + "Kind": 3 + }, + { + "EndIndex": 154123, + "Kind": 3 + }, + { + "EndIndex": 154141, + "Kind": 3 + }, + { + "EndIndex": 154183, + "Kind": 3 + }, + { + "EndIndex": 154509, + "Kind": 3 + }, + { + "EndIndex": 154531, + "Kind": 3 + }, + { + "EndIndex": 154537, + "Kind": 3 + }, + { + "EndIndex": 154539, + "Kind": 3 + }, + { + "EndIndex": 154573, + "Kind": 3 + }, + { + "EndIndex": 154626, + "Kind": 3 + }, + { + "EndIndex": 154658, + "Kind": 3 + }, + { + "EndIndex": 154677, + "Kind": 3 + }, + { + "EndIndex": 154719, + "Kind": 3 + }, + { + "EndIndex": 154776, + "Kind": 3 + }, + { + "EndIndex": 154790, + "Kind": 3 + }, + { + "EndIndex": 154796, + "Kind": 3 + }, + { + "EndIndex": 154814, + "Kind": 3 + }, + { + "EndIndex": 154847, + "Kind": 3 + }, + { + "EndIndex": 154998, + "Kind": 3 + }, + { + "EndIndex": 155019, + "Kind": 3 + }, + { + "EndIndex": 155025, + "Kind": 3 + }, + { + "EndIndex": 155043, + "Kind": 3 + }, + { + "EndIndex": 155085, + "Kind": 3 + }, + { + "EndIndex": 155411, + "Kind": 3 + }, + { + "EndIndex": 155433, + "Kind": 3 + }, + { + "EndIndex": 155439, + "Kind": 3 + }, + { + "EndIndex": 155441, + "Kind": 3 + }, + { + "EndIndex": 155474, + "Kind": 3 + }, + { + "EndIndex": 155527, + "Kind": 3 + }, + { + "EndIndex": 155560, + "Kind": 3 + }, + { + "EndIndex": 155579, + "Kind": 3 + }, + { + "EndIndex": 155621, + "Kind": 3 + }, + { + "EndIndex": 155678, + "Kind": 3 + }, + { + "EndIndex": 155692, + "Kind": 3 + }, + { + "EndIndex": 155698, + "Kind": 3 + }, + { + "EndIndex": 155716, + "Kind": 3 + }, + { + "EndIndex": 155749, + "Kind": 3 + }, + { + "EndIndex": 155900, + "Kind": 3 + }, + { + "EndIndex": 155921, + "Kind": 3 + }, + { + "EndIndex": 155927, + "Kind": 3 + }, + { + "EndIndex": 155945, + "Kind": 3 + }, + { + "EndIndex": 155987, + "Kind": 3 + }, + { + "EndIndex": 156313, + "Kind": 3 + }, + { + "EndIndex": 156335, + "Kind": 3 + }, + { + "EndIndex": 156341, + "Kind": 3 + }, + { + "EndIndex": 156343, + "Kind": 3 + }, + { + "EndIndex": 156375, + "Kind": 3 + }, + { + "EndIndex": 156410, + "Kind": 3 + }, + { + "EndIndex": 156440, + "Kind": 3 + }, + { + "EndIndex": 156459, + "Kind": 3 + }, + { + "EndIndex": 156501, + "Kind": 3 + }, + { + "EndIndex": 156540, + "Kind": 3 + }, + { + "EndIndex": 156554, + "Kind": 3 + }, + { + "EndIndex": 156560, + "Kind": 3 + }, + { + "EndIndex": 156578, + "Kind": 3 + }, + { + "EndIndex": 156611, + "Kind": 3 + }, + { + "EndIndex": 156762, + "Kind": 3 + }, + { + "EndIndex": 156783, + "Kind": 3 + }, + { + "EndIndex": 156789, + "Kind": 3 + }, + { + "EndIndex": 156807, + "Kind": 3 + }, + { + "EndIndex": 156849, + "Kind": 3 + }, + { + "EndIndex": 157175, + "Kind": 3 + }, + { + "EndIndex": 157197, + "Kind": 3 + }, + { + "EndIndex": 157203, + "Kind": 3 + }, + { + "EndIndex": 157205, + "Kind": 3 + }, + { + "EndIndex": 157237, + "Kind": 3 + }, + { + "EndIndex": 157300, + "Kind": 3 + }, + { + "EndIndex": 157332, + "Kind": 3 + }, + { + "EndIndex": 157351, + "Kind": 3 + }, + { + "EndIndex": 157393, + "Kind": 3 + }, + { + "EndIndex": 157460, + "Kind": 3 + }, + { + "EndIndex": 157474, + "Kind": 3 + }, + { + "EndIndex": 157480, + "Kind": 3 + }, + { + "EndIndex": 157498, + "Kind": 3 + }, + { + "EndIndex": 157531, + "Kind": 3 + }, + { + "EndIndex": 157682, + "Kind": 3 + }, + { + "EndIndex": 157703, + "Kind": 3 + }, + { + "EndIndex": 157709, + "Kind": 3 + }, + { + "EndIndex": 157727, + "Kind": 3 + }, + { + "EndIndex": 157769, + "Kind": 3 + }, + { + "EndIndex": 158095, + "Kind": 3 + }, + { + "EndIndex": 158117, + "Kind": 3 + }, + { + "EndIndex": 158123, + "Kind": 3 + }, + { + "EndIndex": 158125, + "Kind": 3 + }, + { + "EndIndex": 158163, + "Kind": 3 + }, + { + "EndIndex": 158212, + "Kind": 3 + }, + { + "EndIndex": 158248, + "Kind": 3 + }, + { + "EndIndex": 158267, + "Kind": 3 + }, + { + "EndIndex": 158292, + "Kind": 3 + }, + { + "EndIndex": 158345, + "Kind": 3 + }, + { + "EndIndex": 158359, + "Kind": 3 + }, + { + "EndIndex": 158365, + "Kind": 3 + }, + { + "EndIndex": 158383, + "Kind": 3 + }, + { + "EndIndex": 158416, + "Kind": 3 + }, + { + "EndIndex": 158567, + "Kind": 3 + }, + { + "EndIndex": 158588, + "Kind": 3 + }, + { + "EndIndex": 158594, + "Kind": 3 + }, + { + "EndIndex": 158612, + "Kind": 3 + }, + { + "EndIndex": 158654, + "Kind": 3 + }, + { + "EndIndex": 158980, + "Kind": 3 + }, + { + "EndIndex": 159002, + "Kind": 3 + }, + { + "EndIndex": 159008, + "Kind": 3 + }, + { + "EndIndex": 159010, + "Kind": 3 + }, + { + "EndIndex": 159043, + "Kind": 3 + }, + { + "EndIndex": 159091, + "Kind": 3 + }, + { + "EndIndex": 159122, + "Kind": 3 + }, + { + "EndIndex": 159141, + "Kind": 3 + }, + { + "EndIndex": 159166, + "Kind": 3 + }, + { + "EndIndex": 159218, + "Kind": 3 + }, + { + "EndIndex": 159232, + "Kind": 3 + }, + { + "EndIndex": 159238, + "Kind": 3 + }, + { + "EndIndex": 159256, + "Kind": 3 + }, + { + "EndIndex": 159289, + "Kind": 3 + }, + { + "EndIndex": 159440, + "Kind": 3 + }, + { + "EndIndex": 159461, + "Kind": 3 + }, + { + "EndIndex": 159467, + "Kind": 3 + }, + { + "EndIndex": 159485, + "Kind": 3 + }, + { + "EndIndex": 159527, + "Kind": 3 + }, + { + "EndIndex": 159853, + "Kind": 3 + }, + { + "EndIndex": 159875, + "Kind": 3 + }, + { + "EndIndex": 159881, + "Kind": 3 + }, + { + "EndIndex": 159896, + "Kind": 3 + }, + { + "EndIndex": 159918, + "Kind": 3 + }, + { + "EndIndex": 159952, + "Kind": 3 + }, + { + "EndIndex": 159966, + "Kind": 3 + }, + { + "EndIndex": 159972, + "Kind": 3 + }, + { + "EndIndex": 159974, + "Kind": 3 + }, + { + "EndIndex": 160005, + "Kind": 3 + }, + { + "EndIndex": 160028, + "Kind": 3 + }, + { + "EndIndex": 160057, + "Kind": 3 + }, + { + "EndIndex": 160076, + "Kind": 3 + }, + { + "EndIndex": 160118, + "Kind": 3 + }, + { + "EndIndex": 160145, + "Kind": 3 + }, + { + "EndIndex": 160159, + "Kind": 3 + }, + { + "EndIndex": 160165, + "Kind": 3 + }, + { + "EndIndex": 160183, + "Kind": 3 + }, + { + "EndIndex": 160216, + "Kind": 3 + }, + { + "EndIndex": 160367, + "Kind": 3 + }, + { + "EndIndex": 160388, + "Kind": 3 + }, + { + "EndIndex": 160394, + "Kind": 3 + }, + { + "EndIndex": 160418, + "Kind": 3 + }, + { + "EndIndex": 160447, + "Kind": 3 + }, + { + "EndIndex": 160466, + "Kind": 3 + }, + { + "EndIndex": 160472, + "Kind": 3 + }, + { + "EndIndex": 160490, + "Kind": 3 + }, + { + "EndIndex": 160532, + "Kind": 3 + }, + { + "EndIndex": 160858, + "Kind": 3 + }, + { + "EndIndex": 160880, + "Kind": 3 + }, + { + "EndIndex": 160886, + "Kind": 3 + }, + { + "EndIndex": 160901, + "Kind": 3 + }, + { + "EndIndex": 160926, + "Kind": 3 + }, + { + "EndIndex": 160956, + "Kind": 3 + }, + { + "EndIndex": 160970, + "Kind": 3 + }, + { + "EndIndex": 160976, + "Kind": 3 + }, + { + "EndIndex": 160991, + "Kind": 3 + }, + { + "EndIndex": 161014, + "Kind": 3 + }, + { + "EndIndex": 161042, + "Kind": 3 + }, + { + "EndIndex": 161056, + "Kind": 3 + }, + { + "EndIndex": 161062, + "Kind": 3 + }, + { + "EndIndex": 161077, + "Kind": 3 + }, + { + "EndIndex": 161097, + "Kind": 3 + }, + { + "EndIndex": 161122, + "Kind": 3 + }, + { + "EndIndex": 161136, + "Kind": 3 + }, + { + "EndIndex": 161142, + "Kind": 3 + }, + { + "EndIndex": 161157, + "Kind": 3 + }, + { + "EndIndex": 161180, + "Kind": 3 + }, + { + "EndIndex": 161208, + "Kind": 3 + }, + { + "EndIndex": 161222, + "Kind": 3 + }, + { + "EndIndex": 161228, + "Kind": 3 + }, + { + "EndIndex": 161243, + "Kind": 3 + }, + { + "EndIndex": 161279, + "Kind": 3 + }, + { + "EndIndex": 161320, + "Kind": 3 + }, + { + "EndIndex": 161334, + "Kind": 3 + }, + { + "EndIndex": 161340, + "Kind": 3 + }, + { + "EndIndex": 161355, + "Kind": 3 + }, + { + "EndIndex": 161376, + "Kind": 3 + }, + { + "EndIndex": 161402, + "Kind": 3 + }, + { + "EndIndex": 161416, + "Kind": 3 + }, + { + "EndIndex": 161422, + "Kind": 3 + }, + { + "EndIndex": 161424, + "Kind": 3 + }, + { + "EndIndex": 161455, + "Kind": 3 + }, + { + "EndIndex": 161508, + "Kind": 3 + }, + { + "EndIndex": 161539, + "Kind": 3 + }, + { + "EndIndex": 161558, + "Kind": 3 + }, + { + "EndIndex": 161600, + "Kind": 3 + }, + { + "EndIndex": 161657, + "Kind": 3 + }, + { + "EndIndex": 161671, + "Kind": 3 + }, + { + "EndIndex": 161677, + "Kind": 3 + }, + { + "EndIndex": 161695, + "Kind": 3 + }, + { + "EndIndex": 161728, + "Kind": 3 + }, + { + "EndIndex": 161879, + "Kind": 3 + }, + { + "EndIndex": 161900, + "Kind": 3 + }, + { + "EndIndex": 161906, + "Kind": 3 + }, + { + "EndIndex": 161924, + "Kind": 3 + }, + { + "EndIndex": 161966, + "Kind": 3 + }, + { + "EndIndex": 162292, + "Kind": 3 + }, + { + "EndIndex": 162314, + "Kind": 3 + }, + { + "EndIndex": 162320, + "Kind": 3 + }, + { + "EndIndex": 162322, + "Kind": 3 + }, + { + "EndIndex": 162353, + "Kind": 3 + }, + { + "EndIndex": 162539, + "Kind": 3 + }, + { + "EndIndex": 162568, + "Kind": 3 + }, + { + "EndIndex": 162587, + "Kind": 3 + }, + { + "EndIndex": 162629, + "Kind": 3 + }, + { + "EndIndex": 162819, + "Kind": 3 + }, + { + "EndIndex": 162833, + "Kind": 3 + }, + { + "EndIndex": 162839, + "Kind": 3 + }, + { + "EndIndex": 162857, + "Kind": 3 + }, + { + "EndIndex": 162890, + "Kind": 3 + }, + { + "EndIndex": 163041, + "Kind": 3 + }, + { + "EndIndex": 163062, + "Kind": 3 + }, + { + "EndIndex": 163068, + "Kind": 3 + }, + { + "EndIndex": 163086, + "Kind": 3 + }, + { + "EndIndex": 163128, + "Kind": 3 + }, + { + "EndIndex": 163454, + "Kind": 3 + }, + { + "EndIndex": 163476, + "Kind": 3 + }, + { + "EndIndex": 163482, + "Kind": 3 + }, + { + "EndIndex": 163484, + "Kind": 3 + }, + { + "EndIndex": 163518, + "Kind": 3 + }, + { + "EndIndex": 163563, + "Kind": 3 + }, + { + "EndIndex": 163591, + "Kind": 3 + }, + { + "EndIndex": 163610, + "Kind": 3 + }, + { + "EndIndex": 163652, + "Kind": 3 + }, + { + "EndIndex": 163701, + "Kind": 3 + }, + { + "EndIndex": 163715, + "Kind": 3 + }, + { + "EndIndex": 163721, + "Kind": 3 + }, + { + "EndIndex": 163739, + "Kind": 3 + }, + { + "EndIndex": 163772, + "Kind": 3 + }, + { + "EndIndex": 163923, + "Kind": 3 + }, + { + "EndIndex": 163944, + "Kind": 3 + }, + { + "EndIndex": 163950, + "Kind": 3 + }, + { + "EndIndex": 163968, + "Kind": 3 + }, + { + "EndIndex": 164010, + "Kind": 3 + }, + { + "EndIndex": 164336, + "Kind": 3 + }, + { + "EndIndex": 164358, + "Kind": 3 + }, + { + "EndIndex": 164364, + "Kind": 3 + }, + { + "EndIndex": 164379, + "Kind": 3 + }, + { + "EndIndex": 164400, + "Kind": 3 + }, + { + "EndIndex": 164426, + "Kind": 3 + }, + { + "EndIndex": 164440, + "Kind": 3 + }, + { + "EndIndex": 164446, + "Kind": 3 + }, + { + "EndIndex": 164448, + "Kind": 3 + }, + { + "EndIndex": 164483, + "Kind": 3 + }, + { + "EndIndex": 164527, + "Kind": 3 + }, + { + "EndIndex": 164553, + "Kind": 3 + }, + { + "EndIndex": 164572, + "Kind": 3 + }, + { + "EndIndex": 164614, + "Kind": 3 + }, + { + "EndIndex": 164662, + "Kind": 3 + }, + { + "EndIndex": 164676, + "Kind": 3 + }, + { + "EndIndex": 164682, + "Kind": 3 + }, + { + "EndIndex": 164700, + "Kind": 3 + }, + { + "EndIndex": 164733, + "Kind": 3 + }, + { + "EndIndex": 164884, + "Kind": 3 + }, + { + "EndIndex": 164905, + "Kind": 3 + }, + { + "EndIndex": 164911, + "Kind": 3 + }, + { + "EndIndex": 164929, + "Kind": 3 + }, + { + "EndIndex": 164971, + "Kind": 3 + }, + { + "EndIndex": 165297, + "Kind": 3 + }, + { + "EndIndex": 165319, + "Kind": 3 + }, + { + "EndIndex": 165325, + "Kind": 3 + }, + { + "EndIndex": 165327, + "Kind": 3 + }, + { + "EndIndex": 165357, + "Kind": 3 + }, + { + "EndIndex": 165381, + "Kind": 3 + }, + { + "EndIndex": 165411, + "Kind": 3 + }, + { + "EndIndex": 165430, + "Kind": 3 + }, + { + "EndIndex": 165472, + "Kind": 3 + }, + { + "EndIndex": 165500, + "Kind": 3 + }, + { + "EndIndex": 165514, + "Kind": 3 + }, + { + "EndIndex": 165520, + "Kind": 3 + }, + { + "EndIndex": 165538, + "Kind": 3 + }, + { + "EndIndex": 165571, + "Kind": 3 + }, + { + "EndIndex": 165722, + "Kind": 3 + }, + { + "EndIndex": 165743, + "Kind": 3 + }, + { + "EndIndex": 165749, + "Kind": 3 + }, + { + "EndIndex": 165767, + "Kind": 3 + }, + { + "EndIndex": 165809, + "Kind": 3 + }, + { + "EndIndex": 166135, + "Kind": 3 + }, + { + "EndIndex": 166157, + "Kind": 3 + }, + { + "EndIndex": 166163, + "Kind": 3 + }, + { + "EndIndex": 166165, + "Kind": 3 + }, + { + "EndIndex": 166194, + "Kind": 3 + }, + { + "EndIndex": 166230, + "Kind": 3 + }, + { + "EndIndex": 166257, + "Kind": 3 + }, + { + "EndIndex": 166276, + "Kind": 3 + }, + { + "EndIndex": 166318, + "Kind": 3 + }, + { + "EndIndex": 166358, + "Kind": 3 + }, + { + "EndIndex": 166372, + "Kind": 3 + }, + { + "EndIndex": 166378, + "Kind": 3 + }, + { + "EndIndex": 166396, + "Kind": 3 + }, + { + "EndIndex": 166429, + "Kind": 3 + }, + { + "EndIndex": 166580, + "Kind": 3 + }, + { + "EndIndex": 166601, + "Kind": 3 + }, + { + "EndIndex": 166607, + "Kind": 3 + }, + { + "EndIndex": 166625, + "Kind": 3 + }, + { + "EndIndex": 166667, + "Kind": 3 + }, + { + "EndIndex": 166993, + "Kind": 3 + }, + { + "EndIndex": 167015, + "Kind": 3 + }, + { + "EndIndex": 167021, + "Kind": 3 + }, + { + "EndIndex": 167023, + "Kind": 3 + }, + { + "EndIndex": 167060, + "Kind": 3 + }, + { + "EndIndex": 167115, + "Kind": 3 + }, + { + "EndIndex": 167150, + "Kind": 3 + }, + { + "EndIndex": 167169, + "Kind": 3 + }, + { + "EndIndex": 167211, + "Kind": 3 + }, + { + "EndIndex": 167270, + "Kind": 3 + }, + { + "EndIndex": 167284, + "Kind": 3 + }, + { + "EndIndex": 167290, + "Kind": 3 + }, + { + "EndIndex": 167308, + "Kind": 3 + }, + { + "EndIndex": 167341, + "Kind": 3 + }, + { + "EndIndex": 167492, + "Kind": 3 + }, + { + "EndIndex": 167513, + "Kind": 3 + }, + { + "EndIndex": 167519, + "Kind": 3 + }, + { + "EndIndex": 167537, + "Kind": 3 + }, + { + "EndIndex": 167579, + "Kind": 3 + }, + { + "EndIndex": 167905, + "Kind": 3 + }, + { + "EndIndex": 167927, + "Kind": 3 + }, + { + "EndIndex": 167933, + "Kind": 3 + }, + { + "EndIndex": 167935, + "Kind": 3 + }, + { + "EndIndex": 167976, + "Kind": 3 + }, + { + "EndIndex": 168007, + "Kind": 3 + }, + { + "EndIndex": 168043, + "Kind": 3 + }, + { + "EndIndex": 168062, + "Kind": 3 + }, + { + "EndIndex": 168104, + "Kind": 3 + }, + { + "EndIndex": 168139, + "Kind": 3 + }, + { + "EndIndex": 168153, + "Kind": 3 + }, + { + "EndIndex": 168159, + "Kind": 3 + }, + { + "EndIndex": 168177, + "Kind": 3 + }, + { + "EndIndex": 168210, + "Kind": 3 + }, + { + "EndIndex": 168361, + "Kind": 3 + }, + { + "EndIndex": 168382, + "Kind": 3 + }, + { + "EndIndex": 168388, + "Kind": 3 + }, + { + "EndIndex": 168412, + "Kind": 3 + }, + { + "EndIndex": 168441, + "Kind": 3 + }, + { + "EndIndex": 168460, + "Kind": 3 + }, + { + "EndIndex": 168466, + "Kind": 3 + }, + { + "EndIndex": 168484, + "Kind": 3 + }, + { + "EndIndex": 168526, + "Kind": 3 + }, + { + "EndIndex": 168852, + "Kind": 3 + }, + { + "EndIndex": 168874, + "Kind": 3 + }, + { + "EndIndex": 168880, + "Kind": 3 + }, + { + "EndIndex": 168895, + "Kind": 3 + }, + { + "EndIndex": 168920, + "Kind": 3 + }, + { + "EndIndex": 168950, + "Kind": 3 + }, + { + "EndIndex": 168964, + "Kind": 3 + }, + { + "EndIndex": 168970, + "Kind": 3 + }, + { + "EndIndex": 168985, + "Kind": 3 + }, + { + "EndIndex": 169005, + "Kind": 3 + }, + { + "EndIndex": 169030, + "Kind": 3 + }, + { + "EndIndex": 169044, + "Kind": 3 + }, + { + "EndIndex": 169050, + "Kind": 3 + }, + { + "EndIndex": 169065, + "Kind": 3 + }, + { + "EndIndex": 169088, + "Kind": 3 + }, + { + "EndIndex": 169116, + "Kind": 3 + }, + { + "EndIndex": 169130, + "Kind": 3 + }, + { + "EndIndex": 169136, + "Kind": 3 + }, + { + "EndIndex": 169151, + "Kind": 3 + }, + { + "EndIndex": 169174, + "Kind": 3 + }, + { + "EndIndex": 169202, + "Kind": 3 + }, + { + "EndIndex": 169216, + "Kind": 3 + }, + { + "EndIndex": 169222, + "Kind": 3 + }, + { + "EndIndex": 169237, + "Kind": 3 + }, + { + "EndIndex": 169259, + "Kind": 3 + }, + { + "EndIndex": 169286, + "Kind": 3 + }, + { + "EndIndex": 169300, + "Kind": 3 + }, + { + "EndIndex": 169306, + "Kind": 3 + }, + { + "EndIndex": 169308, + "Kind": 3 + }, + { + "EndIndex": 169349, + "Kind": 3 + }, + { + "EndIndex": 169380, + "Kind": 3 + }, + { + "EndIndex": 169416, + "Kind": 3 + }, + { + "EndIndex": 169435, + "Kind": 3 + }, + { + "EndIndex": 169477, + "Kind": 3 + }, + { + "EndIndex": 169512, + "Kind": 3 + }, + { + "EndIndex": 169526, + "Kind": 3 + }, + { + "EndIndex": 169532, + "Kind": 3 + }, + { + "EndIndex": 169550, + "Kind": 3 + }, + { + "EndIndex": 169583, + "Kind": 3 + }, + { + "EndIndex": 169734, + "Kind": 3 + }, + { + "EndIndex": 169755, + "Kind": 3 + }, + { + "EndIndex": 169761, + "Kind": 3 + }, + { + "EndIndex": 169785, + "Kind": 3 + }, + { + "EndIndex": 169814, + "Kind": 3 + }, + { + "EndIndex": 169833, + "Kind": 3 + }, + { + "EndIndex": 169839, + "Kind": 3 + }, + { + "EndIndex": 169857, + "Kind": 3 + }, + { + "EndIndex": 169899, + "Kind": 3 + }, + { + "EndIndex": 170225, + "Kind": 3 + }, + { + "EndIndex": 170247, + "Kind": 3 + }, + { + "EndIndex": 170253, + "Kind": 3 + }, + { + "EndIndex": 170268, + "Kind": 3 + }, + { + "EndIndex": 170293, + "Kind": 3 + }, + { + "EndIndex": 170323, + "Kind": 3 + }, + { + "EndIndex": 170337, + "Kind": 3 + }, + { + "EndIndex": 170343, + "Kind": 3 + }, + { + "EndIndex": 170358, + "Kind": 3 + }, + { + "EndIndex": 170378, + "Kind": 3 + }, + { + "EndIndex": 170403, + "Kind": 3 + }, + { + "EndIndex": 170417, + "Kind": 3 + }, + { + "EndIndex": 170423, + "Kind": 3 + }, + { + "EndIndex": 170438, + "Kind": 3 + }, + { + "EndIndex": 170461, + "Kind": 3 + }, + { + "EndIndex": 170489, + "Kind": 3 + }, + { + "EndIndex": 170503, + "Kind": 3 + }, + { + "EndIndex": 170509, + "Kind": 3 + }, + { + "EndIndex": 170524, + "Kind": 3 + }, + { + "EndIndex": 170547, + "Kind": 3 + }, + { + "EndIndex": 170575, + "Kind": 3 + }, + { + "EndIndex": 170589, + "Kind": 3 + }, + { + "EndIndex": 170595, + "Kind": 3 + }, + { + "EndIndex": 170610, + "Kind": 3 + }, + { + "EndIndex": 170632, + "Kind": 3 + }, + { + "EndIndex": 170659, + "Kind": 3 + }, + { + "EndIndex": 170673, + "Kind": 3 + }, + { + "EndIndex": 170679, + "Kind": 3 + }, + { + "EndIndex": 170681, + "Kind": 3 + }, + { + "EndIndex": 170714, + "Kind": 3 + }, + { + "EndIndex": 170744, + "Kind": 3 + }, + { + "EndIndex": 170774, + "Kind": 3 + }, + { + "EndIndex": 170793, + "Kind": 3 + }, + { + "EndIndex": 170835, + "Kind": 3 + }, + { + "EndIndex": 170869, + "Kind": 3 + }, + { + "EndIndex": 170883, + "Kind": 3 + }, + { + "EndIndex": 170889, + "Kind": 3 + }, + { + "EndIndex": 170907, + "Kind": 3 + }, + { + "EndIndex": 170940, + "Kind": 3 + }, + { + "EndIndex": 171091, + "Kind": 3 + }, + { + "EndIndex": 171112, + "Kind": 3 + }, + { + "EndIndex": 171118, + "Kind": 3 + }, + { + "EndIndex": 171136, + "Kind": 3 + }, + { + "EndIndex": 171178, + "Kind": 3 + }, + { + "EndIndex": 171504, + "Kind": 3 + }, + { + "EndIndex": 171526, + "Kind": 3 + }, + { + "EndIndex": 171532, + "Kind": 3 + }, + { + "EndIndex": 171534, + "Kind": 3 + }, + { + "EndIndex": 171578, + "Kind": 3 + }, + { + "EndIndex": 171612, + "Kind": 3 + }, + { + "EndIndex": 171651, + "Kind": 3 + }, + { + "EndIndex": 171670, + "Kind": 3 + }, + { + "EndIndex": 171712, + "Kind": 3 + }, + { + "EndIndex": 171750, + "Kind": 3 + }, + { + "EndIndex": 171764, + "Kind": 3 + }, + { + "EndIndex": 171770, + "Kind": 3 + }, + { + "EndIndex": 171788, + "Kind": 3 + }, + { + "EndIndex": 171821, + "Kind": 3 + }, + { + "EndIndex": 171972, + "Kind": 3 + }, + { + "EndIndex": 171993, + "Kind": 3 + }, + { + "EndIndex": 171999, + "Kind": 3 + }, + { + "EndIndex": 172023, + "Kind": 3 + }, + { + "EndIndex": 172052, + "Kind": 3 + }, + { + "EndIndex": 172071, + "Kind": 3 + }, + { + "EndIndex": 172077, + "Kind": 3 + }, + { + "EndIndex": 172095, + "Kind": 3 + }, + { + "EndIndex": 172137, + "Kind": 3 + }, + { + "EndIndex": 172463, + "Kind": 3 + }, + { + "EndIndex": 172485, + "Kind": 3 + }, + { + "EndIndex": 172491, + "Kind": 3 + }, + { + "EndIndex": 172506, + "Kind": 3 + }, + { + "EndIndex": 172531, + "Kind": 3 + }, + { + "EndIndex": 172561, + "Kind": 3 + }, + { + "EndIndex": 172575, + "Kind": 3 + }, + { + "EndIndex": 172581, + "Kind": 3 + }, + { + "EndIndex": 172596, + "Kind": 3 + }, + { + "EndIndex": 172616, + "Kind": 3 + }, + { + "EndIndex": 172641, + "Kind": 3 + }, + { + "EndIndex": 172655, + "Kind": 3 + }, + { + "EndIndex": 172661, + "Kind": 3 + }, + { + "EndIndex": 172676, + "Kind": 3 + }, + { + "EndIndex": 172699, + "Kind": 3 + }, + { + "EndIndex": 172727, + "Kind": 3 + }, + { + "EndIndex": 172741, + "Kind": 3 + }, + { + "EndIndex": 172747, + "Kind": 3 + }, + { + "EndIndex": 172762, + "Kind": 3 + }, + { + "EndIndex": 172785, + "Kind": 3 + }, + { + "EndIndex": 172813, + "Kind": 3 + }, + { + "EndIndex": 172827, + "Kind": 3 + }, + { + "EndIndex": 172833, + "Kind": 3 + }, + { + "EndIndex": 172848, + "Kind": 3 + }, + { + "EndIndex": 172870, + "Kind": 3 + }, + { + "EndIndex": 172897, + "Kind": 3 + }, + { + "EndIndex": 172911, + "Kind": 3 + }, + { + "EndIndex": 172917, + "Kind": 3 + }, + { + "EndIndex": 172919, + "Kind": 3 + }, + { + "EndIndex": 172951, + "Kind": 3 + }, + { + "EndIndex": 173054, + "Kind": 3 + }, + { + "EndIndex": 173086, + "Kind": 3 + }, + { + "EndIndex": 173105, + "Kind": 3 + }, + { + "EndIndex": 173147, + "Kind": 3 + }, + { + "EndIndex": 173254, + "Kind": 3 + }, + { + "EndIndex": 173268, + "Kind": 3 + }, + { + "EndIndex": 173274, + "Kind": 3 + }, + { + "EndIndex": 173292, + "Kind": 3 + }, + { + "EndIndex": 173325, + "Kind": 3 + }, + { + "EndIndex": 173476, + "Kind": 3 + }, + { + "EndIndex": 173497, + "Kind": 3 + }, + { + "EndIndex": 173503, + "Kind": 3 + }, + { + "EndIndex": 173521, + "Kind": 3 + }, + { + "EndIndex": 173563, + "Kind": 3 + }, + { + "EndIndex": 173889, + "Kind": 3 + }, + { + "EndIndex": 173911, + "Kind": 3 + }, + { + "EndIndex": 173917, + "Kind": 3 + }, + { + "EndIndex": 173919, + "Kind": 3 + }, + { + "EndIndex": 173948, + "Kind": 3 + }, + { + "EndIndex": 174003, + "Kind": 3 + }, + { + "EndIndex": 174032, + "Kind": 3 + }, + { + "EndIndex": 174051, + "Kind": 3 + }, + { + "EndIndex": 174093, + "Kind": 3 + }, + { + "EndIndex": 174152, + "Kind": 3 + }, + { + "EndIndex": 174166, + "Kind": 3 + }, + { + "EndIndex": 174172, + "Kind": 3 + }, + { + "EndIndex": 174190, + "Kind": 3 + }, + { + "EndIndex": 174223, + "Kind": 3 + }, + { + "EndIndex": 174374, + "Kind": 3 + }, + { + "EndIndex": 174395, + "Kind": 3 + }, + { + "EndIndex": 174401, + "Kind": 3 + }, + { + "EndIndex": 174419, + "Kind": 3 + }, + { + "EndIndex": 174461, + "Kind": 3 + }, + { + "EndIndex": 174787, + "Kind": 3 + }, + { + "EndIndex": 174809, + "Kind": 3 + }, + { + "EndIndex": 174815, + "Kind": 3 + }, + { + "EndIndex": 174817, + "Kind": 3 + }, + { + "EndIndex": 174847, + "Kind": 3 + }, + { + "EndIndex": 174902, + "Kind": 3 + }, + { + "EndIndex": 174930, + "Kind": 3 + }, + { + "EndIndex": 174949, + "Kind": 3 + }, + { + "EndIndex": 174989, + "Kind": 3 + }, + { + "EndIndex": 175048, + "Kind": 3 + }, + { + "EndIndex": 175062, + "Kind": 3 + }, + { + "EndIndex": 175068, + "Kind": 3 + }, + { + "EndIndex": 175086, + "Kind": 3 + }, + { + "EndIndex": 175119, + "Kind": 3 + }, + { + "EndIndex": 175270, + "Kind": 3 + }, + { + "EndIndex": 175291, + "Kind": 3 + }, + { + "EndIndex": 175297, + "Kind": 3 + }, + { + "EndIndex": 175315, + "Kind": 3 + }, + { + "EndIndex": 175357, + "Kind": 3 + }, + { + "EndIndex": 175683, + "Kind": 3 + }, + { + "EndIndex": 175705, + "Kind": 3 + }, + { + "EndIndex": 175711, + "Kind": 3 + }, + { + "EndIndex": 175713, + "Kind": 3 + }, + { + "EndIndex": 175740, + "Kind": 3 + }, + { + "EndIndex": 175782, + "Kind": 3 + }, + { + "EndIndex": 175807, + "Kind": 3 + }, + { + "EndIndex": 175826, + "Kind": 3 + }, + { + "EndIndex": 175868, + "Kind": 3 + }, + { + "EndIndex": 175914, + "Kind": 3 + }, + { + "EndIndex": 175928, + "Kind": 3 + }, + { + "EndIndex": 175934, + "Kind": 3 + }, + { + "EndIndex": 175952, + "Kind": 3 + }, + { + "EndIndex": 175985, + "Kind": 3 + }, + { + "EndIndex": 176136, + "Kind": 3 + }, + { + "EndIndex": 176157, + "Kind": 3 + }, + { + "EndIndex": 176163, + "Kind": 3 + }, + { + "EndIndex": 176181, + "Kind": 3 + }, + { + "EndIndex": 176223, + "Kind": 3 + }, + { + "EndIndex": 176549, + "Kind": 3 + }, + { + "EndIndex": 176571, + "Kind": 3 + }, + { + "EndIndex": 176577, + "Kind": 3 + }, + { + "EndIndex": 176579, + "Kind": 3 + }, + { + "EndIndex": 176605, + "Kind": 3 + }, + { + "EndIndex": 176648, + "Kind": 3 + }, + { + "EndIndex": 176715, + "Kind": 3 + }, + { + "EndIndex": 176750, + "Kind": 3 + }, + { + "EndIndex": 176769, + "Kind": 3 + }, + { + "EndIndex": 176811, + "Kind": 3 + }, + { + "EndIndex": 176882, + "Kind": 3 + }, + { + "EndIndex": 176896, + "Kind": 3 + }, + { + "EndIndex": 176902, + "Kind": 3 + }, + { + "EndIndex": 176920, + "Kind": 3 + }, + { + "EndIndex": 176953, + "Kind": 3 + }, + { + "EndIndex": 177104, + "Kind": 3 + }, + { + "EndIndex": 177125, + "Kind": 3 + }, + { + "EndIndex": 177131, + "Kind": 3 + }, + { + "EndIndex": 177149, + "Kind": 3 + }, + { + "EndIndex": 177191, + "Kind": 3 + }, + { + "EndIndex": 177517, + "Kind": 3 + }, + { + "EndIndex": 177539, + "Kind": 3 + }, + { + "EndIndex": 177545, + "Kind": 3 + }, + { + "EndIndex": 177547, + "Kind": 3 + }, + { + "EndIndex": 177613, + "Kind": 3 + }, + { + "EndIndex": 177746, + "Kind": 3 + }, + { + "EndIndex": 177756, + "Kind": 3 + }, + { + "EndIndex": 177758, + "Kind": 3 + }, + { + "EndIndex": 177900, + "Kind": 3 + }, + { + "EndIndex": 177972, + "Kind": 3 + }, + { + "EndIndex": 178868, + "Kind": 3 + }, + { + "EndIndex": 178878, + "Kind": 3 + }, + { + "EndIndex": 178880, + "Kind": 3 + }, + { + "EndIndex": 178903, + "Kind": 3 + }, + { + "EndIndex": 178921, + "Kind": 3 + }, + { + "EndIndex": 178934, + "Kind": 3 + }, + { + "EndIndex": 178984, + "Kind": 3 + }, + { + "EndIndex": 178994, + "Kind": 3 + }, + { + "EndIndex": 178996, + "Kind": 3 + }, + { + "EndIndex": 179016, + "Kind": 3 + }, + { + "EndIndex": 179130, + "Kind": 3 + }, + { + "EndIndex": 179148, + "Kind": 3 + }, + { + "EndIndex": 179150, + "Kind": 3 + }, + { + "EndIndex": 179170, + "Kind": 3 + }, + { + "EndIndex": 179278, + "Kind": 3 + }, + { + "EndIndex": 179296, + "Kind": 3 + }, + { + "EndIndex": 179298, + "Kind": 3 + }, + { + "EndIndex": 179315, + "Kind": 3 + }, + { + "EndIndex": 179635, + "Kind": 3 + }, + { + "EndIndex": 179650, + "Kind": 3 + }, + { + "EndIndex": 179652, + "Kind": 3 + }, + { + "EndIndex": 179670, + "Kind": 3 + }, + { + "EndIndex": 179779, + "Kind": 3 + }, + { + "EndIndex": 179794, + "Kind": 3 + }, + { + "EndIndex": 179796, + "Kind": 3 + }, + { + "EndIndex": 179827, + "Kind": 3 + }, + { + "EndIndex": 180020, + "Kind": 3 + }, + { + "EndIndex": 180030, + "Kind": 3 + }, + { + "EndIndex": 180032, + "Kind": 3 + }, + { + "EndIndex": 180058, + "Kind": 3 + }, + { + "EndIndex": 180589, + "Kind": 3 + }, + { + "EndIndex": 180620, + "Kind": 3 + }, + { + "EndIndex": 180650, + "Kind": 3 + }, + { + "EndIndex": 180678, + "Kind": 3 + }, + { + "EndIndex": 180684, + "Kind": 3 + }, + { + "EndIndex": 180710, + "Kind": 3 + }, + { + "EndIndex": 180792, + "Kind": 3 + }, + { + "EndIndex": 180810, + "Kind": 3 + }, + { + "EndIndex": 180816, + "Kind": 3 + }, + { + "EndIndex": 180843, + "Kind": 3 + }, + { + "EndIndex": 180877, + "Kind": 3 + }, + { + "EndIndex": 180908, + "Kind": 3 + }, + { + "EndIndex": 180930, + "Kind": 3 + }, + { + "EndIndex": 180936, + "Kind": 3 + }, + { + "EndIndex": 180969, + "Kind": 3 + }, + { + "EndIndex": 180998, + "Kind": 3 + }, + { + "EndIndex": 181019, + "Kind": 3 + }, + { + "EndIndex": 181025, + "Kind": 3 + }, + { + "EndIndex": 181055, + "Kind": 3 + }, + { + "EndIndex": 181086, + "Kind": 3 + }, + { + "EndIndex": 181108, + "Kind": 3 + }, + { + "EndIndex": 181114, + "Kind": 3 + }, + { + "EndIndex": 181144, + "Kind": 3 + }, + { + "EndIndex": 181175, + "Kind": 3 + }, + { + "EndIndex": 181197, + "Kind": 3 + }, + { + "EndIndex": 181203, + "Kind": 3 + }, + { + "EndIndex": 181242, + "Kind": 3 + }, + { + "EndIndex": 181281, + "Kind": 3 + }, + { + "EndIndex": 181295, + "Kind": 3 + }, + { + "EndIndex": 181301, + "Kind": 3 + }, + { + "EndIndex": 181334, + "Kind": 3 + }, + { + "EndIndex": 181363, + "Kind": 3 + }, + { + "EndIndex": 181377, + "Kind": 3 + }, + { + "EndIndex": 181383, + "Kind": 3 + }, + { + "EndIndex": 181413, + "Kind": 3 + }, + { + "EndIndex": 181443, + "Kind": 3 + }, + { + "EndIndex": 181465, + "Kind": 3 + }, + { + "EndIndex": 181471, + "Kind": 3 + }, + { + "EndIndex": 181492, + "Kind": 3 + }, + { + "EndIndex": 181524, + "Kind": 3 + }, + { + "EndIndex": 181558, + "Kind": 3 + }, + { + "EndIndex": 181579, + "Kind": 3 + }, + { + "EndIndex": 181585, + "Kind": 3 + }, + { + "EndIndex": 181617, + "Kind": 3 + }, + { + "EndIndex": 181651, + "Kind": 3 + }, + { + "EndIndex": 181672, + "Kind": 3 + }, + { + "EndIndex": 181678, + "Kind": 3 + }, + { + "EndIndex": 181734, + "Kind": 3 + }, + { + "EndIndex": 182269, + "Kind": 3 + }, + { + "EndIndex": 182283, + "Kind": 3 + }, + { + "EndIndex": 182289, + "Kind": 3 + }, + { + "EndIndex": 182307, + "Kind": 3 + }, + { + "EndIndex": 182340, + "Kind": 3 + }, + { + "EndIndex": 182491, + "Kind": 3 + }, + { + "EndIndex": 182512, + "Kind": 3 + }, + { + "EndIndex": 182518, + "Kind": 3 + }, + { + "EndIndex": 182543, + "Kind": 3 + }, + { + "EndIndex": 182576, + "Kind": 3 + }, + { + "EndIndex": 182604, + "Kind": 3 + }, + { + "EndIndex": 182610, + "Kind": 3 + }, + { + "EndIndex": 182640, + "Kind": 3 + }, + { + "EndIndex": 182671, + "Kind": 3 + }, + { + "EndIndex": 182693, + "Kind": 3 + }, + { + "EndIndex": 182699, + "Kind": 3 + }, + { + "EndIndex": 182723, + "Kind": 3 + }, + { + "EndIndex": 182752, + "Kind": 3 + }, + { + "EndIndex": 182770, + "Kind": 3 + }, + { + "EndIndex": 182776, + "Kind": 3 + }, + { + "EndIndex": 182806, + "Kind": 3 + }, + { + "EndIndex": 182836, + "Kind": 3 + }, + { + "EndIndex": 182858, + "Kind": 3 + }, + { + "EndIndex": 182864, + "Kind": 3 + }, + { + "EndIndex": 182895, + "Kind": 3 + }, + { + "EndIndex": 182925, + "Kind": 3 + }, + { + "EndIndex": 182953, + "Kind": 3 + }, + { + "EndIndex": 182959, + "Kind": 3 + }, + { + "EndIndex": 182990, + "Kind": 3 + }, + { + "EndIndex": 183020, + "Kind": 3 + }, + { + "EndIndex": 183048, + "Kind": 3 + }, + { + "EndIndex": 183054, + "Kind": 3 + }, + { + "EndIndex": 183084, + "Kind": 3 + }, + { + "EndIndex": 183115, + "Kind": 3 + }, + { + "EndIndex": 183137, + "Kind": 3 + }, + { + "EndIndex": 183143, + "Kind": 3 + }, + { + "EndIndex": 183170, + "Kind": 3 + }, + { + "EndIndex": 183220, + "Kind": 3 + }, + { + "EndIndex": 183250, + "Kind": 3 + }, + { + "EndIndex": 183256, + "Kind": 3 + }, + { + "EndIndex": 183293, + "Kind": 3 + }, + { + "EndIndex": 183343, + "Kind": 3 + }, + { + "EndIndex": 183373, + "Kind": 3 + }, + { + "EndIndex": 183379, + "Kind": 3 + }, + { + "EndIndex": 183404, + "Kind": 3 + }, + { + "EndIndex": 183434, + "Kind": 3 + }, + { + "EndIndex": 183453, + "Kind": 3 + }, + { + "EndIndex": 183459, + "Kind": 3 + }, + { + "EndIndex": 183491, + "Kind": 3 + }, + { + "EndIndex": 183521, + "Kind": 3 + }, + { + "EndIndex": 183549, + "Kind": 3 + }, + { + "EndIndex": 183555, + "Kind": 3 + }, + { + "EndIndex": 183587, + "Kind": 3 + }, + { + "EndIndex": 183617, + "Kind": 3 + }, + { + "EndIndex": 183645, + "Kind": 3 + }, + { + "EndIndex": 183651, + "Kind": 3 + }, + { + "EndIndex": 183691, + "Kind": 3 + }, + { + "EndIndex": 183726, + "Kind": 3 + }, + { + "EndIndex": 183747, + "Kind": 3 + }, + { + "EndIndex": 183753, + "Kind": 3 + }, + { + "EndIndex": 183780, + "Kind": 3 + }, + { + "EndIndex": 183853, + "Kind": 3 + }, + { + "EndIndex": 183871, + "Kind": 3 + }, + { + "EndIndex": 183877, + "Kind": 3 + }, + { + "EndIndex": 183901, + "Kind": 3 + }, + { + "EndIndex": 183930, + "Kind": 3 + }, + { + "EndIndex": 183949, + "Kind": 3 + }, + { + "EndIndex": 183955, + "Kind": 3 + }, + { + "EndIndex": 183973, + "Kind": 3 + }, + { + "EndIndex": 184015, + "Kind": 3 + }, + { + "EndIndex": 184341, + "Kind": 3 + }, + { + "EndIndex": 184363, + "Kind": 3 + }, + { + "EndIndex": 184369, + "Kind": 3 + }, + { + "EndIndex": 184398, + "Kind": 3 + }, + { + "EndIndex": 184499, + "Kind": 3 + }, + { + "EndIndex": 184513, + "Kind": 3 + }, + { + "EndIndex": 184519, + "Kind": 3 + }, + { + "EndIndex": 184546, + "Kind": 3 + }, + { + "EndIndex": 184684, + "Kind": 3 + }, + { + "EndIndex": 184712, + "Kind": 3 + }, + { + "EndIndex": 184718, + "Kind": 3 + }, + { + "EndIndex": 184741, + "Kind": 3 + }, + { + "EndIndex": 184918, + "Kind": 3 + }, + { + "EndIndex": 184946, + "Kind": 3 + }, + { + "EndIndex": 184952, + "Kind": 3 + }, + { + "EndIndex": 184974, + "Kind": 3 + }, + { + "EndIndex": 185022, + "Kind": 3 + }, + { + "EndIndex": 185043, + "Kind": 3 + }, + { + "EndIndex": 185049, + "Kind": 3 + }, + { + "EndIndex": 185070, + "Kind": 3 + }, + { + "EndIndex": 185101, + "Kind": 3 + }, + { + "EndIndex": 185129, + "Kind": 3 + }, + { + "EndIndex": 185135, + "Kind": 3 + }, + { + "EndIndex": 185160, + "Kind": 3 + }, + { + "EndIndex": 185374, + "Kind": 3 + }, + { + "EndIndex": 185392, + "Kind": 3 + }, + { + "EndIndex": 185398, + "Kind": 3 + }, + { + "EndIndex": 185439, + "Kind": 3 + }, + { + "EndIndex": 185916, + "Kind": 3 + }, + { + "EndIndex": 185930, + "Kind": 3 + }, + { + "EndIndex": 185936, + "Kind": 3 + }, + { + "EndIndex": 185986, + "Kind": 3 + }, + { + "EndIndex": 186266, + "Kind": 3 + }, + { + "EndIndex": 186288, + "Kind": 3 + }, + { + "EndIndex": 186294, + "Kind": 3 + }, + { + "EndIndex": 186332, + "Kind": 3 + }, + { + "EndIndex": 186519, + "Kind": 3 + }, + { + "EndIndex": 186547, + "Kind": 3 + }, + { + "EndIndex": 186553, + "Kind": 3 + }, + { + "EndIndex": 186594, + "Kind": 3 + }, + { + "EndIndex": 186745, + "Kind": 3 + }, + { + "EndIndex": 186759, + "Kind": 3 + }, + { + "EndIndex": 186765, + "Kind": 3 + }, + { + "EndIndex": 186808, + "Kind": 3 + }, + { + "EndIndex": 187064, + "Kind": 3 + }, + { + "EndIndex": 187082, + "Kind": 3 + }, + { + "EndIndex": 187088, + "Kind": 3 + }, + { + "EndIndex": 187106, + "Kind": 3 + }, + { + "EndIndex": 187143, + "Kind": 3 + }, + { + "EndIndex": 187340, + "Kind": 3 + }, + { + "EndIndex": 187354, + "Kind": 3 + }, + { + "EndIndex": 187360, + "Kind": 3 + }, + { + "EndIndex": 187380, + "Kind": 3 + }, + { + "EndIndex": 187535, + "Kind": 3 + }, + { + "EndIndex": 187554, + "Kind": 3 + }, + { + "EndIndex": 187560, + "Kind": 3 + }, + { + "EndIndex": 187585, + "Kind": 3 + }, + { + "EndIndex": 187872, + "Kind": 3 + }, + { + "EndIndex": 187890, + "Kind": 3 + }, + { + "EndIndex": 187896, + "Kind": 3 + }, + { + "EndIndex": 187932, + "Kind": 3 + }, + { + "EndIndex": 188106, + "Kind": 3 + }, + { + "EndIndex": 188120, + "Kind": 3 + }, + { + "EndIndex": 188126, + "Kind": 3 + }, + { + "EndIndex": 188150, + "Kind": 3 + }, + { + "EndIndex": 188296, + "Kind": 3 + }, + { + "EndIndex": 188318, + "Kind": 3 + }, + { + "EndIndex": 188324, + "Kind": 3 + }, + { + "EndIndex": 188348, + "Kind": 3 + }, + { + "EndIndex": 188492, + "Kind": 3 + }, + { + "EndIndex": 188514, + "Kind": 3 + }, + { + "EndIndex": 188520, + "Kind": 3 + }, + { + "EndIndex": 188544, + "Kind": 3 + }, + { + "EndIndex": 188656, + "Kind": 3 + }, + { + "EndIndex": 188677, + "Kind": 3 + }, + { + "EndIndex": 188683, + "Kind": 3 + }, + { + "EndIndex": 188707, + "Kind": 3 + }, + { + "EndIndex": 188847, + "Kind": 3 + }, + { + "EndIndex": 188869, + "Kind": 3 + }, + { + "EndIndex": 188875, + "Kind": 3 + }, + { + "EndIndex": 188899, + "Kind": 3 + }, + { + "EndIndex": 189054, + "Kind": 3 + }, + { + "EndIndex": 189076, + "Kind": 3 + }, + { + "EndIndex": 189082, + "Kind": 3 + }, + { + "EndIndex": 189106, + "Kind": 3 + }, + { + "EndIndex": 189250, + "Kind": 3 + }, + { + "EndIndex": 189272, + "Kind": 3 + }, + { + "EndIndex": 189278, + "Kind": 3 + }, + { + "EndIndex": 189302, + "Kind": 3 + }, + { + "EndIndex": 189548, + "Kind": 3 + }, + { + "EndIndex": 189570, + "Kind": 3 + }, + { + "EndIndex": 189576, + "Kind": 3 + }, + { + "EndIndex": 189600, + "Kind": 3 + }, + { + "EndIndex": 189755, + "Kind": 3 + }, + { + "EndIndex": 189777, + "Kind": 3 + }, + { + "EndIndex": 189783, + "Kind": 3 + }, + { + "EndIndex": 189823, + "Kind": 3 + }, + { + "EndIndex": 190012, + "Kind": 3 + }, + { + "EndIndex": 190026, + "Kind": 3 + }, + { + "EndIndex": 190032, + "Kind": 3 + }, + { + "EndIndex": 190054, + "Kind": 3 + }, + { + "EndIndex": 190235, + "Kind": 3 + }, + { + "EndIndex": 190263, + "Kind": 3 + }, + { + "EndIndex": 190269, + "Kind": 3 + }, + { + "EndIndex": 190291, + "Kind": 3 + }, + { + "EndIndex": 190397, + "Kind": 3 + }, + { + "EndIndex": 190425, + "Kind": 3 + }, + { + "EndIndex": 190431, + "Kind": 3 + }, + { + "EndIndex": 190461, + "Kind": 3 + }, + { + "EndIndex": 190590, + "Kind": 3 + }, + { + "EndIndex": 190618, + "Kind": 3 + }, + { + "EndIndex": 190624, + "Kind": 3 + }, + { + "EndIndex": 190642, + "Kind": 3 + }, + { + "EndIndex": 190676, + "Kind": 3 + }, + { + "EndIndex": 190935, + "Kind": 3 + }, + { + "EndIndex": 190949, + "Kind": 3 + }, + { + "EndIndex": 190955, + "Kind": 3 + }, + { + "EndIndex": 190986, + "Kind": 3 + }, + { + "EndIndex": 191423, + "Kind": 3 + }, + { + "EndIndex": 191479, + "Kind": 3 + }, + { + "EndIndex": 191485, + "Kind": 3 + }, + { + "EndIndex": 191512, + "Kind": 3 + }, + { + "EndIndex": 191734, + "Kind": 3 + }, + { + "EndIndex": 191748, + "Kind": 3 + }, + { + "EndIndex": 191754, + "Kind": 3 + }, + { + "EndIndex": 191784, + "Kind": 3 + }, + { + "EndIndex": 191889, + "Kind": 3 + }, + { + "EndIndex": 191910, + "Kind": 3 + }, + { + "EndIndex": 191916, + "Kind": 3 + }, + { + "EndIndex": 191957, + "Kind": 3 + }, + { + "EndIndex": 192246, + "Kind": 3 + }, + { + "EndIndex": 192274, + "Kind": 3 + }, + { + "EndIndex": 192280, + "Kind": 3 + }, + { + "EndIndex": 192304, + "Kind": 3 + }, + { + "EndIndex": 192362, + "Kind": 3 + }, + { + "EndIndex": 192376, + "Kind": 3 + }, + { + "EndIndex": 192382, + "Kind": 3 + }, + { + "EndIndex": 192426, + "Kind": 3 + }, + { + "EndIndex": 192684, + "Kind": 3 + }, + { + "EndIndex": 192702, + "Kind": 3 + }, + { + "EndIndex": 192708, + "Kind": 3 + }, + { + "EndIndex": 192753, + "Kind": 3 + }, + { + "EndIndex": 193041, + "Kind": 3 + }, + { + "EndIndex": 193059, + "Kind": 3 + }, + { + "EndIndex": 193065, + "Kind": 3 + }, + { + "EndIndex": 193087, + "Kind": 3 + }, + { + "EndIndex": 193268, + "Kind": 3 + }, + { + "EndIndex": 193296, + "Kind": 3 + }, + { + "EndIndex": 193302, + "Kind": 3 + }, + { + "EndIndex": 193334, + "Kind": 3 + }, + { + "EndIndex": 193793, + "Kind": 3 + }, + { + "EndIndex": 193849, + "Kind": 3 + }, + { + "EndIndex": 193855, + "Kind": 3 + }, + { + "EndIndex": 193893, + "Kind": 3 + }, + { + "EndIndex": 194358, + "Kind": 3 + }, + { + "EndIndex": 194388, + "Kind": 3 + }, + { + "EndIndex": 194394, + "Kind": 3 + }, + { + "EndIndex": 194424, + "Kind": 3 + }, + { + "EndIndex": 194555, + "Kind": 3 + }, + { + "EndIndex": 194583, + "Kind": 3 + }, + { + "EndIndex": 194589, + "Kind": 3 + }, + { + "EndIndex": 194626, + "Kind": 3 + }, + { + "EndIndex": 195007, + "Kind": 3 + }, + { + "EndIndex": 195037, + "Kind": 3 + }, + { + "EndIndex": 195043, + "Kind": 3 + }, + { + "EndIndex": 195080, + "Kind": 3 + }, + { + "EndIndex": 195255, + "Kind": 3 + }, + { + "EndIndex": 195280, + "Kind": 3 + }, + { + "EndIndex": 195286, + "Kind": 3 + }, + { + "EndIndex": 195338, + "Kind": 3 + }, + { + "EndIndex": 195622, + "Kind": 3 + }, + { + "EndIndex": 195644, + "Kind": 3 + }, + { + "EndIndex": 195650, + "Kind": 3 + }, + { + "EndIndex": 195679, + "Kind": 3 + }, + { + "EndIndex": 195834, + "Kind": 3 + }, + { + "EndIndex": 195862, + "Kind": 3 + }, + { + "EndIndex": 195868, + "Kind": 3 + }, + { + "EndIndex": 195893, + "Kind": 3 + }, + { + "EndIndex": 196030, + "Kind": 3 + }, + { + "EndIndex": 196058, + "Kind": 3 + }, + { + "EndIndex": 196064, + "Kind": 3 + }, + { + "EndIndex": 196086, + "Kind": 3 + }, + { + "EndIndex": 196255, + "Kind": 3 + }, + { + "EndIndex": 196283, + "Kind": 3 + }, + { + "EndIndex": 196289, + "Kind": 3 + }, + { + "EndIndex": 196330, + "Kind": 3 + }, + { + "EndIndex": 196640, + "Kind": 3 + }, + { + "EndIndex": 196654, + "Kind": 3 + }, + { + "EndIndex": 196660, + "Kind": 3 + }, + { + "EndIndex": 196682, + "Kind": 3 + }, + { + "EndIndex": 196788, + "Kind": 3 + }, + { + "EndIndex": 196816, + "Kind": 3 + }, + { + "EndIndex": 196822, + "Kind": 3 + }, + { + "EndIndex": 196851, + "Kind": 3 + }, + { + "EndIndex": 197004, + "Kind": 3 + }, + { + "EndIndex": 197032, + "Kind": 3 + }, + { + "EndIndex": 197038, + "Kind": 3 + }, + { + "EndIndex": 197040, + "Kind": 3 + }, + { + "EndIndex": 197060, + "Kind": 3 + }, + { + "EndIndex": 197226, + "Kind": 3 + }, + { + "EndIndex": 197244, + "Kind": 3 + }, + { + "EndIndex": 197246, + "Kind": 3 + }, + { + "EndIndex": 197259, + "Kind": 3 + }, + { + "EndIndex": 197343, + "Kind": 3 + }, + { + "EndIndex": 197358, + "Kind": 3 + }, + { + "EndIndex": 197360, + "Kind": 3 + }, + { + "EndIndex": 197429, + "Kind": 3 + }, + { + "EndIndex": 198151, + "Kind": 3 + }, + { + "EndIndex": 198161, + "Kind": 3 + }, + { + "EndIndex": 198163, + "Kind": 3 + }, + { + "EndIndex": 198185, + "Kind": 3 + }, + { + "EndIndex": 198304, + "Kind": 3 + }, + { + "EndIndex": 198314, + "Kind": 3 + }, + { + "EndIndex": 198316, + "Kind": 3 + }, + { + "EndIndex": 198336, + "Kind": 3 + }, + { + "EndIndex": 198455, + "Kind": 3 + }, + { + "EndIndex": 198465, + "Kind": 3 + }, + { + "EndIndex": 198467, + "Kind": 3 + }, + { + "EndIndex": 198492, + "Kind": 3 + }, + { + "EndIndex": 198598, + "Kind": 3 + }, + { + "EndIndex": 198608, + "Kind": 3 + }, + { + "EndIndex": 198610, + "Kind": 3 + }, + { + "EndIndex": 198633, + "Kind": 3 + }, + { + "EndIndex": 199275, + "Kind": 3 + }, + { + "EndIndex": 199294, + "Kind": 3 + }, + { + "EndIndex": 199296, + "Kind": 3 + }, + { + "EndIndex": 199315, + "Kind": 3 + }, + { + "EndIndex": 199382, + "Kind": 3 + }, + { + "EndIndex": 199401, + "Kind": 3 + }, + { + "EndIndex": 199403, + "Kind": 3 + }, + { + "EndIndex": 199429, + "Kind": 3 + }, + { + "EndIndex": 199756, + "Kind": 3 + }, + { + "EndIndex": 199783, + "Kind": 3 + }, + { + "EndIndex": 199822, + "Kind": 3 + }, + { + "EndIndex": 199861, + "Kind": 3 + }, + { + "EndIndex": 199875, + "Kind": 3 + }, + { + "EndIndex": 199881, + "Kind": 3 + }, + { + "EndIndex": 199923, + "Kind": 3 + }, + { + "EndIndex": 200254, + "Kind": 3 + }, + { + "EndIndex": 200268, + "Kind": 3 + }, + { + "EndIndex": 200274, + "Kind": 3 + }, + { + "EndIndex": 200292, + "Kind": 3 + }, + { + "EndIndex": 200325, + "Kind": 3 + }, + { + "EndIndex": 200476, + "Kind": 3 + }, + { + "EndIndex": 200497, + "Kind": 3 + }, + { + "EndIndex": 200503, + "Kind": 3 + }, + { + "EndIndex": 200528, + "Kind": 3 + }, + { + "EndIndex": 200561, + "Kind": 3 + }, + { + "EndIndex": 200589, + "Kind": 3 + }, + { + "EndIndex": 200595, + "Kind": 3 + }, + { + "EndIndex": 200620, + "Kind": 3 + }, + { + "EndIndex": 200653, + "Kind": 3 + }, + { + "EndIndex": 200667, + "Kind": 3 + }, + { + "EndIndex": 200673, + "Kind": 3 + }, + { + "EndIndex": 200700, + "Kind": 3 + }, + { + "EndIndex": 200750, + "Kind": 3 + }, + { + "EndIndex": 200780, + "Kind": 3 + }, + { + "EndIndex": 200786, + "Kind": 3 + }, + { + "EndIndex": 200804, + "Kind": 3 + }, + { + "EndIndex": 200846, + "Kind": 3 + }, + { + "EndIndex": 201172, + "Kind": 3 + }, + { + "EndIndex": 201194, + "Kind": 3 + }, + { + "EndIndex": 201200, + "Kind": 3 + }, + { + "EndIndex": 201202, + "Kind": 3 + }, + { + "EndIndex": 201238, + "Kind": 3 + }, + { + "EndIndex": 201578, + "Kind": 3 + }, + { + "EndIndex": 201588, + "Kind": 3 + }, + { + "EndIndex": 201590, + "Kind": 3 + }, + { + "EndIndex": 201626, + "Kind": 3 + }, + { + "EndIndex": 201975, + "Kind": 3 + }, + { + "EndIndex": 201985, + "Kind": 3 + }, + { + "EndIndex": 201987, + "Kind": 3 + }, + { + "EndIndex": 202010, + "Kind": 3 + }, + { + "EndIndex": 202020, + "Kind": 3 + }, + { + "EndIndex": 202022, + "Kind": 3 + }, + { + "EndIndex": 202045, + "Kind": 3 + }, + { + "EndIndex": 202248, + "Kind": 3 + }, + { + "EndIndex": 202272, + "Kind": 3 + }, + { + "EndIndex": 202311, + "Kind": 3 + }, + { + "EndIndex": 202350, + "Kind": 3 + }, + { + "EndIndex": 202364, + "Kind": 3 + }, + { + "EndIndex": 202370, + "Kind": 3 + }, + { + "EndIndex": 202421, + "Kind": 3 + }, + { + "EndIndex": 202628, + "Kind": 3 + }, + { + "EndIndex": 202642, + "Kind": 3 + }, + { + "EndIndex": 202648, + "Kind": 3 + }, + { + "EndIndex": 202666, + "Kind": 3 + }, + { + "EndIndex": 202699, + "Kind": 3 + }, + { + "EndIndex": 202850, + "Kind": 3 + }, + { + "EndIndex": 202871, + "Kind": 3 + }, + { + "EndIndex": 202877, + "Kind": 3 + }, + { + "EndIndex": 202902, + "Kind": 3 + }, + { + "EndIndex": 202935, + "Kind": 3 + }, + { + "EndIndex": 202960, + "Kind": 3 + }, + { + "EndIndex": 202966, + "Kind": 3 + }, + { + "EndIndex": 202991, + "Kind": 3 + }, + { + "EndIndex": 203024, + "Kind": 3 + }, + { + "EndIndex": 203038, + "Kind": 3 + }, + { + "EndIndex": 203044, + "Kind": 3 + }, + { + "EndIndex": 203071, + "Kind": 3 + }, + { + "EndIndex": 203121, + "Kind": 3 + }, + { + "EndIndex": 203151, + "Kind": 3 + }, + { + "EndIndex": 203157, + "Kind": 3 + }, + { + "EndIndex": 203175, + "Kind": 3 + }, + { + "EndIndex": 203217, + "Kind": 3 + }, + { + "EndIndex": 203543, + "Kind": 3 + }, + { + "EndIndex": 203565, + "Kind": 3 + }, + { + "EndIndex": 203571, + "Kind": 3 + }, + { + "EndIndex": 203573, + "Kind": 3 + }, + { + "EndIndex": 203606, + "Kind": 3 + }, + { + "EndIndex": 203783, + "Kind": 3 + }, + { + "EndIndex": 203798, + "Kind": 3 + }, + { + "EndIndex": 203800, + "Kind": 3 + }, + { + "EndIndex": 203842, + "Kind": 3 + }, + { + "EndIndex": 204104, + "Kind": 3 + }, + { + "EndIndex": 204114, + "Kind": 3 + }, + { + "EndIndex": 204116, + "Kind": 3 + }, + { + "EndIndex": 204132, + "Kind": 3 + }, + { + "EndIndex": 204318, + "Kind": 3 + }, + { + "EndIndex": 204341, + "Kind": 3 + }, + { + "EndIndex": 204343, + "Kind": 3 + }, + { + "EndIndex": 204368, + "Kind": 3 + }, + { + "EndIndex": 204514, + "Kind": 3 + }, + { + "EndIndex": 204532, + "Kind": 3 + }, + { + "EndIndex": 204534, + "Kind": 3 + }, + { + "EndIndex": 204550, + "Kind": 3 + }, + { + "EndIndex": 204713, + "Kind": 3 + }, + { + "EndIndex": 204727, + "Kind": 3 + }, + { + "EndIndex": 204729, + "Kind": 3 + }, + { + "EndIndex": 204761, + "Kind": 3 + }, + { + "EndIndex": 205083, + "Kind": 3 + }, + { + "EndIndex": 205093, + "Kind": 3 + }, + { + "EndIndex": 205095, + "Kind": 3 + }, + { + "EndIndex": 205113, + "Kind": 3 + }, + { + "EndIndex": 205212, + "Kind": 3 + }, + { + "EndIndex": 205227, + "Kind": 3 + }, + { + "EndIndex": 205229, + "Kind": 3 + }, + { + "EndIndex": 205243, + "Kind": 3 + }, + { + "EndIndex": 205403, + "Kind": 3 + }, + { + "EndIndex": 205417, + "Kind": 3 + }, + { + "EndIndex": 205419, + "Kind": 3 + }, + { + "EndIndex": 205439, + "Kind": 3 + }, + { + "EndIndex": 205757, + "Kind": 3 + }, + { + "EndIndex": 205772, + "Kind": 3 + }, + { + "EndIndex": 205774, + "Kind": 3 + }, + { + "EndIndex": 205812, + "Kind": 3 + }, + { + "EndIndex": 206068, + "Kind": 3 + }, + { + "EndIndex": 206078, + "Kind": 3 + }, + { + "EndIndex": 206080, + "Kind": 3 + }, + { + "EndIndex": 206118, + "Kind": 3 + }, + { + "EndIndex": 206372, + "Kind": 3 + }, + { + "EndIndex": 206382, + "Kind": 3 + }, + { + "EndIndex": 206384, + "Kind": 3 + }, + { + "EndIndex": 206415, + "Kind": 3 + }, + { + "EndIndex": 206679, + "Kind": 3 + }, + { + "EndIndex": 206689, + "Kind": 3 + }, + { + "EndIndex": 206691, + "Kind": 3 + }, + { + "EndIndex": 206706, + "Kind": 3 + }, + { + "EndIndex": 206756, + "Kind": 3 + }, + { + "EndIndex": 206770, + "Kind": 3 + }, + { + "EndIndex": 206772, + "Kind": 3 + }, + { + "EndIndex": 206792, + "Kind": 3 + }, + { + "EndIndex": 206911, + "Kind": 3 + }, + { + "EndIndex": 206921, + "Kind": 3 + }, + { + "EndIndex": 206923, + "Kind": 3 + }, + { + "EndIndex": 206938, + "Kind": 3 + }, + { + "EndIndex": 207214, + "Kind": 3 + }, + { + "EndIndex": 207237, + "Kind": 3 + }, + { + "EndIndex": 207239, + "Kind": 3 + }, + { + "EndIndex": 207259, + "Kind": 3 + }, + { + "EndIndex": 207443, + "Kind": 3 + }, + { + "EndIndex": 207464, + "Kind": 3 + }, + { + "EndIndex": 207503, + "Kind": 3 + }, + { + "EndIndex": 207542, + "Kind": 3 + }, + { + "EndIndex": 207556, + "Kind": 3 + }, + { + "EndIndex": 207562, + "Kind": 3 + }, + { + "EndIndex": 207605, + "Kind": 3 + }, + { + "EndIndex": 207793, + "Kind": 3 + }, + { + "EndIndex": 207807, + "Kind": 3 + }, + { + "EndIndex": 207813, + "Kind": 3 + }, + { + "EndIndex": 207831, + "Kind": 3 + }, + { + "EndIndex": 207864, + "Kind": 3 + }, + { + "EndIndex": 208015, + "Kind": 3 + }, + { + "EndIndex": 208036, + "Kind": 3 + }, + { + "EndIndex": 208042, + "Kind": 3 + }, + { + "EndIndex": 208067, + "Kind": 3 + }, + { + "EndIndex": 208100, + "Kind": 3 + }, + { + "EndIndex": 208122, + "Kind": 3 + }, + { + "EndIndex": 208128, + "Kind": 3 + }, + { + "EndIndex": 208153, + "Kind": 3 + }, + { + "EndIndex": 208186, + "Kind": 3 + }, + { + "EndIndex": 208200, + "Kind": 3 + }, + { + "EndIndex": 208206, + "Kind": 3 + }, + { + "EndIndex": 208233, + "Kind": 3 + }, + { + "EndIndex": 208283, + "Kind": 3 + }, + { + "EndIndex": 208313, + "Kind": 3 + }, + { + "EndIndex": 208319, + "Kind": 3 + }, + { + "EndIndex": 208337, + "Kind": 3 + }, + { + "EndIndex": 208379, + "Kind": 3 + }, + { + "EndIndex": 208705, + "Kind": 3 + }, + { + "EndIndex": 208727, + "Kind": 3 + }, + { + "EndIndex": 208733, + "Kind": 3 + }, + { + "EndIndex": 208735, + "Kind": 3 + }, + { + "EndIndex": 208781, + "Kind": 3 + }, + { + "EndIndex": 209107, + "Kind": 3 + }, + { + "EndIndex": 209117, + "Kind": 3 + }, + { + "EndIndex": 209119, + "Kind": 3 + }, + { + "EndIndex": 209146, + "Kind": 3 + }, + { + "EndIndex": 209219, + "Kind": 3 + }, + { + "EndIndex": 209247, + "Kind": 3 + }, + { + "EndIndex": 209280, + "Kind": 3 + }, + { + "EndIndex": 209309, + "Kind": 3 + }, + { + "EndIndex": 209330, + "Kind": 3 + }, + { + "EndIndex": 209336, + "Kind": 3 + }, + { + "EndIndex": 209362, + "Kind": 3 + }, + { + "EndIndex": 209383, + "Kind": 3 + }, + { + "EndIndex": 209389, + "Kind": 3 + }, + { + "EndIndex": 209419, + "Kind": 3 + }, + { + "EndIndex": 209450, + "Kind": 3 + }, + { + "EndIndex": 209472, + "Kind": 3 + }, + { + "EndIndex": 209478, + "Kind": 3 + }, + { + "EndIndex": 209503, + "Kind": 3 + }, + { + "EndIndex": 209517, + "Kind": 3 + }, + { + "EndIndex": 209523, + "Kind": 3 + }, + { + "EndIndex": 209553, + "Kind": 3 + }, + { + "EndIndex": 209584, + "Kind": 3 + }, + { + "EndIndex": 209606, + "Kind": 3 + }, + { + "EndIndex": 209612, + "Kind": 3 + }, + { + "EndIndex": 209651, + "Kind": 3 + }, + { + "EndIndex": 209690, + "Kind": 3 + }, + { + "EndIndex": 209704, + "Kind": 3 + }, + { + "EndIndex": 209710, + "Kind": 3 + }, + { + "EndIndex": 209743, + "Kind": 3 + }, + { + "EndIndex": 209772, + "Kind": 3 + }, + { + "EndIndex": 209786, + "Kind": 3 + }, + { + "EndIndex": 209792, + "Kind": 3 + }, + { + "EndIndex": 209822, + "Kind": 3 + }, + { + "EndIndex": 209852, + "Kind": 3 + }, + { + "EndIndex": 209874, + "Kind": 3 + }, + { + "EndIndex": 209880, + "Kind": 3 + }, + { + "EndIndex": 209905, + "Kind": 3 + }, + { + "EndIndex": 209935, + "Kind": 3 + }, + { + "EndIndex": 209953, + "Kind": 3 + }, + { + "EndIndex": 209959, + "Kind": 3 + }, + { + "EndIndex": 210001, + "Kind": 3 + }, + { + "EndIndex": 210078, + "Kind": 3 + }, + { + "EndIndex": 210092, + "Kind": 3 + }, + { + "EndIndex": 210098, + "Kind": 3 + }, + { + "EndIndex": 210116, + "Kind": 3 + }, + { + "EndIndex": 210149, + "Kind": 3 + }, + { + "EndIndex": 210300, + "Kind": 3 + }, + { + "EndIndex": 210321, + "Kind": 3 + }, + { + "EndIndex": 210327, + "Kind": 3 + }, + { + "EndIndex": 210357, + "Kind": 3 + }, + { + "EndIndex": 210388, + "Kind": 3 + }, + { + "EndIndex": 210410, + "Kind": 3 + }, + { + "EndIndex": 210416, + "Kind": 3 + }, + { + "EndIndex": 210440, + "Kind": 3 + }, + { + "EndIndex": 210469, + "Kind": 3 + }, + { + "EndIndex": 210487, + "Kind": 3 + }, + { + "EndIndex": 210493, + "Kind": 3 + }, + { + "EndIndex": 210523, + "Kind": 3 + }, + { + "EndIndex": 210553, + "Kind": 3 + }, + { + "EndIndex": 210575, + "Kind": 3 + }, + { + "EndIndex": 210581, + "Kind": 3 + }, + { + "EndIndex": 210611, + "Kind": 3 + }, + { + "EndIndex": 210642, + "Kind": 3 + }, + { + "EndIndex": 210664, + "Kind": 3 + }, + { + "EndIndex": 210670, + "Kind": 3 + }, + { + "EndIndex": 210695, + "Kind": 3 + }, + { + "EndIndex": 210725, + "Kind": 3 + }, + { + "EndIndex": 210744, + "Kind": 3 + }, + { + "EndIndex": 210750, + "Kind": 3 + }, + { + "EndIndex": 210790, + "Kind": 3 + }, + { + "EndIndex": 210825, + "Kind": 3 + }, + { + "EndIndex": 210846, + "Kind": 3 + }, + { + "EndIndex": 210852, + "Kind": 3 + }, + { + "EndIndex": 210870, + "Kind": 3 + }, + { + "EndIndex": 210912, + "Kind": 3 + }, + { + "EndIndex": 211238, + "Kind": 3 + }, + { + "EndIndex": 211260, + "Kind": 3 + }, + { + "EndIndex": 211266, + "Kind": 3 + }, + { + "EndIndex": 211281, + "Kind": 3 + }, + { + "EndIndex": 211310, + "Kind": 3 + }, + { + "EndIndex": 211375, + "Kind": 3 + }, + { + "EndIndex": 211389, + "Kind": 3 + }, + { + "EndIndex": 211395, + "Kind": 3 + }, + { + "EndIndex": 211424, + "Kind": 3 + }, + { + "EndIndex": 211479, + "Kind": 3 + }, + { + "EndIndex": 211493, + "Kind": 3 + }, + { + "EndIndex": 211499, + "Kind": 3 + }, + { + "EndIndex": 211514, + "Kind": 3 + }, + { + "EndIndex": 211541, + "Kind": 3 + }, + { + "EndIndex": 211604, + "Kind": 3 + }, + { + "EndIndex": 211618, + "Kind": 3 + }, + { + "EndIndex": 211624, + "Kind": 3 + }, + { + "EndIndex": 211639, + "Kind": 3 + }, + { + "EndIndex": 211668, + "Kind": 3 + }, + { + "EndIndex": 211739, + "Kind": 3 + }, + { + "EndIndex": 211753, + "Kind": 3 + }, + { + "EndIndex": 211759, + "Kind": 3 + }, + { + "EndIndex": 211774, + "Kind": 3 + }, + { + "EndIndex": 211797, + "Kind": 3 + }, + { + "EndIndex": 211896, + "Kind": 3 + }, + { + "EndIndex": 211915, + "Kind": 3 + }, + { + "EndIndex": 211921, + "Kind": 3 + }, + { + "EndIndex": 211941, + "Kind": 3 + }, + { + "EndIndex": 212018, + "Kind": 3 + }, + { + "EndIndex": 212037, + "Kind": 3 + }, + { + "EndIndex": 212043, + "Kind": 3 + }, + { + "EndIndex": 212058, + "Kind": 3 + }, + { + "EndIndex": 212083, + "Kind": 3 + }, + { + "EndIndex": 212147, + "Kind": 3 + }, + { + "EndIndex": 212161, + "Kind": 3 + }, + { + "EndIndex": 212167, + "Kind": 3 + }, + { + "EndIndex": 212182, + "Kind": 3 + }, + { + "EndIndex": 212205, + "Kind": 3 + }, + { + "EndIndex": 212304, + "Kind": 3 + }, + { + "EndIndex": 212318, + "Kind": 3 + }, + { + "EndIndex": 212324, + "Kind": 3 + }, + { + "EndIndex": 212339, + "Kind": 3 + }, + { + "EndIndex": 212360, + "Kind": 3 + }, + { + "EndIndex": 212467, + "Kind": 3 + }, + { + "EndIndex": 212481, + "Kind": 3 + }, + { + "EndIndex": 212487, + "Kind": 3 + }, + { + "EndIndex": 212502, + "Kind": 3 + }, + { + "EndIndex": 212522, + "Kind": 3 + }, + { + "EndIndex": 212574, + "Kind": 3 + }, + { + "EndIndex": 212588, + "Kind": 3 + }, + { + "EndIndex": 212594, + "Kind": 3 + }, + { + "EndIndex": 212609, + "Kind": 3 + }, + { + "EndIndex": 212634, + "Kind": 3 + }, + { + "EndIndex": 212696, + "Kind": 3 + }, + { + "EndIndex": 212710, + "Kind": 3 + }, + { + "EndIndex": 212716, + "Kind": 3 + }, + { + "EndIndex": 212740, + "Kind": 3 + }, + { + "EndIndex": 212815, + "Kind": 3 + }, + { + "EndIndex": 212829, + "Kind": 3 + }, + { + "EndIndex": 212835, + "Kind": 3 + }, + { + "EndIndex": 212850, + "Kind": 3 + }, + { + "EndIndex": 212872, + "Kind": 3 + }, + { + "EndIndex": 212968, + "Kind": 3 + }, + { + "EndIndex": 212982, + "Kind": 3 + }, + { + "EndIndex": 212988, + "Kind": 3 + }, + { + "EndIndex": 213003, + "Kind": 3 + }, + { + "EndIndex": 213027, + "Kind": 3 + }, + { + "EndIndex": 213146, + "Kind": 3 + }, + { + "EndIndex": 213160, + "Kind": 3 + }, + { + "EndIndex": 213166, + "Kind": 3 + }, + { + "EndIndex": 213181, + "Kind": 3 + }, + { + "EndIndex": 213208, + "Kind": 3 + }, + { + "EndIndex": 213277, + "Kind": 3 + }, + { + "EndIndex": 213291, + "Kind": 3 + }, + { + "EndIndex": 213297, + "Kind": 3 + }, + { + "EndIndex": 213321, + "Kind": 3 + }, + { + "EndIndex": 213380, + "Kind": 3 + }, + { + "EndIndex": 213394, + "Kind": 3 + }, + { + "EndIndex": 213400, + "Kind": 3 + }, + { + "EndIndex": 213423, + "Kind": 3 + }, + { + "EndIndex": 213487, + "Kind": 3 + }, + { + "EndIndex": 213501, + "Kind": 3 + }, + { + "EndIndex": 213507, + "Kind": 3 + }, + { + "EndIndex": 213509, + "Kind": 3 + }, + { + "EndIndex": 213555, + "Kind": 3 + }, + { + "EndIndex": 213883, + "Kind": 3 + }, + { + "EndIndex": 213893, + "Kind": 3 + }, + { + "EndIndex": 213895, + "Kind": 3 + }, + { + "EndIndex": 213930, + "Kind": 3 + }, + { + "EndIndex": 214107, + "Kind": 3 + }, + { + "EndIndex": 214117, + "Kind": 3 + }, + { + "EndIndex": 214119, + "Kind": 3 + }, + { + "EndIndex": 214137, + "Kind": 3 + }, + { + "EndIndex": 214229, + "Kind": 3 + }, + { + "EndIndex": 214244, + "Kind": 3 + }, + { + "EndIndex": 214246, + "Kind": 3 + }, + { + "EndIndex": 214324, + "Kind": 3 + }, + { + "EndIndex": 220772, + "Kind": 3 + }, + { + "EndIndex": 220782, + "Kind": 3 + }, + { + "EndIndex": 220784, + "Kind": 3 + }, + { + "EndIndex": 220797, + "Kind": 3 + }, + { + "EndIndex": 220862, + "Kind": 3 + }, + { + "EndIndex": 220872, + "Kind": 3 + }, + { + "EndIndex": 220874, + "Kind": 3 + }, + { + "EndIndex": 220893, + "Kind": 3 + }, + { + "EndIndex": 221092, + "Kind": 3 + }, + { + "EndIndex": 221102, + "Kind": 3 + }, + { + "EndIndex": 221104, + "Kind": 3 + }, + { + "EndIndex": 221118, + "Kind": 3 + }, + { + "EndIndex": 221526, + "Kind": 3 + }, + { + "EndIndex": 221536, + "Kind": 3 + }, + { + "EndIndex": 221538, + "Kind": 3 + }, + { + "EndIndex": 221561, + "Kind": 3 + }, + { + "EndIndex": 221571, + "Kind": 3 + }, + { + "EndIndex": 221573, + "Kind": 3 + }, + { + "EndIndex": 221595, + "Kind": 3 + }, + { + "EndIndex": 222030, + "Kind": 3 + }, + { + "EndIndex": 222055, + "Kind": 3 + }, + { + "EndIndex": 222076, + "Kind": 3 + }, + { + "EndIndex": 222098, + "Kind": 3 + }, + { + "EndIndex": 222104, + "Kind": 3 + }, + { + "EndIndex": 222127, + "Kind": 3 + }, + { + "EndIndex": 222161, + "Kind": 3 + }, + { + "EndIndex": 222192, + "Kind": 3 + }, + { + "EndIndex": 222214, + "Kind": 3 + }, + { + "EndIndex": 222220, + "Kind": 3 + }, + { + "EndIndex": 222250, + "Kind": 3 + }, + { + "EndIndex": 222281, + "Kind": 3 + }, + { + "EndIndex": 222303, + "Kind": 3 + }, + { + "EndIndex": 222309, + "Kind": 3 + }, + { + "EndIndex": 222339, + "Kind": 3 + }, + { + "EndIndex": 222370, + "Kind": 3 + }, + { + "EndIndex": 222392, + "Kind": 3 + }, + { + "EndIndex": 222398, + "Kind": 3 + }, + { + "EndIndex": 222437, + "Kind": 3 + }, + { + "EndIndex": 222476, + "Kind": 3 + }, + { + "EndIndex": 222490, + "Kind": 3 + }, + { + "EndIndex": 222496, + "Kind": 3 + }, + { + "EndIndex": 222529, + "Kind": 3 + }, + { + "EndIndex": 222558, + "Kind": 3 + }, + { + "EndIndex": 222572, + "Kind": 3 + }, + { + "EndIndex": 222578, + "Kind": 3 + }, + { + "EndIndex": 222608, + "Kind": 3 + }, + { + "EndIndex": 222638, + "Kind": 3 + }, + { + "EndIndex": 222660, + "Kind": 3 + }, + { + "EndIndex": 222666, + "Kind": 3 + }, + { + "EndIndex": 222691, + "Kind": 3 + }, + { + "EndIndex": 222721, + "Kind": 3 + }, + { + "EndIndex": 222739, + "Kind": 3 + }, + { + "EndIndex": 222745, + "Kind": 3 + }, + { + "EndIndex": 222794, + "Kind": 3 + }, + { + "EndIndex": 223233, + "Kind": 3 + }, + { + "EndIndex": 223247, + "Kind": 3 + }, + { + "EndIndex": 223253, + "Kind": 3 + }, + { + "EndIndex": 223271, + "Kind": 3 + }, + { + "EndIndex": 223304, + "Kind": 3 + }, + { + "EndIndex": 223455, + "Kind": 3 + }, + { + "EndIndex": 223476, + "Kind": 3 + }, + { + "EndIndex": 223482, + "Kind": 3 + }, + { + "EndIndex": 223507, + "Kind": 3 + }, + { + "EndIndex": 223540, + "Kind": 3 + }, + { + "EndIndex": 223564, + "Kind": 3 + }, + { + "EndIndex": 223570, + "Kind": 3 + }, + { + "EndIndex": 223600, + "Kind": 3 + }, + { + "EndIndex": 223631, + "Kind": 3 + }, + { + "EndIndex": 223653, + "Kind": 3 + }, + { + "EndIndex": 223659, + "Kind": 3 + }, + { + "EndIndex": 223683, + "Kind": 3 + }, + { + "EndIndex": 223712, + "Kind": 3 + }, + { + "EndIndex": 223730, + "Kind": 3 + }, + { + "EndIndex": 223736, + "Kind": 3 + }, + { + "EndIndex": 223766, + "Kind": 3 + }, + { + "EndIndex": 223796, + "Kind": 3 + }, + { + "EndIndex": 223818, + "Kind": 3 + }, + { + "EndIndex": 223824, + "Kind": 3 + }, + { + "EndIndex": 223854, + "Kind": 3 + }, + { + "EndIndex": 223885, + "Kind": 3 + }, + { + "EndIndex": 223907, + "Kind": 3 + }, + { + "EndIndex": 223913, + "Kind": 3 + }, + { + "EndIndex": 223940, + "Kind": 3 + }, + { + "EndIndex": 223970, + "Kind": 3 + }, + { + "EndIndex": 223976, + "Kind": 3 + }, + { + "EndIndex": 224001, + "Kind": 3 + }, + { + "EndIndex": 224031, + "Kind": 3 + }, + { + "EndIndex": 224050, + "Kind": 3 + }, + { + "EndIndex": 224056, + "Kind": 3 + }, + { + "EndIndex": 224085, + "Kind": 3 + }, + { + "EndIndex": 224123, + "Kind": 3 + }, + { + "EndIndex": 224137, + "Kind": 3 + }, + { + "EndIndex": 224143, + "Kind": 3 + }, + { + "EndIndex": 224161, + "Kind": 3 + }, + { + "EndIndex": 224203, + "Kind": 3 + }, + { + "EndIndex": 224529, + "Kind": 3 + }, + { + "EndIndex": 224551, + "Kind": 3 + }, + { + "EndIndex": 224557, + "Kind": 3 + }, + { + "EndIndex": 224582, + "Kind": 3 + }, + { + "EndIndex": 224670, + "Kind": 3 + }, + { + "EndIndex": 224688, + "Kind": 3 + }, + { + "EndIndex": 224694, + "Kind": 3 + }, + { + "EndIndex": 224719, + "Kind": 3 + }, + { + "EndIndex": 224856, + "Kind": 3 + }, + { + "EndIndex": 224874, + "Kind": 3 + }, + { + "EndIndex": 224880, + "Kind": 3 + }, + { + "EndIndex": 224895, + "Kind": 3 + }, + { + "EndIndex": 224917, + "Kind": 3 + }, + { + "EndIndex": 224931, + "Kind": 3 + }, + { + "EndIndex": 224937, + "Kind": 3 + }, + { + "EndIndex": 224952, + "Kind": 3 + }, + { + "EndIndex": 224973, + "Kind": 3 + }, + { + "EndIndex": 224987, + "Kind": 3 + }, + { + "EndIndex": 224993, + "Kind": 3 + }, + { + "EndIndex": 225008, + "Kind": 3 + }, + { + "EndIndex": 225029, + "Kind": 3 + }, + { + "EndIndex": 225043, + "Kind": 3 + }, + { + "EndIndex": 225049, + "Kind": 3 + }, + { + "EndIndex": 225051, + "Kind": 3 + }, + { + "EndIndex": 225067, + "Kind": 3 + }, + { + "EndIndex": 225207, + "Kind": 3 + }, + { + "EndIndex": 225222, + "Kind": 3 + }, + { + "EndIndex": 225224, + "Kind": 3 + }, + { + "EndIndex": 225249, + "Kind": 3 + }, + { + "EndIndex": 225321, + "Kind": 3 + }, + { + "EndIndex": 225347, + "Kind": 3 + }, + { + "EndIndex": 225386, + "Kind": 3 + }, + { + "EndIndex": 225425, + "Kind": 3 + }, + { + "EndIndex": 225439, + "Kind": 3 + }, + { + "EndIndex": 225445, + "Kind": 3 + }, + { + "EndIndex": 225487, + "Kind": 3 + }, + { + "EndIndex": 225563, + "Kind": 3 + }, + { + "EndIndex": 225577, + "Kind": 3 + }, + { + "EndIndex": 225583, + "Kind": 3 + }, + { + "EndIndex": 225601, + "Kind": 3 + }, + { + "EndIndex": 225634, + "Kind": 3 + }, + { + "EndIndex": 225785, + "Kind": 3 + }, + { + "EndIndex": 225806, + "Kind": 3 + }, + { + "EndIndex": 225812, + "Kind": 3 + }, + { + "EndIndex": 225837, + "Kind": 3 + }, + { + "EndIndex": 225870, + "Kind": 3 + }, + { + "EndIndex": 225897, + "Kind": 3 + }, + { + "EndIndex": 225903, + "Kind": 3 + }, + { + "EndIndex": 225935, + "Kind": 3 + }, + { + "EndIndex": 226001, + "Kind": 3 + }, + { + "EndIndex": 226019, + "Kind": 3 + }, + { + "EndIndex": 226025, + "Kind": 3 + }, + { + "EndIndex": 226050, + "Kind": 3 + }, + { + "EndIndex": 226083, + "Kind": 3 + }, + { + "EndIndex": 226097, + "Kind": 3 + }, + { + "EndIndex": 226103, + "Kind": 3 + }, + { + "EndIndex": 226130, + "Kind": 3 + }, + { + "EndIndex": 226180, + "Kind": 3 + }, + { + "EndIndex": 226210, + "Kind": 3 + }, + { + "EndIndex": 226216, + "Kind": 3 + }, + { + "EndIndex": 226252, + "Kind": 3 + }, + { + "EndIndex": 226301, + "Kind": 3 + }, + { + "EndIndex": 226322, + "Kind": 3 + }, + { + "EndIndex": 226328, + "Kind": 3 + }, + { + "EndIndex": 226346, + "Kind": 3 + }, + { + "EndIndex": 226388, + "Kind": 3 + }, + { + "EndIndex": 226714, + "Kind": 3 + }, + { + "EndIndex": 226736, + "Kind": 3 + }, + { + "EndIndex": 226742, + "Kind": 3 + }, + { + "EndIndex": 226744, + "Kind": 3 + }, + { + "EndIndex": 226773, + "Kind": 3 + }, + { + "EndIndex": 226988, + "Kind": 3 + }, + { + "EndIndex": 227004, + "Kind": 3 + }, + { + "EndIndex": 227006, + "Kind": 3 + }, + { + "EndIndex": 227038, + "Kind": 3 + }, + { + "EndIndex": 227165, + "Kind": 3 + }, + { + "EndIndex": 227175, + "Kind": 3 + }, + { + "EndIndex": 227177, + "Kind": 3 + }, + { + "EndIndex": 227199, + "Kind": 3 + }, + { + "EndIndex": 227325, + "Kind": 3 + }, + { + "EndIndex": 227348, + "Kind": 3 + }, + { + "EndIndex": 227378, + "Kind": 3 + }, + { + "EndIndex": 227409, + "Kind": 3 + }, + { + "EndIndex": 227431, + "Kind": 3 + }, + { + "EndIndex": 227437, + "Kind": 3 + }, + { + "EndIndex": 227467, + "Kind": 3 + }, + { + "EndIndex": 227498, + "Kind": 3 + }, + { + "EndIndex": 227520, + "Kind": 3 + }, + { + "EndIndex": 227526, + "Kind": 3 + }, + { + "EndIndex": 227565, + "Kind": 3 + }, + { + "EndIndex": 227604, + "Kind": 3 + }, + { + "EndIndex": 227618, + "Kind": 3 + }, + { + "EndIndex": 227624, + "Kind": 3 + }, + { + "EndIndex": 227654, + "Kind": 3 + }, + { + "EndIndex": 227684, + "Kind": 3 + }, + { + "EndIndex": 227706, + "Kind": 3 + }, + { + "EndIndex": 227712, + "Kind": 3 + }, + { + "EndIndex": 227733, + "Kind": 3 + }, + { + "EndIndex": 227782, + "Kind": 3 + }, + { + "EndIndex": 227912, + "Kind": 3 + }, + { + "EndIndex": 227926, + "Kind": 3 + }, + { + "EndIndex": 227932, + "Kind": 3 + }, + { + "EndIndex": 227950, + "Kind": 3 + }, + { + "EndIndex": 227983, + "Kind": 3 + }, + { + "EndIndex": 228134, + "Kind": 3 + }, + { + "EndIndex": 228155, + "Kind": 3 + }, + { + "EndIndex": 228161, + "Kind": 3 + }, + { + "EndIndex": 228191, + "Kind": 3 + }, + { + "EndIndex": 228222, + "Kind": 3 + }, + { + "EndIndex": 228244, + "Kind": 3 + }, + { + "EndIndex": 228250, + "Kind": 3 + }, + { + "EndIndex": 228280, + "Kind": 3 + }, + { + "EndIndex": 228310, + "Kind": 3 + }, + { + "EndIndex": 228332, + "Kind": 3 + }, + { + "EndIndex": 228338, + "Kind": 3 + }, + { + "EndIndex": 228368, + "Kind": 3 + }, + { + "EndIndex": 228399, + "Kind": 3 + }, + { + "EndIndex": 228421, + "Kind": 3 + }, + { + "EndIndex": 228427, + "Kind": 3 + }, + { + "EndIndex": 228454, + "Kind": 3 + }, + { + "EndIndex": 228504, + "Kind": 3 + }, + { + "EndIndex": 228534, + "Kind": 3 + }, + { + "EndIndex": 228540, + "Kind": 3 + }, + { + "EndIndex": 228565, + "Kind": 3 + }, + { + "EndIndex": 228595, + "Kind": 3 + }, + { + "EndIndex": 228614, + "Kind": 3 + }, + { + "EndIndex": 228620, + "Kind": 3 + }, + { + "EndIndex": 228638, + "Kind": 3 + }, + { + "EndIndex": 228680, + "Kind": 3 + }, + { + "EndIndex": 229006, + "Kind": 3 + }, + { + "EndIndex": 229028, + "Kind": 3 + }, + { + "EndIndex": 229034, + "Kind": 3 + }, + { + "EndIndex": 229058, + "Kind": 3 + }, + { + "EndIndex": 229341, + "Kind": 3 + }, + { + "EndIndex": 229365, + "Kind": 3 + }, + { + "EndIndex": 229371, + "Kind": 3 + }, + { + "EndIndex": 229386, + "Kind": 3 + }, + { + "EndIndex": 229408, + "Kind": 3 + }, + { + "EndIndex": 229422, + "Kind": 3 + }, + { + "EndIndex": 229428, + "Kind": 3 + }, + { + "EndIndex": 229443, + "Kind": 3 + }, + { + "EndIndex": 229464, + "Kind": 3 + }, + { + "EndIndex": 229478, + "Kind": 3 + }, + { + "EndIndex": 229484, + "Kind": 3 + }, + { + "EndIndex": 229499, + "Kind": 3 + }, + { + "EndIndex": 229520, + "Kind": 3 + }, + { + "EndIndex": 229534, + "Kind": 3 + }, + { + "EndIndex": 229540, + "Kind": 3 + }, + { + "EndIndex": 229542, + "Kind": 3 + }, + { + "EndIndex": 229565, + "Kind": 3 + }, + { + "EndIndex": 229795, + "Kind": 3 + }, + { + "EndIndex": 229818, + "Kind": 3 + }, + { + "EndIndex": 229820, + "Kind": 3 + }, + { + "EndIndex": 229847, + "Kind": 3 + }, + { + "EndIndex": 230087, + "Kind": 3 + }, + { + "EndIndex": 230097, + "Kind": 3 + }, + { + "EndIndex": 230099, + "Kind": 3 + }, + { + "EndIndex": 230121, + "Kind": 3 + }, + { + "EndIndex": 230609, + "Kind": 3 + }, + { + "EndIndex": 230632, + "Kind": 3 + }, + { + "EndIndex": 230673, + "Kind": 3 + }, + { + "EndIndex": 230741, + "Kind": 3 + }, + { + "EndIndex": 230765, + "Kind": 3 + }, + { + "EndIndex": 230771, + "Kind": 3 + }, + { + "EndIndex": 230810, + "Kind": 3 + }, + { + "EndIndex": 230849, + "Kind": 3 + }, + { + "EndIndex": 230863, + "Kind": 3 + }, + { + "EndIndex": 230869, + "Kind": 3 + }, + { + "EndIndex": 230907, + "Kind": 3 + }, + { + "EndIndex": 231399, + "Kind": 3 + }, + { + "EndIndex": 231413, + "Kind": 3 + }, + { + "EndIndex": 231419, + "Kind": 3 + }, + { + "EndIndex": 231437, + "Kind": 3 + }, + { + "EndIndex": 231470, + "Kind": 3 + }, + { + "EndIndex": 231621, + "Kind": 3 + }, + { + "EndIndex": 231642, + "Kind": 3 + }, + { + "EndIndex": 231648, + "Kind": 3 + }, + { + "EndIndex": 231673, + "Kind": 3 + }, + { + "EndIndex": 231703, + "Kind": 3 + }, + { + "EndIndex": 231722, + "Kind": 3 + }, + { + "EndIndex": 231728, + "Kind": 3 + }, + { + "EndIndex": 231743, + "Kind": 3 + }, + { + "EndIndex": 231768, + "Kind": 3 + }, + { + "EndIndex": 231822, + "Kind": 3 + }, + { + "EndIndex": 231836, + "Kind": 3 + }, + { + "EndIndex": 231842, + "Kind": 3 + }, + { + "EndIndex": 231857, + "Kind": 3 + }, + { + "EndIndex": 231888, + "Kind": 3 + }, + { + "EndIndex": 231954, + "Kind": 3 + }, + { + "EndIndex": 231968, + "Kind": 3 + }, + { + "EndIndex": 231974, + "Kind": 3 + }, + { + "EndIndex": 231992, + "Kind": 3 + }, + { + "EndIndex": 232034, + "Kind": 3 + }, + { + "EndIndex": 232360, + "Kind": 3 + }, + { + "EndIndex": 232382, + "Kind": 3 + }, + { + "EndIndex": 232388, + "Kind": 3 + }, + { + "EndIndex": 232403, + "Kind": 3 + }, + { + "EndIndex": 232433, + "Kind": 3 + }, + { + "EndIndex": 232471, + "Kind": 3 + }, + { + "EndIndex": 232485, + "Kind": 3 + }, + { + "EndIndex": 232491, + "Kind": 3 + }, + { + "EndIndex": 232493, + "Kind": 3 + }, + { + "EndIndex": 232517, + "Kind": 3 + }, + { + "EndIndex": 232649, + "Kind": 3 + }, + { + "EndIndex": 232668, + "Kind": 3 + }, + { + "EndIndex": 232670, + "Kind": 3 + }, + { + "EndIndex": 232690, + "Kind": 3 + }, + { + "EndIndex": 233001, + "Kind": 3 + }, + { + "EndIndex": 233022, + "Kind": 3 + }, + { + "EndIndex": 233061, + "Kind": 3 + }, + { + "EndIndex": 233100, + "Kind": 3 + }, + { + "EndIndex": 233114, + "Kind": 3 + }, + { + "EndIndex": 233120, + "Kind": 3 + }, + { + "EndIndex": 233162, + "Kind": 3 + }, + { + "EndIndex": 233477, + "Kind": 3 + }, + { + "EndIndex": 233491, + "Kind": 3 + }, + { + "EndIndex": 233497, + "Kind": 3 + }, + { + "EndIndex": 233515, + "Kind": 3 + }, + { + "EndIndex": 233548, + "Kind": 3 + }, + { + "EndIndex": 233699, + "Kind": 3 + }, + { + "EndIndex": 233720, + "Kind": 3 + }, + { + "EndIndex": 233726, + "Kind": 3 + }, + { + "EndIndex": 233751, + "Kind": 3 + }, + { + "EndIndex": 233784, + "Kind": 3 + }, + { + "EndIndex": 233806, + "Kind": 3 + }, + { + "EndIndex": 233812, + "Kind": 3 + }, + { + "EndIndex": 233837, + "Kind": 3 + }, + { + "EndIndex": 233870, + "Kind": 3 + }, + { + "EndIndex": 233884, + "Kind": 3 + }, + { + "EndIndex": 233890, + "Kind": 3 + }, + { + "EndIndex": 233917, + "Kind": 3 + }, + { + "EndIndex": 233967, + "Kind": 3 + }, + { + "EndIndex": 233997, + "Kind": 3 + }, + { + "EndIndex": 234003, + "Kind": 3 + }, + { + "EndIndex": 234021, + "Kind": 3 + }, + { + "EndIndex": 234063, + "Kind": 3 + }, + { + "EndIndex": 234389, + "Kind": 3 + }, + { + "EndIndex": 234411, + "Kind": 3 + }, + { + "EndIndex": 234417, + "Kind": 3 + }, + { + "EndIndex": 234419, + "Kind": 3 + } + ], + "FileSize": 234419, "Id": -1981595346, - "Name": "builtins" + "Name": "builtins", + "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/MemberLocations.json b/src/Caching/Test/Files/MemberLocations.json new file mode 100644 index 000000000..883fc6859 --- /dev/null +++ b/src/Caching/Test/Files/MemberLocations.json @@ -0,0 +1,371 @@ +{ + "UniqueId": "module", + "Documentation": "", + "Functions": [ + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "a", + "Type": null, + "DefaultValue": null, + "Kind": 0 + }, + { + "Name": "b", + "Type": null, + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 799444, + "Name": "sum", + "IndexSpan": { + "Start": 19, + "Length": 3 + } + } + ], + "Variables": [ + { + "Value": "bool", + "Id": -529376420, + "Name": "__debug__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "str", + "Id": -1636005055, + "Name": "__doc__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "str", + "Id": 875442003, + "Name": "__file__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "str", + "Id": 1097116834, + "Name": "__name__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "str", + "Id": 75395663, + "Name": "__package__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "list", + "Id": 1154586556, + "Name": "__path__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "i:str", + "Id": 833, + "Name": "x", + "IndexSpan": { + "Start": 2, + "Length": 1 + } + } + ], + "Classes": [ + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module:B", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": "i:int" + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 935009768, + "Name": "methodB2", + "IndexSpan": { + "Start": 253, + "Length": 8 + } + } + ], + "Properties": [ + { + "Documentation": "", + "ReturnType": "i:int", + "Attributes": 0, + "Id": -947452202, + "Name": "propertyB", + "IndexSpan": { + "Start": 207, + "Length": 9 + } + } + ], + "Fields": [ + { + "Value": "i:int", + "Id": 833, + "Name": "x", + "IndexSpan": null + }, + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + } + ], + "GenericParameters": null, + "InnerClasses": [ + { + "Documentation": null, + "Bases": [ + "object" + ], + "Methods": [ + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module:C", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": 965872103, + "Name": "__init__", + "IndexSpan": { + "Start": 101, + "Length": 8 + } + }, + { + "Documentation": null, + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "module:C", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Attributes": 0, + "Classes": null, + "Functions": null, + "Id": -1909501045, + "Name": "methodC", + "IndexSpan": { + "Start": 148, + "Length": 7 + } + } + ], + "Properties": [], + "Fields": [ + { + "Value": "dict", + "Id": 817929997, + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "object", + "Id": 1225024228, + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + } + ], + "GenericParameters": null, + "InnerClasses": [], + "Id": 780, + "Name": "C", + "IndexSpan": { + "Start": 85, + "Length": 1 + } + } + ], + "Id": 779, + "Name": "B", + "IndexSpan": { + "Start": 57, + "Length": 1 + } + } + ], + "NewLines": [ + { + "EndIndex": 2, + "Kind": 3 + }, + { + "EndIndex": 13, + "Kind": 3 + }, + { + "EndIndex": 15, + "Kind": 3 + }, + { + "EndIndex": 31, + "Kind": 3 + }, + { + "EndIndex": 49, + "Kind": 3 + }, + { + "EndIndex": 51, + "Kind": 3 + }, + { + "EndIndex": 61, + "Kind": 3 + }, + { + "EndIndex": 73, + "Kind": 3 + }, + { + "EndIndex": 75, + "Kind": 3 + }, + { + "EndIndex": 89, + "Kind": 3 + }, + { + "EndIndex": 118, + "Kind": 3 + }, + { + "EndIndex": 136, + "Kind": 3 + }, + { + "EndIndex": 164, + "Kind": 3 + }, + { + "EndIndex": 182, + "Kind": 3 + }, + { + "EndIndex": 184, + "Kind": 3 + }, + { + "EndIndex": 199, + "Kind": 3 + }, + { + "EndIndex": 225, + "Kind": 3 + }, + { + "EndIndex": 243, + "Kind": 3 + }, + { + "EndIndex": 245, + "Kind": 3 + }, + { + "EndIndex": 270, + "Kind": 3 + }, + { + "EndIndex": 288, + "Kind": 3 + } + ], + "FileSize": 288, + "Id": -2131035837, + "Name": "module", + "IndexSpan": null +} \ No newline at end of file diff --git a/src/Caching/Test/Files/NestedClasses.json b/src/Caching/Test/Files/NestedClasses.json index 51771c683..4549d8e3e 100644 --- a/src/Caching/Test/Files/NestedClasses.json +++ b/src/Caching/Test/Files/NestedClasses.json @@ -6,47 +6,83 @@ { "Value": "bool", "Id": -529376420, - "Name": "__debug__" + "Name": "__debug__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str", "Id": -1636005055, - "Name": "__doc__" + "Name": "__doc__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str", "Id": 875442003, - "Name": "__file__" + "Name": "__file__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str", "Id": 1097116834, - "Name": "__name__" + "Name": "__name__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str", "Id": 75395663, - "Name": "__package__" + "Name": "__package__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "list", "Id": 1154586556, - "Name": "__path__" + "Name": "__path__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 833, - "Name": "x" + "Name": "x", + "IndexSpan": { + "Start": 2, + "Length": 1 + } }, { "Value": "i:module:C", "Id": 812, - "Name": "c" + "Name": "c", + "IndexSpan": { + "Start": 323, + "Length": 1 + } } ], "Classes": [ @@ -75,7 +111,11 @@ "Classes": null, "Functions": null, "Id": -1909501047, - "Name": "methodA" + "Name": "methodA", + "IndexSpan": { + "Start": 33, + "Length": 7 + } } ], "Properties": [], @@ -83,18 +123,30 @@ { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 778, - "Name": "A" + "Name": "A", + "IndexSpan": { + "Start": 21, + "Length": 1 + } }, { "Documentation": null, @@ -121,7 +173,11 @@ "Classes": null, "Functions": null, "Id": 935009767, - "Name": "methodB1" + "Name": "methodB1", + "IndexSpan": { + "Start": 235, + "Length": 8 + } }, { "Documentation": null, @@ -142,7 +198,11 @@ "Classes": null, "Functions": null, "Id": 935009768, - "Name": "methodB2" + "Name": "methodB2", + "IndexSpan": { + "Start": 282, + "Length": 8 + } } ], "Properties": [], @@ -150,17 +210,26 @@ { "Value": "i:int", "Id": 833, - "Name": "x" + "Name": "x", + "IndexSpan": null }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, @@ -190,7 +259,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 122, + "Length": 8 + } }, { "Documentation": null, @@ -211,7 +284,11 @@ "Classes": null, "Functions": null, "Id": -1909501045, - "Name": "methodC" + "Name": "methodC", + "IndexSpan": { + "Start": 175, + "Length": 7 + } } ], "Properties": [], @@ -219,29 +296,142 @@ { "Value": "i:int", "Id": 834, - "Name": "y" + "Name": "y", + "IndexSpan": null }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 780, - "Name": "C" + "Name": "C", + "IndexSpan": { + "Start": 106, + "Length": 1 + } } ], "Id": 779, - "Name": "B" + "Name": "B", + "IndexSpan": { + "Start": 78, + "Length": 1 + } } ], + "NewLines": [ + { + "EndIndex": 2, + "Kind": 3 + }, + { + "EndIndex": 13, + "Kind": 3 + }, + { + "EndIndex": 15, + "Kind": 3 + }, + { + "EndIndex": 25, + "Kind": 3 + }, + { + "EndIndex": 49, + "Kind": 3 + }, + { + "EndIndex": 70, + "Kind": 3 + }, + { + "EndIndex": 72, + "Kind": 3 + }, + { + "EndIndex": 82, + "Kind": 3 + }, + { + "EndIndex": 94, + "Kind": 3 + }, + { + "EndIndex": 96, + "Kind": 3 + }, + { + "EndIndex": 110, + "Kind": 3 + }, + { + "EndIndex": 139, + "Kind": 3 + }, + { + "EndIndex": 163, + "Kind": 3 + }, + { + "EndIndex": 191, + "Kind": 3 + }, + { + "EndIndex": 217, + "Kind": 3 + }, + { + "EndIndex": 227, + "Kind": 3 + }, + { + "EndIndex": 252, + "Kind": 3 + }, + { + "EndIndex": 272, + "Kind": 3 + }, + { + "EndIndex": 274, + "Kind": 3 + }, + { + "EndIndex": 299, + "Kind": 3 + }, + { + "EndIndex": 321, + "Kind": 3 + }, + { + "EndIndex": 323, + "Kind": 3 + }, + { + "EndIndex": 343, + "Kind": 3 + } + ], + "FileSize": 343, "Id": -2131035837, - "Name": "module" + "Name": "module", + "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/Requests.json b/src/Caching/Test/Files/Requests.json index fb7bb1831..9d3fa1f73 100644 --- a/src/Caching/Test/Files/Requests.json +++ b/src/Caching/Test/Files/Requests.json @@ -27,7 +27,11 @@ "Classes": null, "Functions": null, "Id": 435179778, - "Name": "check_compatibility" + "Name": "check_compatibility", + "IndexSpan": { + "Start": 973, + "Length": 19 + } }, { "Documentation": null, @@ -48,232 +52,940 @@ "Classes": null, "Functions": null, "Id": -399540245, - "Name": "_check_cryptography" + "Name": "_check_cryptography", + "IndexSpan": { + "Start": 1808, + "Length": 19 + } } ], "Variables": [ { "Value": "urllib3", "Id": 1260465222, - "Name": "urllib3" + "Name": "urllib3", + "IndexSpan": { + "Start": 878, + "Length": 7 + } }, { "Value": "chardet", "Id": -2125975290, - "Name": "chardet" + "Name": "chardet", + "IndexSpan": { + "Start": 893, + "Length": 7 + } }, { "Value": "warnings", "Id": 1876311406, - "Name": "warnings" + "Name": "warnings", + "IndexSpan": { + "Start": 908, + "Length": 8 + } }, { "Value": "requests.exceptions:RequestsDependencyWarning", "Id": -802098666, - "Name": "RequestsDependencyWarning" + "Name": "RequestsDependencyWarning", + "IndexSpan": { + "Start": 941, + "Length": 25 + } }, { "Value": "urllib3.contrib.pyopenssl", "Id": -1632802014, - "Name": "pyopenssl" + "Name": "pyopenssl", + "IndexSpan": { + "Start": 2657, + "Length": 9 + } }, { "Value": "urllib3.exceptions:DependencyWarning", "Id": -891041158, - "Name": "DependencyWarning" + "Name": "DependencyWarning", + "IndexSpan": { + "Start": 2960, + "Length": 17 + } }, { "Value": "i:str", "Id": 916650529, - "Name": "__title__" + "Name": "__title__", + "IndexSpan": { + "Start": 3055, + "Length": 9 + } }, { "Value": "i:str", "Id": -1883656187, - "Name": "__description__" + "Name": "__description__", + "IndexSpan": { + "Start": 3066, + "Length": 15 + } }, { "Value": "i:str", "Id": -1620207176, - "Name": "__url__" + "Name": "__url__", + "IndexSpan": { + "Start": 3083, + "Length": 7 + } }, { "Value": "i:str", "Id": 1161199201, - "Name": "__version__" + "Name": "__version__", + "IndexSpan": { + "Start": 3092, + "Length": 11 + } }, { "Value": "i:int", "Id": -1840123721, - "Name": "__build__" + "Name": "__build__", + "IndexSpan": { + "Start": 3129, + "Length": 9 + } }, { "Value": "i:str", "Id": 1654469090, - "Name": "__author__" + "Name": "__author__", + "IndexSpan": { + "Start": 3140, + "Length": 10 + } }, { "Value": "i:str", "Id": -94198849, - "Name": "__author_email__" + "Name": "__author_email__", + "IndexSpan": { + "Start": 3152, + "Length": 16 + } }, { "Value": "i:str", "Id": -386551926, - "Name": "__license__" + "Name": "__license__", + "IndexSpan": { + "Start": 3170, + "Length": 11 + } }, { "Value": "i:str", "Id": 1739624272, - "Name": "__copyright__" + "Name": "__copyright__", + "IndexSpan": { + "Start": 3207, + "Length": 13 + } }, { "Value": "i:str", "Id": 782136591, - "Name": "__cake__" + "Name": "__cake__", + "IndexSpan": { + "Start": 3222, + "Length": 8 + } }, { "Value": "requests.utils", "Id": 770082554, - "Name": "utils" + "Name": "utils", + "IndexSpan": { + "Start": 3246, + "Length": 5 + } }, { "Value": "requests.packages", "Id": 2129088004, - "Name": "packages" + "Name": "packages", + "IndexSpan": { + "Start": 3266, + "Length": 8 + } }, { "Value": "requests.models:Request", "Id": -104689032, - "Name": "Request" + "Name": "Request", + "IndexSpan": { + "Start": 3295, + "Length": 7 + } }, { "Value": "requests.models:Response", "Id": 1102541176, - "Name": "Response" + "Name": "Response", + "IndexSpan": { + "Start": 3304, + "Length": 8 + } }, { "Value": "requests.models:PreparedRequest", "Id": 1337118331, - "Name": "PreparedRequest" + "Name": "PreparedRequest", + "IndexSpan": { + "Start": 3314, + "Length": 15 + } }, { "Value": "requests.api:request", "Id": -1769342312, - "Name": "request" + "Name": "request", + "IndexSpan": { + "Start": 3347, + "Length": 7 + } }, { "Value": "requests.api:get", "Id": 787423, - "Name": "get" + "Name": "get", + "IndexSpan": { + "Start": 3356, + "Length": 3 + } }, { "Value": "requests.api:head", "Id": 24439415, - "Name": "head" + "Name": "head", + "IndexSpan": { + "Start": 3361, + "Length": 4 + } }, { "Value": "requests.api:post", "Id": 24687927, - "Name": "post" + "Name": "post", + "IndexSpan": { + "Start": 3367, + "Length": 4 + } }, { "Value": "requests.api:patch", "Id": 764909201, - "Name": "patch" + "Name": "patch", + "IndexSpan": { + "Start": 3373, + "Length": 5 + } }, { "Value": "requests.api:put", "Id": 796568, - "Name": "put" + "Name": "put", + "IndexSpan": { + "Start": 3380, + "Length": 3 + } }, { "Value": "requests.api:delete", "Id": 1897257090, - "Name": "delete" + "Name": "delete", + "IndexSpan": { + "Start": 3385, + "Length": 6 + } }, { "Value": "requests.api:options", "Id": 180457127, - "Name": "options" + "Name": "options", + "IndexSpan": { + "Start": 3393, + "Length": 7 + } }, { "Value": "requests.sessions:session", "Id": -880047457, - "Name": "session" + "Name": "session", + "IndexSpan": { + "Start": 3423, + "Length": 7 + } }, { "Value": "requests.sessions:Session", "Id": 784605823, - "Name": "Session" + "Name": "Session", + "IndexSpan": { + "Start": 3432, + "Length": 7 + } }, { "Value": "i:requests.structures:LookupDict", "Id": 753305199, - "Name": "codes" + "Name": "codes", + "IndexSpan": { + "Start": 3466, + "Length": 5 + } }, { "Value": "requests.exceptions:RequestException", "Id": 355509431, - "Name": "RequestException" + "Name": "RequestException", + "IndexSpan": { + "Start": 3502, + "Length": 16 + } }, { "Value": "requests.exceptions:Timeout", "Id": 1780673866, - "Name": "Timeout" + "Name": "Timeout", + "IndexSpan": { + "Start": 3520, + "Length": 7 + } }, { "Value": "requests.exceptions:URLRequired", "Id": 1361573271, - "Name": "URLRequired" + "Name": "URLRequired", + "IndexSpan": { + "Start": 3529, + "Length": 11 + } }, { "Value": "requests.exceptions:TooManyRedirects", "Id": 511002043, - "Name": "TooManyRedirects" + "Name": "TooManyRedirects", + "IndexSpan": { + "Start": 3546, + "Length": 16 + } }, { "Value": "requests.exceptions:HTTPError", "Id": -1546903511, - "Name": "HTTPError" + "Name": "HTTPError", + "IndexSpan": { + "Start": 3564, + "Length": 9 + } }, { "Value": "requests.exceptions:ConnectionError", "Id": 853386419, - "Name": "ConnectionError" + "Name": "ConnectionError", + "IndexSpan": { + "Start": 3575, + "Length": 15 + } }, { "Value": "requests.exceptions:FileModeWarning", "Id": 1675678790, - "Name": "FileModeWarning" + "Name": "FileModeWarning", + "IndexSpan": { + "Start": 3596, + "Length": 15 + } }, { "Value": "requests.exceptions:ConnectTimeout", "Id": -1047738098, - "Name": "ConnectTimeout" + "Name": "ConnectTimeout", + "IndexSpan": { + "Start": 3613, + "Length": 14 + } }, { "Value": "requests.exceptions:ReadTimeout", "Id": -1711523244, - "Name": "ReadTimeout" + "Name": "ReadTimeout", + "IndexSpan": { + "Start": 3629, + "Length": 11 + } }, { "Value": "logging", "Id": 1772213096, - "Name": "logging" + "Name": "logging", + "IndexSpan": { + "Start": 3719, + "Length": 7 + } }, { "Value": "logging:NullHandler", "Id": -1600735444, - "Name": "NullHandler" + "Name": "NullHandler", + "IndexSpan": { + "Start": 3747, + "Length": 11 + } }, { "Value": "typing:Any", "Id": 751189, - "Name": "Any" + "Name": "Any", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Classes": [], + "NewLines": [ + { + "EndIndex": 24, + "Kind": 1 + }, + { + "EndIndex": 25, + "Kind": 1 + }, + { + "EndIndex": 32, + "Kind": 1 + }, + { + "EndIndex": 63, + "Kind": 1 + }, + { + "EndIndex": 93, + "Kind": 1 + }, + { + "EndIndex": 106, + "Kind": 1 + }, + { + "EndIndex": 107, + "Kind": 1 + }, + { + "EndIndex": 111, + "Kind": 1 + }, + { + "EndIndex": 133, + "Kind": 1 + }, + { + "EndIndex": 155, + "Kind": 1 + }, + { + "EndIndex": 156, + "Kind": 1 + }, + { + "EndIndex": 232, + "Kind": 1 + }, + { + "EndIndex": 239, + "Kind": 1 + }, + { + "EndIndex": 240, + "Kind": 1 + }, + { + "EndIndex": 263, + "Kind": 1 + }, + { + "EndIndex": 313, + "Kind": 1 + }, + { + "EndIndex": 334, + "Kind": 1 + }, + { + "EndIndex": 341, + "Kind": 1 + }, + { + "EndIndex": 396, + "Kind": 1 + }, + { + "EndIndex": 404, + "Kind": 1 + }, + { + "EndIndex": 405, + "Kind": 1 + }, + { + "EndIndex": 418, + "Kind": 1 + }, + { + "EndIndex": 419, + "Kind": 1 + }, + { + "EndIndex": 471, + "Kind": 1 + }, + { + "EndIndex": 538, + "Kind": 1 + }, + { + "EndIndex": 559, + "Kind": 1 + }, + { + "EndIndex": 564, + "Kind": 1 + }, + { + "EndIndex": 573, + "Kind": 1 + }, + { + "EndIndex": 588, + "Kind": 1 + }, + { + "EndIndex": 613, + "Kind": 1 + }, + { + "EndIndex": 637, + "Kind": 1 + }, + { + "EndIndex": 645, + "Kind": 1 + }, + { + "EndIndex": 654, + "Kind": 1 + }, + { + "EndIndex": 659, + "Kind": 1 + }, + { + "EndIndex": 660, + "Kind": 1 + }, + { + "EndIndex": 738, + "Kind": 1 + }, + { + "EndIndex": 774, + "Kind": 1 + }, + { + "EndIndex": 775, + "Kind": 1 + }, + { + "EndIndex": 814, + "Kind": 1 + }, + { + "EndIndex": 866, + "Kind": 1 + }, + { + "EndIndex": 870, + "Kind": 1 + }, + { + "EndIndex": 871, + "Kind": 1 + }, + { + "EndIndex": 886, + "Kind": 1 + }, + { + "EndIndex": 901, + "Kind": 1 + }, + { + "EndIndex": 917, + "Kind": 1 + }, + { + "EndIndex": 967, + "Kind": 1 + }, + { + "EndIndex": 968, + "Kind": 1 + }, + { + "EndIndex": 969, + "Kind": 1 + }, + { + "EndIndex": 1028, + "Kind": 1 + }, + { + "EndIndex": 1077, + "Kind": 1 + }, + { + "EndIndex": 1159, + "Kind": 1 + }, + { + "EndIndex": 1160, + "Kind": 1 + }, + { + "EndIndex": 1219, + "Kind": 1 + }, + { + "EndIndex": 1253, + "Kind": 1 + }, + { + "EndIndex": 1289, + "Kind": 1 + }, + { + "EndIndex": 1290, + "Kind": 1 + }, + { + "EndIndex": 1329, + "Kind": 1 + }, + { + "EndIndex": 1385, + "Kind": 1 + }, + { + "EndIndex": 1446, + "Kind": 1 + }, + { + "EndIndex": 1479, + "Kind": 1 + }, + { + "EndIndex": 1501, + "Kind": 1 + }, + { + "EndIndex": 1524, + "Kind": 1 + }, + { + "EndIndex": 1547, + "Kind": 1 + }, + { + "EndIndex": 1548, + "Kind": 1 + }, + { + "EndIndex": 1587, + "Kind": 1 + }, + { + "EndIndex": 1644, + "Kind": 1 + }, + { + "EndIndex": 1705, + "Kind": 1 + }, + { + "EndIndex": 1737, + "Kind": 1 + }, + { + "EndIndex": 1759, + "Kind": 1 + }, + { + "EndIndex": 1780, + "Kind": 1 + }, + { + "EndIndex": 1802, + "Kind": 1 + }, + { + "EndIndex": 1803, + "Kind": 1 + }, + { + "EndIndex": 1804, + "Kind": 1 + }, + { + "EndIndex": 1851, + "Kind": 1 + }, + { + "EndIndex": 1878, + "Kind": 1 + }, + { + "EndIndex": 1887, + "Kind": 1 + }, + { + "EndIndex": 1966, + "Kind": 1 + }, + { + "EndIndex": 1989, + "Kind": 1 + }, + { + "EndIndex": 2004, + "Kind": 1 + }, + { + "EndIndex": 2005, + "Kind": 1 + }, + { + "EndIndex": 2046, + "Kind": 1 + }, + { + "EndIndex": 2148, + "Kind": 1 + }, + { + "EndIndex": 2206, + "Kind": 1 + }, + { + "EndIndex": 2207, + "Kind": 1 + }, + { + "EndIndex": 2256, + "Kind": 1 + }, + { + "EndIndex": 2261, + "Kind": 1 + }, + { + "EndIndex": 2327, + "Kind": 1 + }, + { + "EndIndex": 2364, + "Kind": 1 + }, + { + "EndIndex": 2440, + "Kind": 1 + }, + { + "EndIndex": 2519, + "Kind": 1 + }, + { + "EndIndex": 2564, + "Kind": 1 + }, + { + "EndIndex": 2565, + "Kind": 1 + }, + { + "EndIndex": 2620, + "Kind": 1 + }, + { + "EndIndex": 2625, + "Kind": 1 + }, + { + "EndIndex": 2667, + "Kind": 1 + }, + { + "EndIndex": 2703, + "Kind": 1 + }, + { + "EndIndex": 2704, + "Kind": 1 + }, + { + "EndIndex": 2737, + "Kind": 1 + }, + { + "EndIndex": 2802, + "Kind": 1 + }, + { + "EndIndex": 2848, + "Kind": 1 + }, + { + "EndIndex": 2868, + "Kind": 1 + }, + { + "EndIndex": 2877, + "Kind": 1 + }, + { + "EndIndex": 2878, + "Kind": 1 + }, + { + "EndIndex": 2929, + "Kind": 1 + }, + { + "EndIndex": 2978, + "Kind": 1 + }, + { + "EndIndex": 3029, + "Kind": 1 + }, + { + "EndIndex": 3030, + "Kind": 1 + }, + { + "EndIndex": 3104, + "Kind": 1 + }, + { + "EndIndex": 3182, + "Kind": 1 + }, + { + "EndIndex": 3231, + "Kind": 1 + }, + { + "EndIndex": 3232, + "Kind": 1 + }, + { + "EndIndex": 3252, + "Kind": 1 + }, + { + "EndIndex": 3275, + "Kind": 1 + }, + { + "EndIndex": 3330, + "Kind": 1 + }, + { + "EndIndex": 3401, + "Kind": 1 + }, + { + "EndIndex": 3440, + "Kind": 1 + }, + { + "EndIndex": 3472, + "Kind": 1 + }, + { + "EndIndex": 3498, + "Kind": 1 + }, + { + "EndIndex": 3542, + "Kind": 1 + }, + { + "EndIndex": 3592, + "Kind": 1 + }, + { + "EndIndex": 3641, + "Kind": 1 + }, + { + "EndIndex": 3643, + "Kind": 1 + }, + { + "EndIndex": 3644, + "Kind": 1 + }, + { + "EndIndex": 3712, + "Kind": 1 + }, + { + "EndIndex": 3727, + "Kind": 1 + }, + { + "EndIndex": 3759, + "Kind": 1 + }, + { + "EndIndex": 3760, + "Kind": 1 + }, + { + "EndIndex": 3814, + "Kind": 1 + }, + { + "EndIndex": 3815, + "Kind": 1 + }, + { + "EndIndex": 3858, + "Kind": 1 + }, + { + "EndIndex": 3921, + "Kind": 1 + } + ], + "FileSize": 3921, "Id": -203071489, - "Name": "requests" + "Name": "requests", + "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/SmokeTest.json b/src/Caching/Test/Files/SmokeTest.json index eb1096502..66c6cd305 100644 --- a/src/Caching/Test/Files/SmokeTest.json +++ b/src/Caching/Test/Files/SmokeTest.json @@ -14,54 +14,94 @@ "Classes": null, "Functions": null, "Id": 24395611, - "Name": "func" + "Name": "func", + "IndexSpan": { + "Start": 207, + "Length": 4 + } } ], "Variables": [ { "Value": "bool", "Id": -529376420, - "Name": "__debug__" + "Name": "__debug__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str", "Id": -1636005055, - "Name": "__doc__" + "Name": "__doc__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str", "Id": 875442003, - "Name": "__file__" + "Name": "__file__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str", "Id": 1097116834, - "Name": "__name__" + "Name": "__name__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "str", "Id": 75395663, - "Name": "__package__" + "Name": "__package__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "list", "Id": 1154586556, - "Name": "__path__" + "Name": "__path__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 833, - "Name": "x" + "Name": "x", + "IndexSpan": { + "Start": 2, + "Length": 1 + } }, { "Value": "i:module:C", "Id": 812, - "Name": "c" + "Name": "c", + "IndexSpan": { + "Start": 234, + "Length": 1 + } } ], "Classes": [ @@ -90,7 +130,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 45, + "Length": 8 + } }, { "Documentation": null, @@ -111,7 +155,11 @@ "Classes": null, "Functions": null, "Id": -2139806792, - "Name": "method" + "Name": "method", + "IndexSpan": { + "Start": 100, + "Length": 6 + } } ], "Properties": [ @@ -120,37 +168,135 @@ "ReturnType": "i:int", "Attributes": 0, "Id": 24690682, - "Name": "prop" + "Name": "prop", + "IndexSpan": { + "Start": 163, + "Length": 4 + } } ], "Fields": [ { "Value": "i:int", "Id": 833, - "Name": "x" + "Name": "x", + "IndexSpan": null }, { "Value": "i:int", "Id": 834, - "Name": "y" + "Name": "y", + "IndexSpan": null }, { "Value": "dict", "Id": 817929997, - "Name": "__dict__" + "Name": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "object", "Id": 1225024228, - "Name": "__weakref__" + "Name": "__weakref__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "GenericParameters": null, "InnerClasses": [], "Id": 780, - "Name": "C" + "Name": "C", + "IndexSpan": { + "Start": 21, + "Length": 1 + } } ], + "NewLines": [ + { + "EndIndex": 2, + "Kind": 3 + }, + { + "EndIndex": 13, + "Kind": 3 + }, + { + "EndIndex": 15, + "Kind": 3 + }, + { + "EndIndex": 25, + "Kind": 3 + }, + { + "EndIndex": 37, + "Kind": 3 + }, + { + "EndIndex": 62, + "Kind": 3 + }, + { + "EndIndex": 82, + "Kind": 3 + }, + { + "EndIndex": 92, + "Kind": 3 + }, + { + "EndIndex": 115, + "Kind": 3 + }, + { + "EndIndex": 138, + "Kind": 3 + }, + { + "EndIndex": 140, + "Kind": 3 + }, + { + "EndIndex": 155, + "Kind": 3 + }, + { + "EndIndex": 183, + "Kind": 3 + }, + { + "EndIndex": 201, + "Kind": 3 + }, + { + "EndIndex": 203, + "Kind": 3 + }, + { + "EndIndex": 216, + "Kind": 3 + }, + { + "EndIndex": 232, + "Kind": 3 + }, + { + "EndIndex": 234, + "Kind": 3 + }, + { + "EndIndex": 243, + "Kind": 3 + } + ], + "FileSize": 243, "Id": -2131035837, - "Name": "module" + "Name": "module", + "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/Sys.json b/src/Caching/Test/Files/Sys.json index 45eb533cb..81e6f9371 100644 --- a/src/Caching/Test/Files/Sys.json +++ b/src/Caching/Test/Files/Sys.json @@ -14,7 +14,11 @@ "Classes": null, "Functions": null, "Id": -1623088213, - "Name": "__breakpointhook__" + "Name": "__breakpointhook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "displayhook(object) -> None\n\nPrint an object to sys.stdout and also save it in builtins._\n", @@ -28,7 +32,11 @@ "Classes": null, "Functions": null, "Id": 629764782, - "Name": "__displayhook__" + "Name": "__displayhook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "excepthook(exctype, value, traceback) -> None\n\nHandle an exception by displaying it with a traceback on sys.stderr.\n", @@ -42,7 +50,11 @@ "Classes": null, "Functions": null, "Id": 1425218131, - "Name": "__excepthook__" + "Name": "__excepthook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -56,7 +68,11 @@ "Classes": null, "Functions": null, "Id": -1727507378, - "Name": "__interactivehook__" + "Name": "__interactivehook__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "_clear_type_cache() -> None\nClear the internal type lookup cache.", @@ -70,7 +86,11 @@ "Classes": null, "Functions": null, "Id": -1527505257, - "Name": "_clear_type_cache" + "Name": "_clear_type_cache", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "_current_frames() -> dictionary\n\nReturn a dictionary mapping each current thread T's thread id to T's\ncurrent stack frame.\n\nThis function should be used for specialized purposes only.", @@ -84,7 +104,11 @@ "Classes": null, "Functions": null, "Id": 813545300, - "Name": "_current_frames" + "Name": "_current_frames", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "_debugmallocstats()\n\nPrint summary info to stderr about the state of\npymalloc's structures.\n\nIn Py_DEBUG mode, also perform some expensive internal consistency\nchecks.\n", @@ -98,7 +122,11 @@ "Classes": null, "Functions": null, "Id": -1370295892, - "Name": "_debugmallocstats" + "Name": "_debugmallocstats", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "_enablelegacywindowsfsencoding()\n\nChanges the default filesystem encoding to mbcs:replace for consistency\nwith earlier versions of Python. See PEP 529 for more information.\n\nThis is equivalent to defining the PYTHONLEGACYWINDOWSFSENCODING \nenvironment variable before launching Python.", @@ -112,7 +140,11 @@ "Classes": null, "Functions": null, "Id": 1047770159, - "Name": "_enablelegacywindowsfsencoding" + "Name": "_enablelegacywindowsfsencoding", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "_getframe([depth]) -> frameobject\n\nReturn a frame object from the call stack. If optional integer depth is\ngiven, return the frame object that many calls below the top of the stack.\nIf that is deeper than the call stack, ValueError is raised. The default\nfor depth is zero, returning the frame at the top of the call stack.\n\nThis function should be used for internal and specialized\npurposes only.", @@ -137,7 +169,11 @@ "Classes": null, "Functions": null, "Id": 1848744703, - "Name": "_getframe" + "Name": "_getframe", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "breakpointhook(*args, **kws)\n\nThis hook function is called by built-in breakpoint().\n", @@ -164,7 +200,11 @@ "Classes": null, "Functions": null, "Id": -1414470549, - "Name": "breakpointhook" + "Name": "breakpointhook", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "call_tracing(func, args) -> object\n\nCall func(*args), while tracing is enabled. The tracing state is\nsaved, and restored afterwards. This is intended to be called from\na debugger from a checkpoint, to recursively debug some other code.", @@ -191,7 +231,11 @@ "Classes": null, "Functions": null, "Id": -1158985352, - "Name": "call_tracing" + "Name": "call_tracing", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "callstats() -> tuple of integers\n\nReturn a tuple of function call statistics, if CALL_PROFILE was defined\nwhen Python was built. Otherwise, return None.\n\nWhen enabled, this function returns detailed, implementation-specific\ndetails about the number of function calls executed. The return value is\na 11-tuple where the entries in the tuple are counts of:\n0. all function calls\n1. calls to PyFunction_Type objects\n2. PyFunction calls that do not create an argument tuple\n3. PyFunction calls that do not create an argument tuple\n and bypass PyEval_EvalCodeEx()\n4. PyMethod calls\n5. PyMethod calls on bound methods\n6. PyType calls\n7. PyCFunction calls\n8. generator calls\n9. All other calls\n10. Number of stack pops performed by call_function()", @@ -205,7 +249,11 @@ "Classes": null, "Functions": null, "Id": -1252442422, - "Name": "callstats" + "Name": "callstats", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "displayhook(object) -> None\n\nPrint an object to sys.stdout and also save it in builtins._\n", @@ -226,7 +274,11 @@ "Classes": null, "Functions": null, "Id": 388872302, - "Name": "displayhook" + "Name": "displayhook", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "exc_info() -> (type, value, traceback)\n\nReturn information about the most recent exception caught by an except\nclause in the current stack frame or in an older stack frame.", @@ -240,7 +292,11 @@ "Classes": null, "Functions": null, "Id": -935045484, - "Name": "exc_info" + "Name": "exc_info", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "excepthook(exctype, value, traceback) -> None\n\nHandle an exception by displaying it with a traceback on sys.stderr.\n", @@ -273,7 +329,11 @@ "Classes": null, "Functions": null, "Id": 305517843, - "Name": "excepthook" + "Name": "excepthook", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "exit([status])\n\nExit the interpreter by raising SystemExit(status).\nIf the status is omitted or None, it defaults to zero (i.e., success).\nIf the status is an integer, it will be used as the system exit status.\nIf it is another kind of object, it will be printed and the system\nexit status will be one (i.e., failure).", @@ -294,7 +354,11 @@ "Classes": null, "Functions": null, "Id": 24368565, - "Name": "exit" + "Name": "exit", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "get_asyncgen_hooks()\n\nReturn a namedtuple of installed asynchronous generators hooks (firstiter, finalizer).", @@ -308,7 +372,11 @@ "Classes": null, "Functions": null, "Id": -932626587, - "Name": "get_asyncgen_hooks" + "Name": "get_asyncgen_hooks", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Check status of origin tracking for coroutine objects in this thread.", @@ -322,7 +390,11 @@ "Classes": null, "Functions": null, "Id": 1605124845, - "Name": "get_coroutine_origin_tracking_depth" + "Name": "get_coroutine_origin_tracking_depth", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "get_coroutine_wrapper()\n\nReturn the wrapper for coroutine objects set by sys.set_coroutine_wrapper.", @@ -336,7 +408,11 @@ "Classes": null, "Functions": null, "Id": -1829443124, - "Name": "get_coroutine_wrapper" + "Name": "get_coroutine_wrapper", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getallocatedblocks() -> integer\n\nReturn the number of memory blocks currently allocated, regardless of their\nsize.", @@ -350,7 +426,11 @@ "Classes": null, "Functions": null, "Id": -1953654962, - "Name": "getallocatedblocks" + "Name": "getallocatedblocks", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getcheckinterval() -> current check interval; see setcheckinterval().", @@ -364,7 +444,11 @@ "Classes": null, "Functions": null, "Id": 2065023054, - "Name": "getcheckinterval" + "Name": "getcheckinterval", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getdefaultencoding() -> string\n\nReturn the current default string encoding used by the Unicode \nimplementation.", @@ -378,7 +462,11 @@ "Classes": null, "Functions": null, "Id": 1935348949, - "Name": "getdefaultencoding" + "Name": "getdefaultencoding", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getfilesystemencodeerrors() -> string\n\nReturn the error mode used to convert Unicode filenames in\noperating system filenames.", @@ -392,7 +480,11 @@ "Classes": null, "Functions": null, "Id": 346962379, - "Name": "getfilesystemencodeerrors" + "Name": "getfilesystemencodeerrors", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getfilesystemencoding() -> string\n\nReturn the encoding used to convert Unicode filenames in\noperating system filenames.", @@ -406,7 +498,11 @@ "Classes": null, "Functions": null, "Id": -946006243, - "Name": "getfilesystemencoding" + "Name": "getfilesystemencoding", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getprofile()\n\nReturn the profiling function set with sys.setprofile.\nSee the profiler chapter in the library manual.", @@ -420,7 +516,11 @@ "Classes": null, "Functions": null, "Id": 682573034, - "Name": "getprofile" + "Name": "getprofile", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getrecursionlimit()\n\nReturn the current value of the recursion limit, the maximum depth\nof the Python interpreter stack. This limit prevents infinite\nrecursion from causing an overflow of the C stack and crashing Python.", @@ -434,7 +534,11 @@ "Classes": null, "Functions": null, "Id": 949225272, - "Name": "getrecursionlimit" + "Name": "getrecursionlimit", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getrefcount(object) -> integer\n\nReturn the reference count of object. The count returned is generally\none higher than you might expect, because it includes the (temporary)\nreference as an argument to getrefcount().", @@ -455,7 +559,11 @@ "Classes": null, "Functions": null, "Id": -37310149, - "Name": "getrefcount" + "Name": "getrefcount", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getsizeof(object, default) -> int\n\nReturn the size of object in bytes.", @@ -493,7 +601,11 @@ "Classes": null, "Functions": null, "Id": 1485394487, - "Name": "getsizeof" + "Name": "getsizeof", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getswitchinterval() -> current thread switch interval; see setswitchinterval().", @@ -507,7 +619,11 @@ "Classes": null, "Functions": null, "Id": -1633191528, - "Name": "getswitchinterval" + "Name": "getswitchinterval", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "gettrace()\n\nReturn the global debug tracing function set with sys.settrace.\nSee the debugger chapter in the library manual.", @@ -521,7 +637,11 @@ "Classes": null, "Functions": null, "Id": -920747834, - "Name": "gettrace" + "Name": "gettrace", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "getwindowsversion()\n\nReturn information about the running version of Windows as a named tuple.\nThe members are named: major, minor, build, platform, service_pack,\nservice_pack_major, service_pack_minor, suite_mask, and product_type. For\nbackward compatibility, only the first 5 items are available by indexing.\nAll elements are numbers, except service_pack and platform_type which are\nstrings, and platform_version which is a 3-tuple. Platform is always 2.\nProduct_type may be 1 for a workstation, 2 for a domain controller, 3 for a\nserver. Platform_version is a 3-tuple containing a version number that is\nintended for identifying the OS rather than feature detection.", @@ -535,7 +655,11 @@ "Classes": null, "Functions": null, "Id": -1280212332, - "Name": "getwindowsversion" + "Name": "getwindowsversion", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "intern(string) -> string\n\n``Intern'' the given string. This enters the string in the (global)\ntable of interned strings whose purpose is to speed up dictionary lookups.\nReturn the string itself or the previously interned string object with the\nsame value.", @@ -556,7 +680,11 @@ "Classes": null, "Functions": null, "Id": 2048952809, - "Name": "intern" + "Name": "intern", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "is_finalizing()\nReturn True if Python is exiting.", @@ -570,7 +698,11 @@ "Classes": null, "Functions": null, "Id": 1710543065, - "Name": "is_finalizing" + "Name": "is_finalizing", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "set_asyncgen_hooks(*, firstiter=None, finalizer=None)\n\nSet a finalizer for async generators objects.", @@ -603,7 +735,11 @@ "Classes": null, "Functions": null, "Id": -12592935, - "Name": "set_asyncgen_hooks" + "Name": "set_asyncgen_hooks", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Enable or disable origin tracking for coroutine objects in this thread.\n\nCoroutine objects will track 'depth' frames of traceback information about\nwhere they came from, available in their cr_origin attribute. Set depth of 0\nto disable.", @@ -624,7 +760,11 @@ "Classes": null, "Functions": null, "Id": 836059129, - "Name": "set_coroutine_origin_tracking_depth" + "Name": "set_coroutine_origin_tracking_depth", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "set_coroutine_wrapper(wrapper)\n\nSet a wrapper for coroutine objects.", @@ -645,7 +785,11 @@ "Classes": null, "Functions": null, "Id": 706767832, - "Name": "set_coroutine_wrapper" + "Name": "set_coroutine_wrapper", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "setcheckinterval(n)\n\nTell the Python interpreter to check for asynchronous events every\nn instructions. This also affects how often thread switches occur.", @@ -666,7 +810,11 @@ "Classes": null, "Functions": null, "Id": 233580226, - "Name": "setcheckinterval" + "Name": "setcheckinterval", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "setprofile(function)\n\nSet the profiling function. It will be called on each function call\nand return. See the profiler chapter in the library manual.", @@ -687,7 +835,11 @@ "Classes": null, "Functions": null, "Id": -1675589026, - "Name": "setprofile" + "Name": "setprofile", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "setrecursionlimit(n)\n\nSet the maximum depth of the Python interpreter stack to n. This\nlimit prevents infinite recursion from causing an overflow of the C\nstack and crashing Python. The highest possible limit is platform-\ndependent.", @@ -708,7 +860,11 @@ "Classes": null, "Functions": null, "Id": 9072452, - "Name": "setrecursionlimit" + "Name": "setrecursionlimit", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "setswitchinterval(n)\n\nSet the ideal thread switching delay inside the Python interpreter\nThe actual frequency of switching threads can be lower if the\ninterpreter executes long sequences of uninterruptible code\n(this is implementation-specific and workload-dependent).\n\nThe parameter must represent the desired switching delay in seconds\nA typical value is 0.005 (5 milliseconds).", @@ -729,7 +885,11 @@ "Classes": null, "Functions": null, "Id": 1721622948, - "Name": "setswitchinterval" + "Name": "setswitchinterval", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "settrace(function)\n\nSet the global debug tracing function. It will be called on each\nfunction call. See the debugger chapter in the library manual.", @@ -750,7 +910,11 @@ "Classes": null, "Functions": null, "Id": -1481860294, - "Name": "settrace" + "Name": "settrace", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -764,7 +928,11 @@ "Classes": null, "Functions": null, "Id": 503242166, - "Name": "getdlopenflags" + "Name": "getdlopenflags", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -785,7 +953,11 @@ "Classes": null, "Functions": null, "Id": -1268494038, - "Name": "setdlopenflags" + "Name": "setdlopenflags", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -806,7 +978,11 @@ "Classes": null, "Functions": null, "Id": 1891924589, - "Name": "settscdump" + "Name": "settscdump", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -820,324 +996,580 @@ "Classes": null, "Functions": null, "Id": -1618095583, - "Name": "gettotalrefcount" + "Name": "gettotalrefcount", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Variables": [ { "Value": "_io", "Id": 668243680, - "Name": "_mod__io" + "Name": "_mod__io", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "builtins", "Id": -1070584715, - "Name": "_mod_builtins" + "Name": "_mod_builtins", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "types", "Id": -2043043116, - "Name": "_mod_types" + "Name": "_mod_types", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": -1636005055, - "Name": "__doc__" + "Name": "__doc__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 1097116834, - "Name": "__name__" + "Name": "__name__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 75395663, - "Name": "__package__" + "Name": "__package__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:_io:TextIOWrapper", "Id": 1612032761, - "Name": "__stderr__" + "Name": "__stderr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:_io:TextIOWrapper", "Id": 329210449, - "Name": "__stdin__" + "Name": "__stdin__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:_io:TextIOWrapper", "Id": 1621359266, - "Name": "__stdout__" + "Name": "__stdout__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 677051350, - "Name": "_framework" + "Name": "_framework", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:tuple", "Id": 24173482, - "Name": "_git" + "Name": "_git", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:NoneType", "Id": 749413383, - "Name": "_home" + "Name": "_home", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:dict", "Id": 1595009614, - "Name": "_xoptions" + "Name": "_xoptions", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:int", "Id": 1834311484, - "Name": "api_version" + "Name": "api_version", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:list", "Id": 24243575, - "Name": "argv" + "Name": "argv", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 1664944041, - "Name": "base_exec_prefix" + "Name": "base_exec_prefix", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 1039099721, - "Name": "base_prefix" + "Name": "base_prefix", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:list", "Id": 1963179240, - "Name": "builtin_module_names" + "Name": "builtin_module_names", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 2033693967, - "Name": "byteorder" + "Name": "byteorder", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 1298046352, - "Name": "copyright" + "Name": "copyright", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:int", "Id": -1200168491, - "Name": "dllhandle" + "Name": "dllhandle", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:bool", "Id": 1675585612, - "Name": "dont_write_bytecode" + "Name": "dont_write_bytecode", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 62274953, - "Name": "exec_prefix" + "Name": "exec_prefix", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": -2135911519, - "Name": "executable" + "Name": "executable", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 92603457, - "Name": "float_repr_style" + "Name": "float_repr_style", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:int", "Id": -471599948, - "Name": "hexversion" + "Name": "hexversion", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:_implementation", "Id": 1997289353, - "Name": "implementation" + "Name": "implementation", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:int", "Id": -2020000914, - "Name": "maxsize" + "Name": "maxsize", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:int", "Id": 842058832, - "Name": "maxunicode" + "Name": "maxunicode", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:list", "Id": -1294259224, - "Name": "meta_path" + "Name": "meta_path", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:dict", "Id": -1637601392, - "Name": "modules" + "Name": "modules", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:list", "Id": 24674492, - "Name": "path" + "Name": "path", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:list", "Id": -1506404755, - "Name": "path_hooks" + "Name": "path_hooks", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:dict", "Id": 376899064, - "Name": "path_importer_cache" + "Name": "path_importer_cache", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": -1042062966, - "Name": "platform" + "Name": "platform", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": -2042362519, - "Name": "prefix" + "Name": "prefix", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:_io:TextIOWrapper", "Id": -1954658503, - "Name": "stderr" + "Name": "stderr", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:_io:TextIOWrapper", "Id": 768230609, - "Name": "stdin" + "Name": "stdin", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:_io:TextIOWrapper", "Id": -1954648798, - "Name": "stdout" + "Name": "stdout", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": 1781540065, - "Name": "version" + "Name": "version", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:list", "Id": -707130143, - "Name": "warnoptions" + "Name": "warnoptions", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:str", "Id": -1849986786, - "Name": "winver" + "Name": "winver", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:sys:__float_info", "Id": 602612744, - "Name": "float_info" + "Name": "float_info", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:sys:__hash_info", "Id": 84475656, - "Name": "hash_info" + "Name": "hash_info", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:sys:__int_info", "Id": 1942821909, - "Name": "int_info" + "Name": "int_info", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:sys:__thread_info", "Id": 604643660, - "Name": "thread_info" + "Name": "thread_info", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:sys:__version_info", "Id": 1738857804, - "Name": "version_info" + "Name": "version_info", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "typing:List", "Id": 23609685, - "Name": "List" + "Name": "List", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "typing:Sequence", "Id": -1502554888, - "Name": "Sequence" + "Name": "Sequence", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "typing:Any", "Id": 751189, - "Name": "Any" + "Name": "Any", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "typing:Dict", "Id": 23370861, - "Name": "Dict" + "Name": "Dict", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "typing:Tuple", "Id": 739642865, - "Name": "Tuple" + "Name": "Tuple", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "typing:Optional", "Id": 1363847319, - "Name": "Optional" + "Name": "Optional", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "typing:Union", "Id": 740351224, - "Name": "Union" + "Name": "Union", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "typing:TypeVar", "Id": -2053481098, - "Name": "TypeVar" + "Name": "TypeVar", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "typing:Type", "Id": 23863281, - "Name": "Type" + "Name": "Type", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "types:FrameType", "Id": -1970702352, - "Name": "FrameType" + "Name": "FrameType", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "_importlib_modulespec:ModuleType", "Id": -1551859907, - "Name": "ModuleType" + "Name": "ModuleType", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "types:TracebackType", "Id": -612342225, - "Name": "TracebackType" + "Name": "TracebackType", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "importlib.abc:MetaPathFinder", "Id": -1792761721, - "Name": "MetaPathFinder" + "Name": "MetaPathFinder", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "typing:_T", "Id": 25132, - "Name": "_T" + "Name": "_T", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:types:TracebackType", "Id": 2060329242, - "Name": "last_traceback" + "Name": "last_traceback", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Value": "i:tuple", "Id": -1174870545, - "Name": "subversion" + "Name": "subversion", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Classes": [ @@ -1173,7 +1605,11 @@ "Classes": null, "Functions": null, "Id": -1639102358, - "Name": "__add__" + "Name": "__add__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return key in self.", @@ -1200,7 +1636,11 @@ "Classes": null, "Functions": null, "Id": -1841774666, - "Name": "__contains__" + "Name": "__contains__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement delattr(self, name).", @@ -1227,7 +1667,11 @@ "Classes": null, "Functions": null, "Id": 2095540485, - "Name": "__delattr__" + "Name": "__delattr__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Default dir() implementation.", @@ -1248,7 +1692,11 @@ "Classes": null, "Functions": null, "Id": -1636169386, - "Name": "__dir__" + "Name": "__dir__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self==value.", @@ -1275,7 +1723,11 @@ "Classes": null, "Functions": null, "Id": 1748372547, - "Name": "__eq__" + "Name": "__eq__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Default object formatter.", @@ -1302,7 +1754,11 @@ "Classes": null, "Functions": null, "Id": 695475534, - "Name": "__format__" + "Name": "__format__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>=value.", @@ -1329,7 +1785,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -1356,7 +1816,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self[key].", @@ -1383,7 +1847,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -1404,7 +1872,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -1431,7 +1903,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -1452,7 +1928,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "sys.flags\n\nFlags provided through command line arguments or environment vars.", @@ -1485,7 +1965,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -1506,7 +1990,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -1527,7 +2015,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -1554,7 +2046,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -1575,7 +2071,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self=value.", @@ -2231,7 +2837,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -2258,7 +2868,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self[key].", @@ -2285,7 +2899,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -2312,7 +2930,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -2339,7 +2961,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -2360,7 +2986,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "sys.float_info\n\nA structseq holding information about the float type. It contains low level\ninformation about the precision and internal representation. Please study\nyour system's :file:`float.h` for more information.", @@ -2393,7 +3023,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -2414,7 +3048,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -2435,7 +3073,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -2462,7 +3104,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -2483,7 +3129,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self=value.", @@ -3143,7 +3895,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -3170,7 +3926,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self[key].", @@ -3197,7 +3957,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -3224,7 +3988,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -3251,7 +4019,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -3272,7 +4044,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "hash_info\n\nA struct sequence providing parameters used for computing\nhashes. The attributes are read only.", @@ -3305,7 +4081,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -3326,7 +4106,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -3347,7 +4131,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -3374,7 +4162,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -3395,7 +4187,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self=value.", @@ -4045,7 +4941,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -4072,7 +4972,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self[key].", @@ -4099,7 +5003,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -4126,7 +5034,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -4153,7 +5065,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -4174,7 +5090,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "sys.int_info\n\nA struct sequence that holds information about Python's\ninternal representation of integers. The attributes are read only.", @@ -4207,7 +5127,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -4228,7 +5152,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -4249,7 +5177,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -4276,7 +5208,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -4297,7 +5233,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self=value.", @@ -4912,7 +5945,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -4939,7 +5976,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self[key].", @@ -4966,7 +6007,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -4993,7 +6038,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -5020,7 +6069,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -5041,7 +6094,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "sys.thread_info\n\nA struct sequence holding information about the thread implementation.", @@ -5074,7 +6131,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -5095,7 +6156,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Implement iter(self).", @@ -5116,7 +6181,11 @@ "Classes": null, "Functions": null, "Id": 971292143, - "Name": "__iter__" + "Name": "__iter__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -5143,7 +6212,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -5164,7 +6237,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self=value.", @@ -5784,7 +6955,11 @@ "Classes": null, "Functions": null, "Id": 1748420597, - "Name": "__ge__" + "Name": "__ge__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return getattr(self, name).", @@ -5811,7 +6986,11 @@ "Classes": null, "Functions": null, "Id": -1329277859, - "Name": "__getattribute__" + "Name": "__getattribute__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self[key].", @@ -5838,7 +7017,11 @@ "Classes": null, "Functions": null, "Id": -293179214, - "Name": "__getitem__" + "Name": "__getitem__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": null, @@ -5865,7 +7048,11 @@ "Classes": null, "Functions": null, "Id": -488627138, - "Name": "__getnewargs__" + "Name": "__getnewargs__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self>value.", @@ -5892,7 +7079,11 @@ "Classes": null, "Functions": null, "Id": 1748435012, - "Name": "__gt__" + "Name": "__gt__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return hash(self).", @@ -5913,7 +7104,11 @@ "Classes": null, "Functions": null, "Id": 925523557, - "Name": "__hash__" + "Name": "__hash__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "sys.version_info\n\nVersion information as a named tuple.", @@ -5946,7 +7141,11 @@ "Classes": null, "Functions": null, "Id": 965872103, - "Name": "__init__" + "Name": "__init__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", @@ -5967,7 +7166,11 @@ "Classes": null, "Functions": null, "Id": 1040523408, - "Name": "__init_subclass__" + "Name": "__init_subclass__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self<=value.", @@ -5994,7 +7197,11 @@ "Classes": null, "Functions": null, "Id": 1748569552, - "Name": "__le__" + "Name": "__le__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return len(self).", @@ -6015,7 +7222,11 @@ "Classes": null, "Functions": null, "Id": -1628904226, - "Name": "__len__" + "Name": "__len__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } }, { "Documentation": "Return self TestEnvironmentImpl.TestCleanup(); - private string BaselineFileName => Path.ChangeExtension(Path.Combine(BaselineFilesFolder, TestContext.TestName), "json"); - - [TestMethod, Priority(0)] - public async Task SmokeTest() { - const string code = @" -x = 'str' - -class C: - x: int - def __init__(self): - self.y = 1 - - def method(self): - return func() - - @property - def prop(self) -> int: - return x - -def func(): - return 2.0 - -c = C() -"; - var analysis = await GetAnalysisAsync(code); - var model = ModuleModel.FromAnalysis(analysis, Services); - var json = ToJson(model); - Baseline.CompareToFile(BaselineFileName, json); - } - - [TestMethod, Priority(0)] - public async Task NestedClasses() { - const string code = @" -x = 'str' - -class A: - def methodA(self): - return True - -class B: - x: int - - class C: - def __init__(self): - self.y = 1 - def methodC(self): - return False - - def methodB1(self): - return C() - - def methodB2(self): - return C().y - -c = B().methodB1() -"; - var analysis = await GetAnalysisAsync(code); - var model = ModuleModel.FromAnalysis(analysis, Services); - var json = ToJson(model); - Baseline.CompareToFile(BaselineFileName, json); - } + private string BaselineFileName => GetBaselineFileName(TestContext.TestName); [TestMethod, Priority(0)] public async Task Builtins() { @@ -157,27 +95,5 @@ import requests dbModule.Should().HaveSameMembersAs(rq); } } - - [DataTestMethod, Priority(0)] - [DataRow("", null, null, false)] - [DataRow("str", "builtins", "str", false)] - [DataRow("i:str", "builtins", "str", true)] - [DataRow("i:...", "builtins", "ellipsis", true)] - [DataRow("ellipsis", "builtins", "ellipsis", false)] - [DataRow("i:builtins:str", "builtins", "str", true)] - [DataRow("i:mod:x", "mod", "x", true)] - [DataRow("typing:Union[str, tuple]", "typing", "Union[str, tuple]", false)] - [DataRow("typing:Union[typing:Any, mod:y]", "typing", "Union[typing:Any, mod:y]", false)] - [DataRow("typing:Union[typing:Union[str, int], mod:y]", "typing", "Union[typing:Union[str, int], mod:y]", false)] - public void QualifiedNames(string qualifiedName, string moduleName, string typeName, bool isInstance) { - TypeNames.DeconstructQualifiedName(qualifiedName, out var actualModuleName, out var actualMemberNames, out var actualIsInstance); - actualModuleName.Should().Be(moduleName); - if (string.IsNullOrEmpty(qualifiedName)) { - actualMemberNames.Should().BeNull(); - } else { - actualMemberNames[0].Should().Be(typeName); - } - actualIsInstance.Should().Be(isInstance); - } } } diff --git a/src/Caching/Test/ReferencesTests.cs b/src/Caching/Test/ReferencesTests.cs new file mode 100644 index 000000000..435b8df76 --- /dev/null +++ b/src/Caching/Test/ReferencesTests.cs @@ -0,0 +1,125 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Analysis.Caching.Tests.FluentAssertions; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Types; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using TestUtilities; +using Microsoft.Python.Analysis.Modules; + +namespace Microsoft.Python.Analysis.Caching.Tests { + [TestClass] + public class ReferencesTests : AnalysisCachingTestBase { + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + private string BaselineFileName => GetBaselineFileName(TestContext.TestName); + + [TestMethod, Priority(0)] + public async Task MemberLocations() { + const string code = @" +x = 'str' + +def sum(a, b): + return a + b + +class B: + x: int + + class C: + def __init__(self): + pass + def methodC(self): + pass + + @property + def propertyB(self): + return 1 + + def methodB2(self): + return 2 +"; + var analysis = await GetAnalysisAsync(code); + var model = ModuleModel.FromAnalysis(analysis, Services); + var json = ToJson(model); + Baseline.CompareToFile(BaselineFileName, json); + + using (var dbModule = new PythonDbModule(model, analysis.Document.FilePath, Services)) { + var sum = dbModule.GetMember("sum") as IPythonFunctionType; + sum.Should().NotBeNull(); + sum.Definition.Span.Should().Be(4, 5, 4, 8); + + var b = dbModule.GetMember("B") as IPythonClassType; + b.Should().NotBeNull(); + b.Definition.Span.Should().Be(7, 7, 7, 8); + + var c = b.GetMember("C") as IPythonClassType; + c.Should().NotBeNull(); + c.Definition.Span.Should().Be(10, 11, 10, 12); + + var methodC = c.GetMember("methodC") as IPythonFunctionType; + methodC.Should().NotBeNull(); + methodC.Definition.Span.Should().Be(13, 13, 13, 20); + + var propertyB = b.GetMember("propertyB") as IPythonPropertyType; + propertyB.Should().NotBeNull(); + propertyB.Definition.Span.Should().Be(17, 9, 17, 18); + + var methodB2 = b.GetMember("methodB2") as IPythonFunctionType; + methodB2.Should().NotBeNull(); + methodB2.Definition.Span.Should().Be(20, 9, 20, 17); + } + } + + [TestMethod, Priority(0)] + public async Task Logging() { + const string code = @" +import logging +logging.critical() +"; + var analysis = await GetAnalysisAsync(code); + var logging = analysis.Document.Interpreter.ModuleResolution.GetImportedModule("logging"); + var model = ModuleModel.FromAnalysis(logging.Analysis, Services); + + var dbModule = new PythonDbModule(model, logging.FilePath, Services); + analysis.Document.Interpreter.ModuleResolution.SpecializeModule("logging", x => dbModule); + + var moduleName = $"{analysis.Document.Name}_db.py"; + var modulePath = TestData.GetTestSpecificPath(moduleName); + analysis = await GetAnalysisAsync(code, Services, moduleName, modulePath); + + var v = analysis.Should().HaveVariable("logging").Which; + var vm = v.Value.Should().BeOfType().Which; + var m = vm.Module.Should().BeOfType().Which; + + var critical = m.GetMember("critical") as IPythonFunctionType; + critical.Should().NotBeNull(); + + var span = critical.Definition.Span; + span.Start.Line.Should().BeGreaterThan(1000); + (span.End.Column - span.Start.Column).Should().Be("critical".Length); + } + } +} diff --git a/src/Core/Impl/Text/ILocationConverter.cs b/src/Core/Impl/Text/ILocationConverter.cs new file mode 100644 index 000000000..162698200 --- /dev/null +++ b/src/Core/Impl/Text/ILocationConverter.cs @@ -0,0 +1,26 @@ +// Python Tools for Visual Studio +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +namespace Microsoft.Python.Core.Text { + /// + /// Represents object that can convert linear span coordinates + /// to line/column and vise versa. + /// + public interface ILocationConverter { + SourceLocation IndexToLocation(int index); + int LocationToIndex(SourceLocation location); + } +} diff --git a/src/Core/Impl/Text/IndexSpan.cs b/src/Core/Impl/Text/IndexSpan.cs index 25c9ca823..85f99153f 100644 --- a/src/Core/Impl/Text/IndexSpan.cs +++ b/src/Core/Impl/Text/IndexSpan.cs @@ -23,18 +23,16 @@ namespace Microsoft.Python.Core.Text { /// It is closed on the left and open on the right: [Start .. End). /// public struct IndexSpan : IEquatable { - private readonly int _start, _length; - public IndexSpan(int start, int length) { - _start = start; - _length = length; + Start = start; + Length = length; } - public int Start => _start; + public int Start { get; } - public int End => _start + _length; + public int End => Start + Length; - public int Length => _length; + public int Length { get; } public override int GetHashCode() => Length.GetHashCode() ^ Start.GetHashCode(); @@ -49,7 +47,7 @@ public IndexSpan(int start, int length) { } #region IEquatable Members - public bool Equals(IndexSpan other) => _length == other._length && _start == other._start; + public bool Equals(IndexSpan other) => Length == other.Length && Start == other.Start; #endregion public static IndexSpan FromBounds(int start, int end) => new IndexSpan(start, end - start); diff --git a/src/LanguageServer/Impl/Sources/DefinitionSource.cs b/src/LanguageServer/Impl/Sources/DefinitionSource.cs index b7cb347ab..7bac3369c 100644 --- a/src/LanguageServer/Impl/Sources/DefinitionSource.cs +++ b/src/LanguageServer/Impl/Sources/DefinitionSource.cs @@ -25,6 +25,7 @@ using Microsoft.Python.Core; using Microsoft.Python.Core.Text; using Microsoft.Python.LanguageServer.Completion; +using Microsoft.Python.LanguageServer.Documents; using Microsoft.Python.LanguageServer.Protocol; using Microsoft.Python.Parsing.Ast; @@ -193,10 +194,10 @@ private Reference FromMemberExpression(MemberExpression mex, IDocumentAnalysis a var type = target?.GetPythonType(); switch (type) { - case IPythonModule m when m.Analysis.GlobalScope != null: + case IPythonModule m when m.GlobalScope != null: // Module GetMember returns module variable value while we // want the variable itself since we want to know its location. - var v1 = m.Analysis.GlobalScope.Variables[mex.Name]; + var v1 = m.GlobalScope.Variables[mex.Name]; if (v1 != null) { definingMember = v1; return FromMember(v1); @@ -247,12 +248,15 @@ private bool CanNavigateToModule(Uri uri) { } var rdt = _services.GetService(); var doc = rdt.GetDocument(uri); - return CanNavigateToModule(doc); + // Allow navigation to modules not in RDT - most probably + // it is a module that was restored from database. + return doc == null || CanNavigateToModule(doc); } private static bool CanNavigateToModule(IPythonModule m) - => m?.ModuleType == ModuleType.User || + => m?.ModuleType == ModuleType.Stub || m?.ModuleType == ModuleType.Package || - m?.ModuleType == ModuleType.Library; + m?.ModuleType == ModuleType.Library || + m?.ModuleType == ModuleType.Specialized; } } diff --git a/src/Parsing/Impl/Ast/PythonAst.cs b/src/Parsing/Impl/Ast/PythonAst.cs index 70a669cf9..5ebeee6e7 100644 --- a/src/Parsing/Impl/Ast/PythonAst.cs +++ b/src/Parsing/Impl/Ast/PythonAst.cs @@ -25,7 +25,7 @@ namespace Microsoft.Python.Parsing.Ast { /// /// Top-level ast for all Python code. Holds onto the body and the line mapping information. /// - public sealed class PythonAst : ScopeStatement { + public sealed class PythonAst : ScopeStatement, ILocationConverter { private readonly object _lock = new object(); private readonly Statement _body; private readonly Dictionary> _attributes = new Dictionary>(); @@ -140,8 +140,10 @@ internal void SetAttributes(Dictionary> attribu } } + #region ILocationConverter public SourceLocation IndexToLocation(int index) => NewLineLocation.IndexToLocation(NewLineLocations, index); public int LocationToIndex(SourceLocation location) => NewLineLocation.LocationToIndex(NewLineLocations, location, EndIndex); + #endregion internal int GetLineEndFromPosition(int index) { var loc = IndexToLocation(index); diff --git a/src/Parsing/Impl/Ast/SourceLocationExtensions.cs b/src/Parsing/Impl/Ast/SourceLocationExtensions.cs index 4c8df3e07..9377fe70f 100644 --- a/src/Parsing/Impl/Ast/SourceLocationExtensions.cs +++ b/src/Parsing/Impl/Ast/SourceLocationExtensions.cs @@ -18,18 +18,18 @@ namespace Microsoft.Python.Parsing.Ast { public static class SourceLocationExtensions { - public static int ToIndex(this SourceLocation location, PythonAst ast) => ast.LocationToIndex(location); + public static int ToIndex(this SourceLocation location, ILocationConverter lc) => lc.LocationToIndex(location); } public static class SourceSpanExtensions { - public static IndexSpan ToIndexSpan(this SourceSpan span, PythonAst ast) - => IndexSpan.FromBounds(ast.LocationToIndex(span.Start), ast.LocationToIndex(span.End)); - public static IndexSpan ToIndexSpan(this Range range, PythonAst ast) - => IndexSpan.FromBounds(ast.LocationToIndex(range.start), ast.LocationToIndex(range.end)); + public static IndexSpan ToIndexSpan(this SourceSpan span, ILocationConverter lc) + => IndexSpan.FromBounds(lc.LocationToIndex(span.Start), lc.LocationToIndex(span.End)); + public static IndexSpan ToIndexSpan(this Range range, ILocationConverter lc) + => IndexSpan.FromBounds(lc.LocationToIndex(range.start), lc.LocationToIndex(range.end)); } public static class IndexSpanExtensions { - public static SourceSpan ToSourceSpan(this IndexSpan span, PythonAst ast) - => ast != null ? new SourceSpan(ast.IndexToLocation(span.Start), ast.IndexToLocation(span.End)) : default; + public static SourceSpan ToSourceSpan(this IndexSpan span, ILocationConverter lc) + => lc != null ? new SourceSpan(lc.IndexToLocation(span.Start), lc.IndexToLocation(span.End)) : default; } } diff --git a/src/Parsing/Impl/Tokens/NewLineKind.cs b/src/Parsing/Impl/Tokens/NewLineKind.cs new file mode 100644 index 000000000..fb103bbd3 --- /dev/null +++ b/src/Parsing/Impl/Tokens/NewLineKind.cs @@ -0,0 +1,24 @@ +// Python Tools for Visual Studio +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +namespace Microsoft.Python.Parsing { + public enum NewLineKind { + None, + LineFeed, + CarriageReturn, + CarriageReturnLineFeed + } +} diff --git a/src/Parsing/Impl/Tokens/NewLineKindExtensions.cs b/src/Parsing/Impl/Tokens/NewLineKindExtensions.cs new file mode 100644 index 000000000..1c7e26803 --- /dev/null +++ b/src/Parsing/Impl/Tokens/NewLineKindExtensions.cs @@ -0,0 +1,39 @@ +// Python Tools for Visual Studio +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; + +namespace Microsoft.Python.Parsing { + public static class NewLineKindExtensions { + public static int GetSize(this NewLineKind kind) { + switch (kind) { + case NewLineKind.LineFeed: return 1; + case NewLineKind.CarriageReturnLineFeed: return 2; + case NewLineKind.CarriageReturn: return 1; + } + return 0; + } + + public static string GetString(this NewLineKind kind) { + switch (kind) { + case NewLineKind.CarriageReturn: return "\r"; + case NewLineKind.CarriageReturnLineFeed: return "\r\n"; + case NewLineKind.LineFeed: return "\n"; + } + throw new InvalidOperationException(); + } + } +} diff --git a/src/Parsing/Impl/Tokens/NewLineLocation.cs b/src/Parsing/Impl/Tokens/NewLineLocation.cs new file mode 100644 index 000000000..478f83c89 --- /dev/null +++ b/src/Parsing/Impl/Tokens/NewLineLocation.cs @@ -0,0 +1,120 @@ +// Python Tools for Visual Studio +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Diagnostics; +using Microsoft.Python.Core.Text; + +namespace Microsoft.Python.Parsing { + [DebuggerDisplay("NewLineLocation({EndIndex}, {Kind})")] + public struct NewLineLocation : IComparable { + public NewLineLocation(int lineEnd, NewLineKind kind) { + EndIndex = lineEnd; + Kind = kind; + } + + /// + /// The end of of the line, including the line break. + /// + public int EndIndex { get; } + + /// + /// The type of new line which terminated the line. + /// + public NewLineKind Kind { get; } + + public int CompareTo(NewLineLocation other) => EndIndex - other.EndIndex; + + public static SourceLocation IndexToLocation(NewLineLocation[] lineLocations, int index) { + if (lineLocations == null || index == 0) { + return new SourceLocation(index, 1, 1); + } + + var match = Array.BinarySearch(lineLocations, new NewLineLocation(index, NewLineKind.None)); + if (match < 0) { + // If our index = -1, it means we're on the first line. + if (match == -1) { + return new SourceLocation(index, 1, checked(index + 1)); + } + // If we couldn't find an exact match for this line number, get the nearest + // matching line number less than this one + match = ~match - 1; + } + + while (match >= 0 && index == lineLocations[match].EndIndex && lineLocations[match].Kind == NewLineKind.None) { + match -= 1; + } + if (match < 0) { + return new SourceLocation(index, 1, checked(index + 1)); + } + + var line = match + 2; + var col = index - lineLocations[match].EndIndex + 1; + return new SourceLocation(index, line, col); + } + + public static int LocationToIndex(NewLineLocation[] lineLocations, SourceLocation location, int endIndex) { + if (lineLocations == null) { + return 0; + } + var index = 0; + if (lineLocations.Length == 0) { + // We have a single line, so the column is the index + index = location.Column - 1; + return endIndex >= 0 ? Math.Min(index, endIndex) : index; + } + var line = location.Line - 1; + + if (line > lineLocations.Length) { + index = lineLocations[lineLocations.Length - 1].EndIndex; + return endIndex >= 0 ? Math.Min(index, endIndex) : index; + } + + if (line > 0) { + index = lineLocations[line - 1].EndIndex; + } + + if (line < lineLocations.Length && location.Column > (lineLocations[line].EndIndex - index)) { + index = lineLocations[line].EndIndex; + return endIndex >= 0 ? Math.Min(index, endIndex) : index; + } + + if (endIndex < 0) { + endIndex = lineLocations[lineLocations.Length - 1].EndIndex; + } + + return (int)Math.Min((long)index + location.Column - 1, endIndex); + } + + private static readonly char[] _lineSeparators = new[] { '\r', '\n' }; + + public static NewLineLocation FindNewLine(string text, int start) { + var i = text.IndexOfAny(_lineSeparators, start); + if (i < start) { + return new NewLineLocation(text.Length, NewLineKind.None); + } + if (text[i] == '\n') { + return new NewLineLocation(i + 1, NewLineKind.LineFeed); + } + if (text.Length > i + 1 && text[i + 1] == '\n') { + return new NewLineLocation(i + 2, NewLineKind.CarriageReturnLineFeed); + } + return new NewLineLocation(i + 1, NewLineKind.CarriageReturn); + } + + public override string ToString() => $""; + } +} diff --git a/src/Parsing/Impl/Token.cs b/src/Parsing/Impl/Tokens/Token.cs similarity index 100% rename from src/Parsing/Impl/Token.cs rename to src/Parsing/Impl/Tokens/Token.cs diff --git a/src/Parsing/Impl/TokenCategory.cs b/src/Parsing/Impl/Tokens/TokenCategory.cs similarity index 100% rename from src/Parsing/Impl/TokenCategory.cs rename to src/Parsing/Impl/Tokens/TokenCategory.cs diff --git a/src/Parsing/Impl/TokenInfo.cs b/src/Parsing/Impl/Tokens/TokenInfo.cs similarity index 100% rename from src/Parsing/Impl/TokenInfo.cs rename to src/Parsing/Impl/Tokens/TokenInfo.cs diff --git a/src/Parsing/Impl/TokenKind.Generated.cs b/src/Parsing/Impl/Tokens/TokenKind.Generated.cs similarity index 100% rename from src/Parsing/Impl/TokenKind.Generated.cs rename to src/Parsing/Impl/Tokens/TokenKind.Generated.cs diff --git a/src/Parsing/Impl/TokenTriggers.cs b/src/Parsing/Impl/Tokens/TokenTriggers.cs similarity index 100% rename from src/Parsing/Impl/TokenTriggers.cs rename to src/Parsing/Impl/Tokens/TokenTriggers.cs diff --git a/src/Parsing/Impl/Tokenizer.cs b/src/Parsing/Impl/Tokens/Tokenizer.cs similarity index 95% rename from src/Parsing/Impl/Tokenizer.cs rename to src/Parsing/Impl/Tokens/Tokenizer.cs index e77356a9a..ec5622252 100644 --- a/src/Parsing/Impl/Tokenizer.cs +++ b/src/Parsing/Impl/Tokens/Tokenizer.cs @@ -28,7 +28,6 @@ using Microsoft.Python.Core.Text; namespace Microsoft.Python.Parsing { - /// /// IronPython tokenizer /// @@ -2585,133 +2584,4 @@ private void ClearInvalidChars() { #endregion } - - public enum NewLineKind { - None, - LineFeed, - CarriageReturn, - CarriageReturnLineFeed - } - - [DebuggerDisplay("NewLineLocation({_endIndex}, {_kind})")] - public struct NewLineLocation : IComparable { - private readonly int _endIndex; - private readonly NewLineKind _kind; - - public NewLineLocation(int lineEnd, NewLineKind kind) { - _endIndex = lineEnd; - _kind = kind; - } - - /// - /// The end of of the line, including the line break. - /// - public int EndIndex => _endIndex; - - /// - /// The type of new line which terminated the line. - /// - public NewLineKind Kind => _kind; - - public int CompareTo(NewLineLocation other) => EndIndex - other.EndIndex; - - public static SourceLocation IndexToLocation(NewLineLocation[] lineLocations, int index) { - if (lineLocations == null || index == 0) { - return new SourceLocation(index, 1, 1); - } - - var match = Array.BinarySearch(lineLocations, new NewLineLocation(index, NewLineKind.None)); - if (match < 0) { - // If our index = -1, it means we're on the first line. - if (match == -1) { - return new SourceLocation(index, 1, checked(index + 1)); - } - // If we couldn't find an exact match for this line number, get the nearest - // matching line number less than this one - match = ~match - 1; - } - - while (match >= 0 && index == lineLocations[match].EndIndex && lineLocations[match].Kind == NewLineKind.None) { - match -= 1; - } - if (match < 0) { - return new SourceLocation(index, 1, checked(index + 1)); - } - - var line = match + 2; - var col = index - lineLocations[match].EndIndex + 1; - return new SourceLocation(index, line, col); - } - - public static int LocationToIndex(NewLineLocation[] lineLocations, SourceLocation location, int endIndex) { - if (lineLocations == null) { - return 0; - } - var index = 0; - if (lineLocations.Length == 0) { - // We have a single line, so the column is the index - index = location.Column - 1; - return endIndex >= 0 ? Math.Min(index, endIndex) : index; - } - var line = location.Line - 1; - - if (line > lineLocations.Length) { - index = lineLocations[lineLocations.Length - 1].EndIndex; - return endIndex >= 0 ? Math.Min(index, endIndex) : index; - } - - if (line > 0) { - index = lineLocations[line - 1].EndIndex; - } - - if (line < lineLocations.Length && location.Column > (lineLocations[line].EndIndex - index)) { - index = lineLocations[line].EndIndex; - return endIndex >= 0 ? Math.Min(index, endIndex) : index; - } - - if (endIndex < 0) { - endIndex = lineLocations[lineLocations.Length - 1].EndIndex; - } - - return (int)Math.Min((long)index + location.Column - 1, endIndex); - } - - private static readonly char[] _lineSeparators = new[] { '\r', '\n' }; - - public static NewLineLocation FindNewLine(string text, int start) { - var i = text.IndexOfAny(_lineSeparators, start); - if (i < start) { - return new NewLineLocation(text.Length, NewLineKind.None); - } - if (text[i] == '\n') { - return new NewLineLocation(i + 1, NewLineKind.LineFeed); - } - if (text.Length > i + 1 && text[i + 1] == '\n') { - return new NewLineLocation(i + 2, NewLineKind.CarriageReturnLineFeed); - } - return new NewLineLocation(i + 1, NewLineKind.CarriageReturn); - } - - public override string ToString() => $""; - } - - public static class NewLineKindExtensions { - public static int GetSize(this NewLineKind kind) { - switch (kind) { - case NewLineKind.LineFeed: return 1; - case NewLineKind.CarriageReturnLineFeed: return 2; - case NewLineKind.CarriageReturn: return 1; - } - return 0; - } - - public static string GetString(this NewLineKind kind) { - switch (kind) { - case NewLineKind.CarriageReturn: return "\r"; - case NewLineKind.CarriageReturnLineFeed: return "\r\n"; - case NewLineKind.LineFeed: return "\n"; - } - throw new InvalidOperationException(); - } - } } diff --git a/src/Parsing/Impl/TokenizerOptions.cs b/src/Parsing/Impl/Tokens/TokenizerOptions.cs similarity index 100% rename from src/Parsing/Impl/TokenizerOptions.cs rename to src/Parsing/Impl/Tokens/TokenizerOptions.cs From 21437191dde54745b1a79487d7aab905229ecb47 Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Thu, 8 Aug 2019 09:30:38 -0700 Subject: [PATCH 05/60] Multiple fixes and additional tests for persistence (#1372) * Remove old qualified name * Node storage * Class and scope to use AST map * Library analysis * Fix SO * Keep small AST with imports * AST reduction * Final field * Initial * Reload * Ignore post-final requests * Drop AST * Remove local variables * Test fixes * Fix overload match * Tests * Add locks * Remove local variables * Drop file content to save memory * Cache PEP hints * Recreate AST * Fix specialization * Fix locations * usings * Test fixes * Add options to keep data in memory * Fix test * Fix lambda parameters * Fix argument set Fix global scope node * Fix overload doc * Fix stub merge errors * Fix async issues * Undo some changes * Fix test * Fix race condition * Partial * Models and views * Restore log null checks * Fix merge conflict * Fix merge issue * Null check * Partial * Partial * Partial * Fix test * Partial * Partial * First test * Baseline comparison * Builtins * Partial * Type fixes * Fix type names, part I * Qualified name * Properly write variables * Partial * Construct module from model * Test * Variable creations * Factories * Factories * Split construction * Restore * Save builtins * Test passes * Qualified name * Better export detection * Test fixes * More consistent qualified names * Sys test * Demo * Complete sys write/read * Partial * Partial * Test staility * Perf bug * Baseline, remove debug code, deactivate db * Test fixes * Test fix * Simplify a bit * Baselines and use : separator * Baselines * PR feedback * Merge master * Remove registry reference * PR feedback * PR feedback * Restore persistence + update test * Better handle persistent module in dependencies * Undo * Add location converter abstraction * Store member location * Fix merge issue * Basic locations test * Navigation * Add test * Update baselines * Type restore - initial * Remove debug code * Partial * Fix stub merge * Various model fixes * Improve module handling * Qualified name improvements * Fix unbound case * Improve stub merge * Fix qualified names of typing * Handle stub-only modules * Add tests for io, re and sys * Better handle named tuple * Handle module circular references * Handle else in platform and version clauses + handle it in symbol collector * Formatting * Fix walk of multi-level if statement * Unify package search in imports * Fix tests * Undo change * Port changes from dbtype * Partial * Named tuple support * Baseline updates * Debug code * Support types * Properly compare class member declaring type * Nested classes and functions persistence * Undo debug * Fix numpy restore * Baselines * Fix tests * Update AnyStr test reflecting changes to AnyStr behavior * Exclude baselines from git diff * Fix gitattr * Move git setting to root * Try no path * Add RDT count to the analysis_complete event (#1396) * Add RDT count to the analysis_complete event * Use property instead of method * Test fixes * Undo change * Additional stub merge fixes * Baseline updates * Fix goto def * Protect specific type creation * Track documentaton source * More reliable tests + simplification * Prevent crashes when the AST happens to be null (#1405) * Remove all references to dropped modules and force GC on reload (#1402) * First attempt at ensuring moduled dropped during reload are GC'd * Make sure AST is set after content is cleared * More tests passing * ModuleWalker updates * Also don't merge against specialized modules, do builtin _astMap reset before reanalyzing instead of after any analysis * Don't call dispose directly, it's done elsewhere and has no effect * Force GC via normal session instead of waiting for a hardcoded time * Un-refactor function since it's not being called externally anymore * Formatting/usings * PR feedback * Undo IsBuiltin, some things continued to be referenced with that changed * Move reload logic down into PythonAnalyzer, remove added public inferface items * Mode AddReference to PythonType as override * Remove dead code, make all ResetAnalyzer calls full * Typo * Cleanup * Basic classification * Fix merge error * Module unique id fixes * Stricted check to save analysis * Revert "Fix tests" This reverts commit 247a8c38741324452cc5a8eeb412a9784441bd8b. * Revert "Unify package search in imports" This reverts commit 67fed10d1c892de07a9a920b5396d53d7473b977. * Don't clear scope variables with inner classes * Fix typo --- .gitattributes | 1 + .../Analyzer/Definitions/IPythonAnalyzer.cs | 5 +- .../Evaluation/ExpressionEval.Constants.cs | 2 +- .../Analyzer/Evaluation/ExpressionEval.cs | 31 +- .../Analyzer/Handlers/ConditionalHandler.cs | 109 +- .../Ast/Impl/Analyzer/LibraryAnalysis.cs | 3 - .../Ast/Impl/Analyzer/ModuleWalker.cs | 173 +- .../Ast/Impl/Analyzer/PythonAnalyzer.cs | 36 +- .../Impl/Analyzer/PythonAnalyzerSession.cs | 39 +- .../Impl/Analyzer/Symbols/ClassEvaluator.cs | 2 - .../Analyzer/Symbols/FunctionEvaluator.cs | 15 +- .../Impl/Analyzer/Symbols/SymbolCollector.cs | 43 +- .../Definitions/IRunningDocumentTable.cs | 5 + .../Impl/Documents/RunningDocumentTable.cs | 8 + .../Impl/Extensions/ArgumentSetExtensions.cs | 2 +- .../Impl/Extensions/IfStatementExtensions.cs | 94 + .../Extensions/PythonFunctionExtensions.cs | 11 +- .../Impl/Extensions/PythonTypeExtensions.cs | 15 +- .../Impl/Extensions/PythonWalkerExtensions.cs | 61 + .../Ast/Impl/Microsoft.Python.Analysis.csproj | 1 + .../Modules/Definitions/IModuleManagement.cs | 14 +- .../Definitions/ModuleCreationOptions.cs | 1 + src/Analysis/Ast/Impl/Modules/PythonModule.cs | 20 +- .../Ast/Impl/Modules/PythonVariableModule.cs | 3 + .../Resolution/MainModuleResolution.cs | 30 +- .../Resolution/ModuleResolutionBase.cs | 1 - .../BuiltinsSpecializations.cs | 5 +- .../Specializations/Typing/Types/AnyType.cs | 2 +- .../Typing/Types/GenericType.cs | 10 +- .../Typing/Types/NamedTupleType.cs | 9 +- .../Typing/Types/OptionalType.cs | 2 + .../Specializations/Typing/Types/TypeAlias.cs | 1 + .../Typing/Types/TypingDictionaryType.cs | 4 +- .../Typing/Types/TypingIteratorType.cs | 3 + .../Typing/Types/TypingListType.cs | 4 +- .../Typing/Types/TypingTupleType.cs | 13 +- .../Specializations/Typing/TypingModule.cs | 30 +- .../Typing/TypingTypeFactory.cs | 6 +- src/Analysis/Ast/Impl/Types/ArgumentSet.cs | 1 - .../Types/Collections/PythonCollectionType.cs | 23 +- .../Types/Collections/PythonDictionaryType.cs | 2 +- .../Types/Definitions/IPythonClassType.cs | 2 +- .../Definitions/IPythonFunctionOverload.cs | 1 - src/Analysis/Ast/Impl/Types/LocatedMember.cs | 3 + .../Ast/Impl/Types/PythonClassType.cs | 255 +- .../Ast/Impl/Types/PythonFunctionOverload.cs | 2 +- .../Ast/Impl/Types/PythonFunctionType.cs | 38 +- src/Analysis/Ast/Impl/Types/PythonType.cs | 10 +- .../Ast/Impl/Types/PythonTypeWrapper.cs | 14 +- .../Impl/Values/Collections/PythonIterator.cs | 2 +- src/Analysis/Ast/Test/BasicTests.cs | 54 - src/Analysis/Ast/Test/BuiltinsTests.cs | 99 + src/Analysis/Ast/Test/ClassesTests.cs | 34 + src/Analysis/Ast/Test/ConditionalsTests.cs | 49 +- .../Test/FluentAssertions/MemberAssertions.cs | 70 +- .../PythonFunctionAssertions.cs | 11 + .../PythonFunctionOverloadAssertions.cs | 20 + src/Analysis/Ast/Test/FunctionTests.cs | 29 + src/Analysis/Ast/Test/LibraryTests.cs | 2 +- src/Analysis/Ast/Test/PepHintTests.cs | 2 +- src/Analysis/Ast/Test/TypingTests.cs | 6 +- .../Interpreter/InterpreterConfiguration.cs | 99 +- .../Impl/Interpreter/PythonLibraryPath.cs | 50 +- .../Core/Impl/Properties/AssemblyInfo.cs | 1 + src/Caching/Impl/Factories/ClassFactory.cs | 8 +- src/Caching/Impl/Factories/FactoryBase.cs | 9 +- src/Caching/Impl/Factories/FunctionFactory.cs | 24 +- src/Caching/Impl/Factories/ModuleFactory.cs | 147 +- src/Caching/Impl/Factories/VariableFactory.cs | 6 +- src/Caching/Impl/Models/ClassModel.cs | 10 +- src/Caching/Impl/Models/FunctionModel.cs | 67 +- src/Caching/Impl/Models/ModuleModel.cs | 48 +- src/Caching/Impl/Models/PropertyModel.cs | 2 +- src/Caching/Impl/Models/VariableModel.cs | 6 +- src/Caching/Impl/ModuleDatabase.cs | 2 +- src/Caching/Impl/ModuleUniqueId.cs | 74 +- src/Caching/Impl/QualifiedNameParts.cs | 36 + src/Caching/Impl/TypeNames.cs | 111 +- src/Caching/Test/AnalysisCachingTestBase.cs | 5 +- src/Caching/Test/ClassesTests.cs | 1 + src/Caching/Test/CoreTests.cs | 65 +- src/Caching/Test/Files/Builtins.json | 59942 ---------------- src/Caching/Test/Files/MemberLocations.json | 79 +- src/Caching/Test/Files/NestedClasses.json | 107 +- src/Caching/Test/Files/Requests.json | 991 - src/Caching/Test/Files/SmokeTest.json | 50 +- src/Caching/Test/Files/Sys.json | 12601 ---- src/Caching/Test/Files/VersionHandling2.json | 123 + src/Caching/Test/Files/VersionHandling3.json | 135 + src/Caching/Test/Files/VersionedModule.json | 44 - src/Caching/Test/LibraryModulesTests.cs | 45 +- src/Caching/Test/ReferencesTests.cs | 4 +- .../Impl/Completion/ExpressionCompletion.cs | 6 +- .../Impl/Implementation/Server.Telemetry.cs | 1 + .../Impl/Implementation/Server.cs | 66 +- .../Indexing/MostRecentDocumentSymbols.cs | 16 +- .../Impl/LanguageServer.Configuration.cs | 4 +- src/LanguageServer/Impl/Protocol/Classes.cs | 2 +- src/LanguageServer/Impl/Resources.Designer.cs | 29 +- src/LanguageServer/Impl/Resources.resx | 9 + .../Impl/Sources/DefinitionSource.cs | 5 +- src/Parsing/Test/PythonInstallPathResolver.cs | 1 - src/Parsing/Test/PythonVersion.cs | 2 - src/Parsing/Test/PythonVersions.cs | 51 +- .../Test/UnixPythonInstallPathResolver.cs | 4 - .../Test/WindowsPythonInstallPathResolver.cs | 34 - 106 files changed, 1955 insertions(+), 74710 deletions(-) create mode 100644 .gitattributes create mode 100644 src/Analysis/Ast/Impl/Extensions/IfStatementExtensions.cs create mode 100644 src/Analysis/Ast/Impl/Extensions/PythonWalkerExtensions.cs create mode 100644 src/Analysis/Ast/Test/BuiltinsTests.cs create mode 100644 src/Caching/Impl/QualifiedNameParts.cs delete mode 100644 src/Caching/Test/Files/Builtins.json delete mode 100644 src/Caching/Test/Files/Requests.json delete mode 100644 src/Caching/Test/Files/Sys.json create mode 100644 src/Caching/Test/Files/VersionHandling2.json create mode 100644 src/Caching/Test/Files/VersionHandling3.json delete mode 100644 src/Caching/Test/Files/VersionedModule.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..587b786e4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.json -diff diff --git a/src/Analysis/Ast/Impl/Analyzer/Definitions/IPythonAnalyzer.cs b/src/Analysis/Ast/Impl/Analyzer/Definitions/IPythonAnalyzer.cs index 970c4bb3f..1e77bcb22 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Definitions/IPythonAnalyzer.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Definitions/IPythonAnalyzer.cs @@ -56,10 +56,11 @@ public interface IPythonAnalyzer { /// IReadOnlyList LintModule(IPythonModule module); + /// - /// Removes all the modules from the analysis, except Typeshed and builtin + /// Removes all the modules from the analysis and restarts it, including stubs. /// - void ResetAnalyzer(); + Task ResetAnalyzer(); /// /// Returns list of currently loaded modules. diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Constants.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Constants.cs index 53376c5a0..52185a35c 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Constants.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Constants.cs @@ -23,7 +23,7 @@ namespace Microsoft.Python.Analysis.Analyzer.Evaluation { internal sealed partial class ExpressionEval { - public IPythonInstance GetConstantFromLiteral(Expression expr, LookupOptions options) { + public IPythonInstance GetConstantFromLiteral(Expression expr) { if (expr is ConstantExpression ce) { switch (ce.Value) { case string s: diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs index 23b6e498c..dceef6fd7 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs @@ -189,7 +189,7 @@ public IMember GetValueFromExpression(Expression expr, LookupOptions options = L m = null; break; default: - m = GetValueFromBinaryOp(expr) ?? GetConstantFromLiteral(expr, options); + m = GetValueFromBinaryOp(expr) ?? GetConstantFromLiteral(expr); break; } if (m == null) { @@ -237,22 +237,12 @@ private IMember GetValueFromMember(MemberExpression expr) { return null; } - IPythonInstance instance = null; var m = GetValueFromExpression(expr.Target); - if (m is IPythonType typeInfo) { - var member = typeInfo.GetMember(expr.Name); - // If container is class/type info rather than the instance, then the method is an unbound function. - // Example: C.f where f is a method of C. Compare to C().f where f is bound to the instance of C. - if (member is PythonFunctionType f && !f.IsStatic && !f.IsClassMethod) { - f.AddReference(GetLocationOfName(expr)); - return f.ToUnbound(); - } - instance = new PythonInstance(typeInfo); + if (m == null) { + return UnknownType; } - instance = instance ?? m as IPythonInstance; - var type = m?.GetPythonType(); // Try inner type - + var type = m.GetPythonType(); var value = type?.GetMember(expr.Name); type?.AddMemberReference(expr.Name, this, GetLocationOfName(expr)); @@ -260,6 +250,19 @@ private IMember GetValueFromMember(MemberExpression expr) { return value; } + IPythonInstance instance = null; + if (m == type) { + // If container is class/type info rather than the instance, then the method is an unbound function. + // Example: C.f where f is a method of C. Compare to C().f where f is bound to the instance of C. + if (value is PythonFunctionType f && f.DeclaringType != null && !f.IsStatic && !f.IsClassMethod) { + f.AddReference(GetLocationOfName(expr)); + return f.ToUnbound(); + } + instance = new PythonInstance(type); + } + + instance = instance ?? m as IPythonInstance; + // Class type GetMember returns a type. However, class members are // mostly instances (consider self.x = 1, x is an instance of int). // However, it is indeed possible to have them as types, like in diff --git a/src/Analysis/Ast/Impl/Analyzer/Handlers/ConditionalHandler.cs b/src/Analysis/Ast/Impl/Analyzer/Handlers/ConditionalHandler.cs index 8720bc8e3..93c82cfd6 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Handlers/ConditionalHandler.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Handlers/ConditionalHandler.cs @@ -13,123 +13,18 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System; -using System.Linq; using Microsoft.Python.Core.OS; -using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Analyzer.Handlers { internal sealed class ConditionalHandler : StatementHandler { private readonly IOSPlatform _platformService; - private enum ConditionTestResult { - Unrecognized, - DontWalkBody, - WalkBody - } - public ConditionalHandler(AnalysisWalker walker) : base(walker) { _platformService = Eval.Services.GetService(); } - public bool HandleIf(IfStatement node) { - // System version, platform and os.path specializations - var someRecognized = false; - foreach (var test in node.Tests) { - var result = TryHandleSysVersionInfo(test); - if (result != ConditionTestResult.Unrecognized) { - if (result == ConditionTestResult.WalkBody) { - test.Walk(Walker); - } - someRecognized = true; - continue; - } - - result = TryHandleSysPlatform(test); - if (result != ConditionTestResult.Unrecognized) { - if (result == ConditionTestResult.WalkBody) { - test.Walk(Walker); - } - someRecognized = true; - continue; - } - - result = TryHandleOsPath(test); - if (result != ConditionTestResult.Unrecognized) { - if (result == ConditionTestResult.WalkBody) { - test.Walk(Walker); - return false; // Execute only one condition. - } - someRecognized = true; - } - } - return !someRecognized; - } - - private ConditionTestResult TryHandleSysVersionInfo(IfStatementTest test) { - if (test.Test is BinaryExpression cmp && - cmp.Left is MemberExpression me && (me.Target as NameExpression)?.Name == "sys" && me.Name == "version_info" && - cmp.Right is TupleExpression te && te.Items.All(i => (i as ConstantExpression)?.Value is int)) { - Version v; - try { - v = new Version( - (int)((te.Items.ElementAtOrDefault(0) as ConstantExpression)?.Value ?? 0), - (int)((te.Items.ElementAtOrDefault(1) as ConstantExpression)?.Value ?? 0) - ); - } catch (ArgumentException) { - // Unsupported comparison, so walk all children - return ConditionTestResult.WalkBody; - } - - var shouldWalk = false; - switch (cmp.Operator) { - case PythonOperator.LessThan: - shouldWalk = Ast.LanguageVersion.ToVersion() < v; - break; - case PythonOperator.LessThanOrEqual: - shouldWalk = Ast.LanguageVersion.ToVersion() <= v; - break; - case PythonOperator.GreaterThan: - shouldWalk = Ast.LanguageVersion.ToVersion() > v; - break; - case PythonOperator.GreaterThanOrEqual: - shouldWalk = Ast.LanguageVersion.ToVersion() >= v; - break; - } - return shouldWalk ? ConditionTestResult.WalkBody : ConditionTestResult.DontWalkBody; - } - return ConditionTestResult.Unrecognized; - } - - private ConditionTestResult TryHandleSysPlatform(IfStatementTest test) { - if (test.Test is BinaryExpression cmp && - cmp.Left is MemberExpression me && (me.Target as NameExpression)?.Name == "sys" && me.Name == "platform" && - cmp.Right is ConstantExpression cex && cex.GetStringValue() is string s) { - switch (cmp.Operator) { - case PythonOperator.Equals: - return s == "win32" && _platformService.IsWindows ? ConditionTestResult.WalkBody : ConditionTestResult.DontWalkBody; - case PythonOperator.NotEquals: - return s == "win32" && _platformService.IsWindows ? ConditionTestResult.DontWalkBody : ConditionTestResult.WalkBody; - } - return ConditionTestResult.DontWalkBody; - } - return ConditionTestResult.Unrecognized; - } - - private ConditionTestResult TryHandleOsPath(IfStatementTest test) { - if (test.Test is BinaryExpression cmp && - cmp.Left is ConstantExpression cex && cex.GetStringValue() is string s && - cmp.Right is NameExpression nex && nex.Name == "_names") { - switch (cmp.Operator) { - case PythonOperator.In when s == "nt": - return _platformService.IsWindows ? ConditionTestResult.WalkBody : ConditionTestResult.DontWalkBody; - case PythonOperator.In when s == "posix": - return _platformService.IsWindows ? ConditionTestResult.DontWalkBody : ConditionTestResult.WalkBody; - } - return ConditionTestResult.DontWalkBody; - } - return ConditionTestResult.Unrecognized; - } + public bool HandleIf(IfStatement node) + => node.WalkIfWithSystemConditions(Walker, Ast.LanguageVersion, _platformService.IsWindows); } } diff --git a/src/Analysis/Ast/Impl/Analyzer/LibraryAnalysis.cs b/src/Analysis/Ast/Impl/Analyzer/LibraryAnalysis.cs index bf8f7df93..a68fe2642 100644 --- a/src/Analysis/Ast/Impl/Analyzer/LibraryAnalysis.cs +++ b/src/Analysis/Ast/Impl/Analyzer/LibraryAnalysis.cs @@ -15,12 +15,9 @@ using System.Collections.Generic; using System.Linq; -using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Documents; -using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Values; -using Microsoft.Python.Core; using Microsoft.Python.Core.Diagnostics; using Microsoft.Python.Parsing.Ast; diff --git a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs index 87834d78d..a2c1759b9 100644 --- a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs +++ b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs @@ -16,6 +16,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Xml.Serialization; using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Modules; @@ -227,8 +228,9 @@ private void MergeStub() { if (_stubAnalysis == null) { return; } - - var builtins = Module.Interpreter.ModuleResolution.BuiltinsModule; + // TODO: figure out why module is getting analyzed before stub. + // https://github.com/microsoft/python-language-server/issues/907 + // Debug.Assert(!(_stubAnalysis is EmptyAnalysis)); // Note that scrape can pick up more functions than the stub contains // Or the stub can have definitions that scraping had missed. Therefore @@ -242,57 +244,152 @@ private void MergeStub() { var sourceVar = Eval.GlobalScope.Variables[v.Name]; var sourceType = sourceVar?.Value.GetPythonType(); - + // If stub says 'Any' but we have better type, keep the current type. if (!IsStubBetterType(sourceType, stubType)) { - continue;; + continue; } - // If types are the classes, merge members. - // Otherwise, replace type from one from the stub. - if (sourceType is PythonClassType cls && Module.Equals(cls.DeclaringModule)) { - // If class exists and belongs to this module, add or replace - // its members with ones from the stub, preserving documentation. - // Don't augment types that do not come from this module. - foreach (var name in stubType.GetMemberNames()) { - var stubMember = stubType.GetMember(name); - var member = cls.GetMember(name); - - var memberType = member?.GetPythonType(); - var stubMemberType = stubMember.GetPythonType(); - - if (builtins.Equals(memberType?.DeclaringModule) || builtins.Equals(stubMemberType.DeclaringModule)) { - continue; // Leave builtins alone. + // If type does not exist in module, but exists in stub, declare it unless it is an import. + // If types are the classes, merge members. Otherwise, replace type from one from the stub. + switch (sourceType) { + case null: + // Nothing in sources, but there is type in the stub. Declare it. + if (v.Source == VariableSource.Declaration) { + Eval.DeclareVariable(v.Name, v.Value, v.Source); + } + break; + + case PythonClassType cls when Module.Equals(cls.DeclaringModule): + // Transfer documentation first so we get class documentation + // that came from class definition win over one that may + // come from __init__ during the member merge below. + TransferDocumentationAndLocation(sourceType, stubType); + + // If class exists and belongs to this module, add or replace + // its members with ones from the stub, preserving documentation. + // Don't augment types that do not come from this module. + // Do not replace __class__ since it has to match class type and we are not + // replacing class type, we are only merging members. + foreach (var name in stubType.GetMemberNames().Except(new[] { "__class__", "__base__", "__bases__", "__mro__", "mro" })) { + var stubMember = stubType.GetMember(name); + var member = cls.GetMember(name); + + var memberType = member?.GetPythonType(); + var stubMemberType = stubMember.GetPythonType(); + + if (sourceType.IsBuiltin || stubType.IsBuiltin) { + // If stub type does not have an immediate member such as __init__() and + // rather have it inherited from object, we do not want to use the inherited + // since current class may either have its own of inherits it from the object. + continue; + } + + if (stubMemberType?.MemberType == PythonMemberType.Method && stubMemberType?.DeclaringModule.ModuleType == ModuleType.Builtins) { + // Leave methods coming from object at the object and don't copy them into the derived class. + } + + if (!IsStubBetterType(memberType, stubMemberType)) { + continue; + } + + // Get documentation from the current type, if any, since stubs + // typically do not contain documentation while scraped code does. + TransferDocumentationAndLocation(memberType, stubMemberType); + cls.AddMember(name, stubMember, overwrite: true); } - if (!IsStubBetterType(memberType, stubMemberType)) { - continue; + break; + + case IPythonModule _: + // We do not re-declare modules. + break; + + default: + var stubModule = stubType.DeclaringModule; + if (stubType is IPythonModule || stubModule.ModuleType == ModuleType.Builtins) { + // Modules members that are modules should remain as they are, i.e. os.path + // should remain library with its own stub attached. + break; + } + // We do not re-declaring variables that are imported. + if (v.Source == VariableSource.Declaration) { + // Re-declare variable with the data from the stub. + TransferDocumentationAndLocation(sourceType, stubType); + // TODO: choose best type between the scrape and the stub. Stub probably should always win. + var source = Eval.CurrentScope.Variables[v.Name]?.Source ?? v.Source; + Eval.DeclareVariable(v.Name, v.Value, source); } - // Get documentation from the current type, if any, since stubs - // typically do not contain documentation while scraped code does. - memberType?.TransferDocumentationAndLocation(stubMemberType); - cls.AddMember(name, stubMember, overwrite: true); - } - } else { - // Re-declare variable with the data from the stub unless member is a module. - // Modules members that are modules should remain as they are, i.e. os.path - // should remain library with its own stub attached. - if (!(stubType is IPythonModule) && !builtins.Equals(stubType.DeclaringModule)) { - sourceType.TransferDocumentationAndLocation(stubType); - // TODO: choose best type between the scrape and the stub. Stub probably should always win. - var source = Eval.CurrentScope.Variables[v.Name]?.Source ?? VariableSource.Declaration; - Eval.DeclareVariable(v.Name, v.Value, source); - } + break; } } } private static bool IsStubBetterType(IPythonType sourceType, IPythonType stubType) { - // If stub says 'Any' but we have better type, keep the current type. if (stubType.IsUnknown()) { + // Do not use worse types than what is in the module. + return false; + } + if (sourceType.IsUnknown()) { + return true; // Anything is better than unknowns. + } + if (sourceType.DeclaringModule.ModuleType == ModuleType.Specialized) { + // Types in specialized modules should never be touched. + return false; + } + if (stubType.DeclaringModule is TypingModule && stubType.Name == "Any") { + // If stub says 'Any' but we have better type, keep the current type. return false; } - return sourceType.IsUnknown() || !(stubType.DeclaringModule is TypingModule) || stubType.Name != "Any"; + // Types should be compatible except it is allowed to replace function by a class. + // Consider stub of threading that replaces def RLock(): by class RLock(). + // Similarly, in _json, make_scanner function is replaced by a class. + if (sourceType.MemberType == PythonMemberType.Function && stubType.MemberType == PythonMemberType.Class) { + return true; + } + return sourceType.MemberType == stubType.MemberType; + } + + private static void TransferDocumentationAndLocation(IPythonType s, IPythonType d) { + if (s.IsUnknown() || d.IsBuiltin || s.IsBuiltin) { + return; // Do not transfer location of unknowns or builtins + } + // Documentation and location are always get transferred from module type + // to the stub type and never the other way around. This makes sure that + // we show documentation from the original module and goto definition + // navigates to the module source and not to the stub. + if (s != d && s is PythonType src && d is PythonType dst) { + // If type is a class, then doc can either come from class definition node of from __init__. + // If class has doc from the class definition, don't stomp on it. + var transferDoc = true; + if (src is PythonClassType srcClass && dst is PythonClassType dstClass) { + // Higher lever source wins + if(srcClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Class || + (srcClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Init && dstClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Base)) { + dstClass.SetDocumentation(srcClass.Documentation); + transferDoc = false; + } + } + + // Sometimes destination (stub type) already has documentation. This happens when stub type + // is used to augment more than one type. For example, in threading module RLock stub class + // replaces both RLock function and _RLock class making 'factory' function RLock to look + // like a class constructor. Effectively a single stub type is used for more than one type + // in the source and two source types may have different documentation. Thus transferring doc + // from one source type affects documentation of another type. It may be better to clone stub + // type and separate instances for separate source type, but for now we'll just avoid stomping + // on the existing documentation. + if (transferDoc && string.IsNullOrEmpty(dst.Documentation)) { + var srcDocumentation = src.Documentation; + if (!string.IsNullOrEmpty(srcDocumentation)) { + dst.SetDocumentation(srcDocumentation); + } + } + + if (src.Location.IsValid) { + dst.Location = src.Location; + } + } } } } diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs index c5d207f2a..7bae2ca29 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs @@ -17,7 +17,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis.Caching; @@ -49,6 +48,7 @@ public sealed class PythonAnalyzer : IPythonAnalyzer, IDisposable { private int _version; private PythonAnalyzerSession _currentSession; private PythonAnalyzerSession _nextSession; + private bool _forceGCOnNextSession; public PythonAnalyzer(IServiceManager services, string cacheFolderPath = null) { _services = services; @@ -198,9 +198,18 @@ public IReadOnlyList LintModule(IPythonModule module) { return optionsProvider?.Options?.LintingEnabled == false ? Array.Empty() : result; } - public void ResetAnalyzer() { + public async Task ResetAnalyzer() { + var interpreter = _services.GetService(); + var builtins = interpreter.ModuleResolution.BuiltinsModule; + builtins.SetAst(builtins.Analysis.Ast); + + await interpreter.TypeshedResolution.ReloadAsync(); + await interpreter.ModuleResolution.ReloadAsync(); + lock (_syncObj) { - _analysisEntries.Split(kvp => kvp.Key.IsTypeshed || kvp.Value.Module is IBuiltinsPythonModule, out var entriesToPreserve, out var entriesToRemove); + _forceGCOnNextSession = true; + + _analysisEntries.Split(kvp => kvp.Value.Module is IBuiltinsPythonModule, out var entriesToPreserve, out var entriesToRemove); _analysisEntries.Clear(); foreach (var (key, entry) in entriesToPreserve) { _analysisEntries.Add(key, entry); @@ -208,6 +217,8 @@ public void ResetAnalyzer() { _dependencyResolver.RemoveKeys(entriesToRemove.Select(e => e.Key)); } + + _services.GetService().ReloadAll(); } public IReadOnlyList LoadedModules { @@ -220,7 +231,7 @@ public IReadOnlyList LoadedModules { public event EventHandler AnalysisComplete; - internal void RaiseAnalysisComplete(int moduleCount, double msElapsed) + internal void RaiseAnalysisComplete(int moduleCount, double msElapsed) => AnalysisComplete?.Invoke(this, new AnalysisCompleteEventArgs(moduleCount, msElapsed)); private void AnalyzeDocument(in AnalysisModuleKey key, in PythonAnalyzerEntry entry, in ImmutableArray dependencies) { @@ -243,7 +254,7 @@ private void AnalyzeDocument(in AnalysisModuleKey key, in PythonAnalyzerEntry en session.Start(true); } } - + private bool TryCreateSession(in int graphVersion, in PythonAnalyzerEntry entry, out PythonAnalyzerSession session) { var analyzeUserModuleOutOfOrder = false; lock (_syncObj) { @@ -278,7 +289,7 @@ private bool TryCreateSession(in int graphVersion, in PythonAnalyzerEntry entry, session = null; return false; } - + if (_currentSession.IsCompleted) { _currentSession = session = CreateSession(walker, null); return true; @@ -303,14 +314,21 @@ private void StartNextSession(Task task) { session.Start(false); } - private PythonAnalyzerSession CreateSession(in IDependencyChainWalker walker, in PythonAnalyzerEntry entry) - => new PythonAnalyzerSession(_services, _progress, _analysisCompleteEvent, _startNextSession, _disposeToken.CancellationToken, walker, _version, entry); + private PythonAnalyzerSession CreateSession(in IDependencyChainWalker walker, in PythonAnalyzerEntry entry) { + bool forceGC; + lock (_syncObj) { + forceGC = _forceGCOnNextSession; + _forceGCOnNextSession = false; + } + + return new PythonAnalyzerSession(_services, _progress, _analysisCompleteEvent, _startNextSession, _disposeToken.CancellationToken, walker, _version, entry, forceGC: forceGC); + } private void LoadMissingDocuments(IPythonInterpreter interpreter, ImmutableArray missingKeys) { if (missingKeys.Count == 0) { return; } - + var foundKeys = ImmutableArray.Empty; foreach (var missingKey in missingKeys) { lock (_syncObj) { diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index 753a3ef92..7fdfeaa76 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -46,7 +46,7 @@ internal sealed class PythonAnalyzerSession { private readonly IProgressReporter _progress; private readonly IPythonAnalyzer _analyzer; private readonly ILogger _log; - private readonly ITelemetryService _telemetry; + private readonly bool _forceGC; private readonly IModuleDatabaseService _moduleDatabaseService; private State _state; @@ -71,7 +71,8 @@ public PythonAnalyzerSession(IServiceManager services, CancellationToken analyzerCancellationToken, IDependencyChainWalker walker, int version, - PythonAnalyzerEntry entry) { + PythonAnalyzerEntry entry, + bool forceGC = false) { _services = services; _analysisCompleteEvent = analysisCompleteEvent; @@ -82,11 +83,11 @@ public PythonAnalyzerSession(IServiceManager services, _walker = walker; _entry = entry; _state = State.NotStarted; + _forceGC = forceGC; _diagnosticsService = _services.GetService(); _analyzer = _services.GetService(); _log = _services.GetService(); - _telemetry = _services.GetService(); _moduleDatabaseService = _services.GetService(); _progress = progress; } @@ -161,11 +162,12 @@ private async Task StartAsync() { var elapsed = stopWatch.Elapsed.TotalMilliseconds; LogResults(_log, elapsed, originalRemaining, remaining, Version); - ForceGCIfNeeded(originalRemaining, remaining); + ForceGCIfNeeded(_log, originalRemaining, remaining, _forceGC); } - private static void ForceGCIfNeeded(int originalRemaining, int remaining) { - if (originalRemaining - remaining > 1000) { + private static void ForceGCIfNeeded(ILogger logger, int originalRemaining, int remaining, bool force) { + if (force || originalRemaining - remaining > 1000) { + logger?.Log(TraceEventType.Verbose, "Forcing full garbage collection and heap compaction."); GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; GC.Collect(); } @@ -232,7 +234,7 @@ private async Task AnalyzeAffectedEntriesAsync(Stopwatch stopWatch) { } - private bool IsAnalyzedLibraryInLoop(IDependencyChainNode node) + private bool IsAnalyzedLibraryInLoop(IDependencyChainNode node) => !node.HasMissingDependencies && node.Value.IsAnalyzedLibrary(_walker.Version) && node.IsWalkedWithDependencies && node.IsValidVersion; private Task StartAnalysis(IDependencyChainNode node, AsyncCountdownEvent ace, Stopwatch stopWatch) @@ -370,10 +372,26 @@ private void LogException(IPythonModule module, Exception exception) { } private IDocumentAnalysis CreateAnalysis(IDependencyChainNode node, IDocument document, PythonAst ast, int version, ModuleWalker walker, bool isCanceled) { + var canHaveLibraryAnalysis = false; + var saveAnalysis = false; + // Don't try to drop builtins; it causes issues elsewhere. + // We probably want the builtin module's AST and other info for evaluation. + switch (document.ModuleType) { + case ModuleType.Library: + case ModuleType.Compiled: + case ModuleType.CompiledBuiltin: + canHaveLibraryAnalysis = true; + saveAnalysis = true; + break; + case ModuleType.Stub: + canHaveLibraryAnalysis = true; + break; + } + var createLibraryAnalysis = !isCanceled && node != null && !node.HasMissingDependencies && - document.ModuleType == ModuleType.Library && + canHaveLibraryAnalysis && !document.IsOpen && node.HasOnlyWalkedDependencies && node.IsValidVersion; @@ -388,7 +406,10 @@ private IDocumentAnalysis CreateAnalysis(IDependencyChainNode(); - if (Module.ModuleType != ModuleType.User && optionsProvider?.Options.KeepLibraryLocalVariables != true) { + if (Module.ModuleType != ModuleType.User && + optionsProvider?.Options.KeepLibraryLocalVariables != true && + Eval.CurrentScope.Variables.All( + v => v.GetPythonType() == null && + v.GetPythonType() == null) + ) { ((VariableCollection)Eval.CurrentScope.Variables).Clear(); } } @@ -79,6 +85,7 @@ private IPythonType TryDetermineReturnValue() { if (!annotationType.IsUnknown()) { // Annotations are typically types while actually functions return // instances unless specifically annotated to a type such as Type[T]. + // TODO: try constructing argument set from types. Consider Tuple[_T1, _T2] where _T1 = TypeVar('_T1', str, bytes) var t = annotationType.CreateInstance(annotationType.Name, ArgumentSet.WithoutContext); // If instance could not be created, such as when return type is List[T] and // type of T is not yet known, just use the type. @@ -119,8 +126,8 @@ public override bool Walk(ReturnStatement node) { var value = Eval.GetValueFromExpression(node.Expression); if (value != null) { // although technically legal, __init__ in a constructor should not have a not-none return value - if (FunctionDefinition.Name.EqualsOrdinal("__init__") && _function.DeclaringType.MemberType == PythonMemberType.Class - && !value.IsOfType(BuiltinTypeId.NoneType)) { + if (FunctionDefinition.Name.EqualsOrdinal("__init__") && _function.DeclaringType.MemberType == PythonMemberType.Class + && !value.IsOfType(BuiltinTypeId.NoneType)) { Eval.ReportDiagnostics(Module.Uri, new Diagnostics.DiagnosticsEntry( Resources.ReturnInInit, diff --git a/src/Analysis/Ast/Impl/Analyzer/Symbols/SymbolCollector.cs b/src/Analysis/Ast/Impl/Analyzer/Symbols/SymbolCollector.cs index a3f489cf7..cf49cc3ee 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Symbols/SymbolCollector.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Symbols/SymbolCollector.cs @@ -15,12 +15,13 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Analyzer.Evaluation; -using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +using Microsoft.Python.Core.OS; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Analyzer.Symbols { @@ -29,7 +30,7 @@ namespace Microsoft.Python.Analysis.Analyzer.Symbols { /// so the symbol table can resolve references on demand. /// internal sealed class SymbolCollector : PythonWalker { - private readonly Dictionary _typeMap = new Dictionary(); + private readonly Dictionary _typeMap = new Dictionary(); private readonly Stack _scopes = new Stack(); private readonly ModuleSymbolTable _table; private readonly ExpressionEval _eval; @@ -46,6 +47,9 @@ private SymbolCollector(ModuleSymbolTable table, ExpressionEval eval) { private void Walk() => _eval.Ast.Walk(this); + public override bool Walk(IfStatement node) + => node.WalkIfWithSystemConditions(this, _eval.Ast.LanguageVersion, _eval.Services.GetService().IsWindows); + public override bool Walk(ClassDefinition cd) { if (IsDeprecated(cd)) { return false; @@ -90,9 +94,16 @@ public override void PostWalk(FunctionDefinition fd) { } private PythonClassType CreateClass(ClassDefinition cd) { - var cls = new PythonClassType(cd, _eval.GetLocationOfName(cd), + PythonType declaringType = null; + if(!(cd.Parent is PythonAst)) { + Debug.Assert(_typeMap.ContainsKey(cd.Parent)); + _typeMap.TryGetValue(cd.Parent, out declaringType); + } + var cls = new PythonClassType(cd, declaringType, _eval.GetLocationOfName(cd), _eval.SuppressBuiltinLookup ? BuiltinTypeId.Unknown : BuiltinTypeId.Type); _typeMap[cd] = cls; + + declaringType?.AddMember(cls.Name, cls, overwrite: true); return cls; } @@ -104,14 +115,16 @@ private void AddFunctionOrProperty(FunctionDefinition fd) { } } - private void AddFunction(FunctionDefinition fd, IPythonType declaringType) { - if (!(_eval.LookupNameInScopes(fd.Name, LookupOptions.Local) is PythonFunctionType existing)) { - existing = new PythonFunctionType(fd, declaringType, _eval.GetLocationOfName(fd)); + private void AddFunction(FunctionDefinition fd, PythonType declaringType) { + if (!(_eval.LookupNameInScopes(fd.Name, LookupOptions.Local) is PythonFunctionType f)) { + f = new PythonFunctionType(fd, declaringType, _eval.GetLocationOfName(fd)); // The variable is transient (non-user declared) hence it does not have location. // Function type is tracking locations for references and renaming. - _eval.DeclareVariable(fd.Name, existing, VariableSource.Declaration); + _eval.DeclareVariable(fd.Name, f, VariableSource.Declaration); + _typeMap[fd] = f; + declaringType?.AddMember(f.Name, f, overwrite: true); } - AddOverload(fd, existing, o => existing.AddOverload(o)); + AddOverload(fd, f, o => f.AddOverload(o)); } private void AddOverload(FunctionDefinition fd, IPythonClassMember function, Action addOverload) { @@ -149,7 +162,7 @@ private PythonFunctionOverload GetOverloadFromStub(FunctionDefinition node) { return null; } - private bool TryAddProperty(FunctionDefinition node, IPythonType declaringType) { + private bool TryAddProperty(FunctionDefinition node, PythonType declaringType) { var dec = node.Decorators?.Decorators; var decorators = dec != null ? dec.ExcludeDefault().ToArray() : Array.Empty(); @@ -166,14 +179,16 @@ private bool TryAddProperty(FunctionDefinition node, IPythonType declaringType) return false; } - private void AddProperty(FunctionDefinition fd, IPythonType declaringType, bool isAbstract) { - if (!(_eval.LookupNameInScopes(fd.Name, LookupOptions.Local) is PythonPropertyType existing)) { - existing = new PythonPropertyType(fd, _eval.GetLocationOfName(fd), declaringType, isAbstract); + private void AddProperty(FunctionDefinition fd, PythonType declaringType, bool isAbstract) { + if (!(_eval.LookupNameInScopes(fd.Name, LookupOptions.Local) is PythonPropertyType p)) { + p = new PythonPropertyType(fd, _eval.GetLocationOfName(fd), declaringType, isAbstract); // The variable is transient (non-user declared) hence it does not have location. // Property type is tracking locations for references and renaming. - _eval.DeclareVariable(fd.Name, existing, VariableSource.Declaration); + _eval.DeclareVariable(fd.Name, p, VariableSource.Declaration); + _typeMap[fd] = p; + declaringType?.AddMember(p.Name, p, overwrite: true); } - AddOverload(fd, existing, o => existing.AddOverload(o)); + AddOverload(fd, p, o => p.AddOverload(o)); } private IMember GetMemberFromStub(string name) { diff --git a/src/Analysis/Ast/Impl/Documents/Definitions/IRunningDocumentTable.cs b/src/Analysis/Ast/Impl/Documents/Definitions/IRunningDocumentTable.cs index 442327bd8..b1e9dcaef 100644 --- a/src/Analysis/Ast/Impl/Documents/Definitions/IRunningDocumentTable.cs +++ b/src/Analysis/Ast/Impl/Documents/Definitions/IRunningDocumentTable.cs @@ -90,5 +90,10 @@ public interface IRunningDocumentTable { /// Fires when document is removed. /// event EventHandler Removed; + + /// + /// Gets the number of documents in the table. + /// + int DocumentCount { get; } } } diff --git a/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs b/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs index cb99f182d..34e017efc 100644 --- a/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs +++ b/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs @@ -69,6 +69,14 @@ public IEnumerable GetDocuments() { } } + public int DocumentCount { + get { + lock (_lock) { + return _documentsByUri.Count; + } + } + } + /// /// Adds file to the list of available documents. /// diff --git a/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs b/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs index 56b3d745a..ef999a511 100644 --- a/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs @@ -64,7 +64,7 @@ internal static void DeclareParametersInScope(this IArgumentSet args, Expression } if (args.ListArgument != null && !string.IsNullOrEmpty(args.ListArgument.Name)) { - var type = new PythonCollectionType(null, BuiltinTypeId.List, eval.BuiltinsModule, false); + var type = new PythonCollectionType(BuiltinTypeId.List, eval.BuiltinsModule, false); var list = new PythonCollection(type, args.ListArgument.Values); eval.DeclareVariable(args.ListArgument.Name, list, VariableSource.Declaration, args.ListArgument.Location); } diff --git a/src/Analysis/Ast/Impl/Extensions/IfStatementExtensions.cs b/src/Analysis/Ast/Impl/Extensions/IfStatementExtensions.cs new file mode 100644 index 000000000..43a8e6869 --- /dev/null +++ b/src/Analysis/Ast/Impl/Extensions/IfStatementExtensions.cs @@ -0,0 +1,94 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Linq; +using Microsoft.Python.Parsing; +using Microsoft.Python.Parsing.Ast; + +namespace Microsoft.Python.Analysis { + public enum ConditionTestResult { + Unrecognized, + DontWalkBody, + WalkBody + } + + public static class IfStatementExtensions { + public static ConditionTestResult TryHandleSysVersionInfo(this IfStatementTest test, PythonLanguageVersion languageVersion) { + if (test.Test is BinaryExpression cmp && + cmp.Left is MemberExpression me && (me.Target as NameExpression)?.Name == "sys" && me.Name == "version_info" && + cmp.Right is TupleExpression te && te.Items.All(i => (i as ConstantExpression)?.Value is int)) { + Version v; + try { + v = new Version( + (int)((te.Items.ElementAtOrDefault(0) as ConstantExpression)?.Value ?? 0), + (int)((te.Items.ElementAtOrDefault(1) as ConstantExpression)?.Value ?? 0) + ); + } catch (ArgumentException) { + // Unsupported comparison, so walk all children + return ConditionTestResult.WalkBody; + } + + var shouldWalk = false; + switch (cmp.Operator) { + case PythonOperator.LessThan: + shouldWalk = languageVersion.ToVersion() < v; + break; + case PythonOperator.LessThanOrEqual: + shouldWalk = languageVersion.ToVersion() <= v; + break; + case PythonOperator.GreaterThan: + shouldWalk = languageVersion.ToVersion() > v; + break; + case PythonOperator.GreaterThanOrEqual: + shouldWalk = languageVersion.ToVersion() >= v; + break; + } + return shouldWalk ? ConditionTestResult.WalkBody : ConditionTestResult.DontWalkBody; + } + return ConditionTestResult.Unrecognized; + } + + public static ConditionTestResult TryHandleSysPlatform(this IfStatementTest test, bool isWindows) { + if (test.Test is BinaryExpression cmp && + cmp.Left is MemberExpression me && (me.Target as NameExpression)?.Name == "sys" && me.Name == "platform" && + cmp.Right is ConstantExpression cex && cex.GetStringValue() is string s) { + switch (cmp.Operator) { + case PythonOperator.Equals: + return s == "win32" && isWindows ? ConditionTestResult.WalkBody : ConditionTestResult.DontWalkBody; + case PythonOperator.NotEquals: + return s == "win32" && isWindows ? ConditionTestResult.DontWalkBody : ConditionTestResult.WalkBody; + } + return ConditionTestResult.DontWalkBody; + } + return ConditionTestResult.Unrecognized; + } + + public static ConditionTestResult TryHandleOsPath(this IfStatementTest test, bool isWindows) { + if (test.Test is BinaryExpression cmp && + cmp.Left is ConstantExpression cex && cex.GetStringValue() is string s && + cmp.Right is NameExpression nex && nex.Name == "_names") { + switch (cmp.Operator) { + case PythonOperator.In when s == "nt": + return isWindows ? ConditionTestResult.WalkBody : ConditionTestResult.DontWalkBody; + case PythonOperator.In when s == "posix": + return isWindows ? ConditionTestResult.DontWalkBody : ConditionTestResult.WalkBody; + } + return ConditionTestResult.DontWalkBody; + } + return ConditionTestResult.Unrecognized; + } + } +} diff --git a/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs index a53be479c..4c6ec4e7f 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs @@ -15,18 +15,21 @@ using System.Collections.Generic; using System.Linq; +using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; namespace Microsoft.Python.Analysis { public static class PythonFunctionExtensions { - public static bool IsUnbound(this IPythonFunctionType f) + public static bool IsUnbound(this IPythonFunctionType f) => f.DeclaringType != null && f.MemberType == PythonMemberType.Function; - public static bool IsBound(this IPythonFunctionType f) + public static bool IsBound(this IPythonFunctionType f) => f.DeclaringType != null && f.MemberType == PythonMemberType.Method; + public static bool IsLambda(this IPythonFunctionType f) => f.Name == ""; + public static bool HasClassFirstArgument(this IPythonClassMember m) => (m is IPythonFunctionType f && !f.IsStatic && (f.IsClassMethod || f.IsBound())) || (m is IPythonPropertyType prop); @@ -42,7 +45,9 @@ public static string GetQualifiedName(this IPythonClassMember cm) { for (var p = cm.DeclaringType as IPythonClassMember; p != null; p = p.DeclaringType as IPythonClassMember) { s.Push(p.Name); } - return $"{cm.DeclaringModule.Name}:{string.Join(".", s)}"; + return cm.DeclaringModule.ModuleType == ModuleType.Builtins + ? string.Join(".", s) + : $"{cm.DeclaringModule.Name}:{string.Join(".", s)}"; } } } diff --git a/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs index 1e87eb99a..2e948660b 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs @@ -13,7 +13,6 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System.Diagnostics; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core; @@ -29,20 +28,12 @@ public static bool IsGenericParameter(this IPythonType value) public static bool IsGeneric(this IPythonType value) => value is IGenericTypeDefinition || value is IGenericType || (value is IPythonClassType c && c.IsGeneric()); - public static void TransferDocumentationAndLocation(this IPythonType s, IPythonType d) { - if (s != d && s is PythonType src && d is PythonType dst) { - var documentation = src.Documentation; - if (!string.IsNullOrEmpty(documentation)) { - dst.SetDocumentation(documentation); - } - - dst.Location = src.Location; - } - } - public static bool IsConstructor(this IPythonClassMember m) => m.Name.EqualsOrdinal("__init__") || m.Name.EqualsOrdinal("__new__"); public static string GetQualifiedName(this IPythonType t) => $"{t.DeclaringModule.Name}:{t.Name}"; + + internal static IPythonType ToBound(this IPythonType t) => t is PythonFunctionType.PythonUnboundMethod m ? m.Function : t; + } } diff --git a/src/Analysis/Ast/Impl/Extensions/PythonWalkerExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonWalkerExtensions.cs new file mode 100644 index 000000000..affefbf2d --- /dev/null +++ b/src/Analysis/Ast/Impl/Extensions/PythonWalkerExtensions.cs @@ -0,0 +1,61 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using Microsoft.Python.Parsing; +using Microsoft.Python.Parsing.Ast; + +namespace Microsoft.Python.Analysis { + public static class PythonWalkerExtensions { + public static bool WalkIfWithSystemConditions(this IfStatement node, PythonWalker walker, PythonLanguageVersion languageVersion, bool isWindows) { + // System version, platform and os.path specializations + var executeElse = false; + foreach (var test in node.Tests) { + + var result = test.TryHandleSysVersionInfo(languageVersion); + if (result == ConditionTestResult.Unrecognized) { + result = test.TryHandleSysPlatform(isWindows); + if (result == ConditionTestResult.Unrecognized) { + result = test.TryHandleOsPath(isWindows); + } + } + + // If condition is satisfied, walk the corresponding block and + // return false indicating that statement should not be walked again. + // If condition is false or was not recognized, continue but remember + // if we need to execute final else clause. + switch (result) { + case ConditionTestResult.WalkBody: + test.Walk(walker); + return false; // We only need to execute one of the clauses. + case ConditionTestResult.DontWalkBody: + // If condition is false, continue but remember + // if we may need to execute the final else clause. + executeElse = true; + break; + case ConditionTestResult.Unrecognized: + continue; // See if other conditions may work. + } + } + + if (executeElse) { + node.ElseStatement?.Walk(walker); + return false; + } + + // We didn't walk anything, so me caller do their own thing. + return true; + } + } +} diff --git a/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj b/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj index 8f4bbee5a..7d7bacfec 100644 --- a/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj +++ b/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj @@ -38,6 +38,7 @@ + diff --git a/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs b/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs index 84833d141..703d8be8c 100644 --- a/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs +++ b/src/Analysis/Ast/Impl/Modules/Definitions/IModuleManagement.cs @@ -14,9 +14,7 @@ // permissions and limitations under the License. using System; -using System.Collections; using System.Collections.Generic; -using System.Threading; using Microsoft.Python.Analysis.Caching; using Microsoft.Python.Analysis.Core.Interpreter; using Microsoft.Python.Analysis.Types; @@ -33,8 +31,6 @@ public interface IModuleManagement: IModuleResolution { /// ModulePath FindModule(string filePath); - IReadOnlyCollection GetPackagesFromDirectory(string searchPath, CancellationToken cancellationToken = default); - /// /// Cache of module stubs generated from compiled modules. /// @@ -50,8 +46,9 @@ public interface IModuleManagement: IModuleResolution { /// /// Module to specialize. /// Specialized module constructor. - /// Original (library) module loaded as stub, if any. - IPythonModule SpecializeModule(string fullName, Func specializationConstructor); + /// Replace existing loaded module, if any. + /// Specialized module. + IPythonModule SpecializeModule(string fullName, Func specializationConstructor, bool replaceExisting = false); /// /// Returns specialized module, if any. Will attempt to load module from persistent state. @@ -72,5 +69,10 @@ public interface IModuleManagement: IModuleResolution { /// Set of interpreter paths. /// IEnumerable InterpreterPaths { get; } + + /// + /// Interpreter paths with additional classification. + /// + IReadOnlyList LibraryPaths { get; } } } diff --git a/src/Analysis/Ast/Impl/Modules/Definitions/ModuleCreationOptions.cs b/src/Analysis/Ast/Impl/Modules/Definitions/ModuleCreationOptions.cs index b49e555dc..f9c1dc9aa 100644 --- a/src/Analysis/Ast/Impl/Modules/Definitions/ModuleCreationOptions.cs +++ b/src/Analysis/Ast/Impl/Modules/Definitions/ModuleCreationOptions.cs @@ -14,6 +14,7 @@ // permissions and limitations under the License. using System; +using Microsoft.Python.Analysis.Core.Interpreter; using Microsoft.Python.Analysis.Types; namespace Microsoft.Python.Analysis.Modules { diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.cs index cc1980873..c9c0b4576 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.cs @@ -22,6 +22,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Core.Interpreter; using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Specializations.Typing; @@ -103,8 +104,10 @@ internal PythonModule(ModuleCreationOptions creationOptions, IServiceContainer s if (uri == null && !string.IsNullOrEmpty(creationOptions.FilePath)) { Uri.TryCreate(creationOptions.FilePath, UriKind.Absolute, out uri); } + Uri = uri; FilePath = creationOptions.FilePath ?? uri?.LocalPath; + Stub = creationOptions.Stub; if (Stub is PythonModule stub && ModuleType != ModuleType.Stub) { stub.PrimaryModule = this; @@ -113,6 +116,7 @@ internal PythonModule(ModuleCreationOptions creationOptions, IServiceContainer s if (ModuleType == ModuleType.Specialized || ModuleType == ModuleType.Unresolved) { ContentState = State.Analyzed; } + InitializeContent(creationOptions.Content, 0); } @@ -164,8 +168,20 @@ public virtual IEnumerable GetMemberNames() { if (valueType is PythonModule) { return false; // Do not re-export modules. } - // Do not re-export types from typing - return !(valueType?.DeclaringModule is TypingModule) || this is TypingModule; + if(valueType is IPythonFunctionType f && f.IsLambda()) { + return false; + } + if (this is TypingModule) { + return true; // Let typing module behave normally. + } + // Do not re-export types from typing. However, do export variables + // assigned with types from typing. Example: + // from typing import Any # do NOT export Any + // x = Union[int, str] # DO export x + if(valueType?.DeclaringModule is TypingModule && v.Name == valueType.Name) { + return false; + } + return true; }) .Select(v => v.Name); } diff --git a/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs b/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs index 74efc4f56..e28964258 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs @@ -16,6 +16,9 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Python.Analysis.Core.Interpreter; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs index d5a500c3f..f428b6774 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs @@ -44,6 +44,8 @@ internal sealed class MainModuleResolution : ModuleResolutionBase, IModuleManage public MainModuleResolution(string root, IServiceContainer services) : base(root, services) { } + public IReadOnlyList LibraryPaths { get; private set; } = Array.Empty(); + internal IBuiltinsPythonModule CreateBuiltinsModule() { if (BuiltinsModule == null) { // Initialize built-in @@ -150,25 +152,37 @@ private async Task> GetInterpreterSearchPathsAs /// /// Module to specialize. /// Specialized module constructor. - /// Original (library) module loaded as stub. - public IPythonModule SpecializeModule(string name, Func specializationConstructor) { + /// Replace existing loaded module, if any. + /// Specialized module. + public IPythonModule SpecializeModule(string name, Func specializationConstructor, bool replaceExisting = false) { var import = CurrentPathResolver.GetModuleImportFromModuleName(name); var module = specializationConstructor(import?.ModulePath); _specialized[name] = module; + + if (replaceExisting) { + Modules.TryRemove(name, out _); + } return module; } /// /// Returns specialized module, if any. /// - public IPythonModule GetSpecializedModule(string fullName, bool allowCreation = false, string modulePath = null) + public IPythonModule GetSpecializedModule(string fullName, bool allowCreation = false, string modulePath = null) => _specialized.TryGetValue(fullName, out var module) ? module : null; /// /// Determines of module is specialized or exists in the database. /// - public bool IsSpecializedModule(string fullName, string modulePath = null) - => _specialized.ContainsKey(fullName) || GetDbService()?.ModuleExistsInStorage(fullName, modulePath) == true; + public bool IsSpecializedModule(string fullName, string modulePath = null) { + if (_specialized.ContainsKey(fullName)) { + return true; + } + if (modulePath != null && Path.GetExtension(modulePath) == ".pyi") { + return false; + } + return GetDbService()?.ModuleExistsInStorage(fullName, modulePath) == true; + } internal async Task LoadBuiltinTypesAsync(CancellationToken cancellationToken = default) { var analyzer = _services.GetService(); @@ -186,10 +200,8 @@ internal async Task LoadBuiltinTypesAsync(CancellationToken cancellationToken = } internal async Task ReloadSearchPaths(CancellationToken cancellationToken = default) { - var ps = _services.GetService(); - - var paths = await GetInterpreterSearchPathsAsync(cancellationToken); - var (interpreterPaths, userPaths) = PythonLibraryPath.ClassifyPaths(Root, _fs, paths, Configuration.SearchPaths); + LibraryPaths = await GetInterpreterSearchPathsAsync(cancellationToken); + var (interpreterPaths, userPaths) = PythonLibraryPath.ClassifyPaths(Root, _fs, LibraryPaths, Configuration.SearchPaths); InterpreterPaths = interpreterPaths.Select(p => p.Path); _userPaths = userPaths.Select(p => p.Path); diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs b/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs index a9e699d11..a9060889f 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs @@ -56,7 +56,6 @@ protected ModuleResolutionBase(string root, IServiceContainer services) { public string Root { get; protected set; } public IEnumerable InterpreterPaths { get; protected set; } = Enumerable.Empty(); - public IModuleCache ModuleCache { get; protected set; } public string BuiltinModuleName => BuiltinTypeId.Unknown.GetModuleName(_interpreter.LanguageVersion); /// diff --git a/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs b/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs index 3b98a971e..7815fe4a8 100644 --- a/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs +++ b/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs @@ -30,7 +30,8 @@ public static IMember Identity(IPythonModule module, IPythonFunctionOverload ove public static IMember TypeInfo(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { var args = argSet.Values(); - return args.Count > 0 ? args[0].GetPythonType() : module.Interpreter.GetBuiltinType(BuiltinTypeId.Type); + var t = args.Count > 0 ? args[0].GetPythonType() : module.Interpreter.GetBuiltinType(BuiltinTypeId.Type); + return t.ToBound(); } public static IMember Iterator(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { @@ -78,7 +79,7 @@ public static IMember __iter__(IPythonInterpreter interpreter, BuiltinTypeId con public static IMember Range(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { var args = argSet.Values(); if (args.Count > 0) { - var type = new PythonCollectionType(null, BuiltinTypeId.List, module.Interpreter.ModuleResolution.BuiltinsModule, false); + var type = new PythonCollectionType(BuiltinTypeId.List, module.Interpreter.ModuleResolution.BuiltinsModule, false); return new PythonCollection(type, new[] { args[0] }); } return null; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/AnyType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/AnyType.cs index 25b1eb39d..73eef02f4 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/AnyType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/AnyType.cs @@ -24,7 +24,7 @@ public AnyType(IPythonModule declaringModule) : base(declaringModule) { } public override PythonMemberType MemberType => PythonMemberType.Class; public string Name => "Any"; - public string QualifiedName => this.GetQualifiedName(); + public string QualifiedName => "typing:Any"; public BuiltinTypeId TypeId => BuiltinTypeId.Type; public string Documentation => Name; public bool IsBuiltin => false; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs index 6c2bfea26..b86688150 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs @@ -14,6 +14,7 @@ // permissions and limitations under the License. using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using Microsoft.Python.Analysis.Types; @@ -32,7 +33,7 @@ internal class GenericType : LocatedMember, IGenericType { /// Constructs generic type with generic type parameters. Typically used /// in generic classes such as when handling Generic[_T] base. /// - public GenericType(string name, IReadOnlyList parameters, IPythonModule declaringModule) + public GenericType(string name, IReadOnlyList parameters, IPythonModule declaringModule) : this(name, declaringModule) { Parameters = parameters ?? throw new ArgumentNullException(nameof(parameters)); } @@ -90,7 +91,7 @@ public IPythonType CreateSpecificType(IReadOnlyList typeArguments) public bool IsSpecialized => true; public IMember CreateInstance(string typeName, IArgumentSet args) { - var types = args.Values(); + var types = GetTypesFromValues(args.Arguments); if (types.Count != args.Arguments.Count) { throw new ArgumentException(@"Generic type instance construction arguments must be all of IPythonType", nameof(args)); } @@ -104,7 +105,7 @@ public IMember CreateInstance(string typeName, IArgumentSet args) { public virtual IMember Index(IPythonInstance instance, IArgumentSet args) => DeclaringModule.Interpreter.UnknownType; public IPythonType CreateSpecificType(IArgumentSet typeArguments) - => CreateSpecificType(typeArguments.Arguments.Select(a => a.Value).OfType().ToArray()); + => CreateSpecificType(GetTypesFromValues(typeArguments.Arguments)); #endregion public override bool Equals(object other) { @@ -119,5 +120,8 @@ public override bool Equals(object other) { public override int GetHashCode() => TypeId != BuiltinTypeId.Unknown ? TypeId.GetHashCode() : base.GetHashCode(); + + private IReadOnlyList GetTypesFromValues(IEnumerable args) + => args.Select(a => a.Value).OfType().Select(m => m.GetPythonType()).ToArray(); } } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/NamedTupleType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/NamedTupleType.cs index 2343bec6b..cfad82980 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/NamedTupleType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/NamedTupleType.cs @@ -27,20 +27,25 @@ internal sealed class NamedTupleType : TypingTupleType, ITypingNamedTupleType { /// /// Creates type info for a strongly-typed tuple, such as Tuple[T1, T2, ...]. /// - public NamedTupleType(string tupleName, IReadOnlyList itemNames, IReadOnlyList itemTypes, IPythonInterpreter interpreter) - : base(itemTypes, interpreter) { + public NamedTupleType(string tupleName, IReadOnlyList itemNames, IReadOnlyList itemTypes, IPythonModule declaringModule, IPythonInterpreter interpreter) + : base(itemTypes, declaringModule, interpreter) { TupleName = tupleName ?? throw new ArgumentNullException(nameof(tupleName)); ItemNames = itemNames; var typeNames = itemTypes.Select(t => t.IsUnknown() ? string.Empty : t.Name); var pairs = itemNames.Zip(typeNames, (name, typeName) => string.IsNullOrEmpty(typeName) ? name : $"{name}: {typeName}"); Name = CodeFormatter.FormatSequence(tupleName, '(', pairs); + + typeNames = itemTypes.Select(t => t.IsUnknown() ? string.Empty : t.QualifiedName); + pairs = itemNames.Zip(typeNames, (name, typeName) => string.IsNullOrEmpty(typeName) ? name : $"{name}: {typeName}"); + QualifiedName = CodeFormatter.FormatSequence($"{declaringModule.Name}:{tupleName}", '(', pairs); } public string TupleName { get; } public IReadOnlyList ItemNames { get; } public override string Name { get; } + public override string QualifiedName { get; } public override bool IsSpecialized => true; public override IMember CreateInstance(string typeName, IArgumentSet args) => new TypingTuple(this); diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/OptionalType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/OptionalType.cs index a4ba593a8..0c89c3a7a 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/OptionalType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/OptionalType.cs @@ -22,8 +22,10 @@ namespace Microsoft.Python.Analysis.Specializations.Typing.Types { internal sealed class OptionalType : PythonTypeWrapper, IPythonUnionType { public OptionalType(IPythonModule declaringModule, IPythonType type) : base(type, declaringModule) { Name = $"Optional[{type.Name}]"; + QualifiedName = $"typing:Optional[{type.QualifiedName}]"; } public override string Name { get; } + public override string QualifiedName { get; } public override PythonMemberType MemberType => PythonMemberType.Union; public override bool IsSpecialized => true; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypeAlias.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypeAlias.cs index ffcbde6a1..67d93be1c 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypeAlias.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypeAlias.cs @@ -21,6 +21,7 @@ public TypeAlias(string name, IPythonType type) : base(type) { Name = name; } public override string Name { get; } + public override string QualifiedName => $"typing:{Name}"; public override bool IsSpecialized => true; } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingDictionaryType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingDictionaryType.cs index 23f84f589..6f0e55bd4 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingDictionaryType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingDictionaryType.cs @@ -38,6 +38,7 @@ public TypingDictionaryType(string name, IPythonType keyType, IPythonType valueT KeyType = keyType; ValueType = valueType; Name = $"{name}[{keyType.Name}, {valueType.Name}]"; + QualifiedName = $"typing:{name}[{keyType.QualifiedName}, {valueType.QualifiedName}]"; } public IPythonType KeyType { get; } @@ -45,13 +46,14 @@ public TypingDictionaryType(string name, IPythonType keyType, IPythonType valueT public IPythonType ItemType => _itemType ?? (_itemType = CreateItemType()); public override string Name { get; } + public override string QualifiedName { get; } public override IMember CreateInstance(string typeName, IArgumentSet args) => new TypingDictionary(this); public override IMember Index(IPythonInstance instance, IArgumentSet args) => new PythonInstance(ValueType); public override bool IsSpecialized => true; private TypingTupleType CreateItemType() { - var itemType = new TypingTupleType(new[] { KeyType, ValueType }, DeclaringModule.Interpreter); + var itemType = new TypingTupleType(new[] { KeyType, ValueType }, DeclaringModule, DeclaringModule.Interpreter); return itemType; } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingIteratorType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingIteratorType.cs index fa721e862..1b4fa245f 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingIteratorType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingIteratorType.cs @@ -34,6 +34,7 @@ public TypingIteratorType(IPythonType itemType, BuiltinTypeId iteratorType, IPyt ItemTypes = new[] { itemType }; Repeat = true; Name = $"Iterator[{itemType.Name}]"; + QualifiedName = $"typing:Iterator[{itemType.QualifiedName}]"; } /// @@ -44,11 +45,13 @@ public TypingIteratorType(IReadOnlyList itemTypes, BuiltinTypeId it : base(iteratorType, interpreter.ModuleResolution.GetSpecializedModule("typing")) { ItemTypes = itemTypes; Name = $"Iterator[{CodeFormatter.FormatSequence(string.Empty, '(', itemTypes)}]"; + QualifiedName = $"typing:Iterator[{CodeFormatter.FormatSequence(string.Empty, '(', itemTypes.Select(t => t.QualifiedName))}]"; } public IReadOnlyList ItemTypes { get; } public bool Repeat { get; } public override string Name { get; } + public override string QualifiedName { get; } public override bool IsSpecialized => true; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingListType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingListType.cs index 778e2d6ec..2c1d3ba27 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingListType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingListType.cs @@ -41,12 +41,14 @@ public TypingListType(string typeName, IPythonType itemType, IPythonInterpreter /// Tells of list represents a mutable collection. /// If true, type will append item type names to the base type name. public TypingListType(string typeName, BuiltinTypeId typeId, IPythonType itemType, IPythonInterpreter interpreter, bool isMutable, bool formatName = true) - : base(null, typeId, interpreter.ModuleResolution.GetSpecializedModule("typing"), isMutable) { + : base(typeId, interpreter.ModuleResolution.GetSpecializedModule("typing"), isMutable) { ItemType = itemType; Name = formatName ? $"{typeName}[{itemType.Name}]" : typeName; + QualifiedName = formatName ? $"typing:{typeName}[{itemType.QualifiedName}]" : $"typing:{typeName}"; } public override string Name { get; } + public override string QualifiedName { get; } public override bool IsAbstract => false; public override bool IsSpecialized => true; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs index 690c85d6b..97efe1431 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs @@ -14,6 +14,7 @@ // permissions and limitations under the License. using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Specializations.Typing.Values; using Microsoft.Python.Analysis.Types; @@ -28,16 +29,20 @@ internal class TypingTupleType : PythonCollectionType, ITypingTupleType { /// Creates type info for a strongly-typed tuple, such as Tuple[T1, T2, ...]. /// /// Tuple item types. + /// Declaring module. If null, then 'typing' is assumed. /// Python interpreter. - public TypingTupleType(IReadOnlyList itemTypes, IPythonInterpreter interpreter) - : base(null, BuiltinTypeId.Tuple, interpreter.ModuleResolution.GetSpecializedModule("typing"), false) { - ItemTypes = itemTypes; + public TypingTupleType(IReadOnlyList itemTypes, IPythonModule declaringModule, IPythonInterpreter interpreter) + : base(BuiltinTypeId.Tuple, declaringModule ?? interpreter.ModuleResolution.GetSpecializedModule("typing"), false) { + ItemTypes = itemTypes.Count > 0 ? itemTypes : new[] { interpreter.UnknownType }; Name = CodeFormatter.FormatSequence("Tuple", '[', itemTypes); + QualifiedName = CodeFormatter.FormatSequence("typing:Tuple", '[', itemTypes.Select(t => t.QualifiedName)); } public IReadOnlyList ItemTypes { get; } public override string Name { get; } + public override string QualifiedName { get; } + public override bool IsAbstract => false; public override bool IsSpecialized => true; @@ -73,7 +78,7 @@ public override bool Equals(object obj) { return true; } - public override int GetHashCode() + public override int GetHashCode() => ItemTypes.Aggregate(0, (current, item) => current ^ item.GetHashCode()) ^ Name.GetHashCode(); } } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs b/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs index 9964e3d66..d0a3b18b7 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs @@ -60,8 +60,8 @@ private void SpecializeMembers() { // When called, create generic parameter type. For documentation // use original TypeVar declaration so it appear as a tooltip. - o.SetReturnValueProvider((interpreter, overload, args) - => GenericTypeParameter.FromTypeVar(args, interpreter)); + o.SetReturnValueProvider((declaringModule, overload, args) + => GenericTypeParameter.FromTypeVar(args, declaringModule)); fn.AddOverload(o); _members["TypeVar"] = fn; @@ -71,7 +71,7 @@ private void SpecializeMembers() { o = new PythonFunctionOverload(fn.Name, location); // When called, create generic parameter type. For documentation // use original TypeVar declaration so it appear as a tooltip. - o.SetReturnValueProvider((interpreter, overload, args) => CreateTypeAlias(args)); + o.SetReturnValueProvider((declaringModule, overload, args) => CreateTypeAlias(args)); fn.AddOverload(o); _members["NewType"] = fn; @@ -80,7 +80,7 @@ private void SpecializeMembers() { o = new PythonFunctionOverload(fn.Name, location); // When called, create generic parameter type. For documentation // use original TypeVar declaration so it appear as a tooltip. - o.SetReturnValueProvider((interpreter, overload, args) => { + o.SetReturnValueProvider((declaringModule, overload, args) => { var a = args.Values(); return a.Count == 1 ? a[0] : Interpreter.UnknownType; }); @@ -136,12 +136,11 @@ private void SpecializeMembers() { fn = PythonFunctionType.Specialize("NamedTuple", this, GetMemberDocumentation("NamedTuple")); o = new PythonFunctionOverload(fn.Name, location); - o.SetReturnValueProvider((interpreter, overload, args) => CreateNamedTuple(args.Values())); + o.SetReturnValueProvider((declaringModule, overload, args) => CreateNamedTuple(args.Values(), declaringModule)); fn.AddOverload(o); _members["NamedTuple"] = fn; _members["Any"] = new AnyType(this); - _members["AnyStr"] = CreateAnyStr(); _members["Optional"] = new GenericType("Optional", CreateOptional, this); @@ -241,8 +240,8 @@ private IPythonType CreateTypeAlias(IArgumentSet args) { eval.ReportDiagnostics( eval.Module?.Uri, - new DiagnosticsEntry(Resources.NewTypeFirstArgNotString.FormatInvariant(firstArgType), - expression?.GetLocation(eval)?.Span ?? default, + new DiagnosticsEntry(Resources.NewTypeFirstArgNotString.FormatInvariant(firstArgType), + expression?.GetLocation(eval)?.Span ?? default, Diagnostics.ErrorCodes.TypingNewTypeArguments, Severity.Warning, DiagnosticSource.Analysis) ); @@ -259,7 +258,7 @@ private IPythonType CreateUnion(IReadOnlyList typeArgs) { return Interpreter.UnknownType; } - private IPythonType CreateNamedTuple(IReadOnlyList typeArgs) { + private IPythonType CreateNamedTuple(IReadOnlyList typeArgs, IPythonModule declaringModule) { if (typeArgs.Count != 2) { // TODO: report wrong number of arguments return Interpreter.UnknownType; @@ -304,7 +303,7 @@ private IPythonType CreateNamedTuple(IReadOnlyList typeArgs) { itemNames.Add(itemName2); itemTypes.Add(c.Contents[1].GetPythonType()); } - return TypingTypeFactory.CreateNamedTupleType(Interpreter, tupleName, itemNames, itemTypes); + return TypingTypeFactory.CreateNamedTupleType(Interpreter, tupleName, itemNames, itemTypes, declaringModule); } private IPythonType CreateOptional(IReadOnlyList typeArgs) { @@ -327,15 +326,14 @@ private IPythonType CreateAnyStr() { var str = Interpreter.GetBuiltinType(BuiltinTypeId.Str); var bytes = Interpreter.GetBuiltinType(BuiltinTypeId.Bytes); var unicode = Interpreter.GetBuiltinType(BuiltinTypeId.Unicode); - var name = "AnyStr"; var constraints = Interpreter.LanguageVersion.Is3x() - ? new IPythonType[] { str, bytes } - : new IPythonType[] { str, unicode }; - var docArgs = new[] { $"'{name}'" }.Concat(constraints.Select(c => c.Name)); - var documentation = CodeFormatter.FormatSequence("TypeVar", '(', docArgs); + ? new[] { str, bytes } + : new[] { str, unicode }; + var docArgs = new[] { "'AnyStr'" }.Concat(constraints.Select(c => c.Name)); - return new GenericTypeParameter(name, this, constraints, documentation, default); + var documentation = CodeFormatter.FormatSequence("TypeVar", '(', docArgs); + return new PythonTypeWrapper("AnyStr", documentation, this, Interpreter.GetBuiltinType(BuiltinTypeId.Str)); } private IPythonType CreateGenericClassParameter(IReadOnlyList typeArgs) { diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/TypingTypeFactory.cs b/src/Analysis/Ast/Impl/Specializations/Typing/TypingTypeFactory.cs index afed8ded6..540615aac 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/TypingTypeFactory.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/TypingTypeFactory.cs @@ -26,7 +26,7 @@ public static ITypingListType CreateListType(IPythonInterpreter interpreter, str => new TypingListType(typeName, typeId, itemType, interpreter, isMutable); public static ITypingTupleType CreateTupleType(IPythonInterpreter interpreter, IReadOnlyList types) - => new TypingTupleType(types, interpreter); + => new TypingTupleType(types, null, interpreter); public static ITypingIteratorType CreateIteratorType(IPythonInterpreter interpreter, IPythonType itemType) => new TypingIteratorType(itemType, BuiltinTypeId.ListIterator, interpreter); @@ -55,8 +55,8 @@ public static ITypingListType CreateItemsViewType(IPythonInterpreter interpreter public static IPythonType CreateUnionType(IPythonInterpreter interpreter, IReadOnlyList types, IPythonModule declaringModule) => new PythonUnionType(types.Select(a => a.GetPythonType()), declaringModule); - public static ITypingNamedTupleType CreateNamedTupleType(IPythonInterpreter interpreter, string tupleName, IReadOnlyList itemNames, IReadOnlyList itemTypes) - => new NamedTupleType(tupleName, itemNames, itemTypes, interpreter); + public static ITypingNamedTupleType CreateNamedTupleType(IPythonInterpreter interpreter, string tupleName, IReadOnlyList itemNames, IReadOnlyList itemTypes, IPythonModule declaringModule) + => new NamedTupleType(tupleName, itemNames, itemTypes, declaringModule, interpreter); public static IPythonType CreateOptionalType(IPythonModule declaringModule, IPythonType type) => new OptionalType(declaringModule, type); diff --git a/src/Analysis/Ast/Impl/Types/ArgumentSet.cs b/src/Analysis/Ast/Impl/Types/ArgumentSet.cs index e84c4a165..ae1f9fe39 100644 --- a/src/Analysis/Ast/Impl/Types/ArgumentSet.cs +++ b/src/Analysis/Ast/Impl/Types/ArgumentSet.cs @@ -17,7 +17,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Runtime.CompilerServices; using Microsoft.Python.Analysis.Analyzer; using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Values; diff --git a/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs b/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs index 00cdef76e..e8e6f598f 100644 --- a/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs +++ b/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs @@ -25,22 +25,17 @@ namespace Microsoft.Python.Analysis.Types.Collections { /// Type info for an iterable entity. Most base collection class. /// internal class PythonCollectionType : PythonTypeWrapper, IPythonCollectionType { - private string _typeName; - /// /// Creates type info for an collection. /// - /// Iterable type name. If null, name of the type id will be used. /// Collection type id, such as . /// Declaring module. /// Indicates if collection is mutable (like list) or immutable (like tuple). public PythonCollectionType( - string typeName, BuiltinTypeId collectionTypeId, IPythonModule declaringModule, bool isMutable ) : base(collectionTypeId, declaringModule) { - _typeName = typeName; TypeId = collectionTypeId; IteratorType = new PythonIteratorType(collectionTypeId.GetIteratorTypeId(), declaringModule); IsMutable = isMutable; @@ -56,18 +51,6 @@ bool isMutable #endregion #region IPythonType - public override string Name { - get { - if (_typeName == null) { - var type = DeclaringModule.Interpreter.GetBuiltinType(TypeId); - if (!type.IsUnknown()) { - _typeName = type.Name; - } - } - return _typeName ?? ""; ; - } - } - public override BuiltinTypeId TypeId { get; } public override PythonMemberType MemberType => PythonMemberType.Class; public override IMember GetMember(string name) => name == @"__iter__" ? IteratorType : base.GetMember(name); @@ -98,7 +81,7 @@ public static IPythonCollection CreateList(IPythonModule declaringModule, IArgum } public static IPythonCollection CreateList(IPythonModule declaringModule, IReadOnlyList contents, bool flatten = true, bool exact = false) { - var collectionType = new PythonCollectionType(null, BuiltinTypeId.List, declaringModule, true); + var collectionType = new PythonCollectionType(BuiltinTypeId.List, declaringModule, true); return new PythonCollection(collectionType, contents, flatten, exact: exact); } @@ -109,7 +92,7 @@ public static IPythonCollection CreateConcatenatedList(IPythonModule declaringMo } public static IPythonCollection CreateTuple(IPythonModule declaringModule, IReadOnlyList contents, bool exact = false) { - var collectionType = new PythonCollectionType(null, BuiltinTypeId.Tuple, declaringModule, false); + var collectionType = new PythonCollectionType(BuiltinTypeId.Tuple, declaringModule, false); return new PythonCollection(collectionType, contents, exact: exact); } @@ -120,7 +103,7 @@ public static IPythonCollection CreateConcatenatedTuple(IPythonModule declaringM } public static IPythonCollection CreateSet(IPythonModule declaringModule, IReadOnlyList contents, bool flatten = true, bool exact = false) { - var collectionType = new PythonCollectionType(null, BuiltinTypeId.Set, declaringModule, true); + var collectionType = new PythonCollectionType(BuiltinTypeId.Set, declaringModule, true); return new PythonCollection(collectionType, contents, flatten, exact: exact); } diff --git a/src/Analysis/Ast/Impl/Types/Collections/PythonDictionaryType.cs b/src/Analysis/Ast/Impl/Types/Collections/PythonDictionaryType.cs index 855339441..a4835deec 100644 --- a/src/Analysis/Ast/Impl/Types/Collections/PythonDictionaryType.cs +++ b/src/Analysis/Ast/Impl/Types/Collections/PythonDictionaryType.cs @@ -20,7 +20,7 @@ namespace Microsoft.Python.Analysis.Types.Collections { internal class PythonDictionaryType : PythonCollectionType { public PythonDictionaryType(IPythonModule declaringModule, bool isMutable = true) - : base(null, BuiltinTypeId.Dict, declaringModule, isMutable) { + : base(BuiltinTypeId.Dict, declaringModule, isMutable) { } public override IMember CreateInstance(string typeName, IArgumentSet args) { diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs b/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs index 852860bef..aa42faee9 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs +++ b/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs @@ -20,7 +20,7 @@ namespace Microsoft.Python.Analysis.Types { /// /// Represents Python class type definition. /// - public interface IPythonClassType : IPythonType { + public interface IPythonClassType : IPythonClassMember { /// /// Class definition node in the AST. /// diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IPythonFunctionOverload.cs b/src/Analysis/Ast/Impl/Types/Definitions/IPythonFunctionOverload.cs index f71505cb8..2f8706a8e 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IPythonFunctionOverload.cs +++ b/src/Analysis/Ast/Impl/Types/Definitions/IPythonFunctionOverload.cs @@ -53,7 +53,6 @@ public interface IPythonFunctionOverload { /// Call arguments or type arguments. /// Invoking class instance. In case of generics it is instance of the specific type /// as opposed to declaring type which is the generic template class. - /// Call expression location, if any. IMember Call(IArgumentSet args, IPythonType self); /// diff --git a/src/Analysis/Ast/Impl/Types/LocatedMember.cs b/src/Analysis/Ast/Impl/Types/LocatedMember.cs index 36899d865..2a70b4004 100644 --- a/src/Analysis/Ast/Impl/Types/LocatedMember.cs +++ b/src/Analysis/Ast/Impl/Types/LocatedMember.cs @@ -54,6 +54,9 @@ public virtual IReadOnlyList References { public virtual void AddReference(Location location) { lock (this) { + if(this.DeclaringModule == null || this.DeclaringModule?.ModuleType == ModuleType.Builtins) { + return; + } // Don't add references to library code. if (location.Module?.ModuleType == ModuleType.User && !location.Equals(Location)) { _references = _references ?? new HashSet(); diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.cs index eae622a9c..a00dd76df 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.cs @@ -17,8 +17,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using Microsoft.Python.Analysis.Analyzer; -using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types.Collections; @@ -33,8 +31,15 @@ namespace Microsoft.Python.Analysis.Types { [DebuggerDisplay("Class {Name}")] internal class PythonClassType : PythonType, IPythonClassType, IPythonTemplateType, IEquatable { + internal enum ClassDocumentationSource { + Class, + Init, + Base + } + private static readonly string[] _classMethods = { "mro", "__dict__", @"__weakref__" }; + private readonly object _specificTypeLock = new object(); private Dictionary _specificTypeCache; private IPythonClassType _processing; private List _bases; @@ -50,15 +55,18 @@ internal PythonClassType(string name, Location location) public PythonClassType( ClassDefinition classDefinition, + IPythonType declaringType, Location location, BuiltinTypeId builtinTypeId = BuiltinTypeId.Type ) : base(classDefinition.Name, location, classDefinition.GetDocumentation(), builtinTypeId) { Check.ArgumentNotNull(nameof(location), location.Module); location.Module.AddAstNode(this, classDefinition); + DeclaringType = declaringType; } #region IPythonType public override PythonMemberType MemberType => PythonMemberType.Class; + public IPythonType DeclaringType { get; } public override IEnumerable GetMemberNames() { var names = new HashSet(); @@ -114,11 +122,14 @@ public override string Documentation { try { // Try doc from the type first (class definition AST node). _documentation = base.Documentation; + DocumentationSource = ClassDocumentationSource.Class; + if (string.IsNullOrEmpty(_documentation)) { // If not present, try docs __init__. IPythonFunctionType handles // __init__ in a special way so there is no danger of call coming // back here and causing stack overflow. _documentation = (GetMember("__init__") as IPythonFunctionType)?.Documentation; + DocumentationSource = ClassDocumentationSource.Init; } if (string.IsNullOrEmpty(_documentation) && Bases != null) { @@ -126,6 +137,7 @@ public override string Documentation { var o = DeclaringModule.Interpreter.GetBuiltinType(BuiltinTypeId.Object); _documentation = Bases.FirstOrDefault(b => b != o && !string.IsNullOrEmpty(b?.Documentation)) ?.Documentation; + DocumentationSource = ClassDocumentationSource.Base; } } finally { Pop(); @@ -189,6 +201,9 @@ public IReadOnlyDictionary GenericParameters => _genericParameters ?? EmptyDictionary.Instance; #endregion + internal ClassDocumentationSource DocumentationSource { get; private set; } + internal override void SetDocumentation(string documentation) => _documentation = documentation; + internal void SetBases(IEnumerable bases) { if (_bases != null) { return; // Already set @@ -290,144 +305,146 @@ public bool Equals(IPythonClassType other) => Name == other?.Name && DeclaringModule.Equals(other?.DeclaringModule); public IPythonType CreateSpecificType(IArgumentSet args) { - // Get declared generic parameters of the class, i.e. list of Ts in Generic[T1, T2, ...] - var genericClassParameters = Bases.OfType().ToArray(); - // Optimistically use the first one - // TODO: handle optional generics as class A(Generic[_T1], Optional[Generic[_T2]]) - var genericClassParameter = genericClassParameters.FirstOrDefault(); - - // Create map of names listed in Generic[...] in the class definition. - // We will be filling the map with specific types, if any provided. - var genericTypeDefinitions = genericClassParameter?.TypeDefinitions ?? Array.Empty(); - var genericClassTypeParameters = genericTypeDefinitions.ToDictionary(td => td.Name, td => td); - - var specificClassTypeParameters = new Dictionary(); - var newBases = new List(); - - // Arguments passed are those of __init__ or it is a copy constructor. - // They do not necessarily match all of the declared generic parameters. - // Some generic parameters may be used to specify method return types or - // method arguments and do not appear in the constructor argument list. - // Figure out whatever specific types we can from the arguments. - foreach (var arg in args.Arguments) { - // The argument may either match generic type definition of be a specific type - // created off generic type. Consider '__init__(self, v: _T)' and - // 'class A(Generic[K, V], Mapping[K, V])'. - if (arg.Type is IGenericTypeDefinition argTypeDefinition) { - // Parameter is annotated as generic type definition. Check if its generic type - // name matches any of the generic class parameters. I.e. if there is - // an argument like 'v: _T' we need to check if class has matching Generic[_T]. - if (genericClassTypeParameters.ContainsKey(argTypeDefinition.Name)) { - // TODO: Check if specific type matches generic type definition constraints and report mismatches. - // Assign specific type. - if (arg.Value is IMember m && m.GetPythonType() is IPythonType pt) { - specificClassTypeParameters[argTypeDefinition.Name] = pt; + lock (_specificTypeLock) { + // Get declared generic parameters of the class, i.e. list of Ts in Generic[T1, T2, ...] + var genericClassParameters = Bases.OfType().ToArray(); + // Optimistically use the first one + // TODO: handle optional generics as class A(Generic[_T1], Optional[Generic[_T2]]) + var genericClassParameter = genericClassParameters.FirstOrDefault(); + + // Create map of names listed in Generic[...] in the class definition. + // We will be filling the map with specific types, if any provided. + var genericTypeDefinitions = genericClassParameter?.TypeDefinitions ?? Array.Empty(); + var genericClassTypeParameters = genericTypeDefinitions.ToDictionary(td => td.Name, td => td); + + var specificClassTypeParameters = new Dictionary(); + var newBases = new List(); + + // Arguments passed are those of __init__ or it is a copy constructor. + // They do not necessarily match all of the declared generic parameters. + // Some generic parameters may be used to specify method return types or + // method arguments and do not appear in the constructor argument list. + // Figure out whatever specific types we can from the arguments. + foreach (var arg in args.Arguments) { + // The argument may either match generic type definition of be a specific type + // created off generic type. Consider '__init__(self, v: _T)' and + // 'class A(Generic[K, V], Mapping[K, V])'. + if (arg.Type is IGenericTypeDefinition argTypeDefinition) { + // Parameter is annotated as generic type definition. Check if its generic type + // name matches any of the generic class parameters. I.e. if there is + // an argument like 'v: _T' we need to check if class has matching Generic[_T]. + if (genericClassTypeParameters.ContainsKey(argTypeDefinition.Name)) { + // TODO: Check if specific type matches generic type definition constraints and report mismatches. + // Assign specific type. + if (arg.Value is IMember m && m.GetPythonType() is IPythonType pt) { + specificClassTypeParameters[argTypeDefinition.Name] = pt; + } else { + // TODO: report supplied parameter is not a type. + } } else { - // TODO: report supplied parameter is not a type. + // TODO: report generic parameter name mismatch. } - } else { - // TODO: report generic parameter name mismatch. - } - continue; - } - - if (arg.Value is IMember member && !member.GetPythonType().IsUnknown()) { - var type = member.GetPythonType(); - // Type may be a specific type created off generic or just a type - // for the copy constructor. Consider 'class A(Generic[K, V], Mapping[K, V])' - // constructed as 'd = {1:'a', 2:'b'}; A(d)'. Here we look through bases - // and see if any matches the builtin type id. For example, Mapping or Dict - // will have BultinTypeId.Dict and we can figure out specific types from - // the content of the collection. - var b = _bases.OfType().FirstOrDefault(x => x.TypeId == type.TypeId); - if (b != null && b.Parameters.Count > 0) { - newBases.Add(type); - // Optimistically assign argument types if they match. - // Handle common cases directly. - GetSpecificTypeFromArgumentValue(b, arg.Value, specificClassTypeParameters); continue; } - // Any regular base match? - if (_bases.Any(x => x.TypeId == type.TypeId) && !type.Equals(this)) { - newBases.Add(type); + if (arg.Value is IMember member && !member.GetPythonType().IsUnknown()) { + var type = member.GetPythonType(); + // Type may be a specific type created off generic or just a type + // for the copy constructor. Consider 'class A(Generic[K, V], Mapping[K, V])' + // constructed as 'd = {1:'a', 2:'b'}; A(d)'. Here we look through bases + // and see if any matches the builtin type id. For example, Mapping or Dict + // will have BultinTypeId.Dict and we can figure out specific types from + // the content of the collection. + var b = _bases.OfType().FirstOrDefault(x => x.TypeId == type.TypeId); + if (b != null && b.Parameters.Count > 0) { + newBases.Add(type); + // Optimistically assign argument types if they match. + // Handle common cases directly. + GetSpecificTypeFromArgumentValue(b, arg.Value, specificClassTypeParameters); + continue; + } + + // Any regular base match? + if (_bases.Any(x => x.TypeId == type.TypeId) && !type.Equals(this)) { + newBases.Add(type); + } } } - } - // For still undefined parameters try matching passed types in order - for (int i = 0, gtIndex = 0; i < args.Arguments.Count; i++) { - var arg = args.Arguments[i]; - if (Equals(arg.Type)) { - continue; // Typically 'self'. - } + // For still undefined parameters try matching passed types in order + for (int i = 0, gtIndex = 0; i < args.Arguments.Count; i++) { + var arg = args.Arguments[i]; + if (Equals(arg.Type)) { + continue; // Typically 'self'. + } - if (arg.Value is IMember member) { - var type = member.GetPythonType(); - if (!type.IsUnknown()) { - var gtd = gtIndex < genericTypeDefinitions.Count ? genericTypeDefinitions[gtIndex] : null; - if (gtd != null && !specificClassTypeParameters.ContainsKey(gtd.Name)) { - specificClassTypeParameters[gtd.Name] = type; + if (arg.Value is IMember member) { + var type = member.GetPythonType(); + if (!type.IsUnknown()) { + var gtd = gtIndex < genericTypeDefinitions.Count ? genericTypeDefinitions[gtIndex] : null; + if (gtd != null && !specificClassTypeParameters.ContainsKey(gtd.Name)) { + specificClassTypeParameters[gtd.Name] = type; + } + gtIndex++; } - gtIndex++; } } - } - // Define specific type in the original order - var specificTypes = genericTypeDefinitions - .Select(p => specificClassTypeParameters.TryGetValue(p.Name, out var v) ? v : null) - .ExcludeDefault() - .ToArray(); + // Define specific type in the original order + var specificTypes = genericTypeDefinitions + .Select(p => specificClassTypeParameters.TryGetValue(p.Name, out var v) ? v : null) + .ExcludeDefault() + .ToArray(); - var specificName = CodeFormatter.FormatSequence(Name, '[', specificTypes); - _specificTypeCache = _specificTypeCache ?? new Dictionary(); - if (_specificTypeCache.TryGetValue(specificName, out var classType)) { - return classType; - } - _specificTypeCache[specificName] = classType = new PythonClassType(specificName, new Location(DeclaringModule)); + var specificName = CodeFormatter.FormatSequence(Name, '[', specificTypes); + _specificTypeCache = _specificTypeCache ?? new Dictionary(); + if (_specificTypeCache.TryGetValue(specificName, out var classType)) { + return classType; + } + _specificTypeCache[specificName] = classType = new PythonClassType(specificName, new Location(DeclaringModule)); - // Methods returning generic types need to know how to match generic - // parameter name to the actual supplied type. - StoreGenericParameters(classType, genericTypeDefinitions.ToArray(), specificTypes); + // Methods returning generic types need to know how to match generic + // parameter name to the actual supplied type. + StoreGenericParameters(classType, genericTypeDefinitions.ToArray(), specificTypes); - // Prevent reentrancy when resolving generic class where - // method may be returning instance of type of the same class. - if (!Push(classType)) { - return _processing; - } + // Prevent reentrancy when resolving generic class where + // method may be returning instance of type of the same class. + if (!Push(classType)) { + return _processing; + } - try { - // Create specific bases since we may have generic types there. - // Match generic parameter names to base type parameter names. - // Consider 'class A(Generic[T], B[T], C[E]): ...' - var genericTypeBases = Bases.Except(genericClassParameters).OfType().ToArray(); - // Start with regular types, then add specific types for all generic types. - var bases = Bases.Except(genericTypeBases).Except(genericClassParameters).ToList(); - - // Create specific types for generic type bases - // it for generic types but not Generic[T, ...] itself. - foreach (var gt in genericTypeBases) { - var st = gt.Parameters - .Select(p => classType.GenericParameters.TryGetValue(p.Name, out var t) ? t : null) - .Where(p => !p.IsUnknown()) - .ToArray(); - if (st.Length > 0) { - var type = gt.CreateSpecificType(new ArgumentSet(st, args.Expression, args.Eval)); - if (!type.IsUnknown()) { - bases.Add(type); + try { + // Create specific bases since we may have generic types there. + // Match generic parameter names to base type parameter names. + // Consider 'class A(Generic[T], B[T], C[E]): ...' + var genericTypeBases = Bases.Except(genericClassParameters).OfType().ToArray(); + // Start with regular types, then add specific types for all generic types. + var bases = Bases.Except(genericTypeBases).Except(genericClassParameters).ToList(); + + // Create specific types for generic type bases + // it for generic types but not Generic[T, ...] itself. + foreach (var gt in genericTypeBases) { + var st = gt.Parameters + .Select(p => classType.GenericParameters.TryGetValue(p.Name, out var t) ? t : null) + .Where(p => !p.IsUnknown()) + .ToArray(); + if (st.Length > 0) { + var type = gt.CreateSpecificType(new ArgumentSet(st, args.Expression, args.Eval)); + if (!type.IsUnknown()) { + bases.Add(type); + } } } - } - // Set specific class bases - classType.SetBases(bases.Concat(newBases)); - // Transfer members from generic to specific type. - SetClassMembers(classType, args); - } finally { - Pop(); + // Set specific class bases + classType.SetBases(bases.Concat(newBases)); + // Transfer members from generic to specific type. + SetClassMembers(classType, args); + } finally { + Pop(); + } + return classType; } - return classType; } private void StoreGenericParameters(PythonClassType classType, IGenericTypeDefinition[] genericParameters, IPythonType[] specificTypes) { diff --git a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs index d1c5033fb..48e7d161a 100644 --- a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs +++ b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs @@ -116,7 +116,7 @@ public string GetReturnDocumentation(IPythonType self = null) { public IMember Call(IArgumentSet args, IPythonType self) { if (!_fromAnnotation) { // First try supplied specialization callback. - var rt = _returnValueProvider?.Invoke(DeclaringModule, this, args); + var rt = _returnValueProvider?.Invoke(args.Eval.Module, this, args); if (!rt.IsUnknown()) { return rt; } diff --git a/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs b/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs index a0f6079e2..03150f13f 100644 --- a/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonFunctionType.cs @@ -16,6 +16,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; using Microsoft.Python.Core.Collections; @@ -51,7 +52,7 @@ public PythonFunctionType( Location location, IPythonType declaringType, string documentation - ) : base(name, location, documentation, declaringType != null ? BuiltinTypeId.Method : BuiltinTypeId.Function) { + ) : base(name, location, documentation, declaringType is IPythonClassType ? BuiltinTypeId.Method : BuiltinTypeId.Function) { DeclaringType = declaringType; } @@ -61,8 +62,13 @@ public PythonFunctionType( Location location ) : base(fd.Name, location, fd.Name == "__init__" ? (declaringType?.Documentation ?? fd.GetDocumentation()) : fd.GetDocumentation(), - declaringType != null ? BuiltinTypeId.Method : BuiltinTypeId.Function) { + declaringType is IPythonClassType ? BuiltinTypeId.Method : BuiltinTypeId.Function) { DeclaringType = declaringType; + + // IsStub must be set permanently so when location of the stub is reassigned + // to the primary module for navigation purposes, function still remembers + // that it case from a stub. + IsStub = location.Module.ModuleType == ModuleType.Stub; location.Module.AddAstNode(this, fd); ProcessDecorators(fd); @@ -99,7 +105,7 @@ internal override void SetDocumentation(string documentation) { public override bool IsSpecialized => _isSpecialized; public bool IsOverload { get; private set; } - public bool IsStub { get; internal set; } + public bool IsStub { get; } public bool IsUnbound => DeclaringType == null; public IReadOnlyList Overloads => _overloads; @@ -117,7 +123,10 @@ internal void Specialize(string[] dependencies) { internal void AddOverload(IPythonFunctionOverload overload) => _overloads = _overloads.Count > 0 ? _overloads.Add(overload) : ImmutableArray.Create(overload); - internal IPythonFunctionType ToUnbound() => new PythonUnboundMethod(this); + internal IPythonFunctionType ToUnbound() { + Debug.Assert(DeclaringType != null, "Attempt to unbound standalone function."); + return new PythonUnboundMethod(this); + } private void ProcessDecorators(FunctionDefinition fd) { foreach (var dec in (fd.Decorators?.Decorators).MaybeEnumerate().OfType()) { @@ -154,22 +163,21 @@ private void ProcessDecorators(FunctionDefinition fd) { /// /// Represents unbound method, such in C.f where C is class rather than the instance. /// - private sealed class PythonUnboundMethod : PythonTypeWrapper, IPythonFunctionType { - private readonly IPythonFunctionType _pf; - + internal sealed class PythonUnboundMethod : PythonTypeWrapper, IPythonFunctionType { public PythonUnboundMethod(IPythonFunctionType function) : base(function, function.DeclaringModule) { - _pf = function; + Function = function; } - public FunctionDefinition FunctionDefinition => _pf.FunctionDefinition; - public IPythonType DeclaringType => _pf.DeclaringType; - public bool IsStatic => _pf.IsStatic; - public bool IsClassMethod => _pf.IsClassMethod; - public bool IsOverload => _pf.IsOverload; - public bool IsStub => _pf.IsStub; + public IPythonFunctionType Function { get; } + public FunctionDefinition FunctionDefinition => Function.FunctionDefinition; + public IPythonType DeclaringType => Function.DeclaringType; + public bool IsStatic => Function.IsStatic; + public bool IsClassMethod => Function.IsClassMethod; + public bool IsOverload => Function.IsOverload; + public bool IsStub => Function.IsStub; public bool IsUnbound => true; - public IReadOnlyList Overloads => _pf.Overloads; + public IReadOnlyList Overloads => Function.Overloads; public override BuiltinTypeId TypeId => BuiltinTypeId.Function; public override PythonMemberType MemberType => PythonMemberType.Function; } diff --git a/src/Analysis/Ast/Impl/Types/PythonType.cs b/src/Analysis/Ast/Impl/Types/PythonType.cs index 503592fdf..eaf746d22 100644 --- a/src/Analysis/Ast/Impl/Types/PythonType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonType.cs @@ -52,6 +52,14 @@ private PythonType(string name, Location location, BuiltinTypeId typeId) : base( #region ILocatedMember public override PythonMemberType MemberType => _typeId.GetMemberId(); + + public override void AddReference(Location location) { + if (DeclaringModule == null || DeclaringModule.ModuleType == ModuleType.Builtins) { + return; + } + + base.AddReference(location); + } #endregion #region IPythonType @@ -61,7 +69,7 @@ private PythonType(string name, Location location, BuiltinTypeId typeId) : base( public virtual string QualifiedName => DeclaringModule.ModuleType == ModuleType.Builtins ? TypeId == BuiltinTypeId.Ellipsis ? "ellipsis" : Name - : $"{DeclaringModule.Name}:{Name}"; + : this.GetQualifiedName(); public virtual string Documentation { get; private set; } public virtual BuiltinTypeId TypeId => _typeId; diff --git a/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs b/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs index 063820faa..5265555fc 100644 --- a/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs +++ b/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs @@ -23,6 +23,8 @@ namespace Microsoft.Python.Analysis.Types { /// internal class PythonTypeWrapper : IPythonType { private readonly BuiltinTypeId _builtinTypeId; + private readonly string _typeName; + private readonly string _documentation; private IPythonType _innerType; protected IPythonType InnerType @@ -32,7 +34,11 @@ protected IPythonType InnerType /// Creates delegate type wrapper over an existing type. /// Use dedicated constructor for wrapping builtin types. /// - public PythonTypeWrapper(IPythonType type) : this(type, type.DeclaringModule) { + public PythonTypeWrapper(IPythonType type) : this(type, type.DeclaringModule) { } + + public PythonTypeWrapper(string typeName, string documentation, IPythonModule declaringModule, IPythonType baseType) : this(baseType, declaringModule) { + _typeName = typeName; + _documentation = documentation; } /// @@ -55,10 +61,10 @@ public PythonTypeWrapper(BuiltinTypeId builtinTypeId, IPythonModule declaringMod } #region IPythonType - public virtual string Name => InnerType.Name; - public virtual string QualifiedName => InnerType.QualifiedName; + public virtual string Name => _typeName ?? InnerType.Name; + public virtual string QualifiedName => _typeName != null ? $"{DeclaringModule.Name}:{_typeName}" : InnerType.QualifiedName; public IPythonModule DeclaringModule { get; } - public virtual string Documentation => InnerType.Documentation; + public virtual string Documentation => _documentation ?? InnerType.Documentation; public virtual BuiltinTypeId TypeId => InnerType.TypeId; public virtual PythonMemberType MemberType => InnerType.MemberType; public virtual bool IsBuiltin => InnerType.IsBuiltin; diff --git a/src/Analysis/Ast/Impl/Values/Collections/PythonIterator.cs b/src/Analysis/Ast/Impl/Values/Collections/PythonIterator.cs index e97263f34..835feabac 100644 --- a/src/Analysis/Ast/Impl/Values/Collections/PythonIterator.cs +++ b/src/Analysis/Ast/Impl/Values/Collections/PythonIterator.cs @@ -38,7 +38,7 @@ public PythonIterator(IPythonType iteratorType, IPythonCollection collection) : private IArgumentSet GetArgSet(int index) { var newArg = new PythonConstant(index, Type.DeclaringModule.Interpreter.GetBuiltinType(BuiltinTypeId.Int)); - return new ArgumentSet(new List() { newArg }, null, null); + return new ArgumentSet(new List { newArg }, null, null); } public override IMember Call(string memberName, IArgumentSet args) { diff --git a/src/Analysis/Ast/Test/BasicTests.cs b/src/Analysis/Ast/Test/BasicTests.cs index e82c400d1..a469fdddc 100644 --- a/src/Analysis/Ast/Test/BasicTests.cs +++ b/src/Analysis/Ast/Test/BasicTests.cs @@ -13,15 +13,12 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System.Linq; using System.Threading.Tasks; using FluentAssertions; using Microsoft.Python.Analysis.Tests.FluentAssertions; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; -using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Tests; -using Microsoft.Python.Tests.Utilities.FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using TestUtilities; @@ -82,56 +79,5 @@ import sys .HaveVariable("sys").OfType(BuiltinTypeId.Module) .And.HaveVariable("x").OfType(BuiltinTypeId.List); } - - [DataRow(true, true)] - [DataRow(false, true)] - [DataRow(true, false)] - [DataRow(false, false)] - [DataTestMethod, Priority(0)] - public async Task UnknownType(bool isPython3X, bool isAnaconda) { - const string code = @"x = 1"; - - var configuration = isPython3X - ? isAnaconda ? PythonVersions.LatestAnaconda3X : PythonVersions.LatestAvailable3X - : isAnaconda ? PythonVersions.LatestAnaconda2X : PythonVersions.LatestAvailable2X; - var analysis = await GetAnalysisAsync(code, configuration); - - var unkType = analysis.Document.Interpreter.UnknownType; - unkType.TypeId.Should().Be(BuiltinTypeId.Unknown); - } - - [DataRow(true, true)] - [DataRow(false, true)] - [DataRow(true, false)] - [DataRow(false, false)] - [DataTestMethod, Priority(0)] - public async Task BuiltinsTest(bool isPython3X, bool isAnaconda) { - const string code = @" -x = 1 -"; - var configuration = isPython3X - ? isAnaconda ? PythonVersions.LatestAnaconda3X : PythonVersions.LatestAvailable3X - : isAnaconda ? PythonVersions.LatestAnaconda2X : PythonVersions.LatestAvailable2X; - var analysis = await GetAnalysisAsync(code, configuration); - - var v = analysis.Should().HaveVariable("x").Which; - var t = v.Value.GetPythonType(); - t.Should().BeAssignableTo(); - - var mc = (IMemberContainer)t; - var names = mc.GetMemberNames().ToArray(); - names.Length.Should().BeGreaterThan(50); - } - - [TestMethod, Priority(0)] - public async Task BuiltinsTrueFalse() { - const string code = @" -booltypetrue = True -booltypefalse = False -"; - var analysis = await GetAnalysisAsync(code); - analysis.Should().HaveVariable(@"booltypetrue").OfType(BuiltinTypeId.Bool) - .And.HaveVariable(@"booltypefalse").OfType(BuiltinTypeId.Bool); - } } } diff --git a/src/Analysis/Ast/Test/BuiltinsTests.cs b/src/Analysis/Ast/Test/BuiltinsTests.cs new file mode 100644 index 000000000..04860f26c --- /dev/null +++ b/src/Analysis/Ast/Test/BuiltinsTests.cs @@ -0,0 +1,99 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Analysis.Tests.FluentAssertions; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Parsing.Tests; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Tests { + [TestClass] + public class BuiltinsTests : AnalysisTestBase { + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + + [DataRow(true, true)] + [DataRow(false, true)] + [DataRow(true, false)] + [DataRow(false, false)] + [DataTestMethod, Priority(0)] + public async Task BuiltinsTest(bool isPython3X, bool isAnaconda) { + const string code = @" +x = 1 +"; + var configuration = isPython3X + ? isAnaconda ? PythonVersions.LatestAnaconda3X : PythonVersions.LatestAvailable3X + : isAnaconda ? PythonVersions.LatestAnaconda2X : PythonVersions.LatestAvailable2X; + var analysis = await GetAnalysisAsync(code, configuration); + + var v = analysis.Should().HaveVariable("x").Which; + var t = v.Value.GetPythonType(); + t.Should().BeAssignableTo(); + + var mc = (IMemberContainer)t; + var names = mc.GetMemberNames().ToArray(); + names.Length.Should().BeGreaterThan(50); + } + + [TestMethod, Priority(0)] + public async Task BuiltinsTrueFalse() { + const string code = @" +booltypetrue = True +booltypefalse = False +"; + var analysis = await GetAnalysisAsync(code); + analysis.Should().HaveVariable(@"booltypetrue").OfType(BuiltinTypeId.Bool) + .And.HaveVariable(@"booltypefalse").OfType(BuiltinTypeId.Bool); + } + + [DataRow(true, true)] + [DataRow(false, true)] + [DataRow(true, false)] + [DataRow(false, false)] + [DataTestMethod, Priority(0)] + public async Task UnknownType(bool isPython3X, bool isAnaconda) { + const string code = @"x = 1"; + + var configuration = isPython3X + ? isAnaconda ? PythonVersions.LatestAnaconda3X : PythonVersions.LatestAvailable3X + : isAnaconda ? PythonVersions.LatestAnaconda2X : PythonVersions.LatestAvailable2X; + var analysis = await GetAnalysisAsync(code, configuration); + + var unkType = analysis.Document.Interpreter.UnknownType; + unkType.TypeId.Should().Be(BuiltinTypeId.Unknown); + } + + [TestMethod, Priority(0)] + public async Task Type() { + const string code = @" +class _C: + def _m(self): pass +MethodType = type(_C()._m)"; + var analysis = await GetAnalysisAsync(code); + analysis.Should().HaveVariable(@"MethodType").OfType(BuiltinTypeId.Method); + } + } +} diff --git a/src/Analysis/Ast/Test/ClassesTests.cs b/src/Analysis/Ast/Test/ClassesTests.cs index 1d817f3cb..8b774b61a 100644 --- a/src/Analysis/Ast/Test/ClassesTests.cs +++ b/src/Analysis/Ast/Test/ClassesTests.cs @@ -634,5 +634,39 @@ def __init__(self): // Test run time: typically ~ 20 sec. sw.ElapsedMilliseconds.Should().BeLessThan(60000); } + + [TestMethod, Priority(0)] + public async Task NestedClasses() { + const string code = @" +class A: + class B: + def __init__(self): ... + + def __init__(self): ... + +x = A.B +ab = A.B() +"; + var analysis = await GetAnalysisAsync(code); + + analysis.Should().HaveVariable("x").OfType(BuiltinTypeId.Type); + var ab = analysis.Should().HaveVariable("ab").Which; + ab.Value.Should().BeAssignableTo() + .And.HaveType(typeof(IPythonClassType)); + + var c = ab.Value.GetPythonType(); + c.Should().NotBeNull(); + c.DeclaringType.Name.Should().Be("A"); + c.DeclaringType.Should().BeAssignableTo(); + } + + [TestMethod, Priority(0)] + public async Task MethodType() { + const string code = @" +x = type(object.__init__) +"; + var analysis = await GetAnalysisAsync(code); + analysis.Should().HaveVariable("x").OfType(BuiltinTypeId.Method); + } } } diff --git a/src/Analysis/Ast/Test/ConditionalsTests.cs b/src/Analysis/Ast/Test/ConditionalsTests.cs index 80faf453e..054142dd1 100644 --- a/src/Analysis/Ast/Test/ConditionalsTests.cs +++ b/src/Analysis/Ast/Test/ConditionalsTests.cs @@ -14,7 +14,6 @@ // permissions and limitations under the License. using System.Threading.Tasks; -using FluentAssertions; using Microsoft.Python.Analysis.Tests.FluentAssertions; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core.IO; @@ -76,15 +75,13 @@ public async Task SysPlatformWindows(bool isWindows) { const string code = @" if sys.platform == 'win32': x = 1 +else: + x = 'a' "; var platform = SubstitutePlatform(out var sm); platform.IsWindows.Returns(x => isWindows); var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X, sm); - if (isWindows) { - analysis.Should().HaveVariable("x").OfType(BuiltinTypeId.Int); - } else { - analysis.Should().NotHaveVariable("x"); - } + analysis.Should().HaveVariable("x").OfType(isWindows ? BuiltinTypeId.Int : BuiltinTypeId.Str); } [DataRow(false)] @@ -130,15 +127,45 @@ public async Task OsPathPosix(bool isWindows) { const string code = @" if 'posix' in _names: x = 1 +else: + x = 'a' "; var platform = SubstitutePlatform(out var sm); platform.IsWindows.Returns(x => isWindows); var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable2X, sm); - if (!isWindows) { - analysis.Should().HaveVariable("x").OfType(BuiltinTypeId.Int); - } else { - analysis.Should().NotHaveVariable("x"); - } + analysis.Should().HaveVariable("x").OfType(isWindows ? BuiltinTypeId.Str : BuiltinTypeId.Int); + } + + [DataRow(false)] + [DataRow(true)] + [DataTestMethod, Priority(0)] + public async Task FunctionByVersion(bool is3x) { + const string code = @" +if sys.version_info >= (3, 0): + def func(a): ... +else: + def func(a, b): ... +"; + var analysis = await GetAnalysisAsync(code, is3x ? PythonVersions.LatestAvailable3X : PythonVersions.LatestAvailable2X); + analysis.Should().HaveFunction("func") + .Which.Should().HaveSingleOverload() + .Which.Should().HaveParameters(is3x ? new[] { "a" } : new[] { "a", "b" }); + } + + [DataRow(false)] + [DataRow(true)] + [DataTestMethod, Priority(0)] + public async Task FunctionByVersionElif(bool is3x) { + const string code = @" +if sys.version_info >= (3, 0): + def func(a): ... +elif sys.version_info < (3, 0): + def func(a, b): ... +"; + var analysis = await GetAnalysisAsync(code, is3x ? PythonVersions.LatestAvailable3X : PythonVersions.LatestAvailable2X); + analysis.Should().HaveFunction("func") + .Which.Should().HaveSingleOverload() + .Which.Should().HaveParameters(is3x ? new[] { "a" } : new[] { "a", "b" }); } private IOSPlatform SubstitutePlatform(out IServiceManager sm) { diff --git a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs index 6d18b1104..6658572e6 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs @@ -21,6 +21,7 @@ using FluentAssertions.Execution; using FluentAssertions.Primitives; using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; using static Microsoft.Python.Analysis.Tests.FluentAssertions.AssertionsUtilities; namespace Microsoft.Python.Analysis.Tests.FluentAssertions { @@ -70,7 +71,7 @@ public AndWhichConstraint HaveMember(string NotBeNull(); var t = Subject.GetPythonType(); - var mc = (IMemberContainer) t; + var mc = (IMemberContainer)t; Execute.Assertion.ForCondition(mc != null) .BecauseOf(because, reasonArgs) .FailWith($"Expected {GetName(t)} to be a member container{{reason}}."); @@ -88,9 +89,70 @@ public AndWhichConstraint HaveMember(string return new AndWhichConstraint(this, typedMember); } - public AndConstraint HaveSameMembersAs(IMember m) { - m.Should().BeAssignableTo(); - return HaveMembers(((IMemberContainer)m).GetMemberNames(), string.Empty); + public AndConstraint HaveSameMemberNamesAs(IMember member) { + member.Should().BeAssignableTo(); + return HaveMembers(((IMemberContainer)member).GetMemberNames(), string.Empty); + } + + public void HaveSameMembersAs(IMember other) { + other.Should().BeAssignableTo(); + var otherContainer = (IMemberContainer)other; + + var subjectType = Subject.GetPythonType(); + var subjectMemberNames = subjectType.GetMemberNames().ToArray(); + var otherMemberNames = otherContainer.GetMemberNames().ToArray(); + + var missingNames = otherMemberNames.Except(subjectMemberNames).ToArray(); + var extraNames = subjectMemberNames.Except(otherMemberNames).ToArray(); + + missingNames.Should().BeEmpty("Subject has missing names: ", missingNames); + extraNames.Should().BeEmpty("Subject has extra names: ", extraNames); + + foreach (var n in subjectMemberNames) { + var subjectMember = subjectType.GetMember(n); + var otherMember = otherContainer.GetMember(n); + var subjectMemberType = subjectMember.GetPythonType(); + var otherMemberType = otherMember.GetPythonType(); + + // PythonConstant, PythonUnicodeStrings... etc are mapped to instances. + if (subjectMember is IPythonInstance) { + otherMember.Should().BeAssignableTo(); + } + + subjectMemberType.MemberType.Should().Be(otherMemberType.MemberType); + + if (string.IsNullOrEmpty(subjectMemberType.Documentation)) { + otherMemberType.Documentation.Should().BeNullOrEmpty(); + } else { + subjectMemberType.Documentation.Should().Be(otherMemberType.Documentation); + } + + switch (subjectMemberType.MemberType) { + case PythonMemberType.Class: + // Restored collections (like instance of tuple) turn into classes + // rather than into collections with content since we don't track + // collection content in libraries. + subjectMemberType.QualifiedName.Should().Be(otherMemberType.QualifiedName); + break; + case PythonMemberType.Function: + case PythonMemberType.Method: + subjectMemberType.Should().BeAssignableTo(); + otherMemberType.Should().BeAssignableTo(); + if (subjectMemberType is IPythonFunctionType subjectFunction) { + var otherFunction = (IPythonFunctionType)otherMemberType; + subjectFunction.Should().HaveSameOverloadsAs(otherFunction); + } + + break; + case PythonMemberType.Property: + subjectMemberType.Should().BeAssignableTo(); + otherMemberType.Should().BeAssignableTo(); + break; + case PythonMemberType.Unknown: + subjectMemberType.IsUnknown().Should().BeTrue(); + break; + } + } } public AndConstraint HaveMembers(params string[] memberNames) diff --git a/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionAssertions.cs index 5ba32fa27..f67644743 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionAssertions.cs @@ -74,6 +74,17 @@ public AndWhichConstraint Hav return new AndWhichConstraint(this, overloads[index]); } + public void HaveSameOverloadsAs(IPythonFunctionType other, string because = "", params object[] reasonArgs) { + var overloads = Subject.Overloads.ToArray(); + Subject.Should().HaveOverloadCount(other.Overloads.Count); + + for (var i = 0; i < Subject.Overloads.Count; i++) { + var subjectOverload = Subject.Overloads[i]; + var otherOverload = other.Overloads[i]; + subjectOverload.Should().HaveSameParametersAs(otherOverload); + } + } + public AndWhichConstraint HaveParameterAt(int index, string because = "", params object[] reasonArgs) { var overloads = Subject.Overloads.ToArray(); Execute.Assertion.ForCondition(overloads.Length == 1) diff --git a/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionOverloadAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionOverloadAssertions.cs index 6ab5b0f8e..e79bcd533 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionOverloadAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/PythonFunctionOverloadAssertions.cs @@ -102,6 +102,26 @@ public AndConstraint HaveParameters(IEnumerabl return new AndConstraint(this); } + public AndConstraint HaveSameParametersAs(IPythonFunctionOverload other, string because = "", params object[] reasonArgs) { + var parameters = Subject.Parameters.ToArray(); + var expected = other.Parameters.ToArray(); + + parameters.Should().HaveCount(other.Parameters.Count); + for (var j = 0; j < expected.Length; j++) { + var subjectParam = other.Parameters[j]; + var otherParam = other.Parameters[j]; + subjectParam.Name.Should().Be(otherParam.Name); + + if (subjectParam.Type == null) { + otherParam.Type.Should().BeNull(); + } else { + subjectParam.Type.Name.Should().Be(otherParam.Type.Name); + } + } + + return new AndConstraint(this); + } + public AndConstraint HaveNoParameters(string because = "", params object[] reasonArgs) => HaveParameters(Enumerable.Empty(), because, reasonArgs); diff --git a/src/Analysis/Ast/Test/FunctionTests.cs b/src/Analysis/Ast/Test/FunctionTests.cs index 7ebefdfdb..09a38c00e 100644 --- a/src/Analysis/Ast/Test/FunctionTests.cs +++ b/src/Analysis/Ast/Test/FunctionTests.cs @@ -567,6 +567,35 @@ def inner(): .And.HaveVariable("z").OfType(BuiltinTypeId.Int); } + [TestMethod, Priority(0)] + public async Task NestedMembers() { + const string code = @" +def outer(): + class innerClass(): ... + def innerFunc(): ... +"; + var analysis = await GetAnalysisAsync(code); + var outer = analysis.Should().HaveFunction("outer").Which as IPythonType; + outer.Should().HaveMember("innerClass"); + outer.Should().HaveMember("innerFunc"); + } + + [TestMethod, Priority(0)] + public async Task NestedPropertyMembers() { + const string code = @" +def outer(): + @property + def p(self): + class innerClass(): ... + def innerFunc(): ... +"; + var analysis = await GetAnalysisAsync(code); + var outer = analysis.Should().HaveFunction("outer").Which as IPythonType; + var p = outer.Should().HaveMember("p").Which as IPythonType; + p.Should().HaveMember("innerClass"); + p.Should().HaveMember("innerFunc"); + } + [TestMethod, Priority(0)] public async Task Deprecated() { const string code = @" diff --git a/src/Analysis/Ast/Test/LibraryTests.cs b/src/Analysis/Ast/Test/LibraryTests.cs index a26e53139..3a8935918 100644 --- a/src/Analysis/Ast/Test/LibraryTests.cs +++ b/src/Analysis/Ast/Test/LibraryTests.cs @@ -40,7 +40,7 @@ public async Task Random() { foreach (var fnName in new[] { @"seed", @"randrange", @"gauss" }) { analysis.Should().HaveVariable(fnName).Which - .Should().HaveType(BuiltinTypeId.Function) + .Should().HaveType(BuiltinTypeId.Method) .And.Value.GetPythonType().Documentation.Should().NotBeNullOrEmpty(); } } diff --git a/src/Analysis/Ast/Test/PepHintTests.cs b/src/Analysis/Ast/Test/PepHintTests.cs index 8964ddc7f..1cf706944 100644 --- a/src/Analysis/Ast/Test/PepHintTests.cs +++ b/src/Analysis/Ast/Test/PepHintTests.cs @@ -73,7 +73,7 @@ class Response: # truncated timedelta.IsUnknown().Should().BeFalse(); c.Should().HaveMember("elapsed") - .Which.Should().HaveSameMembersAs(timedelta); + .Which.Should().HaveSameMemberNamesAs(timedelta); } [TestMethod, Priority(0)] diff --git a/src/Analysis/Ast/Test/TypingTests.cs b/src/Analysis/Ast/Test/TypingTests.cs index f0856a743..606ecc3c5 100644 --- a/src/Analysis/Ast/Test/TypingTests.cs +++ b/src/Analysis/Ast/Test/TypingTests.cs @@ -265,9 +265,9 @@ from typing import AnyStr y = n2[0] "; var analysis = await GetAnalysisAsync(code); - analysis.Should().HaveVariable("n1").OfType("AnyStr") - .And.HaveVariable("x").OfType("AnyStr") - .And.HaveVariable("y").OfType("AnyStr"); + analysis.Should().HaveVariable("n1").OfType(BuiltinTypeId.Str) + .And.HaveVariable("x").OfType(BuiltinTypeId.Str) + .And.HaveVariable("y").OfType(BuiltinTypeId.Str); } [TestMethod, Priority(0)] diff --git a/src/Analysis/Core/Impl/Interpreter/InterpreterConfiguration.cs b/src/Analysis/Core/Impl/Interpreter/InterpreterConfiguration.cs index 1ed4f6331..208025789 100644 --- a/src/Analysis/Core/Impl/Interpreter/InterpreterConfiguration.cs +++ b/src/Analysis/Core/Impl/Interpreter/InterpreterConfiguration.cs @@ -15,21 +15,17 @@ using System; using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using Microsoft.Python.Core; namespace Microsoft.Python.Analysis.Core.Interpreter { public sealed class InterpreterConfiguration : IEquatable { - private readonly string _description; - private string _fullDescription; - /// /// Constructs a new interpreter configuration based on the provided values. /// - public InterpreterConfiguration( - string id, - string description, + public InterpreterConfiguration(string interpreterPath = null, Version version = null) : + this(interpreterPath, string.Empty, null, null, default, version) { } + + // Tests only + internal InterpreterConfiguration( string interpreterPath = null, string pathVar = "", string libPath = null, @@ -37,8 +33,6 @@ public InterpreterConfiguration( InterpreterArchitecture architecture = default, Version version = null ) { - Id = id; - _description = description ?? string.Empty; InterpreterPath = interpreterPath; PathEnvironmentVariable = pathVar; Architecture = architecture ?? InterpreterArchitecture.Unknown; @@ -51,8 +45,6 @@ private static string Read(IReadOnlyDictionary d, string k) => d.TryGetValue(k, out var o) ? o as string : null; private InterpreterConfiguration(IReadOnlyDictionary properties) { - Id = Read(properties, nameof(Id)); - _description = Read(properties, nameof(Description)) ?? ""; InterpreterPath = Read(properties, nameof(InterpreterPath)); PathEnvironmentVariable = Read(properties, nameof(PathEnvironmentVariable)); LibraryPath = Read(properties, nameof(LibraryPath)); @@ -73,65 +65,6 @@ private InterpreterConfiguration(IReadOnlyDictionary properties) } } - public void WriteToDictionary(IDictionary properties) { - properties[nameof(Id)] = Id; - properties[nameof(Description)] = _description; - properties[nameof(InterpreterPath)] = InterpreterPath; - properties[nameof(PathEnvironmentVariable)] = PathEnvironmentVariable; - properties[nameof(LibraryPath)] = LibraryPath; - properties[nameof(Architecture)] = Architecture.ToString(); - if (Version != null) { - properties[nameof(Version)] = Version.ToString(); - } - properties[nameof(SearchPaths)] = SearchPaths.ToArray(); - } - - /// - /// Reconstructs an interpreter configuration from a dictionary. - /// - public static InterpreterConfiguration FromDictionary(IReadOnlyDictionary properties) - => new InterpreterConfiguration(properties); - - /// - /// Serializes an interpreter configuration to a dictionary. - /// - public IReadOnlyDictionary ToDictionary() { - var d = new Dictionary(); - WriteToDictionary(d); - return d; - } - - /// - /// Gets a unique and stable identifier for this interpreter. - /// - public string Id { get; } - - /// - /// Gets a friendly description of the interpreter - /// - public string Description => _fullDescription ?? _description; - - /// - /// Changes the description to be less likely to be - /// ambiguous with other interpreters. - /// - public void SwitchToFullDescription() { - var hasVersion = _description.Contains(Version.ToString()); - var hasArch = _description.IndexOf(Architecture.ToString(null, CultureInfo.CurrentCulture), StringComparison.CurrentCultureIgnoreCase) >= 0 || - _description.IndexOf(Architecture.ToString("x", CultureInfo.CurrentCulture), StringComparison.CurrentCultureIgnoreCase) >= 0; - - if (hasVersion && hasArch) { - // Regular description is sufficient - _fullDescription = null; - } else if (hasVersion) { - _fullDescription = "{0} ({1})".FormatUI(_description, Architecture); - } else if (hasArch) { - _fullDescription = "{0} ({1})".FormatUI(_description, Version); - } else { - _fullDescription = "{0} ({1}, {2})".FormatUI(_description, Version, Architecture); - } - } - /// /// Returns the path to the interpreter executable for launching Python /// applications. @@ -186,8 +119,7 @@ public bool Equals(InterpreterConfiguration other) { } var cmp = StringComparer.OrdinalIgnoreCase; - return string.Equals(Id, other.Id) && - cmp.Equals(Description, other.Description) && + return cmp.Equals(InterpreterPath, other.InterpreterPath) && cmp.Equals(PathEnvironmentVariable, other.PathEnvironmentVariable) && Architecture == other.Architecture && @@ -196,28 +128,13 @@ public bool Equals(InterpreterConfiguration other) { public override int GetHashCode() { var cmp = StringComparer.OrdinalIgnoreCase; - return Id.GetHashCode() ^ - cmp.GetHashCode(Description) ^ + return cmp.GetHashCode(InterpreterPath ?? "") ^ cmp.GetHashCode(PathEnvironmentVariable ?? "") ^ Architecture.GetHashCode() ^ Version.GetHashCode(); } - public override string ToString() => Description; - - /// - /// Attempts to update descriptions to be unique within the - /// provided sequence by adding information about the - /// interpreter that is missing from the default description. - /// - public static void DisambiguateDescriptions(IReadOnlyList configs) { - foreach (var c in configs) { - c._fullDescription = null; - } - foreach (var c in configs.GroupBy(i => i._description ?? "").Where(g => g.Count() > 1).SelectMany(g => g)) { - c.SwitchToFullDescription(); - } - } + public override string ToString() => InterpreterPath; } } diff --git a/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs b/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs index ae75f054c..5abcbb4ee 100644 --- a/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs +++ b/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs @@ -40,16 +40,9 @@ public PythonLibraryPath(string path, PythonLibraryPathType type = PythonLibrary ModulePrefix = modulePrefix ?? string.Empty; } - public PythonLibraryPath(string path, bool isStandardLibrary, string modulePrefix) : - this(path, isStandardLibrary ? PythonLibraryPathType.StdLib : PythonLibraryPathType.Unspecified, modulePrefix) { } - public string Path { get; } - public PythonLibraryPathType Type { get; } - - public string ModulePrefix { get; } = string.Empty; - - public bool IsStandardLibrary => Type == PythonLibraryPathType.StdLib; + public string ModulePrefix { get; } public override string ToString() { var type = string.Empty; @@ -69,9 +62,9 @@ public override string ToString() { return "{0}|{1}|{2}".FormatInvariant(Path, type, ModulePrefix); } - public static PythonLibraryPath Parse(string s) { + private static PythonLibraryPath Parse(string s) { if (string.IsNullOrEmpty(s)) { - throw new ArgumentNullException("source"); + throw new ArgumentNullException(nameof(s)); } var parts = s.Split(new[] { '|' }, 3); @@ -83,8 +76,7 @@ public static PythonLibraryPath Parse(string s) { var ty = parts[1]; var prefix = parts[2]; - PythonLibraryPathType type = PythonLibraryPathType.Unspecified; - + var type = PythonLibraryPathType.Unspecified; switch (ty) { case "stdlib": type = PythonLibraryPathType.StdLib; @@ -106,8 +98,7 @@ public static PythonLibraryPath Parse(string s) { /// /// Root of the standard library. /// A list of search paths for the interpreter. - /// New in 2.2, moved in 3.3 - public static List GetDefaultSearchPaths(string library) { + private static List GetDefaultSearchPaths(string library) { var result = new List(); if (!Directory.Exists(library)) { return result; @@ -174,19 +165,15 @@ public static string GetSitePackagesPath(string standardLibraryPath) public static async Task> GetSearchPathsFromInterpreterAsync(string interpreter, IFileSystem fs, IProcessServices ps, CancellationToken cancellationToken = default) { // sys.path will include the working directory, so we make an empty // path that we can filter out later - var tempWorkingDir = IOPath.Combine(IOPath.GetTempPath(), IOPath.GetRandomFileName()); - fs.CreateDirectory(tempWorkingDir); - if (!InstallPath.TryGetFile("get_search_paths.py", out var srcGetSearchPaths)) { + if (!InstallPath.TryGetFile("get_search_paths.py", out var getSearchPathScript)) { return new List(); } - var getSearchPaths = IOPath.Combine(tempWorkingDir, PathUtils.GetFileName(srcGetSearchPaths)); - File.Copy(srcGetSearchPaths, getSearchPaths); var startInfo = new ProcessStartInfo( interpreter, - new[] { "-S", "-E", getSearchPaths }.AsQuotedArguments() + new[] { "-S", "-E", getSearchPathScript }.AsQuotedArguments() ) { - WorkingDirectory = tempWorkingDir, + WorkingDirectory = IOPath.GetDirectoryName(getSearchPathScript), UseShellExecute = false, ErrorDialog = false, CreateNoWindow = true, @@ -194,17 +181,11 @@ public static async Task> GetSearchPathsFromInterpreterA RedirectStandardOutput = true }; - try { - var output = await ps.ExecuteAndCaptureOutputAsync(startInfo, cancellationToken); - return output.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).Select(s => { + var output = await ps.ExecuteAndCaptureOutputAsync(startInfo, cancellationToken); + return output.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries) + .Skip(1).Select(s => { try { - var p = Parse(s); - - if (PathUtils.PathStartsWith(p.Path, tempWorkingDir)) { - return null; - } - - return p; + return Parse(s); } catch (ArgumentException) { Debug.Fail("Invalid search path: " + (s ?? "")); return null; @@ -212,10 +193,8 @@ public static async Task> GetSearchPathsFromInterpreterA Debug.Fail("Invalid format for search path: " + s); return null; } - }).Where(p => p != null).ToList(); - } finally { - fs.DeleteDirectory(tempWorkingDir, true); - } + }) + .Where(p => p != null).ToList(); } public static (IReadOnlyList interpreterPaths, IReadOnlyList userPaths) ClassifyPaths( @@ -304,7 +283,6 @@ public bool Equals(PythonLibraryPath other) { } public static bool operator ==(PythonLibraryPath left, PythonLibraryPath right) => left?.Equals(right) ?? right is null; - public static bool operator !=(PythonLibraryPath left, PythonLibraryPath right) => !(left?.Equals(right) ?? right is null); } } diff --git a/src/Analysis/Core/Impl/Properties/AssemblyInfo.cs b/src/Analysis/Core/Impl/Properties/AssemblyInfo.cs index 33b24b71a..cd223fd12 100644 --- a/src/Analysis/Core/Impl/Properties/AssemblyInfo.cs +++ b/src/Analysis/Core/Impl/Properties/AssemblyInfo.cs @@ -17,4 +17,5 @@ [assembly: InternalsVisibleTo("Microsoft.Python.Analysis.Engine, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] [assembly: InternalsVisibleTo("Microsoft.Python.Analysis, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] +[assembly: InternalsVisibleTo("Microsoft.Python.Parsing.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] [assembly: InternalsVisibleTo("Microsoft.Python.Analysis.Engine.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] diff --git a/src/Caching/Impl/Factories/ClassFactory.cs b/src/Caching/Impl/Factories/ClassFactory.cs index 0e790279e..f0c9be0f6 100644 --- a/src/Caching/Impl/Factories/ClassFactory.cs +++ b/src/Caching/Impl/Factories/ClassFactory.cs @@ -26,7 +26,7 @@ public ClassFactory(IEnumerable classes, ModuleFactory mf) : base(classes, mf) { } - protected override PythonClassType CreateMember(ClassModel cm, IPythonType declaringType) + public override PythonClassType CreateMember(ClassModel cm, IPythonType declaringType) => new PythonClassType(cm.Name, new Location(ModuleFactory.Module, cm.IndexSpan.ToSpan())); protected override void CreateMemberParts(ClassModel cm, PythonClassType cls) { @@ -34,6 +34,7 @@ protected override void CreateMemberParts(ClassModel cm, PythonClassType cls) { var is3x = ModuleFactory.Module.Interpreter.LanguageVersion.Is3x(); var bases = cm.Bases.Select(b => is3x && b == "object" ? null : TryCreate(b)).ExcludeDefault().ToArray(); cls.SetBases(bases); + cls.SetDocumentation(cm.Documentation); foreach (var f in cm.Methods) { cls.AddMember(f.Name, ModuleFactory.FunctionFactory.Construct(f, cls, false), false); @@ -44,7 +45,10 @@ protected override void CreateMemberParts(ClassModel cm, PythonClassType cls) { foreach (var c in cm.InnerClasses) { cls.AddMember(c.Name, Construct(c, cls, false), false); } - // TODO: fields. Bypass variable cache! + foreach(var vm in cm.Fields) { + var v = ModuleFactory.VariableFactory.Construct(vm, cls, false); + cls.AddMember(v.Name, v, false); + } } } } diff --git a/src/Caching/Impl/Factories/FactoryBase.cs b/src/Caching/Impl/Factories/FactoryBase.cs index 9456eade4..2120879a2 100644 --- a/src/Caching/Impl/Factories/FactoryBase.cs +++ b/src/Caching/Impl/Factories/FactoryBase.cs @@ -20,6 +20,10 @@ using Microsoft.Python.Analysis.Types; namespace Microsoft.Python.Analysis.Caching.Factories { + /// + /// Represents base factory that implements creation of a type + /// from its model (persistent form). + /// internal abstract class FactoryBase : IDisposable where TModel : MemberModel where TMember : IMember { @@ -41,6 +45,9 @@ protected FactoryBase(IEnumerable models, ModuleFactory mf) { public TMember TryCreate(string name, IPythonType declaringType = null) => _data.TryGetValue(name, out var data) ? Construct(data.Model, declaringType) : default; + /// + /// Constructs member from its persistent model. + /// public TMember Construct(TModel cm, IPythonType declaringType = null, bool cached = true) { TMember m; @@ -60,7 +67,7 @@ public TMember Construct(TModel cm, IPythonType declaringType = null, bool cache public virtual void Dispose() => _data.Clear(); - protected abstract TMember CreateMember(TModel model, IPythonType declaringType); + public abstract TMember CreateMember(TModel model, IPythonType declaringType); protected virtual void CreateMemberParts(TModel model, TMember member) { } } } diff --git a/src/Caching/Impl/Factories/FunctionFactory.cs b/src/Caching/Impl/Factories/FunctionFactory.cs index b4cdb25bc..07503bedb 100644 --- a/src/Caching/Impl/Factories/FunctionFactory.cs +++ b/src/Caching/Impl/Factories/FunctionFactory.cs @@ -24,16 +24,32 @@ public FunctionFactory(IEnumerable classes, ModuleFactory mf) : base(classes, mf) { } - protected override IPythonFunctionType CreateMember(FunctionModel fm, IPythonType declaringType) { - var f = new PythonFunctionType(fm.Name, new Location(ModuleFactory.Module, fm.IndexSpan.ToSpan()), declaringType, fm.Documentation); + public override IPythonFunctionType CreateMember(FunctionModel fm, IPythonType declaringType) { + var ft = new PythonFunctionType(fm.Name, new Location(ModuleFactory.Module, fm.IndexSpan.ToSpan()), declaringType, fm.Documentation); + foreach (var om in fm.Overloads) { var o = new PythonFunctionOverload(fm.Name, new Location(ModuleFactory.Module, fm.IndexSpan.ToSpan())); o.SetDocumentation(fm.Documentation); o.SetReturnValue(ModuleFactory.ConstructMember(om.ReturnType), true); o.SetParameters(om.Parameters.Select(ConstructParameter).ToArray()); - f.AddOverload(o); + ft.AddOverload(o); + } + + foreach(var model in fm.Functions) { + var f = CreateMember(model, ft); + if (f != null) { + ft.AddMember(f.Name, f, overwrite: true); + } } - return f; + + foreach (var model in fm.Classes) { + var c = ModuleFactory.ClassFactory.CreateMember(model, ft); + if (c != null) { + ft.AddMember(c.Name, c, overwrite: true); + } + } + + return ft; } private IParameterInfo ConstructParameter(ParameterModel pm) diff --git a/src/Caching/Impl/Factories/ModuleFactory.cs b/src/Caching/Impl/Factories/ModuleFactory.cs index a2ba630c3..b82b7a297 100644 --- a/src/Caching/Impl/Factories/ModuleFactory.cs +++ b/src/Caching/Impl/Factories/ModuleFactory.cs @@ -18,15 +18,19 @@ using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Specializations.Typing.Types; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Utilities; using Microsoft.Python.Analysis.Values; +using Microsoft.Python.Core; namespace Microsoft.Python.Analysis.Caching.Factories { internal sealed class ModuleFactory : IDisposable { - private static readonly ReentrancyGuard _processing = new ReentrancyGuard(); + // TODO: better resolve circular references. + private readonly ReentrancyGuard _typeReentrancy = new ReentrancyGuard(); + private readonly ReentrancyGuard _moduleReentrancy = new ReentrancyGuard(); public IPythonModule Module { get; } public ClassFactory ClassFactory { get; } @@ -53,49 +57,121 @@ public void Dispose() { public IPythonType ConstructType(string qualifiedName) => ConstructMember(qualifiedName)?.GetPythonType(); public IMember ConstructMember(string qualifiedName) { - if (!TypeNames.DeconstructQualifiedName(qualifiedName, out var moduleName, out var memberNames, out var isInstance)) { + // Determine module name, member chain and if this is an instance. + if (!TypeNames.DeconstructQualifiedName(qualifiedName, out var parts)) { return null; } // TODO: better resolve circular references. - if (!_processing.Push(qualifiedName) || memberNames.Count < 2) { + if (!_typeReentrancy.Push(qualifiedName)) { return null; } try { // See if member is a module first. - var module = moduleName == Module.Name ? Module : Module.Interpreter.ModuleResolution.GetOrLoadModule(moduleName); + var module = GetModule(parts); if (module == null) { return null; } - var member = moduleName == Module.Name - ? GetMemberFromThisModule(memberNames) - : GetMemberFromModule(module, memberNames); + if (parts.ObjectType == ObjectType.NamedTuple) { + return ConstructNamedTuple(parts.MemberNames[0], module); + } + + var member = parts.ModuleName == Module.Name + ? GetMemberFromThisModule(parts.MemberNames) + : GetMemberFromModule(module, parts.MemberNames); - if (!isInstance) { + if (parts.ObjectType != ObjectType.Instance) { return member; } var t = member.GetPythonType() ?? module.Interpreter.UnknownType; return new PythonInstance(t); } finally { - _processing.Pop(); + _typeReentrancy.Pop(); } } - private IMember GetMemberFromModule(IPythonModule module, IReadOnlyList memberNames) { + private IPythonModule GetModule(QualifiedNameParts parts) { + if (parts.ModuleName == Module.Name) { + return Module; + } + if (!_moduleReentrancy.Push(parts.ModuleName)) { + return null; + } + + try { + // Here we do not call GetOrLoad since modules references here must + // either be loaded already since they were required to create + // persistent state from analysis. Also, occasionally types come + // from the stub and the main module was never loaded. This, for example, + // happens with io which has member with mmap type coming from mmap + // stub rather than the primary mmap module. + var m = Module.Interpreter.ModuleResolution.GetImportedModule(parts.ModuleName); + // Try stub-only case (ex _importlib_modulespec). + m = m ?? Module.Interpreter.TypeshedResolution.GetImportedModule(parts.ModuleName); + if (m != null) { + return parts.ObjectType == ObjectType.VariableModule ? new PythonVariableModule(m) : m; + } + + return null; + } finally { + _moduleReentrancy.Pop(); + } + } + + private IMember GetMemberFromModule(IPythonModule module, IReadOnlyList memberNames) + => memberNames.Count == 0 ? module : GetMember(module, memberNames); + + private IMember GetBuiltinMember(IBuiltinsPythonModule builtins, string memberName) { + if (memberName.StartsWithOrdinal("__")) { + memberName = memberName.Substring(2, memberName.Length - 4); + } + + switch (memberName) { + case "NoneType": + return builtins.Interpreter.GetBuiltinType(BuiltinTypeId.NoneType); + case "Unknown": + return builtins.Interpreter.UnknownType; + } + return builtins.GetMember(memberName); + } + + private IMember GetMemberFromThisModule(IReadOnlyList memberNames) { if (memberNames.Count == 0) { return null; } - IMember member = module; - foreach (var memberName in memberNames) { - var typeArgs = GetTypeArguments(memberName, out _); + var name = memberNames[0]; + var root = ClassFactory.TryCreate(name) + ?? (FunctionFactory.TryCreate(name) + ?? (IMember)VariableFactory.TryCreate(name)); + + return GetMember(root, memberNames.Skip(1)); + } + + private IMember GetMember(IMember root, IEnumerable memberNames) { + IMember member = root; + foreach (var n in memberNames) { + var memberName = n; + // Check if name has type arguments such as Union[int, str] + // Note that types can be nested like Union[int, Union[A, B]] + var typeArgs = GetTypeArguments(memberName, out var typeName); + if (typeArgs.Count > 0) { + memberName = typeName; + } var mc = member as IMemberContainer; Debug.Assert(mc != null); - member = mc?.GetMember(memberName); + + if (mc is IBuiltinsPythonModule builtins) { + // Builtins require special handling since there may be 'hidden' names + // like __NoneType__ which need to be mapped to visible types. + member = GetBuiltinMember(builtins, memberName) ?? builtins.Interpreter.UnknownType; + } else { + member = mc?.GetMember(memberName); + } if (member == null) { Debug.Assert(member != null); @@ -110,18 +186,6 @@ private IMember GetMemberFromModule(IPythonModule module, IReadOnlyList return member; } - private IMember GetMemberFromThisModule(IReadOnlyList memberNames) { - if (memberNames.Count == 0) { - return null; - } - - // TODO: nested classes, etc (traverse parts and recurse). - var name = memberNames[0]; - return ClassFactory.TryCreate(name) - ?? (FunctionFactory.TryCreate(name) - ?? (IMember)VariableFactory.TryCreate(name)); - } - private IReadOnlyList GetTypeArguments(string memberName, out string typeName) { typeName = null; // TODO: better handle generics. @@ -134,7 +198,9 @@ private IReadOnlyList GetTypeArguments(string memberName, out strin var closeBracket = memberName.LastIndexOf(']'); if (closeBracket > 0) { var argumentString = memberName.Substring(openBracket + 1, closeBracket - openBracket - 1); - var arguments = argumentString.Split(',').Select(s => s.Trim()).ToArray(); + // Extract type names from argument string. Note that types themselves + // can have arguments: Union[int, Union[int, Union[str, bool]], ...]. + var arguments = TypeNames.GetTypeNames(argumentString, ','); foreach (var a in arguments) { var t = ConstructType(a); // TODO: better handle generics type definitions from TypeVar. @@ -147,5 +213,32 @@ private IReadOnlyList GetTypeArguments(string memberName, out strin } return typeArgs; } + + private ITypingNamedTupleType ConstructNamedTuple(string tupleString, IPythonModule module) { + // tuple_name(name: type, name: type, ...) + // time_result(columns: int, lines: int) + var openBraceIndex = tupleString.IndexOf('('); + var closeBraceIndex = tupleString.IndexOf(')'); + var name = tupleString.Substring(0, openBraceIndex); + var argString = tupleString.Substring(openBraceIndex + 1, closeBraceIndex - openBraceIndex - 1); + + var itemNames = new List(); + var itemTypes = new List(); + var start = 0; + + for (var i = 0; i < argString.Length; i++) { + var ch = argString[i]; + if (ch == ':') { + itemNames.Add(argString.Substring(start, i - start).Trim()); + i++; + var paramType = TypeNames.GetTypeName(argString, ref i, ','); + var t = ConstructType(paramType); + itemTypes.Add(t ?? module.Interpreter.UnknownType); + start = i + 1; + } + } + + return new NamedTupleType(name, itemNames, itemTypes, module, module.Interpreter); + } } } diff --git a/src/Caching/Impl/Factories/VariableFactory.cs b/src/Caching/Impl/Factories/VariableFactory.cs index 45a497970..ad624d183 100644 --- a/src/Caching/Impl/Factories/VariableFactory.cs +++ b/src/Caching/Impl/Factories/VariableFactory.cs @@ -24,9 +24,9 @@ public VariableFactory(IEnumerable models, ModuleFactory mf) : base(models, mf) { } - protected override IVariable CreateMember(VariableModel vm, IPythonType declaringType) { - var m = ModuleFactory.ConstructMember(vm.Value); - return new Variable(vm.Name, m, VariableSource.Declaration, new Location(ModuleFactory.Module, vm.IndexSpan.ToSpan())); + public override IVariable CreateMember(VariableModel vm, IPythonType declaringType) { + var m = ModuleFactory.ConstructMember(vm.Value) ?? ModuleFactory.Module.Interpreter.UnknownType; + return new Variable(vm.Name, m, VariableSource.Declaration, new Location(ModuleFactory.Module, vm.IndexSpan?.ToSpan() ?? default)); } } } diff --git a/src/Caching/Impl/Models/ClassModel.cs b/src/Caching/Impl/Models/ClassModel.cs index 9787f7e61..2b44c1472 100644 --- a/src/Caching/Impl/Models/ClassModel.cs +++ b/src/Caching/Impl/Models/ClassModel.cs @@ -22,8 +22,8 @@ using Microsoft.Python.Core; namespace Microsoft.Python.Analysis.Caching.Models { - [DebuggerDisplay("c:{Name}")] - internal sealed class ClassModel: MemberModel { + [DebuggerDisplay("cls:{Name}")] + internal sealed class ClassModel : MemberModel { public string Documentation { get; set; } public string[] Bases { get; set; } public FunctionModel[] Methods { get; set; } @@ -49,7 +49,7 @@ private ClassModel(IPythonClassType cls) { var m = cls.GetMember(name); // Only take members from this class, skip members from bases. - if (m is IPythonClassMember cm && !cls.Equals(cm.DeclaringType)) { + if (m is IPythonClassMember cm && cls.QualifiedName != cm.DeclaringType?.QualifiedName) { continue; } @@ -65,6 +65,8 @@ private ClassModel(IPythonClassType cls) { } innerClasses.Add(FromType(ct)); break; + case IPythonFunctionType ft when ft.IsLambda(): + break; case IPythonFunctionType ft when ft.Name == name: methods.Add(FunctionModel.FromType(ft)); break; @@ -88,7 +90,7 @@ private ClassModel(IPythonClassType cls) { IndexSpan = cls.Location.IndexSpan.ToModel(); Documentation = cls.Documentation; - Bases = cls.Bases.OfType().Select(t => t.GetQualifiedName()).ToArray(); + Bases = cls.Bases.OfType().Select(t => t.GetPersistentQualifiedName()).ToArray(); Methods = methods.ToArray(); Properties = properties.ToArray(); Fields = fields.ToArray(); diff --git a/src/Caching/Impl/Models/FunctionModel.cs b/src/Caching/Impl/Models/FunctionModel.cs index 9cebb7005..4c601b792 100644 --- a/src/Caching/Impl/Models/FunctionModel.cs +++ b/src/Caching/Impl/Models/FunctionModel.cs @@ -13,9 +13,12 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System.Collections.Generic; using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Utilities; +using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; namespace Microsoft.Python.Analysis.Caching.Models { @@ -24,30 +27,62 @@ internal sealed class FunctionModel: MemberModel { public string Documentation { get; set; } public OverloadModel[] Overloads { get; set; } public FunctionAttributes Attributes { get; set; } - public string[] Classes { get; set; } - public string[] Functions { get; set; } - - public static FunctionModel FromType(IPythonFunctionType ft) { - return new FunctionModel { - Id = ft.Name.GetStableHash(), - Name = ft.Name, - IndexSpan = ft.Location.IndexSpan.ToModel(), - Documentation = ft.Documentation, - Overloads = ft.Overloads.Select(FromOverload).ToArray() - // TODO: attributes, inner functions and inner classes. - }; - } + public ClassModel[] Classes { get; set; } + public FunctionModel[] Functions { get; set; } + + private readonly ReentrancyGuard _processing = new ReentrancyGuard(); + + public static FunctionModel FromType(IPythonFunctionType ft) => new FunctionModel(ft); private static OverloadModel FromOverload(IPythonFunctionOverload o) { return new OverloadModel { Parameters = o.Parameters.Select(p => new ParameterModel { Name = p.Name, - Type = p.Type.GetQualifiedName(), + Type = p.Type.GetPersistentQualifiedName(), Kind = p.Kind, - DefaultValue = p.DefaultValue.GetQualifiedName(), + DefaultValue = p.DefaultValue.GetPersistentQualifiedName(), }).ToArray(), - ReturnType = o.StaticReturnValue.GetQualifiedName() + ReturnType = o.StaticReturnValue.GetPersistentQualifiedName() }; } + + public FunctionModel() { } // For de-serializer from JSON + + private FunctionModel(IPythonFunctionType func) { + var functions = new List(); + var classes = new List(); + + foreach (var name in func.GetMemberNames()) { + var m = func.GetMember(name); + + // Only take members from this class, skip members from bases. + if (!_processing.Push(m)) { + continue; + } + + try { + switch (m) { + case IPythonFunctionType ft when ft.IsLambda(): + break; + case IPythonFunctionType ft: + functions.Add(FromType(ft)); + break; + case IPythonClassType cls: + classes.Add(ClassModel.FromType(cls)); + break; + } + } finally { + _processing.Pop(); + } + } + + Id = func.Name.GetStableHash(); + Name = func.Name; + IndexSpan = func.Location.IndexSpan.ToModel(); + Documentation = func.Documentation; + Overloads = func.Overloads.Select(FromOverload).ToArray(); + Classes = classes.ToArray(); + Functions = functions.ToArray(); + } } } diff --git a/src/Caching/Impl/Models/ModuleModel.cs b/src/Caching/Impl/Models/ModuleModel.cs index 46d3dee73..883c774d8 100644 --- a/src/Caching/Impl/Models/ModuleModel.cs +++ b/src/Caching/Impl/Models/ModuleModel.cs @@ -15,10 +15,10 @@ using System.Collections.Generic; using System.Linq; +using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; -using Microsoft.Python.Parsing; namespace Microsoft.Python.Analysis.Caching.Models { internal sealed class ModuleModel : MemberModel { @@ -55,34 +55,42 @@ public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceConta var exportedNames = new HashSet(analysis.Document.GetMemberNames()); foreach (var v in analysis.GlobalScope.Variables .Where(v => exportedNames.Contains(v.Name) || v.Source == VariableSource.Declaration || v.Source == VariableSource.Builtin)) { - // Create type model before variable since variable needs it. - string typeName = null; switch (v.Value) { - case IPythonFunctionType ft - when ft.DeclaringModule.Equals(analysis.Document) || ft.DeclaringModule.Equals(analysis.Document.Stub): - if (!functions.ContainsKey(ft.Name)) { - typeName = ft.Name; - functions[ft.Name] = FunctionModel.FromType(ft); + case IPythonFunctionType ft when ft.IsLambda(): + // No need to persist lambdas. + continue; + case IPythonFunctionType ft when v.Name != ft.Name: + // Variable assigned to type info of the function like + // def func(): ... + // x = type(func) + break; + case IPythonFunctionType ft: + var fm = GetFunctionModel(analysis, v, ft); + if (fm != null && !functions.ContainsKey(ft.Name)) { + functions[ft.Name] = fm; + continue; } - + break; + case IPythonClassType cls when v.Name != cls.Name: + // Variable assigned to type info of the class. break; case IPythonClassType cls when cls.DeclaringModule.Equals(analysis.Document) || cls.DeclaringModule.Equals(analysis.Document.Stub): if (!classes.ContainsKey(cls.Name)) { - typeName = cls.Name; classes[cls.Name] = ClassModel.FromType(cls); + continue; } break; } // Do not re-declare classes and functions as variables in the model. - if (typeName == null && !variables.ContainsKey(v.Name)) { + if (!variables.ContainsKey(v.Name)) { variables[v.Name] = VariableModel.FromVariable(v); } } - var uniqueId = analysis.Document.GetUniqieId(services); + var uniqueId = analysis.Document.GetUniqueId(services); return new ModuleModel { Id = uniqueId.GetStableHash(), UniqueId = uniqueId, @@ -98,5 +106,21 @@ when cls.DeclaringModule.Equals(analysis.Document) || cls.DeclaringModule.Equals FileSize = analysis.Ast.EndIndex }; } + + private static FunctionModel GetFunctionModel(IDocumentAnalysis analysis, IVariable v, IPythonFunctionType f) { + if (v.Source == VariableSource.Import && !f.DeclaringModule.Equals(analysis.Document) && !f.DeclaringModule.Equals(analysis.Document.Stub)) { + // It may be that the function is from a child module via import. + // For example, a number of functions in 'os' are imported from 'nt' on Windows via + // star import. Their stubs, however, come from 'os' stub. The function then have declaring + // module as 'nt' rather than 'os' and 'nt' does not have a stub. In this case use function + // model like if function was declared in 'os'. + return FunctionModel.FromType(f); + } + + if (f.DeclaringModule.Equals(analysis.Document) || f.DeclaringModule.Equals(analysis.Document.Stub)) { + return FunctionModel.FromType(f); + } + return null; + } } } diff --git a/src/Caching/Impl/Models/PropertyModel.cs b/src/Caching/Impl/Models/PropertyModel.cs index 2937cecbd..91cb0feef 100644 --- a/src/Caching/Impl/Models/PropertyModel.cs +++ b/src/Caching/Impl/Models/PropertyModel.cs @@ -28,7 +28,7 @@ public static PropertyModel FromType(IPythonPropertyType prop) { Name = prop.Name, IndexSpan = prop.Location.IndexSpan.ToModel(), Documentation = prop.Documentation, - ReturnType = prop.ReturnType.GetQualifiedName(), + ReturnType = prop.ReturnType.GetPersistentQualifiedName() // TODO: attributes. }; } diff --git a/src/Caching/Impl/Models/VariableModel.cs b/src/Caching/Impl/Models/VariableModel.cs index c44b3eb77..e6467d312 100644 --- a/src/Caching/Impl/Models/VariableModel.cs +++ b/src/Caching/Impl/Models/VariableModel.cs @@ -27,20 +27,20 @@ internal sealed class VariableModel: MemberModel { Id = v.Name.GetStableHash(), Name = v.Name, IndexSpan = v.Location.IndexSpan.ToModel(), - Value = v.Value.GetQualifiedName() + Value = v.Value.GetPersistentQualifiedName() }; public static VariableModel FromInstance(string name, IPythonInstance inst) => new VariableModel { Id = name.GetStableHash(), Name = name, - Value = inst.GetQualifiedName() + Value = inst.GetPersistentQualifiedName() }; public static VariableModel FromType(string name, IPythonType t) => new VariableModel { Id = name.GetStableHash(), Name = name, IndexSpan = t.Location.IndexSpan.ToModel(), - Value = t.QualifiedName + Value = t.GetPersistentQualifiedName() }; } } diff --git a/src/Caching/Impl/ModuleDatabase.cs b/src/Caching/Impl/ModuleDatabase.cs index 85c82e9f6..3c7e2779e 100644 --- a/src/Caching/Impl/ModuleDatabase.cs +++ b/src/Caching/Impl/ModuleDatabase.cs @@ -146,7 +146,7 @@ private void StoreModuleAnalysis(IDocumentAnalysis analysis, CancellationToken c /// private string FindDatabaseFile(string moduleName, string filePath) { var interpreter = _services.GetService(); - var uniqueId = ModuleUniqueId.GetUniqieId(moduleName, filePath, ModuleType.Specialized, _services); + var uniqueId = ModuleUniqueId.GetUniqueId(moduleName, filePath, ModuleType.Specialized, _services); if (string.IsNullOrEmpty(uniqueId)) { return null; } diff --git a/src/Caching/Impl/ModuleUniqueId.cs b/src/Caching/Impl/ModuleUniqueId.cs index 7c5e7524d..879211599 100644 --- a/src/Caching/Impl/ModuleUniqueId.cs +++ b/src/Caching/Impl/ModuleUniqueId.cs @@ -14,9 +14,9 @@ // permissions and limitations under the License. using System; +using System.Collections.Generic; using System.IO; using System.Linq; -using System.Security.Cryptography; using Microsoft.Python.Analysis.Core.Interpreter; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; @@ -25,10 +25,10 @@ namespace Microsoft.Python.Analysis.Caching { internal static class ModuleUniqueId { - public static string GetUniqieId(this IPythonModule module, IServiceContainer services) - => GetUniqieId(module.Name, module.FilePath, module.ModuleType, services); + public static string GetUniqueId(this IPythonModule module, IServiceContainer services) + => GetUniqueId(module.Name, module.FilePath, module.ModuleType, services); - public static string GetUniqieId(string moduleName, string filePath, ModuleType moduleType, IServiceContainer services) { + public static string GetUniqueId(string moduleName, string filePath, ModuleType moduleType, IServiceContainer services) { var interpreter = services.GetService(); var fs = services.GetService(); @@ -37,31 +37,38 @@ public static string GetUniqieId(string moduleName, string filePath, ModuleType return $"{moduleName}"; } - var config = interpreter.Configuration; - var standardLibraryPath = PythonLibraryPath.GetStandardLibraryPath(config); - var sitePackagesPath = PythonLibraryPath.GetSitePackagesPath(config); + var modulePathType = GetModulePathType(filePath, interpreter.ModuleResolution.LibraryPaths, fs); - if (!string.IsNullOrEmpty(filePath) && fs.IsPathUnderRoot(sitePackagesPath, filePath)) { - // If module is in site-packages and is versioned, then unique id = name + version + interpreter version. - // Example: 'requests' and 'requests-2.21.0.dist-info'. - var moduleFolder = Path.GetDirectoryName(Path.GetDirectoryName(filePath)); + if (!string.IsNullOrEmpty(filePath) && modulePathType == PythonLibraryPathType.Site) { + // Module can be a submodule of a versioned package. In this case we want to use + // version of the enclosing package so we have to look up the chain of folders. + var moduleRootName = moduleName.Split('.')[0]; + var moduleFilesFolder = Path.GetDirectoryName(filePath); + var installationFolder = Path.GetDirectoryName(moduleFilesFolder); - // TODO: for egg (https://github.com/microsoft/python-language-server/issues/196), consider *.egg-info - var folders = fs - .GetFileSystemEntries(moduleFolder, "*-*.dist-info", SearchOption.TopDirectoryOnly) - .Select(Path.GetFileName) - .Where(n => n.StartsWith(moduleName, StringComparison.OrdinalIgnoreCase)) // Module name can be capitalized differently. - .ToArray(); + var versionFolder = installationFolder; + while (!string.IsNullOrEmpty(versionFolder)) { + // If module is in site-packages and is versioned, then unique id = name + version + interpreter version. + // Example: 'requests' and 'requests-2.21.0.dist-info'. + // TODO: for egg (https://github.com/microsoft/python-language-server/issues/196), consider *.egg-info + var folders = fs.GetFileSystemEntries(versionFolder, "*-*.dist-info", SearchOption.TopDirectoryOnly) + .Select(Path.GetFileName) + .Where(n => n.StartsWith(moduleRootName, StringComparison.OrdinalIgnoreCase)) // Module name can be capitalized differently. + .ToArray(); - if (folders.Length == 1) { - var fileName = Path.GetFileNameWithoutExtension(folders[0]); - var dash = fileName.IndexOf('-'); - return $"{fileName.Substring(0, dash)}({fileName.Substring(dash + 1)})"; + if (folders.Length == 1) { + var fileName = Path.GetFileNameWithoutExtension(folders[0]); + var dash = fileName.IndexOf('-'); + return $"{moduleName}({fileName.Substring(dash + 1)})"; + } + // Move up if nothing is found. + versionFolder = Path.GetDirectoryName(versionFolder); } } + var config = interpreter.Configuration; if (moduleType == ModuleType.Builtins || moduleType == ModuleType.CompiledBuiltin || - string.IsNullOrEmpty(filePath) || fs.IsPathUnderRoot(standardLibraryPath, filePath)) { + string.IsNullOrEmpty(filePath) || modulePathType == PythonLibraryPathType.StdLib) { // If module is a standard library, unique id is its name + interpreter version. return $"{moduleName}({config.Version.Major}.{config.Version.Minor})"; } @@ -72,17 +79,22 @@ public static string GetUniqieId(string moduleName, string filePath, ModuleType private static string HashModuleContent(string moduleFolder, IFileSystem fs) { // Hash file sizes - using (var sha256 = SHA256.Create()) { - var total = fs - .GetFileSystemEntries(moduleFolder, "*.*", SearchOption.AllDirectories) - .Where(fs.FileExists) - .Select(fs.FileSize) - .Aggregate((hash, e) => unchecked(hash * 31 ^ e.GetHashCode())); + var total = fs + .GetFileSystemEntries(moduleFolder, "*.*", SearchOption.AllDirectories) + .Where(fs.FileExists) + .Select(fs.FileSize) + .Aggregate((hash, e) => unchecked(hash * 31 ^ e.GetHashCode())); + + return ((uint)total).ToString(); + } - return Convert - .ToBase64String(sha256.ComputeHash(BitConverter.GetBytes(total))) - .Replace('/', '_').Replace('+', '-'); + private static PythonLibraryPathType GetModulePathType(string modulePath, IEnumerable libraryPaths, IFileSystem fs) { + if (string.IsNullOrEmpty(modulePath)) { + return PythonLibraryPathType.Unspecified; } + return libraryPaths + .OrderByDescending(p => p.Path.Length) + .FirstOrDefault(p => fs.IsPathUnderRoot(p.Path, modulePath))?.Type ?? PythonLibraryPathType.Unspecified; } } } diff --git a/src/Caching/Impl/QualifiedNameParts.cs b/src/Caching/Impl/QualifiedNameParts.cs new file mode 100644 index 000000000..3bbb431bb --- /dev/null +++ b/src/Caching/Impl/QualifiedNameParts.cs @@ -0,0 +1,36 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; + +namespace Microsoft.Python.Analysis.Caching { + public enum ObjectType { + Type, + Instance, + Module, + VariableModule, + BuiltinModule, + NamedTuple + } + + internal struct QualifiedNameParts { + /// Object type. + public ObjectType ObjectType; + /// Module name. + public string ModuleName; + /// Module member names such as 'A', 'B', 'C' from module:A.B.C. + public IReadOnlyList MemberNames; + } +} diff --git a/src/Caching/Impl/TypeNames.cs b/src/Caching/Impl/TypeNames.cs index 5408d724f..d60025128 100644 --- a/src/Caching/Impl/TypeNames.cs +++ b/src/Caching/Impl/TypeNames.cs @@ -13,23 +13,38 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System; using System.Collections.Generic; +using System.Linq; using Microsoft.Python.Analysis.Modules; +using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; namespace Microsoft.Python.Analysis.Caching { internal static class TypeNames { - public static string GetQualifiedName(this IMember m) { + /// + /// Constructs persistent member name based on the member and the current module. + /// Persistent name contains complete information for the member restoration code. + /// + public static string GetPersistentQualifiedName(this IMember m) { var t = m.GetPythonType(); if (!t.IsUnknown()) { switch (m) { - case IPythonInstance _: - return $"i:{t.QualifiedName}"; + case IPythonInstance _: // constants and strings map here. + return t is ITypingNamedTupleType nt1 ? $"n:{nt1.QualifiedName}" : $"i:{t.QualifiedName}"; + case IBuiltinsPythonModule b: + return $"b:{b.QualifiedName}"; + case PythonVariableModule vm: + return $"p:{vm.QualifiedName}"; + case IPythonModule mod: + return $"m:{mod.QualifiedName}"; + case ITypingNamedTupleType nt2: + return $"n:{nt2.QualifiedName}"; case IPythonType pt when pt.DeclaringModule.ModuleType == ModuleType.Builtins: - return pt.TypeId == BuiltinTypeId.Ellipsis ? "ellipsis" : pt.Name; + return $"t:{(pt.TypeId == BuiltinTypeId.Ellipsis ? "ellipsis" : pt.QualifiedName)}"; case IPythonType pt: - return pt.QualifiedName; + return $"t:{pt.QualifiedName}"; case null: break; } @@ -42,54 +57,80 @@ public static string GetQualifiedName(this IMember m) { /// qualified name designates instance (prefixed with 'i:'). /// /// Qualified name to split. May include instance prefix. - /// Module name. - /// Module member names such as 'A', 'B', 'C' from module:A.B.C. - /// If true, the qualified name describes instance of a type. - public static bool DeconstructQualifiedName(string qualifiedName, out string moduleName, out IReadOnlyList memberNames, out bool isInstance) { - moduleName = null; - memberNames = null; - isInstance = false; - + /// Qualified name parts. + public static bool DeconstructQualifiedName(string qualifiedName, out QualifiedNameParts parts) { + parts = new QualifiedNameParts(); if (string.IsNullOrEmpty(qualifiedName)) { return false; } - isInstance = qualifiedName.StartsWith("i:"); - qualifiedName = isInstance ? qualifiedName.Substring(2) : qualifiedName; + GetObjectTypeFromPrefix(qualifiedName, ref parts, out var prefixOffset); + GetModuleNameAndMembers(qualifiedName, ref parts, prefixOffset); - if (qualifiedName == "..." || qualifiedName == "ellipsis") { - moduleName = @"builtins"; - memberNames = new[] { "ellipsis" }; - return true; + return !string.IsNullOrEmpty(parts.ModuleName); + } + + private static void GetObjectTypeFromPrefix(string qualifiedName, ref QualifiedNameParts parts, out int prefixOffset) { + prefixOffset = 2; + if (qualifiedName.StartsWith("i:")) { + parts.ObjectType = ObjectType.Instance; + } else if (qualifiedName.StartsWith("m:")) { + parts.ObjectType = ObjectType.Module; + } else if (qualifiedName.StartsWith("p:")) { + parts.ObjectType = ObjectType.VariableModule; + } else if (qualifiedName.StartsWith("b:")) { + parts.ObjectType = ObjectType.BuiltinModule; + } else if (qualifiedName.StartsWith("t:")) { + parts.ObjectType = ObjectType.Type; + } else if (qualifiedName.StartsWith("n:")) { + parts.ObjectType = ObjectType.NamedTuple; + } else { + // Unprefixed name is typically an argument to another type like Union[int, typing:Any] + parts.ObjectType = ObjectType.Type; + prefixOffset = 0; } + } - var moduleSeparatorIndex = qualifiedName.IndexOf(':'); + private static void GetModuleNameAndMembers(string qualifiedName, ref QualifiedNameParts parts, int prefixOffset) { + // Strip the prefix, turning i:module:A.B.C into module:A.B.C + var typeName = qualifiedName.Substring(prefixOffset); + + var moduleSeparatorIndex = typeName.IndexOf(':'); if (moduleSeparatorIndex < 0) { - moduleName = @"builtins"; - memberNames = new[] { qualifiedName }; - return true; + switch (parts.ObjectType) { + case ObjectType.Type: + case ObjectType.Instance: + // No module name means built-in type like 'int' or 'i:str'. + parts.ModuleName = @"builtins"; + parts.MemberNames = typeName == "..." ? new[] { "ellipsis" } : typeName.Split('.').ToArray(); + break; + default: + parts.ModuleName = typeName; + parts.MemberNames = Array.Empty(); + break; + } + return; } - - moduleName = qualifiedName.Substring(0, moduleSeparatorIndex); - // First chunk is qualified module name except dots in braces. - // Builtin types don't have module prefix. - memberNames = GetParts(qualifiedName.Substring(moduleSeparatorIndex+1)); - return !string.IsNullOrEmpty(moduleName); + + // Extract module name and member names, of any. + parts.ModuleName = typeName.Substring(0, moduleSeparatorIndex); + var memberNamesOffset = parts.ModuleName.Length + 1; + parts.MemberNames = GetTypeNames(typeName.Substring(memberNamesOffset), '.'); } - private static IReadOnlyList GetParts(string qualifiedTypeName) { + public static IReadOnlyList GetTypeNames(string qualifiedTypeName, char separator) { var parts = new List(); for (var i = 0; i < qualifiedTypeName.Length; i++) { - var part = GetSubPart(qualifiedTypeName, ref i); + var part = GetTypeName(qualifiedTypeName, ref i, separator); if (string.IsNullOrEmpty(part)) { break; } - parts.Add(part); + parts.Add(part.Trim()); } return parts; } - private static string GetSubPart(string s, ref int i) { + public static string GetTypeName(string s, ref int i, char separator) { var braceCounter = new Stack(); var start = i; for (; i < s.Length; i++) { @@ -106,12 +147,12 @@ private static string GetSubPart(string s, ref int i) { } } - if (braceCounter.Count == 0 && ch == '.') { + if (braceCounter.Count == 0 && ch == separator) { break; } } - return s.Substring(start, i - start); + return s.Substring(start, i - start).Trim(); } } } diff --git a/src/Caching/Test/AnalysisCachingTestBase.cs b/src/Caching/Test/AnalysisCachingTestBase.cs index afb91091c..34927e303 100644 --- a/src/Caching/Test/AnalysisCachingTestBase.cs +++ b/src/Caching/Test/AnalysisCachingTestBase.cs @@ -41,6 +41,9 @@ protected string BaselineFilesFolder { } } - protected string GetBaselineFileName(string testName) => Path.ChangeExtension(Path.Combine(BaselineFilesFolder, testName), "json"); + protected string GetBaselineFileName(string testName, string suffix = null) + => Path.ChangeExtension(suffix == null + ? Path.Combine(BaselineFilesFolder, testName) + : Path.Combine(BaselineFilesFolder, testName + suffix), "json"); } } diff --git a/src/Caching/Test/ClassesTests.cs b/src/Caching/Test/ClassesTests.cs index f0b06de74..adaa23093 100644 --- a/src/Caching/Test/ClassesTests.cs +++ b/src/Caching/Test/ClassesTests.cs @@ -15,6 +15,7 @@ using System.Threading.Tasks; using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Caching.Tests.FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using TestUtilities; diff --git a/src/Caching/Test/CoreTests.cs b/src/Caching/Test/CoreTests.cs index 38bb3b3c0..c5cd6ea1e 100644 --- a/src/Caching/Test/CoreTests.cs +++ b/src/Caching/Test/CoreTests.cs @@ -16,6 +16,8 @@ using System.Threading.Tasks; using FluentAssertions; using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Tests.FluentAssertions; +using Microsoft.Python.Parsing.Tests; using Microsoft.VisualStudio.TestTools.UnitTesting; using TestUtilities; @@ -32,6 +34,7 @@ public void TestInitialize() public void Cleanup() => TestEnvironmentImpl.TestCleanup(); private string BaselineFileName => GetBaselineFileName(TestContext.TestName); + private string GetBaselineFileNameWithSuffix(string suffix) => GetBaselineFileName(TestContext.TestName, suffix); [TestMethod, Priority(0)] public async Task SmokeTest() { @@ -61,27 +64,51 @@ def func(): Baseline.CompareToFile(BaselineFileName, json); } - [DataTestMethod, Priority(0)] - [DataRow("", null, null, false)] - [DataRow("str", "builtins", "str", false)] - [DataRow("i:str", "builtins", "str", true)] - [DataRow("i:...", "builtins", "ellipsis", true)] - [DataRow("ellipsis", "builtins", "ellipsis", false)] - [DataRow("i:builtins:str", "builtins", "str", true)] - [DataRow("i:mod:x", "mod", "x", true)] - [DataRow("typing:Union[str, tuple]", "typing", "Union[str, tuple]", false)] - [DataRow("typing:Union[typing:Any, mod:y]", "typing", "Union[typing:Any, mod:y]", false)] - [DataRow("typing:Union[typing:Union[str, int], mod:y]", "typing", "Union[typing:Union[str, int], mod:y]", false)] - public void QualifiedNames(string qualifiedName, string moduleName, string typeName, bool isInstance) { - TypeNames.DeconstructQualifiedName(qualifiedName, out var actualModuleName, out var actualMemberNames, out var actualIsInstance); - actualModuleName.Should().Be(moduleName); - if (string.IsNullOrEmpty(qualifiedName)) { - actualMemberNames.Should().BeNull(); - } else { - actualMemberNames[0].Should().Be(typeName); + [DataRow("t:str", "builtins", "str", ObjectType.Type)] + [DataRow("i:str", "builtins", "str", ObjectType.Instance)] + [DataRow("i:...", "builtins", "ellipsis", ObjectType.Instance)] + [DataRow("t:ellipsis", "builtins", "ellipsis", ObjectType.Type)] + [DataRow("i:builtins:str", "builtins", "str", ObjectType.Instance)] + [DataRow("i:mod:x", "mod", "x", ObjectType.Instance)] + [DataRow("t:typing:Union[str, tuple]", "typing", "Union[str, tuple]", ObjectType.Type)] + [DataRow("t:typing:Union[typing:Any, mod:y]", "typing", "Union[typing:Any, mod:y]", ObjectType.Type)] + [DataRow("t:typing:Union[typing:Union[str, int], mod:y]", "typing", "Union[typing:Union[str, int], mod:y]", ObjectType.Type)] + [DataRow("m:typing", "typing", "", ObjectType.Module)] + [DataRow("p:A", "A", "", ObjectType.VariableModule)] + public void QualifiedNames(string qualifiedName, string moduleName, string typeName, ObjectType objectType) { + TypeNames.DeconstructQualifiedName(qualifiedName, out var parts); + parts.ModuleName.Should().Be(moduleName); + switch (objectType) { + case ObjectType.Instance: + case ObjectType.Type: + parts.MemberNames[0].Should().Be(typeName); + break; + default: + parts.MemberNames.Should().BeEmpty(); + break; } - actualIsInstance.Should().Be(isInstance); + parts.ObjectType.Should().Be(objectType); + } + + [DataTestMethod, Priority(0)] + [DataRow(true)] + [DataRow(false)] + public async Task VersionHandling(bool is3x) { + const string code = @" +if sys.version_info >= (3, 0): + def func(a, b, c): ... +else: + def func(a): ... +"; + var analysis = await GetAnalysisAsync(code, is3x ? PythonVersions.LatestAvailable3X : PythonVersions.LatestAvailable2X); + analysis.Should().HaveFunction("func") + .Which.Should().HaveSingleOverload() + .Which.Should().HaveParameters(is3x ? new[] { "a", "b", "c" } : new[] { "a" }); + + var model = ModuleModel.FromAnalysis(analysis, Services); + var json = ToJson(model); + Baseline.CompareToFile(GetBaselineFileNameWithSuffix(is3x ? "3" : "2"), json); } } } diff --git a/src/Caching/Test/Files/Builtins.json b/src/Caching/Test/Files/Builtins.json deleted file mode 100644 index 8a5415c33..000000000 --- a/src/Caching/Test/Files/Builtins.json +++ /dev/null @@ -1,59942 +0,0 @@ -{ - "UniqueId": "builtins(3.7)", - "Documentation": "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", - "Functions": [ - { - "Documentation": "", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24816593, - "Name": "type", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "__build_class__(func, name, *bases, metaclass=None, **kwds) -> class\n\nInternal helper function used by the class statement.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "func", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bases", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "metaclass", - "Type": null, - "DefaultValue": null, - "Kind": 3 - }, - { - "Name": "kwds", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 186877360, - "Name": "__build_class__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "__import__(name, globals=None, locals=None, fromlist=(), level=0) -> module\n\nImport a module. Because this function is meant for use by the Python\ninterpreter and not for general use, it is better to use\nimportlib.import_module() to programmatically import a module.\n\nThe globals argument is only used to determine the context;\nthey are not modified. The locals argument is unused. The fromlist\nshould be a list of names to emulate ``from name import ...'', or an\nempty list to emulate ``import name''.\nWhen importing a module from a package, note that __import__('A.B', ...)\nreturns package A when fromlist is empty, but its submodule B when\nfromlist is not empty. The level argument is used to determine whether to\nperform absolute or relative imports: 0 is absolute, while a positive number\nis the number of parent directories to search relative to the current module.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "globals", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "locals", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "fromlist", - "Type": "tuple", - "DefaultValue": "i:tuple", - "Kind": 0 - }, - { - "Name": "level", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -200972932, - "Name": "__import__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the absolute value of the argument.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "x", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 781563, - "Name": "abs", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if bool(x) is True for all values x in the iterable.\n\nIf the iterable is empty, return True.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 781866, - "Name": "all", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if bool(x) is True for any x in the iterable.\n\nIf the iterable is empty, return False.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 781941, - "Name": "any", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return an ASCII-only representation of an object.\n\nAs repr(), return a string containing a printable representation of an\nobject, but escape the non-ASCII characters in the string returned by\nrepr() using \\\\x, \\\\u or \\\\U escapes. This generates a string similar\nto that returned by repr() in Python 2.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "obj", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 751576474, - "Name": "ascii", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the binary representation of an integer.\n\n >>> bin(2796202)\n '0b1010101010101010101010'", - "Overloads": [ - { - "Parameters": [ - { - "Name": "number", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 782736, - "Name": "bin", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "breakpoint(*args, **kws)\n\nCall sys.breakpointhook(*args, **kws). sys.breakpointhook() must accept\nwhatever arguments are passed.\n\nBy default, this drops you into the pdb debugger.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kws", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1356147896, - "Name": "breakpoint", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return whether the object is callable (i.e., some kind of function).\n\nNote that classes are callable, as are instances of classes with a\n__call__() method.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "obj", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1205971407, - "Name": "callable", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "i", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 783670, - "Name": "chr", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Compile source into a code object that can be executed by exec() or eval().\n\nThe source code may represent a Python module, statement or expression.\nThe filename will be used for run-time error messages.\nThe mode must be 'exec' to compile a module, 'single' to compile a\nsingle (interactive) statement, or 'eval' to compile an expression.\nThe flags argument, if present, controls which future statements influence\nthe compilation of the code.\nThe dont_inherit argument, if true, stops the compilation inheriting\nthe effects of any future statements in effect in the code calling\ncompile; if absent or false these statements do influence the compilation,\nin addition to any features explicitly specified.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "source", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "filename", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "mode", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "flags", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "dont_inherit", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "optimize", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1914543556, - "Name": "compile", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1298046352, - "Name": "copyright", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1836401501, - "Name": "credits", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Deletes the named attribute from the given object.\n\ndelattr(x, 'y') is equivalent to ``del x.y''", - "Overloads": [ - { - "Parameters": [ - { - "Name": "obj", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1314690939, - "Name": "delattr", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "dir([object]) -> list of strings\n\nIf called without an argument, return the names in the current scope.\nElse, return an alphabetized list of names comprising (some of) the attributes\nof the given object, and of attributes reachable from it.\nIf the object supplies a method named __dir__, it will be used; otherwise\nthe default dir() logic is used and returns:\n for a module object: the module's attributes.\n for a class object: its attributes, and recursively the attributes\n of its bases.\n for any other object: its attributes, its class's attributes, and\n recursively the attributes of its class's base classes.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "object", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 784662, - "Name": "dir", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the tuple (x//y, x%y). Invariant: div*y + mod == x.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "x", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "y", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1901256616, - "Name": "divmod", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Evaluate the given source in the context of globals and locals.\n\nThe source may be a string representing a Python expression\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "source", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "globals", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "locals", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "object" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24366387, - "Name": "eval", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Execute the given source in the context of globals and locals.\n\nThe source may be a string representing one or more Python statements\nor a code object as returned by compile().\nThe globals must be a dictionary and locals can be any mapping,\ndefaulting to the current globals and locals.\nIf only globals is given, locals defaults to it.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "source", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "globals", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "locals", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24368424, - "Name": "exec", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "code", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24368565, - "Name": "exit", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return value.__format__(format_spec)\n\nformat_spec defaults to the empty string.\nSee the Format Specification Mini-Language section of help('FORMATTING') for\ndetails.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "format_spec", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1963936462, - "Name": "format", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getattr(object, name[, default]) -> value\n\nGet a named attribute from an object; getattr(x, 'y') is equivalent to x.y.\nWhen a default argument is given, it is returned when the attribute doesn't\nexist; without it, an exception is raised in that case.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "object", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "default", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1355208272, - "Name": "getattr", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the dictionary containing the current scope's global variables.\n\nNOTE: Updates to this dictionary *will* affect name lookups in the current\nglobal scope and vice-versa.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:dict" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1551006009, - "Name": "globals", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return whether the object has an attribute with the given name.\n\nThis is done by calling getattr(obj, name) and catching AttributeError.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "obj", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2127271828, - "Name": "hasattr", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the hash value for the given object.\n\nTwo objects that compare equal must also have the same hash value, but the\nreverse is not necessarily true.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "obj", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24436133, - "Name": "hash", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Define the builtin 'help'.\n\n This is a wrapper around pydoc.help that provides a helpful message\n when 'help' is typed at the Python interactive prompt.\n\n Calling help() at the Python prompt starts an interactive help session.\n Calling help(thing) prints help for the python object 'thing'.\n ", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwds", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24439768, - "Name": "help", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the hexadecimal representation of an integer.\n\n >>> hex(12648430)\n '0xc0ffee'", - "Overloads": [ - { - "Parameters": [ - { - "Name": "number", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 788388, - "Name": "hex", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the identity of an object.\n\nThis is guaranteed to be unique among simultaneously existing objects.\n(CPython uses the object's memory address.)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "obj", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 25458, - "Name": "id", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Read a string from standard input. The trailing newline is stripped.\n\nThe prompt string, if given, is printed to standard output without a\ntrailing newline before reading input.\n\nIf the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.\nOn *nix systems, readline is used if available.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "prompt", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 758828563, - "Name": "input", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return whether an object is an instance of a class or of a subclass thereof.\n\nA tuple, as in ``isinstance(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``isinstance(x, A) or isinstance(x, B)\nor ...`` etc.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "obj", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "class_or_tuple", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1317005078, - "Name": "isinstance", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return whether 'cls' is a derived from another class or is the same class.\n\nA tuple, as in ``issubclass(x, (A, B, ...))``, may be given as the target to\ncheck against. This is equivalent to ``issubclass(x, A) or issubclass(x, B)\nor ...`` etc.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "class_or_tuple", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1314249287, - "Name": "issubclass", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "iter(iterable) -> iterator\niter(callable, sentinel) -> iterator\n\nGet an iterator from an object. In the first form, the argument must\nsupply its own iterator, or be a sequence.\nIn the second form, the callable is called until it returns the sentinel.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "callable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sentinel", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24483759, - "Name": "iter", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the number of items in a container.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "obj", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 792222, - "Name": "len", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "interactive prompt objects for printing the license text, a list of\n contributors and the copyright notice.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1596689482, - "Name": "license", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a dictionary containing the current scope's local variables.\n\nNOTE: Whether or not updates to this dictionary will affect name lookups in\nthe local scope and vice-versa is *implementation dependent* and not\ncovered by any backwards compatibility guarantees.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:dict" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2135253311, - "Name": "locals", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "max(iterable, *[, default=obj, key=func]) -> value\nmax(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its biggest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the largest argument.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "default", - "Type": null, - "DefaultValue": null, - "Kind": 3 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 3 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 793069, - "Name": "max", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "min(iterable, *[, default=obj, key=func]) -> value\nmin(arg1, arg2, *args, *[, key=func]) -> value\n\nWith a single iterable argument, return its smallest item. The\ndefault keyword-only argument specifies an object to return if\nthe provided iterable is empty.\nWith two or more arguments, return the smallest argument.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "default", - "Type": null, - "DefaultValue": null, - "Kind": 3 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 3 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 793307, - "Name": "min", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "next(iterator[, default])\n\nReturn the next item from the iterator. If default is given and the iterator\nis exhausted, it is returned instead of raising StopIteration.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "iterator", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "default", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24618890, - "Name": "next", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the octal representation of an integer.\n\n >>> oct(342391)\n '0o1234567'", - "Overloads": [ - { - "Parameters": [ - { - "Name": "number", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 795049, - "Name": "oct", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Open file and return a stream. Raise OSError upon failure.\n\nfile is either a text or byte string giving the name (and the path\nif the file isn't in the current working directory) of the file to\nbe opened or an integer file descriptor of the file to be\nwrapped. (If a file descriptor is given, it is closed when the\nreturned I/O object is closed, unless closefd is set to False.)\n\nmode is an optional string that specifies the mode in which the file\nis opened. It defaults to 'r' which means open for reading in text\nmode. Other common values are 'w' for writing (truncating the file if\nit already exists), 'x' for creating and writing to a new file, and\n'a' for appending (which on some Unix systems, means that all writes\nappend to the end of the file regardless of the current seek position).\nIn text mode, if encoding is not specified the encoding used is platform\ndependent: locale.getpreferredencoding(False) is called to get the\ncurrent locale encoding. (For reading and writing raw bytes use binary\nmode and leave encoding unspecified.) The available modes are:\n\n========= ===============================================================\nCharacter Meaning\n--------- ---------------------------------------------------------------\n'r' open for reading (default)\n'w' open for writing, truncating the file first\n'x' create a new file and open it for writing\n'a' open for writing, appending to the end of the file if it exists\n'b' binary mode\n't' text mode (default)\n'+' open a disk file for updating (reading and writing)\n'U' universal newline mode (deprecated)\n========= ===============================================================\n\nThe default mode is 'rt' (open for reading text). For binary random\naccess, the mode 'w+b' opens and truncates the file to 0 bytes, while\n'r+b' opens the file without truncation. The 'x' mode implies 'w' and\nraises an `FileExistsError` if the file already exists.\n\nPython distinguishes between files opened in binary and text modes,\neven when the underlying operating system doesn't. Files opened in\nbinary mode (appending 'b' to the mode argument) return contents as\nbytes objects without any decoding. In text mode (the default, or when\n't' is appended to the mode argument), the contents of the file are\nreturned as strings, the bytes having been first decoded using a\nplatform-dependent encoding or using the specified encoding if given.\n\n'U' mode is deprecated and will raise an exception in future versions\nof Python. It has no effect in Python 3. Use newline to control\nuniversal newlines mode.\n\nbuffering is an optional integer used to set the buffering policy.\nPass 0 to switch buffering off (only allowed in binary mode), 1 to select\nline buffering (only usable in text mode), and an integer > 1 to indicate\nthe size of a fixed-size chunk buffer. When no buffering argument is\ngiven, the default buffering policy works as follows:\n\n* Binary files are buffered in fixed-size chunks; the size of the buffer\n is chosen using a heuristic trying to determine the underlying device's\n \"block size\" and falling back on `io.DEFAULT_BUFFER_SIZE`.\n On many systems, the buffer will typically be 4096 or 8192 bytes long.\n\n* \"Interactive\" text files (files for which isatty() returns True)\n use line buffering. Other text files use the policy described above\n for binary files.\n\nencoding is the name of the encoding used to decode or encode the\nfile. This should only be used in text mode. The default encoding is\nplatform dependent, but any encoding supported by Python can be\npassed. See the codecs module for the list of supported encodings.\n\nerrors is an optional string that specifies how encoding errors are to\nbe handled---this argument should not be used in binary mode. Pass\n'strict' to raise a ValueError exception if there is an encoding error\n(the default of None has the same effect), or pass 'ignore' to ignore\nerrors. (Note that ignoring encoding errors can lead to data loss.)\nSee the documentation for codecs.register or run 'help(codecs.Codec)'\nfor a list of the permitted encoding error strings.\n\nnewline controls how universal newlines works (it only applies to text\nmode). It can be None, '', '\\n', '\\r', and '\\r\\n'. It works as\nfollows:\n\n* On input, if newline is None, universal newlines mode is\n enabled. Lines in the input can end in '\\n', '\\r', or '\\r\\n', and\n these are translated into '\\n' before being returned to the\n caller. If it is '', universal newline mode is enabled, but line\n endings are returned to the caller untranslated. If it has any of\n the other legal values, input lines are only terminated by the given\n string, and the line ending is returned to the caller untranslated.\n\n* On output, if newline is None, any '\\n' characters written are\n translated to the system default line separator, os.linesep. If\n newline is '' or '\\n', no translation takes place. If newline is any\n of the other legal values, any '\\n' characters written are translated\n to the given string.\n\nIf closefd is False, the underlying file descriptor will be kept open\nwhen the file is closed. This does not work when a file name is given\nand must be True in that case.\n\nA custom opener can be used by passing a callable as *opener*. The\nunderlying file descriptor for the file object is then obtained by\ncalling *opener* with (*file*, *flags*). *opener* must return an open\nfile descriptor (passing os.open as *opener* results in functionality\nsimilar to passing None).\n\nopen() returns a file object whose type depends on the mode, and\nthrough which the standard file operations such as reading and writing\nare performed. When open() is used to open a file in a text mode ('w',\n'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open\na file in a binary mode, the returned class varies: in read binary\nmode, it returns a BufferedReader; in write binary and append binary\nmodes, it returns a BufferedWriter, and in read/write mode, it returns\na BufferedRandom.\n\nIt is also possible to use a string or bytearray as a file for both\nreading and writing. For strings StringIO can be used like a file\nopened in a text mode, and for bytes a BytesIO can be used like a file\nopened in a binary mode.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "file", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "mode", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "buffering", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "encoding", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "errors", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "newline", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "closefd", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "opener", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24658657, - "Name": "open", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the Unicode code point for a one-character string.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "c", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 795498, - "Name": "ord", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Equivalent to x**y (with two arguments) or x**y % z (with three arguments)\n\nSome types, such as ints, are able to use a more efficient algorithm when\ninvoked using the three argument form.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "x", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "y", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "z", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 796385, - "Name": "pow", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)\n\nPrints the values to a stream, or to sys.stdout by default.\nOptional keyword arguments:\nfile: a file-like object (stream); defaults to the current sys.stdout.\nsep: string inserted between values, default a space.\nend: string appended after the last value, default a newline.\nflush: whether to forcibly flush the stream.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 765405430, - "Name": "print", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "code", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24723174, - "Name": "quit", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 766750598, - "Name": "range", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the canonical string representation of the object.\n\nFor many object types, including most builtins, eval(repr(obj)) == obj.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "obj", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24737804, - "Name": "repr", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Round a number to a given precision in decimal digits.\n\nThe return value is an integer if ndigits is omitted or None. Otherwise\nthe return value has the same type as the number. ndigits may be negative.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "number", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "ndigits", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 767174615, - "Name": "round", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Sets the named attribute on the given object to the specified value.\n\nsetattr(x, 'y', v) is equivalent to ``x.y = v''", - "Overloads": [ - { - "Parameters": [ - { - "Name": "obj", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -879649444, - "Name": "setattr", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a new list containing all items from the iterable in ascending order.\n\nA custom key function can be supplied to customize the sort order, and the\nreverse flag can be set to request the result in descending order.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1958845036, - "Name": "sorted", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the sum of a 'start' value (default: 0) plus an iterable of numbers\n\nWhen the iterable is empty, return the start value.\nThis function is intended specifically for use with numeric values and may\nreject non-numeric types.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 799444, - "Name": "sum", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "vars([object]) -> dictionary\n\nWithout arguments, equivalent to locals().\nWith an argument, equivalent to object.__dict__.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "object", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24853187, - "Name": "vars", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 783823, - "Name": "cmp", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Variables": [ - { - "Value": "object", - "Id": 376535734, - "Name": "__Object__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "int", - "Id": -1660953576, - "Name": "__Int__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "bool", - "Id": -149570207, - "Name": "__Bool__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "int", - "Id": 136686707, - "Name": "__Long__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "float", - "Id": -1172856571, - "Name": "__Float__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "complex", - "Id": -1125625831, - "Name": "__Complex__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "tuple", - "Id": -1373807759, - "Name": "__Tuple__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "list", - "Id": 131307029, - "Name": "__List__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "dict", - "Id": -98202835, - "Name": "__Dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "set", - "Id": -1651986485, - "Name": "__Set__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "frozenset", - "Id": -1845664181, - "Name": "__FrozenSet__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "bytes", - "Id": -50989228, - "Name": "__Bytes__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "bytes_iterator", - "Id": 1196082274, - "Name": "__BytesIterator__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "str", - "Id": -667382010, - "Name": "__Unicode__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "str_iterator", - "Id": 899385876, - "Name": "__UnicodeIterator__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "str", - "Id": -1651541542, - "Name": "__Str__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "str_iterator", - "Id": -1693163288, - "Name": "__StrIterator__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "module", - "Id": -318216541, - "Name": "__Module__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "function", - "Id": -56357041, - "Name": "__Function__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "wrapper_descriptor", - "Id": 2031680028, - "Name": "__BuiltinMethodDescriptor__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "builtin_function_or_method", - "Id": -998173500, - "Name": "__BuiltinFunction__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "generator", - "Id": 1086442300, - "Name": "__Generator__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "property", - "Id": -919605748, - "Name": "__Property__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "classmethod", - "Id": -991650526, - "Name": "__ClassMethod__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "staticmethod", - "Id": 1863225126, - "Name": "__StaticMethod__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "ellipsis", - "Id": 961323528, - "Name": "__Ellipsis__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "tuple_iterator", - "Id": 1754184575, - "Name": "__TupleIterator__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "list_iterator", - "Id": 692195875, - "Name": "__ListIterator__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "dict_keys", - "Id": -414283327, - "Name": "__DictKeys__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "dict_values", - "Id": -623419857, - "Name": "__DictValues__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "dict_items", - "Id": -1322081197, - "Name": "__DictItems__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "set_iterator", - "Id": 1366627801, - "Name": "__SetIterator__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "callable_iterator", - "Id": 1819825725, - "Name": "__CallableIterator__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": null, - "Id": -2048509720, - "Name": "__builtin_module_names__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:ellipsis", - "Id": 1631567368, - "Name": "Ellipsis", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:OSError", - "Id": 763574764, - "Name": "EnvironmentError", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:OSError", - "Id": -172840821, - "Name": "IOError", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:NotImplementedType", - "Id": -1818427354, - "Name": "NotImplemented", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:OSError", - "Id": 1763918588, - "Name": "WindowsError", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": null, - "Id": -1636005055, - "Name": "__doc__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": null, - "Id": 1097116834, - "Name": "__name__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": null, - "Id": 75395663, - "Name": "__package__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "bool", - "Id": 23856709, - "Name": "True", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "bool", - "Id": 726114124, - "Name": "False", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "__NoneType__", - "Id": 23674863, - "Name": "None", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Classes": [ - { - "Documentation": null, - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "NotImplementedType", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "NotImplementedType", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "NotImplementedType", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -544113923, - "Name": "__reduce__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return repr(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "NotImplementedType", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1215429388, - "Name": "__repr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "NotImplementedType", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 2136768640, - "Name": "NotImplementedType", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "Bases": [], - "Methods": [], - "Properties": [], - "Fields": [ - { - "Value": null, - "Id": 1097116834, - "Name": "__name__", - "IndexSpan": null - }, - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 1423120691, - "Name": "__Unknown__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "the type of the None object", - "Bases": [], - "Methods": [], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 1499999113, - "Name": "__NoneType__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "The most base type", - "Bases": [], - "Methods": [ - { - "Documentation": "Implement delattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2095540485, - "Name": "__delattr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Default dir() implementation.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1636169386, - "Name": "__dir__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Default object formatter.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "format_spec", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 695475534, - "Name": "__format__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "The most base type", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given. If x is a number, return x.__int__(). For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base. The literal can be preceded by '+' or '-' and be surrounded\nby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n>>> int('0b100', base=0)\n4", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "abs(self)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1639147525, - "Name": "__abs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self+value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1639102358, - "Name": "__add__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self&value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1638804448, - "Name": "__and__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "self != 0", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 766562625, - "Name": "__bool__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Ceiling of an Integral returns itself.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 785777820, - "Name": "__ceil__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return divmod(self, value).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 589685672, - "Name": "__divmod__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "float(self)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1457457445, - "Name": "__float__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Flooring an Integral returns itself.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1457872597, - "Name": "__floor__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self//value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 778272028, - "Name": "__floordiv__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "format_spec", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 695475534, - "Name": "__format__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self converted to an integer, if self is suitable for use as an index into a list.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -127776229, - "Name": "__index__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "int([x]) -> integer\nint(x, base=10) -> integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given. If x is a number, return x.__int__(). For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base. The literal can be preceded by '+' or '-' and be surrounded\nby whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n>>> int('0b100', base=0)\n4", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "x", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "base", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "int(self)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1631400904, - "Name": "__int__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "~self", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 849070445, - "Name": "__invert__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<>self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1555101003, - "Name": "__rrshift__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -900426137, - "Name": "__rshift__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return value-self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1228492261, - "Name": "__rsub__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return value/self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1563284312, - "Name": "__rtruediv__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return value^self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1232946496, - "Name": "__rxor__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Returns size in memory, in bytes.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1069167279, - "Name": "__sizeof__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return str(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1621988870, - "Name": "__str__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self-value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1621974455, - "Name": "__sub__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self/value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:float" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -375214324, - "Name": "__truediv__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Truncating an Integral returns itself.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1175294069, - "Name": "__trunc__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self^value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1617520220, - "Name": "__xor__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Number of bits necessary to represent self in binary.\n\n>>> bin(37)\n'0b100101'\n>>> (37).bit_length()\n6", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 641823151, - "Name": "bit_length", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Returns self, the complex conjugate of any int.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:complex" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -903692703, - "Name": "conjugate", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the integer represented by the given array of bytes.\n\n bytes\n Holds the array of bytes to convert. The argument must either\n support the buffer protocol or be an iterable object producing bytes.\n Bytes and bytearray are examples of built-in objects that support the\n buffer protocol.\n byteorder\n The byte order used to represent the integer. If byteorder is 'big',\n the most significant byte is at the beginning of the byte array. If\n byteorder is 'little', the most significant byte is at the end of the\n byte array. To request the native byte order of the host system, use\n `sys.byteorder' as the byte order value.\n signed\n Indicates whether two's complement is used to represent the integer.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "type", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bytes", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "byteorder", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -190029075, - "Name": "from_bytes", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return an array of bytes representing an integer.\n\n length\n Length of bytes object to use. An OverflowError is raised if the\n integer is not representable with the given number of bytes.\n byteorder\n The byte order used to represent the integer. If byteorder is 'big',\n the most significant byte is at the beginning of the byte array. If\n byteorder is 'little', the most significant byte is at the end of the\n byte array. To request the native byte order of the host system, use\n `sys.byteorder' as the byte order value.\n signed\n Determines whether two's complement is used to represent the integer.\n If signed is False and a negative integer is given, an OverflowError\n is raised.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "length", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "byteorder", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -71556418, - "Name": "to_bytes", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [ - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 985628143, - "Name": "denominator", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 24476897, - "Name": "imag", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 1522491474, - "Name": "numerator", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 24737333, - "Name": "real", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 789624, - "Name": "int", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.", - "Bases": [ - "int" - ], - "Methods": [ - { - "Documentation": "Return self&value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1638804448, - "Name": "__and__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "bool(x) -> bool\n\nReturns True when the argument x is true, False otherwise.\nThe builtins True and False are the only two instances of the class bool.\nThe class bool is a subclass of the class int, and cannot be subclassed.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "x", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self|value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748671418, - "Name": "__or__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return value&self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1211662268, - "Name": "__rand__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return repr(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1215429388, - "Name": "__repr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return value|self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1623061346, - "Name": "__ror__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return value^self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1232946496, - "Name": "__rxor__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return str(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1621988870, - "Name": "__str__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self^value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1617520220, - "Name": "__xor__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the integer represented by the given array of bytes.\n\n bytes\n Holds the array of bytes to convert. The argument must either\n support the buffer protocol or be an iterable object producing bytes.\n Bytes and bytearray are examples of built-in objects that support the\n buffer protocol.\n byteorder\n The byte order used to represent the integer. If byteorder is 'big',\n the most significant byte is at the beginning of the byte array. If\n byteorder is 'little', the most significant byte is at the end of the\n byte array. To request the native byte order of the host system, use\n `sys.byteorder' as the byte order value.\n signed\n Indicates whether two's complement is used to represent the integer.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "type", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bytes", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "byteorder", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -190029075, - "Name": "from_bytes", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 24270721, - "Name": "bool", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Convert a string or number to a floating point number, if possible.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "abs(self)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:float" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1639147525, - "Name": "__abs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self+value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:float" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1639102358, - "Name": "__add__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "self != 0", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 766562625, - "Name": "__bool__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return divmod(self, value).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 589685672, - "Name": "__divmod__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "float(self)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1457457445, - "Name": "__float__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self//value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 778272028, - "Name": "__floordiv__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Formats the float according to format_spec.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "format_spec", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 695475534, - "Name": "__format__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "You probably don't want to use this function.\n\n typestr\n Must be 'double' or 'float'.\n\nIt exists mainly to be used in Python's test suite.\n\nThis function returns whichever of 'unknown', 'IEEE, big-endian' or 'IEEE,\nlittle-endian' best describes the format of floating point numbers used by the\nC type named by typestr.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "type", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "typestr", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1018863830, - "Name": "__getformat__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Convert a string or number to a floating point number, if possible.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "int(self)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1631400904, - "Name": "__int__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>> (10.0).as_integer_ratio()\n(10, 1)\n>>> (0.0).as_integer_ratio()\n(0, 1)\n>>> (-.25).as_integer_ratio()\n(-1, 4)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1148559724, - "Name": "as_integer_ratio", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self, the complex conjugate of any float.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:complex" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -903692703, - "Name": "conjugate", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a floating-point number from a hexadecimal string.\n\n>>> float.fromhex('0x1.ffffp10')\n2047.984375\n>>> float.fromhex('-0x1p-1074')\n-5e-324", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "type", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "string", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 835611450, - "Name": "fromhex", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a hexadecimal representation of a floating-point number.\n\n>>> (-0.1).hex()\n'-0x1.999999999999ap-4'\n>>> 3.14159.hex()\n'0x1.921f9f01b866ep+1'", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 788388, - "Name": "hex", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the float is an integer.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 783186560, - "Name": "is_integer", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [ - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 24476897, - "Name": "imag", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 24737333, - "Name": "real", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 755996837, - "Name": "float", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a complex number from a real part and an optional imaginary part.\n\nThis is equivalent to (real + imag*1j) where imag defaults to 0.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "abs(self)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:complex" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1639147525, - "Name": "__abs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self+value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:complex" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1639102358, - "Name": "__add__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "self != 0", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 766562625, - "Name": "__bool__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return divmod(self, value).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 589685672, - "Name": "__divmod__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "float(self)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1457457445, - "Name": "__float__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self//value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 778272028, - "Name": "__floordiv__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "complex.__format__() -> str\n\nConvert to a string according to format_spec.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "format_spec", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 695475534, - "Name": "__format__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a complex number from a real part and an optional imaginary part.\n\nThis is equivalent to (real + imag*1j) where imag defaults to 0.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "int(self)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1631400904, - "Name": "__int__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self complex\n\nReturn the complex conjugate of its argument. (3-4j).conjugate() == 3+4j.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "complex", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:complex" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -903692703, - "Name": "conjugate", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [ - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 24476897, - "Name": "imag", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 24737333, - "Name": "real", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": -1914540871, - "Name": "complex", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return self+value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1639102358, - "Name": "__add__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return key in self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1841774666, - "Name": "__contains__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Built-in immutable sequence.\n\nIf no argument is given, the constructor returns an empty tuple.\nIf iterable is specified the tuple is initialized from iterable's items.\n\nIf the argument is a tuple, the return value is the same object.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple_iterator" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "x.__getitem__(y) <==> x[y]", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "index", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement self+=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 953701999, - "Name": "__iadd__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement self*=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965298386, - "Name": "__imul__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Built-in mutable sequence.\n\nIf no argument is given, the constructor creates a new empty list.\nThe argument must be an iterable if specified.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "list", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list_iterator" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self new empty dictionary\ndict(mapping) -> new dictionary initialized from a mapping object's\n (key, value) pairs\ndict(iterable) -> new dictionary initialized as if via:\n d = {}\n for k, v in iterable:\n d[k] = v\ndict(**kwargs) -> new dictionary initialized with the name=value pairs\n in the keyword argument list. For example: dict(one=1, two=2)", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "True if the dictionary has the specified key, else False.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1841774666, - "Name": "__contains__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Delete self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1970845273, - "Name": "__delitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "x.__getitem__(y) <==> x[y]", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "dict() -> new empty dictionary\ndict(mapping) -> new dictionary initialized from a mapping object's\n (key, value) pairs\ndict(iterable) -> new dictionary initialized as if via:\n d = {}\n for k, v in iterable:\n d[k] = v\ndict(**kwargs) -> new dictionary initialized with the name=value pairs\n in the keyword argument list. For example: dict(one=1, two=2)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict_keys" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self size of D in memory, in bytes", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1069167279, - "Name": "__sizeof__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "D.clear() -> None. Remove all items from D.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 753216662, - "Name": "clear", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "D.copy() -> a shallow copy of D", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24300556, - "Name": "copy", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a new dictionary with keys from iterable and values set to value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "type", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 134240693, - "Name": "fromkeys", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the value for key if key is in the dictionary, else default.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "default", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 787423, - "Name": "get", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "D.items() -> a set-like object providing a view on D's items", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict_items" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 758996489, - "Name": "items", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "D.keys() -> a set-like object providing a view on D's keys", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict_keys" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24529547, - "Name": "keys", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\nIf key is not found, d is returned if given, otherwise KeyError is raised", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "k", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "d", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict_keys" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 796378, - "Name": "pop", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "D.popitem() -> (k, v), remove and return some (key, value) pair as a\n2-tuple; but raise KeyError if D is empty.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "k", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "d", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict_items" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1035642093, - "Name": "popitem", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Insert key with a value of default if key is not in the dictionary.\n\nReturn the value for key if key is in the dictionary, else default.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "default", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 178640630, - "Name": "setdefault", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "D.update([E, ]**F) -> None. Update D from dict/iterable E and F.\nIf E is present and has a .keys() method, then does: for k in E: D[k] = E[k]\nIf E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v\nIn either case, this is followed by: for k in F: D[k] = F[k]", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "d", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1901098080, - "Name": "update", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "D.values() -> an object providing a view on D's values", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict_values" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1886064647, - "Name": "values", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": null - }, - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 24324173, - "Name": "dict", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "set() -> new empty set object\nset(iterable) -> new set object\n\nBuild an unordered collection of unique elements.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return self&value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:set" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1638804448, - "Name": "__and__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "x.__contains__(y) <==> y in x.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1841774666, - "Name": "__contains__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self&=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 953999909, - "Name": "__iand__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "set() -> new empty set object\nset(iterable) -> new set object\n\nBuild an unordered collection of unique elements.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self|=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1631373035, - "Name": "__ior__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self-=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 970829902, - "Name": "__isub__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:set_iterator" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self^=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 975284137, - "Name": "__ixor__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self size of S in memory, in bytes", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1069167279, - "Name": "__sizeof__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self-value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:set" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1621974455, - "Name": "__sub__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self^value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:set" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1617520220, - "Name": "__xor__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Add an element to a set.\n\nThis has no effect if the element is already present.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 781610, - "Name": "add", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Remove all elements from this set.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 753216662, - "Name": "clear", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a shallow copy of a set.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:set" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24300556, - "Name": "copy", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the difference of two or more sets as a new set.\n\n(i.e. all elements that are in this set but not the others.)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:set" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -946813804, - "Name": "difference", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Remove all elements of another set from this set.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "others", - "Type": null, - "DefaultValue": null, - "Kind": 1 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2053694164, - "Name": "difference_update", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Remove an element from a set if it is a member.\n\nIf the element is not a member, do nothing.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "elem", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1193668441, - "Name": "discard", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the intersection of two sets as a new set.\n\n(i.e. all elements that are in both sets.)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:set" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2011414560, - "Name": "intersection", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Update a set with the intersection of itself and another.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "others", - "Type": null, - "DefaultValue": null, - "Kind": 1 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1074130488, - "Name": "intersection_update", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if two sets have a null intersection.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1041514301, - "Name": "isdisjoint", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Report whether another set contains this set.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2076857571, - "Name": "issubset", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Report whether this set contains another set.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -911398520, - "Name": "issuperset", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Remove and return an arbitrary set element.\nRaises KeyError if the set is empty.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 796378, - "Name": "pop", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Remove an element from a set; it must be a member.\n\nIf the element is not a member, raise a KeyError.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "elem", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1996862629, - "Name": "remove", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the symmetric difference of two sets as a new set.\n\n(i.e. all elements that are in exactly one of the sets.)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:set" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 796556764, - "Name": "symmetric_difference", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Update a set with the symmetric difference of itself and another.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "others", - "Type": null, - "DefaultValue": null, - "Kind": 1 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -81680244, - "Name": "symmetric_difference_update", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the union of sets as a new set.\n\n(i.e. all elements that are in either set.)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "others", - "Type": null, - "DefaultValue": null, - "Kind": 1 - } - ], - "ReturnType": "i:set" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 769903896, - "Name": "union", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Update a set with the union of itself and others.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "set", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "others", - "Type": null, - "DefaultValue": null, - "Kind": 1 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1901098080, - "Name": "update", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": null - }, - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 798955, - "Name": "set", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "frozenset() -> empty frozenset object\nfrozenset(iterable) -> frozenset object\n\nBuild an immutable unordered collection of unique elements.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return self&value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:frozenset" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1638804448, - "Name": "__and__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "x.__contains__(y) <==> y in x.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1841774666, - "Name": "__contains__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "frozenset() -> empty frozenset object\nfrozenset(iterable) -> frozenset object\n\nBuild an immutable unordered collection of unique elements.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:set_iterator" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self size of S in memory, in bytes", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1069167279, - "Name": "__sizeof__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self-value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:frozenset" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1621974455, - "Name": "__sub__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self^value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:frozenset" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1617520220, - "Name": "__xor__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a shallow copy of a set.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:frozenset" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24300556, - "Name": "copy", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the difference of two or more sets as a new set.\n\n(i.e. all elements that are in this set but not the others.)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:frozenset" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -946813804, - "Name": "difference", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the intersection of two sets as a new set.\n\n(i.e. all elements that are in both sets.)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:frozenset" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2011414560, - "Name": "intersection", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if two sets have a null intersection.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1041514301, - "Name": "isdisjoint", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Report whether another set contains this set.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2076857571, - "Name": "issubset", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Report whether this set contains another set.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -911398520, - "Name": "issuperset", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the symmetric difference of two sets as a new set.\n\n(i.e. all elements that are in exactly one of the sets.)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "other", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:frozenset" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 796556764, - "Name": "symmetric_difference", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return the union of sets as a new set.\n\n(i.e. all elements that are in either set.)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "frozenset", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "others", - "Type": null, - "DefaultValue": null, - "Kind": 1 - } - ], - "ReturnType": "i:frozenset" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 769903896, - "Name": "union", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 233394059, - "Name": "frozenset", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "bytes(iterable_of_ints) -> bytes\nbytes(string, encoding[, errors]) -> bytes\nbytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\nbytes(int) -> bytes object of size given by the parameter initialized with null bytes\nbytes() -> empty bytes object\n\nConstruct an immutable array of bytes from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - any object implementing the buffer API.\n - an integer", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return self+value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1639102358, - "Name": "__add__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return key in self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1841774666, - "Name": "__contains__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "bytes(iterable_of_ints) -> bytes\nbytes(string, encoding[, errors]) -> bytes\nbytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\nbytes(int) -> bytes object of size given by the parameter initialized with null bytes\nbytes() -> empty bytes object\n\nConstruct an immutable array of bytes from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - any object implementing the buffer API.\n - an integer", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "string", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "encoding", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "errors", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self copy of B\n\nReturn a copy of B with only its first character capitalized (ASCII)\nand the rest lower-cased.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -145846717, - "Name": "capitalize", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.center(width[, fillchar]) -> copy of B\n\nReturn B centered in a string of length width. Padding is\ndone using the specified fill character (default is a space).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "width", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "fillbyte", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1868701484, - "Name": "center", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.count(sub[, start[, end]]) -> int\n\nReturn the number of non-overlapping occurrences of subsection sub in\nbytes B[start:end]. Optional arguments start and end are interpreted\nas in slice notation.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 753321816, - "Name": "count", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Decode the bytes using the codec registered for encoding.\n\n encoding\n The encoding with which to decode the bytes.\n errors\n The error handling scheme to use for the handling of decoding errors.\n The default is 'strict' meaning that decoding errors raise a\n UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n as well as any other name registered with codecs.register_error that\n can handle UnicodeDecodeErrors.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "encoding", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "errors", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1896998085, - "Name": "decode", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if B ends with the specified suffix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nsuffix can also be a tuple of bytes to try.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "suffix", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1172635435, - "Name": "endswith", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.expandtabs(tabsize=8) -> copy of B\n\nReturn a copy of B where all tab characters are expanded using spaces.\nIf tabsize is not given, a tab size of 8 characters is assumed.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "tabsize", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -2134490001, - "Name": "expandtabs", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24384080, - "Name": "find", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a bytes object from a string of hexadecimal numbers.\n\nSpaces between two numbers are accepted.\nExample: bytes.fromhex('B9 01EF') -> b'\\\\xb9\\\\x01\\\\xef'.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "type", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "string", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 835611450, - "Name": "fromhex", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.hex() -> string\n\nCreate a string of hexadecimal numbers from a bytes object.\nExample: b'\\xb9\\x01\\xef'.hex() -> 'b901ef'.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 788388, - "Name": "hex", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the subsection is not found.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 758816539, - "Name": "index", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isalnum() -> bool\n\nReturn True if all characters in B are alphanumeric\nand there is at least one character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -781168486, - "Name": "isalnum", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isalpha() -> bool\n\nReturn True if all characters in B are alphabetic\nand there is at least one character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -781166979, - "Name": "isalpha", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isascii() -> bool\n\nReturn True if B is empty or all characters in B are ASCII,\nFalse otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -780970896, - "Name": "isascii", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isdigit() -> bool\n\nReturn True if all characters in B are digits\nand there is at least one character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -778494388, - "Name": "isdigit", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.islower() -> bool\n\nReturn True if all cased characters in B are lowercase and there is\nat least one cased character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -770912224, - "Name": "islower", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isspace() -> bool\n\nReturn True if all characters in B are whitespace\nand there is at least one character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -764439003, - "Name": "isspace", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.istitle() -> bool\n\nReturn True if B is a titlecased string and there is at least one\ncharacter in B, i.e. uppercase characters may only follow uncased\ncharacters and lowercase characters only cased ones. Return False\notherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -763705481, - "Name": "istitle", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isupper() -> bool\n\nReturn True if all cased characters in B are uppercase and there is\nat least one cased character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -762577471, - "Name": "isupper", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Concatenate any number of bytes objects.\n\nThe bytes whose method is called is inserted in between each pair.\n\nThe result is returned as a new bytes object.\n\nExample: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "iterable_of_bytes", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24508865, - "Name": "join", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.ljust(width[, fillchar]) -> copy of B\n\nReturn B left justified in a string of length width. Padding is\ndone using the specified fill character (default is a space).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "width", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "fillbyte", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 761484705, - "Name": "ljust", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.lower() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to lowercase.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 761635146, - "Name": "lower", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Strip leading bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading ASCII whitespace.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bytes", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2139470083, - "Name": "lstrip", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a translation table useable for the bytes or bytearray translate method.\n\nThe returned table will be one where each byte in frm is mapped to the byte at\nthe same position in to.\n\nThe bytes objects frm and to must be of the same length.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "frm", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "to", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1060805443, - "Name": "maketrans", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original bytes\nobject and two empty bytes objects.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -2024653645, - "Name": "partition", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy with all occurrences of substring old replaced by new.\n\n count\n Maximum number of occurrences to replace.\n -1 (the default value) means replace all occurrences.\n\nIf the optional argument count is given, only the first count occurrences are\nreplaced.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "old", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "new", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "count", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1770538307, - "Name": "replace", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 766894964, - "Name": "rfind", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaise ValueError when the subsection is not found.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1993149833, - "Name": "rindex", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.rjust(width[, fillchar]) -> copy of B\n\nReturn B right justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "width", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "fillbyte", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 767025831, - "Name": "rjust", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Partition the bytes into three parts using the given separator.\n\nThis will search for the separator sep in the bytes, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty bytes\nobjects and the original bytes object.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1107721713, - "Name": "rpartition", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a list of the sections in the bytes, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytes.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplitting is done starting at the end of the bytes and working to the front.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "maxsplit", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1983847233, - "Name": "rsplit", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Strip trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip trailing ASCII whitespace.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bytes", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1983722307, - "Name": "rstrip", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a list of the sections in the bytes, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytes.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "maxsplit", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 768119139, - "Name": "split", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a list of the lines in the bytes, breaking at line boundaries.\n\nLine breaks are not included in the resulting list unless keepends is given and\ntrue.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "keepends", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1291658108, - "Name": "splitlines", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if B starts with the specified prefix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nprefix can also be a tuple of bytes to try.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "prefix", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 65206254, - "Name": "startswith", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Strip leading and trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading and trailing ASCII whitespace.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bytes", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 768244065, - "Name": "strip", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.swapcase() -> copy of B\n\nReturn a copy of B with uppercase ASCII characters converted\nto lowercase ASCII and vice versa.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1060209754, - "Name": "swapcase", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.title() -> copy of B\n\nReturn a titlecased version of B, i.e. ASCII words start with uppercase\ncharacters, all remaining cased characters have lowercase.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 768841889, - "Name": "title", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy with each character mapped by the given translation table.\n\n table\n Translation table, which must be a bytes object of length 256.\n\nAll characters occurring in the optional argument delete are removed.\nThe remaining characters are mapped through the given translation table.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "table", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "delete", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 827988759, - "Name": "translate", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.upper() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to uppercase.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 769969899, - "Name": "upper", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.zfill(width) -> copy of B\n\nPad a numeric string B with zeros on the left, to fill a field\nof the specified width. B is never truncated.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "width", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 774283078, - "Name": "zfill", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 752694964, - "Name": "bytes", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "bytes_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytes_iterator" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Private method returning an estimate of len(list(it)).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 358836041, - "Name": "__length_hint__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement next(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1101153034, - "Name": "__next__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return state information for pickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -544113923, - "Name": "__reduce__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Set state information for unpickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytes_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "state", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1719806726, - "Name": "__setstate__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "bytes_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": -1994109543, - "Name": "bytes_iterator", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return self+value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1639102358, - "Name": "__add__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return key in self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1841774666, - "Name": "__contains__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a formatted version of the string as described by format_spec.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "format_spec", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 695475534, - "Name": "__format__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bytes_or_buffer", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "encoding", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "errors", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self int\n\nReturn the number of non-overlapping occurrences of substring sub in\nstring S[start:end]. Optional arguments start and end are\ninterpreted as in slice notation.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 753321816, - "Name": "count", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Encode the string using the codec registered for encoding.\n\n encoding\n The encoding in which to encode the string.\n errors\n The error handling scheme to use for encoding errors.\n The default is 'strict' meaning that encoding errors raise a\n UnicodeEncodeError. Other possible values are 'ignore', 'replace' and\n 'xmlcharrefreplace' as well as any other name registered with\n codecs.register_error that can handle UnicodeEncodeErrors.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "encoding", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "errors", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1933938925, - "Name": "encode", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "S.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if S ends with the specified suffix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nsuffix can also be a tuple of strings to try.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "suffix", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1172635435, - "Name": "endswith", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy where all tab characters are expanded using spaces.\n\nIf tabsize is not given, a tab size of 8 characters is assumed.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "tabsize", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -2134490001, - "Name": "expandtabs", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "S.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24384080, - "Name": "find", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "S.format(*args, **kwargs) -> str\n\nReturn a formatted version of S, using substitutions from args and kwargs.\nThe substitutions are identified by braces ('{' and '}').", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1963936462, - "Name": "format", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "S.format_map(mapping) -> str\n\nReturn a formatted version of S, using substitutions from mapping.\nThe substitutions are identified by braces ('{' and '}').", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "mapping", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1943930987, - "Name": "format_map", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "S.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in S where substring sub is found, \nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 758816539, - "Name": "index", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the string is an alpha-numeric string, False otherwise.\n\nA string is alpha-numeric if all characters in the string are alpha-numeric and\nthere is at least one character in the string.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -781168486, - "Name": "isalnum", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the string is an alphabetic string, False otherwise.\n\nA string is alphabetic if all characters in the string are alphabetic and there\nis at least one character in the string.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -781166979, - "Name": "isalpha", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if all characters in the string are ASCII, False otherwise.\n\nASCII characters have code points in the range U+0000-U+007F.\nEmpty string is ASCII too.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -780970896, - "Name": "isascii", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the string is a decimal string, False otherwise.\n\nA string is a decimal string if all characters in the string are decimal and\nthere is at least one character in the string.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -927011664, - "Name": "isdecimal", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the string is a digit string, False otherwise.\n\nA string is a digit string if all characters in the string are digits and there\nis at least one character in the string.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -778494388, - "Name": "isdigit", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the string is a valid Python identifier, False otherwise.\n\nUse keyword.iskeyword() to test for reserved identifiers such as \"def\" and\n\"class\".", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 401040106, - "Name": "isidentifier", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the string is a lowercase string, False otherwise.\n\nA string is lowercase if all cased characters in the string are lowercase and\nthere is at least one cased character in the string.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -770912224, - "Name": "islower", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the string is a numeric string, False otherwise.\n\nA string is numeric if all characters in the string are numeric and there is at\nleast one character in the string.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -174721940, - "Name": "isnumeric", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the string is printable, False otherwise.\n\nA string is printable if all of its characters are considered printable in\nrepr() or if it is empty.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 346760998, - "Name": "isprintable", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the string is a whitespace string, False otherwise.\n\nA string is whitespace if all characters in the string are whitespace and there\nis at least one character in the string.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -764439003, - "Name": "isspace", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the string is a title-cased string, False otherwise.\n\nIn a title-cased string, upper- and title-case characters may only\nfollow uncased characters and lowercase characters only cased ones.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -763705481, - "Name": "istitle", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return True if the string is an uppercase string, False otherwise.\n\nA string is uppercase if all cased characters in the string are uppercase and\nthere is at least one cased character in the string.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -762577471, - "Name": "isupper", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Concatenate any number of strings.\n\nThe string whose method is called is inserted in between each given string.\nThe result is returned as a new string.\n\nExample: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24508865, - "Name": "join", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a left-justified string of length width.\n\nPadding is done using the specified fill character (default is a space).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "width", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "fillchar", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 761484705, - "Name": "ljust", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy of the string converted to lowercase.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 761635146, - "Name": "lower", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy of the string with leading whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "chars", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2139470083, - "Name": "lstrip", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a translation table usable for str.translate().\n\nIf there is only one argument, it must be a dictionary mapping Unicode\nordinals (integers) or characters to Unicode ordinals, strings or None.\nCharacter keys will be then converted to ordinals.\nIf there are two arguments, they must be strings of equal length, and\nin the resulting dictionary, each character in x will be mapped to the\ncharacter at the same position in y. If there is a third argument, it\nmust be a string, whose characters will be mapped to None in the result.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "x", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "y", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "z", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1060805443, - "Name": "maketrans", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string. If the separator is found,\nreturns a 3-tuple containing the part before the separator, the separator\nitself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing the original string\nand two empty strings.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -2024653645, - "Name": "partition", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy with all occurrences of substring old replaced by new.\n\n count\n Maximum number of occurrences to replace.\n -1 (the default value) means replace all occurrences.\n\nIf the optional argument count is given, only the first count occurrences are\nreplaced.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "old", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "new", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "count", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1770538307, - "Name": "replace", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "S.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 766894964, - "Name": "rfind", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "S.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in S where substring sub is found,\nsuch that sub is contained within S[start:end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the substring is not found.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1993149833, - "Name": "rindex", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a right-justified string of length width.\n\nPadding is done using the specified fill character (default is a space).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "width", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "fillchar", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 767025831, - "Name": "rjust", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Partition the string into three parts using the given separator.\n\nThis will search for the separator in the string, starting at the end. If\nthe separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it.\n\nIf the separator is not found, returns a 3-tuple containing two empty strings\nand the original string.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1107721713, - "Name": "rpartition", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a list of the words in the string, using sep as the delimiter string.\n\n sep\n The delimiter according which to split the string.\n None (the default value) means split according to any whitespace,\n and discard empty strings from the result.\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplits are done starting at the end of the string and working to the front.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "maxsplit", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1983847233, - "Name": "rsplit", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy of the string with trailing whitespace removed.\n\nIf chars is given and not None, remove characters in chars instead.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "chars", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1983722307, - "Name": "rstrip", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a list of the words in the string, using sep as the delimiter string.\n\n sep\n The delimiter according which to split the string.\n None (the default value) means split according to any whitespace,\n and discard empty strings from the result.\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "maxsplit", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 768119139, - "Name": "split", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a list of the lines in the string, breaking at line boundaries.\n\nLine breaks are not included in the resulting list unless keepends is given and\ntrue.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "keepends", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1291658108, - "Name": "splitlines", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "S.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if S starts with the specified prefix, False otherwise.\nWith optional start, test S beginning at that position.\nWith optional end, stop comparing S at that position.\nprefix can also be a tuple of strings to try.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "prefix", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 65206254, - "Name": "startswith", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy of the string with leading and trailing whitespace remove.\n\nIf chars is given and not None, remove characters in chars instead.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "chars", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 768244065, - "Name": "strip", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Convert uppercase characters to lowercase and lowercase characters to uppercase.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1060209754, - "Name": "swapcase", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a version of the string where each word is titlecased.\n\nMore specifically, words start with uppercased characters and all remaining\ncased characters have lower case.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 768841889, - "Name": "title", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Replace each character in the string using the given translation table.\n\n table\n Translation table, which must be a mapping of Unicode ordinals to\n Unicode ordinals, strings, or None.\n\nThe table must implement lookup/indexing via __getitem__, for instance a\ndictionary or list. If this operation raises LookupError, the character is\nleft untouched. Characters mapped to None are deleted.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "table", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 827988759, - "Name": "translate", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy of the string converted to uppercase.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 769969899, - "Name": "upper", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Pad a numeric string with zeros on the left, to fill a field of the given width.\n\nThe string is never truncated.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "width", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 774283078, - "Name": "zfill", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 799418, - "Name": "str", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "str_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str_iterator" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Private method returning an estimate of len(list(it)).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 358836041, - "Name": "__length_hint__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement next(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1101153034, - "Name": "__next__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return state information for pickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -544113923, - "Name": "__reduce__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Set state information for unpickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "str_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "state", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1719806726, - "Name": "__setstate__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "str_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 1858697299, - "Name": "str_iterator", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a module object.\n\nThe name must be a string; the optional doc argument can have any type.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Implement delattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "module", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2095540485, - "Name": "__delattr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "__dir__() -> list\nspecialized dir() implementation", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "module", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1636169386, - "Name": "__dir__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "module", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a module object.\n\nThe name must be a string; the optional doc argument can have any type.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "module", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "module", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return repr(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "module", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1215429388, - "Name": "__repr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement setattr(self, name, value).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "module", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -736377828, - "Name": "__setattr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "module", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "i:dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": null - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": -2131035837, - "Name": "module", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a function object.\n\n code\n a code object\n globals\n the globals dictionary\n name\n a string that overrides the name from the code object\n argdefs\n a tuple that specifies the default argument values\n closure\n a tuple that supplies the bindings for free variables", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Call self as a function.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "function", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 782173109, - "Name": "__call__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return an attribute of instance, which is of type owner.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "function", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "instance", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "owner", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:function" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1633516065, - "Name": "__get__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a function object.\n\n code\n a code object\n globals\n the globals dictionary\n name\n a string that overrides the name from the code object\n argdefs\n a tuple that specifies the default argument values\n closure\n a tuple that supplies the bindings for free variables", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "function", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "function", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return repr(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "function", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1215429388, - "Name": "__repr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "function", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [ - { - "Documentation": "", - "ReturnType": "i:dict", - "Attributes": 0, - "Id": 1058045229, - "Name": "__annotations__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 2101485316, - "Name": "__closure__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": "i:object", - "Attributes": 0, - "Id": 794857348, - "Name": "__code__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": -1308361943, - "Name": "__defaults__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": "i:dict", - "Attributes": 0, - "Id": -1338696519, - "Name": "__globals__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": -56184875, - "Name": "__kwdefaults__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Fields": [ - { - "Value": "i:dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": null - }, - { - "Value": null, - "Id": 1097116834, - "Name": "__name__", - "IndexSpan": null - }, - { - "Value": null, - "Id": -1879833807, - "Name": "__qualname__", - "IndexSpan": null - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": -1535808273, - "Name": "function", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Call self as a function.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "wrapper_descriptor", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 782173109, - "Name": "__call__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return an attribute of instance, which is of type owner.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "wrapper_descriptor", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "instance", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "owner", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:wrapper_descriptor" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1633516065, - "Name": "__get__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "wrapper_descriptor", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "wrapper_descriptor", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "wrapper_descriptor", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -544113923, - "Name": "__reduce__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return repr(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "wrapper_descriptor", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1215429388, - "Name": "__repr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "wrapper_descriptor", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [ - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 1840816120, - "Name": "__objclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Fields": [ - { - "Value": null, - "Id": 1097116834, - "Name": "__name__", - "IndexSpan": null - }, - { - "Value": null, - "Id": -1879833807, - "Name": "__qualname__", - "IndexSpan": null - }, - { - "Value": null, - "Id": 174109373, - "Name": "__text_signature__", - "IndexSpan": null - }, - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": -98573582, - "Name": "wrapper_descriptor", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Call self as a function.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "builtin_function_or_method", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 782173109, - "Name": "__call__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "builtin_function_or_method", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "builtin_function_or_method", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "builtin_function_or_method", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "builtin_function_or_method", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "builtin_function_or_method", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "builtin_function_or_method", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "builtin_function_or_method", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self raise GeneratorExit inside generator.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "generator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 753226817, - "Name": "close", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "generator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24767519, - "Name": "send", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "generator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "type", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "traceback", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 768810287, - "Name": "throw", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [ - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 1450385203, - "Name": "gi_code", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 2015125735, - "Name": "gi_frame", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 1663620793, - "Name": "gi_running", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": -1949084879, - "Name": "gi_yieldfrom", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Fields": [ - { - "Value": null, - "Id": 1097116834, - "Name": "__name__", - "IndexSpan": null - }, - { - "Value": null, - "Id": -1879833807, - "Name": "__qualname__", - "IndexSpan": null - }, - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 62112924, - "Name": "generator", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Property attribute.\n\n fget\n function to be used for getting an attribute value\n fset\n function to be used for setting an attribute value\n fdel\n function to be used for del'ing an attribute\n doc\n docstring\n\nTypical use is to define a managed attribute x:\n\nclass C(object):\n def getx(self): return self._x\n def setx(self, value): self._x = value\n def delx(self): del self._x\n x = property(getx, setx, delx, \"I'm the 'x' property.\")\n\nDecorators make defining new properties or modifying existing ones easy:\n\nclass C(object):\n @property\n def x(self):\n \"I am the 'x' property.\"\n return self._x\n @x.setter\n def x(self, value):\n self._x = value\n @x.deleter\n def x(self):\n del self._x", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Delete an attribute of instance.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "property", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "instance", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1041108482, - "Name": "__delete__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return an attribute of instance, which is of type owner.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "property", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "instance", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "owner", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:property" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1633516065, - "Name": "__get__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "property", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Property attribute.\n\n fget\n function to be used for getting an attribute value\n fset\n function to be used for setting an attribute value\n fdel\n function to be used for del'ing an attribute\n doc\n docstring\n\nTypical use is to define a managed attribute x:\n\nclass C(object):\n def getx(self): return self._x\n def setx(self, value): self._x = value\n def delx(self): del self._x\n x = property(getx, setx, delx, \"I'm the 'x' property.\")\n\nDecorators make defining new properties or modifying existing ones easy:\n\nclass C(object):\n @property\n def x(self):\n \"I am the 'x' property.\"\n return self._x\n @x.setter\n def x(self, value):\n self._x = value\n @x.deleter\n def x(self):\n del self._x", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "property", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "property", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Set an attribute of instance to value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "property", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "instance", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1622433813, - "Name": "__set__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "property", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Descriptor to change the deleter on a property.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "property", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "func", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1314572240, - "Name": "deleter", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Descriptor to change the getter on a property.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "property", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "func", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1983396834, - "Name": "getter", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Descriptor to change the setter on a property.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "property", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "func", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1968020650, - "Name": "setter", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [ - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 305214020, - "Name": "__isabstractmethod__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 24379004, - "Name": "fdel", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 24381895, - "Name": "fget", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 24393427, - "Name": "fset", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 385079020, - "Name": "property", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "classmethod(function) -> method\n\nConvert a function to be a class method.\n\nA class method receives the class as implicit first argument,\njust like an instance method receives the instance.\nTo declare a class method, use this idiom:\n\n class C:\n @classmethod\n def f(cls, arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\nIf a class method is called for a derived class, the derived class\nobject is passed as the implied first argument.\n\nClass methods are different than C++ or Java static methods.\nIf you want those, see the staticmethod builtin.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return an attribute of instance, which is of type owner.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "classmethod", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "instance", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "owner", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:classmethod" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1633516065, - "Name": "__get__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "classmethod(function) -> method\n\nConvert a function to be a class method.\n\nA class method receives the class as implicit first argument,\njust like an instance method receives the instance.\nTo declare a class method, use this idiom:\n\n class C:\n @classmethod\n def f(cls, arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\nIf a class method is called for a derived class, the derived class\nobject is passed as the implied first argument.\n\nClass methods are different than C++ or Java static methods.\nIf you want those, see the staticmethod builtin.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "classmethod", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "function", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "classmethod", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "classmethod", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [ - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 886581915, - "Name": "__func__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 305214020, - "Name": "__isabstractmethod__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Fields": [ - { - "Value": "i:dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": null - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": -1347789854, - "Name": "classmethod", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "staticmethod(function) -> method\n\nConvert a function to be a static method.\n\nA static method does not receive an implicit first argument.\nTo declare a static method, use this idiom:\n\n class C:\n @staticmethod\n def f(arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\n\nStatic methods in Python are similar to those found in Java or C++.\nFor a more advanced concept, see the classmethod builtin.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return an attribute of instance, which is of type owner.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "staticmethod", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "instance", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "owner", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:staticmethod" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1633516065, - "Name": "__get__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "staticmethod(function) -> method\n\nConvert a function to be a static method.\n\nA static method does not receive an implicit first argument.\nTo declare a static method, use this idiom:\n\n class C:\n @staticmethod\n def f(arg1, arg2, ...):\n ...\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()). The instance is ignored except for its class.\n\nStatic methods in Python are similar to those found in Java or C++.\nFor a more advanced concept, see the classmethod builtin.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "staticmethod", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "function", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "staticmethod", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "staticmethod", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [ - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 886581915, - "Name": "__func__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 305214020, - "Name": "__isabstractmethod__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Fields": [ - { - "Value": "i:dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": null - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": -382457242, - "Name": "staticmethod", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "ellipsis", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "ellipsis", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "ellipsis", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "ellipsis", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -544113923, - "Name": "__reduce__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return repr(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "ellipsis", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1215429388, - "Name": "__repr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "ellipsis", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 1566923240, - "Name": "ellipsis", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "tuple_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple_iterator" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Private method returning an estimate of len(list(it)).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 358836041, - "Name": "__length_hint__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement next(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1101153034, - "Name": "__next__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return state information for pickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -544113923, - "Name": "__reduce__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Set state information for unpickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "tuple_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "state", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1719806726, - "Name": "__setstate__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "tuple_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 1210482396, - "Name": "tuple_iterator", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "list_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list_iterator" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Private method returning an estimate of len(list(it)).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 358836041, - "Name": "__length_hint__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement next(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1101153034, - "Name": "__next__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return state information for pickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list_iterator", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -544113923, - "Name": "__reduce__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Set state information for unpickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "list_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "state", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1719806726, - "Name": "__setstate__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "list_iterator", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": -235571144, - "Name": "list_iterator", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return self&value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_keys", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict_keys" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1638804448, - "Name": "__and__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return key in self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_keys", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1841774666, - "Name": "__contains__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_keys", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_keys", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_keys", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_keys", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_keys", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "dict_keys", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_keys", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict_keys" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_keys", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_keys", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_items", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_items", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_items", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_items", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "dict_items", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_items", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:dict_items" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_items", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "dict_items", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self bytearray\nbytearray(string, encoding[, errors]) -> bytearray\nbytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer\nbytearray(int) -> bytes array of size given by the parameter initialized with null bytes\nbytearray() -> empty bytes array\n\nConstruct a mutable bytearray object from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - a bytes or a buffer object\n - any object implementing the buffer API.\n - an integer", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return self+value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1639102358, - "Name": "__add__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.__alloc__() -> int\n\nReturn the number of bytes actually allocated.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1312536510, - "Name": "__alloc__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return key in self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1841774666, - "Name": "__contains__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Delete self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1970845273, - "Name": "__delitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement self+=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 953701999, - "Name": "__iadd__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement self*=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965298386, - "Name": "__imul__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "bytearray(iterable_of_ints) -> bytearray\nbytearray(string, encoding[, errors]) -> bytearray\nbytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer\nbytearray(int) -> bytes array of size given by the parameter initialized with null bytes\nbytearray() -> empty bytes array\n\nConstruct a mutable bytearray object from:\n - an iterable yielding integers in range(256)\n - a text string encoded using the specified encoding\n - a bytes or a buffer object\n - any object implementing the buffer API.\n - an integer", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "string", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "encoding", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "errors", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self copy of B\n\nReturn a copy of B with only its first character capitalized (ASCII)\nand the rest lower-cased.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -145846717, - "Name": "capitalize", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.center(width[, fillchar]) -> copy of B\n\nReturn B centered in a string of length width. Padding is\ndone using the specified fill character (default is a space).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1868701484, - "Name": "center", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Remove all items from the bytearray.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 753216662, - "Name": "clear", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy of B.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24300556, - "Name": "copy", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.count(sub[, start[, end]]) -> int\n\nReturn the number of non-overlapping occurrences of subsection sub in\nbytes B[start:end]. Optional arguments start and end are interpreted\nas in slice notation.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "x", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 753321816, - "Name": "count", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Decode the bytearray using the codec registered for encoding.\n\n encoding\n The encoding with which to decode the bytearray.\n errors\n The error handling scheme to use for the handling of decoding errors.\n The default is 'strict' meaning that decoding errors raise a\n UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n as well as any other name registered with codecs.register_error that\n can handle UnicodeDecodeErrors.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "encoding", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "errors", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1896998085, - "Name": "decode", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.endswith(suffix[, start[, end]]) -> bool\n\nReturn True if B ends with the specified suffix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nsuffix can also be a tuple of bytes to try.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "suffix", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1172635435, - "Name": "endswith", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.expandtabs(tabsize=8) -> copy of B\n\nReturn a copy of B where all tab characters are expanded using spaces.\nIf tabsize is not given, a tab size of 8 characters is assumed.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "tabsize", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -2134490001, - "Name": "expandtabs", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Append all the items from the iterator or sequence to the end of the bytearray.\n\n iterable_of_ints\n The iterable of items to append.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "iterable_of_ints", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1943671281, - "Name": "extend", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.find(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24384080, - "Name": "find", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a bytearray object from a string of hexadecimal numbers.\n\nSpaces between two numbers are accepted.\nExample: bytearray.fromhex('B9 01EF') -> bytearray(b'\\\\xb9\\\\x01\\\\xef')", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "type", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "string", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 835611450, - "Name": "fromhex", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.hex() -> string\n\nCreate a string of hexadecimal numbers from a bytearray object.\nExample: bytearray([0xb9, 0x01, 0xef]).hex() -> 'b901ef'.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 788388, - "Name": "hex", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.index(sub[, start[, end]]) -> int\n\nReturn the lowest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaises ValueError when the subsection is not found.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "v", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 758816539, - "Name": "index", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Insert a single item into the bytearray before the given index.\n\n index\n The index where the value is to be inserted.\n item\n The item to be inserted.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "index", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "item", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2048923024, - "Name": "insert", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isalnum() -> bool\n\nReturn True if all characters in B are alphanumeric\nand there is at least one character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -781168486, - "Name": "isalnum", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isalpha() -> bool\n\nReturn True if all characters in B are alphabetic\nand there is at least one character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -781166979, - "Name": "isalpha", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isascii() -> bool\n\nReturn True if B is empty or all characters in B are ASCII,\nFalse otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -780970896, - "Name": "isascii", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isdigit() -> bool\n\nReturn True if all characters in B are digits\nand there is at least one character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -778494388, - "Name": "isdigit", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.islower() -> bool\n\nReturn True if all cased characters in B are lowercase and there is\nat least one cased character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -770912224, - "Name": "islower", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isspace() -> bool\n\nReturn True if all characters in B are whitespace\nand there is at least one character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -764439003, - "Name": "isspace", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.istitle() -> bool\n\nReturn True if B is a titlecased string and there is at least one\ncharacter in B, i.e. uppercase characters may only follow uncased\ncharacters and lowercase characters only cased ones. Return False\notherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -763705481, - "Name": "istitle", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.isupper() -> bool\n\nReturn True if all cased characters in B are uppercase and there is\nat least one cased character in B, False otherwise.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -762577471, - "Name": "isupper", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Concatenate any number of bytes/bytearray objects.\n\nThe bytearray whose method is called is inserted in between each pair.\n\nThe result is returned as a new bytearray object.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "iterable_of_bytes", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24508865, - "Name": "join", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.ljust(width[, fillchar]) -> copy of B\n\nReturn B left justified in a string of length width. Padding is\ndone using the specified fill character (default is a space).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 761484705, - "Name": "ljust", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.lower() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to lowercase.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 761635146, - "Name": "lower", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Strip leading bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading ASCII whitespace.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bytes", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2139470083, - "Name": "lstrip", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a translation table useable for the bytes or bytearray translate method.\n\nThe returned table will be one where each byte in frm is mapped to the byte at\nthe same position in to.\n\nThe bytes objects frm and to must be of the same length.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "frm", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "to", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1060805443, - "Name": "maketrans", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Partition the bytearray into three parts using the given separator.\n\nThis will search for the separator sep in the bytearray. If the separator is\nfound, returns a 3-tuple containing the part before the separator, the\nseparator itself, and the part after it as new bytearray objects.\n\nIf the separator is not found, returns a 3-tuple containing the copy of the\noriginal bytearray object and two empty bytearray objects.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -2024653645, - "Name": "partition", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Remove and return a single item from B.\n\n index\n The index from where to remove the item.\n -1 (the default value) means remove the last item.\n\nIf no index argument is given, will pop the last item.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "index", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 796378, - "Name": "pop", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Remove the first occurrence of a value in the bytearray.\n\n value\n The value to remove.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1996862629, - "Name": "remove", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy with all occurrences of substring old replaced by new.\n\n count\n Maximum number of occurrences to replace.\n -1 (the default value) means replace all occurrences.\n\nIf the optional argument count is given, only the first count occurrences are\nreplaced.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "old", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "new", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "count", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1770538307, - "Name": "replace", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Reverse the order of the values in B in place.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1765188885, - "Name": "reverse", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.rfind(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 766894964, - "Name": "rfind", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.rindex(sub[, start[, end]]) -> int\n\nReturn the highest index in B where subsection sub is found,\nsuch that sub is contained within B[start,end]. Optional\narguments start and end are interpreted as in slice notation.\n\nRaise ValueError when the subsection is not found.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sub", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1993149833, - "Name": "rindex", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.rjust(width[, fillchar]) -> copy of B\n\nReturn B right justified in a string of length width. Padding is\ndone using the specified fill character (default is a space)", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 767025831, - "Name": "rjust", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Partition the bytearray into three parts using the given separator.\n\nThis will search for the separator sep in the bytearray, starting at the end.\nIf the separator is found, returns a 3-tuple containing the part before the\nseparator, the separator itself, and the part after it as new bytearray\nobjects.\n\nIf the separator is not found, returns a 3-tuple containing two empty bytearray\nobjects and the copy of the original bytearray object.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1107721713, - "Name": "rpartition", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a list of the sections in the bytearray, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytearray.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.\n\nSplitting is done starting at the end of the bytearray and working to the front.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "maxsplit", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1983847233, - "Name": "rsplit", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Strip trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip trailing ASCII whitespace.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bytes", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1983722307, - "Name": "rstrip", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a list of the sections in the bytearray, using sep as the delimiter.\n\n sep\n The delimiter according which to split the bytearray.\n None (the default value) means split on ASCII whitespace characters\n (space, tab, return, newline, formfeed, vertical tab).\n maxsplit\n Maximum number of splits to do.\n -1 (the default value) means no limit.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "sep", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "maxsplit", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 768119139, - "Name": "split", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a list of the lines in the bytearray, breaking at line boundaries.\n\nLine breaks are not included in the resulting list unless keepends is given and\ntrue.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "keepends", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1291658108, - "Name": "splitlines", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.startswith(prefix[, start[, end]]) -> bool\n\nReturn True if B starts with the specified prefix, False otherwise.\nWith optional start, test B beginning at that position.\nWith optional end, stop comparing B at that position.\nprefix can also be a tuple of bytes to try.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "prefix", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "end", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 65206254, - "Name": "startswith", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Strip leading and trailing bytes contained in the argument.\n\nIf the argument is omitted or None, strip leading and trailing ASCII whitespace.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bytes", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 768244065, - "Name": "strip", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.swapcase() -> copy of B\n\nReturn a copy of B with uppercase ASCII characters converted\nto lowercase ASCII and vice versa.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1060209754, - "Name": "swapcase", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.title() -> copy of B\n\nReturn a titlecased version of B, i.e. ASCII words start with uppercase\ncharacters, all remaining cased characters have lowercase.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 768841889, - "Name": "title", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a copy with each character mapped by the given translation table.\n\n table\n Translation table, which must be a bytes object of length 256.\n\nAll characters occurring in the optional argument delete are removed.\nThe remaining characters are mapped through the given translation table.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "table", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "delete", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 827988759, - "Name": "translate", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.upper() -> copy of B\n\nReturn a copy of B with all ASCII characters converted to uppercase.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 769969899, - "Name": "upper", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "B.zfill(width) -> copy of B\n\nPad a numeric string B with zeros on the left, to fill a field\nof the specified width. B is never truncated.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "bytearray", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "width", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bytearray" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 774283078, - "Name": "zfill", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": null - }, - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 2020778010, - "Name": "bytearray", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return an enumerate object.\n\n iterable\n an object supporting iteration\n\nThe enumerate object yields pairs containing a count (from start, which\ndefaults to zero) and a value yielded by the iterable argument.\n\nenumerate is useful for obtaining an indexed list:\n (0, seq[0]), (1, seq[1]), (2, seq[2]), ...", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "enumerate", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return an enumerate object.\n\n iterable\n an object supporting iteration\n\nThe enumerate object yields pairs containing a count (from start, which\ndefaults to zero) and a value yielded by the iterable argument.\n\nenumerate is useful for obtaining an indexed list:\n (0, seq[0]), (1, seq[1]), (2, seq[2]), ...", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "enumerate", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "enumerate", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "enumerate", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:enumerate" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement next(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "enumerate", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1101153034, - "Name": "__next__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return state information for pickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "enumerate", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -544113923, - "Name": "__reduce__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "enumerate", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 22552621, - "Name": "enumerate", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "filter(function or None, iterable) --> filter object\n\nReturn an iterator yielding those items of iterable for which function(item)\nis true. If function is None, return the items that are true.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "filter", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "filter(function or None, iterable) --> filter object\n\nReturn an iterator yielding those items of iterable for which function(item)\nis true. If function is None, return the items that are true.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "filter", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "functionorNone", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "iterable", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "filter", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "filter", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:filter" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement next(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "filter", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1101153034, - "Name": "__next__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return state information for pickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "filter", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -544113923, - "Name": "__reduce__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "filter", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 1958223439, - "Name": "filter", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "map(func, *iterables) --> map object\n\nMake an iterator that computes the function using arguments from\neach of the iterables. Stops when the shortest iterable is exhausted.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "map", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "map(func, *iterables) --> map object\n\nMake an iterator that computes the function using arguments from\neach of the iterables. Stops when the shortest iterable is exhausted.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "map", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "func", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "iterables", - "Type": null, - "DefaultValue": null, - "Kind": 1 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "map", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "map", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:map" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement next(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "map", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1101153034, - "Name": "__next__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return state information for pickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "map", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -544113923, - "Name": "__reduce__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "map", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 793061, - "Name": "map", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a new memoryview object which references the given object.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Delete self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1970845273, - "Name": "__delitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:memoryview" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 631946913, - "Name": "__enter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 860590709, - "Name": "__exit__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Create a new memoryview object which references the given object.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "memoryview", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "slice", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "slice", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "slice", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "slice(stop)\nslice(start, stop[, step])\n\nCreate a slice object. This is used for extended slicing (e.g. a[0:10:2]).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "slice", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "start", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "stop", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "step", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "slice", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "slice", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self (start, stop, stride)\n\nAssuming a sequence of length len, calculate the start and stop\nindices, and the stride length of the extended slice described by\nS. Out of bounds indices are clipped in a manner consistent with the\nhandling of normal slices.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "slice", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -921644112, - "Name": "indices", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [ - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 768228011, - "Name": "start", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 24781667, - "Name": "step", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 24781977, - "Name": "stop", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Fields": [ - { - "Value": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": null - }, - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 767996891, - "Name": "slice", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "super() -> same as super(__class__, )\nsuper(type) -> unbound super object\nsuper(type, obj) -> bound super object; requires isinstance(obj, type)\nsuper(type, type2) -> bound super object; requires issubclass(type2, type)\nTypical use to call a cooperative superclass method:\nclass C(B):\n def meth(self, arg):\n super().meth(arg)\nThis works for class methods too:\nclass C(B):\n @classmethod\n def cmeth(cls, arg):\n super().cmeth(arg)\n", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return an attribute of instance, which is of type owner.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "super", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "instance", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "owner", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:super" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1633516065, - "Name": "__get__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "super", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "super() -> same as super(__class__, )\nsuper(type) -> unbound super object\nsuper(type, obj) -> bound super object; requires isinstance(obj, type)\nsuper(type, type2) -> bound super object; requires issubclass(type2, type)\nTypical use to call a cooperative superclass method:\nclass C(B):\n def meth(self, arg):\n super().meth(arg)\nThis works for class methods too:\nclass C(B):\n @classmethod\n def cmeth(cls, arg):\n super().cmeth(arg)\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "super", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "type", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "type2", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "super", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return repr(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "super", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1215429388, - "Name": "__repr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "super", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [ - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 1243927843, - "Name": "__self__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 2069653788, - "Name": "__self_class__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "", - "ReturnType": null, - "Attributes": 0, - "Id": 185188451, - "Name": "__thisclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 768271812, - "Name": "super", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "zip(iter1 [,iter2 [...]]) --> zip object\n\nReturn a zip object whose .__next__() method returns a tuple where\nthe i-th element comes from the i-th iterable argument. The .__next__()\nmethod continues until the shortest iterable in the argument sequence\nis exhausted and then it raises StopIteration.", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "zip", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "zip(iter1 [,iter2 [...]]) --> zip object\n\nReturn a zip object whose .__next__() method returns a tuple where\nthe i-th element comes from the i-th iterable argument. The .__next__()\nmethod continues until the shortest iterable in the argument sequence\nis exhausted and then it raises StopIteration.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "zip", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "zip", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "zip", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:zip" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement next(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "zip", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1101153034, - "Name": "__next__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return state information for pickling.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "zip", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -544113923, - "Name": "__reduce__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "zip", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 805802, - "Name": "zip", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "type(object_or_name, bases, dict)\ntype(object) -> the object's type\ntype(name, bases, dict) -> a new type", - "Bases": [ - "object" - ], - "Methods": [ - { - "Documentation": "Call self as a function.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 782173109, - "Name": "__call__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement delattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2095540485, - "Name": "__delattr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Specialized __dir__ implementation for types.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1636169386, - "Name": "__dir__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "type(object_or_name, bases, dict)\ntype(object) -> the object's type\ntype(name, bases, dict) -> a new type", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "object_or_name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bases", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "dict", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Check if an object is an instance.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "instance", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1213275748, - "Name": "__instancecheck__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "__prepare__() -> dict\nused to create the namespace for the class statement", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "bases", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "kwds", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1556881104, - "Name": "__prepare__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return repr(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1215429388, - "Name": "__repr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement setattr(self, name, value).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -736377828, - "Name": "__setattr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return memory consumption of the type object.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1069167279, - "Name": "__sizeof__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Check if a class is a subclass.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -25004647, - "Name": "__subclasscheck__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return a list of immediate subclasses.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1804067837, - "Name": "__subclasses__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented. If it returns\nNotImplemented, the normal algorithm is used. Otherwise, it\noverrides the normal algorithm (and the outcome is cached).\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "type", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "subclass", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1374911630, - "Name": "__subclasshook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Properties": [], - "Fields": [ - { - "Value": null, - "Id": -1388753224, - "Name": "__basicsize__", - "IndexSpan": null - }, - { - "Value": "i:dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": null - }, - { - "Value": null, - "Id": -198224608, - "Name": "__dictoffset__", - "IndexSpan": null - }, - { - "Value": null, - "Id": 1444705936, - "Name": "__flags__", - "IndexSpan": null - }, - { - "Value": null, - "Id": 919460331, - "Name": "__itemsize__", - "IndexSpan": null - }, - { - "Value": "i:tuple", - "Id": -1627592461, - "Name": "__mro__", - "IndexSpan": null - }, - { - "Value": null, - "Id": 1097116834, - "Name": "__name__", - "IndexSpan": null - }, - { - "Value": null, - "Id": -1879833807, - "Name": "__qualname__", - "IndexSpan": null - }, - { - "Value": null, - "Id": 174109373, - "Name": "__text_signature__", - "IndexSpan": null - }, - { - "Value": null, - "Id": 1521523639, - "Name": "__weakrefoffset__", - "IndexSpan": null - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "GenericParameters": null, - "InnerClasses": [], - "Id": 24816593, - "Name": "type", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "NewLines": [ - { - "EndIndex": 35, - "Kind": 3 - }, - { - "EndIndex": 71, - "Kind": 3 - }, - { - "EndIndex": 113, - "Kind": 3 - }, - { - "EndIndex": 127, - "Kind": 3 - }, - { - "EndIndex": 133, - "Kind": 3 - }, - { - "EndIndex": 151, - "Kind": 3 - }, - { - "EndIndex": 184, - "Kind": 3 - }, - { - "EndIndex": 335, - "Kind": 3 - }, - { - "EndIndex": 356, - "Kind": 3 - }, - { - "EndIndex": 362, - "Kind": 3 - }, - { - "EndIndex": 389, - "Kind": 3 - }, - { - "EndIndex": 419, - "Kind": 3 - }, - { - "EndIndex": 425, - "Kind": 3 - }, - { - "EndIndex": 450, - "Kind": 3 - }, - { - "EndIndex": 480, - "Kind": 3 - }, - { - "EndIndex": 499, - "Kind": 3 - }, - { - "EndIndex": 505, - "Kind": 3 - }, - { - "EndIndex": 523, - "Kind": 3 - }, - { - "EndIndex": 565, - "Kind": 3 - }, - { - "EndIndex": 891, - "Kind": 3 - }, - { - "EndIndex": 913, - "Kind": 3 - }, - { - "EndIndex": 919, - "Kind": 3 - }, - { - "EndIndex": 921, - "Kind": 3 - }, - { - "EndIndex": 941, - "Kind": 3 - }, - { - "EndIndex": 958, - "Kind": 3 - }, - { - "EndIndex": 986, - "Kind": 3 - }, - { - "EndIndex": 988, - "Kind": 3 - }, - { - "EndIndex": 1009, - "Kind": 3 - }, - { - "EndIndex": 1044, - "Kind": 3 - }, - { - "EndIndex": 1046, - "Kind": 3 - }, - { - "EndIndex": 1061, - "Kind": 3 - }, - { - "EndIndex": 1087, - "Kind": 3 - }, - { - "EndIndex": 1111, - "Kind": 3 - }, - { - "EndIndex": 1145, - "Kind": 3 - }, - { - "EndIndex": 1187, - "Kind": 3 - }, - { - "EndIndex": 1208, - "Kind": 3 - }, - { - "EndIndex": 1214, - "Kind": 3 - }, - { - "EndIndex": 1238, - "Kind": 3 - }, - { - "EndIndex": 1279, - "Kind": 3 - }, - { - "EndIndex": 1300, - "Kind": 3 - }, - { - "EndIndex": 1306, - "Kind": 3 - }, - { - "EndIndex": 1336, - "Kind": 3 - }, - { - "EndIndex": 1367, - "Kind": 3 - }, - { - "EndIndex": 1389, - "Kind": 3 - }, - { - "EndIndex": 1395, - "Kind": 3 - }, - { - "EndIndex": 1435, - "Kind": 3 - }, - { - "EndIndex": 1472, - "Kind": 3 - }, - { - "EndIndex": 1491, - "Kind": 3 - }, - { - "EndIndex": 1497, - "Kind": 3 - }, - { - "EndIndex": 1527, - "Kind": 3 - }, - { - "EndIndex": 1558, - "Kind": 3 - }, - { - "EndIndex": 1580, - "Kind": 3 - }, - { - "EndIndex": 1586, - "Kind": 3 - }, - { - "EndIndex": 1625, - "Kind": 3 - }, - { - "EndIndex": 1664, - "Kind": 3 - }, - { - "EndIndex": 1678, - "Kind": 3 - }, - { - "EndIndex": 1684, - "Kind": 3 - }, - { - "EndIndex": 1714, - "Kind": 3 - }, - { - "EndIndex": 1744, - "Kind": 3 - }, - { - "EndIndex": 1766, - "Kind": 3 - }, - { - "EndIndex": 1772, - "Kind": 3 - }, - { - "EndIndex": 1797, - "Kind": 3 - }, - { - "EndIndex": 1827, - "Kind": 3 - }, - { - "EndIndex": 1845, - "Kind": 3 - }, - { - "EndIndex": 1851, - "Kind": 3 - }, - { - "EndIndex": 1893, - "Kind": 3 - }, - { - "EndIndex": 1923, - "Kind": 3 - }, - { - "EndIndex": 1937, - "Kind": 3 - }, - { - "EndIndex": 1943, - "Kind": 3 - }, - { - "EndIndex": 1961, - "Kind": 3 - }, - { - "EndIndex": 1994, - "Kind": 3 - }, - { - "EndIndex": 2145, - "Kind": 3 - }, - { - "EndIndex": 2166, - "Kind": 3 - }, - { - "EndIndex": 2172, - "Kind": 3 - }, - { - "EndIndex": 2202, - "Kind": 3 - }, - { - "EndIndex": 2233, - "Kind": 3 - }, - { - "EndIndex": 2255, - "Kind": 3 - }, - { - "EndIndex": 2261, - "Kind": 3 - }, - { - "EndIndex": 2291, - "Kind": 3 - }, - { - "EndIndex": 2321, - "Kind": 3 - }, - { - "EndIndex": 2343, - "Kind": 3 - }, - { - "EndIndex": 2349, - "Kind": 3 - }, - { - "EndIndex": 2379, - "Kind": 3 - }, - { - "EndIndex": 2410, - "Kind": 3 - }, - { - "EndIndex": 2432, - "Kind": 3 - }, - { - "EndIndex": 2438, - "Kind": 3 - }, - { - "EndIndex": 2465, - "Kind": 3 - }, - { - "EndIndex": 2495, - "Kind": 3 - }, - { - "EndIndex": 2525, - "Kind": 3 - }, - { - "EndIndex": 2531, - "Kind": 3 - }, - { - "EndIndex": 2571, - "Kind": 3 - }, - { - "EndIndex": 2601, - "Kind": 3 - }, - { - "EndIndex": 2631, - "Kind": 3 - }, - { - "EndIndex": 2637, - "Kind": 3 - }, - { - "EndIndex": 2662, - "Kind": 3 - }, - { - "EndIndex": 2692, - "Kind": 3 - }, - { - "EndIndex": 2711, - "Kind": 3 - }, - { - "EndIndex": 2717, - "Kind": 3 - }, - { - "EndIndex": 2758, - "Kind": 3 - }, - { - "EndIndex": 2807, - "Kind": 3 - }, - { - "EndIndex": 2828, - "Kind": 3 - }, - { - "EndIndex": 2834, - "Kind": 3 - }, - { - "EndIndex": 2861, - "Kind": 3 - }, - { - "EndIndex": 2908, - "Kind": 3 - }, - { - "EndIndex": 2926, - "Kind": 3 - }, - { - "EndIndex": 2932, - "Kind": 3 - }, - { - "EndIndex": 2956, - "Kind": 3 - }, - { - "EndIndex": 2985, - "Kind": 3 - }, - { - "EndIndex": 3004, - "Kind": 3 - }, - { - "EndIndex": 3010, - "Kind": 3 - }, - { - "EndIndex": 3028, - "Kind": 3 - }, - { - "EndIndex": 3070, - "Kind": 3 - }, - { - "EndIndex": 3396, - "Kind": 3 - }, - { - "EndIndex": 3418, - "Kind": 3 - }, - { - "EndIndex": 3424, - "Kind": 3 - }, - { - "EndIndex": 3426, - "Kind": 3 - }, - { - "EndIndex": 3447, - "Kind": 3 - }, - { - "EndIndex": 3468, - "Kind": 3 - }, - { - "EndIndex": 3583, - "Kind": 3 - }, - { - "EndIndex": 3608, - "Kind": 3 - }, - { - "EndIndex": 3628, - "Kind": 3 - }, - { - "EndIndex": 3653, - "Kind": 3 - }, - { - "EndIndex": 3695, - "Kind": 3 - }, - { - "EndIndex": 3731, - "Kind": 3 - }, - { - "EndIndex": 3753, - "Kind": 3 - }, - { - "EndIndex": 3759, - "Kind": 3 - }, - { - "EndIndex": 3781, - "Kind": 3 - }, - { - "EndIndex": 3815, - "Kind": 3 - }, - { - "EndIndex": 3857, - "Kind": 3 - }, - { - "EndIndex": 3878, - "Kind": 3 - }, - { - "EndIndex": 3884, - "Kind": 3 - }, - { - "EndIndex": 3903, - "Kind": 3 - }, - { - "EndIndex": 3929, - "Kind": 3 - }, - { - "EndIndex": 3953, - "Kind": 3 - }, - { - "EndIndex": 4010, - "Kind": 3 - }, - { - "EndIndex": 4031, - "Kind": 3 - }, - { - "EndIndex": 4037, - "Kind": 3 - }, - { - "EndIndex": 4066, - "Kind": 3 - }, - { - "EndIndex": 4105, - "Kind": 3 - }, - { - "EndIndex": 4144, - "Kind": 3 - }, - { - "EndIndex": 4158, - "Kind": 3 - }, - { - "EndIndex": 4164, - "Kind": 3 - }, - { - "EndIndex": 4218, - "Kind": 3 - }, - { - "EndIndex": 4337, - "Kind": 3 - }, - { - "EndIndex": 4351, - "Kind": 3 - }, - { - "EndIndex": 4357, - "Kind": 3 - }, - { - "EndIndex": 4375, - "Kind": 3 - }, - { - "EndIndex": 4408, - "Kind": 3 - }, - { - "EndIndex": 4559, - "Kind": 3 - }, - { - "EndIndex": 4580, - "Kind": 3 - }, - { - "EndIndex": 4586, - "Kind": 3 - }, - { - "EndIndex": 4630, - "Kind": 3 - }, - { - "EndIndex": 4676, - "Kind": 3 - }, - { - "EndIndex": 4698, - "Kind": 3 - }, - { - "EndIndex": 4704, - "Kind": 3 - }, - { - "EndIndex": 4727, - "Kind": 3 - }, - { - "EndIndex": 4745, - "Kind": 3 - }, - { - "EndIndex": 4768, - "Kind": 3 - }, - { - "EndIndex": 4786, - "Kind": 3 - }, - { - "EndIndex": 4834, - "Kind": 3 - }, - { - "EndIndex": 4921, - "Kind": 3 - }, - { - "EndIndex": 4942, - "Kind": 3 - }, - { - "EndIndex": 4948, - "Kind": 3 - }, - { - "EndIndex": 4975, - "Kind": 3 - }, - { - "EndIndex": 5000, - "Kind": 3 - }, - { - "EndIndex": 5030, - "Kind": 3 - }, - { - "EndIndex": 5049, - "Kind": 3 - }, - { - "EndIndex": 5055, - "Kind": 3 - }, - { - "EndIndex": 5096, - "Kind": 3 - }, - { - "EndIndex": 5145, - "Kind": 3 - }, - { - "EndIndex": 5166, - "Kind": 3 - }, - { - "EndIndex": 5172, - "Kind": 3 - }, - { - "EndIndex": 5199, - "Kind": 3 - }, - { - "EndIndex": 5256, - "Kind": 3 - }, - { - "EndIndex": 5274, - "Kind": 3 - }, - { - "EndIndex": 5280, - "Kind": 3 - }, - { - "EndIndex": 5324, - "Kind": 3 - }, - { - "EndIndex": 5367, - "Kind": 3 - }, - { - "EndIndex": 5389, - "Kind": 3 - }, - { - "EndIndex": 5395, - "Kind": 3 - }, - { - "EndIndex": 5426, - "Kind": 3 - }, - { - "EndIndex": 5476, - "Kind": 3 - }, - { - "EndIndex": 5499, - "Kind": 3 - }, - { - "EndIndex": 5505, - "Kind": 3 - }, - { - "EndIndex": 5523, - "Kind": 3 - }, - { - "EndIndex": 5565, - "Kind": 3 - }, - { - "EndIndex": 5891, - "Kind": 3 - }, - { - "EndIndex": 5913, - "Kind": 3 - }, - { - "EndIndex": 5919, - "Kind": 3 - }, - { - "EndIndex": 5950, - "Kind": 3 - }, - { - "EndIndex": 5979, - "Kind": 3 - }, - { - "EndIndex": 5999, - "Kind": 3 - }, - { - "EndIndex": 6051, - "Kind": 3 - }, - { - "EndIndex": 6080, - "Kind": 3 - }, - { - "EndIndex": 6086, - "Kind": 3 - }, - { - "EndIndex": 6088, - "Kind": 3 - }, - { - "EndIndex": 6105, - "Kind": 3 - }, - { - "EndIndex": 6125, - "Kind": 3 - }, - { - "EndIndex": 6751, - "Kind": 3 - }, - { - "EndIndex": 6775, - "Kind": 3 - }, - { - "EndIndex": 6796, - "Kind": 3 - }, - { - "EndIndex": 6818, - "Kind": 3 - }, - { - "EndIndex": 6824, - "Kind": 3 - }, - { - "EndIndex": 6855, - "Kind": 3 - }, - { - "EndIndex": 6885, - "Kind": 3 - }, - { - "EndIndex": 6907, - "Kind": 3 - }, - { - "EndIndex": 6913, - "Kind": 3 - }, - { - "EndIndex": 6944, - "Kind": 3 - }, - { - "EndIndex": 6974, - "Kind": 3 - }, - { - "EndIndex": 6996, - "Kind": 3 - }, - { - "EndIndex": 7002, - "Kind": 3 - }, - { - "EndIndex": 7027, - "Kind": 3 - }, - { - "EndIndex": 7048, - "Kind": 3 - }, - { - "EndIndex": 7070, - "Kind": 3 - }, - { - "EndIndex": 7076, - "Kind": 3 - }, - { - "EndIndex": 7101, - "Kind": 3 - }, - { - "EndIndex": 7151, - "Kind": 3 - }, - { - "EndIndex": 7173, - "Kind": 3 - }, - { - "EndIndex": 7179, - "Kind": 3 - }, - { - "EndIndex": 7200, - "Kind": 3 - }, - { - "EndIndex": 7234, - "Kind": 3 - }, - { - "EndIndex": 7273, - "Kind": 3 - }, - { - "EndIndex": 7296, - "Kind": 3 - }, - { - "EndIndex": 7302, - "Kind": 3 - }, - { - "EndIndex": 7332, - "Kind": 3 - }, - { - "EndIndex": 7363, - "Kind": 3 - }, - { - "EndIndex": 7385, - "Kind": 3 - }, - { - "EndIndex": 7391, - "Kind": 3 - }, - { - "EndIndex": 7417, - "Kind": 3 - }, - { - "EndIndex": 7440, - "Kind": 3 - }, - { - "EndIndex": 7460, - "Kind": 3 - }, - { - "EndIndex": 7466, - "Kind": 3 - }, - { - "EndIndex": 7492, - "Kind": 3 - }, - { - "EndIndex": 7540, - "Kind": 3 - }, - { - "EndIndex": 7562, - "Kind": 3 - }, - { - "EndIndex": 7568, - "Kind": 3 - }, - { - "EndIndex": 7604, - "Kind": 3 - }, - { - "EndIndex": 7635, - "Kind": 3 - }, - { - "EndIndex": 7653, - "Kind": 3 - }, - { - "EndIndex": 7659, - "Kind": 3 - }, - { - "EndIndex": 7699, - "Kind": 3 - }, - { - "EndIndex": 7718, - "Kind": 3 - }, - { - "EndIndex": 7724, - "Kind": 3 - }, - { - "EndIndex": 7754, - "Kind": 3 - }, - { - "EndIndex": 7785, - "Kind": 3 - }, - { - "EndIndex": 7807, - "Kind": 3 - }, - { - "EndIndex": 7813, - "Kind": 3 - }, - { - "EndIndex": 7852, - "Kind": 3 - }, - { - "EndIndex": 7891, - "Kind": 3 - }, - { - "EndIndex": 7905, - "Kind": 3 - }, - { - "EndIndex": 7911, - "Kind": 3 - }, - { - "EndIndex": 7942, - "Kind": 3 - }, - { - "EndIndex": 7961, - "Kind": 3 - }, - { - "EndIndex": 7967, - "Kind": 3 - }, - { - "EndIndex": 7997, - "Kind": 3 - }, - { - "EndIndex": 8027, - "Kind": 3 - }, - { - "EndIndex": 8049, - "Kind": 3 - }, - { - "EndIndex": 8055, - "Kind": 3 - }, - { - "EndIndex": 8080, - "Kind": 3 - }, - { - "EndIndex": 8110, - "Kind": 3 - }, - { - "EndIndex": 8128, - "Kind": 3 - }, - { - "EndIndex": 8134, - "Kind": 3 - }, - { - "EndIndex": 8160, - "Kind": 3 - }, - { - "EndIndex": 8261, - "Kind": 3 - }, - { - "EndIndex": 8279, - "Kind": 3 - }, - { - "EndIndex": 8285, - "Kind": 3 - }, - { - "EndIndex": 8322, - "Kind": 3 - }, - { - "EndIndex": 8952, - "Kind": 3 - }, - { - "EndIndex": 8966, - "Kind": 3 - }, - { - "EndIndex": 8972, - "Kind": 3 - }, - { - "EndIndex": 8990, - "Kind": 3 - }, - { - "EndIndex": 9023, - "Kind": 3 - }, - { - "EndIndex": 9174, - "Kind": 3 - }, - { - "EndIndex": 9195, - "Kind": 3 - }, - { - "EndIndex": 9201, - "Kind": 3 - }, - { - "EndIndex": 9225, - "Kind": 3 - }, - { - "EndIndex": 9246, - "Kind": 3 - }, - { - "EndIndex": 9264, - "Kind": 3 - }, - { - "EndIndex": 9270, - "Kind": 3 - }, - { - "EndIndex": 9297, - "Kind": 3 - }, - { - "EndIndex": 9314, - "Kind": 3 - }, - { - "EndIndex": 9336, - "Kind": 3 - }, - { - "EndIndex": 9342, - "Kind": 3 - }, - { - "EndIndex": 9372, - "Kind": 3 - }, - { - "EndIndex": 9403, - "Kind": 3 - }, - { - "EndIndex": 9425, - "Kind": 3 - }, - { - "EndIndex": 9431, - "Kind": 3 - }, - { - "EndIndex": 9465, - "Kind": 3 - }, - { - "EndIndex": 9496, - "Kind": 3 - }, - { - "EndIndex": 9518, - "Kind": 3 - }, - { - "EndIndex": 9524, - "Kind": 3 - }, - { - "EndIndex": 9554, - "Kind": 3 - }, - { - "EndIndex": 9584, - "Kind": 3 - }, - { - "EndIndex": 9606, - "Kind": 3 - }, - { - "EndIndex": 9612, - "Kind": 3 - }, - { - "EndIndex": 9643, - "Kind": 3 - }, - { - "EndIndex": 9673, - "Kind": 3 - }, - { - "EndIndex": 9695, - "Kind": 3 - }, - { - "EndIndex": 9701, - "Kind": 3 - }, - { - "EndIndex": 9732, - "Kind": 3 - }, - { - "EndIndex": 9762, - "Kind": 3 - }, - { - "EndIndex": 9784, - "Kind": 3 - }, - { - "EndIndex": 9790, - "Kind": 3 - }, - { - "EndIndex": 9820, - "Kind": 3 - }, - { - "EndIndex": 9851, - "Kind": 3 - }, - { - "EndIndex": 9873, - "Kind": 3 - }, - { - "EndIndex": 9879, - "Kind": 3 - }, - { - "EndIndex": 9903, - "Kind": 3 - }, - { - "EndIndex": 9920, - "Kind": 3 - }, - { - "EndIndex": 9942, - "Kind": 3 - }, - { - "EndIndex": 9948, - "Kind": 3 - }, - { - "EndIndex": 9978, - "Kind": 3 - }, - { - "EndIndex": 10008, - "Kind": 3 - }, - { - "EndIndex": 10030, - "Kind": 3 - }, - { - "EndIndex": 10036, - "Kind": 3 - }, - { - "EndIndex": 10060, - "Kind": 3 - }, - { - "EndIndex": 10077, - "Kind": 3 - }, - { - "EndIndex": 10099, - "Kind": 3 - }, - { - "EndIndex": 10105, - "Kind": 3 - }, - { - "EndIndex": 10141, - "Kind": 3 - }, - { - "EndIndex": 10182, - "Kind": 3 - }, - { - "EndIndex": 10204, - "Kind": 3 - }, - { - "EndIndex": 10210, - "Kind": 3 - }, - { - "EndIndex": 10242, - "Kind": 3 - }, - { - "EndIndex": 10272, - "Kind": 3 - }, - { - "EndIndex": 10294, - "Kind": 3 - }, - { - "EndIndex": 10300, - "Kind": 3 - }, - { - "EndIndex": 10332, - "Kind": 3 - }, - { - "EndIndex": 10362, - "Kind": 3 - }, - { - "EndIndex": 10384, - "Kind": 3 - }, - { - "EndIndex": 10390, - "Kind": 3 - }, - { - "EndIndex": 10425, - "Kind": 3 - }, - { - "EndIndex": 10464, - "Kind": 3 - }, - { - "EndIndex": 10487, - "Kind": 3 - }, - { - "EndIndex": 10493, - "Kind": 3 - }, - { - "EndIndex": 10518, - "Kind": 3 - }, - { - "EndIndex": 10548, - "Kind": 3 - }, - { - "EndIndex": 10567, - "Kind": 3 - }, - { - "EndIndex": 10573, - "Kind": 3 - }, - { - "EndIndex": 10610, - "Kind": 3 - }, - { - "EndIndex": 10641, - "Kind": 3 - }, - { - "EndIndex": 10663, - "Kind": 3 - }, - { - "EndIndex": 10669, - "Kind": 3 - }, - { - "EndIndex": 10704, - "Kind": 3 - }, - { - "EndIndex": 10735, - "Kind": 3 - }, - { - "EndIndex": 10757, - "Kind": 3 - }, - { - "EndIndex": 10763, - "Kind": 3 - }, - { - "EndIndex": 10795, - "Kind": 3 - }, - { - "EndIndex": 10825, - "Kind": 3 - }, - { - "EndIndex": 10847, - "Kind": 3 - }, - { - "EndIndex": 10853, - "Kind": 3 - }, - { - "EndIndex": 10885, - "Kind": 3 - }, - { - "EndIndex": 10915, - "Kind": 3 - }, - { - "EndIndex": 10937, - "Kind": 3 - }, - { - "EndIndex": 10943, - "Kind": 3 - }, - { - "EndIndex": 10974, - "Kind": 3 - }, - { - "EndIndex": 11004, - "Kind": 3 - }, - { - "EndIndex": 11026, - "Kind": 3 - }, - { - "EndIndex": 11032, - "Kind": 3 - }, - { - "EndIndex": 11069, - "Kind": 3 - }, - { - "EndIndex": 11177, - "Kind": 3 - }, - { - "EndIndex": 11199, - "Kind": 3 - }, - { - "EndIndex": 11205, - "Kind": 3 - }, - { - "EndIndex": 11242, - "Kind": 3 - }, - { - "EndIndex": 11283, - "Kind": 3 - }, - { - "EndIndex": 11305, - "Kind": 3 - }, - { - "EndIndex": 11311, - "Kind": 3 - }, - { - "EndIndex": 11346, - "Kind": 3 - }, - { - "EndIndex": 11377, - "Kind": 3 - }, - { - "EndIndex": 11399, - "Kind": 3 - }, - { - "EndIndex": 11405, - "Kind": 3 - }, - { - "EndIndex": 11439, - "Kind": 3 - }, - { - "EndIndex": 11470, - "Kind": 3 - }, - { - "EndIndex": 11492, - "Kind": 3 - }, - { - "EndIndex": 11498, - "Kind": 3 - }, - { - "EndIndex": 11530, - "Kind": 3 - }, - { - "EndIndex": 11560, - "Kind": 3 - }, - { - "EndIndex": 11582, - "Kind": 3 - }, - { - "EndIndex": 11588, - "Kind": 3 - }, - { - "EndIndex": 11624, - "Kind": 3 - }, - { - "EndIndex": 11654, - "Kind": 3 - }, - { - "EndIndex": 11676, - "Kind": 3 - }, - { - "EndIndex": 11682, - "Kind": 3 - }, - { - "EndIndex": 11714, - "Kind": 3 - }, - { - "EndIndex": 11744, - "Kind": 3 - }, - { - "EndIndex": 11766, - "Kind": 3 - }, - { - "EndIndex": 11772, - "Kind": 3 - }, - { - "EndIndex": 11799, - "Kind": 3 - }, - { - "EndIndex": 11844, - "Kind": 3 - }, - { - "EndIndex": 11862, - "Kind": 3 - }, - { - "EndIndex": 11868, - "Kind": 3 - }, - { - "EndIndex": 11892, - "Kind": 3 - }, - { - "EndIndex": 11921, - "Kind": 3 - }, - { - "EndIndex": 11940, - "Kind": 3 - }, - { - "EndIndex": 11946, - "Kind": 3 - }, - { - "EndIndex": 11977, - "Kind": 3 - }, - { - "EndIndex": 12007, - "Kind": 3 - }, - { - "EndIndex": 12029, - "Kind": 3 - }, - { - "EndIndex": 12035, - "Kind": 3 - }, - { - "EndIndex": 12053, - "Kind": 3 - }, - { - "EndIndex": 12095, - "Kind": 3 - }, - { - "EndIndex": 12421, - "Kind": 3 - }, - { - "EndIndex": 12443, - "Kind": 3 - }, - { - "EndIndex": 12449, - "Kind": 3 - }, - { - "EndIndex": 12484, - "Kind": 3 - }, - { - "EndIndex": 12514, - "Kind": 3 - }, - { - "EndIndex": 12542, - "Kind": 3 - }, - { - "EndIndex": 12548, - "Kind": 3 - }, - { - "EndIndex": 12574, - "Kind": 3 - }, - { - "EndIndex": 12624, - "Kind": 3 - }, - { - "EndIndex": 12646, - "Kind": 3 - }, - { - "EndIndex": 12652, - "Kind": 3 - }, - { - "EndIndex": 12683, - "Kind": 3 - }, - { - "EndIndex": 12713, - "Kind": 3 - }, - { - "EndIndex": 12735, - "Kind": 3 - }, - { - "EndIndex": 12741, - "Kind": 3 - }, - { - "EndIndex": 12768, - "Kind": 3 - }, - { - "EndIndex": 12886, - "Kind": 3 - }, - { - "EndIndex": 12904, - "Kind": 3 - }, - { - "EndIndex": 12910, - "Kind": 3 - }, - { - "EndIndex": 12936, - "Kind": 3 - }, - { - "EndIndex": 12995, - "Kind": 3 - }, - { - "EndIndex": 13025, - "Kind": 3 - }, - { - "EndIndex": 13031, - "Kind": 3 - }, - { - "EndIndex": 13046, - "Kind": 3 - }, - { - "EndIndex": 13074, - "Kind": 3 - }, - { - "EndIndex": 13138, - "Kind": 3 - }, - { - "EndIndex": 13152, - "Kind": 3 - }, - { - "EndIndex": 13158, - "Kind": 3 - }, - { - "EndIndex": 13176, - "Kind": 3 - }, - { - "EndIndex": 13226, - "Kind": 3 - }, - { - "EndIndex": 13990, - "Kind": 3 - }, - { - "EndIndex": 14008, - "Kind": 3 - }, - { - "EndIndex": 14014, - "Kind": 3 - }, - { - "EndIndex": 14029, - "Kind": 3 - }, - { - "EndIndex": 14050, - "Kind": 3 - }, - { - "EndIndex": 14100, - "Kind": 3 - }, - { - "EndIndex": 14114, - "Kind": 3 - }, - { - "EndIndex": 14120, - "Kind": 3 - }, - { - "EndIndex": 14135, - "Kind": 3 - }, - { - "EndIndex": 14161, - "Kind": 3 - }, - { - "EndIndex": 14223, - "Kind": 3 - }, - { - "EndIndex": 14237, - "Kind": 3 - }, - { - "EndIndex": 14243, - "Kind": 3 - }, - { - "EndIndex": 14258, - "Kind": 3 - }, - { - "EndIndex": 14279, - "Kind": 3 - }, - { - "EndIndex": 14324, - "Kind": 3 - }, - { - "EndIndex": 14338, - "Kind": 3 - }, - { - "EndIndex": 14344, - "Kind": 3 - }, - { - "EndIndex": 14388, - "Kind": 3 - }, - { - "EndIndex": 15131, - "Kind": 3 - }, - { - "EndIndex": 15151, - "Kind": 3 - }, - { - "EndIndex": 15157, - "Kind": 3 - }, - { - "EndIndex": 15159, - "Kind": 3 - }, - { - "EndIndex": 15174, - "Kind": 3 - }, - { - "EndIndex": 15192, - "Kind": 3 - }, - { - "EndIndex": 15426, - "Kind": 3 - }, - { - "EndIndex": 15457, - "Kind": 3 - }, - { - "EndIndex": 15487, - "Kind": 3 - }, - { - "EndIndex": 15510, - "Kind": 3 - }, - { - "EndIndex": 15516, - "Kind": 3 - }, - { - "EndIndex": 15538, - "Kind": 3 - }, - { - "EndIndex": 15566, - "Kind": 3 - }, - { - "EndIndex": 15804, - "Kind": 3 - }, - { - "EndIndex": 15818, - "Kind": 3 - }, - { - "EndIndex": 15824, - "Kind": 3 - }, - { - "EndIndex": 15842, - "Kind": 3 - }, - { - "EndIndex": 15875, - "Kind": 3 - }, - { - "EndIndex": 16026, - "Kind": 3 - }, - { - "EndIndex": 16047, - "Kind": 3 - }, - { - "EndIndex": 16053, - "Kind": 3 - }, - { - "EndIndex": 16083, - "Kind": 3 - }, - { - "EndIndex": 16113, - "Kind": 3 - }, - { - "EndIndex": 16136, - "Kind": 3 - }, - { - "EndIndex": 16142, - "Kind": 3 - }, - { - "EndIndex": 16174, - "Kind": 3 - }, - { - "EndIndex": 16204, - "Kind": 3 - }, - { - "EndIndex": 16227, - "Kind": 3 - }, - { - "EndIndex": 16233, - "Kind": 3 - }, - { - "EndIndex": 16258, - "Kind": 3 - }, - { - "EndIndex": 16288, - "Kind": 3 - }, - { - "EndIndex": 16307, - "Kind": 3 - }, - { - "EndIndex": 16313, - "Kind": 3 - }, - { - "EndIndex": 16344, - "Kind": 3 - }, - { - "EndIndex": 16374, - "Kind": 3 - }, - { - "EndIndex": 16397, - "Kind": 3 - }, - { - "EndIndex": 16403, - "Kind": 3 - }, - { - "EndIndex": 16435, - "Kind": 3 - }, - { - "EndIndex": 16465, - "Kind": 3 - }, - { - "EndIndex": 16488, - "Kind": 3 - }, - { - "EndIndex": 16494, - "Kind": 3 - }, - { - "EndIndex": 16518, - "Kind": 3 - }, - { - "EndIndex": 16547, - "Kind": 3 - }, - { - "EndIndex": 16566, - "Kind": 3 - }, - { - "EndIndex": 16572, - "Kind": 3 - }, - { - "EndIndex": 16590, - "Kind": 3 - }, - { - "EndIndex": 16632, - "Kind": 3 - }, - { - "EndIndex": 16958, - "Kind": 3 - }, - { - "EndIndex": 16980, - "Kind": 3 - }, - { - "EndIndex": 16986, - "Kind": 3 - }, - { - "EndIndex": 17017, - "Kind": 3 - }, - { - "EndIndex": 17047, - "Kind": 3 - }, - { - "EndIndex": 17070, - "Kind": 3 - }, - { - "EndIndex": 17076, - "Kind": 3 - }, - { - "EndIndex": 17094, - "Kind": 3 - }, - { - "EndIndex": 17144, - "Kind": 3 - }, - { - "EndIndex": 17908, - "Kind": 3 - }, - { - "EndIndex": 17930, - "Kind": 3 - }, - { - "EndIndex": 17936, - "Kind": 3 - }, - { - "EndIndex": 17938, - "Kind": 3 - }, - { - "EndIndex": 17955, - "Kind": 3 - }, - { - "EndIndex": 17975, - "Kind": 3 - }, - { - "EndIndex": 17997, - "Kind": 3 - }, - { - "EndIndex": 18072, - "Kind": 3 - }, - { - "EndIndex": 18096, - "Kind": 3 - }, - { - "EndIndex": 18117, - "Kind": 3 - }, - { - "EndIndex": 18141, - "Kind": 3 - }, - { - "EndIndex": 18147, - "Kind": 3 - }, - { - "EndIndex": 18178, - "Kind": 3 - }, - { - "EndIndex": 18208, - "Kind": 3 - }, - { - "EndIndex": 18232, - "Kind": 3 - }, - { - "EndIndex": 18238, - "Kind": 3 - }, - { - "EndIndex": 18263, - "Kind": 3 - }, - { - "EndIndex": 18284, - "Kind": 3 - }, - { - "EndIndex": 18306, - "Kind": 3 - }, - { - "EndIndex": 18312, - "Kind": 3 - }, - { - "EndIndex": 18335, - "Kind": 3 - }, - { - "EndIndex": 18369, - "Kind": 3 - }, - { - "EndIndex": 18408, - "Kind": 3 - }, - { - "EndIndex": 18431, - "Kind": 3 - }, - { - "EndIndex": 18437, - "Kind": 3 - }, - { - "EndIndex": 18467, - "Kind": 3 - }, - { - "EndIndex": 18498, - "Kind": 3 - }, - { - "EndIndex": 18520, - "Kind": 3 - }, - { - "EndIndex": 18526, - "Kind": 3 - }, - { - "EndIndex": 18552, - "Kind": 3 - }, - { - "EndIndex": 18575, - "Kind": 3 - }, - { - "EndIndex": 18595, - "Kind": 3 - }, - { - "EndIndex": 18601, - "Kind": 3 - }, - { - "EndIndex": 18637, - "Kind": 3 - }, - { - "EndIndex": 18668, - "Kind": 3 - }, - { - "EndIndex": 18686, - "Kind": 3 - }, - { - "EndIndex": 18692, - "Kind": 3 - }, - { - "EndIndex": 18732, - "Kind": 3 - }, - { - "EndIndex": 18787, - "Kind": 3 - }, - { - "EndIndex": 18806, - "Kind": 3 - }, - { - "EndIndex": 18812, - "Kind": 3 - }, - { - "EndIndex": 18842, - "Kind": 3 - }, - { - "EndIndex": 18873, - "Kind": 3 - }, - { - "EndIndex": 18895, - "Kind": 3 - }, - { - "EndIndex": 18901, - "Kind": 3 - }, - { - "EndIndex": 18940, - "Kind": 3 - }, - { - "EndIndex": 18979, - "Kind": 3 - }, - { - "EndIndex": 18993, - "Kind": 3 - }, - { - "EndIndex": 18999, - "Kind": 3 - }, - { - "EndIndex": 19017, - "Kind": 3 - }, - { - "EndIndex": 19061, - "Kind": 3 - }, - { - "EndIndex": 19404, - "Kind": 3 - }, - { - "EndIndex": 19423, - "Kind": 3 - }, - { - "EndIndex": 19429, - "Kind": 3 - }, - { - "EndIndex": 19460, - "Kind": 3 - }, - { - "EndIndex": 19479, - "Kind": 3 - }, - { - "EndIndex": 19485, - "Kind": 3 - }, - { - "EndIndex": 19515, - "Kind": 3 - }, - { - "EndIndex": 19545, - "Kind": 3 - }, - { - "EndIndex": 19567, - "Kind": 3 - }, - { - "EndIndex": 19573, - "Kind": 3 - }, - { - "EndIndex": 19598, - "Kind": 3 - }, - { - "EndIndex": 19628, - "Kind": 3 - }, - { - "EndIndex": 19646, - "Kind": 3 - }, - { - "EndIndex": 19652, - "Kind": 3 - }, - { - "EndIndex": 19694, - "Kind": 3 - }, - { - "EndIndex": 19773, - "Kind": 3 - }, - { - "EndIndex": 19787, - "Kind": 3 - }, - { - "EndIndex": 19793, - "Kind": 3 - }, - { - "EndIndex": 19811, - "Kind": 3 - }, - { - "EndIndex": 19844, - "Kind": 3 - }, - { - "EndIndex": 19995, - "Kind": 3 - }, - { - "EndIndex": 20016, - "Kind": 3 - }, - { - "EndIndex": 20022, - "Kind": 3 - }, - { - "EndIndex": 20046, - "Kind": 3 - }, - { - "EndIndex": 20067, - "Kind": 3 - }, - { - "EndIndex": 20085, - "Kind": 3 - }, - { - "EndIndex": 20091, - "Kind": 3 - }, - { - "EndIndex": 20121, - "Kind": 3 - }, - { - "EndIndex": 20152, - "Kind": 3 - }, - { - "EndIndex": 20174, - "Kind": 3 - }, - { - "EndIndex": 20180, - "Kind": 3 - }, - { - "EndIndex": 20210, - "Kind": 3 - }, - { - "EndIndex": 20240, - "Kind": 3 - }, - { - "EndIndex": 20262, - "Kind": 3 - }, - { - "EndIndex": 20268, - "Kind": 3 - }, - { - "EndIndex": 20299, - "Kind": 3 - }, - { - "EndIndex": 20329, - "Kind": 3 - }, - { - "EndIndex": 20353, - "Kind": 3 - }, - { - "EndIndex": 20359, - "Kind": 3 - }, - { - "EndIndex": 20390, - "Kind": 3 - }, - { - "EndIndex": 20420, - "Kind": 3 - }, - { - "EndIndex": 20444, - "Kind": 3 - }, - { - "EndIndex": 20450, - "Kind": 3 - }, - { - "EndIndex": 20480, - "Kind": 3 - }, - { - "EndIndex": 20511, - "Kind": 3 - }, - { - "EndIndex": 20533, - "Kind": 3 - }, - { - "EndIndex": 20539, - "Kind": 3 - }, - { - "EndIndex": 20563, - "Kind": 3 - }, - { - "EndIndex": 20580, - "Kind": 3 - }, - { - "EndIndex": 20604, - "Kind": 3 - }, - { - "EndIndex": 20610, - "Kind": 3 - }, - { - "EndIndex": 20634, - "Kind": 3 - }, - { - "EndIndex": 20651, - "Kind": 3 - }, - { - "EndIndex": 20675, - "Kind": 3 - }, - { - "EndIndex": 20681, - "Kind": 3 - }, - { - "EndIndex": 20717, - "Kind": 3 - }, - { - "EndIndex": 20758, - "Kind": 3 - }, - { - "EndIndex": 20782, - "Kind": 3 - }, - { - "EndIndex": 20788, - "Kind": 3 - }, - { - "EndIndex": 20820, - "Kind": 3 - }, - { - "EndIndex": 20850, - "Kind": 3 - }, - { - "EndIndex": 20874, - "Kind": 3 - }, - { - "EndIndex": 20880, - "Kind": 3 - }, - { - "EndIndex": 20915, - "Kind": 3 - }, - { - "EndIndex": 20954, - "Kind": 3 - }, - { - "EndIndex": 20977, - "Kind": 3 - }, - { - "EndIndex": 20983, - "Kind": 3 - }, - { - "EndIndex": 21008, - "Kind": 3 - }, - { - "EndIndex": 21038, - "Kind": 3 - }, - { - "EndIndex": 21057, - "Kind": 3 - }, - { - "EndIndex": 21063, - "Kind": 3 - }, - { - "EndIndex": 21100, - "Kind": 3 - }, - { - "EndIndex": 21131, - "Kind": 3 - }, - { - "EndIndex": 21155, - "Kind": 3 - }, - { - "EndIndex": 21161, - "Kind": 3 - }, - { - "EndIndex": 21193, - "Kind": 3 - }, - { - "EndIndex": 21223, - "Kind": 3 - }, - { - "EndIndex": 21247, - "Kind": 3 - }, - { - "EndIndex": 21253, - "Kind": 3 - }, - { - "EndIndex": 21285, - "Kind": 3 - }, - { - "EndIndex": 21315, - "Kind": 3 - }, - { - "EndIndex": 21339, - "Kind": 3 - }, - { - "EndIndex": 21345, - "Kind": 3 - }, - { - "EndIndex": 21380, - "Kind": 3 - }, - { - "EndIndex": 21521, - "Kind": 3 - }, - { - "EndIndex": 21545, - "Kind": 3 - }, - { - "EndIndex": 21551, - "Kind": 3 - }, - { - "EndIndex": 21588, - "Kind": 3 - }, - { - "EndIndex": 21629, - "Kind": 3 - }, - { - "EndIndex": 21653, - "Kind": 3 - }, - { - "EndIndex": 21659, - "Kind": 3 - }, - { - "EndIndex": 21691, - "Kind": 3 - }, - { - "EndIndex": 21721, - "Kind": 3 - }, - { - "EndIndex": 21745, - "Kind": 3 - }, - { - "EndIndex": 21751, - "Kind": 3 - }, - { - "EndIndex": 21787, - "Kind": 3 - }, - { - "EndIndex": 21817, - "Kind": 3 - }, - { - "EndIndex": 21841, - "Kind": 3 - }, - { - "EndIndex": 21847, - "Kind": 3 - }, - { - "EndIndex": 21865, - "Kind": 3 - }, - { - "EndIndex": 21915, - "Kind": 3 - }, - { - "EndIndex": 22405, - "Kind": 3 - }, - { - "EndIndex": 22419, - "Kind": 3 - }, - { - "EndIndex": 22425, - "Kind": 3 - }, - { - "EndIndex": 22449, - "Kind": 3 - }, - { - "EndIndex": 22478, - "Kind": 3 - }, - { - "EndIndex": 22497, - "Kind": 3 - }, - { - "EndIndex": 22503, - "Kind": 3 - }, - { - "EndIndex": 22534, - "Kind": 3 - }, - { - "EndIndex": 22564, - "Kind": 3 - }, - { - "EndIndex": 22588, - "Kind": 3 - }, - { - "EndIndex": 22594, - "Kind": 3 - }, - { - "EndIndex": 22612, - "Kind": 3 - }, - { - "EndIndex": 22654, - "Kind": 3 - }, - { - "EndIndex": 22980, - "Kind": 3 - }, - { - "EndIndex": 23002, - "Kind": 3 - }, - { - "EndIndex": 23008, - "Kind": 3 - }, - { - "EndIndex": 23043, - "Kind": 3 - }, - { - "EndIndex": 23073, - "Kind": 3 - }, - { - "EndIndex": 23101, - "Kind": 3 - }, - { - "EndIndex": 23107, - "Kind": 3 - }, - { - "EndIndex": 23133, - "Kind": 3 - }, - { - "EndIndex": 23194, - "Kind": 3 - }, - { - "EndIndex": 23218, - "Kind": 3 - }, - { - "EndIndex": 23224, - "Kind": 3 - }, - { - "EndIndex": 23257, - "Kind": 3 - }, - { - "EndIndex": 23588, - "Kind": 3 - }, - { - "EndIndex": 23611, - "Kind": 3 - }, - { - "EndIndex": 23617, - "Kind": 3 - }, - { - "EndIndex": 23643, - "Kind": 3 - }, - { - "EndIndex": 23703, - "Kind": 3 - }, - { - "EndIndex": 23733, - "Kind": 3 - }, - { - "EndIndex": 23739, - "Kind": 3 - }, - { - "EndIndex": 23757, - "Kind": 3 - }, - { - "EndIndex": 23794, - "Kind": 3 - }, - { - "EndIndex": 23954, - "Kind": 3 - }, - { - "EndIndex": 23974, - "Kind": 3 - }, - { - "EndIndex": 23980, - "Kind": 3 - }, - { - "EndIndex": 24000, - "Kind": 3 - }, - { - "EndIndex": 24163, - "Kind": 3 - }, - { - "EndIndex": 24182, - "Kind": 3 - }, - { - "EndIndex": 24188, - "Kind": 3 - }, - { - "EndIndex": 24203, - "Kind": 3 - }, - { - "EndIndex": 24224, - "Kind": 3 - }, - { - "EndIndex": 24274, - "Kind": 3 - }, - { - "EndIndex": 24288, - "Kind": 3 - }, - { - "EndIndex": 24294, - "Kind": 3 - }, - { - "EndIndex": 24321, - "Kind": 3 - }, - { - "EndIndex": 24372, - "Kind": 3 - }, - { - "EndIndex": 24394, - "Kind": 3 - }, - { - "EndIndex": 24400, - "Kind": 3 - }, - { - "EndIndex": 24415, - "Kind": 3 - }, - { - "EndIndex": 24436, - "Kind": 3 - }, - { - "EndIndex": 24481, - "Kind": 3 - }, - { - "EndIndex": 24495, - "Kind": 3 - }, - { - "EndIndex": 24501, - "Kind": 3 - }, - { - "EndIndex": 24503, - "Kind": 3 - }, - { - "EndIndex": 24522, - "Kind": 3 - }, - { - "EndIndex": 24546, - "Kind": 3 - }, - { - "EndIndex": 24694, - "Kind": 3 - }, - { - "EndIndex": 24718, - "Kind": 3 - }, - { - "EndIndex": 24739, - "Kind": 3 - }, - { - "EndIndex": 24765, - "Kind": 3 - }, - { - "EndIndex": 24771, - "Kind": 3 - }, - { - "EndIndex": 24802, - "Kind": 3 - }, - { - "EndIndex": 24832, - "Kind": 3 - }, - { - "EndIndex": 24858, - "Kind": 3 - }, - { - "EndIndex": 24864, - "Kind": 3 - }, - { - "EndIndex": 24889, - "Kind": 3 - }, - { - "EndIndex": 24910, - "Kind": 3 - }, - { - "EndIndex": 24932, - "Kind": 3 - }, - { - "EndIndex": 24938, - "Kind": 3 - }, - { - "EndIndex": 24963, - "Kind": 3 - }, - { - "EndIndex": 24997, - "Kind": 3 - }, - { - "EndIndex": 25036, - "Kind": 3 - }, - { - "EndIndex": 25059, - "Kind": 3 - }, - { - "EndIndex": 25065, - "Kind": 3 - }, - { - "EndIndex": 25095, - "Kind": 3 - }, - { - "EndIndex": 25126, - "Kind": 3 - }, - { - "EndIndex": 25148, - "Kind": 3 - }, - { - "EndIndex": 25154, - "Kind": 3 - }, - { - "EndIndex": 25180, - "Kind": 3 - }, - { - "EndIndex": 25203, - "Kind": 3 - }, - { - "EndIndex": 25223, - "Kind": 3 - }, - { - "EndIndex": 25229, - "Kind": 3 - }, - { - "EndIndex": 25265, - "Kind": 3 - }, - { - "EndIndex": 25296, - "Kind": 3 - }, - { - "EndIndex": 25314, - "Kind": 3 - }, - { - "EndIndex": 25320, - "Kind": 3 - }, - { - "EndIndex": 25360, - "Kind": 3 - }, - { - "EndIndex": 25448, - "Kind": 3 - }, - { - "EndIndex": 25467, - "Kind": 3 - }, - { - "EndIndex": 25473, - "Kind": 3 - }, - { - "EndIndex": 25503, - "Kind": 3 - }, - { - "EndIndex": 25534, - "Kind": 3 - }, - { - "EndIndex": 25556, - "Kind": 3 - }, - { - "EndIndex": 25562, - "Kind": 3 - }, - { - "EndIndex": 25601, - "Kind": 3 - }, - { - "EndIndex": 25640, - "Kind": 3 - }, - { - "EndIndex": 25654, - "Kind": 3 - }, - { - "EndIndex": 25660, - "Kind": 3 - }, - { - "EndIndex": 25691, - "Kind": 3 - }, - { - "EndIndex": 25710, - "Kind": 3 - }, - { - "EndIndex": 25716, - "Kind": 3 - }, - { - "EndIndex": 25746, - "Kind": 3 - }, - { - "EndIndex": 25776, - "Kind": 3 - }, - { - "EndIndex": 25798, - "Kind": 3 - }, - { - "EndIndex": 25804, - "Kind": 3 - }, - { - "EndIndex": 25829, - "Kind": 3 - }, - { - "EndIndex": 25859, - "Kind": 3 - }, - { - "EndIndex": 25877, - "Kind": 3 - }, - { - "EndIndex": 25883, - "Kind": 3 - }, - { - "EndIndex": 25925, - "Kind": 3 - }, - { - "EndIndex": 26077, - "Kind": 3 - }, - { - "EndIndex": 26091, - "Kind": 3 - }, - { - "EndIndex": 26097, - "Kind": 3 - }, - { - "EndIndex": 26115, - "Kind": 3 - }, - { - "EndIndex": 26148, - "Kind": 3 - }, - { - "EndIndex": 26299, - "Kind": 3 - }, - { - "EndIndex": 26320, - "Kind": 3 - }, - { - "EndIndex": 26326, - "Kind": 3 - }, - { - "EndIndex": 26350, - "Kind": 3 - }, - { - "EndIndex": 26371, - "Kind": 3 - }, - { - "EndIndex": 26389, - "Kind": 3 - }, - { - "EndIndex": 26395, - "Kind": 3 - }, - { - "EndIndex": 26425, - "Kind": 3 - }, - { - "EndIndex": 26456, - "Kind": 3 - }, - { - "EndIndex": 26478, - "Kind": 3 - }, - { - "EndIndex": 26484, - "Kind": 3 - }, - { - "EndIndex": 26514, - "Kind": 3 - }, - { - "EndIndex": 26544, - "Kind": 3 - }, - { - "EndIndex": 26566, - "Kind": 3 - }, - { - "EndIndex": 26572, - "Kind": 3 - }, - { - "EndIndex": 26603, - "Kind": 3 - }, - { - "EndIndex": 26633, - "Kind": 3 - }, - { - "EndIndex": 26659, - "Kind": 3 - }, - { - "EndIndex": 26665, - "Kind": 3 - }, - { - "EndIndex": 26696, - "Kind": 3 - }, - { - "EndIndex": 26726, - "Kind": 3 - }, - { - "EndIndex": 26752, - "Kind": 3 - }, - { - "EndIndex": 26758, - "Kind": 3 - }, - { - "EndIndex": 26788, - "Kind": 3 - }, - { - "EndIndex": 26819, - "Kind": 3 - }, - { - "EndIndex": 26841, - "Kind": 3 - }, - { - "EndIndex": 26847, - "Kind": 3 - }, - { - "EndIndex": 26871, - "Kind": 3 - }, - { - "EndIndex": 26888, - "Kind": 3 - }, - { - "EndIndex": 26914, - "Kind": 3 - }, - { - "EndIndex": 26920, - "Kind": 3 - }, - { - "EndIndex": 26944, - "Kind": 3 - }, - { - "EndIndex": 26961, - "Kind": 3 - }, - { - "EndIndex": 26987, - "Kind": 3 - }, - { - "EndIndex": 26993, - "Kind": 3 - }, - { - "EndIndex": 27029, - "Kind": 3 - }, - { - "EndIndex": 27070, - "Kind": 3 - }, - { - "EndIndex": 27096, - "Kind": 3 - }, - { - "EndIndex": 27102, - "Kind": 3 - }, - { - "EndIndex": 27134, - "Kind": 3 - }, - { - "EndIndex": 27164, - "Kind": 3 - }, - { - "EndIndex": 27190, - "Kind": 3 - }, - { - "EndIndex": 27196, - "Kind": 3 - }, - { - "EndIndex": 27231, - "Kind": 3 - }, - { - "EndIndex": 27270, - "Kind": 3 - }, - { - "EndIndex": 27293, - "Kind": 3 - }, - { - "EndIndex": 27299, - "Kind": 3 - }, - { - "EndIndex": 27324, - "Kind": 3 - }, - { - "EndIndex": 27354, - "Kind": 3 - }, - { - "EndIndex": 27373, - "Kind": 3 - }, - { - "EndIndex": 27379, - "Kind": 3 - }, - { - "EndIndex": 27416, - "Kind": 3 - }, - { - "EndIndex": 27447, - "Kind": 3 - }, - { - "EndIndex": 27473, - "Kind": 3 - }, - { - "EndIndex": 27479, - "Kind": 3 - }, - { - "EndIndex": 27511, - "Kind": 3 - }, - { - "EndIndex": 27541, - "Kind": 3 - }, - { - "EndIndex": 27567, - "Kind": 3 - }, - { - "EndIndex": 27573, - "Kind": 3 - }, - { - "EndIndex": 27605, - "Kind": 3 - }, - { - "EndIndex": 27635, - "Kind": 3 - }, - { - "EndIndex": 27661, - "Kind": 3 - }, - { - "EndIndex": 27667, - "Kind": 3 - }, - { - "EndIndex": 27704, - "Kind": 3 - }, - { - "EndIndex": 27745, - "Kind": 3 - }, - { - "EndIndex": 27771, - "Kind": 3 - }, - { - "EndIndex": 27777, - "Kind": 3 - }, - { - "EndIndex": 27809, - "Kind": 3 - }, - { - "EndIndex": 27839, - "Kind": 3 - }, - { - "EndIndex": 27865, - "Kind": 3 - }, - { - "EndIndex": 27871, - "Kind": 3 - }, - { - "EndIndex": 27907, - "Kind": 3 - }, - { - "EndIndex": 27937, - "Kind": 3 - }, - { - "EndIndex": 27963, - "Kind": 3 - }, - { - "EndIndex": 27969, - "Kind": 3 - }, - { - "EndIndex": 27993, - "Kind": 3 - }, - { - "EndIndex": 28022, - "Kind": 3 - }, - { - "EndIndex": 28041, - "Kind": 3 - }, - { - "EndIndex": 28047, - "Kind": 3 - }, - { - "EndIndex": 28078, - "Kind": 3 - }, - { - "EndIndex": 28108, - "Kind": 3 - }, - { - "EndIndex": 28134, - "Kind": 3 - }, - { - "EndIndex": 28140, - "Kind": 3 - }, - { - "EndIndex": 28158, - "Kind": 3 - }, - { - "EndIndex": 28200, - "Kind": 3 - }, - { - "EndIndex": 28526, - "Kind": 3 - }, - { - "EndIndex": 28548, - "Kind": 3 - }, - { - "EndIndex": 28554, - "Kind": 3 - }, - { - "EndIndex": 28589, - "Kind": 3 - }, - { - "EndIndex": 28619, - "Kind": 3 - }, - { - "EndIndex": 28647, - "Kind": 3 - }, - { - "EndIndex": 28653, - "Kind": 3 - }, - { - "EndIndex": 28679, - "Kind": 3 - }, - { - "EndIndex": 28798, - "Kind": 3 - }, - { - "EndIndex": 28828, - "Kind": 3 - }, - { - "EndIndex": 28834, - "Kind": 3 - }, - { - "EndIndex": 28849, - "Kind": 3 - }, - { - "EndIndex": 28870, - "Kind": 3 - }, - { - "EndIndex": 28920, - "Kind": 3 - }, - { - "EndIndex": 28934, - "Kind": 3 - }, - { - "EndIndex": 28940, - "Kind": 3 - }, - { - "EndIndex": 28955, - "Kind": 3 - }, - { - "EndIndex": 28976, - "Kind": 3 - }, - { - "EndIndex": 29021, - "Kind": 3 - }, - { - "EndIndex": 29035, - "Kind": 3 - }, - { - "EndIndex": 29041, - "Kind": 3 - }, - { - "EndIndex": 29043, - "Kind": 3 - }, - { - "EndIndex": 29066, - "Kind": 3 - }, - { - "EndIndex": 29088, - "Kind": 3 - }, - { - "EndIndex": 29334, - "Kind": 3 - }, - { - "EndIndex": 29365, - "Kind": 3 - }, - { - "EndIndex": 29395, - "Kind": 3 - }, - { - "EndIndex": 29419, - "Kind": 3 - }, - { - "EndIndex": 29425, - "Kind": 3 - }, - { - "EndIndex": 29448, - "Kind": 3 - }, - { - "EndIndex": 29482, - "Kind": 3 - }, - { - "EndIndex": 29513, - "Kind": 3 - }, - { - "EndIndex": 29535, - "Kind": 3 - }, - { - "EndIndex": 29541, - "Kind": 3 - }, - { - "EndIndex": 29571, - "Kind": 3 - }, - { - "EndIndex": 29602, - "Kind": 3 - }, - { - "EndIndex": 29624, - "Kind": 3 - }, - { - "EndIndex": 29630, - "Kind": 3 - }, - { - "EndIndex": 29660, - "Kind": 3 - }, - { - "EndIndex": 29691, - "Kind": 3 - }, - { - "EndIndex": 29713, - "Kind": 3 - }, - { - "EndIndex": 29719, - "Kind": 3 - }, - { - "EndIndex": 29758, - "Kind": 3 - }, - { - "EndIndex": 29797, - "Kind": 3 - }, - { - "EndIndex": 29811, - "Kind": 3 - }, - { - "EndIndex": 29817, - "Kind": 3 - }, - { - "EndIndex": 29850, - "Kind": 3 - }, - { - "EndIndex": 29879, - "Kind": 3 - }, - { - "EndIndex": 29893, - "Kind": 3 - }, - { - "EndIndex": 29899, - "Kind": 3 - }, - { - "EndIndex": 29930, - "Kind": 3 - }, - { - "EndIndex": 29949, - "Kind": 3 - }, - { - "EndIndex": 29955, - "Kind": 3 - }, - { - "EndIndex": 29985, - "Kind": 3 - }, - { - "EndIndex": 30015, - "Kind": 3 - }, - { - "EndIndex": 30037, - "Kind": 3 - }, - { - "EndIndex": 30043, - "Kind": 3 - }, - { - "EndIndex": 30068, - "Kind": 3 - }, - { - "EndIndex": 30098, - "Kind": 3 - }, - { - "EndIndex": 30116, - "Kind": 3 - }, - { - "EndIndex": 30122, - "Kind": 3 - }, - { - "EndIndex": 30164, - "Kind": 3 - }, - { - "EndIndex": 30414, - "Kind": 3 - }, - { - "EndIndex": 30428, - "Kind": 3 - }, - { - "EndIndex": 30434, - "Kind": 3 - }, - { - "EndIndex": 30452, - "Kind": 3 - }, - { - "EndIndex": 30485, - "Kind": 3 - }, - { - "EndIndex": 30636, - "Kind": 3 - }, - { - "EndIndex": 30657, - "Kind": 3 - }, - { - "EndIndex": 30663, - "Kind": 3 - }, - { - "EndIndex": 30688, - "Kind": 3 - }, - { - "EndIndex": 30721, - "Kind": 3 - }, - { - "EndIndex": 30757, - "Kind": 3 - }, - { - "EndIndex": 30763, - "Kind": 3 - }, - { - "EndIndex": 30793, - "Kind": 3 - }, - { - "EndIndex": 30824, - "Kind": 3 - }, - { - "EndIndex": 30846, - "Kind": 3 - }, - { - "EndIndex": 30852, - "Kind": 3 - }, - { - "EndIndex": 30876, - "Kind": 3 - }, - { - "EndIndex": 30905, - "Kind": 3 - }, - { - "EndIndex": 30923, - "Kind": 3 - }, - { - "EndIndex": 30929, - "Kind": 3 - }, - { - "EndIndex": 30959, - "Kind": 3 - }, - { - "EndIndex": 30989, - "Kind": 3 - }, - { - "EndIndex": 31011, - "Kind": 3 - }, - { - "EndIndex": 31017, - "Kind": 3 - }, - { - "EndIndex": 31048, - "Kind": 3 - }, - { - "EndIndex": 31078, - "Kind": 3 - }, - { - "EndIndex": 31102, - "Kind": 3 - }, - { - "EndIndex": 31108, - "Kind": 3 - }, - { - "EndIndex": 31138, - "Kind": 3 - }, - { - "EndIndex": 31169, - "Kind": 3 - }, - { - "EndIndex": 31191, - "Kind": 3 - }, - { - "EndIndex": 31197, - "Kind": 3 - }, - { - "EndIndex": 31222, - "Kind": 3 - }, - { - "EndIndex": 31252, - "Kind": 3 - }, - { - "EndIndex": 31271, - "Kind": 3 - }, - { - "EndIndex": 31277, - "Kind": 3 - }, - { - "EndIndex": 31309, - "Kind": 3 - }, - { - "EndIndex": 31339, - "Kind": 3 - }, - { - "EndIndex": 31363, - "Kind": 3 - }, - { - "EndIndex": 31369, - "Kind": 3 - }, - { - "EndIndex": 31387, - "Kind": 3 - }, - { - "EndIndex": 31429, - "Kind": 3 - }, - { - "EndIndex": 31755, - "Kind": 3 - }, - { - "EndIndex": 31777, - "Kind": 3 - }, - { - "EndIndex": 31783, - "Kind": 3 - }, - { - "EndIndex": 31812, - "Kind": 3 - }, - { - "EndIndex": 31862, - "Kind": 3 - }, - { - "EndIndex": 31880, - "Kind": 3 - }, - { - "EndIndex": 31886, - "Kind": 3 - }, - { - "EndIndex": 31928, - "Kind": 3 - }, - { - "EndIndex": 32018, - "Kind": 3 - }, - { - "EndIndex": 32036, - "Kind": 3 - }, - { - "EndIndex": 32042, - "Kind": 3 - }, - { - "EndIndex": 32044, - "Kind": 3 - }, - { - "EndIndex": 32063, - "Kind": 3 - }, - { - "EndIndex": 32084, - "Kind": 3 - }, - { - "EndIndex": 32236, - "Kind": 3 - }, - { - "EndIndex": 32267, - "Kind": 3 - }, - { - "EndIndex": 32297, - "Kind": 3 - }, - { - "EndIndex": 32320, - "Kind": 3 - }, - { - "EndIndex": 32326, - "Kind": 3 - }, - { - "EndIndex": 32348, - "Kind": 3 - }, - { - "EndIndex": 32382, - "Kind": 3 - }, - { - "EndIndex": 32413, - "Kind": 3 - }, - { - "EndIndex": 32435, - "Kind": 3 - }, - { - "EndIndex": 32441, - "Kind": 3 - }, - { - "EndIndex": 32474, - "Kind": 3 - }, - { - "EndIndex": 32503, - "Kind": 3 - }, - { - "EndIndex": 32524, - "Kind": 3 - }, - { - "EndIndex": 32530, - "Kind": 3 - }, - { - "EndIndex": 32560, - "Kind": 3 - }, - { - "EndIndex": 32591, - "Kind": 3 - }, - { - "EndIndex": 32613, - "Kind": 3 - }, - { - "EndIndex": 32619, - "Kind": 3 - }, - { - "EndIndex": 32649, - "Kind": 3 - }, - { - "EndIndex": 32680, - "Kind": 3 - }, - { - "EndIndex": 32702, - "Kind": 3 - }, - { - "EndIndex": 32708, - "Kind": 3 - }, - { - "EndIndex": 32747, - "Kind": 3 - }, - { - "EndIndex": 32786, - "Kind": 3 - }, - { - "EndIndex": 32800, - "Kind": 3 - }, - { - "EndIndex": 32806, - "Kind": 3 - }, - { - "EndIndex": 32841, - "Kind": 3 - }, - { - "EndIndex": 32879, - "Kind": 3 - }, - { - "EndIndex": 32893, - "Kind": 3 - }, - { - "EndIndex": 32899, - "Kind": 3 - }, - { - "EndIndex": 32929, - "Kind": 3 - }, - { - "EndIndex": 32959, - "Kind": 3 - }, - { - "EndIndex": 32981, - "Kind": 3 - }, - { - "EndIndex": 32987, - "Kind": 3 - }, - { - "EndIndex": 33008, - "Kind": 3 - }, - { - "EndIndex": 33040, - "Kind": 3 - }, - { - "EndIndex": 33074, - "Kind": 3 - }, - { - "EndIndex": 33095, - "Kind": 3 - }, - { - "EndIndex": 33101, - "Kind": 3 - }, - { - "EndIndex": 33133, - "Kind": 3 - }, - { - "EndIndex": 33167, - "Kind": 3 - }, - { - "EndIndex": 33188, - "Kind": 3 - }, - { - "EndIndex": 33194, - "Kind": 3 - }, - { - "EndIndex": 33236, - "Kind": 3 - }, - { - "EndIndex": 33392, - "Kind": 3 - }, - { - "EndIndex": 33406, - "Kind": 3 - }, - { - "EndIndex": 33412, - "Kind": 3 - }, - { - "EndIndex": 33430, - "Kind": 3 - }, - { - "EndIndex": 33463, - "Kind": 3 - }, - { - "EndIndex": 33614, - "Kind": 3 - }, - { - "EndIndex": 33635, - "Kind": 3 - }, - { - "EndIndex": 33641, - "Kind": 3 - }, - { - "EndIndex": 33666, - "Kind": 3 - }, - { - "EndIndex": 33699, - "Kind": 3 - }, - { - "EndIndex": 33734, - "Kind": 3 - }, - { - "EndIndex": 33740, - "Kind": 3 - }, - { - "EndIndex": 33770, - "Kind": 3 - }, - { - "EndIndex": 33801, - "Kind": 3 - }, - { - "EndIndex": 33823, - "Kind": 3 - }, - { - "EndIndex": 33829, - "Kind": 3 - }, - { - "EndIndex": 33853, - "Kind": 3 - }, - { - "EndIndex": 33882, - "Kind": 3 - }, - { - "EndIndex": 33900, - "Kind": 3 - }, - { - "EndIndex": 33906, - "Kind": 3 - }, - { - "EndIndex": 33936, - "Kind": 3 - }, - { - "EndIndex": 33966, - "Kind": 3 - }, - { - "EndIndex": 33988, - "Kind": 3 - }, - { - "EndIndex": 33994, - "Kind": 3 - }, - { - "EndIndex": 34025, - "Kind": 3 - }, - { - "EndIndex": 34055, - "Kind": 3 - }, - { - "EndIndex": 34078, - "Kind": 3 - }, - { - "EndIndex": 34084, - "Kind": 3 - }, - { - "EndIndex": 34114, - "Kind": 3 - }, - { - "EndIndex": 34145, - "Kind": 3 - }, - { - "EndIndex": 34167, - "Kind": 3 - }, - { - "EndIndex": 34173, - "Kind": 3 - }, - { - "EndIndex": 34198, - "Kind": 3 - }, - { - "EndIndex": 34228, - "Kind": 3 - }, - { - "EndIndex": 34247, - "Kind": 3 - }, - { - "EndIndex": 34253, - "Kind": 3 - }, - { - "EndIndex": 34282, - "Kind": 3 - }, - { - "EndIndex": 34334, - "Kind": 3 - }, - { - "EndIndex": 34369, - "Kind": 3 - }, - { - "EndIndex": 34375, - "Kind": 3 - }, - { - "EndIndex": 34407, - "Kind": 3 - }, - { - "EndIndex": 34437, - "Kind": 3 - }, - { - "EndIndex": 34460, - "Kind": 3 - }, - { - "EndIndex": 34466, - "Kind": 3 - }, - { - "EndIndex": 34506, - "Kind": 3 - }, - { - "EndIndex": 34541, - "Kind": 3 - }, - { - "EndIndex": 34562, - "Kind": 3 - }, - { - "EndIndex": 34568, - "Kind": 3 - }, - { - "EndIndex": 34595, - "Kind": 3 - }, - { - "EndIndex": 34655, - "Kind": 3 - }, - { - "EndIndex": 34673, - "Kind": 3 - }, - { - "EndIndex": 34679, - "Kind": 3 - }, - { - "EndIndex": 34697, - "Kind": 3 - }, - { - "EndIndex": 34739, - "Kind": 3 - }, - { - "EndIndex": 35065, - "Kind": 3 - }, - { - "EndIndex": 35087, - "Kind": 3 - }, - { - "EndIndex": 35093, - "Kind": 3 - }, - { - "EndIndex": 35124, - "Kind": 3 - }, - { - "EndIndex": 35173, - "Kind": 3 - }, - { - "EndIndex": 35194, - "Kind": 3 - }, - { - "EndIndex": 35200, - "Kind": 3 - }, - { - "EndIndex": 35222, - "Kind": 3 - }, - { - "EndIndex": 35261, - "Kind": 3 - }, - { - "EndIndex": 35282, - "Kind": 3 - }, - { - "EndIndex": 35288, - "Kind": 3 - }, - { - "EndIndex": 35309, - "Kind": 3 - }, - { - "EndIndex": 35355, - "Kind": 3 - }, - { - "EndIndex": 35378, - "Kind": 3 - }, - { - "EndIndex": 35384, - "Kind": 3 - }, - { - "EndIndex": 35413, - "Kind": 3 - }, - { - "EndIndex": 35463, - "Kind": 3 - }, - { - "EndIndex": 35481, - "Kind": 3 - }, - { - "EndIndex": 35487, - "Kind": 3 - }, - { - "EndIndex": 35520, - "Kind": 3 - }, - { - "EndIndex": 35584, - "Kind": 3 - }, - { - "EndIndex": 35605, - "Kind": 3 - }, - { - "EndIndex": 35611, - "Kind": 3 - }, - { - "EndIndex": 35653, - "Kind": 3 - }, - { - "EndIndex": 35743, - "Kind": 3 - }, - { - "EndIndex": 35761, - "Kind": 3 - }, - { - "EndIndex": 35767, - "Kind": 3 - }, - { - "EndIndex": 35805, - "Kind": 3 - }, - { - "EndIndex": 35844, - "Kind": 3 - }, - { - "EndIndex": 35865, - "Kind": 3 - }, - { - "EndIndex": 35871, - "Kind": 3 - }, - { - "EndIndex": 35898, - "Kind": 3 - }, - { - "EndIndex": 36021, - "Kind": 3 - }, - { - "EndIndex": 36045, - "Kind": 3 - }, - { - "EndIndex": 36051, - "Kind": 3 - }, - { - "EndIndex": 36081, - "Kind": 3 - }, - { - "EndIndex": 36176, - "Kind": 3 - }, - { - "EndIndex": 36197, - "Kind": 3 - }, - { - "EndIndex": 36203, - "Kind": 3 - }, - { - "EndIndex": 36227, - "Kind": 3 - }, - { - "EndIndex": 36258, - "Kind": 3 - }, - { - "EndIndex": 36279, - "Kind": 3 - }, - { - "EndIndex": 36285, - "Kind": 3 - }, - { - "EndIndex": 36306, - "Kind": 3 - }, - { - "EndIndex": 36341, - "Kind": 3 - }, - { - "EndIndex": 36362, - "Kind": 3 - }, - { - "EndIndex": 36368, - "Kind": 3 - }, - { - "EndIndex": 36370, - "Kind": 3 - }, - { - "EndIndex": 36387, - "Kind": 3 - }, - { - "EndIndex": 36408, - "Kind": 3 - }, - { - "EndIndex": 36794, - "Kind": 3 - }, - { - "EndIndex": 36816, - "Kind": 3 - }, - { - "EndIndex": 36850, - "Kind": 3 - }, - { - "EndIndex": 36919, - "Kind": 3 - }, - { - "EndIndex": 36941, - "Kind": 3 - }, - { - "EndIndex": 36947, - "Kind": 3 - }, - { - "EndIndex": 36980, - "Kind": 3 - }, - { - "EndIndex": 37009, - "Kind": 3 - }, - { - "EndIndex": 37030, - "Kind": 3 - }, - { - "EndIndex": 37036, - "Kind": 3 - }, - { - "EndIndex": 37066, - "Kind": 3 - }, - { - "EndIndex": 37097, - "Kind": 3 - }, - { - "EndIndex": 37119, - "Kind": 3 - }, - { - "EndIndex": 37125, - "Kind": 3 - }, - { - "EndIndex": 37155, - "Kind": 3 - }, - { - "EndIndex": 37186, - "Kind": 3 - }, - { - "EndIndex": 37208, - "Kind": 3 - }, - { - "EndIndex": 37214, - "Kind": 3 - }, - { - "EndIndex": 37253, - "Kind": 3 - }, - { - "EndIndex": 37292, - "Kind": 3 - }, - { - "EndIndex": 37306, - "Kind": 3 - }, - { - "EndIndex": 37312, - "Kind": 3 - }, - { - "EndIndex": 37345, - "Kind": 3 - }, - { - "EndIndex": 37383, - "Kind": 3 - }, - { - "EndIndex": 37397, - "Kind": 3 - }, - { - "EndIndex": 37403, - "Kind": 3 - }, - { - "EndIndex": 37433, - "Kind": 3 - }, - { - "EndIndex": 37463, - "Kind": 3 - }, - { - "EndIndex": 37485, - "Kind": 3 - }, - { - "EndIndex": 37491, - "Kind": 3 - }, - { - "EndIndex": 37512, - "Kind": 3 - }, - { - "EndIndex": 37547, - "Kind": 3 - }, - { - "EndIndex": 37937, - "Kind": 3 - }, - { - "EndIndex": 37951, - "Kind": 3 - }, - { - "EndIndex": 37957, - "Kind": 3 - }, - { - "EndIndex": 37975, - "Kind": 3 - }, - { - "EndIndex": 38008, - "Kind": 3 - }, - { - "EndIndex": 38159, - "Kind": 3 - }, - { - "EndIndex": 38180, - "Kind": 3 - }, - { - "EndIndex": 38186, - "Kind": 3 - }, - { - "EndIndex": 38211, - "Kind": 3 - }, - { - "EndIndex": 38244, - "Kind": 3 - }, - { - "EndIndex": 38275, - "Kind": 3 - }, - { - "EndIndex": 38281, - "Kind": 3 - }, - { - "EndIndex": 38311, - "Kind": 3 - }, - { - "EndIndex": 38342, - "Kind": 3 - }, - { - "EndIndex": 38364, - "Kind": 3 - }, - { - "EndIndex": 38370, - "Kind": 3 - }, - { - "EndIndex": 38394, - "Kind": 3 - }, - { - "EndIndex": 38423, - "Kind": 3 - }, - { - "EndIndex": 38441, - "Kind": 3 - }, - { - "EndIndex": 38447, - "Kind": 3 - }, - { - "EndIndex": 38477, - "Kind": 3 - }, - { - "EndIndex": 38507, - "Kind": 3 - }, - { - "EndIndex": 38529, - "Kind": 3 - }, - { - "EndIndex": 38535, - "Kind": 3 - }, - { - "EndIndex": 38565, - "Kind": 3 - }, - { - "EndIndex": 38596, - "Kind": 3 - }, - { - "EndIndex": 38618, - "Kind": 3 - }, - { - "EndIndex": 38624, - "Kind": 3 - }, - { - "EndIndex": 38649, - "Kind": 3 - }, - { - "EndIndex": 38679, - "Kind": 3 - }, - { - "EndIndex": 38698, - "Kind": 3 - }, - { - "EndIndex": 38704, - "Kind": 3 - }, - { - "EndIndex": 38744, - "Kind": 3 - }, - { - "EndIndex": 38779, - "Kind": 3 - }, - { - "EndIndex": 38800, - "Kind": 3 - }, - { - "EndIndex": 38806, - "Kind": 3 - }, - { - "EndIndex": 38833, - "Kind": 3 - }, - { - "EndIndex": 38892, - "Kind": 3 - }, - { - "EndIndex": 38910, - "Kind": 3 - }, - { - "EndIndex": 38916, - "Kind": 3 - }, - { - "EndIndex": 38934, - "Kind": 3 - }, - { - "EndIndex": 38976, - "Kind": 3 - }, - { - "EndIndex": 39302, - "Kind": 3 - }, - { - "EndIndex": 39324, - "Kind": 3 - }, - { - "EndIndex": 39330, - "Kind": 3 - }, - { - "EndIndex": 39352, - "Kind": 3 - }, - { - "EndIndex": 39408, - "Kind": 3 - }, - { - "EndIndex": 39429, - "Kind": 3 - }, - { - "EndIndex": 39435, - "Kind": 3 - }, - { - "EndIndex": 39456, - "Kind": 3 - }, - { - "EndIndex": 39499, - "Kind": 3 - }, - { - "EndIndex": 39522, - "Kind": 3 - }, - { - "EndIndex": 39528, - "Kind": 3 - }, - { - "EndIndex": 39546, - "Kind": 3 - }, - { - "EndIndex": 39593, - "Kind": 3 - }, - { - "EndIndex": 39677, - "Kind": 3 - }, - { - "EndIndex": 39696, - "Kind": 3 - }, - { - "EndIndex": 39702, - "Kind": 3 - }, - { - "EndIndex": 39736, - "Kind": 3 - }, - { - "EndIndex": 39815, - "Kind": 3 - }, - { - "EndIndex": 39839, - "Kind": 3 - }, - { - "EndIndex": 39845, - "Kind": 3 - }, - { - "EndIndex": 39867, - "Kind": 3 - }, - { - "EndIndex": 39939, - "Kind": 3 - }, - { - "EndIndex": 39971, - "Kind": 3 - }, - { - "EndIndex": 39977, - "Kind": 3 - }, - { - "EndIndex": 39998, - "Kind": 3 - }, - { - "EndIndex": 40068, - "Kind": 3 - }, - { - "EndIndex": 40099, - "Kind": 3 - }, - { - "EndIndex": 40105, - "Kind": 3 - }, - { - "EndIndex": 40136, - "Kind": 3 - }, - { - "EndIndex": 40298, - "Kind": 3 - }, - { - "EndIndex": 40329, - "Kind": 3 - }, - { - "EndIndex": 40335, - "Kind": 3 - }, - { - "EndIndex": 40370, - "Kind": 3 - }, - { - "EndIndex": 40494, - "Kind": 3 - }, - { - "EndIndex": 40526, - "Kind": 3 - }, - { - "EndIndex": 40532, - "Kind": 3 - }, - { - "EndIndex": 40573, - "Kind": 3 - }, - { - "EndIndex": 40723, - "Kind": 3 - }, - { - "EndIndex": 40747, - "Kind": 3 - }, - { - "EndIndex": 40753, - "Kind": 3 - }, - { - "EndIndex": 40779, - "Kind": 3 - }, - { - "EndIndex": 41079, - "Kind": 3 - }, - { - "EndIndex": 41100, - "Kind": 3 - }, - { - "EndIndex": 41106, - "Kind": 3 - }, - { - "EndIndex": 41129, - "Kind": 3 - }, - { - "EndIndex": 41195, - "Kind": 3 - }, - { - "EndIndex": 41228, - "Kind": 3 - }, - { - "EndIndex": 41234, - "Kind": 3 - }, - { - "EndIndex": 41236, - "Kind": 3 - }, - { - "EndIndex": 41253, - "Kind": 3 - }, - { - "EndIndex": 41273, - "Kind": 3 - }, - { - "EndIndex": 41396, - "Kind": 3 - }, - { - "EndIndex": 41427, - "Kind": 3 - }, - { - "EndIndex": 41457, - "Kind": 3 - }, - { - "EndIndex": 41479, - "Kind": 3 - }, - { - "EndIndex": 41485, - "Kind": 3 - }, - { - "EndIndex": 41506, - "Kind": 3 - }, - { - "EndIndex": 41542, - "Kind": 3 - }, - { - "EndIndex": 41584, - "Kind": 3 - }, - { - "EndIndex": 41606, - "Kind": 3 - }, - { - "EndIndex": 41612, - "Kind": 3 - }, - { - "EndIndex": 41642, - "Kind": 3 - }, - { - "EndIndex": 41673, - "Kind": 3 - }, - { - "EndIndex": 41695, - "Kind": 3 - }, - { - "EndIndex": 41701, - "Kind": 3 - }, - { - "EndIndex": 41731, - "Kind": 3 - }, - { - "EndIndex": 41762, - "Kind": 3 - }, - { - "EndIndex": 41784, - "Kind": 3 - }, - { - "EndIndex": 41790, - "Kind": 3 - }, - { - "EndIndex": 41829, - "Kind": 3 - }, - { - "EndIndex": 41868, - "Kind": 3 - }, - { - "EndIndex": 41882, - "Kind": 3 - }, - { - "EndIndex": 41888, - "Kind": 3 - }, - { - "EndIndex": 41918, - "Kind": 3 - }, - { - "EndIndex": 41948, - "Kind": 3 - }, - { - "EndIndex": 41970, - "Kind": 3 - }, - { - "EndIndex": 41976, - "Kind": 3 - }, - { - "EndIndex": 41997, - "Kind": 3 - }, - { - "EndIndex": 42029, - "Kind": 3 - }, - { - "EndIndex": 42060, - "Kind": 3 - }, - { - "EndIndex": 42081, - "Kind": 3 - }, - { - "EndIndex": 42087, - "Kind": 3 - }, - { - "EndIndex": 42122, - "Kind": 3 - }, - { - "EndIndex": 42249, - "Kind": 3 - }, - { - "EndIndex": 42263, - "Kind": 3 - }, - { - "EndIndex": 42269, - "Kind": 3 - }, - { - "EndIndex": 42287, - "Kind": 3 - }, - { - "EndIndex": 42320, - "Kind": 3 - }, - { - "EndIndex": 42471, - "Kind": 3 - }, - { - "EndIndex": 42492, - "Kind": 3 - }, - { - "EndIndex": 42498, - "Kind": 3 - }, - { - "EndIndex": 42529, - "Kind": 3 - }, - { - "EndIndex": 42560, - "Kind": 3 - }, - { - "EndIndex": 42581, - "Kind": 3 - }, - { - "EndIndex": 42587, - "Kind": 3 - }, - { - "EndIndex": 42619, - "Kind": 3 - }, - { - "EndIndex": 42650, - "Kind": 3 - }, - { - "EndIndex": 42671, - "Kind": 3 - }, - { - "EndIndex": 42677, - "Kind": 3 - }, - { - "EndIndex": 42702, - "Kind": 3 - }, - { - "EndIndex": 42735, - "Kind": 3 - }, - { - "EndIndex": 42769, - "Kind": 3 - }, - { - "EndIndex": 42775, - "Kind": 3 - }, - { - "EndIndex": 42807, - "Kind": 3 - }, - { - "EndIndex": 42838, - "Kind": 3 - }, - { - "EndIndex": 42859, - "Kind": 3 - }, - { - "EndIndex": 42865, - "Kind": 3 - }, - { - "EndIndex": 42895, - "Kind": 3 - }, - { - "EndIndex": 42926, - "Kind": 3 - }, - { - "EndIndex": 42948, - "Kind": 3 - }, - { - "EndIndex": 42954, - "Kind": 3 - }, - { - "EndIndex": 42978, - "Kind": 3 - }, - { - "EndIndex": 43007, - "Kind": 3 - }, - { - "EndIndex": 43025, - "Kind": 3 - }, - { - "EndIndex": 43031, - "Kind": 3 - }, - { - "EndIndex": 43061, - "Kind": 3 - }, - { - "EndIndex": 43091, - "Kind": 3 - }, - { - "EndIndex": 43113, - "Kind": 3 - }, - { - "EndIndex": 43119, - "Kind": 3 - }, - { - "EndIndex": 43149, - "Kind": 3 - }, - { - "EndIndex": 43180, - "Kind": 3 - }, - { - "EndIndex": 43202, - "Kind": 3 - }, - { - "EndIndex": 43208, - "Kind": 3 - }, - { - "EndIndex": 43238, - "Kind": 3 - }, - { - "EndIndex": 43268, - "Kind": 3 - }, - { - "EndIndex": 43290, - "Kind": 3 - }, - { - "EndIndex": 43296, - "Kind": 3 - }, - { - "EndIndex": 43328, - "Kind": 3 - }, - { - "EndIndex": 43358, - "Kind": 3 - }, - { - "EndIndex": 43380, - "Kind": 3 - }, - { - "EndIndex": 43386, - "Kind": 3 - }, - { - "EndIndex": 43413, - "Kind": 3 - }, - { - "EndIndex": 43463, - "Kind": 3 - }, - { - "EndIndex": 43493, - "Kind": 3 - }, - { - "EndIndex": 43499, - "Kind": 3 - }, - { - "EndIndex": 43524, - "Kind": 3 - }, - { - "EndIndex": 43554, - "Kind": 3 - }, - { - "EndIndex": 43573, - "Kind": 3 - }, - { - "EndIndex": 43579, - "Kind": 3 - }, - { - "EndIndex": 43610, - "Kind": 3 - }, - { - "EndIndex": 43640, - "Kind": 3 - }, - { - "EndIndex": 43662, - "Kind": 3 - }, - { - "EndIndex": 43668, - "Kind": 3 - }, - { - "EndIndex": 43700, - "Kind": 3 - }, - { - "EndIndex": 43730, - "Kind": 3 - }, - { - "EndIndex": 43752, - "Kind": 3 - }, - { - "EndIndex": 43758, - "Kind": 3 - }, - { - "EndIndex": 43790, - "Kind": 3 - }, - { - "EndIndex": 43820, - "Kind": 3 - }, - { - "EndIndex": 43842, - "Kind": 3 - }, - { - "EndIndex": 43848, - "Kind": 3 - }, - { - "EndIndex": 43875, - "Kind": 3 - }, - { - "EndIndex": 43934, - "Kind": 3 - }, - { - "EndIndex": 43952, - "Kind": 3 - }, - { - "EndIndex": 43958, - "Kind": 3 - }, - { - "EndIndex": 43989, - "Kind": 3 - }, - { - "EndIndex": 44019, - "Kind": 3 - }, - { - "EndIndex": 44041, - "Kind": 3 - }, - { - "EndIndex": 44047, - "Kind": 3 - }, - { - "EndIndex": 44065, - "Kind": 3 - }, - { - "EndIndex": 44107, - "Kind": 3 - }, - { - "EndIndex": 44433, - "Kind": 3 - }, - { - "EndIndex": 44455, - "Kind": 3 - }, - { - "EndIndex": 44461, - "Kind": 3 - }, - { - "EndIndex": 44492, - "Kind": 3 - }, - { - "EndIndex": 44522, - "Kind": 3 - }, - { - "EndIndex": 44544, - "Kind": 3 - }, - { - "EndIndex": 44550, - "Kind": 3 - }, - { - "EndIndex": 44577, - "Kind": 3 - }, - { - "EndIndex": 44670, - "Kind": 3 - }, - { - "EndIndex": 44691, - "Kind": 3 - }, - { - "EndIndex": 44697, - "Kind": 3 - }, - { - "EndIndex": 44719, - "Kind": 3 - }, - { - "EndIndex": 44765, - "Kind": 3 - }, - { - "EndIndex": 44786, - "Kind": 3 - }, - { - "EndIndex": 44792, - "Kind": 3 - }, - { - "EndIndex": 44813, - "Kind": 3 - }, - { - "EndIndex": 44856, - "Kind": 3 - }, - { - "EndIndex": 44878, - "Kind": 3 - }, - { - "EndIndex": 44884, - "Kind": 3 - }, - { - "EndIndex": 44918, - "Kind": 3 - }, - { - "EndIndex": 45049, - "Kind": 3 - }, - { - "EndIndex": 45071, - "Kind": 3 - }, - { - "EndIndex": 45077, - "Kind": 3 - }, - { - "EndIndex": 45120, - "Kind": 3 - }, - { - "EndIndex": 45181, - "Kind": 3 - }, - { - "EndIndex": 45202, - "Kind": 3 - }, - { - "EndIndex": 45208, - "Kind": 3 - }, - { - "EndIndex": 45238, - "Kind": 3 - }, - { - "EndIndex": 45344, - "Kind": 3 - }, - { - "EndIndex": 45365, - "Kind": 3 - }, - { - "EndIndex": 45371, - "Kind": 3 - }, - { - "EndIndex": 45407, - "Kind": 3 - }, - { - "EndIndex": 45514, - "Kind": 3 - }, - { - "EndIndex": 45536, - "Kind": 3 - }, - { - "EndIndex": 45542, - "Kind": 3 - }, - { - "EndIndex": 45587, - "Kind": 3 - }, - { - "EndIndex": 45656, - "Kind": 3 - }, - { - "EndIndex": 45677, - "Kind": 3 - }, - { - "EndIndex": 45683, - "Kind": 3 - }, - { - "EndIndex": 45717, - "Kind": 3 - }, - { - "EndIndex": 45778, - "Kind": 3 - }, - { - "EndIndex": 45800, - "Kind": 3 - }, - { - "EndIndex": 45806, - "Kind": 3 - }, - { - "EndIndex": 45838, - "Kind": 3 - }, - { - "EndIndex": 45895, - "Kind": 3 - }, - { - "EndIndex": 45917, - "Kind": 3 - }, - { - "EndIndex": 45923, - "Kind": 3 - }, - { - "EndIndex": 45957, - "Kind": 3 - }, - { - "EndIndex": 46014, - "Kind": 3 - }, - { - "EndIndex": 46036, - "Kind": 3 - }, - { - "EndIndex": 46042, - "Kind": 3 - }, - { - "EndIndex": 46062, - "Kind": 3 - }, - { - "EndIndex": 46155, - "Kind": 3 - }, - { - "EndIndex": 46169, - "Kind": 3 - }, - { - "EndIndex": 46175, - "Kind": 3 - }, - { - "EndIndex": 46204, - "Kind": 3 - }, - { - "EndIndex": 46319, - "Kind": 3 - }, - { - "EndIndex": 46340, - "Kind": 3 - }, - { - "EndIndex": 46346, - "Kind": 3 - }, - { - "EndIndex": 46390, - "Kind": 3 - }, - { - "EndIndex": 46519, - "Kind": 3 - }, - { - "EndIndex": 46541, - "Kind": 3 - }, - { - "EndIndex": 46547, - "Kind": 3 - }, - { - "EndIndex": 46600, - "Kind": 3 - }, - { - "EndIndex": 46677, - "Kind": 3 - }, - { - "EndIndex": 46698, - "Kind": 3 - }, - { - "EndIndex": 46704, - "Kind": 3 - }, - { - "EndIndex": 46735, - "Kind": 3 - }, - { - "EndIndex": 46832, - "Kind": 3 - }, - { - "EndIndex": 46854, - "Kind": 3 - }, - { - "EndIndex": 46860, - "Kind": 3 - }, - { - "EndIndex": 46892, - "Kind": 3 - }, - { - "EndIndex": 46953, - "Kind": 3 - }, - { - "EndIndex": 46974, - "Kind": 3 - }, - { - "EndIndex": 46980, - "Kind": 3 - }, - { - "EndIndex": 46982, - "Kind": 3 - }, - { - "EndIndex": 46997, - "Kind": 3 - }, - { - "EndIndex": 47023, - "Kind": 3 - }, - { - "EndIndex": 47172, - "Kind": 3 - }, - { - "EndIndex": 47203, - "Kind": 3 - }, - { - "EndIndex": 47233, - "Kind": 3 - }, - { - "EndIndex": 47261, - "Kind": 3 - }, - { - "EndIndex": 47267, - "Kind": 3 - }, - { - "EndIndex": 47294, - "Kind": 3 - }, - { - "EndIndex": 47330, - "Kind": 3 - }, - { - "EndIndex": 47372, - "Kind": 3 - }, - { - "EndIndex": 47394, - "Kind": 3 - }, - { - "EndIndex": 47400, - "Kind": 3 - }, - { - "EndIndex": 47430, - "Kind": 3 - }, - { - "EndIndex": 47461, - "Kind": 3 - }, - { - "EndIndex": 47483, - "Kind": 3 - }, - { - "EndIndex": 47489, - "Kind": 3 - }, - { - "EndIndex": 47519, - "Kind": 3 - }, - { - "EndIndex": 47550, - "Kind": 3 - }, - { - "EndIndex": 47572, - "Kind": 3 - }, - { - "EndIndex": 47578, - "Kind": 3 - }, - { - "EndIndex": 47617, - "Kind": 3 - }, - { - "EndIndex": 47656, - "Kind": 3 - }, - { - "EndIndex": 47670, - "Kind": 3 - }, - { - "EndIndex": 47676, - "Kind": 3 - }, - { - "EndIndex": 47706, - "Kind": 3 - }, - { - "EndIndex": 47736, - "Kind": 3 - }, - { - "EndIndex": 47758, - "Kind": 3 - }, - { - "EndIndex": 47764, - "Kind": 3 - }, - { - "EndIndex": 47789, - "Kind": 3 - }, - { - "EndIndex": 47819, - "Kind": 3 - }, - { - "EndIndex": 47837, - "Kind": 3 - }, - { - "EndIndex": 47843, - "Kind": 3 - }, - { - "EndIndex": 47878, - "Kind": 3 - }, - { - "EndIndex": 48031, - "Kind": 3 - }, - { - "EndIndex": 48045, - "Kind": 3 - }, - { - "EndIndex": 48051, - "Kind": 3 - }, - { - "EndIndex": 48069, - "Kind": 3 - }, - { - "EndIndex": 48102, - "Kind": 3 - }, - { - "EndIndex": 48253, - "Kind": 3 - }, - { - "EndIndex": 48274, - "Kind": 3 - }, - { - "EndIndex": 48280, - "Kind": 3 - }, - { - "EndIndex": 48305, - "Kind": 3 - }, - { - "EndIndex": 48338, - "Kind": 3 - }, - { - "EndIndex": 48372, - "Kind": 3 - }, - { - "EndIndex": 48378, - "Kind": 3 - }, - { - "EndIndex": 48408, - "Kind": 3 - }, - { - "EndIndex": 48439, - "Kind": 3 - }, - { - "EndIndex": 48461, - "Kind": 3 - }, - { - "EndIndex": 48467, - "Kind": 3 - }, - { - "EndIndex": 48491, - "Kind": 3 - }, - { - "EndIndex": 48520, - "Kind": 3 - }, - { - "EndIndex": 48538, - "Kind": 3 - }, - { - "EndIndex": 48544, - "Kind": 3 - }, - { - "EndIndex": 48574, - "Kind": 3 - }, - { - "EndIndex": 48604, - "Kind": 3 - }, - { - "EndIndex": 48626, - "Kind": 3 - }, - { - "EndIndex": 48632, - "Kind": 3 - }, - { - "EndIndex": 48662, - "Kind": 3 - }, - { - "EndIndex": 48693, - "Kind": 3 - }, - { - "EndIndex": 48715, - "Kind": 3 - }, - { - "EndIndex": 48721, - "Kind": 3 - }, - { - "EndIndex": 48751, - "Kind": 3 - }, - { - "EndIndex": 48781, - "Kind": 3 - }, - { - "EndIndex": 48809, - "Kind": 3 - }, - { - "EndIndex": 48815, - "Kind": 3 - }, - { - "EndIndex": 48847, - "Kind": 3 - }, - { - "EndIndex": 48877, - "Kind": 3 - }, - { - "EndIndex": 48905, - "Kind": 3 - }, - { - "EndIndex": 48911, - "Kind": 3 - }, - { - "EndIndex": 48938, - "Kind": 3 - }, - { - "EndIndex": 48988, - "Kind": 3 - }, - { - "EndIndex": 49018, - "Kind": 3 - }, - { - "EndIndex": 49024, - "Kind": 3 - }, - { - "EndIndex": 49049, - "Kind": 3 - }, - { - "EndIndex": 49079, - "Kind": 3 - }, - { - "EndIndex": 49098, - "Kind": 3 - }, - { - "EndIndex": 49104, - "Kind": 3 - }, - { - "EndIndex": 49135, - "Kind": 3 - }, - { - "EndIndex": 49165, - "Kind": 3 - }, - { - "EndIndex": 49193, - "Kind": 3 - }, - { - "EndIndex": 49199, - "Kind": 3 - }, - { - "EndIndex": 49231, - "Kind": 3 - }, - { - "EndIndex": 49261, - "Kind": 3 - }, - { - "EndIndex": 49289, - "Kind": 3 - }, - { - "EndIndex": 49295, - "Kind": 3 - }, - { - "EndIndex": 49327, - "Kind": 3 - }, - { - "EndIndex": 49357, - "Kind": 3 - }, - { - "EndIndex": 49385, - "Kind": 3 - }, - { - "EndIndex": 49391, - "Kind": 3 - }, - { - "EndIndex": 49418, - "Kind": 3 - }, - { - "EndIndex": 49477, - "Kind": 3 - }, - { - "EndIndex": 49495, - "Kind": 3 - }, - { - "EndIndex": 49501, - "Kind": 3 - }, - { - "EndIndex": 49532, - "Kind": 3 - }, - { - "EndIndex": 49562, - "Kind": 3 - }, - { - "EndIndex": 49590, - "Kind": 3 - }, - { - "EndIndex": 49596, - "Kind": 3 - }, - { - "EndIndex": 49614, - "Kind": 3 - }, - { - "EndIndex": 49656, - "Kind": 3 - }, - { - "EndIndex": 49982, - "Kind": 3 - }, - { - "EndIndex": 50004, - "Kind": 3 - }, - { - "EndIndex": 50010, - "Kind": 3 - }, - { - "EndIndex": 50041, - "Kind": 3 - }, - { - "EndIndex": 50071, - "Kind": 3 - }, - { - "EndIndex": 50099, - "Kind": 3 - }, - { - "EndIndex": 50105, - "Kind": 3 - }, - { - "EndIndex": 50126, - "Kind": 3 - }, - { - "EndIndex": 50169, - "Kind": 3 - }, - { - "EndIndex": 50197, - "Kind": 3 - }, - { - "EndIndex": 50203, - "Kind": 3 - }, - { - "EndIndex": 50237, - "Kind": 3 - }, - { - "EndIndex": 50368, - "Kind": 3 - }, - { - "EndIndex": 50396, - "Kind": 3 - }, - { - "EndIndex": 50402, - "Kind": 3 - }, - { - "EndIndex": 50438, - "Kind": 3 - }, - { - "EndIndex": 50545, - "Kind": 3 - }, - { - "EndIndex": 50573, - "Kind": 3 - }, - { - "EndIndex": 50579, - "Kind": 3 - }, - { - "EndIndex": 50613, - "Kind": 3 - }, - { - "EndIndex": 50674, - "Kind": 3 - }, - { - "EndIndex": 50696, - "Kind": 3 - }, - { - "EndIndex": 50702, - "Kind": 3 - }, - { - "EndIndex": 50734, - "Kind": 3 - }, - { - "EndIndex": 50791, - "Kind": 3 - }, - { - "EndIndex": 50813, - "Kind": 3 - }, - { - "EndIndex": 50819, - "Kind": 3 - }, - { - "EndIndex": 50853, - "Kind": 3 - }, - { - "EndIndex": 50910, - "Kind": 3 - }, - { - "EndIndex": 50932, - "Kind": 3 - }, - { - "EndIndex": 50938, - "Kind": 3 - }, - { - "EndIndex": 50982, - "Kind": 3 - }, - { - "EndIndex": 51111, - "Kind": 3 - }, - { - "EndIndex": 51139, - "Kind": 3 - }, - { - "EndIndex": 51145, - "Kind": 3 - }, - { - "EndIndex": 51176, - "Kind": 3 - }, - { - "EndIndex": 51273, - "Kind": 3 - }, - { - "EndIndex": 51301, - "Kind": 3 - }, - { - "EndIndex": 51307, - "Kind": 3 - }, - { - "EndIndex": 51309, - "Kind": 3 - }, - { - "EndIndex": 51336, - "Kind": 3 - }, - { - "EndIndex": 51358, - "Kind": 3 - }, - { - "EndIndex": 51834, - "Kind": 3 - }, - { - "EndIndex": 51865, - "Kind": 3 - }, - { - "EndIndex": 51895, - "Kind": 3 - }, - { - "EndIndex": 51919, - "Kind": 3 - }, - { - "EndIndex": 51925, - "Kind": 3 - }, - { - "EndIndex": 51948, - "Kind": 3 - }, - { - "EndIndex": 51982, - "Kind": 3 - }, - { - "EndIndex": 52013, - "Kind": 3 - }, - { - "EndIndex": 52035, - "Kind": 3 - }, - { - "EndIndex": 52041, - "Kind": 3 - }, - { - "EndIndex": 52071, - "Kind": 3 - }, - { - "EndIndex": 52102, - "Kind": 3 - }, - { - "EndIndex": 52124, - "Kind": 3 - }, - { - "EndIndex": 52130, - "Kind": 3 - }, - { - "EndIndex": 52160, - "Kind": 3 - }, - { - "EndIndex": 52191, - "Kind": 3 - }, - { - "EndIndex": 52213, - "Kind": 3 - }, - { - "EndIndex": 52219, - "Kind": 3 - }, - { - "EndIndex": 52258, - "Kind": 3 - }, - { - "EndIndex": 52297, - "Kind": 3 - }, - { - "EndIndex": 52311, - "Kind": 3 - }, - { - "EndIndex": 52317, - "Kind": 3 - }, - { - "EndIndex": 52350, - "Kind": 3 - }, - { - "EndIndex": 52379, - "Kind": 3 - }, - { - "EndIndex": 52403, - "Kind": 3 - }, - { - "EndIndex": 52409, - "Kind": 3 - }, - { - "EndIndex": 52440, - "Kind": 3 - }, - { - "EndIndex": 52459, - "Kind": 3 - }, - { - "EndIndex": 52465, - "Kind": 3 - }, - { - "EndIndex": 52495, - "Kind": 3 - }, - { - "EndIndex": 52525, - "Kind": 3 - }, - { - "EndIndex": 52547, - "Kind": 3 - }, - { - "EndIndex": 52553, - "Kind": 3 - }, - { - "EndIndex": 52578, - "Kind": 3 - }, - { - "EndIndex": 52608, - "Kind": 3 - }, - { - "EndIndex": 52626, - "Kind": 3 - }, - { - "EndIndex": 52632, - "Kind": 3 - }, - { - "EndIndex": 52688, - "Kind": 3 - }, - { - "EndIndex": 53168, - "Kind": 3 - }, - { - "EndIndex": 53182, - "Kind": 3 - }, - { - "EndIndex": 53188, - "Kind": 3 - }, - { - "EndIndex": 53206, - "Kind": 3 - }, - { - "EndIndex": 53239, - "Kind": 3 - }, - { - "EndIndex": 53390, - "Kind": 3 - }, - { - "EndIndex": 53411, - "Kind": 3 - }, - { - "EndIndex": 53417, - "Kind": 3 - }, - { - "EndIndex": 53442, - "Kind": 3 - }, - { - "EndIndex": 53475, - "Kind": 3 - }, - { - "EndIndex": 53511, - "Kind": 3 - }, - { - "EndIndex": 53517, - "Kind": 3 - }, - { - "EndIndex": 53547, - "Kind": 3 - }, - { - "EndIndex": 53578, - "Kind": 3 - }, - { - "EndIndex": 53600, - "Kind": 3 - }, - { - "EndIndex": 53606, - "Kind": 3 - }, - { - "EndIndex": 53630, - "Kind": 3 - }, - { - "EndIndex": 53659, - "Kind": 3 - }, - { - "EndIndex": 53677, - "Kind": 3 - }, - { - "EndIndex": 53683, - "Kind": 3 - }, - { - "EndIndex": 53713, - "Kind": 3 - }, - { - "EndIndex": 53743, - "Kind": 3 - }, - { - "EndIndex": 53765, - "Kind": 3 - }, - { - "EndIndex": 53771, - "Kind": 3 - }, - { - "EndIndex": 53802, - "Kind": 3 - }, - { - "EndIndex": 53832, - "Kind": 3 - }, - { - "EndIndex": 53856, - "Kind": 3 - }, - { - "EndIndex": 53862, - "Kind": 3 - }, - { - "EndIndex": 53893, - "Kind": 3 - }, - { - "EndIndex": 53923, - "Kind": 3 - }, - { - "EndIndex": 53947, - "Kind": 3 - }, - { - "EndIndex": 53953, - "Kind": 3 - }, - { - "EndIndex": 53983, - "Kind": 3 - }, - { - "EndIndex": 54014, - "Kind": 3 - }, - { - "EndIndex": 54036, - "Kind": 3 - }, - { - "EndIndex": 54042, - "Kind": 3 - }, - { - "EndIndex": 54067, - "Kind": 3 - }, - { - "EndIndex": 54097, - "Kind": 3 - }, - { - "EndIndex": 54116, - "Kind": 3 - }, - { - "EndIndex": 54122, - "Kind": 3 - }, - { - "EndIndex": 54154, - "Kind": 3 - }, - { - "EndIndex": 54184, - "Kind": 3 - }, - { - "EndIndex": 54208, - "Kind": 3 - }, - { - "EndIndex": 54214, - "Kind": 3 - }, - { - "EndIndex": 54246, - "Kind": 3 - }, - { - "EndIndex": 54276, - "Kind": 3 - }, - { - "EndIndex": 54300, - "Kind": 3 - }, - { - "EndIndex": 54306, - "Kind": 3 - }, - { - "EndIndex": 54330, - "Kind": 3 - }, - { - "EndIndex": 54359, - "Kind": 3 - }, - { - "EndIndex": 54378, - "Kind": 3 - }, - { - "EndIndex": 54384, - "Kind": 3 - }, - { - "EndIndex": 54402, - "Kind": 3 - }, - { - "EndIndex": 54444, - "Kind": 3 - }, - { - "EndIndex": 54770, - "Kind": 3 - }, - { - "EndIndex": 54792, - "Kind": 3 - }, - { - "EndIndex": 54798, - "Kind": 3 - }, - { - "EndIndex": 54825, - "Kind": 3 - }, - { - "EndIndex": 54963, - "Kind": 3 - }, - { - "EndIndex": 54987, - "Kind": 3 - }, - { - "EndIndex": 54993, - "Kind": 3 - }, - { - "EndIndex": 55038, - "Kind": 3 - }, - { - "EndIndex": 55215, - "Kind": 3 - }, - { - "EndIndex": 55239, - "Kind": 3 - }, - { - "EndIndex": 55245, - "Kind": 3 - }, - { - "EndIndex": 55289, - "Kind": 3 - }, - { - "EndIndex": 55503, - "Kind": 3 - }, - { - "EndIndex": 55521, - "Kind": 3 - }, - { - "EndIndex": 55527, - "Kind": 3 - }, - { - "EndIndex": 55568, - "Kind": 3 - }, - { - "EndIndex": 56037, - "Kind": 3 - }, - { - "EndIndex": 56056, - "Kind": 3 - }, - { - "EndIndex": 56062, - "Kind": 3 - }, - { - "EndIndex": 56112, - "Kind": 3 - }, - { - "EndIndex": 56392, - "Kind": 3 - }, - { - "EndIndex": 56414, - "Kind": 3 - }, - { - "EndIndex": 56420, - "Kind": 3 - }, - { - "EndIndex": 56458, - "Kind": 3 - }, - { - "EndIndex": 56645, - "Kind": 3 - }, - { - "EndIndex": 56669, - "Kind": 3 - }, - { - "EndIndex": 56675, - "Kind": 3 - }, - { - "EndIndex": 56718, - "Kind": 3 - }, - { - "EndIndex": 56974, - "Kind": 3 - }, - { - "EndIndex": 56992, - "Kind": 3 - }, - { - "EndIndex": 56998, - "Kind": 3 - }, - { - "EndIndex": 57016, - "Kind": 3 - }, - { - "EndIndex": 57053, - "Kind": 3 - }, - { - "EndIndex": 57232, - "Kind": 3 - }, - { - "EndIndex": 57252, - "Kind": 3 - }, - { - "EndIndex": 57258, - "Kind": 3 - }, - { - "EndIndex": 57278, - "Kind": 3 - }, - { - "EndIndex": 57418, - "Kind": 3 - }, - { - "EndIndex": 57437, - "Kind": 3 - }, - { - "EndIndex": 57443, - "Kind": 3 - }, - { - "EndIndex": 57487, - "Kind": 3 - }, - { - "EndIndex": 57774, - "Kind": 3 - }, - { - "EndIndex": 57792, - "Kind": 3 - }, - { - "EndIndex": 57798, - "Kind": 3 - }, - { - "EndIndex": 57822, - "Kind": 3 - }, - { - "EndIndex": 57968, - "Kind": 3 - }, - { - "EndIndex": 57990, - "Kind": 3 - }, - { - "EndIndex": 57996, - "Kind": 3 - }, - { - "EndIndex": 58020, - "Kind": 3 - }, - { - "EndIndex": 58164, - "Kind": 3 - }, - { - "EndIndex": 58186, - "Kind": 3 - }, - { - "EndIndex": 58192, - "Kind": 3 - }, - { - "EndIndex": 58216, - "Kind": 3 - }, - { - "EndIndex": 58328, - "Kind": 3 - }, - { - "EndIndex": 58349, - "Kind": 3 - }, - { - "EndIndex": 58355, - "Kind": 3 - }, - { - "EndIndex": 58379, - "Kind": 3 - }, - { - "EndIndex": 58519, - "Kind": 3 - }, - { - "EndIndex": 58541, - "Kind": 3 - }, - { - "EndIndex": 58547, - "Kind": 3 - }, - { - "EndIndex": 58571, - "Kind": 3 - }, - { - "EndIndex": 58726, - "Kind": 3 - }, - { - "EndIndex": 58748, - "Kind": 3 - }, - { - "EndIndex": 58754, - "Kind": 3 - }, - { - "EndIndex": 58778, - "Kind": 3 - }, - { - "EndIndex": 58922, - "Kind": 3 - }, - { - "EndIndex": 58944, - "Kind": 3 - }, - { - "EndIndex": 58950, - "Kind": 3 - }, - { - "EndIndex": 58974, - "Kind": 3 - }, - { - "EndIndex": 59220, - "Kind": 3 - }, - { - "EndIndex": 59242, - "Kind": 3 - }, - { - "EndIndex": 59248, - "Kind": 3 - }, - { - "EndIndex": 59272, - "Kind": 3 - }, - { - "EndIndex": 59427, - "Kind": 3 - }, - { - "EndIndex": 59449, - "Kind": 3 - }, - { - "EndIndex": 59455, - "Kind": 3 - }, - { - "EndIndex": 59495, - "Kind": 3 - }, - { - "EndIndex": 59727, - "Kind": 3 - }, - { - "EndIndex": 59747, - "Kind": 3 - }, - { - "EndIndex": 59753, - "Kind": 3 - }, - { - "EndIndex": 59797, - "Kind": 3 - }, - { - "EndIndex": 59978, - "Kind": 3 - }, - { - "EndIndex": 60002, - "Kind": 3 - }, - { - "EndIndex": 60008, - "Kind": 3 - }, - { - "EndIndex": 60030, - "Kind": 3 - }, - { - "EndIndex": 60136, - "Kind": 3 - }, - { - "EndIndex": 60160, - "Kind": 3 - }, - { - "EndIndex": 60166, - "Kind": 3 - }, - { - "EndIndex": 60196, - "Kind": 3 - }, - { - "EndIndex": 60326, - "Kind": 3 - }, - { - "EndIndex": 60350, - "Kind": 3 - }, - { - "EndIndex": 60356, - "Kind": 3 - }, - { - "EndIndex": 60374, - "Kind": 3 - }, - { - "EndIndex": 60408, - "Kind": 3 - }, - { - "EndIndex": 60667, - "Kind": 3 - }, - { - "EndIndex": 60687, - "Kind": 3 - }, - { - "EndIndex": 60693, - "Kind": 3 - }, - { - "EndIndex": 60724, - "Kind": 3 - }, - { - "EndIndex": 61108, - "Kind": 3 - }, - { - "EndIndex": 61152, - "Kind": 3 - }, - { - "EndIndex": 61158, - "Kind": 3 - }, - { - "EndIndex": 61199, - "Kind": 3 - }, - { - "EndIndex": 61488, - "Kind": 3 - }, - { - "EndIndex": 61512, - "Kind": 3 - }, - { - "EndIndex": 61518, - "Kind": 3 - }, - { - "EndIndex": 61562, - "Kind": 3 - }, - { - "EndIndex": 61820, - "Kind": 3 - }, - { - "EndIndex": 61838, - "Kind": 3 - }, - { - "EndIndex": 61844, - "Kind": 3 - }, - { - "EndIndex": 61889, - "Kind": 3 - }, - { - "EndIndex": 62177, - "Kind": 3 - }, - { - "EndIndex": 62195, - "Kind": 3 - }, - { - "EndIndex": 62201, - "Kind": 3 - }, - { - "EndIndex": 62245, - "Kind": 3 - }, - { - "EndIndex": 62426, - "Kind": 3 - }, - { - "EndIndex": 62450, - "Kind": 3 - }, - { - "EndIndex": 62456, - "Kind": 3 - }, - { - "EndIndex": 62488, - "Kind": 3 - }, - { - "EndIndex": 62893, - "Kind": 3 - }, - { - "EndIndex": 62937, - "Kind": 3 - }, - { - "EndIndex": 62943, - "Kind": 3 - }, - { - "EndIndex": 62981, - "Kind": 3 - }, - { - "EndIndex": 63434, - "Kind": 3 - }, - { - "EndIndex": 63460, - "Kind": 3 - }, - { - "EndIndex": 63466, - "Kind": 3 - }, - { - "EndIndex": 63496, - "Kind": 3 - }, - { - "EndIndex": 63627, - "Kind": 3 - }, - { - "EndIndex": 63651, - "Kind": 3 - }, - { - "EndIndex": 63657, - "Kind": 3 - }, - { - "EndIndex": 63694, - "Kind": 3 - }, - { - "EndIndex": 64067, - "Kind": 3 - }, - { - "EndIndex": 64093, - "Kind": 3 - }, - { - "EndIndex": 64099, - "Kind": 3 - }, - { - "EndIndex": 64136, - "Kind": 3 - }, - { - "EndIndex": 64307, - "Kind": 3 - }, - { - "EndIndex": 64332, - "Kind": 3 - }, - { - "EndIndex": 64338, - "Kind": 3 - }, - { - "EndIndex": 64390, - "Kind": 3 - }, - { - "EndIndex": 64674, - "Kind": 3 - }, - { - "EndIndex": 64696, - "Kind": 3 - }, - { - "EndIndex": 64702, - "Kind": 3 - }, - { - "EndIndex": 64731, - "Kind": 3 - }, - { - "EndIndex": 64886, - "Kind": 3 - }, - { - "EndIndex": 64910, - "Kind": 3 - }, - { - "EndIndex": 64916, - "Kind": 3 - }, - { - "EndIndex": 64941, - "Kind": 3 - }, - { - "EndIndex": 65078, - "Kind": 3 - }, - { - "EndIndex": 65102, - "Kind": 3 - }, - { - "EndIndex": 65108, - "Kind": 3 - }, - { - "EndIndex": 65130, - "Kind": 3 - }, - { - "EndIndex": 65299, - "Kind": 3 - }, - { - "EndIndex": 65323, - "Kind": 3 - }, - { - "EndIndex": 65329, - "Kind": 3 - }, - { - "EndIndex": 65370, - "Kind": 3 - }, - { - "EndIndex": 65680, - "Kind": 3 - }, - { - "EndIndex": 65704, - "Kind": 3 - }, - { - "EndIndex": 65710, - "Kind": 3 - }, - { - "EndIndex": 65732, - "Kind": 3 - }, - { - "EndIndex": 65838, - "Kind": 3 - }, - { - "EndIndex": 65862, - "Kind": 3 - }, - { - "EndIndex": 65868, - "Kind": 3 - }, - { - "EndIndex": 65897, - "Kind": 3 - }, - { - "EndIndex": 66050, - "Kind": 3 - }, - { - "EndIndex": 66074, - "Kind": 3 - }, - { - "EndIndex": 66080, - "Kind": 3 - }, - { - "EndIndex": 66082, - "Kind": 3 - }, - { - "EndIndex": 66101, - "Kind": 3 - }, - { - "EndIndex": 66132, - "Kind": 3 - }, - { - "EndIndex": 66164, - "Kind": 3 - }, - { - "EndIndex": 66203, - "Kind": 3 - }, - { - "EndIndex": 66242, - "Kind": 3 - }, - { - "EndIndex": 66256, - "Kind": 3 - }, - { - "EndIndex": 66262, - "Kind": 3 - }, - { - "EndIndex": 66304, - "Kind": 3 - }, - { - "EndIndex": 66318, - "Kind": 3 - }, - { - "EndIndex": 66324, - "Kind": 3 - }, - { - "EndIndex": 66342, - "Kind": 3 - }, - { - "EndIndex": 66375, - "Kind": 3 - }, - { - "EndIndex": 66526, - "Kind": 3 - }, - { - "EndIndex": 66547, - "Kind": 3 - }, - { - "EndIndex": 66553, - "Kind": 3 - }, - { - "EndIndex": 66578, - "Kind": 3 - }, - { - "EndIndex": 66611, - "Kind": 3 - }, - { - "EndIndex": 66644, - "Kind": 3 - }, - { - "EndIndex": 66650, - "Kind": 3 - }, - { - "EndIndex": 66682, - "Kind": 3 - }, - { - "EndIndex": 66748, - "Kind": 3 - }, - { - "EndIndex": 66766, - "Kind": 3 - }, - { - "EndIndex": 66772, - "Kind": 3 - }, - { - "EndIndex": 66797, - "Kind": 3 - }, - { - "EndIndex": 66830, - "Kind": 3 - }, - { - "EndIndex": 66848, - "Kind": 3 - }, - { - "EndIndex": 66854, - "Kind": 3 - }, - { - "EndIndex": 66881, - "Kind": 3 - }, - { - "EndIndex": 66931, - "Kind": 3 - }, - { - "EndIndex": 66961, - "Kind": 3 - }, - { - "EndIndex": 66967, - "Kind": 3 - }, - { - "EndIndex": 67003, - "Kind": 3 - }, - { - "EndIndex": 67052, - "Kind": 3 - }, - { - "EndIndex": 67073, - "Kind": 3 - }, - { - "EndIndex": 67079, - "Kind": 3 - }, - { - "EndIndex": 67097, - "Kind": 3 - }, - { - "EndIndex": 67139, - "Kind": 3 - }, - { - "EndIndex": 67465, - "Kind": 3 - }, - { - "EndIndex": 67487, - "Kind": 3 - }, - { - "EndIndex": 67493, - "Kind": 3 - }, - { - "EndIndex": 67495, - "Kind": 3 - }, - { - "EndIndex": 67531, - "Kind": 3 - }, - { - "EndIndex": 67551, - "Kind": 3 - }, - { - "EndIndex": 67989, - "Kind": 3 - }, - { - "EndIndex": 68020, - "Kind": 3 - }, - { - "EndIndex": 68050, - "Kind": 3 - }, - { - "EndIndex": 68072, - "Kind": 3 - }, - { - "EndIndex": 68078, - "Kind": 3 - }, - { - "EndIndex": 68099, - "Kind": 3 - }, - { - "EndIndex": 68133, - "Kind": 3 - }, - { - "EndIndex": 68164, - "Kind": 3 - }, - { - "EndIndex": 68186, - "Kind": 3 - }, - { - "EndIndex": 68192, - "Kind": 3 - }, - { - "EndIndex": 68222, - "Kind": 3 - }, - { - "EndIndex": 68253, - "Kind": 3 - }, - { - "EndIndex": 68275, - "Kind": 3 - }, - { - "EndIndex": 68281, - "Kind": 3 - }, - { - "EndIndex": 68321, - "Kind": 3 - }, - { - "EndIndex": 68402, - "Kind": 3 - }, - { - "EndIndex": 68421, - "Kind": 3 - }, - { - "EndIndex": 68427, - "Kind": 3 - }, - { - "EndIndex": 68457, - "Kind": 3 - }, - { - "EndIndex": 68488, - "Kind": 3 - }, - { - "EndIndex": 68510, - "Kind": 3 - }, - { - "EndIndex": 68516, - "Kind": 3 - }, - { - "EndIndex": 68555, - "Kind": 3 - }, - { - "EndIndex": 68594, - "Kind": 3 - }, - { - "EndIndex": 68608, - "Kind": 3 - }, - { - "EndIndex": 68614, - "Kind": 3 - }, - { - "EndIndex": 68647, - "Kind": 3 - }, - { - "EndIndex": 68676, - "Kind": 3 - }, - { - "EndIndex": 68698, - "Kind": 3 - }, - { - "EndIndex": 68704, - "Kind": 3 - }, - { - "EndIndex": 68735, - "Kind": 3 - }, - { - "EndIndex": 68754, - "Kind": 3 - }, - { - "EndIndex": 68760, - "Kind": 3 - }, - { - "EndIndex": 68790, - "Kind": 3 - }, - { - "EndIndex": 68820, - "Kind": 3 - }, - { - "EndIndex": 68842, - "Kind": 3 - }, - { - "EndIndex": 68848, - "Kind": 3 - }, - { - "EndIndex": 68873, - "Kind": 3 - }, - { - "EndIndex": 68903, - "Kind": 3 - }, - { - "EndIndex": 68921, - "Kind": 3 - }, - { - "EndIndex": 68927, - "Kind": 3 - }, - { - "EndIndex": 68997, - "Kind": 3 - }, - { - "EndIndex": 69439, - "Kind": 3 - }, - { - "EndIndex": 69453, - "Kind": 3 - }, - { - "EndIndex": 69459, - "Kind": 3 - }, - { - "EndIndex": 69477, - "Kind": 3 - }, - { - "EndIndex": 69510, - "Kind": 3 - }, - { - "EndIndex": 69661, - "Kind": 3 - }, - { - "EndIndex": 69682, - "Kind": 3 - }, - { - "EndIndex": 69688, - "Kind": 3 - }, - { - "EndIndex": 69713, - "Kind": 3 - }, - { - "EndIndex": 69746, - "Kind": 3 - }, - { - "EndIndex": 69784, - "Kind": 3 - }, - { - "EndIndex": 69790, - "Kind": 3 - }, - { - "EndIndex": 69820, - "Kind": 3 - }, - { - "EndIndex": 69851, - "Kind": 3 - }, - { - "EndIndex": 69873, - "Kind": 3 - }, - { - "EndIndex": 69879, - "Kind": 3 - }, - { - "EndIndex": 69903, - "Kind": 3 - }, - { - "EndIndex": 69932, - "Kind": 3 - }, - { - "EndIndex": 69950, - "Kind": 3 - }, - { - "EndIndex": 69956, - "Kind": 3 - }, - { - "EndIndex": 69986, - "Kind": 3 - }, - { - "EndIndex": 70016, - "Kind": 3 - }, - { - "EndIndex": 70038, - "Kind": 3 - }, - { - "EndIndex": 70044, - "Kind": 3 - }, - { - "EndIndex": 70075, - "Kind": 3 - }, - { - "EndIndex": 70105, - "Kind": 3 - }, - { - "EndIndex": 70127, - "Kind": 3 - }, - { - "EndIndex": 70133, - "Kind": 3 - }, - { - "EndIndex": 70164, - "Kind": 3 - }, - { - "EndIndex": 70194, - "Kind": 3 - }, - { - "EndIndex": 70216, - "Kind": 3 - }, - { - "EndIndex": 70222, - "Kind": 3 - }, - { - "EndIndex": 70252, - "Kind": 3 - }, - { - "EndIndex": 70283, - "Kind": 3 - }, - { - "EndIndex": 70305, - "Kind": 3 - }, - { - "EndIndex": 70311, - "Kind": 3 - }, - { - "EndIndex": 70336, - "Kind": 3 - }, - { - "EndIndex": 70366, - "Kind": 3 - }, - { - "EndIndex": 70385, - "Kind": 3 - }, - { - "EndIndex": 70391, - "Kind": 3 - }, - { - "EndIndex": 70423, - "Kind": 3 - }, - { - "EndIndex": 70453, - "Kind": 3 - }, - { - "EndIndex": 70475, - "Kind": 3 - }, - { - "EndIndex": 70481, - "Kind": 3 - }, - { - "EndIndex": 70513, - "Kind": 3 - }, - { - "EndIndex": 70543, - "Kind": 3 - }, - { - "EndIndex": 70565, - "Kind": 3 - }, - { - "EndIndex": 70571, - "Kind": 3 - }, - { - "EndIndex": 70598, - "Kind": 3 - }, - { - "EndIndex": 70660, - "Kind": 3 - }, - { - "EndIndex": 70678, - "Kind": 3 - }, - { - "EndIndex": 70684, - "Kind": 3 - }, - { - "EndIndex": 70708, - "Kind": 3 - }, - { - "EndIndex": 70737, - "Kind": 3 - }, - { - "EndIndex": 70756, - "Kind": 3 - }, - { - "EndIndex": 70762, - "Kind": 3 - }, - { - "EndIndex": 70780, - "Kind": 3 - }, - { - "EndIndex": 70822, - "Kind": 3 - }, - { - "EndIndex": 71148, - "Kind": 3 - }, - { - "EndIndex": 71170, - "Kind": 3 - }, - { - "EndIndex": 71176, - "Kind": 3 - }, - { - "EndIndex": 71203, - "Kind": 3 - }, - { - "EndIndex": 71347, - "Kind": 3 - }, - { - "EndIndex": 71369, - "Kind": 3 - }, - { - "EndIndex": 71375, - "Kind": 3 - }, - { - "EndIndex": 71400, - "Kind": 3 - }, - { - "EndIndex": 71477, - "Kind": 3 - }, - { - "EndIndex": 71499, - "Kind": 3 - }, - { - "EndIndex": 71505, - "Kind": 3 - }, - { - "EndIndex": 71545, - "Kind": 3 - }, - { - "EndIndex": 71674, - "Kind": 3 - }, - { - "EndIndex": 71696, - "Kind": 3 - }, - { - "EndIndex": 71702, - "Kind": 3 - }, - { - "EndIndex": 71746, - "Kind": 3 - }, - { - "EndIndex": 71960, - "Kind": 3 - }, - { - "EndIndex": 71978, - "Kind": 3 - }, - { - "EndIndex": 71984, - "Kind": 3 - }, - { - "EndIndex": 72025, - "Kind": 3 - }, - { - "EndIndex": 72500, - "Kind": 3 - }, - { - "EndIndex": 72520, - "Kind": 3 - }, - { - "EndIndex": 72526, - "Kind": 3 - }, - { - "EndIndex": 72576, - "Kind": 3 - }, - { - "EndIndex": 72858, - "Kind": 3 - }, - { - "EndIndex": 72880, - "Kind": 3 - }, - { - "EndIndex": 72886, - "Kind": 3 - }, - { - "EndIndex": 72922, - "Kind": 3 - }, - { - "EndIndex": 73066, - "Kind": 3 - }, - { - "EndIndex": 73088, - "Kind": 3 - }, - { - "EndIndex": 73094, - "Kind": 3 - }, - { - "EndIndex": 73137, - "Kind": 3 - }, - { - "EndIndex": 73392, - "Kind": 3 - }, - { - "EndIndex": 73410, - "Kind": 3 - }, - { - "EndIndex": 73416, - "Kind": 3 - }, - { - "EndIndex": 73456, - "Kind": 3 - }, - { - "EndIndex": 73637, - "Kind": 3 - }, - { - "EndIndex": 73659, - "Kind": 3 - }, - { - "EndIndex": 73665, - "Kind": 3 - }, - { - "EndIndex": 73701, - "Kind": 3 - }, - { - "EndIndex": 73870, - "Kind": 3 - }, - { - "EndIndex": 73892, - "Kind": 3 - }, - { - "EndIndex": 73898, - "Kind": 3 - }, - { - "EndIndex": 73942, - "Kind": 3 - }, - { - "EndIndex": 74228, - "Kind": 3 - }, - { - "EndIndex": 74246, - "Kind": 3 - }, - { - "EndIndex": 74252, - "Kind": 3 - }, - { - "EndIndex": 74276, - "Kind": 3 - }, - { - "EndIndex": 74489, - "Kind": 3 - }, - { - "EndIndex": 74511, - "Kind": 3 - }, - { - "EndIndex": 74517, - "Kind": 3 - }, - { - "EndIndex": 74541, - "Kind": 3 - }, - { - "EndIndex": 74745, - "Kind": 3 - }, - { - "EndIndex": 74767, - "Kind": 3 - }, - { - "EndIndex": 74773, - "Kind": 3 - }, - { - "EndIndex": 74797, - "Kind": 3 - }, - { - "EndIndex": 74973, - "Kind": 3 - }, - { - "EndIndex": 74987, - "Kind": 3 - }, - { - "EndIndex": 74993, - "Kind": 3 - }, - { - "EndIndex": 75019, - "Kind": 3 - }, - { - "EndIndex": 75222, - "Kind": 3 - }, - { - "EndIndex": 75244, - "Kind": 3 - }, - { - "EndIndex": 75250, - "Kind": 3 - }, - { - "EndIndex": 75274, - "Kind": 3 - }, - { - "EndIndex": 75472, - "Kind": 3 - }, - { - "EndIndex": 75494, - "Kind": 3 - }, - { - "EndIndex": 75500, - "Kind": 3 - }, - { - "EndIndex": 75529, - "Kind": 3 - }, - { - "EndIndex": 75701, - "Kind": 3 - }, - { - "EndIndex": 75723, - "Kind": 3 - }, - { - "EndIndex": 75729, - "Kind": 3 - }, - { - "EndIndex": 75753, - "Kind": 3 - }, - { - "EndIndex": 75965, - "Kind": 3 - }, - { - "EndIndex": 75987, - "Kind": 3 - }, - { - "EndIndex": 75993, - "Kind": 3 - }, - { - "EndIndex": 76019, - "Kind": 3 - }, - { - "EndIndex": 76213, - "Kind": 3 - }, - { - "EndIndex": 76235, - "Kind": 3 - }, - { - "EndIndex": 76241, - "Kind": 3 - }, - { - "EndIndex": 76269, - "Kind": 3 - }, - { - "EndIndex": 76442, - "Kind": 3 - }, - { - "EndIndex": 76464, - "Kind": 3 - }, - { - "EndIndex": 76470, - "Kind": 3 - }, - { - "EndIndex": 76494, - "Kind": 3 - }, - { - "EndIndex": 76697, - "Kind": 3 - }, - { - "EndIndex": 76719, - "Kind": 3 - }, - { - "EndIndex": 76725, - "Kind": 3 - }, - { - "EndIndex": 76749, - "Kind": 3 - }, - { - "EndIndex": 76967, - "Kind": 3 - }, - { - "EndIndex": 76989, - "Kind": 3 - }, - { - "EndIndex": 76995, - "Kind": 3 - }, - { - "EndIndex": 77019, - "Kind": 3 - }, - { - "EndIndex": 77232, - "Kind": 3 - }, - { - "EndIndex": 77254, - "Kind": 3 - }, - { - "EndIndex": 77260, - "Kind": 3 - }, - { - "EndIndex": 77291, - "Kind": 3 - }, - { - "EndIndex": 77512, - "Kind": 3 - }, - { - "EndIndex": 77531, - "Kind": 3 - }, - { - "EndIndex": 77537, - "Kind": 3 - }, - { - "EndIndex": 77576, - "Kind": 3 - }, - { - "EndIndex": 77711, - "Kind": 3 - }, - { - "EndIndex": 77733, - "Kind": 3 - }, - { - "EndIndex": 77739, - "Kind": 3 - }, - { - "EndIndex": 77761, - "Kind": 3 - }, - { - "EndIndex": 77824, - "Kind": 3 - }, - { - "EndIndex": 77846, - "Kind": 3 - }, - { - "EndIndex": 77852, - "Kind": 3 - }, - { - "EndIndex": 77882, - "Kind": 3 - }, - { - "EndIndex": 78025, - "Kind": 3 - }, - { - "EndIndex": 78047, - "Kind": 3 - }, - { - "EndIndex": 78053, - "Kind": 3 - }, - { - "EndIndex": 78071, - "Kind": 3 - }, - { - "EndIndex": 78105, - "Kind": 3 - }, - { - "EndIndex": 78658, - "Kind": 3 - }, - { - "EndIndex": 78677, - "Kind": 3 - }, - { - "EndIndex": 78683, - "Kind": 3 - }, - { - "EndIndex": 78714, - "Kind": 3 - }, - { - "EndIndex": 79085, - "Kind": 3 - }, - { - "EndIndex": 79123, - "Kind": 3 - }, - { - "EndIndex": 79129, - "Kind": 3 - }, - { - "EndIndex": 79170, - "Kind": 3 - }, - { - "EndIndex": 79459, - "Kind": 3 - }, - { - "EndIndex": 79481, - "Kind": 3 - }, - { - "EndIndex": 79487, - "Kind": 3 - }, - { - "EndIndex": 79531, - "Kind": 3 - }, - { - "EndIndex": 79788, - "Kind": 3 - }, - { - "EndIndex": 79806, - "Kind": 3 - }, - { - "EndIndex": 79812, - "Kind": 3 - }, - { - "EndIndex": 79857, - "Kind": 3 - }, - { - "EndIndex": 80144, - "Kind": 3 - }, - { - "EndIndex": 80162, - "Kind": 3 - }, - { - "EndIndex": 80168, - "Kind": 3 - }, - { - "EndIndex": 80207, - "Kind": 3 - }, - { - "EndIndex": 80343, - "Kind": 3 - }, - { - "EndIndex": 80365, - "Kind": 3 - }, - { - "EndIndex": 80371, - "Kind": 3 - }, - { - "EndIndex": 80403, - "Kind": 3 - }, - { - "EndIndex": 80794, - "Kind": 3 - }, - { - "EndIndex": 80832, - "Kind": 3 - }, - { - "EndIndex": 80838, - "Kind": 3 - }, - { - "EndIndex": 80876, - "Kind": 3 - }, - { - "EndIndex": 81320, - "Kind": 3 - }, - { - "EndIndex": 81344, - "Kind": 3 - }, - { - "EndIndex": 81350, - "Kind": 3 - }, - { - "EndIndex": 81380, - "Kind": 3 - }, - { - "EndIndex": 81524, - "Kind": 3 - }, - { - "EndIndex": 81546, - "Kind": 3 - }, - { - "EndIndex": 81552, - "Kind": 3 - }, - { - "EndIndex": 81589, - "Kind": 3 - }, - { - "EndIndex": 81954, - "Kind": 3 - }, - { - "EndIndex": 81978, - "Kind": 3 - }, - { - "EndIndex": 81984, - "Kind": 3 - }, - { - "EndIndex": 82021, - "Kind": 3 - }, - { - "EndIndex": 82193, - "Kind": 3 - }, - { - "EndIndex": 82218, - "Kind": 3 - }, - { - "EndIndex": 82224, - "Kind": 3 - }, - { - "EndIndex": 82276, - "Kind": 3 - }, - { - "EndIndex": 82562, - "Kind": 3 - }, - { - "EndIndex": 82584, - "Kind": 3 - }, - { - "EndIndex": 82590, - "Kind": 3 - }, - { - "EndIndex": 82619, - "Kind": 3 - }, - { - "EndIndex": 82774, - "Kind": 3 - }, - { - "EndIndex": 82796, - "Kind": 3 - }, - { - "EndIndex": 82802, - "Kind": 3 - }, - { - "EndIndex": 82827, - "Kind": 3 - }, - { - "EndIndex": 82919, - "Kind": 3 - }, - { - "EndIndex": 82941, - "Kind": 3 - }, - { - "EndIndex": 82947, - "Kind": 3 - }, - { - "EndIndex": 82969, - "Kind": 3 - }, - { - "EndIndex": 83156, - "Kind": 3 - }, - { - "EndIndex": 83178, - "Kind": 3 - }, - { - "EndIndex": 83184, - "Kind": 3 - }, - { - "EndIndex": 83217, - "Kind": 3 - }, - { - "EndIndex": 83633, - "Kind": 3 - }, - { - "EndIndex": 83655, - "Kind": 3 - }, - { - "EndIndex": 83661, - "Kind": 3 - }, - { - "EndIndex": 83683, - "Kind": 3 - }, - { - "EndIndex": 83746, - "Kind": 3 - }, - { - "EndIndex": 83768, - "Kind": 3 - }, - { - "EndIndex": 83774, - "Kind": 3 - }, - { - "EndIndex": 83803, - "Kind": 3 - }, - { - "EndIndex": 83929, - "Kind": 3 - }, - { - "EndIndex": 83951, - "Kind": 3 - }, - { - "EndIndex": 83957, - "Kind": 3 - }, - { - "EndIndex": 83959, - "Kind": 3 - }, - { - "EndIndex": 83978, - "Kind": 3 - }, - { - "EndIndex": 84007, - "Kind": 3 - }, - { - "EndIndex": 84037, - "Kind": 3 - }, - { - "EndIndex": 84076, - "Kind": 3 - }, - { - "EndIndex": 84115, - "Kind": 3 - }, - { - "EndIndex": 84129, - "Kind": 3 - }, - { - "EndIndex": 84135, - "Kind": 3 - }, - { - "EndIndex": 84177, - "Kind": 3 - }, - { - "EndIndex": 84191, - "Kind": 3 - }, - { - "EndIndex": 84197, - "Kind": 3 - }, - { - "EndIndex": 84215, - "Kind": 3 - }, - { - "EndIndex": 84248, - "Kind": 3 - }, - { - "EndIndex": 84399, - "Kind": 3 - }, - { - "EndIndex": 84420, - "Kind": 3 - }, - { - "EndIndex": 84426, - "Kind": 3 - }, - { - "EndIndex": 84451, - "Kind": 3 - }, - { - "EndIndex": 84484, - "Kind": 3 - }, - { - "EndIndex": 84515, - "Kind": 3 - }, - { - "EndIndex": 84521, - "Kind": 3 - }, - { - "EndIndex": 84553, - "Kind": 3 - }, - { - "EndIndex": 84619, - "Kind": 3 - }, - { - "EndIndex": 84637, - "Kind": 3 - }, - { - "EndIndex": 84643, - "Kind": 3 - }, - { - "EndIndex": 84668, - "Kind": 3 - }, - { - "EndIndex": 84701, - "Kind": 3 - }, - { - "EndIndex": 84731, - "Kind": 3 - }, - { - "EndIndex": 84737, - "Kind": 3 - }, - { - "EndIndex": 84764, - "Kind": 3 - }, - { - "EndIndex": 84814, - "Kind": 3 - }, - { - "EndIndex": 84844, - "Kind": 3 - }, - { - "EndIndex": 84850, - "Kind": 3 - }, - { - "EndIndex": 84886, - "Kind": 3 - }, - { - "EndIndex": 84935, - "Kind": 3 - }, - { - "EndIndex": 84956, - "Kind": 3 - }, - { - "EndIndex": 84962, - "Kind": 3 - }, - { - "EndIndex": 84980, - "Kind": 3 - }, - { - "EndIndex": 85022, - "Kind": 3 - }, - { - "EndIndex": 85348, - "Kind": 3 - }, - { - "EndIndex": 85370, - "Kind": 3 - }, - { - "EndIndex": 85376, - "Kind": 3 - }, - { - "EndIndex": 85378, - "Kind": 3 - }, - { - "EndIndex": 85414, - "Kind": 3 - }, - { - "EndIndex": 85437, - "Kind": 3 - }, - { - "EndIndex": 85476, - "Kind": 3 - }, - { - "EndIndex": 85499, - "Kind": 3 - }, - { - "EndIndex": 85605, - "Kind": 3 - }, - { - "EndIndex": 85629, - "Kind": 3 - }, - { - "EndIndex": 85663, - "Kind": 3 - }, - { - "EndIndex": 85705, - "Kind": 3 - }, - { - "EndIndex": 85726, - "Kind": 3 - }, - { - "EndIndex": 85732, - "Kind": 3 - }, - { - "EndIndex": 85751, - "Kind": 3 - }, - { - "EndIndex": 85775, - "Kind": 3 - }, - { - "EndIndex": 85838, - "Kind": 3 - }, - { - "EndIndex": 85859, - "Kind": 3 - }, - { - "EndIndex": 85865, - "Kind": 3 - }, - { - "EndIndex": 85904, - "Kind": 3 - }, - { - "EndIndex": 85943, - "Kind": 3 - }, - { - "EndIndex": 85957, - "Kind": 3 - }, - { - "EndIndex": 85963, - "Kind": 3 - }, - { - "EndIndex": 86005, - "Kind": 3 - }, - { - "EndIndex": 86115, - "Kind": 3 - }, - { - "EndIndex": 86129, - "Kind": 3 - }, - { - "EndIndex": 86135, - "Kind": 3 - }, - { - "EndIndex": 86153, - "Kind": 3 - }, - { - "EndIndex": 86186, - "Kind": 3 - }, - { - "EndIndex": 86337, - "Kind": 3 - }, - { - "EndIndex": 86358, - "Kind": 3 - }, - { - "EndIndex": 86364, - "Kind": 3 - }, - { - "EndIndex": 86389, - "Kind": 3 - }, - { - "EndIndex": 86419, - "Kind": 3 - }, - { - "EndIndex": 86438, - "Kind": 3 - }, - { - "EndIndex": 86444, - "Kind": 3 - }, - { - "EndIndex": 86485, - "Kind": 3 - }, - { - "EndIndex": 86534, - "Kind": 3 - }, - { - "EndIndex": 86555, - "Kind": 3 - }, - { - "EndIndex": 86561, - "Kind": 3 - }, - { - "EndIndex": 86579, - "Kind": 3 - }, - { - "EndIndex": 86621, - "Kind": 3 - }, - { - "EndIndex": 86947, - "Kind": 3 - }, - { - "EndIndex": 86969, - "Kind": 3 - }, - { - "EndIndex": 86975, - "Kind": 3 - }, - { - "EndIndex": 86977, - "Kind": 3 - }, - { - "EndIndex": 86998, - "Kind": 3 - }, - { - "EndIndex": 87023, - "Kind": 3 - }, - { - "EndIndex": 87328, - "Kind": 3 - }, - { - "EndIndex": 87343, - "Kind": 3 - }, - { - "EndIndex": 87375, - "Kind": 3 - }, - { - "EndIndex": 87394, - "Kind": 3 - }, - { - "EndIndex": 87400, - "Kind": 3 - }, - { - "EndIndex": 87442, - "Kind": 3 - }, - { - "EndIndex": 87478, - "Kind": 3 - }, - { - "EndIndex": 87492, - "Kind": 3 - }, - { - "EndIndex": 87498, - "Kind": 3 - }, - { - "EndIndex": 87524, - "Kind": 3 - }, - { - "EndIndex": 87539, - "Kind": 3 - }, - { - "EndIndex": 87567, - "Kind": 3 - }, - { - "EndIndex": 87581, - "Kind": 3 - }, - { - "EndIndex": 87587, - "Kind": 3 - }, - { - "EndIndex": 87602, - "Kind": 3 - }, - { - "EndIndex": 87627, - "Kind": 3 - }, - { - "EndIndex": 87652, - "Kind": 3 - }, - { - "EndIndex": 87658, - "Kind": 3 - }, - { - "EndIndex": 87673, - "Kind": 3 - }, - { - "EndIndex": 87702, - "Kind": 3 - }, - { - "EndIndex": 87716, - "Kind": 3 - }, - { - "EndIndex": 87722, - "Kind": 3 - }, - { - "EndIndex": 87741, - "Kind": 3 - }, - { - "EndIndex": 87782, - "Kind": 3 - }, - { - "EndIndex": 87850, - "Kind": 3 - }, - { - "EndIndex": 87877, - "Kind": 3 - }, - { - "EndIndex": 87883, - "Kind": 3 - }, - { - "EndIndex": 87898, - "Kind": 3 - }, - { - "EndIndex": 87926, - "Kind": 3 - }, - { - "EndIndex": 87945, - "Kind": 3 - }, - { - "EndIndex": 87951, - "Kind": 3 - }, - { - "EndIndex": 87993, - "Kind": 3 - }, - { - "EndIndex": 88302, - "Kind": 3 - }, - { - "EndIndex": 88316, - "Kind": 3 - }, - { - "EndIndex": 88322, - "Kind": 3 - }, - { - "EndIndex": 88340, - "Kind": 3 - }, - { - "EndIndex": 88373, - "Kind": 3 - }, - { - "EndIndex": 88524, - "Kind": 3 - }, - { - "EndIndex": 88545, - "Kind": 3 - }, - { - "EndIndex": 88551, - "Kind": 3 - }, - { - "EndIndex": 88566, - "Kind": 3 - }, - { - "EndIndex": 88597, - "Kind": 3 - }, - { - "EndIndex": 88611, - "Kind": 3 - }, - { - "EndIndex": 88617, - "Kind": 3 - }, - { - "EndIndex": 88644, - "Kind": 3 - }, - { - "EndIndex": 88675, - "Kind": 3 - }, - { - "EndIndex": 88700, - "Kind": 3 - }, - { - "EndIndex": 88730, - "Kind": 3 - }, - { - "EndIndex": 88749, - "Kind": 3 - }, - { - "EndIndex": 88755, - "Kind": 3 - }, - { - "EndIndex": 88773, - "Kind": 3 - }, - { - "EndIndex": 88815, - "Kind": 3 - }, - { - "EndIndex": 89141, - "Kind": 3 - }, - { - "EndIndex": 89163, - "Kind": 3 - }, - { - "EndIndex": 89169, - "Kind": 3 - }, - { - "EndIndex": 89171, - "Kind": 3 - }, - { - "EndIndex": 89196, - "Kind": 3 - }, - { - "EndIndex": 89231, - "Kind": 3 - }, - { - "EndIndex": 89273, - "Kind": 3 - }, - { - "EndIndex": 89309, - "Kind": 3 - }, - { - "EndIndex": 89323, - "Kind": 3 - }, - { - "EndIndex": 89329, - "Kind": 3 - }, - { - "EndIndex": 89365, - "Kind": 3 - }, - { - "EndIndex": 89406, - "Kind": 3 - }, - { - "EndIndex": 89474, - "Kind": 3 - }, - { - "EndIndex": 89511, - "Kind": 3 - }, - { - "EndIndex": 89517, - "Kind": 3 - }, - { - "EndIndex": 89556, - "Kind": 3 - }, - { - "EndIndex": 89595, - "Kind": 3 - }, - { - "EndIndex": 89609, - "Kind": 3 - }, - { - "EndIndex": 89615, - "Kind": 3 - }, - { - "EndIndex": 89633, - "Kind": 3 - }, - { - "EndIndex": 89666, - "Kind": 3 - }, - { - "EndIndex": 89817, - "Kind": 3 - }, - { - "EndIndex": 89838, - "Kind": 3 - }, - { - "EndIndex": 89844, - "Kind": 3 - }, - { - "EndIndex": 89881, - "Kind": 3 - }, - { - "EndIndex": 89896, - "Kind": 3 - }, - { - "EndIndex": 89925, - "Kind": 3 - }, - { - "EndIndex": 89939, - "Kind": 3 - }, - { - "EndIndex": 89945, - "Kind": 3 - }, - { - "EndIndex": 89986, - "Kind": 3 - }, - { - "EndIndex": 90013, - "Kind": 3 - }, - { - "EndIndex": 90043, - "Kind": 3 - }, - { - "EndIndex": 90049, - "Kind": 3 - }, - { - "EndIndex": 90074, - "Kind": 3 - }, - { - "EndIndex": 90104, - "Kind": 3 - }, - { - "EndIndex": 90123, - "Kind": 3 - }, - { - "EndIndex": 90129, - "Kind": 3 - }, - { - "EndIndex": 90147, - "Kind": 3 - }, - { - "EndIndex": 90189, - "Kind": 3 - }, - { - "EndIndex": 90515, - "Kind": 3 - }, - { - "EndIndex": 90537, - "Kind": 3 - }, - { - "EndIndex": 90543, - "Kind": 3 - }, - { - "EndIndex": 90574, - "Kind": 3 - }, - { - "EndIndex": 90576, - "Kind": 3 - }, - { - "EndIndex": 90626, - "Kind": 3 - }, - { - "EndIndex": 90669, - "Kind": 3 - }, - { - "EndIndex": 90711, - "Kind": 3 - }, - { - "EndIndex": 90747, - "Kind": 3 - }, - { - "EndIndex": 90761, - "Kind": 3 - }, - { - "EndIndex": 90767, - "Kind": 3 - }, - { - "EndIndex": 90811, - "Kind": 3 - }, - { - "EndIndex": 90841, - "Kind": 3 - }, - { - "EndIndex": 90872, - "Kind": 3 - }, - { - "EndIndex": 90894, - "Kind": 3 - }, - { - "EndIndex": 90900, - "Kind": 3 - }, - { - "EndIndex": 90930, - "Kind": 3 - }, - { - "EndIndex": 90961, - "Kind": 3 - }, - { - "EndIndex": 90983, - "Kind": 3 - }, - { - "EndIndex": 90989, - "Kind": 3 - }, - { - "EndIndex": 91028, - "Kind": 3 - }, - { - "EndIndex": 91067, - "Kind": 3 - }, - { - "EndIndex": 91081, - "Kind": 3 - }, - { - "EndIndex": 91087, - "Kind": 3 - }, - { - "EndIndex": 91117, - "Kind": 3 - }, - { - "EndIndex": 91147, - "Kind": 3 - }, - { - "EndIndex": 91169, - "Kind": 3 - }, - { - "EndIndex": 91175, - "Kind": 3 - }, - { - "EndIndex": 91200, - "Kind": 3 - }, - { - "EndIndex": 91230, - "Kind": 3 - }, - { - "EndIndex": 91248, - "Kind": 3 - }, - { - "EndIndex": 91254, - "Kind": 3 - }, - { - "EndIndex": 91272, - "Kind": 3 - }, - { - "EndIndex": 91305, - "Kind": 3 - }, - { - "EndIndex": 91456, - "Kind": 3 - }, - { - "EndIndex": 91477, - "Kind": 3 - }, - { - "EndIndex": 91483, - "Kind": 3 - }, - { - "EndIndex": 91513, - "Kind": 3 - }, - { - "EndIndex": 91544, - "Kind": 3 - }, - { - "EndIndex": 91566, - "Kind": 3 - }, - { - "EndIndex": 91572, - "Kind": 3 - }, - { - "EndIndex": 91602, - "Kind": 3 - }, - { - "EndIndex": 91632, - "Kind": 3 - }, - { - "EndIndex": 91654, - "Kind": 3 - }, - { - "EndIndex": 91660, - "Kind": 3 - }, - { - "EndIndex": 91705, - "Kind": 3 - }, - { - "EndIndex": 91735, - "Kind": 3 - }, - { - "EndIndex": 91766, - "Kind": 3 - }, - { - "EndIndex": 91788, - "Kind": 3 - }, - { - "EndIndex": 91794, - "Kind": 3 - }, - { - "EndIndex": 91843, - "Kind": 3 - }, - { - "EndIndex": 91870, - "Kind": 3 - }, - { - "EndIndex": 91900, - "Kind": 3 - }, - { - "EndIndex": 91906, - "Kind": 3 - }, - { - "EndIndex": 91931, - "Kind": 3 - }, - { - "EndIndex": 91961, - "Kind": 3 - }, - { - "EndIndex": 91980, - "Kind": 3 - }, - { - "EndIndex": 91986, - "Kind": 3 - }, - { - "EndIndex": 92001, - "Kind": 3 - }, - { - "EndIndex": 92026, - "Kind": 3 - }, - { - "EndIndex": 92040, - "Kind": 3 - }, - { - "EndIndex": 92046, - "Kind": 3 - }, - { - "EndIndex": 92064, - "Kind": 3 - }, - { - "EndIndex": 92106, - "Kind": 3 - }, - { - "EndIndex": 92432, - "Kind": 3 - }, - { - "EndIndex": 92454, - "Kind": 3 - }, - { - "EndIndex": 92460, - "Kind": 3 - }, - { - "EndIndex": 92491, - "Kind": 3 - }, - { - "EndIndex": 92493, - "Kind": 3 - }, - { - "EndIndex": 92543, - "Kind": 3 - }, - { - "EndIndex": 92569, - "Kind": 3 - }, - { - "EndIndex": 92596, - "Kind": 3 - }, - { - "EndIndex": 92620, - "Kind": 3 - }, - { - "EndIndex": 92641, - "Kind": 3 - }, - { - "EndIndex": 92647, - "Kind": 3 - }, - { - "EndIndex": 92686, - "Kind": 3 - }, - { - "EndIndex": 92725, - "Kind": 3 - }, - { - "EndIndex": 92739, - "Kind": 3 - }, - { - "EndIndex": 92745, - "Kind": 3 - }, - { - "EndIndex": 92787, - "Kind": 3 - }, - { - "EndIndex": 92801, - "Kind": 3 - }, - { - "EndIndex": 92807, - "Kind": 3 - }, - { - "EndIndex": 92825, - "Kind": 3 - }, - { - "EndIndex": 92858, - "Kind": 3 - }, - { - "EndIndex": 93009, - "Kind": 3 - }, - { - "EndIndex": 93030, - "Kind": 3 - }, - { - "EndIndex": 93036, - "Kind": 3 - }, - { - "EndIndex": 93061, - "Kind": 3 - }, - { - "EndIndex": 93094, - "Kind": 3 - }, - { - "EndIndex": 93122, - "Kind": 3 - }, - { - "EndIndex": 93128, - "Kind": 3 - }, - { - "EndIndex": 93156, - "Kind": 3 - }, - { - "EndIndex": 93181, - "Kind": 3 - }, - { - "EndIndex": 93214, - "Kind": 3 - }, - { - "EndIndex": 93228, - "Kind": 3 - }, - { - "EndIndex": 93234, - "Kind": 3 - }, - { - "EndIndex": 93266, - "Kind": 3 - }, - { - "EndIndex": 93291, - "Kind": 3 - }, - { - "EndIndex": 93321, - "Kind": 3 - }, - { - "EndIndex": 93340, - "Kind": 3 - }, - { - "EndIndex": 93346, - "Kind": 3 - }, - { - "EndIndex": 93364, - "Kind": 3 - }, - { - "EndIndex": 93406, - "Kind": 3 - }, - { - "EndIndex": 93732, - "Kind": 3 - }, - { - "EndIndex": 93754, - "Kind": 3 - }, - { - "EndIndex": 93760, - "Kind": 3 - }, - { - "EndIndex": 93782, - "Kind": 3 - }, - { - "EndIndex": 93842, - "Kind": 3 - }, - { - "EndIndex": 93863, - "Kind": 3 - }, - { - "EndIndex": 93869, - "Kind": 3 - }, - { - "EndIndex": 93884, - "Kind": 3 - }, - { - "EndIndex": 93908, - "Kind": 3 - }, - { - "EndIndex": 93922, - "Kind": 3 - }, - { - "EndIndex": 93928, - "Kind": 3 - }, - { - "EndIndex": 93943, - "Kind": 3 - }, - { - "EndIndex": 93968, - "Kind": 3 - }, - { - "EndIndex": 93982, - "Kind": 3 - }, - { - "EndIndex": 93988, - "Kind": 3 - }, - { - "EndIndex": 94003, - "Kind": 3 - }, - { - "EndIndex": 94030, - "Kind": 3 - }, - { - "EndIndex": 94044, - "Kind": 3 - }, - { - "EndIndex": 94050, - "Kind": 3 - }, - { - "EndIndex": 94065, - "Kind": 3 - }, - { - "EndIndex": 94094, - "Kind": 3 - }, - { - "EndIndex": 94150, - "Kind": 3 - }, - { - "EndIndex": 94164, - "Kind": 3 - }, - { - "EndIndex": 94170, - "Kind": 3 - }, - { - "EndIndex": 94198, - "Kind": 3 - }, - { - "EndIndex": 94300, - "Kind": 3 - }, - { - "EndIndex": 94332, - "Kind": 3 - }, - { - "EndIndex": 94338, - "Kind": 3 - }, - { - "EndIndex": 94394, - "Kind": 3 - }, - { - "EndIndex": 94511, - "Kind": 3 - }, - { - "EndIndex": 94532, - "Kind": 3 - }, - { - "EndIndex": 94538, - "Kind": 3 - }, - { - "EndIndex": 94540, - "Kind": 3 - }, - { - "EndIndex": 94567, - "Kind": 3 - }, - { - "EndIndex": 94592, - "Kind": 3 - }, - { - "EndIndex": 95387, - "Kind": 3 - }, - { - "EndIndex": 95413, - "Kind": 3 - }, - { - "EndIndex": 95450, - "Kind": 3 - }, - { - "EndIndex": 95494, - "Kind": 3 - }, - { - "EndIndex": 95515, - "Kind": 3 - }, - { - "EndIndex": 95521, - "Kind": 3 - }, - { - "EndIndex": 95562, - "Kind": 3 - }, - { - "EndIndex": 95630, - "Kind": 3 - }, - { - "EndIndex": 95657, - "Kind": 3 - }, - { - "EndIndex": 95663, - "Kind": 3 - }, - { - "EndIndex": 95702, - "Kind": 3 - }, - { - "EndIndex": 95741, - "Kind": 3 - }, - { - "EndIndex": 95755, - "Kind": 3 - }, - { - "EndIndex": 95761, - "Kind": 3 - }, - { - "EndIndex": 95803, - "Kind": 3 - }, - { - "EndIndex": 96602, - "Kind": 3 - }, - { - "EndIndex": 96616, - "Kind": 3 - }, - { - "EndIndex": 96622, - "Kind": 3 - }, - { - "EndIndex": 96640, - "Kind": 3 - }, - { - "EndIndex": 96673, - "Kind": 3 - }, - { - "EndIndex": 96824, - "Kind": 3 - }, - { - "EndIndex": 96845, - "Kind": 3 - }, - { - "EndIndex": 96851, - "Kind": 3 - }, - { - "EndIndex": 96866, - "Kind": 3 - }, - { - "EndIndex": 96903, - "Kind": 3 - }, - { - "EndIndex": 96917, - "Kind": 3 - }, - { - "EndIndex": 96923, - "Kind": 3 - }, - { - "EndIndex": 96964, - "Kind": 3 - }, - { - "EndIndex": 97014, - "Kind": 3 - }, - { - "EndIndex": 97035, - "Kind": 3 - }, - { - "EndIndex": 97041, - "Kind": 3 - }, - { - "EndIndex": 97059, - "Kind": 3 - }, - { - "EndIndex": 97101, - "Kind": 3 - }, - { - "EndIndex": 97427, - "Kind": 3 - }, - { - "EndIndex": 97449, - "Kind": 3 - }, - { - "EndIndex": 97455, - "Kind": 3 - }, - { - "EndIndex": 97485, - "Kind": 3 - }, - { - "EndIndex": 97544, - "Kind": 3 - }, - { - "EndIndex": 97565, - "Kind": 3 - }, - { - "EndIndex": 97571, - "Kind": 3 - }, - { - "EndIndex": 97586, - "Kind": 3 - }, - { - "EndIndex": 97607, - "Kind": 3 - }, - { - "EndIndex": 97621, - "Kind": 3 - }, - { - "EndIndex": 97627, - "Kind": 3 - }, - { - "EndIndex": 97642, - "Kind": 3 - }, - { - "EndIndex": 97663, - "Kind": 3 - }, - { - "EndIndex": 97677, - "Kind": 3 - }, - { - "EndIndex": 97683, - "Kind": 3 - }, - { - "EndIndex": 97698, - "Kind": 3 - }, - { - "EndIndex": 97719, - "Kind": 3 - }, - { - "EndIndex": 97733, - "Kind": 3 - }, - { - "EndIndex": 97739, - "Kind": 3 - }, - { - "EndIndex": 97768, - "Kind": 3 - }, - { - "EndIndex": 97826, - "Kind": 3 - }, - { - "EndIndex": 97847, - "Kind": 3 - }, - { - "EndIndex": 97853, - "Kind": 3 - }, - { - "EndIndex": 97882, - "Kind": 3 - }, - { - "EndIndex": 97940, - "Kind": 3 - }, - { - "EndIndex": 97961, - "Kind": 3 - }, - { - "EndIndex": 97967, - "Kind": 3 - }, - { - "EndIndex": 97969, - "Kind": 3 - }, - { - "EndIndex": 97994, - "Kind": 3 - }, - { - "EndIndex": 98022, - "Kind": 3 - }, - { - "EndIndex": 98718, - "Kind": 3 - }, - { - "EndIndex": 98747, - "Kind": 3 - }, - { - "EndIndex": 98766, - "Kind": 3 - }, - { - "EndIndex": 98781, - "Kind": 3 - }, - { - "EndIndex": 98806, - "Kind": 3 - }, - { - "EndIndex": 98820, - "Kind": 3 - }, - { - "EndIndex": 98826, - "Kind": 3 - }, - { - "EndIndex": 98867, - "Kind": 3 - }, - { - "EndIndex": 98935, - "Kind": 3 - }, - { - "EndIndex": 98965, - "Kind": 3 - }, - { - "EndIndex": 98971, - "Kind": 3 - }, - { - "EndIndex": 99006, - "Kind": 3 - }, - { - "EndIndex": 99706, - "Kind": 3 - }, - { - "EndIndex": 99720, - "Kind": 3 - }, - { - "EndIndex": 99726, - "Kind": 3 - }, - { - "EndIndex": 99744, - "Kind": 3 - }, - { - "EndIndex": 99777, - "Kind": 3 - }, - { - "EndIndex": 99928, - "Kind": 3 - }, - { - "EndIndex": 99949, - "Kind": 3 - }, - { - "EndIndex": 99955, - "Kind": 3 - }, - { - "EndIndex": 99970, - "Kind": 3 - }, - { - "EndIndex": 100007, - "Kind": 3 - }, - { - "EndIndex": 100021, - "Kind": 3 - }, - { - "EndIndex": 100027, - "Kind": 3 - }, - { - "EndIndex": 100045, - "Kind": 3 - }, - { - "EndIndex": 100087, - "Kind": 3 - }, - { - "EndIndex": 100413, - "Kind": 3 - }, - { - "EndIndex": 100435, - "Kind": 3 - }, - { - "EndIndex": 100441, - "Kind": 3 - }, - { - "EndIndex": 100443, - "Kind": 3 - }, - { - "EndIndex": 100474, - "Kind": 3 - }, - { - "EndIndex": 100503, - "Kind": 3 - }, - { - "EndIndex": 101055, - "Kind": 3 - }, - { - "EndIndex": 101085, - "Kind": 3 - }, - { - "EndIndex": 101104, - "Kind": 3 - }, - { - "EndIndex": 101119, - "Kind": 3 - }, - { - "EndIndex": 101144, - "Kind": 3 - }, - { - "EndIndex": 101158, - "Kind": 3 - }, - { - "EndIndex": 101164, - "Kind": 3 - }, - { - "EndIndex": 101205, - "Kind": 3 - }, - { - "EndIndex": 101273, - "Kind": 3 - }, - { - "EndIndex": 101304, - "Kind": 3 - }, - { - "EndIndex": 101310, - "Kind": 3 - }, - { - "EndIndex": 101345, - "Kind": 3 - }, - { - "EndIndex": 101901, - "Kind": 3 - }, - { - "EndIndex": 101915, - "Kind": 3 - }, - { - "EndIndex": 101921, - "Kind": 3 - }, - { - "EndIndex": 101939, - "Kind": 3 - }, - { - "EndIndex": 101972, - "Kind": 3 - }, - { - "EndIndex": 102123, - "Kind": 3 - }, - { - "EndIndex": 102144, - "Kind": 3 - }, - { - "EndIndex": 102150, - "Kind": 3 - }, - { - "EndIndex": 102165, - "Kind": 3 - }, - { - "EndIndex": 102202, - "Kind": 3 - }, - { - "EndIndex": 102216, - "Kind": 3 - }, - { - "EndIndex": 102222, - "Kind": 3 - }, - { - "EndIndex": 102240, - "Kind": 3 - }, - { - "EndIndex": 102282, - "Kind": 3 - }, - { - "EndIndex": 102608, - "Kind": 3 - }, - { - "EndIndex": 102630, - "Kind": 3 - }, - { - "EndIndex": 102636, - "Kind": 3 - }, - { - "EndIndex": 102638, - "Kind": 3 - }, - { - "EndIndex": 102671, - "Kind": 3 - }, - { - "EndIndex": 102696, - "Kind": 3 - }, - { - "EndIndex": 102722, - "Kind": 3 - }, - { - "EndIndex": 102761, - "Kind": 3 - }, - { - "EndIndex": 102800, - "Kind": 3 - }, - { - "EndIndex": 102814, - "Kind": 3 - }, - { - "EndIndex": 102820, - "Kind": 3 - }, - { - "EndIndex": 102862, - "Kind": 3 - }, - { - "EndIndex": 102876, - "Kind": 3 - }, - { - "EndIndex": 102882, - "Kind": 3 - }, - { - "EndIndex": 102900, - "Kind": 3 - }, - { - "EndIndex": 102933, - "Kind": 3 - }, - { - "EndIndex": 103084, - "Kind": 3 - }, - { - "EndIndex": 103105, - "Kind": 3 - }, - { - "EndIndex": 103111, - "Kind": 3 - }, - { - "EndIndex": 103138, - "Kind": 3 - }, - { - "EndIndex": 103168, - "Kind": 3 - }, - { - "EndIndex": 103174, - "Kind": 3 - }, - { - "EndIndex": 103199, - "Kind": 3 - }, - { - "EndIndex": 103229, - "Kind": 3 - }, - { - "EndIndex": 103248, - "Kind": 3 - }, - { - "EndIndex": 103254, - "Kind": 3 - }, - { - "EndIndex": 103272, - "Kind": 3 - }, - { - "EndIndex": 103314, - "Kind": 3 - }, - { - "EndIndex": 103640, - "Kind": 3 - }, - { - "EndIndex": 103662, - "Kind": 3 - }, - { - "EndIndex": 103668, - "Kind": 3 - }, - { - "EndIndex": 103670, - "Kind": 3 - }, - { - "EndIndex": 103695, - "Kind": 3 - }, - { - "EndIndex": 103726, - "Kind": 3 - }, - { - "EndIndex": 103758, - "Kind": 3 - }, - { - "EndIndex": 103797, - "Kind": 3 - }, - { - "EndIndex": 103836, - "Kind": 3 - }, - { - "EndIndex": 103850, - "Kind": 3 - }, - { - "EndIndex": 103856, - "Kind": 3 - }, - { - "EndIndex": 103898, - "Kind": 3 - }, - { - "EndIndex": 103912, - "Kind": 3 - }, - { - "EndIndex": 103918, - "Kind": 3 - }, - { - "EndIndex": 103936, - "Kind": 3 - }, - { - "EndIndex": 103969, - "Kind": 3 - }, - { - "EndIndex": 104120, - "Kind": 3 - }, - { - "EndIndex": 104141, - "Kind": 3 - }, - { - "EndIndex": 104147, - "Kind": 3 - }, - { - "EndIndex": 104172, - "Kind": 3 - }, - { - "EndIndex": 104205, - "Kind": 3 - }, - { - "EndIndex": 104238, - "Kind": 3 - }, - { - "EndIndex": 104244, - "Kind": 3 - }, - { - "EndIndex": 104276, - "Kind": 3 - }, - { - "EndIndex": 104342, - "Kind": 3 - }, - { - "EndIndex": 104360, - "Kind": 3 - }, - { - "EndIndex": 104366, - "Kind": 3 - }, - { - "EndIndex": 104391, - "Kind": 3 - }, - { - "EndIndex": 104424, - "Kind": 3 - }, - { - "EndIndex": 104438, - "Kind": 3 - }, - { - "EndIndex": 104444, - "Kind": 3 - }, - { - "EndIndex": 104471, - "Kind": 3 - }, - { - "EndIndex": 104521, - "Kind": 3 - }, - { - "EndIndex": 104551, - "Kind": 3 - }, - { - "EndIndex": 104557, - "Kind": 3 - }, - { - "EndIndex": 104593, - "Kind": 3 - }, - { - "EndIndex": 104642, - "Kind": 3 - }, - { - "EndIndex": 104663, - "Kind": 3 - }, - { - "EndIndex": 104669, - "Kind": 3 - }, - { - "EndIndex": 104687, - "Kind": 3 - }, - { - "EndIndex": 104729, - "Kind": 3 - }, - { - "EndIndex": 105055, - "Kind": 3 - }, - { - "EndIndex": 105077, - "Kind": 3 - }, - { - "EndIndex": 105083, - "Kind": 3 - }, - { - "EndIndex": 105085, - "Kind": 3 - }, - { - "EndIndex": 105121, - "Kind": 3 - }, - { - "EndIndex": 105151, - "Kind": 3 - }, - { - "EndIndex": 105182, - "Kind": 3 - }, - { - "EndIndex": 105221, - "Kind": 3 - }, - { - "EndIndex": 105260, - "Kind": 3 - }, - { - "EndIndex": 105274, - "Kind": 3 - }, - { - "EndIndex": 105280, - "Kind": 3 - }, - { - "EndIndex": 105322, - "Kind": 3 - }, - { - "EndIndex": 105336, - "Kind": 3 - }, - { - "EndIndex": 105342, - "Kind": 3 - }, - { - "EndIndex": 105360, - "Kind": 3 - }, - { - "EndIndex": 105393, - "Kind": 3 - }, - { - "EndIndex": 105544, - "Kind": 3 - }, - { - "EndIndex": 105565, - "Kind": 3 - }, - { - "EndIndex": 105571, - "Kind": 3 - }, - { - "EndIndex": 105596, - "Kind": 3 - }, - { - "EndIndex": 105629, - "Kind": 3 - }, - { - "EndIndex": 105661, - "Kind": 3 - }, - { - "EndIndex": 105667, - "Kind": 3 - }, - { - "EndIndex": 105699, - "Kind": 3 - }, - { - "EndIndex": 105765, - "Kind": 3 - }, - { - "EndIndex": 105783, - "Kind": 3 - }, - { - "EndIndex": 105789, - "Kind": 3 - }, - { - "EndIndex": 105814, - "Kind": 3 - }, - { - "EndIndex": 105847, - "Kind": 3 - }, - { - "EndIndex": 105861, - "Kind": 3 - }, - { - "EndIndex": 105867, - "Kind": 3 - }, - { - "EndIndex": 105894, - "Kind": 3 - }, - { - "EndIndex": 105944, - "Kind": 3 - }, - { - "EndIndex": 105974, - "Kind": 3 - }, - { - "EndIndex": 105980, - "Kind": 3 - }, - { - "EndIndex": 106016, - "Kind": 3 - }, - { - "EndIndex": 106065, - "Kind": 3 - }, - { - "EndIndex": 106086, - "Kind": 3 - }, - { - "EndIndex": 106092, - "Kind": 3 - }, - { - "EndIndex": 106110, - "Kind": 3 - }, - { - "EndIndex": 106152, - "Kind": 3 - }, - { - "EndIndex": 106478, - "Kind": 3 - }, - { - "EndIndex": 106500, - "Kind": 3 - }, - { - "EndIndex": 106506, - "Kind": 3 - }, - { - "EndIndex": 106508, - "Kind": 3 - }, - { - "EndIndex": 106542, - "Kind": 3 - }, - { - "EndIndex": 106568, - "Kind": 3 - }, - { - "EndIndex": 106599, - "Kind": 3 - }, - { - "EndIndex": 106629, - "Kind": 3 - }, - { - "EndIndex": 106657, - "Kind": 3 - }, - { - "EndIndex": 106663, - "Kind": 3 - }, - { - "EndIndex": 106690, - "Kind": 3 - }, - { - "EndIndex": 106724, - "Kind": 3 - }, - { - "EndIndex": 106755, - "Kind": 3 - }, - { - "EndIndex": 106777, - "Kind": 3 - }, - { - "EndIndex": 106783, - "Kind": 3 - }, - { - "EndIndex": 106813, - "Kind": 3 - }, - { - "EndIndex": 106844, - "Kind": 3 - }, - { - "EndIndex": 106866, - "Kind": 3 - }, - { - "EndIndex": 106872, - "Kind": 3 - }, - { - "EndIndex": 106902, - "Kind": 3 - }, - { - "EndIndex": 106933, - "Kind": 3 - }, - { - "EndIndex": 106955, - "Kind": 3 - }, - { - "EndIndex": 106961, - "Kind": 3 - }, - { - "EndIndex": 107000, - "Kind": 3 - }, - { - "EndIndex": 107039, - "Kind": 3 - }, - { - "EndIndex": 107053, - "Kind": 3 - }, - { - "EndIndex": 107059, - "Kind": 3 - }, - { - "EndIndex": 107089, - "Kind": 3 - }, - { - "EndIndex": 107119, - "Kind": 3 - }, - { - "EndIndex": 107141, - "Kind": 3 - }, - { - "EndIndex": 107147, - "Kind": 3 - }, - { - "EndIndex": 107168, - "Kind": 3 - }, - { - "EndIndex": 107210, - "Kind": 3 - }, - { - "EndIndex": 107224, - "Kind": 3 - }, - { - "EndIndex": 107230, - "Kind": 3 - }, - { - "EndIndex": 107248, - "Kind": 3 - }, - { - "EndIndex": 107281, - "Kind": 3 - }, - { - "EndIndex": 107432, - "Kind": 3 - }, - { - "EndIndex": 107453, - "Kind": 3 - }, - { - "EndIndex": 107459, - "Kind": 3 - }, - { - "EndIndex": 107484, - "Kind": 3 - }, - { - "EndIndex": 107517, - "Kind": 3 - }, - { - "EndIndex": 107545, - "Kind": 3 - }, - { - "EndIndex": 107551, - "Kind": 3 - }, - { - "EndIndex": 107581, - "Kind": 3 - }, - { - "EndIndex": 107612, - "Kind": 3 - }, - { - "EndIndex": 107634, - "Kind": 3 - }, - { - "EndIndex": 107640, - "Kind": 3 - }, - { - "EndIndex": 107664, - "Kind": 3 - }, - { - "EndIndex": 107693, - "Kind": 3 - }, - { - "EndIndex": 107711, - "Kind": 3 - }, - { - "EndIndex": 107717, - "Kind": 3 - }, - { - "EndIndex": 107747, - "Kind": 3 - }, - { - "EndIndex": 107777, - "Kind": 3 - }, - { - "EndIndex": 107799, - "Kind": 3 - }, - { - "EndIndex": 107805, - "Kind": 3 - }, - { - "EndIndex": 107835, - "Kind": 3 - }, - { - "EndIndex": 107866, - "Kind": 3 - }, - { - "EndIndex": 107888, - "Kind": 3 - }, - { - "EndIndex": 107894, - "Kind": 3 - }, - { - "EndIndex": 107924, - "Kind": 3 - }, - { - "EndIndex": 107954, - "Kind": 3 - }, - { - "EndIndex": 107982, - "Kind": 3 - }, - { - "EndIndex": 107988, - "Kind": 3 - }, - { - "EndIndex": 108020, - "Kind": 3 - }, - { - "EndIndex": 108050, - "Kind": 3 - }, - { - "EndIndex": 108078, - "Kind": 3 - }, - { - "EndIndex": 108084, - "Kind": 3 - }, - { - "EndIndex": 108109, - "Kind": 3 - }, - { - "EndIndex": 108139, - "Kind": 3 - }, - { - "EndIndex": 108158, - "Kind": 3 - }, - { - "EndIndex": 108164, - "Kind": 3 - }, - { - "EndIndex": 108195, - "Kind": 3 - }, - { - "EndIndex": 108225, - "Kind": 3 - }, - { - "EndIndex": 108253, - "Kind": 3 - }, - { - "EndIndex": 108259, - "Kind": 3 - }, - { - "EndIndex": 108291, - "Kind": 3 - }, - { - "EndIndex": 108321, - "Kind": 3 - }, - { - "EndIndex": 108349, - "Kind": 3 - }, - { - "EndIndex": 108355, - "Kind": 3 - }, - { - "EndIndex": 108387, - "Kind": 3 - }, - { - "EndIndex": 108417, - "Kind": 3 - }, - { - "EndIndex": 108445, - "Kind": 3 - }, - { - "EndIndex": 108451, - "Kind": 3 - }, - { - "EndIndex": 108482, - "Kind": 3 - }, - { - "EndIndex": 108512, - "Kind": 3 - }, - { - "EndIndex": 108540, - "Kind": 3 - }, - { - "EndIndex": 108546, - "Kind": 3 - }, - { - "EndIndex": 108564, - "Kind": 3 - }, - { - "EndIndex": 108606, - "Kind": 3 - }, - { - "EndIndex": 108932, - "Kind": 3 - }, - { - "EndIndex": 108954, - "Kind": 3 - }, - { - "EndIndex": 108960, - "Kind": 3 - }, - { - "EndIndex": 108991, - "Kind": 3 - }, - { - "EndIndex": 109021, - "Kind": 3 - }, - { - "EndIndex": 109049, - "Kind": 3 - }, - { - "EndIndex": 109055, - "Kind": 3 - }, - { - "EndIndex": 109089, - "Kind": 3 - }, - { - "EndIndex": 109173, - "Kind": 3 - }, - { - "EndIndex": 109195, - "Kind": 3 - }, - { - "EndIndex": 109201, - "Kind": 3 - }, - { - "EndIndex": 109203, - "Kind": 3 - }, - { - "EndIndex": 109229, - "Kind": 3 - }, - { - "EndIndex": 109257, - "Kind": 3 - }, - { - "EndIndex": 109286, - "Kind": 3 - }, - { - "EndIndex": 109325, - "Kind": 3 - }, - { - "EndIndex": 109364, - "Kind": 3 - }, - { - "EndIndex": 109378, - "Kind": 3 - }, - { - "EndIndex": 109384, - "Kind": 3 - }, - { - "EndIndex": 109426, - "Kind": 3 - }, - { - "EndIndex": 109440, - "Kind": 3 - }, - { - "EndIndex": 109446, - "Kind": 3 - }, - { - "EndIndex": 109464, - "Kind": 3 - }, - { - "EndIndex": 109497, - "Kind": 3 - }, - { - "EndIndex": 109648, - "Kind": 3 - }, - { - "EndIndex": 109669, - "Kind": 3 - }, - { - "EndIndex": 109675, - "Kind": 3 - }, - { - "EndIndex": 109700, - "Kind": 3 - }, - { - "EndIndex": 109733, - "Kind": 3 - }, - { - "EndIndex": 109763, - "Kind": 3 - }, - { - "EndIndex": 109769, - "Kind": 3 - }, - { - "EndIndex": 109793, - "Kind": 3 - }, - { - "EndIndex": 109822, - "Kind": 3 - }, - { - "EndIndex": 109840, - "Kind": 3 - }, - { - "EndIndex": 109846, - "Kind": 3 - }, - { - "EndIndex": 109871, - "Kind": 3 - }, - { - "EndIndex": 109901, - "Kind": 3 - }, - { - "EndIndex": 109920, - "Kind": 3 - }, - { - "EndIndex": 109926, - "Kind": 3 - }, - { - "EndIndex": 109944, - "Kind": 3 - }, - { - "EndIndex": 109986, - "Kind": 3 - }, - { - "EndIndex": 110312, - "Kind": 3 - }, - { - "EndIndex": 110334, - "Kind": 3 - }, - { - "EndIndex": 110340, - "Kind": 3 - }, - { - "EndIndex": 110342, - "Kind": 3 - }, - { - "EndIndex": 110372, - "Kind": 3 - }, - { - "EndIndex": 110399, - "Kind": 3 - }, - { - "EndIndex": 110430, - "Kind": 3 - }, - { - "EndIndex": 110460, - "Kind": 3 - }, - { - "EndIndex": 110489, - "Kind": 3 - }, - { - "EndIndex": 110495, - "Kind": 3 - }, - { - "EndIndex": 110523, - "Kind": 3 - }, - { - "EndIndex": 110557, - "Kind": 3 - }, - { - "EndIndex": 110588, - "Kind": 3 - }, - { - "EndIndex": 110610, - "Kind": 3 - }, - { - "EndIndex": 110616, - "Kind": 3 - }, - { - "EndIndex": 110646, - "Kind": 3 - }, - { - "EndIndex": 110677, - "Kind": 3 - }, - { - "EndIndex": 110699, - "Kind": 3 - }, - { - "EndIndex": 110705, - "Kind": 3 - }, - { - "EndIndex": 110735, - "Kind": 3 - }, - { - "EndIndex": 110766, - "Kind": 3 - }, - { - "EndIndex": 110788, - "Kind": 3 - }, - { - "EndIndex": 110794, - "Kind": 3 - }, - { - "EndIndex": 110833, - "Kind": 3 - }, - { - "EndIndex": 110872, - "Kind": 3 - }, - { - "EndIndex": 110886, - "Kind": 3 - }, - { - "EndIndex": 110892, - "Kind": 3 - }, - { - "EndIndex": 110922, - "Kind": 3 - }, - { - "EndIndex": 110952, - "Kind": 3 - }, - { - "EndIndex": 110974, - "Kind": 3 - }, - { - "EndIndex": 110980, - "Kind": 3 - }, - { - "EndIndex": 111001, - "Kind": 3 - }, - { - "EndIndex": 111043, - "Kind": 3 - }, - { - "EndIndex": 111057, - "Kind": 3 - }, - { - "EndIndex": 111063, - "Kind": 3 - }, - { - "EndIndex": 111081, - "Kind": 3 - }, - { - "EndIndex": 111114, - "Kind": 3 - }, - { - "EndIndex": 111265, - "Kind": 3 - }, - { - "EndIndex": 111286, - "Kind": 3 - }, - { - "EndIndex": 111292, - "Kind": 3 - }, - { - "EndIndex": 111317, - "Kind": 3 - }, - { - "EndIndex": 111350, - "Kind": 3 - }, - { - "EndIndex": 111379, - "Kind": 3 - }, - { - "EndIndex": 111385, - "Kind": 3 - }, - { - "EndIndex": 111415, - "Kind": 3 - }, - { - "EndIndex": 111446, - "Kind": 3 - }, - { - "EndIndex": 111468, - "Kind": 3 - }, - { - "EndIndex": 111474, - "Kind": 3 - }, - { - "EndIndex": 111498, - "Kind": 3 - }, - { - "EndIndex": 111527, - "Kind": 3 - }, - { - "EndIndex": 111545, - "Kind": 3 - }, - { - "EndIndex": 111551, - "Kind": 3 - }, - { - "EndIndex": 111581, - "Kind": 3 - }, - { - "EndIndex": 111611, - "Kind": 3 - }, - { - "EndIndex": 111633, - "Kind": 3 - }, - { - "EndIndex": 111639, - "Kind": 3 - }, - { - "EndIndex": 111669, - "Kind": 3 - }, - { - "EndIndex": 111700, - "Kind": 3 - }, - { - "EndIndex": 111722, - "Kind": 3 - }, - { - "EndIndex": 111728, - "Kind": 3 - }, - { - "EndIndex": 111758, - "Kind": 3 - }, - { - "EndIndex": 111788, - "Kind": 3 - }, - { - "EndIndex": 111817, - "Kind": 3 - }, - { - "EndIndex": 111823, - "Kind": 3 - }, - { - "EndIndex": 111855, - "Kind": 3 - }, - { - "EndIndex": 111885, - "Kind": 3 - }, - { - "EndIndex": 111914, - "Kind": 3 - }, - { - "EndIndex": 111920, - "Kind": 3 - }, - { - "EndIndex": 111945, - "Kind": 3 - }, - { - "EndIndex": 111975, - "Kind": 3 - }, - { - "EndIndex": 111994, - "Kind": 3 - }, - { - "EndIndex": 112000, - "Kind": 3 - }, - { - "EndIndex": 112031, - "Kind": 3 - }, - { - "EndIndex": 112061, - "Kind": 3 - }, - { - "EndIndex": 112090, - "Kind": 3 - }, - { - "EndIndex": 112096, - "Kind": 3 - }, - { - "EndIndex": 112128, - "Kind": 3 - }, - { - "EndIndex": 112158, - "Kind": 3 - }, - { - "EndIndex": 112187, - "Kind": 3 - }, - { - "EndIndex": 112193, - "Kind": 3 - }, - { - "EndIndex": 112225, - "Kind": 3 - }, - { - "EndIndex": 112255, - "Kind": 3 - }, - { - "EndIndex": 112284, - "Kind": 3 - }, - { - "EndIndex": 112290, - "Kind": 3 - }, - { - "EndIndex": 112321, - "Kind": 3 - }, - { - "EndIndex": 112351, - "Kind": 3 - }, - { - "EndIndex": 112380, - "Kind": 3 - }, - { - "EndIndex": 112386, - "Kind": 3 - }, - { - "EndIndex": 112404, - "Kind": 3 - }, - { - "EndIndex": 112446, - "Kind": 3 - }, - { - "EndIndex": 112772, - "Kind": 3 - }, - { - "EndIndex": 112794, - "Kind": 3 - }, - { - "EndIndex": 112800, - "Kind": 3 - }, - { - "EndIndex": 112831, - "Kind": 3 - }, - { - "EndIndex": 112861, - "Kind": 3 - }, - { - "EndIndex": 112890, - "Kind": 3 - }, - { - "EndIndex": 112896, - "Kind": 3 - }, - { - "EndIndex": 112930, - "Kind": 3 - }, - { - "EndIndex": 113014, - "Kind": 3 - }, - { - "EndIndex": 113036, - "Kind": 3 - }, - { - "EndIndex": 113042, - "Kind": 3 - }, - { - "EndIndex": 113044, - "Kind": 3 - }, - { - "EndIndex": 113072, - "Kind": 3 - }, - { - "EndIndex": 113101, - "Kind": 3 - }, - { - "EndIndex": 113131, - "Kind": 3 - }, - { - "EndIndex": 113170, - "Kind": 3 - }, - { - "EndIndex": 113209, - "Kind": 3 - }, - { - "EndIndex": 113223, - "Kind": 3 - }, - { - "EndIndex": 113229, - "Kind": 3 - }, - { - "EndIndex": 113271, - "Kind": 3 - }, - { - "EndIndex": 113285, - "Kind": 3 - }, - { - "EndIndex": 113291, - "Kind": 3 - }, - { - "EndIndex": 113309, - "Kind": 3 - }, - { - "EndIndex": 113342, - "Kind": 3 - }, - { - "EndIndex": 113493, - "Kind": 3 - }, - { - "EndIndex": 113514, - "Kind": 3 - }, - { - "EndIndex": 113520, - "Kind": 3 - }, - { - "EndIndex": 113545, - "Kind": 3 - }, - { - "EndIndex": 113578, - "Kind": 3 - }, - { - "EndIndex": 113609, - "Kind": 3 - }, - { - "EndIndex": 113615, - "Kind": 3 - }, - { - "EndIndex": 113647, - "Kind": 3 - }, - { - "EndIndex": 113713, - "Kind": 3 - }, - { - "EndIndex": 113731, - "Kind": 3 - }, - { - "EndIndex": 113737, - "Kind": 3 - }, - { - "EndIndex": 113762, - "Kind": 3 - }, - { - "EndIndex": 113795, - "Kind": 3 - }, - { - "EndIndex": 113809, - "Kind": 3 - }, - { - "EndIndex": 113815, - "Kind": 3 - }, - { - "EndIndex": 113842, - "Kind": 3 - }, - { - "EndIndex": 113892, - "Kind": 3 - }, - { - "EndIndex": 113922, - "Kind": 3 - }, - { - "EndIndex": 113928, - "Kind": 3 - }, - { - "EndIndex": 113946, - "Kind": 3 - }, - { - "EndIndex": 113988, - "Kind": 3 - }, - { - "EndIndex": 114314, - "Kind": 3 - }, - { - "EndIndex": 114336, - "Kind": 3 - }, - { - "EndIndex": 114342, - "Kind": 3 - }, - { - "EndIndex": 114344, - "Kind": 3 - }, - { - "EndIndex": 114376, - "Kind": 3 - }, - { - "EndIndex": 114410, - "Kind": 3 - }, - { - "EndIndex": 114445, - "Kind": 3 - }, - { - "EndIndex": 114484, - "Kind": 3 - }, - { - "EndIndex": 114523, - "Kind": 3 - }, - { - "EndIndex": 114537, - "Kind": 3 - }, - { - "EndIndex": 114543, - "Kind": 3 - }, - { - "EndIndex": 114585, - "Kind": 3 - }, - { - "EndIndex": 114599, - "Kind": 3 - }, - { - "EndIndex": 114605, - "Kind": 3 - }, - { - "EndIndex": 114623, - "Kind": 3 - }, - { - "EndIndex": 114656, - "Kind": 3 - }, - { - "EndIndex": 114807, - "Kind": 3 - }, - { - "EndIndex": 114828, - "Kind": 3 - }, - { - "EndIndex": 114834, - "Kind": 3 - }, - { - "EndIndex": 114859, - "Kind": 3 - }, - { - "EndIndex": 114892, - "Kind": 3 - }, - { - "EndIndex": 114928, - "Kind": 3 - }, - { - "EndIndex": 114934, - "Kind": 3 - }, - { - "EndIndex": 114959, - "Kind": 3 - }, - { - "EndIndex": 114992, - "Kind": 3 - }, - { - "EndIndex": 115006, - "Kind": 3 - }, - { - "EndIndex": 115012, - "Kind": 3 - }, - { - "EndIndex": 115039, - "Kind": 3 - }, - { - "EndIndex": 115089, - "Kind": 3 - }, - { - "EndIndex": 115119, - "Kind": 3 - }, - { - "EndIndex": 115125, - "Kind": 3 - }, - { - "EndIndex": 115143, - "Kind": 3 - }, - { - "EndIndex": 115185, - "Kind": 3 - }, - { - "EndIndex": 115511, - "Kind": 3 - }, - { - "EndIndex": 115533, - "Kind": 3 - }, - { - "EndIndex": 115539, - "Kind": 3 - }, - { - "EndIndex": 115541, - "Kind": 3 - }, - { - "EndIndex": 115583, - "Kind": 3 - }, - { - "EndIndex": 116124, - "Kind": 3 - }, - { - "EndIndex": 116159, - "Kind": 3 - }, - { - "EndIndex": 116200, - "Kind": 3 - }, - { - "EndIndex": 116233, - "Kind": 3 - }, - { - "EndIndex": 116252, - "Kind": 3 - }, - { - "EndIndex": 116294, - "Kind": 3 - }, - { - "EndIndex": 116339, - "Kind": 3 - }, - { - "EndIndex": 116353, - "Kind": 3 - }, - { - "EndIndex": 116359, - "Kind": 3 - }, - { - "EndIndex": 116377, - "Kind": 3 - }, - { - "EndIndex": 116410, - "Kind": 3 - }, - { - "EndIndex": 116561, - "Kind": 3 - }, - { - "EndIndex": 116582, - "Kind": 3 - }, - { - "EndIndex": 116588, - "Kind": 3 - }, - { - "EndIndex": 116606, - "Kind": 3 - }, - { - "EndIndex": 116648, - "Kind": 3 - }, - { - "EndIndex": 116974, - "Kind": 3 - }, - { - "EndIndex": 116996, - "Kind": 3 - }, - { - "EndIndex": 117002, - "Kind": 3 - }, - { - "EndIndex": 117004, - "Kind": 3 - }, - { - "EndIndex": 117038, - "Kind": 3 - }, - { - "EndIndex": 117063, - "Kind": 3 - }, - { - "EndIndex": 117095, - "Kind": 3 - }, - { - "EndIndex": 117114, - "Kind": 3 - }, - { - "EndIndex": 117156, - "Kind": 3 - }, - { - "EndIndex": 117185, - "Kind": 3 - }, - { - "EndIndex": 117199, - "Kind": 3 - }, - { - "EndIndex": 117205, - "Kind": 3 - }, - { - "EndIndex": 117223, - "Kind": 3 - }, - { - "EndIndex": 117256, - "Kind": 3 - }, - { - "EndIndex": 117407, - "Kind": 3 - }, - { - "EndIndex": 117428, - "Kind": 3 - }, - { - "EndIndex": 117434, - "Kind": 3 - }, - { - "EndIndex": 117452, - "Kind": 3 - }, - { - "EndIndex": 117494, - "Kind": 3 - }, - { - "EndIndex": 117820, - "Kind": 3 - }, - { - "EndIndex": 117842, - "Kind": 3 - }, - { - "EndIndex": 117848, - "Kind": 3 - }, - { - "EndIndex": 117850, - "Kind": 3 - }, - { - "EndIndex": 117884, - "Kind": 3 - }, - { - "EndIndex": 117912, - "Kind": 3 - }, - { - "EndIndex": 117944, - "Kind": 3 - }, - { - "EndIndex": 117963, - "Kind": 3 - }, - { - "EndIndex": 118005, - "Kind": 3 - }, - { - "EndIndex": 118037, - "Kind": 3 - }, - { - "EndIndex": 118051, - "Kind": 3 - }, - { - "EndIndex": 118057, - "Kind": 3 - }, - { - "EndIndex": 118075, - "Kind": 3 - }, - { - "EndIndex": 118108, - "Kind": 3 - }, - { - "EndIndex": 118259, - "Kind": 3 - }, - { - "EndIndex": 118280, - "Kind": 3 - }, - { - "EndIndex": 118286, - "Kind": 3 - }, - { - "EndIndex": 118304, - "Kind": 3 - }, - { - "EndIndex": 118346, - "Kind": 3 - }, - { - "EndIndex": 118672, - "Kind": 3 - }, - { - "EndIndex": 118694, - "Kind": 3 - }, - { - "EndIndex": 118700, - "Kind": 3 - }, - { - "EndIndex": 118702, - "Kind": 3 - }, - { - "EndIndex": 118732, - "Kind": 3 - }, - { - "EndIndex": 118776, - "Kind": 3 - }, - { - "EndIndex": 118791, - "Kind": 3 - }, - { - "EndIndex": 118817, - "Kind": 3 - }, - { - "EndIndex": 118844, - "Kind": 3 - }, - { - "EndIndex": 118858, - "Kind": 3 - }, - { - "EndIndex": 118864, - "Kind": 3 - }, - { - "EndIndex": 118895, - "Kind": 3 - }, - { - "EndIndex": 118910, - "Kind": 3 - }, - { - "EndIndex": 118938, - "Kind": 3 - }, - { - "EndIndex": 118967, - "Kind": 3 - }, - { - "EndIndex": 118981, - "Kind": 3 - }, - { - "EndIndex": 118987, - "Kind": 3 - }, - { - "EndIndex": 119021, - "Kind": 3 - }, - { - "EndIndex": 119063, - "Kind": 3 - }, - { - "EndIndex": 119084, - "Kind": 3 - }, - { - "EndIndex": 119090, - "Kind": 3 - }, - { - "EndIndex": 119109, - "Kind": 3 - }, - { - "EndIndex": 119148, - "Kind": 3 - }, - { - "EndIndex": 119187, - "Kind": 3 - }, - { - "EndIndex": 119201, - "Kind": 3 - }, - { - "EndIndex": 119207, - "Kind": 3 - }, - { - "EndIndex": 119249, - "Kind": 3 - }, - { - "EndIndex": 119297, - "Kind": 3 - }, - { - "EndIndex": 119311, - "Kind": 3 - }, - { - "EndIndex": 119317, - "Kind": 3 - }, - { - "EndIndex": 119335, - "Kind": 3 - }, - { - "EndIndex": 119368, - "Kind": 3 - }, - { - "EndIndex": 119519, - "Kind": 3 - }, - { - "EndIndex": 119540, - "Kind": 3 - }, - { - "EndIndex": 119546, - "Kind": 3 - }, - { - "EndIndex": 119573, - "Kind": 3 - }, - { - "EndIndex": 119603, - "Kind": 3 - }, - { - "EndIndex": 119609, - "Kind": 3 - }, - { - "EndIndex": 119634, - "Kind": 3 - }, - { - "EndIndex": 119664, - "Kind": 3 - }, - { - "EndIndex": 119683, - "Kind": 3 - }, - { - "EndIndex": 119689, - "Kind": 3 - }, - { - "EndIndex": 119730, - "Kind": 3 - }, - { - "EndIndex": 119779, - "Kind": 3 - }, - { - "EndIndex": 119800, - "Kind": 3 - }, - { - "EndIndex": 119806, - "Kind": 3 - }, - { - "EndIndex": 119842, - "Kind": 3 - }, - { - "EndIndex": 119863, - "Kind": 3 - }, - { - "EndIndex": 119869, - "Kind": 3 - }, - { - "EndIndex": 119893, - "Kind": 3 - }, - { - "EndIndex": 119922, - "Kind": 3 - }, - { - "EndIndex": 119941, - "Kind": 3 - }, - { - "EndIndex": 119947, - "Kind": 3 - }, - { - "EndIndex": 119965, - "Kind": 3 - }, - { - "EndIndex": 120007, - "Kind": 3 - }, - { - "EndIndex": 120333, - "Kind": 3 - }, - { - "EndIndex": 120355, - "Kind": 3 - }, - { - "EndIndex": 120361, - "Kind": 3 - }, - { - "EndIndex": 120376, - "Kind": 3 - }, - { - "EndIndex": 120413, - "Kind": 3 - }, - { - "EndIndex": 120427, - "Kind": 3 - }, - { - "EndIndex": 120433, - "Kind": 3 - }, - { - "EndIndex": 120448, - "Kind": 3 - }, - { - "EndIndex": 120478, - "Kind": 3 - }, - { - "EndIndex": 120492, - "Kind": 3 - }, - { - "EndIndex": 120498, - "Kind": 3 - }, - { - "EndIndex": 120513, - "Kind": 3 - }, - { - "EndIndex": 120534, - "Kind": 3 - }, - { - "EndIndex": 120548, - "Kind": 3 - }, - { - "EndIndex": 120554, - "Kind": 3 - }, - { - "EndIndex": 120585, - "Kind": 3 - }, - { - "EndIndex": 120679, - "Kind": 3 - }, - { - "EndIndex": 120693, - "Kind": 3 - }, - { - "EndIndex": 120699, - "Kind": 3 - }, - { - "EndIndex": 120701, - "Kind": 3 - }, - { - "EndIndex": 120734, - "Kind": 3 - }, - { - "EndIndex": 120768, - "Kind": 3 - }, - { - "EndIndex": 120801, - "Kind": 3 - }, - { - "EndIndex": 120820, - "Kind": 3 - }, - { - "EndIndex": 120862, - "Kind": 3 - }, - { - "EndIndex": 120900, - "Kind": 3 - }, - { - "EndIndex": 120914, - "Kind": 3 - }, - { - "EndIndex": 120920, - "Kind": 3 - }, - { - "EndIndex": 120938, - "Kind": 3 - }, - { - "EndIndex": 120971, - "Kind": 3 - }, - { - "EndIndex": 121122, - "Kind": 3 - }, - { - "EndIndex": 121143, - "Kind": 3 - }, - { - "EndIndex": 121149, - "Kind": 3 - }, - { - "EndIndex": 121167, - "Kind": 3 - }, - { - "EndIndex": 121209, - "Kind": 3 - }, - { - "EndIndex": 121535, - "Kind": 3 - }, - { - "EndIndex": 121557, - "Kind": 3 - }, - { - "EndIndex": 121563, - "Kind": 3 - }, - { - "EndIndex": 121565, - "Kind": 3 - }, - { - "EndIndex": 121606, - "Kind": 3 - }, - { - "EndIndex": 121626, - "Kind": 3 - }, - { - "EndIndex": 121659, - "Kind": 3 - }, - { - "EndIndex": 121678, - "Kind": 3 - }, - { - "EndIndex": 121720, - "Kind": 3 - }, - { - "EndIndex": 121744, - "Kind": 3 - }, - { - "EndIndex": 121758, - "Kind": 3 - }, - { - "EndIndex": 121764, - "Kind": 3 - }, - { - "EndIndex": 121782, - "Kind": 3 - }, - { - "EndIndex": 121815, - "Kind": 3 - }, - { - "EndIndex": 121966, - "Kind": 3 - }, - { - "EndIndex": 121987, - "Kind": 3 - }, - { - "EndIndex": 121993, - "Kind": 3 - }, - { - "EndIndex": 122011, - "Kind": 3 - }, - { - "EndIndex": 122053, - "Kind": 3 - }, - { - "EndIndex": 122379, - "Kind": 3 - }, - { - "EndIndex": 122401, - "Kind": 3 - }, - { - "EndIndex": 122407, - "Kind": 3 - }, - { - "EndIndex": 122409, - "Kind": 3 - }, - { - "EndIndex": 122440, - "Kind": 3 - }, - { - "EndIndex": 122461, - "Kind": 3 - }, - { - "EndIndex": 122490, - "Kind": 3 - }, - { - "EndIndex": 122509, - "Kind": 3 - }, - { - "EndIndex": 122551, - "Kind": 3 - }, - { - "EndIndex": 122576, - "Kind": 3 - }, - { - "EndIndex": 122590, - "Kind": 3 - }, - { - "EndIndex": 122596, - "Kind": 3 - }, - { - "EndIndex": 122614, - "Kind": 3 - }, - { - "EndIndex": 122647, - "Kind": 3 - }, - { - "EndIndex": 122798, - "Kind": 3 - }, - { - "EndIndex": 122819, - "Kind": 3 - }, - { - "EndIndex": 122825, - "Kind": 3 - }, - { - "EndIndex": 122843, - "Kind": 3 - }, - { - "EndIndex": 122885, - "Kind": 3 - }, - { - "EndIndex": 123211, - "Kind": 3 - }, - { - "EndIndex": 123233, - "Kind": 3 - }, - { - "EndIndex": 123239, - "Kind": 3 - }, - { - "EndIndex": 123241, - "Kind": 3 - }, - { - "EndIndex": 123271, - "Kind": 3 - }, - { - "EndIndex": 123403, - "Kind": 3 - }, - { - "EndIndex": 123433, - "Kind": 3 - }, - { - "EndIndex": 123452, - "Kind": 3 - }, - { - "EndIndex": 123494, - "Kind": 3 - }, - { - "EndIndex": 123630, - "Kind": 3 - }, - { - "EndIndex": 123644, - "Kind": 3 - }, - { - "EndIndex": 123650, - "Kind": 3 - }, - { - "EndIndex": 123668, - "Kind": 3 - }, - { - "EndIndex": 123701, - "Kind": 3 - }, - { - "EndIndex": 123852, - "Kind": 3 - }, - { - "EndIndex": 123873, - "Kind": 3 - }, - { - "EndIndex": 123879, - "Kind": 3 - }, - { - "EndIndex": 123897, - "Kind": 3 - }, - { - "EndIndex": 123939, - "Kind": 3 - }, - { - "EndIndex": 124265, - "Kind": 3 - }, - { - "EndIndex": 124287, - "Kind": 3 - }, - { - "EndIndex": 124293, - "Kind": 3 - }, - { - "EndIndex": 124295, - "Kind": 3 - }, - { - "EndIndex": 124330, - "Kind": 3 - }, - { - "EndIndex": 124358, - "Kind": 3 - }, - { - "EndIndex": 124393, - "Kind": 3 - }, - { - "EndIndex": 124412, - "Kind": 3 - }, - { - "EndIndex": 124454, - "Kind": 3 - }, - { - "EndIndex": 124486, - "Kind": 3 - }, - { - "EndIndex": 124500, - "Kind": 3 - }, - { - "EndIndex": 124506, - "Kind": 3 - }, - { - "EndIndex": 124524, - "Kind": 3 - }, - { - "EndIndex": 124557, - "Kind": 3 - }, - { - "EndIndex": 124708, - "Kind": 3 - }, - { - "EndIndex": 124729, - "Kind": 3 - }, - { - "EndIndex": 124735, - "Kind": 3 - }, - { - "EndIndex": 124753, - "Kind": 3 - }, - { - "EndIndex": 124795, - "Kind": 3 - }, - { - "EndIndex": 125121, - "Kind": 3 - }, - { - "EndIndex": 125143, - "Kind": 3 - }, - { - "EndIndex": 125149, - "Kind": 3 - }, - { - "EndIndex": 125151, - "Kind": 3 - }, - { - "EndIndex": 125199, - "Kind": 3 - }, - { - "EndIndex": 125226, - "Kind": 3 - }, - { - "EndIndex": 125266, - "Kind": 3 - }, - { - "EndIndex": 125285, - "Kind": 3 - }, - { - "EndIndex": 125327, - "Kind": 3 - }, - { - "EndIndex": 125358, - "Kind": 3 - }, - { - "EndIndex": 125372, - "Kind": 3 - }, - { - "EndIndex": 125378, - "Kind": 3 - }, - { - "EndIndex": 125396, - "Kind": 3 - }, - { - "EndIndex": 125429, - "Kind": 3 - }, - { - "EndIndex": 125580, - "Kind": 3 - }, - { - "EndIndex": 125601, - "Kind": 3 - }, - { - "EndIndex": 125607, - "Kind": 3 - }, - { - "EndIndex": 125625, - "Kind": 3 - }, - { - "EndIndex": 125667, - "Kind": 3 - }, - { - "EndIndex": 125993, - "Kind": 3 - }, - { - "EndIndex": 126015, - "Kind": 3 - }, - { - "EndIndex": 126021, - "Kind": 3 - }, - { - "EndIndex": 126023, - "Kind": 3 - }, - { - "EndIndex": 126056, - "Kind": 3 - }, - { - "EndIndex": 126081, - "Kind": 3 - }, - { - "EndIndex": 126114, - "Kind": 3 - }, - { - "EndIndex": 126133, - "Kind": 3 - }, - { - "EndIndex": 126175, - "Kind": 3 - }, - { - "EndIndex": 126204, - "Kind": 3 - }, - { - "EndIndex": 126218, - "Kind": 3 - }, - { - "EndIndex": 126224, - "Kind": 3 - }, - { - "EndIndex": 126242, - "Kind": 3 - }, - { - "EndIndex": 126275, - "Kind": 3 - }, - { - "EndIndex": 126426, - "Kind": 3 - }, - { - "EndIndex": 126447, - "Kind": 3 - }, - { - "EndIndex": 126453, - "Kind": 3 - }, - { - "EndIndex": 126471, - "Kind": 3 - }, - { - "EndIndex": 126513, - "Kind": 3 - }, - { - "EndIndex": 126839, - "Kind": 3 - }, - { - "EndIndex": 126861, - "Kind": 3 - }, - { - "EndIndex": 126867, - "Kind": 3 - }, - { - "EndIndex": 126869, - "Kind": 3 - }, - { - "EndIndex": 126917, - "Kind": 3 - }, - { - "EndIndex": 126944, - "Kind": 3 - }, - { - "EndIndex": 126984, - "Kind": 3 - }, - { - "EndIndex": 127003, - "Kind": 3 - }, - { - "EndIndex": 127045, - "Kind": 3 - }, - { - "EndIndex": 127076, - "Kind": 3 - }, - { - "EndIndex": 127090, - "Kind": 3 - }, - { - "EndIndex": 127096, - "Kind": 3 - }, - { - "EndIndex": 127114, - "Kind": 3 - }, - { - "EndIndex": 127147, - "Kind": 3 - }, - { - "EndIndex": 127298, - "Kind": 3 - }, - { - "EndIndex": 127319, - "Kind": 3 - }, - { - "EndIndex": 127325, - "Kind": 3 - }, - { - "EndIndex": 127343, - "Kind": 3 - }, - { - "EndIndex": 127385, - "Kind": 3 - }, - { - "EndIndex": 127711, - "Kind": 3 - }, - { - "EndIndex": 127733, - "Kind": 3 - }, - { - "EndIndex": 127739, - "Kind": 3 - }, - { - "EndIndex": 127741, - "Kind": 3 - }, - { - "EndIndex": 127787, - "Kind": 3 - }, - { - "EndIndex": 127812, - "Kind": 3 - }, - { - "EndIndex": 127850, - "Kind": 3 - }, - { - "EndIndex": 127869, - "Kind": 3 - }, - { - "EndIndex": 127911, - "Kind": 3 - }, - { - "EndIndex": 127940, - "Kind": 3 - }, - { - "EndIndex": 127954, - "Kind": 3 - }, - { - "EndIndex": 127960, - "Kind": 3 - }, - { - "EndIndex": 127978, - "Kind": 3 - }, - { - "EndIndex": 128011, - "Kind": 3 - }, - { - "EndIndex": 128162, - "Kind": 3 - }, - { - "EndIndex": 128183, - "Kind": 3 - }, - { - "EndIndex": 128189, - "Kind": 3 - }, - { - "EndIndex": 128207, - "Kind": 3 - }, - { - "EndIndex": 128249, - "Kind": 3 - }, - { - "EndIndex": 128575, - "Kind": 3 - }, - { - "EndIndex": 128597, - "Kind": 3 - }, - { - "EndIndex": 128603, - "Kind": 3 - }, - { - "EndIndex": 128605, - "Kind": 3 - }, - { - "EndIndex": 128641, - "Kind": 3 - }, - { - "EndIndex": 128699, - "Kind": 3 - }, - { - "EndIndex": 128735, - "Kind": 3 - }, - { - "EndIndex": 128754, - "Kind": 3 - }, - { - "EndIndex": 128796, - "Kind": 3 - }, - { - "EndIndex": 128858, - "Kind": 3 - }, - { - "EndIndex": 128872, - "Kind": 3 - }, - { - "EndIndex": 128878, - "Kind": 3 - }, - { - "EndIndex": 128896, - "Kind": 3 - }, - { - "EndIndex": 128929, - "Kind": 3 - }, - { - "EndIndex": 129080, - "Kind": 3 - }, - { - "EndIndex": 129101, - "Kind": 3 - }, - { - "EndIndex": 129107, - "Kind": 3 - }, - { - "EndIndex": 129125, - "Kind": 3 - }, - { - "EndIndex": 129167, - "Kind": 3 - }, - { - "EndIndex": 129493, - "Kind": 3 - }, - { - "EndIndex": 129515, - "Kind": 3 - }, - { - "EndIndex": 129521, - "Kind": 3 - }, - { - "EndIndex": 129523, - "Kind": 3 - }, - { - "EndIndex": 129551, - "Kind": 3 - }, - { - "EndIndex": 129583, - "Kind": 3 - }, - { - "EndIndex": 129609, - "Kind": 3 - }, - { - "EndIndex": 129628, - "Kind": 3 - }, - { - "EndIndex": 129670, - "Kind": 3 - }, - { - "EndIndex": 129706, - "Kind": 3 - }, - { - "EndIndex": 129720, - "Kind": 3 - }, - { - "EndIndex": 129726, - "Kind": 3 - }, - { - "EndIndex": 129744, - "Kind": 3 - }, - { - "EndIndex": 129777, - "Kind": 3 - }, - { - "EndIndex": 129928, - "Kind": 3 - }, - { - "EndIndex": 129949, - "Kind": 3 - }, - { - "EndIndex": 129955, - "Kind": 3 - }, - { - "EndIndex": 129973, - "Kind": 3 - }, - { - "EndIndex": 130015, - "Kind": 3 - }, - { - "EndIndex": 130341, - "Kind": 3 - }, - { - "EndIndex": 130363, - "Kind": 3 - }, - { - "EndIndex": 130369, - "Kind": 3 - }, - { - "EndIndex": 130371, - "Kind": 3 - }, - { - "EndIndex": 130394, - "Kind": 3 - }, - { - "EndIndex": 130424, - "Kind": 3 - }, - { - "EndIndex": 130457, - "Kind": 3 - }, - { - "EndIndex": 130511, - "Kind": 3 - }, - { - "EndIndex": 130538, - "Kind": 3 - }, - { - "EndIndex": 130557, - "Kind": 3 - }, - { - "EndIndex": 130599, - "Kind": 3 - }, - { - "EndIndex": 130657, - "Kind": 3 - }, - { - "EndIndex": 130671, - "Kind": 3 - }, - { - "EndIndex": 130677, - "Kind": 3 - }, - { - "EndIndex": 130695, - "Kind": 3 - }, - { - "EndIndex": 130728, - "Kind": 3 - }, - { - "EndIndex": 130879, - "Kind": 3 - }, - { - "EndIndex": 130900, - "Kind": 3 - }, - { - "EndIndex": 130906, - "Kind": 3 - }, - { - "EndIndex": 130924, - "Kind": 3 - }, - { - "EndIndex": 130966, - "Kind": 3 - }, - { - "EndIndex": 131292, - "Kind": 3 - }, - { - "EndIndex": 131314, - "Kind": 3 - }, - { - "EndIndex": 131320, - "Kind": 3 - }, - { - "EndIndex": 131322, - "Kind": 3 - }, - { - "EndIndex": 131355, - "Kind": 3 - }, - { - "EndIndex": 131383, - "Kind": 3 - }, - { - "EndIndex": 131416, - "Kind": 3 - }, - { - "EndIndex": 131435, - "Kind": 3 - }, - { - "EndIndex": 131477, - "Kind": 3 - }, - { - "EndIndex": 131509, - "Kind": 3 - }, - { - "EndIndex": 131523, - "Kind": 3 - }, - { - "EndIndex": 131529, - "Kind": 3 - }, - { - "EndIndex": 131547, - "Kind": 3 - }, - { - "EndIndex": 131580, - "Kind": 3 - }, - { - "EndIndex": 131731, - "Kind": 3 - }, - { - "EndIndex": 131752, - "Kind": 3 - }, - { - "EndIndex": 131758, - "Kind": 3 - }, - { - "EndIndex": 131776, - "Kind": 3 - }, - { - "EndIndex": 131818, - "Kind": 3 - }, - { - "EndIndex": 132144, - "Kind": 3 - }, - { - "EndIndex": 132166, - "Kind": 3 - }, - { - "EndIndex": 132172, - "Kind": 3 - }, - { - "EndIndex": 132174, - "Kind": 3 - }, - { - "EndIndex": 132209, - "Kind": 3 - }, - { - "EndIndex": 132232, - "Kind": 3 - }, - { - "EndIndex": 132267, - "Kind": 3 - }, - { - "EndIndex": 132286, - "Kind": 3 - }, - { - "EndIndex": 132328, - "Kind": 3 - }, - { - "EndIndex": 132355, - "Kind": 3 - }, - { - "EndIndex": 132369, - "Kind": 3 - }, - { - "EndIndex": 132375, - "Kind": 3 - }, - { - "EndIndex": 132393, - "Kind": 3 - }, - { - "EndIndex": 132426, - "Kind": 3 - }, - { - "EndIndex": 132577, - "Kind": 3 - }, - { - "EndIndex": 132598, - "Kind": 3 - }, - { - "EndIndex": 132604, - "Kind": 3 - }, - { - "EndIndex": 132622, - "Kind": 3 - }, - { - "EndIndex": 132664, - "Kind": 3 - }, - { - "EndIndex": 132990, - "Kind": 3 - }, - { - "EndIndex": 133012, - "Kind": 3 - }, - { - "EndIndex": 133018, - "Kind": 3 - }, - { - "EndIndex": 133020, - "Kind": 3 - }, - { - "EndIndex": 133064, - "Kind": 3 - }, - { - "EndIndex": 133104, - "Kind": 3 - }, - { - "EndIndex": 133140, - "Kind": 3 - }, - { - "EndIndex": 133159, - "Kind": 3 - }, - { - "EndIndex": 133201, - "Kind": 3 - }, - { - "EndIndex": 133245, - "Kind": 3 - }, - { - "EndIndex": 133259, - "Kind": 3 - }, - { - "EndIndex": 133265, - "Kind": 3 - }, - { - "EndIndex": 133283, - "Kind": 3 - }, - { - "EndIndex": 133316, - "Kind": 3 - }, - { - "EndIndex": 133467, - "Kind": 3 - }, - { - "EndIndex": 133488, - "Kind": 3 - }, - { - "EndIndex": 133494, - "Kind": 3 - }, - { - "EndIndex": 133512, - "Kind": 3 - }, - { - "EndIndex": 133554, - "Kind": 3 - }, - { - "EndIndex": 133880, - "Kind": 3 - }, - { - "EndIndex": 133902, - "Kind": 3 - }, - { - "EndIndex": 133908, - "Kind": 3 - }, - { - "EndIndex": 133910, - "Kind": 3 - }, - { - "EndIndex": 133941, - "Kind": 3 - }, - { - "EndIndex": 134035, - "Kind": 3 - }, - { - "EndIndex": 134066, - "Kind": 3 - }, - { - "EndIndex": 134085, - "Kind": 3 - }, - { - "EndIndex": 134127, - "Kind": 3 - }, - { - "EndIndex": 134225, - "Kind": 3 - }, - { - "EndIndex": 134239, - "Kind": 3 - }, - { - "EndIndex": 134245, - "Kind": 3 - }, - { - "EndIndex": 134263, - "Kind": 3 - }, - { - "EndIndex": 134296, - "Kind": 3 - }, - { - "EndIndex": 134447, - "Kind": 3 - }, - { - "EndIndex": 134468, - "Kind": 3 - }, - { - "EndIndex": 134474, - "Kind": 3 - }, - { - "EndIndex": 134492, - "Kind": 3 - }, - { - "EndIndex": 134534, - "Kind": 3 - }, - { - "EndIndex": 134860, - "Kind": 3 - }, - { - "EndIndex": 134882, - "Kind": 3 - }, - { - "EndIndex": 134888, - "Kind": 3 - }, - { - "EndIndex": 134890, - "Kind": 3 - }, - { - "EndIndex": 134927, - "Kind": 3 - }, - { - "EndIndex": 134965, - "Kind": 3 - }, - { - "EndIndex": 134996, - "Kind": 3 - }, - { - "EndIndex": 135015, - "Kind": 3 - }, - { - "EndIndex": 135057, - "Kind": 3 - }, - { - "EndIndex": 135099, - "Kind": 3 - }, - { - "EndIndex": 135113, - "Kind": 3 - }, - { - "EndIndex": 135119, - "Kind": 3 - }, - { - "EndIndex": 135137, - "Kind": 3 - }, - { - "EndIndex": 135170, - "Kind": 3 - }, - { - "EndIndex": 135321, - "Kind": 3 - }, - { - "EndIndex": 135342, - "Kind": 3 - }, - { - "EndIndex": 135348, - "Kind": 3 - }, - { - "EndIndex": 135366, - "Kind": 3 - }, - { - "EndIndex": 135408, - "Kind": 3 - }, - { - "EndIndex": 135734, - "Kind": 3 - }, - { - "EndIndex": 135756, - "Kind": 3 - }, - { - "EndIndex": 135762, - "Kind": 3 - }, - { - "EndIndex": 135764, - "Kind": 3 - }, - { - "EndIndex": 135785, - "Kind": 3 - }, - { - "EndIndex": 135816, - "Kind": 3 - }, - { - "EndIndex": 135879, - "Kind": 3 - }, - { - "EndIndex": 135908, - "Kind": 3 - }, - { - "EndIndex": 135927, - "Kind": 3 - }, - { - "EndIndex": 135969, - "Kind": 3 - }, - { - "EndIndex": 136036, - "Kind": 3 - }, - { - "EndIndex": 136050, - "Kind": 3 - }, - { - "EndIndex": 136056, - "Kind": 3 - }, - { - "EndIndex": 136074, - "Kind": 3 - }, - { - "EndIndex": 136107, - "Kind": 3 - }, - { - "EndIndex": 136258, - "Kind": 3 - }, - { - "EndIndex": 136279, - "Kind": 3 - }, - { - "EndIndex": 136285, - "Kind": 3 - }, - { - "EndIndex": 136312, - "Kind": 3 - }, - { - "EndIndex": 136342, - "Kind": 3 - }, - { - "EndIndex": 136348, - "Kind": 3 - }, - { - "EndIndex": 136372, - "Kind": 3 - }, - { - "EndIndex": 136401, - "Kind": 3 - }, - { - "EndIndex": 136420, - "Kind": 3 - }, - { - "EndIndex": 136426, - "Kind": 3 - }, - { - "EndIndex": 136444, - "Kind": 3 - }, - { - "EndIndex": 136486, - "Kind": 3 - }, - { - "EndIndex": 136812, - "Kind": 3 - }, - { - "EndIndex": 136834, - "Kind": 3 - }, - { - "EndIndex": 136840, - "Kind": 3 - }, - { - "EndIndex": 136855, - "Kind": 3 - }, - { - "EndIndex": 136875, - "Kind": 3 - }, - { - "EndIndex": 136904, - "Kind": 3 - }, - { - "EndIndex": 136918, - "Kind": 3 - }, - { - "EndIndex": 136924, - "Kind": 3 - }, - { - "EndIndex": 136939, - "Kind": 3 - }, - { - "EndIndex": 136960, - "Kind": 3 - }, - { - "EndIndex": 136983, - "Kind": 3 - }, - { - "EndIndex": 136997, - "Kind": 3 - }, - { - "EndIndex": 137003, - "Kind": 3 - }, - { - "EndIndex": 137018, - "Kind": 3 - }, - { - "EndIndex": 137039, - "Kind": 3 - }, - { - "EndIndex": 137062, - "Kind": 3 - }, - { - "EndIndex": 137076, - "Kind": 3 - }, - { - "EndIndex": 137082, - "Kind": 3 - }, - { - "EndIndex": 137084, - "Kind": 3 - }, - { - "EndIndex": 137115, - "Kind": 3 - }, - { - "EndIndex": 137188, - "Kind": 3 - }, - { - "EndIndex": 137219, - "Kind": 3 - }, - { - "EndIndex": 137238, - "Kind": 3 - }, - { - "EndIndex": 137280, - "Kind": 3 - }, - { - "EndIndex": 137357, - "Kind": 3 - }, - { - "EndIndex": 137371, - "Kind": 3 - }, - { - "EndIndex": 137377, - "Kind": 3 - }, - { - "EndIndex": 137395, - "Kind": 3 - }, - { - "EndIndex": 137428, - "Kind": 3 - }, - { - "EndIndex": 137579, - "Kind": 3 - }, - { - "EndIndex": 137600, - "Kind": 3 - }, - { - "EndIndex": 137606, - "Kind": 3 - }, - { - "EndIndex": 137624, - "Kind": 3 - }, - { - "EndIndex": 137666, - "Kind": 3 - }, - { - "EndIndex": 137992, - "Kind": 3 - }, - { - "EndIndex": 138014, - "Kind": 3 - }, - { - "EndIndex": 138020, - "Kind": 3 - }, - { - "EndIndex": 138022, - "Kind": 3 - }, - { - "EndIndex": 138060, - "Kind": 3 - }, - { - "EndIndex": 138089, - "Kind": 3 - }, - { - "EndIndex": 138123, - "Kind": 3 - }, - { - "EndIndex": 138142, - "Kind": 3 - }, - { - "EndIndex": 138184, - "Kind": 3 - }, - { - "EndIndex": 138217, - "Kind": 3 - }, - { - "EndIndex": 138231, - "Kind": 3 - }, - { - "EndIndex": 138237, - "Kind": 3 - }, - { - "EndIndex": 138255, - "Kind": 3 - }, - { - "EndIndex": 138288, - "Kind": 3 - }, - { - "EndIndex": 138439, - "Kind": 3 - }, - { - "EndIndex": 138460, - "Kind": 3 - }, - { - "EndIndex": 138466, - "Kind": 3 - }, - { - "EndIndex": 138484, - "Kind": 3 - }, - { - "EndIndex": 138526, - "Kind": 3 - }, - { - "EndIndex": 138852, - "Kind": 3 - }, - { - "EndIndex": 138874, - "Kind": 3 - }, - { - "EndIndex": 138880, - "Kind": 3 - }, - { - "EndIndex": 138882, - "Kind": 3 - }, - { - "EndIndex": 138914, - "Kind": 3 - }, - { - "EndIndex": 138950, - "Kind": 3 - }, - { - "EndIndex": 138978, - "Kind": 3 - }, - { - "EndIndex": 138997, - "Kind": 3 - }, - { - "EndIndex": 139039, - "Kind": 3 - }, - { - "EndIndex": 139079, - "Kind": 3 - }, - { - "EndIndex": 139093, - "Kind": 3 - }, - { - "EndIndex": 139099, - "Kind": 3 - }, - { - "EndIndex": 139117, - "Kind": 3 - }, - { - "EndIndex": 139150, - "Kind": 3 - }, - { - "EndIndex": 139301, - "Kind": 3 - }, - { - "EndIndex": 139322, - "Kind": 3 - }, - { - "EndIndex": 139328, - "Kind": 3 - }, - { - "EndIndex": 139346, - "Kind": 3 - }, - { - "EndIndex": 139388, - "Kind": 3 - }, - { - "EndIndex": 139714, - "Kind": 3 - }, - { - "EndIndex": 139736, - "Kind": 3 - }, - { - "EndIndex": 139742, - "Kind": 3 - }, - { - "EndIndex": 139744, - "Kind": 3 - }, - { - "EndIndex": 139778, - "Kind": 3 - }, - { - "EndIndex": 139808, - "Kind": 3 - }, - { - "EndIndex": 139842, - "Kind": 3 - }, - { - "EndIndex": 139861, - "Kind": 3 - }, - { - "EndIndex": 139903, - "Kind": 3 - }, - { - "EndIndex": 139937, - "Kind": 3 - }, - { - "EndIndex": 139951, - "Kind": 3 - }, - { - "EndIndex": 139957, - "Kind": 3 - }, - { - "EndIndex": 139975, - "Kind": 3 - }, - { - "EndIndex": 140008, - "Kind": 3 - }, - { - "EndIndex": 140159, - "Kind": 3 - }, - { - "EndIndex": 140180, - "Kind": 3 - }, - { - "EndIndex": 140186, - "Kind": 3 - }, - { - "EndIndex": 140204, - "Kind": 3 - }, - { - "EndIndex": 140246, - "Kind": 3 - }, - { - "EndIndex": 140572, - "Kind": 3 - }, - { - "EndIndex": 140594, - "Kind": 3 - }, - { - "EndIndex": 140600, - "Kind": 3 - }, - { - "EndIndex": 140602, - "Kind": 3 - }, - { - "EndIndex": 140637, - "Kind": 3 - }, - { - "EndIndex": 140683, - "Kind": 3 - }, - { - "EndIndex": 140718, - "Kind": 3 - }, - { - "EndIndex": 140737, - "Kind": 3 - }, - { - "EndIndex": 140779, - "Kind": 3 - }, - { - "EndIndex": 140829, - "Kind": 3 - }, - { - "EndIndex": 140843, - "Kind": 3 - }, - { - "EndIndex": 140849, - "Kind": 3 - }, - { - "EndIndex": 140867, - "Kind": 3 - }, - { - "EndIndex": 140900, - "Kind": 3 - }, - { - "EndIndex": 141051, - "Kind": 3 - }, - { - "EndIndex": 141072, - "Kind": 3 - }, - { - "EndIndex": 141078, - "Kind": 3 - }, - { - "EndIndex": 141096, - "Kind": 3 - }, - { - "EndIndex": 141138, - "Kind": 3 - }, - { - "EndIndex": 141464, - "Kind": 3 - }, - { - "EndIndex": 141486, - "Kind": 3 - }, - { - "EndIndex": 141492, - "Kind": 3 - }, - { - "EndIndex": 141494, - "Kind": 3 - }, - { - "EndIndex": 141524, - "Kind": 3 - }, - { - "EndIndex": 141554, - "Kind": 3 - }, - { - "EndIndex": 141580, - "Kind": 3 - }, - { - "EndIndex": 141599, - "Kind": 3 - }, - { - "EndIndex": 141641, - "Kind": 3 - }, - { - "EndIndex": 141675, - "Kind": 3 - }, - { - "EndIndex": 141689, - "Kind": 3 - }, - { - "EndIndex": 141695, - "Kind": 3 - }, - { - "EndIndex": 141713, - "Kind": 3 - }, - { - "EndIndex": 141746, - "Kind": 3 - }, - { - "EndIndex": 141897, - "Kind": 3 - }, - { - "EndIndex": 141918, - "Kind": 3 - }, - { - "EndIndex": 141924, - "Kind": 3 - }, - { - "EndIndex": 141948, - "Kind": 3 - }, - { - "EndIndex": 141977, - "Kind": 3 - }, - { - "EndIndex": 141996, - "Kind": 3 - }, - { - "EndIndex": 142002, - "Kind": 3 - }, - { - "EndIndex": 142020, - "Kind": 3 - }, - { - "EndIndex": 142062, - "Kind": 3 - }, - { - "EndIndex": 142388, - "Kind": 3 - }, - { - "EndIndex": 142410, - "Kind": 3 - }, - { - "EndIndex": 142416, - "Kind": 3 - }, - { - "EndIndex": 142418, - "Kind": 3 - }, - { - "EndIndex": 142459, - "Kind": 3 - }, - { - "EndIndex": 142495, - "Kind": 3 - }, - { - "EndIndex": 142530, - "Kind": 3 - }, - { - "EndIndex": 142549, - "Kind": 3 - }, - { - "EndIndex": 142591, - "Kind": 3 - }, - { - "EndIndex": 142631, - "Kind": 3 - }, - { - "EndIndex": 142645, - "Kind": 3 - }, - { - "EndIndex": 142651, - "Kind": 3 - }, - { - "EndIndex": 142669, - "Kind": 3 - }, - { - "EndIndex": 142702, - "Kind": 3 - }, - { - "EndIndex": 142853, - "Kind": 3 - }, - { - "EndIndex": 142874, - "Kind": 3 - }, - { - "EndIndex": 142880, - "Kind": 3 - }, - { - "EndIndex": 142898, - "Kind": 3 - }, - { - "EndIndex": 142940, - "Kind": 3 - }, - { - "EndIndex": 143266, - "Kind": 3 - }, - { - "EndIndex": 143288, - "Kind": 3 - }, - { - "EndIndex": 143294, - "Kind": 3 - }, - { - "EndIndex": 143296, - "Kind": 3 - }, - { - "EndIndex": 143327, - "Kind": 3 - }, - { - "EndIndex": 143364, - "Kind": 3 - }, - { - "EndIndex": 143393, - "Kind": 3 - }, - { - "EndIndex": 143412, - "Kind": 3 - }, - { - "EndIndex": 143454, - "Kind": 3 - }, - { - "EndIndex": 143495, - "Kind": 3 - }, - { - "EndIndex": 143509, - "Kind": 3 - }, - { - "EndIndex": 143515, - "Kind": 3 - }, - { - "EndIndex": 143533, - "Kind": 3 - }, - { - "EndIndex": 143566, - "Kind": 3 - }, - { - "EndIndex": 143717, - "Kind": 3 - }, - { - "EndIndex": 143738, - "Kind": 3 - }, - { - "EndIndex": 143744, - "Kind": 3 - }, - { - "EndIndex": 143762, - "Kind": 3 - }, - { - "EndIndex": 143804, - "Kind": 3 - }, - { - "EndIndex": 144130, - "Kind": 3 - }, - { - "EndIndex": 144152, - "Kind": 3 - }, - { - "EndIndex": 144158, - "Kind": 3 - }, - { - "EndIndex": 144160, - "Kind": 3 - }, - { - "EndIndex": 144191, - "Kind": 3 - }, - { - "EndIndex": 144213, - "Kind": 3 - }, - { - "EndIndex": 144242, - "Kind": 3 - }, - { - "EndIndex": 144261, - "Kind": 3 - }, - { - "EndIndex": 144303, - "Kind": 3 - }, - { - "EndIndex": 144329, - "Kind": 3 - }, - { - "EndIndex": 144343, - "Kind": 3 - }, - { - "EndIndex": 144349, - "Kind": 3 - }, - { - "EndIndex": 144367, - "Kind": 3 - }, - { - "EndIndex": 144400, - "Kind": 3 - }, - { - "EndIndex": 144551, - "Kind": 3 - }, - { - "EndIndex": 144572, - "Kind": 3 - }, - { - "EndIndex": 144578, - "Kind": 3 - }, - { - "EndIndex": 144596, - "Kind": 3 - }, - { - "EndIndex": 144638, - "Kind": 3 - }, - { - "EndIndex": 144964, - "Kind": 3 - }, - { - "EndIndex": 144986, - "Kind": 3 - }, - { - "EndIndex": 144992, - "Kind": 3 - }, - { - "EndIndex": 144994, - "Kind": 3 - }, - { - "EndIndex": 145035, - "Kind": 3 - }, - { - "EndIndex": 145060, - "Kind": 3 - }, - { - "EndIndex": 145097, - "Kind": 3 - }, - { - "EndIndex": 145116, - "Kind": 3 - }, - { - "EndIndex": 145158, - "Kind": 3 - }, - { - "EndIndex": 145187, - "Kind": 3 - }, - { - "EndIndex": 145201, - "Kind": 3 - }, - { - "EndIndex": 145207, - "Kind": 3 - }, - { - "EndIndex": 145225, - "Kind": 3 - }, - { - "EndIndex": 145258, - "Kind": 3 - }, - { - "EndIndex": 145409, - "Kind": 3 - }, - { - "EndIndex": 145430, - "Kind": 3 - }, - { - "EndIndex": 145436, - "Kind": 3 - }, - { - "EndIndex": 145454, - "Kind": 3 - }, - { - "EndIndex": 145496, - "Kind": 3 - }, - { - "EndIndex": 145822, - "Kind": 3 - }, - { - "EndIndex": 145844, - "Kind": 3 - }, - { - "EndIndex": 145850, - "Kind": 3 - }, - { - "EndIndex": 145852, - "Kind": 3 - }, - { - "EndIndex": 145881, - "Kind": 3 - }, - { - "EndIndex": 145913, - "Kind": 3 - }, - { - "EndIndex": 145940, - "Kind": 3 - }, - { - "EndIndex": 145959, - "Kind": 3 - }, - { - "EndIndex": 146001, - "Kind": 3 - }, - { - "EndIndex": 146037, - "Kind": 3 - }, - { - "EndIndex": 146051, - "Kind": 3 - }, - { - "EndIndex": 146057, - "Kind": 3 - }, - { - "EndIndex": 146075, - "Kind": 3 - }, - { - "EndIndex": 146108, - "Kind": 3 - }, - { - "EndIndex": 146259, - "Kind": 3 - }, - { - "EndIndex": 146280, - "Kind": 3 - }, - { - "EndIndex": 146286, - "Kind": 3 - }, - { - "EndIndex": 146304, - "Kind": 3 - }, - { - "EndIndex": 146346, - "Kind": 3 - }, - { - "EndIndex": 146672, - "Kind": 3 - }, - { - "EndIndex": 146694, - "Kind": 3 - }, - { - "EndIndex": 146700, - "Kind": 3 - }, - { - "EndIndex": 146702, - "Kind": 3 - }, - { - "EndIndex": 146738, - "Kind": 3 - }, - { - "EndIndex": 146782, - "Kind": 3 - }, - { - "EndIndex": 146818, - "Kind": 3 - }, - { - "EndIndex": 146837, - "Kind": 3 - }, - { - "EndIndex": 146879, - "Kind": 3 - }, - { - "EndIndex": 146927, - "Kind": 3 - }, - { - "EndIndex": 146941, - "Kind": 3 - }, - { - "EndIndex": 146947, - "Kind": 3 - }, - { - "EndIndex": 146965, - "Kind": 3 - }, - { - "EndIndex": 146998, - "Kind": 3 - }, - { - "EndIndex": 147149, - "Kind": 3 - }, - { - "EndIndex": 147170, - "Kind": 3 - }, - { - "EndIndex": 147176, - "Kind": 3 - }, - { - "EndIndex": 147194, - "Kind": 3 - }, - { - "EndIndex": 147236, - "Kind": 3 - }, - { - "EndIndex": 147562, - "Kind": 3 - }, - { - "EndIndex": 147584, - "Kind": 3 - }, - { - "EndIndex": 147590, - "Kind": 3 - }, - { - "EndIndex": 147592, - "Kind": 3 - }, - { - "EndIndex": 147631, - "Kind": 3 - }, - { - "EndIndex": 147673, - "Kind": 3 - }, - { - "EndIndex": 147728, - "Kind": 3 - }, - { - "EndIndex": 147765, - "Kind": 3 - }, - { - "EndIndex": 147784, - "Kind": 3 - }, - { - "EndIndex": 147826, - "Kind": 3 - }, - { - "EndIndex": 147885, - "Kind": 3 - }, - { - "EndIndex": 147899, - "Kind": 3 - }, - { - "EndIndex": 147905, - "Kind": 3 - }, - { - "EndIndex": 147923, - "Kind": 3 - }, - { - "EndIndex": 147956, - "Kind": 3 - }, - { - "EndIndex": 148107, - "Kind": 3 - }, - { - "EndIndex": 148128, - "Kind": 3 - }, - { - "EndIndex": 148134, - "Kind": 3 - }, - { - "EndIndex": 148152, - "Kind": 3 - }, - { - "EndIndex": 148194, - "Kind": 3 - }, - { - "EndIndex": 148520, - "Kind": 3 - }, - { - "EndIndex": 148542, - "Kind": 3 - }, - { - "EndIndex": 148548, - "Kind": 3 - }, - { - "EndIndex": 148550, - "Kind": 3 - }, - { - "EndIndex": 148577, - "Kind": 3 - }, - { - "EndIndex": 148619, - "Kind": 3 - }, - { - "EndIndex": 148644, - "Kind": 3 - }, - { - "EndIndex": 148663, - "Kind": 3 - }, - { - "EndIndex": 148705, - "Kind": 3 - }, - { - "EndIndex": 148751, - "Kind": 3 - }, - { - "EndIndex": 148765, - "Kind": 3 - }, - { - "EndIndex": 148771, - "Kind": 3 - }, - { - "EndIndex": 148789, - "Kind": 3 - }, - { - "EndIndex": 148822, - "Kind": 3 - }, - { - "EndIndex": 148973, - "Kind": 3 - }, - { - "EndIndex": 148994, - "Kind": 3 - }, - { - "EndIndex": 149000, - "Kind": 3 - }, - { - "EndIndex": 149027, - "Kind": 3 - }, - { - "EndIndex": 149057, - "Kind": 3 - }, - { - "EndIndex": 149063, - "Kind": 3 - }, - { - "EndIndex": 149087, - "Kind": 3 - }, - { - "EndIndex": 149116, - "Kind": 3 - }, - { - "EndIndex": 149135, - "Kind": 3 - }, - { - "EndIndex": 149141, - "Kind": 3 - }, - { - "EndIndex": 149159, - "Kind": 3 - }, - { - "EndIndex": 149201, - "Kind": 3 - }, - { - "EndIndex": 149527, - "Kind": 3 - }, - { - "EndIndex": 149549, - "Kind": 3 - }, - { - "EndIndex": 149555, - "Kind": 3 - }, - { - "EndIndex": 149570, - "Kind": 3 - }, - { - "EndIndex": 149605, - "Kind": 3 - }, - { - "EndIndex": 149619, - "Kind": 3 - }, - { - "EndIndex": 149625, - "Kind": 3 - }, - { - "EndIndex": 149640, - "Kind": 3 - }, - { - "EndIndex": 149662, - "Kind": 3 - }, - { - "EndIndex": 149694, - "Kind": 3 - }, - { - "EndIndex": 149708, - "Kind": 3 - }, - { - "EndIndex": 149714, - "Kind": 3 - }, - { - "EndIndex": 149729, - "Kind": 3 - }, - { - "EndIndex": 149754, - "Kind": 3 - }, - { - "EndIndex": 149784, - "Kind": 3 - }, - { - "EndIndex": 149798, - "Kind": 3 - }, - { - "EndIndex": 149804, - "Kind": 3 - }, - { - "EndIndex": 149819, - "Kind": 3 - }, - { - "EndIndex": 149845, - "Kind": 3 - }, - { - "EndIndex": 149882, - "Kind": 3 - }, - { - "EndIndex": 149896, - "Kind": 3 - }, - { - "EndIndex": 149902, - "Kind": 3 - }, - { - "EndIndex": 149917, - "Kind": 3 - }, - { - "EndIndex": 149942, - "Kind": 3 - }, - { - "EndIndex": 149972, - "Kind": 3 - }, - { - "EndIndex": 149986, - "Kind": 3 - }, - { - "EndIndex": 149992, - "Kind": 3 - }, - { - "EndIndex": 150007, - "Kind": 3 - }, - { - "EndIndex": 150032, - "Kind": 3 - }, - { - "EndIndex": 150064, - "Kind": 3 - }, - { - "EndIndex": 150078, - "Kind": 3 - }, - { - "EndIndex": 150084, - "Kind": 3 - }, - { - "EndIndex": 150086, - "Kind": 3 - }, - { - "EndIndex": 150125, - "Kind": 3 - }, - { - "EndIndex": 150168, - "Kind": 3 - }, - { - "EndIndex": 150199, - "Kind": 3 - }, - { - "EndIndex": 150218, - "Kind": 3 - }, - { - "EndIndex": 150260, - "Kind": 3 - }, - { - "EndIndex": 150307, - "Kind": 3 - }, - { - "EndIndex": 150321, - "Kind": 3 - }, - { - "EndIndex": 150327, - "Kind": 3 - }, - { - "EndIndex": 150345, - "Kind": 3 - }, - { - "EndIndex": 150378, - "Kind": 3 - }, - { - "EndIndex": 150529, - "Kind": 3 - }, - { - "EndIndex": 150550, - "Kind": 3 - }, - { - "EndIndex": 150556, - "Kind": 3 - }, - { - "EndIndex": 150574, - "Kind": 3 - }, - { - "EndIndex": 150616, - "Kind": 3 - }, - { - "EndIndex": 150942, - "Kind": 3 - }, - { - "EndIndex": 150964, - "Kind": 3 - }, - { - "EndIndex": 150970, - "Kind": 3 - }, - { - "EndIndex": 150972, - "Kind": 3 - }, - { - "EndIndex": 151015, - "Kind": 3 - }, - { - "EndIndex": 151102, - "Kind": 3 - }, - { - "EndIndex": 151145, - "Kind": 3 - }, - { - "EndIndex": 151164, - "Kind": 3 - }, - { - "EndIndex": 151206, - "Kind": 3 - }, - { - "EndIndex": 151297, - "Kind": 3 - }, - { - "EndIndex": 151311, - "Kind": 3 - }, - { - "EndIndex": 151317, - "Kind": 3 - }, - { - "EndIndex": 151335, - "Kind": 3 - }, - { - "EndIndex": 151368, - "Kind": 3 - }, - { - "EndIndex": 151519, - "Kind": 3 - }, - { - "EndIndex": 151540, - "Kind": 3 - }, - { - "EndIndex": 151546, - "Kind": 3 - }, - { - "EndIndex": 151564, - "Kind": 3 - }, - { - "EndIndex": 151606, - "Kind": 3 - }, - { - "EndIndex": 151932, - "Kind": 3 - }, - { - "EndIndex": 151954, - "Kind": 3 - }, - { - "EndIndex": 151960, - "Kind": 3 - }, - { - "EndIndex": 151962, - "Kind": 3 - }, - { - "EndIndex": 151995, - "Kind": 3 - }, - { - "EndIndex": 152026, - "Kind": 3 - }, - { - "EndIndex": 152059, - "Kind": 3 - }, - { - "EndIndex": 152078, - "Kind": 3 - }, - { - "EndIndex": 152120, - "Kind": 3 - }, - { - "EndIndex": 152155, - "Kind": 3 - }, - { - "EndIndex": 152169, - "Kind": 3 - }, - { - "EndIndex": 152175, - "Kind": 3 - }, - { - "EndIndex": 152193, - "Kind": 3 - }, - { - "EndIndex": 152226, - "Kind": 3 - }, - { - "EndIndex": 152377, - "Kind": 3 - }, - { - "EndIndex": 152398, - "Kind": 3 - }, - { - "EndIndex": 152404, - "Kind": 3 - }, - { - "EndIndex": 152422, - "Kind": 3 - }, - { - "EndIndex": 152464, - "Kind": 3 - }, - { - "EndIndex": 152790, - "Kind": 3 - }, - { - "EndIndex": 152812, - "Kind": 3 - }, - { - "EndIndex": 152818, - "Kind": 3 - }, - { - "EndIndex": 152820, - "Kind": 3 - }, - { - "EndIndex": 152856, - "Kind": 3 - }, - { - "EndIndex": 152882, - "Kind": 3 - }, - { - "EndIndex": 152918, - "Kind": 3 - }, - { - "EndIndex": 152937, - "Kind": 3 - }, - { - "EndIndex": 152979, - "Kind": 3 - }, - { - "EndIndex": 153009, - "Kind": 3 - }, - { - "EndIndex": 153023, - "Kind": 3 - }, - { - "EndIndex": 153029, - "Kind": 3 - }, - { - "EndIndex": 153047, - "Kind": 3 - }, - { - "EndIndex": 153080, - "Kind": 3 - }, - { - "EndIndex": 153231, - "Kind": 3 - }, - { - "EndIndex": 153252, - "Kind": 3 - }, - { - "EndIndex": 153258, - "Kind": 3 - }, - { - "EndIndex": 153276, - "Kind": 3 - }, - { - "EndIndex": 153318, - "Kind": 3 - }, - { - "EndIndex": 153644, - "Kind": 3 - }, - { - "EndIndex": 153666, - "Kind": 3 - }, - { - "EndIndex": 153672, - "Kind": 3 - }, - { - "EndIndex": 153674, - "Kind": 3 - }, - { - "EndIndex": 153711, - "Kind": 3 - }, - { - "EndIndex": 153744, - "Kind": 3 - }, - { - "EndIndex": 153776, - "Kind": 3 - }, - { - "EndIndex": 153795, - "Kind": 3 - }, - { - "EndIndex": 153837, - "Kind": 3 - }, - { - "EndIndex": 153874, - "Kind": 3 - }, - { - "EndIndex": 153888, - "Kind": 3 - }, - { - "EndIndex": 153894, - "Kind": 3 - }, - { - "EndIndex": 153912, - "Kind": 3 - }, - { - "EndIndex": 153945, - "Kind": 3 - }, - { - "EndIndex": 154096, - "Kind": 3 - }, - { - "EndIndex": 154117, - "Kind": 3 - }, - { - "EndIndex": 154123, - "Kind": 3 - }, - { - "EndIndex": 154141, - "Kind": 3 - }, - { - "EndIndex": 154183, - "Kind": 3 - }, - { - "EndIndex": 154509, - "Kind": 3 - }, - { - "EndIndex": 154531, - "Kind": 3 - }, - { - "EndIndex": 154537, - "Kind": 3 - }, - { - "EndIndex": 154539, - "Kind": 3 - }, - { - "EndIndex": 154573, - "Kind": 3 - }, - { - "EndIndex": 154626, - "Kind": 3 - }, - { - "EndIndex": 154658, - "Kind": 3 - }, - { - "EndIndex": 154677, - "Kind": 3 - }, - { - "EndIndex": 154719, - "Kind": 3 - }, - { - "EndIndex": 154776, - "Kind": 3 - }, - { - "EndIndex": 154790, - "Kind": 3 - }, - { - "EndIndex": 154796, - "Kind": 3 - }, - { - "EndIndex": 154814, - "Kind": 3 - }, - { - "EndIndex": 154847, - "Kind": 3 - }, - { - "EndIndex": 154998, - "Kind": 3 - }, - { - "EndIndex": 155019, - "Kind": 3 - }, - { - "EndIndex": 155025, - "Kind": 3 - }, - { - "EndIndex": 155043, - "Kind": 3 - }, - { - "EndIndex": 155085, - "Kind": 3 - }, - { - "EndIndex": 155411, - "Kind": 3 - }, - { - "EndIndex": 155433, - "Kind": 3 - }, - { - "EndIndex": 155439, - "Kind": 3 - }, - { - "EndIndex": 155441, - "Kind": 3 - }, - { - "EndIndex": 155474, - "Kind": 3 - }, - { - "EndIndex": 155527, - "Kind": 3 - }, - { - "EndIndex": 155560, - "Kind": 3 - }, - { - "EndIndex": 155579, - "Kind": 3 - }, - { - "EndIndex": 155621, - "Kind": 3 - }, - { - "EndIndex": 155678, - "Kind": 3 - }, - { - "EndIndex": 155692, - "Kind": 3 - }, - { - "EndIndex": 155698, - "Kind": 3 - }, - { - "EndIndex": 155716, - "Kind": 3 - }, - { - "EndIndex": 155749, - "Kind": 3 - }, - { - "EndIndex": 155900, - "Kind": 3 - }, - { - "EndIndex": 155921, - "Kind": 3 - }, - { - "EndIndex": 155927, - "Kind": 3 - }, - { - "EndIndex": 155945, - "Kind": 3 - }, - { - "EndIndex": 155987, - "Kind": 3 - }, - { - "EndIndex": 156313, - "Kind": 3 - }, - { - "EndIndex": 156335, - "Kind": 3 - }, - { - "EndIndex": 156341, - "Kind": 3 - }, - { - "EndIndex": 156343, - "Kind": 3 - }, - { - "EndIndex": 156375, - "Kind": 3 - }, - { - "EndIndex": 156410, - "Kind": 3 - }, - { - "EndIndex": 156440, - "Kind": 3 - }, - { - "EndIndex": 156459, - "Kind": 3 - }, - { - "EndIndex": 156501, - "Kind": 3 - }, - { - "EndIndex": 156540, - "Kind": 3 - }, - { - "EndIndex": 156554, - "Kind": 3 - }, - { - "EndIndex": 156560, - "Kind": 3 - }, - { - "EndIndex": 156578, - "Kind": 3 - }, - { - "EndIndex": 156611, - "Kind": 3 - }, - { - "EndIndex": 156762, - "Kind": 3 - }, - { - "EndIndex": 156783, - "Kind": 3 - }, - { - "EndIndex": 156789, - "Kind": 3 - }, - { - "EndIndex": 156807, - "Kind": 3 - }, - { - "EndIndex": 156849, - "Kind": 3 - }, - { - "EndIndex": 157175, - "Kind": 3 - }, - { - "EndIndex": 157197, - "Kind": 3 - }, - { - "EndIndex": 157203, - "Kind": 3 - }, - { - "EndIndex": 157205, - "Kind": 3 - }, - { - "EndIndex": 157237, - "Kind": 3 - }, - { - "EndIndex": 157300, - "Kind": 3 - }, - { - "EndIndex": 157332, - "Kind": 3 - }, - { - "EndIndex": 157351, - "Kind": 3 - }, - { - "EndIndex": 157393, - "Kind": 3 - }, - { - "EndIndex": 157460, - "Kind": 3 - }, - { - "EndIndex": 157474, - "Kind": 3 - }, - { - "EndIndex": 157480, - "Kind": 3 - }, - { - "EndIndex": 157498, - "Kind": 3 - }, - { - "EndIndex": 157531, - "Kind": 3 - }, - { - "EndIndex": 157682, - "Kind": 3 - }, - { - "EndIndex": 157703, - "Kind": 3 - }, - { - "EndIndex": 157709, - "Kind": 3 - }, - { - "EndIndex": 157727, - "Kind": 3 - }, - { - "EndIndex": 157769, - "Kind": 3 - }, - { - "EndIndex": 158095, - "Kind": 3 - }, - { - "EndIndex": 158117, - "Kind": 3 - }, - { - "EndIndex": 158123, - "Kind": 3 - }, - { - "EndIndex": 158125, - "Kind": 3 - }, - { - "EndIndex": 158163, - "Kind": 3 - }, - { - "EndIndex": 158212, - "Kind": 3 - }, - { - "EndIndex": 158248, - "Kind": 3 - }, - { - "EndIndex": 158267, - "Kind": 3 - }, - { - "EndIndex": 158292, - "Kind": 3 - }, - { - "EndIndex": 158345, - "Kind": 3 - }, - { - "EndIndex": 158359, - "Kind": 3 - }, - { - "EndIndex": 158365, - "Kind": 3 - }, - { - "EndIndex": 158383, - "Kind": 3 - }, - { - "EndIndex": 158416, - "Kind": 3 - }, - { - "EndIndex": 158567, - "Kind": 3 - }, - { - "EndIndex": 158588, - "Kind": 3 - }, - { - "EndIndex": 158594, - "Kind": 3 - }, - { - "EndIndex": 158612, - "Kind": 3 - }, - { - "EndIndex": 158654, - "Kind": 3 - }, - { - "EndIndex": 158980, - "Kind": 3 - }, - { - "EndIndex": 159002, - "Kind": 3 - }, - { - "EndIndex": 159008, - "Kind": 3 - }, - { - "EndIndex": 159010, - "Kind": 3 - }, - { - "EndIndex": 159043, - "Kind": 3 - }, - { - "EndIndex": 159091, - "Kind": 3 - }, - { - "EndIndex": 159122, - "Kind": 3 - }, - { - "EndIndex": 159141, - "Kind": 3 - }, - { - "EndIndex": 159166, - "Kind": 3 - }, - { - "EndIndex": 159218, - "Kind": 3 - }, - { - "EndIndex": 159232, - "Kind": 3 - }, - { - "EndIndex": 159238, - "Kind": 3 - }, - { - "EndIndex": 159256, - "Kind": 3 - }, - { - "EndIndex": 159289, - "Kind": 3 - }, - { - "EndIndex": 159440, - "Kind": 3 - }, - { - "EndIndex": 159461, - "Kind": 3 - }, - { - "EndIndex": 159467, - "Kind": 3 - }, - { - "EndIndex": 159485, - "Kind": 3 - }, - { - "EndIndex": 159527, - "Kind": 3 - }, - { - "EndIndex": 159853, - "Kind": 3 - }, - { - "EndIndex": 159875, - "Kind": 3 - }, - { - "EndIndex": 159881, - "Kind": 3 - }, - { - "EndIndex": 159896, - "Kind": 3 - }, - { - "EndIndex": 159918, - "Kind": 3 - }, - { - "EndIndex": 159952, - "Kind": 3 - }, - { - "EndIndex": 159966, - "Kind": 3 - }, - { - "EndIndex": 159972, - "Kind": 3 - }, - { - "EndIndex": 159974, - "Kind": 3 - }, - { - "EndIndex": 160005, - "Kind": 3 - }, - { - "EndIndex": 160028, - "Kind": 3 - }, - { - "EndIndex": 160057, - "Kind": 3 - }, - { - "EndIndex": 160076, - "Kind": 3 - }, - { - "EndIndex": 160118, - "Kind": 3 - }, - { - "EndIndex": 160145, - "Kind": 3 - }, - { - "EndIndex": 160159, - "Kind": 3 - }, - { - "EndIndex": 160165, - "Kind": 3 - }, - { - "EndIndex": 160183, - "Kind": 3 - }, - { - "EndIndex": 160216, - "Kind": 3 - }, - { - "EndIndex": 160367, - "Kind": 3 - }, - { - "EndIndex": 160388, - "Kind": 3 - }, - { - "EndIndex": 160394, - "Kind": 3 - }, - { - "EndIndex": 160418, - "Kind": 3 - }, - { - "EndIndex": 160447, - "Kind": 3 - }, - { - "EndIndex": 160466, - "Kind": 3 - }, - { - "EndIndex": 160472, - "Kind": 3 - }, - { - "EndIndex": 160490, - "Kind": 3 - }, - { - "EndIndex": 160532, - "Kind": 3 - }, - { - "EndIndex": 160858, - "Kind": 3 - }, - { - "EndIndex": 160880, - "Kind": 3 - }, - { - "EndIndex": 160886, - "Kind": 3 - }, - { - "EndIndex": 160901, - "Kind": 3 - }, - { - "EndIndex": 160926, - "Kind": 3 - }, - { - "EndIndex": 160956, - "Kind": 3 - }, - { - "EndIndex": 160970, - "Kind": 3 - }, - { - "EndIndex": 160976, - "Kind": 3 - }, - { - "EndIndex": 160991, - "Kind": 3 - }, - { - "EndIndex": 161014, - "Kind": 3 - }, - { - "EndIndex": 161042, - "Kind": 3 - }, - { - "EndIndex": 161056, - "Kind": 3 - }, - { - "EndIndex": 161062, - "Kind": 3 - }, - { - "EndIndex": 161077, - "Kind": 3 - }, - { - "EndIndex": 161097, - "Kind": 3 - }, - { - "EndIndex": 161122, - "Kind": 3 - }, - { - "EndIndex": 161136, - "Kind": 3 - }, - { - "EndIndex": 161142, - "Kind": 3 - }, - { - "EndIndex": 161157, - "Kind": 3 - }, - { - "EndIndex": 161180, - "Kind": 3 - }, - { - "EndIndex": 161208, - "Kind": 3 - }, - { - "EndIndex": 161222, - "Kind": 3 - }, - { - "EndIndex": 161228, - "Kind": 3 - }, - { - "EndIndex": 161243, - "Kind": 3 - }, - { - "EndIndex": 161279, - "Kind": 3 - }, - { - "EndIndex": 161320, - "Kind": 3 - }, - { - "EndIndex": 161334, - "Kind": 3 - }, - { - "EndIndex": 161340, - "Kind": 3 - }, - { - "EndIndex": 161355, - "Kind": 3 - }, - { - "EndIndex": 161376, - "Kind": 3 - }, - { - "EndIndex": 161402, - "Kind": 3 - }, - { - "EndIndex": 161416, - "Kind": 3 - }, - { - "EndIndex": 161422, - "Kind": 3 - }, - { - "EndIndex": 161424, - "Kind": 3 - }, - { - "EndIndex": 161455, - "Kind": 3 - }, - { - "EndIndex": 161508, - "Kind": 3 - }, - { - "EndIndex": 161539, - "Kind": 3 - }, - { - "EndIndex": 161558, - "Kind": 3 - }, - { - "EndIndex": 161600, - "Kind": 3 - }, - { - "EndIndex": 161657, - "Kind": 3 - }, - { - "EndIndex": 161671, - "Kind": 3 - }, - { - "EndIndex": 161677, - "Kind": 3 - }, - { - "EndIndex": 161695, - "Kind": 3 - }, - { - "EndIndex": 161728, - "Kind": 3 - }, - { - "EndIndex": 161879, - "Kind": 3 - }, - { - "EndIndex": 161900, - "Kind": 3 - }, - { - "EndIndex": 161906, - "Kind": 3 - }, - { - "EndIndex": 161924, - "Kind": 3 - }, - { - "EndIndex": 161966, - "Kind": 3 - }, - { - "EndIndex": 162292, - "Kind": 3 - }, - { - "EndIndex": 162314, - "Kind": 3 - }, - { - "EndIndex": 162320, - "Kind": 3 - }, - { - "EndIndex": 162322, - "Kind": 3 - }, - { - "EndIndex": 162353, - "Kind": 3 - }, - { - "EndIndex": 162539, - "Kind": 3 - }, - { - "EndIndex": 162568, - "Kind": 3 - }, - { - "EndIndex": 162587, - "Kind": 3 - }, - { - "EndIndex": 162629, - "Kind": 3 - }, - { - "EndIndex": 162819, - "Kind": 3 - }, - { - "EndIndex": 162833, - "Kind": 3 - }, - { - "EndIndex": 162839, - "Kind": 3 - }, - { - "EndIndex": 162857, - "Kind": 3 - }, - { - "EndIndex": 162890, - "Kind": 3 - }, - { - "EndIndex": 163041, - "Kind": 3 - }, - { - "EndIndex": 163062, - "Kind": 3 - }, - { - "EndIndex": 163068, - "Kind": 3 - }, - { - "EndIndex": 163086, - "Kind": 3 - }, - { - "EndIndex": 163128, - "Kind": 3 - }, - { - "EndIndex": 163454, - "Kind": 3 - }, - { - "EndIndex": 163476, - "Kind": 3 - }, - { - "EndIndex": 163482, - "Kind": 3 - }, - { - "EndIndex": 163484, - "Kind": 3 - }, - { - "EndIndex": 163518, - "Kind": 3 - }, - { - "EndIndex": 163563, - "Kind": 3 - }, - { - "EndIndex": 163591, - "Kind": 3 - }, - { - "EndIndex": 163610, - "Kind": 3 - }, - { - "EndIndex": 163652, - "Kind": 3 - }, - { - "EndIndex": 163701, - "Kind": 3 - }, - { - "EndIndex": 163715, - "Kind": 3 - }, - { - "EndIndex": 163721, - "Kind": 3 - }, - { - "EndIndex": 163739, - "Kind": 3 - }, - { - "EndIndex": 163772, - "Kind": 3 - }, - { - "EndIndex": 163923, - "Kind": 3 - }, - { - "EndIndex": 163944, - "Kind": 3 - }, - { - "EndIndex": 163950, - "Kind": 3 - }, - { - "EndIndex": 163968, - "Kind": 3 - }, - { - "EndIndex": 164010, - "Kind": 3 - }, - { - "EndIndex": 164336, - "Kind": 3 - }, - { - "EndIndex": 164358, - "Kind": 3 - }, - { - "EndIndex": 164364, - "Kind": 3 - }, - { - "EndIndex": 164379, - "Kind": 3 - }, - { - "EndIndex": 164400, - "Kind": 3 - }, - { - "EndIndex": 164426, - "Kind": 3 - }, - { - "EndIndex": 164440, - "Kind": 3 - }, - { - "EndIndex": 164446, - "Kind": 3 - }, - { - "EndIndex": 164448, - "Kind": 3 - }, - { - "EndIndex": 164483, - "Kind": 3 - }, - { - "EndIndex": 164527, - "Kind": 3 - }, - { - "EndIndex": 164553, - "Kind": 3 - }, - { - "EndIndex": 164572, - "Kind": 3 - }, - { - "EndIndex": 164614, - "Kind": 3 - }, - { - "EndIndex": 164662, - "Kind": 3 - }, - { - "EndIndex": 164676, - "Kind": 3 - }, - { - "EndIndex": 164682, - "Kind": 3 - }, - { - "EndIndex": 164700, - "Kind": 3 - }, - { - "EndIndex": 164733, - "Kind": 3 - }, - { - "EndIndex": 164884, - "Kind": 3 - }, - { - "EndIndex": 164905, - "Kind": 3 - }, - { - "EndIndex": 164911, - "Kind": 3 - }, - { - "EndIndex": 164929, - "Kind": 3 - }, - { - "EndIndex": 164971, - "Kind": 3 - }, - { - "EndIndex": 165297, - "Kind": 3 - }, - { - "EndIndex": 165319, - "Kind": 3 - }, - { - "EndIndex": 165325, - "Kind": 3 - }, - { - "EndIndex": 165327, - "Kind": 3 - }, - { - "EndIndex": 165357, - "Kind": 3 - }, - { - "EndIndex": 165381, - "Kind": 3 - }, - { - "EndIndex": 165411, - "Kind": 3 - }, - { - "EndIndex": 165430, - "Kind": 3 - }, - { - "EndIndex": 165472, - "Kind": 3 - }, - { - "EndIndex": 165500, - "Kind": 3 - }, - { - "EndIndex": 165514, - "Kind": 3 - }, - { - "EndIndex": 165520, - "Kind": 3 - }, - { - "EndIndex": 165538, - "Kind": 3 - }, - { - "EndIndex": 165571, - "Kind": 3 - }, - { - "EndIndex": 165722, - "Kind": 3 - }, - { - "EndIndex": 165743, - "Kind": 3 - }, - { - "EndIndex": 165749, - "Kind": 3 - }, - { - "EndIndex": 165767, - "Kind": 3 - }, - { - "EndIndex": 165809, - "Kind": 3 - }, - { - "EndIndex": 166135, - "Kind": 3 - }, - { - "EndIndex": 166157, - "Kind": 3 - }, - { - "EndIndex": 166163, - "Kind": 3 - }, - { - "EndIndex": 166165, - "Kind": 3 - }, - { - "EndIndex": 166194, - "Kind": 3 - }, - { - "EndIndex": 166230, - "Kind": 3 - }, - { - "EndIndex": 166257, - "Kind": 3 - }, - { - "EndIndex": 166276, - "Kind": 3 - }, - { - "EndIndex": 166318, - "Kind": 3 - }, - { - "EndIndex": 166358, - "Kind": 3 - }, - { - "EndIndex": 166372, - "Kind": 3 - }, - { - "EndIndex": 166378, - "Kind": 3 - }, - { - "EndIndex": 166396, - "Kind": 3 - }, - { - "EndIndex": 166429, - "Kind": 3 - }, - { - "EndIndex": 166580, - "Kind": 3 - }, - { - "EndIndex": 166601, - "Kind": 3 - }, - { - "EndIndex": 166607, - "Kind": 3 - }, - { - "EndIndex": 166625, - "Kind": 3 - }, - { - "EndIndex": 166667, - "Kind": 3 - }, - { - "EndIndex": 166993, - "Kind": 3 - }, - { - "EndIndex": 167015, - "Kind": 3 - }, - { - "EndIndex": 167021, - "Kind": 3 - }, - { - "EndIndex": 167023, - "Kind": 3 - }, - { - "EndIndex": 167060, - "Kind": 3 - }, - { - "EndIndex": 167115, - "Kind": 3 - }, - { - "EndIndex": 167150, - "Kind": 3 - }, - { - "EndIndex": 167169, - "Kind": 3 - }, - { - "EndIndex": 167211, - "Kind": 3 - }, - { - "EndIndex": 167270, - "Kind": 3 - }, - { - "EndIndex": 167284, - "Kind": 3 - }, - { - "EndIndex": 167290, - "Kind": 3 - }, - { - "EndIndex": 167308, - "Kind": 3 - }, - { - "EndIndex": 167341, - "Kind": 3 - }, - { - "EndIndex": 167492, - "Kind": 3 - }, - { - "EndIndex": 167513, - "Kind": 3 - }, - { - "EndIndex": 167519, - "Kind": 3 - }, - { - "EndIndex": 167537, - "Kind": 3 - }, - { - "EndIndex": 167579, - "Kind": 3 - }, - { - "EndIndex": 167905, - "Kind": 3 - }, - { - "EndIndex": 167927, - "Kind": 3 - }, - { - "EndIndex": 167933, - "Kind": 3 - }, - { - "EndIndex": 167935, - "Kind": 3 - }, - { - "EndIndex": 167976, - "Kind": 3 - }, - { - "EndIndex": 168007, - "Kind": 3 - }, - { - "EndIndex": 168043, - "Kind": 3 - }, - { - "EndIndex": 168062, - "Kind": 3 - }, - { - "EndIndex": 168104, - "Kind": 3 - }, - { - "EndIndex": 168139, - "Kind": 3 - }, - { - "EndIndex": 168153, - "Kind": 3 - }, - { - "EndIndex": 168159, - "Kind": 3 - }, - { - "EndIndex": 168177, - "Kind": 3 - }, - { - "EndIndex": 168210, - "Kind": 3 - }, - { - "EndIndex": 168361, - "Kind": 3 - }, - { - "EndIndex": 168382, - "Kind": 3 - }, - { - "EndIndex": 168388, - "Kind": 3 - }, - { - "EndIndex": 168412, - "Kind": 3 - }, - { - "EndIndex": 168441, - "Kind": 3 - }, - { - "EndIndex": 168460, - "Kind": 3 - }, - { - "EndIndex": 168466, - "Kind": 3 - }, - { - "EndIndex": 168484, - "Kind": 3 - }, - { - "EndIndex": 168526, - "Kind": 3 - }, - { - "EndIndex": 168852, - "Kind": 3 - }, - { - "EndIndex": 168874, - "Kind": 3 - }, - { - "EndIndex": 168880, - "Kind": 3 - }, - { - "EndIndex": 168895, - "Kind": 3 - }, - { - "EndIndex": 168920, - "Kind": 3 - }, - { - "EndIndex": 168950, - "Kind": 3 - }, - { - "EndIndex": 168964, - "Kind": 3 - }, - { - "EndIndex": 168970, - "Kind": 3 - }, - { - "EndIndex": 168985, - "Kind": 3 - }, - { - "EndIndex": 169005, - "Kind": 3 - }, - { - "EndIndex": 169030, - "Kind": 3 - }, - { - "EndIndex": 169044, - "Kind": 3 - }, - { - "EndIndex": 169050, - "Kind": 3 - }, - { - "EndIndex": 169065, - "Kind": 3 - }, - { - "EndIndex": 169088, - "Kind": 3 - }, - { - "EndIndex": 169116, - "Kind": 3 - }, - { - "EndIndex": 169130, - "Kind": 3 - }, - { - "EndIndex": 169136, - "Kind": 3 - }, - { - "EndIndex": 169151, - "Kind": 3 - }, - { - "EndIndex": 169174, - "Kind": 3 - }, - { - "EndIndex": 169202, - "Kind": 3 - }, - { - "EndIndex": 169216, - "Kind": 3 - }, - { - "EndIndex": 169222, - "Kind": 3 - }, - { - "EndIndex": 169237, - "Kind": 3 - }, - { - "EndIndex": 169259, - "Kind": 3 - }, - { - "EndIndex": 169286, - "Kind": 3 - }, - { - "EndIndex": 169300, - "Kind": 3 - }, - { - "EndIndex": 169306, - "Kind": 3 - }, - { - "EndIndex": 169308, - "Kind": 3 - }, - { - "EndIndex": 169349, - "Kind": 3 - }, - { - "EndIndex": 169380, - "Kind": 3 - }, - { - "EndIndex": 169416, - "Kind": 3 - }, - { - "EndIndex": 169435, - "Kind": 3 - }, - { - "EndIndex": 169477, - "Kind": 3 - }, - { - "EndIndex": 169512, - "Kind": 3 - }, - { - "EndIndex": 169526, - "Kind": 3 - }, - { - "EndIndex": 169532, - "Kind": 3 - }, - { - "EndIndex": 169550, - "Kind": 3 - }, - { - "EndIndex": 169583, - "Kind": 3 - }, - { - "EndIndex": 169734, - "Kind": 3 - }, - { - "EndIndex": 169755, - "Kind": 3 - }, - { - "EndIndex": 169761, - "Kind": 3 - }, - { - "EndIndex": 169785, - "Kind": 3 - }, - { - "EndIndex": 169814, - "Kind": 3 - }, - { - "EndIndex": 169833, - "Kind": 3 - }, - { - "EndIndex": 169839, - "Kind": 3 - }, - { - "EndIndex": 169857, - "Kind": 3 - }, - { - "EndIndex": 169899, - "Kind": 3 - }, - { - "EndIndex": 170225, - "Kind": 3 - }, - { - "EndIndex": 170247, - "Kind": 3 - }, - { - "EndIndex": 170253, - "Kind": 3 - }, - { - "EndIndex": 170268, - "Kind": 3 - }, - { - "EndIndex": 170293, - "Kind": 3 - }, - { - "EndIndex": 170323, - "Kind": 3 - }, - { - "EndIndex": 170337, - "Kind": 3 - }, - { - "EndIndex": 170343, - "Kind": 3 - }, - { - "EndIndex": 170358, - "Kind": 3 - }, - { - "EndIndex": 170378, - "Kind": 3 - }, - { - "EndIndex": 170403, - "Kind": 3 - }, - { - "EndIndex": 170417, - "Kind": 3 - }, - { - "EndIndex": 170423, - "Kind": 3 - }, - { - "EndIndex": 170438, - "Kind": 3 - }, - { - "EndIndex": 170461, - "Kind": 3 - }, - { - "EndIndex": 170489, - "Kind": 3 - }, - { - "EndIndex": 170503, - "Kind": 3 - }, - { - "EndIndex": 170509, - "Kind": 3 - }, - { - "EndIndex": 170524, - "Kind": 3 - }, - { - "EndIndex": 170547, - "Kind": 3 - }, - { - "EndIndex": 170575, - "Kind": 3 - }, - { - "EndIndex": 170589, - "Kind": 3 - }, - { - "EndIndex": 170595, - "Kind": 3 - }, - { - "EndIndex": 170610, - "Kind": 3 - }, - { - "EndIndex": 170632, - "Kind": 3 - }, - { - "EndIndex": 170659, - "Kind": 3 - }, - { - "EndIndex": 170673, - "Kind": 3 - }, - { - "EndIndex": 170679, - "Kind": 3 - }, - { - "EndIndex": 170681, - "Kind": 3 - }, - { - "EndIndex": 170714, - "Kind": 3 - }, - { - "EndIndex": 170744, - "Kind": 3 - }, - { - "EndIndex": 170774, - "Kind": 3 - }, - { - "EndIndex": 170793, - "Kind": 3 - }, - { - "EndIndex": 170835, - "Kind": 3 - }, - { - "EndIndex": 170869, - "Kind": 3 - }, - { - "EndIndex": 170883, - "Kind": 3 - }, - { - "EndIndex": 170889, - "Kind": 3 - }, - { - "EndIndex": 170907, - "Kind": 3 - }, - { - "EndIndex": 170940, - "Kind": 3 - }, - { - "EndIndex": 171091, - "Kind": 3 - }, - { - "EndIndex": 171112, - "Kind": 3 - }, - { - "EndIndex": 171118, - "Kind": 3 - }, - { - "EndIndex": 171136, - "Kind": 3 - }, - { - "EndIndex": 171178, - "Kind": 3 - }, - { - "EndIndex": 171504, - "Kind": 3 - }, - { - "EndIndex": 171526, - "Kind": 3 - }, - { - "EndIndex": 171532, - "Kind": 3 - }, - { - "EndIndex": 171534, - "Kind": 3 - }, - { - "EndIndex": 171578, - "Kind": 3 - }, - { - "EndIndex": 171612, - "Kind": 3 - }, - { - "EndIndex": 171651, - "Kind": 3 - }, - { - "EndIndex": 171670, - "Kind": 3 - }, - { - "EndIndex": 171712, - "Kind": 3 - }, - { - "EndIndex": 171750, - "Kind": 3 - }, - { - "EndIndex": 171764, - "Kind": 3 - }, - { - "EndIndex": 171770, - "Kind": 3 - }, - { - "EndIndex": 171788, - "Kind": 3 - }, - { - "EndIndex": 171821, - "Kind": 3 - }, - { - "EndIndex": 171972, - "Kind": 3 - }, - { - "EndIndex": 171993, - "Kind": 3 - }, - { - "EndIndex": 171999, - "Kind": 3 - }, - { - "EndIndex": 172023, - "Kind": 3 - }, - { - "EndIndex": 172052, - "Kind": 3 - }, - { - "EndIndex": 172071, - "Kind": 3 - }, - { - "EndIndex": 172077, - "Kind": 3 - }, - { - "EndIndex": 172095, - "Kind": 3 - }, - { - "EndIndex": 172137, - "Kind": 3 - }, - { - "EndIndex": 172463, - "Kind": 3 - }, - { - "EndIndex": 172485, - "Kind": 3 - }, - { - "EndIndex": 172491, - "Kind": 3 - }, - { - "EndIndex": 172506, - "Kind": 3 - }, - { - "EndIndex": 172531, - "Kind": 3 - }, - { - "EndIndex": 172561, - "Kind": 3 - }, - { - "EndIndex": 172575, - "Kind": 3 - }, - { - "EndIndex": 172581, - "Kind": 3 - }, - { - "EndIndex": 172596, - "Kind": 3 - }, - { - "EndIndex": 172616, - "Kind": 3 - }, - { - "EndIndex": 172641, - "Kind": 3 - }, - { - "EndIndex": 172655, - "Kind": 3 - }, - { - "EndIndex": 172661, - "Kind": 3 - }, - { - "EndIndex": 172676, - "Kind": 3 - }, - { - "EndIndex": 172699, - "Kind": 3 - }, - { - "EndIndex": 172727, - "Kind": 3 - }, - { - "EndIndex": 172741, - "Kind": 3 - }, - { - "EndIndex": 172747, - "Kind": 3 - }, - { - "EndIndex": 172762, - "Kind": 3 - }, - { - "EndIndex": 172785, - "Kind": 3 - }, - { - "EndIndex": 172813, - "Kind": 3 - }, - { - "EndIndex": 172827, - "Kind": 3 - }, - { - "EndIndex": 172833, - "Kind": 3 - }, - { - "EndIndex": 172848, - "Kind": 3 - }, - { - "EndIndex": 172870, - "Kind": 3 - }, - { - "EndIndex": 172897, - "Kind": 3 - }, - { - "EndIndex": 172911, - "Kind": 3 - }, - { - "EndIndex": 172917, - "Kind": 3 - }, - { - "EndIndex": 172919, - "Kind": 3 - }, - { - "EndIndex": 172951, - "Kind": 3 - }, - { - "EndIndex": 173054, - "Kind": 3 - }, - { - "EndIndex": 173086, - "Kind": 3 - }, - { - "EndIndex": 173105, - "Kind": 3 - }, - { - "EndIndex": 173147, - "Kind": 3 - }, - { - "EndIndex": 173254, - "Kind": 3 - }, - { - "EndIndex": 173268, - "Kind": 3 - }, - { - "EndIndex": 173274, - "Kind": 3 - }, - { - "EndIndex": 173292, - "Kind": 3 - }, - { - "EndIndex": 173325, - "Kind": 3 - }, - { - "EndIndex": 173476, - "Kind": 3 - }, - { - "EndIndex": 173497, - "Kind": 3 - }, - { - "EndIndex": 173503, - "Kind": 3 - }, - { - "EndIndex": 173521, - "Kind": 3 - }, - { - "EndIndex": 173563, - "Kind": 3 - }, - { - "EndIndex": 173889, - "Kind": 3 - }, - { - "EndIndex": 173911, - "Kind": 3 - }, - { - "EndIndex": 173917, - "Kind": 3 - }, - { - "EndIndex": 173919, - "Kind": 3 - }, - { - "EndIndex": 173948, - "Kind": 3 - }, - { - "EndIndex": 174003, - "Kind": 3 - }, - { - "EndIndex": 174032, - "Kind": 3 - }, - { - "EndIndex": 174051, - "Kind": 3 - }, - { - "EndIndex": 174093, - "Kind": 3 - }, - { - "EndIndex": 174152, - "Kind": 3 - }, - { - "EndIndex": 174166, - "Kind": 3 - }, - { - "EndIndex": 174172, - "Kind": 3 - }, - { - "EndIndex": 174190, - "Kind": 3 - }, - { - "EndIndex": 174223, - "Kind": 3 - }, - { - "EndIndex": 174374, - "Kind": 3 - }, - { - "EndIndex": 174395, - "Kind": 3 - }, - { - "EndIndex": 174401, - "Kind": 3 - }, - { - "EndIndex": 174419, - "Kind": 3 - }, - { - "EndIndex": 174461, - "Kind": 3 - }, - { - "EndIndex": 174787, - "Kind": 3 - }, - { - "EndIndex": 174809, - "Kind": 3 - }, - { - "EndIndex": 174815, - "Kind": 3 - }, - { - "EndIndex": 174817, - "Kind": 3 - }, - { - "EndIndex": 174847, - "Kind": 3 - }, - { - "EndIndex": 174902, - "Kind": 3 - }, - { - "EndIndex": 174930, - "Kind": 3 - }, - { - "EndIndex": 174949, - "Kind": 3 - }, - { - "EndIndex": 174989, - "Kind": 3 - }, - { - "EndIndex": 175048, - "Kind": 3 - }, - { - "EndIndex": 175062, - "Kind": 3 - }, - { - "EndIndex": 175068, - "Kind": 3 - }, - { - "EndIndex": 175086, - "Kind": 3 - }, - { - "EndIndex": 175119, - "Kind": 3 - }, - { - "EndIndex": 175270, - "Kind": 3 - }, - { - "EndIndex": 175291, - "Kind": 3 - }, - { - "EndIndex": 175297, - "Kind": 3 - }, - { - "EndIndex": 175315, - "Kind": 3 - }, - { - "EndIndex": 175357, - "Kind": 3 - }, - { - "EndIndex": 175683, - "Kind": 3 - }, - { - "EndIndex": 175705, - "Kind": 3 - }, - { - "EndIndex": 175711, - "Kind": 3 - }, - { - "EndIndex": 175713, - "Kind": 3 - }, - { - "EndIndex": 175740, - "Kind": 3 - }, - { - "EndIndex": 175782, - "Kind": 3 - }, - { - "EndIndex": 175807, - "Kind": 3 - }, - { - "EndIndex": 175826, - "Kind": 3 - }, - { - "EndIndex": 175868, - "Kind": 3 - }, - { - "EndIndex": 175914, - "Kind": 3 - }, - { - "EndIndex": 175928, - "Kind": 3 - }, - { - "EndIndex": 175934, - "Kind": 3 - }, - { - "EndIndex": 175952, - "Kind": 3 - }, - { - "EndIndex": 175985, - "Kind": 3 - }, - { - "EndIndex": 176136, - "Kind": 3 - }, - { - "EndIndex": 176157, - "Kind": 3 - }, - { - "EndIndex": 176163, - "Kind": 3 - }, - { - "EndIndex": 176181, - "Kind": 3 - }, - { - "EndIndex": 176223, - "Kind": 3 - }, - { - "EndIndex": 176549, - "Kind": 3 - }, - { - "EndIndex": 176571, - "Kind": 3 - }, - { - "EndIndex": 176577, - "Kind": 3 - }, - { - "EndIndex": 176579, - "Kind": 3 - }, - { - "EndIndex": 176605, - "Kind": 3 - }, - { - "EndIndex": 176648, - "Kind": 3 - }, - { - "EndIndex": 176715, - "Kind": 3 - }, - { - "EndIndex": 176750, - "Kind": 3 - }, - { - "EndIndex": 176769, - "Kind": 3 - }, - { - "EndIndex": 176811, - "Kind": 3 - }, - { - "EndIndex": 176882, - "Kind": 3 - }, - { - "EndIndex": 176896, - "Kind": 3 - }, - { - "EndIndex": 176902, - "Kind": 3 - }, - { - "EndIndex": 176920, - "Kind": 3 - }, - { - "EndIndex": 176953, - "Kind": 3 - }, - { - "EndIndex": 177104, - "Kind": 3 - }, - { - "EndIndex": 177125, - "Kind": 3 - }, - { - "EndIndex": 177131, - "Kind": 3 - }, - { - "EndIndex": 177149, - "Kind": 3 - }, - { - "EndIndex": 177191, - "Kind": 3 - }, - { - "EndIndex": 177517, - "Kind": 3 - }, - { - "EndIndex": 177539, - "Kind": 3 - }, - { - "EndIndex": 177545, - "Kind": 3 - }, - { - "EndIndex": 177547, - "Kind": 3 - }, - { - "EndIndex": 177613, - "Kind": 3 - }, - { - "EndIndex": 177746, - "Kind": 3 - }, - { - "EndIndex": 177756, - "Kind": 3 - }, - { - "EndIndex": 177758, - "Kind": 3 - }, - { - "EndIndex": 177900, - "Kind": 3 - }, - { - "EndIndex": 177972, - "Kind": 3 - }, - { - "EndIndex": 178868, - "Kind": 3 - }, - { - "EndIndex": 178878, - "Kind": 3 - }, - { - "EndIndex": 178880, - "Kind": 3 - }, - { - "EndIndex": 178903, - "Kind": 3 - }, - { - "EndIndex": 178921, - "Kind": 3 - }, - { - "EndIndex": 178934, - "Kind": 3 - }, - { - "EndIndex": 178984, - "Kind": 3 - }, - { - "EndIndex": 178994, - "Kind": 3 - }, - { - "EndIndex": 178996, - "Kind": 3 - }, - { - "EndIndex": 179016, - "Kind": 3 - }, - { - "EndIndex": 179130, - "Kind": 3 - }, - { - "EndIndex": 179148, - "Kind": 3 - }, - { - "EndIndex": 179150, - "Kind": 3 - }, - { - "EndIndex": 179170, - "Kind": 3 - }, - { - "EndIndex": 179278, - "Kind": 3 - }, - { - "EndIndex": 179296, - "Kind": 3 - }, - { - "EndIndex": 179298, - "Kind": 3 - }, - { - "EndIndex": 179315, - "Kind": 3 - }, - { - "EndIndex": 179635, - "Kind": 3 - }, - { - "EndIndex": 179650, - "Kind": 3 - }, - { - "EndIndex": 179652, - "Kind": 3 - }, - { - "EndIndex": 179670, - "Kind": 3 - }, - { - "EndIndex": 179779, - "Kind": 3 - }, - { - "EndIndex": 179794, - "Kind": 3 - }, - { - "EndIndex": 179796, - "Kind": 3 - }, - { - "EndIndex": 179827, - "Kind": 3 - }, - { - "EndIndex": 180020, - "Kind": 3 - }, - { - "EndIndex": 180030, - "Kind": 3 - }, - { - "EndIndex": 180032, - "Kind": 3 - }, - { - "EndIndex": 180058, - "Kind": 3 - }, - { - "EndIndex": 180589, - "Kind": 3 - }, - { - "EndIndex": 180620, - "Kind": 3 - }, - { - "EndIndex": 180650, - "Kind": 3 - }, - { - "EndIndex": 180678, - "Kind": 3 - }, - { - "EndIndex": 180684, - "Kind": 3 - }, - { - "EndIndex": 180710, - "Kind": 3 - }, - { - "EndIndex": 180792, - "Kind": 3 - }, - { - "EndIndex": 180810, - "Kind": 3 - }, - { - "EndIndex": 180816, - "Kind": 3 - }, - { - "EndIndex": 180843, - "Kind": 3 - }, - { - "EndIndex": 180877, - "Kind": 3 - }, - { - "EndIndex": 180908, - "Kind": 3 - }, - { - "EndIndex": 180930, - "Kind": 3 - }, - { - "EndIndex": 180936, - "Kind": 3 - }, - { - "EndIndex": 180969, - "Kind": 3 - }, - { - "EndIndex": 180998, - "Kind": 3 - }, - { - "EndIndex": 181019, - "Kind": 3 - }, - { - "EndIndex": 181025, - "Kind": 3 - }, - { - "EndIndex": 181055, - "Kind": 3 - }, - { - "EndIndex": 181086, - "Kind": 3 - }, - { - "EndIndex": 181108, - "Kind": 3 - }, - { - "EndIndex": 181114, - "Kind": 3 - }, - { - "EndIndex": 181144, - "Kind": 3 - }, - { - "EndIndex": 181175, - "Kind": 3 - }, - { - "EndIndex": 181197, - "Kind": 3 - }, - { - "EndIndex": 181203, - "Kind": 3 - }, - { - "EndIndex": 181242, - "Kind": 3 - }, - { - "EndIndex": 181281, - "Kind": 3 - }, - { - "EndIndex": 181295, - "Kind": 3 - }, - { - "EndIndex": 181301, - "Kind": 3 - }, - { - "EndIndex": 181334, - "Kind": 3 - }, - { - "EndIndex": 181363, - "Kind": 3 - }, - { - "EndIndex": 181377, - "Kind": 3 - }, - { - "EndIndex": 181383, - "Kind": 3 - }, - { - "EndIndex": 181413, - "Kind": 3 - }, - { - "EndIndex": 181443, - "Kind": 3 - }, - { - "EndIndex": 181465, - "Kind": 3 - }, - { - "EndIndex": 181471, - "Kind": 3 - }, - { - "EndIndex": 181492, - "Kind": 3 - }, - { - "EndIndex": 181524, - "Kind": 3 - }, - { - "EndIndex": 181558, - "Kind": 3 - }, - { - "EndIndex": 181579, - "Kind": 3 - }, - { - "EndIndex": 181585, - "Kind": 3 - }, - { - "EndIndex": 181617, - "Kind": 3 - }, - { - "EndIndex": 181651, - "Kind": 3 - }, - { - "EndIndex": 181672, - "Kind": 3 - }, - { - "EndIndex": 181678, - "Kind": 3 - }, - { - "EndIndex": 181734, - "Kind": 3 - }, - { - "EndIndex": 182269, - "Kind": 3 - }, - { - "EndIndex": 182283, - "Kind": 3 - }, - { - "EndIndex": 182289, - "Kind": 3 - }, - { - "EndIndex": 182307, - "Kind": 3 - }, - { - "EndIndex": 182340, - "Kind": 3 - }, - { - "EndIndex": 182491, - "Kind": 3 - }, - { - "EndIndex": 182512, - "Kind": 3 - }, - { - "EndIndex": 182518, - "Kind": 3 - }, - { - "EndIndex": 182543, - "Kind": 3 - }, - { - "EndIndex": 182576, - "Kind": 3 - }, - { - "EndIndex": 182604, - "Kind": 3 - }, - { - "EndIndex": 182610, - "Kind": 3 - }, - { - "EndIndex": 182640, - "Kind": 3 - }, - { - "EndIndex": 182671, - "Kind": 3 - }, - { - "EndIndex": 182693, - "Kind": 3 - }, - { - "EndIndex": 182699, - "Kind": 3 - }, - { - "EndIndex": 182723, - "Kind": 3 - }, - { - "EndIndex": 182752, - "Kind": 3 - }, - { - "EndIndex": 182770, - "Kind": 3 - }, - { - "EndIndex": 182776, - "Kind": 3 - }, - { - "EndIndex": 182806, - "Kind": 3 - }, - { - "EndIndex": 182836, - "Kind": 3 - }, - { - "EndIndex": 182858, - "Kind": 3 - }, - { - "EndIndex": 182864, - "Kind": 3 - }, - { - "EndIndex": 182895, - "Kind": 3 - }, - { - "EndIndex": 182925, - "Kind": 3 - }, - { - "EndIndex": 182953, - "Kind": 3 - }, - { - "EndIndex": 182959, - "Kind": 3 - }, - { - "EndIndex": 182990, - "Kind": 3 - }, - { - "EndIndex": 183020, - "Kind": 3 - }, - { - "EndIndex": 183048, - "Kind": 3 - }, - { - "EndIndex": 183054, - "Kind": 3 - }, - { - "EndIndex": 183084, - "Kind": 3 - }, - { - "EndIndex": 183115, - "Kind": 3 - }, - { - "EndIndex": 183137, - "Kind": 3 - }, - { - "EndIndex": 183143, - "Kind": 3 - }, - { - "EndIndex": 183170, - "Kind": 3 - }, - { - "EndIndex": 183220, - "Kind": 3 - }, - { - "EndIndex": 183250, - "Kind": 3 - }, - { - "EndIndex": 183256, - "Kind": 3 - }, - { - "EndIndex": 183293, - "Kind": 3 - }, - { - "EndIndex": 183343, - "Kind": 3 - }, - { - "EndIndex": 183373, - "Kind": 3 - }, - { - "EndIndex": 183379, - "Kind": 3 - }, - { - "EndIndex": 183404, - "Kind": 3 - }, - { - "EndIndex": 183434, - "Kind": 3 - }, - { - "EndIndex": 183453, - "Kind": 3 - }, - { - "EndIndex": 183459, - "Kind": 3 - }, - { - "EndIndex": 183491, - "Kind": 3 - }, - { - "EndIndex": 183521, - "Kind": 3 - }, - { - "EndIndex": 183549, - "Kind": 3 - }, - { - "EndIndex": 183555, - "Kind": 3 - }, - { - "EndIndex": 183587, - "Kind": 3 - }, - { - "EndIndex": 183617, - "Kind": 3 - }, - { - "EndIndex": 183645, - "Kind": 3 - }, - { - "EndIndex": 183651, - "Kind": 3 - }, - { - "EndIndex": 183691, - "Kind": 3 - }, - { - "EndIndex": 183726, - "Kind": 3 - }, - { - "EndIndex": 183747, - "Kind": 3 - }, - { - "EndIndex": 183753, - "Kind": 3 - }, - { - "EndIndex": 183780, - "Kind": 3 - }, - { - "EndIndex": 183853, - "Kind": 3 - }, - { - "EndIndex": 183871, - "Kind": 3 - }, - { - "EndIndex": 183877, - "Kind": 3 - }, - { - "EndIndex": 183901, - "Kind": 3 - }, - { - "EndIndex": 183930, - "Kind": 3 - }, - { - "EndIndex": 183949, - "Kind": 3 - }, - { - "EndIndex": 183955, - "Kind": 3 - }, - { - "EndIndex": 183973, - "Kind": 3 - }, - { - "EndIndex": 184015, - "Kind": 3 - }, - { - "EndIndex": 184341, - "Kind": 3 - }, - { - "EndIndex": 184363, - "Kind": 3 - }, - { - "EndIndex": 184369, - "Kind": 3 - }, - { - "EndIndex": 184398, - "Kind": 3 - }, - { - "EndIndex": 184499, - "Kind": 3 - }, - { - "EndIndex": 184513, - "Kind": 3 - }, - { - "EndIndex": 184519, - "Kind": 3 - }, - { - "EndIndex": 184546, - "Kind": 3 - }, - { - "EndIndex": 184684, - "Kind": 3 - }, - { - "EndIndex": 184712, - "Kind": 3 - }, - { - "EndIndex": 184718, - "Kind": 3 - }, - { - "EndIndex": 184741, - "Kind": 3 - }, - { - "EndIndex": 184918, - "Kind": 3 - }, - { - "EndIndex": 184946, - "Kind": 3 - }, - { - "EndIndex": 184952, - "Kind": 3 - }, - { - "EndIndex": 184974, - "Kind": 3 - }, - { - "EndIndex": 185022, - "Kind": 3 - }, - { - "EndIndex": 185043, - "Kind": 3 - }, - { - "EndIndex": 185049, - "Kind": 3 - }, - { - "EndIndex": 185070, - "Kind": 3 - }, - { - "EndIndex": 185101, - "Kind": 3 - }, - { - "EndIndex": 185129, - "Kind": 3 - }, - { - "EndIndex": 185135, - "Kind": 3 - }, - { - "EndIndex": 185160, - "Kind": 3 - }, - { - "EndIndex": 185374, - "Kind": 3 - }, - { - "EndIndex": 185392, - "Kind": 3 - }, - { - "EndIndex": 185398, - "Kind": 3 - }, - { - "EndIndex": 185439, - "Kind": 3 - }, - { - "EndIndex": 185916, - "Kind": 3 - }, - { - "EndIndex": 185930, - "Kind": 3 - }, - { - "EndIndex": 185936, - "Kind": 3 - }, - { - "EndIndex": 185986, - "Kind": 3 - }, - { - "EndIndex": 186266, - "Kind": 3 - }, - { - "EndIndex": 186288, - "Kind": 3 - }, - { - "EndIndex": 186294, - "Kind": 3 - }, - { - "EndIndex": 186332, - "Kind": 3 - }, - { - "EndIndex": 186519, - "Kind": 3 - }, - { - "EndIndex": 186547, - "Kind": 3 - }, - { - "EndIndex": 186553, - "Kind": 3 - }, - { - "EndIndex": 186594, - "Kind": 3 - }, - { - "EndIndex": 186745, - "Kind": 3 - }, - { - "EndIndex": 186759, - "Kind": 3 - }, - { - "EndIndex": 186765, - "Kind": 3 - }, - { - "EndIndex": 186808, - "Kind": 3 - }, - { - "EndIndex": 187064, - "Kind": 3 - }, - { - "EndIndex": 187082, - "Kind": 3 - }, - { - "EndIndex": 187088, - "Kind": 3 - }, - { - "EndIndex": 187106, - "Kind": 3 - }, - { - "EndIndex": 187143, - "Kind": 3 - }, - { - "EndIndex": 187340, - "Kind": 3 - }, - { - "EndIndex": 187354, - "Kind": 3 - }, - { - "EndIndex": 187360, - "Kind": 3 - }, - { - "EndIndex": 187380, - "Kind": 3 - }, - { - "EndIndex": 187535, - "Kind": 3 - }, - { - "EndIndex": 187554, - "Kind": 3 - }, - { - "EndIndex": 187560, - "Kind": 3 - }, - { - "EndIndex": 187585, - "Kind": 3 - }, - { - "EndIndex": 187872, - "Kind": 3 - }, - { - "EndIndex": 187890, - "Kind": 3 - }, - { - "EndIndex": 187896, - "Kind": 3 - }, - { - "EndIndex": 187932, - "Kind": 3 - }, - { - "EndIndex": 188106, - "Kind": 3 - }, - { - "EndIndex": 188120, - "Kind": 3 - }, - { - "EndIndex": 188126, - "Kind": 3 - }, - { - "EndIndex": 188150, - "Kind": 3 - }, - { - "EndIndex": 188296, - "Kind": 3 - }, - { - "EndIndex": 188318, - "Kind": 3 - }, - { - "EndIndex": 188324, - "Kind": 3 - }, - { - "EndIndex": 188348, - "Kind": 3 - }, - { - "EndIndex": 188492, - "Kind": 3 - }, - { - "EndIndex": 188514, - "Kind": 3 - }, - { - "EndIndex": 188520, - "Kind": 3 - }, - { - "EndIndex": 188544, - "Kind": 3 - }, - { - "EndIndex": 188656, - "Kind": 3 - }, - { - "EndIndex": 188677, - "Kind": 3 - }, - { - "EndIndex": 188683, - "Kind": 3 - }, - { - "EndIndex": 188707, - "Kind": 3 - }, - { - "EndIndex": 188847, - "Kind": 3 - }, - { - "EndIndex": 188869, - "Kind": 3 - }, - { - "EndIndex": 188875, - "Kind": 3 - }, - { - "EndIndex": 188899, - "Kind": 3 - }, - { - "EndIndex": 189054, - "Kind": 3 - }, - { - "EndIndex": 189076, - "Kind": 3 - }, - { - "EndIndex": 189082, - "Kind": 3 - }, - { - "EndIndex": 189106, - "Kind": 3 - }, - { - "EndIndex": 189250, - "Kind": 3 - }, - { - "EndIndex": 189272, - "Kind": 3 - }, - { - "EndIndex": 189278, - "Kind": 3 - }, - { - "EndIndex": 189302, - "Kind": 3 - }, - { - "EndIndex": 189548, - "Kind": 3 - }, - { - "EndIndex": 189570, - "Kind": 3 - }, - { - "EndIndex": 189576, - "Kind": 3 - }, - { - "EndIndex": 189600, - "Kind": 3 - }, - { - "EndIndex": 189755, - "Kind": 3 - }, - { - "EndIndex": 189777, - "Kind": 3 - }, - { - "EndIndex": 189783, - "Kind": 3 - }, - { - "EndIndex": 189823, - "Kind": 3 - }, - { - "EndIndex": 190012, - "Kind": 3 - }, - { - "EndIndex": 190026, - "Kind": 3 - }, - { - "EndIndex": 190032, - "Kind": 3 - }, - { - "EndIndex": 190054, - "Kind": 3 - }, - { - "EndIndex": 190235, - "Kind": 3 - }, - { - "EndIndex": 190263, - "Kind": 3 - }, - { - "EndIndex": 190269, - "Kind": 3 - }, - { - "EndIndex": 190291, - "Kind": 3 - }, - { - "EndIndex": 190397, - "Kind": 3 - }, - { - "EndIndex": 190425, - "Kind": 3 - }, - { - "EndIndex": 190431, - "Kind": 3 - }, - { - "EndIndex": 190461, - "Kind": 3 - }, - { - "EndIndex": 190590, - "Kind": 3 - }, - { - "EndIndex": 190618, - "Kind": 3 - }, - { - "EndIndex": 190624, - "Kind": 3 - }, - { - "EndIndex": 190642, - "Kind": 3 - }, - { - "EndIndex": 190676, - "Kind": 3 - }, - { - "EndIndex": 190935, - "Kind": 3 - }, - { - "EndIndex": 190949, - "Kind": 3 - }, - { - "EndIndex": 190955, - "Kind": 3 - }, - { - "EndIndex": 190986, - "Kind": 3 - }, - { - "EndIndex": 191423, - "Kind": 3 - }, - { - "EndIndex": 191479, - "Kind": 3 - }, - { - "EndIndex": 191485, - "Kind": 3 - }, - { - "EndIndex": 191512, - "Kind": 3 - }, - { - "EndIndex": 191734, - "Kind": 3 - }, - { - "EndIndex": 191748, - "Kind": 3 - }, - { - "EndIndex": 191754, - "Kind": 3 - }, - { - "EndIndex": 191784, - "Kind": 3 - }, - { - "EndIndex": 191889, - "Kind": 3 - }, - { - "EndIndex": 191910, - "Kind": 3 - }, - { - "EndIndex": 191916, - "Kind": 3 - }, - { - "EndIndex": 191957, - "Kind": 3 - }, - { - "EndIndex": 192246, - "Kind": 3 - }, - { - "EndIndex": 192274, - "Kind": 3 - }, - { - "EndIndex": 192280, - "Kind": 3 - }, - { - "EndIndex": 192304, - "Kind": 3 - }, - { - "EndIndex": 192362, - "Kind": 3 - }, - { - "EndIndex": 192376, - "Kind": 3 - }, - { - "EndIndex": 192382, - "Kind": 3 - }, - { - "EndIndex": 192426, - "Kind": 3 - }, - { - "EndIndex": 192684, - "Kind": 3 - }, - { - "EndIndex": 192702, - "Kind": 3 - }, - { - "EndIndex": 192708, - "Kind": 3 - }, - { - "EndIndex": 192753, - "Kind": 3 - }, - { - "EndIndex": 193041, - "Kind": 3 - }, - { - "EndIndex": 193059, - "Kind": 3 - }, - { - "EndIndex": 193065, - "Kind": 3 - }, - { - "EndIndex": 193087, - "Kind": 3 - }, - { - "EndIndex": 193268, - "Kind": 3 - }, - { - "EndIndex": 193296, - "Kind": 3 - }, - { - "EndIndex": 193302, - "Kind": 3 - }, - { - "EndIndex": 193334, - "Kind": 3 - }, - { - "EndIndex": 193793, - "Kind": 3 - }, - { - "EndIndex": 193849, - "Kind": 3 - }, - { - "EndIndex": 193855, - "Kind": 3 - }, - { - "EndIndex": 193893, - "Kind": 3 - }, - { - "EndIndex": 194358, - "Kind": 3 - }, - { - "EndIndex": 194388, - "Kind": 3 - }, - { - "EndIndex": 194394, - "Kind": 3 - }, - { - "EndIndex": 194424, - "Kind": 3 - }, - { - "EndIndex": 194555, - "Kind": 3 - }, - { - "EndIndex": 194583, - "Kind": 3 - }, - { - "EndIndex": 194589, - "Kind": 3 - }, - { - "EndIndex": 194626, - "Kind": 3 - }, - { - "EndIndex": 195007, - "Kind": 3 - }, - { - "EndIndex": 195037, - "Kind": 3 - }, - { - "EndIndex": 195043, - "Kind": 3 - }, - { - "EndIndex": 195080, - "Kind": 3 - }, - { - "EndIndex": 195255, - "Kind": 3 - }, - { - "EndIndex": 195280, - "Kind": 3 - }, - { - "EndIndex": 195286, - "Kind": 3 - }, - { - "EndIndex": 195338, - "Kind": 3 - }, - { - "EndIndex": 195622, - "Kind": 3 - }, - { - "EndIndex": 195644, - "Kind": 3 - }, - { - "EndIndex": 195650, - "Kind": 3 - }, - { - "EndIndex": 195679, - "Kind": 3 - }, - { - "EndIndex": 195834, - "Kind": 3 - }, - { - "EndIndex": 195862, - "Kind": 3 - }, - { - "EndIndex": 195868, - "Kind": 3 - }, - { - "EndIndex": 195893, - "Kind": 3 - }, - { - "EndIndex": 196030, - "Kind": 3 - }, - { - "EndIndex": 196058, - "Kind": 3 - }, - { - "EndIndex": 196064, - "Kind": 3 - }, - { - "EndIndex": 196086, - "Kind": 3 - }, - { - "EndIndex": 196255, - "Kind": 3 - }, - { - "EndIndex": 196283, - "Kind": 3 - }, - { - "EndIndex": 196289, - "Kind": 3 - }, - { - "EndIndex": 196330, - "Kind": 3 - }, - { - "EndIndex": 196640, - "Kind": 3 - }, - { - "EndIndex": 196654, - "Kind": 3 - }, - { - "EndIndex": 196660, - "Kind": 3 - }, - { - "EndIndex": 196682, - "Kind": 3 - }, - { - "EndIndex": 196788, - "Kind": 3 - }, - { - "EndIndex": 196816, - "Kind": 3 - }, - { - "EndIndex": 196822, - "Kind": 3 - }, - { - "EndIndex": 196851, - "Kind": 3 - }, - { - "EndIndex": 197004, - "Kind": 3 - }, - { - "EndIndex": 197032, - "Kind": 3 - }, - { - "EndIndex": 197038, - "Kind": 3 - }, - { - "EndIndex": 197040, - "Kind": 3 - }, - { - "EndIndex": 197060, - "Kind": 3 - }, - { - "EndIndex": 197226, - "Kind": 3 - }, - { - "EndIndex": 197244, - "Kind": 3 - }, - { - "EndIndex": 197246, - "Kind": 3 - }, - { - "EndIndex": 197259, - "Kind": 3 - }, - { - "EndIndex": 197343, - "Kind": 3 - }, - { - "EndIndex": 197358, - "Kind": 3 - }, - { - "EndIndex": 197360, - "Kind": 3 - }, - { - "EndIndex": 197429, - "Kind": 3 - }, - { - "EndIndex": 198151, - "Kind": 3 - }, - { - "EndIndex": 198161, - "Kind": 3 - }, - { - "EndIndex": 198163, - "Kind": 3 - }, - { - "EndIndex": 198185, - "Kind": 3 - }, - { - "EndIndex": 198304, - "Kind": 3 - }, - { - "EndIndex": 198314, - "Kind": 3 - }, - { - "EndIndex": 198316, - "Kind": 3 - }, - { - "EndIndex": 198336, - "Kind": 3 - }, - { - "EndIndex": 198455, - "Kind": 3 - }, - { - "EndIndex": 198465, - "Kind": 3 - }, - { - "EndIndex": 198467, - "Kind": 3 - }, - { - "EndIndex": 198492, - "Kind": 3 - }, - { - "EndIndex": 198598, - "Kind": 3 - }, - { - "EndIndex": 198608, - "Kind": 3 - }, - { - "EndIndex": 198610, - "Kind": 3 - }, - { - "EndIndex": 198633, - "Kind": 3 - }, - { - "EndIndex": 199275, - "Kind": 3 - }, - { - "EndIndex": 199294, - "Kind": 3 - }, - { - "EndIndex": 199296, - "Kind": 3 - }, - { - "EndIndex": 199315, - "Kind": 3 - }, - { - "EndIndex": 199382, - "Kind": 3 - }, - { - "EndIndex": 199401, - "Kind": 3 - }, - { - "EndIndex": 199403, - "Kind": 3 - }, - { - "EndIndex": 199429, - "Kind": 3 - }, - { - "EndIndex": 199756, - "Kind": 3 - }, - { - "EndIndex": 199783, - "Kind": 3 - }, - { - "EndIndex": 199822, - "Kind": 3 - }, - { - "EndIndex": 199861, - "Kind": 3 - }, - { - "EndIndex": 199875, - "Kind": 3 - }, - { - "EndIndex": 199881, - "Kind": 3 - }, - { - "EndIndex": 199923, - "Kind": 3 - }, - { - "EndIndex": 200254, - "Kind": 3 - }, - { - "EndIndex": 200268, - "Kind": 3 - }, - { - "EndIndex": 200274, - "Kind": 3 - }, - { - "EndIndex": 200292, - "Kind": 3 - }, - { - "EndIndex": 200325, - "Kind": 3 - }, - { - "EndIndex": 200476, - "Kind": 3 - }, - { - "EndIndex": 200497, - "Kind": 3 - }, - { - "EndIndex": 200503, - "Kind": 3 - }, - { - "EndIndex": 200528, - "Kind": 3 - }, - { - "EndIndex": 200561, - "Kind": 3 - }, - { - "EndIndex": 200589, - "Kind": 3 - }, - { - "EndIndex": 200595, - "Kind": 3 - }, - { - "EndIndex": 200620, - "Kind": 3 - }, - { - "EndIndex": 200653, - "Kind": 3 - }, - { - "EndIndex": 200667, - "Kind": 3 - }, - { - "EndIndex": 200673, - "Kind": 3 - }, - { - "EndIndex": 200700, - "Kind": 3 - }, - { - "EndIndex": 200750, - "Kind": 3 - }, - { - "EndIndex": 200780, - "Kind": 3 - }, - { - "EndIndex": 200786, - "Kind": 3 - }, - { - "EndIndex": 200804, - "Kind": 3 - }, - { - "EndIndex": 200846, - "Kind": 3 - }, - { - "EndIndex": 201172, - "Kind": 3 - }, - { - "EndIndex": 201194, - "Kind": 3 - }, - { - "EndIndex": 201200, - "Kind": 3 - }, - { - "EndIndex": 201202, - "Kind": 3 - }, - { - "EndIndex": 201238, - "Kind": 3 - }, - { - "EndIndex": 201578, - "Kind": 3 - }, - { - "EndIndex": 201588, - "Kind": 3 - }, - { - "EndIndex": 201590, - "Kind": 3 - }, - { - "EndIndex": 201626, - "Kind": 3 - }, - { - "EndIndex": 201975, - "Kind": 3 - }, - { - "EndIndex": 201985, - "Kind": 3 - }, - { - "EndIndex": 201987, - "Kind": 3 - }, - { - "EndIndex": 202010, - "Kind": 3 - }, - { - "EndIndex": 202020, - "Kind": 3 - }, - { - "EndIndex": 202022, - "Kind": 3 - }, - { - "EndIndex": 202045, - "Kind": 3 - }, - { - "EndIndex": 202248, - "Kind": 3 - }, - { - "EndIndex": 202272, - "Kind": 3 - }, - { - "EndIndex": 202311, - "Kind": 3 - }, - { - "EndIndex": 202350, - "Kind": 3 - }, - { - "EndIndex": 202364, - "Kind": 3 - }, - { - "EndIndex": 202370, - "Kind": 3 - }, - { - "EndIndex": 202421, - "Kind": 3 - }, - { - "EndIndex": 202628, - "Kind": 3 - }, - { - "EndIndex": 202642, - "Kind": 3 - }, - { - "EndIndex": 202648, - "Kind": 3 - }, - { - "EndIndex": 202666, - "Kind": 3 - }, - { - "EndIndex": 202699, - "Kind": 3 - }, - { - "EndIndex": 202850, - "Kind": 3 - }, - { - "EndIndex": 202871, - "Kind": 3 - }, - { - "EndIndex": 202877, - "Kind": 3 - }, - { - "EndIndex": 202902, - "Kind": 3 - }, - { - "EndIndex": 202935, - "Kind": 3 - }, - { - "EndIndex": 202960, - "Kind": 3 - }, - { - "EndIndex": 202966, - "Kind": 3 - }, - { - "EndIndex": 202991, - "Kind": 3 - }, - { - "EndIndex": 203024, - "Kind": 3 - }, - { - "EndIndex": 203038, - "Kind": 3 - }, - { - "EndIndex": 203044, - "Kind": 3 - }, - { - "EndIndex": 203071, - "Kind": 3 - }, - { - "EndIndex": 203121, - "Kind": 3 - }, - { - "EndIndex": 203151, - "Kind": 3 - }, - { - "EndIndex": 203157, - "Kind": 3 - }, - { - "EndIndex": 203175, - "Kind": 3 - }, - { - "EndIndex": 203217, - "Kind": 3 - }, - { - "EndIndex": 203543, - "Kind": 3 - }, - { - "EndIndex": 203565, - "Kind": 3 - }, - { - "EndIndex": 203571, - "Kind": 3 - }, - { - "EndIndex": 203573, - "Kind": 3 - }, - { - "EndIndex": 203606, - "Kind": 3 - }, - { - "EndIndex": 203783, - "Kind": 3 - }, - { - "EndIndex": 203798, - "Kind": 3 - }, - { - "EndIndex": 203800, - "Kind": 3 - }, - { - "EndIndex": 203842, - "Kind": 3 - }, - { - "EndIndex": 204104, - "Kind": 3 - }, - { - "EndIndex": 204114, - "Kind": 3 - }, - { - "EndIndex": 204116, - "Kind": 3 - }, - { - "EndIndex": 204132, - "Kind": 3 - }, - { - "EndIndex": 204318, - "Kind": 3 - }, - { - "EndIndex": 204341, - "Kind": 3 - }, - { - "EndIndex": 204343, - "Kind": 3 - }, - { - "EndIndex": 204368, - "Kind": 3 - }, - { - "EndIndex": 204514, - "Kind": 3 - }, - { - "EndIndex": 204532, - "Kind": 3 - }, - { - "EndIndex": 204534, - "Kind": 3 - }, - { - "EndIndex": 204550, - "Kind": 3 - }, - { - "EndIndex": 204713, - "Kind": 3 - }, - { - "EndIndex": 204727, - "Kind": 3 - }, - { - "EndIndex": 204729, - "Kind": 3 - }, - { - "EndIndex": 204761, - "Kind": 3 - }, - { - "EndIndex": 205083, - "Kind": 3 - }, - { - "EndIndex": 205093, - "Kind": 3 - }, - { - "EndIndex": 205095, - "Kind": 3 - }, - { - "EndIndex": 205113, - "Kind": 3 - }, - { - "EndIndex": 205212, - "Kind": 3 - }, - { - "EndIndex": 205227, - "Kind": 3 - }, - { - "EndIndex": 205229, - "Kind": 3 - }, - { - "EndIndex": 205243, - "Kind": 3 - }, - { - "EndIndex": 205403, - "Kind": 3 - }, - { - "EndIndex": 205417, - "Kind": 3 - }, - { - "EndIndex": 205419, - "Kind": 3 - }, - { - "EndIndex": 205439, - "Kind": 3 - }, - { - "EndIndex": 205757, - "Kind": 3 - }, - { - "EndIndex": 205772, - "Kind": 3 - }, - { - "EndIndex": 205774, - "Kind": 3 - }, - { - "EndIndex": 205812, - "Kind": 3 - }, - { - "EndIndex": 206068, - "Kind": 3 - }, - { - "EndIndex": 206078, - "Kind": 3 - }, - { - "EndIndex": 206080, - "Kind": 3 - }, - { - "EndIndex": 206118, - "Kind": 3 - }, - { - "EndIndex": 206372, - "Kind": 3 - }, - { - "EndIndex": 206382, - "Kind": 3 - }, - { - "EndIndex": 206384, - "Kind": 3 - }, - { - "EndIndex": 206415, - "Kind": 3 - }, - { - "EndIndex": 206679, - "Kind": 3 - }, - { - "EndIndex": 206689, - "Kind": 3 - }, - { - "EndIndex": 206691, - "Kind": 3 - }, - { - "EndIndex": 206706, - "Kind": 3 - }, - { - "EndIndex": 206756, - "Kind": 3 - }, - { - "EndIndex": 206770, - "Kind": 3 - }, - { - "EndIndex": 206772, - "Kind": 3 - }, - { - "EndIndex": 206792, - "Kind": 3 - }, - { - "EndIndex": 206911, - "Kind": 3 - }, - { - "EndIndex": 206921, - "Kind": 3 - }, - { - "EndIndex": 206923, - "Kind": 3 - }, - { - "EndIndex": 206938, - "Kind": 3 - }, - { - "EndIndex": 207214, - "Kind": 3 - }, - { - "EndIndex": 207237, - "Kind": 3 - }, - { - "EndIndex": 207239, - "Kind": 3 - }, - { - "EndIndex": 207259, - "Kind": 3 - }, - { - "EndIndex": 207443, - "Kind": 3 - }, - { - "EndIndex": 207464, - "Kind": 3 - }, - { - "EndIndex": 207503, - "Kind": 3 - }, - { - "EndIndex": 207542, - "Kind": 3 - }, - { - "EndIndex": 207556, - "Kind": 3 - }, - { - "EndIndex": 207562, - "Kind": 3 - }, - { - "EndIndex": 207605, - "Kind": 3 - }, - { - "EndIndex": 207793, - "Kind": 3 - }, - { - "EndIndex": 207807, - "Kind": 3 - }, - { - "EndIndex": 207813, - "Kind": 3 - }, - { - "EndIndex": 207831, - "Kind": 3 - }, - { - "EndIndex": 207864, - "Kind": 3 - }, - { - "EndIndex": 208015, - "Kind": 3 - }, - { - "EndIndex": 208036, - "Kind": 3 - }, - { - "EndIndex": 208042, - "Kind": 3 - }, - { - "EndIndex": 208067, - "Kind": 3 - }, - { - "EndIndex": 208100, - "Kind": 3 - }, - { - "EndIndex": 208122, - "Kind": 3 - }, - { - "EndIndex": 208128, - "Kind": 3 - }, - { - "EndIndex": 208153, - "Kind": 3 - }, - { - "EndIndex": 208186, - "Kind": 3 - }, - { - "EndIndex": 208200, - "Kind": 3 - }, - { - "EndIndex": 208206, - "Kind": 3 - }, - { - "EndIndex": 208233, - "Kind": 3 - }, - { - "EndIndex": 208283, - "Kind": 3 - }, - { - "EndIndex": 208313, - "Kind": 3 - }, - { - "EndIndex": 208319, - "Kind": 3 - }, - { - "EndIndex": 208337, - "Kind": 3 - }, - { - "EndIndex": 208379, - "Kind": 3 - }, - { - "EndIndex": 208705, - "Kind": 3 - }, - { - "EndIndex": 208727, - "Kind": 3 - }, - { - "EndIndex": 208733, - "Kind": 3 - }, - { - "EndIndex": 208735, - "Kind": 3 - }, - { - "EndIndex": 208781, - "Kind": 3 - }, - { - "EndIndex": 209107, - "Kind": 3 - }, - { - "EndIndex": 209117, - "Kind": 3 - }, - { - "EndIndex": 209119, - "Kind": 3 - }, - { - "EndIndex": 209146, - "Kind": 3 - }, - { - "EndIndex": 209219, - "Kind": 3 - }, - { - "EndIndex": 209247, - "Kind": 3 - }, - { - "EndIndex": 209280, - "Kind": 3 - }, - { - "EndIndex": 209309, - "Kind": 3 - }, - { - "EndIndex": 209330, - "Kind": 3 - }, - { - "EndIndex": 209336, - "Kind": 3 - }, - { - "EndIndex": 209362, - "Kind": 3 - }, - { - "EndIndex": 209383, - "Kind": 3 - }, - { - "EndIndex": 209389, - "Kind": 3 - }, - { - "EndIndex": 209419, - "Kind": 3 - }, - { - "EndIndex": 209450, - "Kind": 3 - }, - { - "EndIndex": 209472, - "Kind": 3 - }, - { - "EndIndex": 209478, - "Kind": 3 - }, - { - "EndIndex": 209503, - "Kind": 3 - }, - { - "EndIndex": 209517, - "Kind": 3 - }, - { - "EndIndex": 209523, - "Kind": 3 - }, - { - "EndIndex": 209553, - "Kind": 3 - }, - { - "EndIndex": 209584, - "Kind": 3 - }, - { - "EndIndex": 209606, - "Kind": 3 - }, - { - "EndIndex": 209612, - "Kind": 3 - }, - { - "EndIndex": 209651, - "Kind": 3 - }, - { - "EndIndex": 209690, - "Kind": 3 - }, - { - "EndIndex": 209704, - "Kind": 3 - }, - { - "EndIndex": 209710, - "Kind": 3 - }, - { - "EndIndex": 209743, - "Kind": 3 - }, - { - "EndIndex": 209772, - "Kind": 3 - }, - { - "EndIndex": 209786, - "Kind": 3 - }, - { - "EndIndex": 209792, - "Kind": 3 - }, - { - "EndIndex": 209822, - "Kind": 3 - }, - { - "EndIndex": 209852, - "Kind": 3 - }, - { - "EndIndex": 209874, - "Kind": 3 - }, - { - "EndIndex": 209880, - "Kind": 3 - }, - { - "EndIndex": 209905, - "Kind": 3 - }, - { - "EndIndex": 209935, - "Kind": 3 - }, - { - "EndIndex": 209953, - "Kind": 3 - }, - { - "EndIndex": 209959, - "Kind": 3 - }, - { - "EndIndex": 210001, - "Kind": 3 - }, - { - "EndIndex": 210078, - "Kind": 3 - }, - { - "EndIndex": 210092, - "Kind": 3 - }, - { - "EndIndex": 210098, - "Kind": 3 - }, - { - "EndIndex": 210116, - "Kind": 3 - }, - { - "EndIndex": 210149, - "Kind": 3 - }, - { - "EndIndex": 210300, - "Kind": 3 - }, - { - "EndIndex": 210321, - "Kind": 3 - }, - { - "EndIndex": 210327, - "Kind": 3 - }, - { - "EndIndex": 210357, - "Kind": 3 - }, - { - "EndIndex": 210388, - "Kind": 3 - }, - { - "EndIndex": 210410, - "Kind": 3 - }, - { - "EndIndex": 210416, - "Kind": 3 - }, - { - "EndIndex": 210440, - "Kind": 3 - }, - { - "EndIndex": 210469, - "Kind": 3 - }, - { - "EndIndex": 210487, - "Kind": 3 - }, - { - "EndIndex": 210493, - "Kind": 3 - }, - { - "EndIndex": 210523, - "Kind": 3 - }, - { - "EndIndex": 210553, - "Kind": 3 - }, - { - "EndIndex": 210575, - "Kind": 3 - }, - { - "EndIndex": 210581, - "Kind": 3 - }, - { - "EndIndex": 210611, - "Kind": 3 - }, - { - "EndIndex": 210642, - "Kind": 3 - }, - { - "EndIndex": 210664, - "Kind": 3 - }, - { - "EndIndex": 210670, - "Kind": 3 - }, - { - "EndIndex": 210695, - "Kind": 3 - }, - { - "EndIndex": 210725, - "Kind": 3 - }, - { - "EndIndex": 210744, - "Kind": 3 - }, - { - "EndIndex": 210750, - "Kind": 3 - }, - { - "EndIndex": 210790, - "Kind": 3 - }, - { - "EndIndex": 210825, - "Kind": 3 - }, - { - "EndIndex": 210846, - "Kind": 3 - }, - { - "EndIndex": 210852, - "Kind": 3 - }, - { - "EndIndex": 210870, - "Kind": 3 - }, - { - "EndIndex": 210912, - "Kind": 3 - }, - { - "EndIndex": 211238, - "Kind": 3 - }, - { - "EndIndex": 211260, - "Kind": 3 - }, - { - "EndIndex": 211266, - "Kind": 3 - }, - { - "EndIndex": 211281, - "Kind": 3 - }, - { - "EndIndex": 211310, - "Kind": 3 - }, - { - "EndIndex": 211375, - "Kind": 3 - }, - { - "EndIndex": 211389, - "Kind": 3 - }, - { - "EndIndex": 211395, - "Kind": 3 - }, - { - "EndIndex": 211424, - "Kind": 3 - }, - { - "EndIndex": 211479, - "Kind": 3 - }, - { - "EndIndex": 211493, - "Kind": 3 - }, - { - "EndIndex": 211499, - "Kind": 3 - }, - { - "EndIndex": 211514, - "Kind": 3 - }, - { - "EndIndex": 211541, - "Kind": 3 - }, - { - "EndIndex": 211604, - "Kind": 3 - }, - { - "EndIndex": 211618, - "Kind": 3 - }, - { - "EndIndex": 211624, - "Kind": 3 - }, - { - "EndIndex": 211639, - "Kind": 3 - }, - { - "EndIndex": 211668, - "Kind": 3 - }, - { - "EndIndex": 211739, - "Kind": 3 - }, - { - "EndIndex": 211753, - "Kind": 3 - }, - { - "EndIndex": 211759, - "Kind": 3 - }, - { - "EndIndex": 211774, - "Kind": 3 - }, - { - "EndIndex": 211797, - "Kind": 3 - }, - { - "EndIndex": 211896, - "Kind": 3 - }, - { - "EndIndex": 211915, - "Kind": 3 - }, - { - "EndIndex": 211921, - "Kind": 3 - }, - { - "EndIndex": 211941, - "Kind": 3 - }, - { - "EndIndex": 212018, - "Kind": 3 - }, - { - "EndIndex": 212037, - "Kind": 3 - }, - { - "EndIndex": 212043, - "Kind": 3 - }, - { - "EndIndex": 212058, - "Kind": 3 - }, - { - "EndIndex": 212083, - "Kind": 3 - }, - { - "EndIndex": 212147, - "Kind": 3 - }, - { - "EndIndex": 212161, - "Kind": 3 - }, - { - "EndIndex": 212167, - "Kind": 3 - }, - { - "EndIndex": 212182, - "Kind": 3 - }, - { - "EndIndex": 212205, - "Kind": 3 - }, - { - "EndIndex": 212304, - "Kind": 3 - }, - { - "EndIndex": 212318, - "Kind": 3 - }, - { - "EndIndex": 212324, - "Kind": 3 - }, - { - "EndIndex": 212339, - "Kind": 3 - }, - { - "EndIndex": 212360, - "Kind": 3 - }, - { - "EndIndex": 212467, - "Kind": 3 - }, - { - "EndIndex": 212481, - "Kind": 3 - }, - { - "EndIndex": 212487, - "Kind": 3 - }, - { - "EndIndex": 212502, - "Kind": 3 - }, - { - "EndIndex": 212522, - "Kind": 3 - }, - { - "EndIndex": 212574, - "Kind": 3 - }, - { - "EndIndex": 212588, - "Kind": 3 - }, - { - "EndIndex": 212594, - "Kind": 3 - }, - { - "EndIndex": 212609, - "Kind": 3 - }, - { - "EndIndex": 212634, - "Kind": 3 - }, - { - "EndIndex": 212696, - "Kind": 3 - }, - { - "EndIndex": 212710, - "Kind": 3 - }, - { - "EndIndex": 212716, - "Kind": 3 - }, - { - "EndIndex": 212740, - "Kind": 3 - }, - { - "EndIndex": 212815, - "Kind": 3 - }, - { - "EndIndex": 212829, - "Kind": 3 - }, - { - "EndIndex": 212835, - "Kind": 3 - }, - { - "EndIndex": 212850, - "Kind": 3 - }, - { - "EndIndex": 212872, - "Kind": 3 - }, - { - "EndIndex": 212968, - "Kind": 3 - }, - { - "EndIndex": 212982, - "Kind": 3 - }, - { - "EndIndex": 212988, - "Kind": 3 - }, - { - "EndIndex": 213003, - "Kind": 3 - }, - { - "EndIndex": 213027, - "Kind": 3 - }, - { - "EndIndex": 213146, - "Kind": 3 - }, - { - "EndIndex": 213160, - "Kind": 3 - }, - { - "EndIndex": 213166, - "Kind": 3 - }, - { - "EndIndex": 213181, - "Kind": 3 - }, - { - "EndIndex": 213208, - "Kind": 3 - }, - { - "EndIndex": 213277, - "Kind": 3 - }, - { - "EndIndex": 213291, - "Kind": 3 - }, - { - "EndIndex": 213297, - "Kind": 3 - }, - { - "EndIndex": 213321, - "Kind": 3 - }, - { - "EndIndex": 213380, - "Kind": 3 - }, - { - "EndIndex": 213394, - "Kind": 3 - }, - { - "EndIndex": 213400, - "Kind": 3 - }, - { - "EndIndex": 213423, - "Kind": 3 - }, - { - "EndIndex": 213487, - "Kind": 3 - }, - { - "EndIndex": 213501, - "Kind": 3 - }, - { - "EndIndex": 213507, - "Kind": 3 - }, - { - "EndIndex": 213509, - "Kind": 3 - }, - { - "EndIndex": 213555, - "Kind": 3 - }, - { - "EndIndex": 213883, - "Kind": 3 - }, - { - "EndIndex": 213893, - "Kind": 3 - }, - { - "EndIndex": 213895, - "Kind": 3 - }, - { - "EndIndex": 213930, - "Kind": 3 - }, - { - "EndIndex": 214107, - "Kind": 3 - }, - { - "EndIndex": 214117, - "Kind": 3 - }, - { - "EndIndex": 214119, - "Kind": 3 - }, - { - "EndIndex": 214137, - "Kind": 3 - }, - { - "EndIndex": 214229, - "Kind": 3 - }, - { - "EndIndex": 214244, - "Kind": 3 - }, - { - "EndIndex": 214246, - "Kind": 3 - }, - { - "EndIndex": 214324, - "Kind": 3 - }, - { - "EndIndex": 220772, - "Kind": 3 - }, - { - "EndIndex": 220782, - "Kind": 3 - }, - { - "EndIndex": 220784, - "Kind": 3 - }, - { - "EndIndex": 220797, - "Kind": 3 - }, - { - "EndIndex": 220862, - "Kind": 3 - }, - { - "EndIndex": 220872, - "Kind": 3 - }, - { - "EndIndex": 220874, - "Kind": 3 - }, - { - "EndIndex": 220893, - "Kind": 3 - }, - { - "EndIndex": 221092, - "Kind": 3 - }, - { - "EndIndex": 221102, - "Kind": 3 - }, - { - "EndIndex": 221104, - "Kind": 3 - }, - { - "EndIndex": 221118, - "Kind": 3 - }, - { - "EndIndex": 221526, - "Kind": 3 - }, - { - "EndIndex": 221536, - "Kind": 3 - }, - { - "EndIndex": 221538, - "Kind": 3 - }, - { - "EndIndex": 221561, - "Kind": 3 - }, - { - "EndIndex": 221571, - "Kind": 3 - }, - { - "EndIndex": 221573, - "Kind": 3 - }, - { - "EndIndex": 221595, - "Kind": 3 - }, - { - "EndIndex": 222030, - "Kind": 3 - }, - { - "EndIndex": 222055, - "Kind": 3 - }, - { - "EndIndex": 222076, - "Kind": 3 - }, - { - "EndIndex": 222098, - "Kind": 3 - }, - { - "EndIndex": 222104, - "Kind": 3 - }, - { - "EndIndex": 222127, - "Kind": 3 - }, - { - "EndIndex": 222161, - "Kind": 3 - }, - { - "EndIndex": 222192, - "Kind": 3 - }, - { - "EndIndex": 222214, - "Kind": 3 - }, - { - "EndIndex": 222220, - "Kind": 3 - }, - { - "EndIndex": 222250, - "Kind": 3 - }, - { - "EndIndex": 222281, - "Kind": 3 - }, - { - "EndIndex": 222303, - "Kind": 3 - }, - { - "EndIndex": 222309, - "Kind": 3 - }, - { - "EndIndex": 222339, - "Kind": 3 - }, - { - "EndIndex": 222370, - "Kind": 3 - }, - { - "EndIndex": 222392, - "Kind": 3 - }, - { - "EndIndex": 222398, - "Kind": 3 - }, - { - "EndIndex": 222437, - "Kind": 3 - }, - { - "EndIndex": 222476, - "Kind": 3 - }, - { - "EndIndex": 222490, - "Kind": 3 - }, - { - "EndIndex": 222496, - "Kind": 3 - }, - { - "EndIndex": 222529, - "Kind": 3 - }, - { - "EndIndex": 222558, - "Kind": 3 - }, - { - "EndIndex": 222572, - "Kind": 3 - }, - { - "EndIndex": 222578, - "Kind": 3 - }, - { - "EndIndex": 222608, - "Kind": 3 - }, - { - "EndIndex": 222638, - "Kind": 3 - }, - { - "EndIndex": 222660, - "Kind": 3 - }, - { - "EndIndex": 222666, - "Kind": 3 - }, - { - "EndIndex": 222691, - "Kind": 3 - }, - { - "EndIndex": 222721, - "Kind": 3 - }, - { - "EndIndex": 222739, - "Kind": 3 - }, - { - "EndIndex": 222745, - "Kind": 3 - }, - { - "EndIndex": 222794, - "Kind": 3 - }, - { - "EndIndex": 223233, - "Kind": 3 - }, - { - "EndIndex": 223247, - "Kind": 3 - }, - { - "EndIndex": 223253, - "Kind": 3 - }, - { - "EndIndex": 223271, - "Kind": 3 - }, - { - "EndIndex": 223304, - "Kind": 3 - }, - { - "EndIndex": 223455, - "Kind": 3 - }, - { - "EndIndex": 223476, - "Kind": 3 - }, - { - "EndIndex": 223482, - "Kind": 3 - }, - { - "EndIndex": 223507, - "Kind": 3 - }, - { - "EndIndex": 223540, - "Kind": 3 - }, - { - "EndIndex": 223564, - "Kind": 3 - }, - { - "EndIndex": 223570, - "Kind": 3 - }, - { - "EndIndex": 223600, - "Kind": 3 - }, - { - "EndIndex": 223631, - "Kind": 3 - }, - { - "EndIndex": 223653, - "Kind": 3 - }, - { - "EndIndex": 223659, - "Kind": 3 - }, - { - "EndIndex": 223683, - "Kind": 3 - }, - { - "EndIndex": 223712, - "Kind": 3 - }, - { - "EndIndex": 223730, - "Kind": 3 - }, - { - "EndIndex": 223736, - "Kind": 3 - }, - { - "EndIndex": 223766, - "Kind": 3 - }, - { - "EndIndex": 223796, - "Kind": 3 - }, - { - "EndIndex": 223818, - "Kind": 3 - }, - { - "EndIndex": 223824, - "Kind": 3 - }, - { - "EndIndex": 223854, - "Kind": 3 - }, - { - "EndIndex": 223885, - "Kind": 3 - }, - { - "EndIndex": 223907, - "Kind": 3 - }, - { - "EndIndex": 223913, - "Kind": 3 - }, - { - "EndIndex": 223940, - "Kind": 3 - }, - { - "EndIndex": 223970, - "Kind": 3 - }, - { - "EndIndex": 223976, - "Kind": 3 - }, - { - "EndIndex": 224001, - "Kind": 3 - }, - { - "EndIndex": 224031, - "Kind": 3 - }, - { - "EndIndex": 224050, - "Kind": 3 - }, - { - "EndIndex": 224056, - "Kind": 3 - }, - { - "EndIndex": 224085, - "Kind": 3 - }, - { - "EndIndex": 224123, - "Kind": 3 - }, - { - "EndIndex": 224137, - "Kind": 3 - }, - { - "EndIndex": 224143, - "Kind": 3 - }, - { - "EndIndex": 224161, - "Kind": 3 - }, - { - "EndIndex": 224203, - "Kind": 3 - }, - { - "EndIndex": 224529, - "Kind": 3 - }, - { - "EndIndex": 224551, - "Kind": 3 - }, - { - "EndIndex": 224557, - "Kind": 3 - }, - { - "EndIndex": 224582, - "Kind": 3 - }, - { - "EndIndex": 224670, - "Kind": 3 - }, - { - "EndIndex": 224688, - "Kind": 3 - }, - { - "EndIndex": 224694, - "Kind": 3 - }, - { - "EndIndex": 224719, - "Kind": 3 - }, - { - "EndIndex": 224856, - "Kind": 3 - }, - { - "EndIndex": 224874, - "Kind": 3 - }, - { - "EndIndex": 224880, - "Kind": 3 - }, - { - "EndIndex": 224895, - "Kind": 3 - }, - { - "EndIndex": 224917, - "Kind": 3 - }, - { - "EndIndex": 224931, - "Kind": 3 - }, - { - "EndIndex": 224937, - "Kind": 3 - }, - { - "EndIndex": 224952, - "Kind": 3 - }, - { - "EndIndex": 224973, - "Kind": 3 - }, - { - "EndIndex": 224987, - "Kind": 3 - }, - { - "EndIndex": 224993, - "Kind": 3 - }, - { - "EndIndex": 225008, - "Kind": 3 - }, - { - "EndIndex": 225029, - "Kind": 3 - }, - { - "EndIndex": 225043, - "Kind": 3 - }, - { - "EndIndex": 225049, - "Kind": 3 - }, - { - "EndIndex": 225051, - "Kind": 3 - }, - { - "EndIndex": 225067, - "Kind": 3 - }, - { - "EndIndex": 225207, - "Kind": 3 - }, - { - "EndIndex": 225222, - "Kind": 3 - }, - { - "EndIndex": 225224, - "Kind": 3 - }, - { - "EndIndex": 225249, - "Kind": 3 - }, - { - "EndIndex": 225321, - "Kind": 3 - }, - { - "EndIndex": 225347, - "Kind": 3 - }, - { - "EndIndex": 225386, - "Kind": 3 - }, - { - "EndIndex": 225425, - "Kind": 3 - }, - { - "EndIndex": 225439, - "Kind": 3 - }, - { - "EndIndex": 225445, - "Kind": 3 - }, - { - "EndIndex": 225487, - "Kind": 3 - }, - { - "EndIndex": 225563, - "Kind": 3 - }, - { - "EndIndex": 225577, - "Kind": 3 - }, - { - "EndIndex": 225583, - "Kind": 3 - }, - { - "EndIndex": 225601, - "Kind": 3 - }, - { - "EndIndex": 225634, - "Kind": 3 - }, - { - "EndIndex": 225785, - "Kind": 3 - }, - { - "EndIndex": 225806, - "Kind": 3 - }, - { - "EndIndex": 225812, - "Kind": 3 - }, - { - "EndIndex": 225837, - "Kind": 3 - }, - { - "EndIndex": 225870, - "Kind": 3 - }, - { - "EndIndex": 225897, - "Kind": 3 - }, - { - "EndIndex": 225903, - "Kind": 3 - }, - { - "EndIndex": 225935, - "Kind": 3 - }, - { - "EndIndex": 226001, - "Kind": 3 - }, - { - "EndIndex": 226019, - "Kind": 3 - }, - { - "EndIndex": 226025, - "Kind": 3 - }, - { - "EndIndex": 226050, - "Kind": 3 - }, - { - "EndIndex": 226083, - "Kind": 3 - }, - { - "EndIndex": 226097, - "Kind": 3 - }, - { - "EndIndex": 226103, - "Kind": 3 - }, - { - "EndIndex": 226130, - "Kind": 3 - }, - { - "EndIndex": 226180, - "Kind": 3 - }, - { - "EndIndex": 226210, - "Kind": 3 - }, - { - "EndIndex": 226216, - "Kind": 3 - }, - { - "EndIndex": 226252, - "Kind": 3 - }, - { - "EndIndex": 226301, - "Kind": 3 - }, - { - "EndIndex": 226322, - "Kind": 3 - }, - { - "EndIndex": 226328, - "Kind": 3 - }, - { - "EndIndex": 226346, - "Kind": 3 - }, - { - "EndIndex": 226388, - "Kind": 3 - }, - { - "EndIndex": 226714, - "Kind": 3 - }, - { - "EndIndex": 226736, - "Kind": 3 - }, - { - "EndIndex": 226742, - "Kind": 3 - }, - { - "EndIndex": 226744, - "Kind": 3 - }, - { - "EndIndex": 226773, - "Kind": 3 - }, - { - "EndIndex": 226988, - "Kind": 3 - }, - { - "EndIndex": 227004, - "Kind": 3 - }, - { - "EndIndex": 227006, - "Kind": 3 - }, - { - "EndIndex": 227038, - "Kind": 3 - }, - { - "EndIndex": 227165, - "Kind": 3 - }, - { - "EndIndex": 227175, - "Kind": 3 - }, - { - "EndIndex": 227177, - "Kind": 3 - }, - { - "EndIndex": 227199, - "Kind": 3 - }, - { - "EndIndex": 227325, - "Kind": 3 - }, - { - "EndIndex": 227348, - "Kind": 3 - }, - { - "EndIndex": 227378, - "Kind": 3 - }, - { - "EndIndex": 227409, - "Kind": 3 - }, - { - "EndIndex": 227431, - "Kind": 3 - }, - { - "EndIndex": 227437, - "Kind": 3 - }, - { - "EndIndex": 227467, - "Kind": 3 - }, - { - "EndIndex": 227498, - "Kind": 3 - }, - { - "EndIndex": 227520, - "Kind": 3 - }, - { - "EndIndex": 227526, - "Kind": 3 - }, - { - "EndIndex": 227565, - "Kind": 3 - }, - { - "EndIndex": 227604, - "Kind": 3 - }, - { - "EndIndex": 227618, - "Kind": 3 - }, - { - "EndIndex": 227624, - "Kind": 3 - }, - { - "EndIndex": 227654, - "Kind": 3 - }, - { - "EndIndex": 227684, - "Kind": 3 - }, - { - "EndIndex": 227706, - "Kind": 3 - }, - { - "EndIndex": 227712, - "Kind": 3 - }, - { - "EndIndex": 227733, - "Kind": 3 - }, - { - "EndIndex": 227782, - "Kind": 3 - }, - { - "EndIndex": 227912, - "Kind": 3 - }, - { - "EndIndex": 227926, - "Kind": 3 - }, - { - "EndIndex": 227932, - "Kind": 3 - }, - { - "EndIndex": 227950, - "Kind": 3 - }, - { - "EndIndex": 227983, - "Kind": 3 - }, - { - "EndIndex": 228134, - "Kind": 3 - }, - { - "EndIndex": 228155, - "Kind": 3 - }, - { - "EndIndex": 228161, - "Kind": 3 - }, - { - "EndIndex": 228191, - "Kind": 3 - }, - { - "EndIndex": 228222, - "Kind": 3 - }, - { - "EndIndex": 228244, - "Kind": 3 - }, - { - "EndIndex": 228250, - "Kind": 3 - }, - { - "EndIndex": 228280, - "Kind": 3 - }, - { - "EndIndex": 228310, - "Kind": 3 - }, - { - "EndIndex": 228332, - "Kind": 3 - }, - { - "EndIndex": 228338, - "Kind": 3 - }, - { - "EndIndex": 228368, - "Kind": 3 - }, - { - "EndIndex": 228399, - "Kind": 3 - }, - { - "EndIndex": 228421, - "Kind": 3 - }, - { - "EndIndex": 228427, - "Kind": 3 - }, - { - "EndIndex": 228454, - "Kind": 3 - }, - { - "EndIndex": 228504, - "Kind": 3 - }, - { - "EndIndex": 228534, - "Kind": 3 - }, - { - "EndIndex": 228540, - "Kind": 3 - }, - { - "EndIndex": 228565, - "Kind": 3 - }, - { - "EndIndex": 228595, - "Kind": 3 - }, - { - "EndIndex": 228614, - "Kind": 3 - }, - { - "EndIndex": 228620, - "Kind": 3 - }, - { - "EndIndex": 228638, - "Kind": 3 - }, - { - "EndIndex": 228680, - "Kind": 3 - }, - { - "EndIndex": 229006, - "Kind": 3 - }, - { - "EndIndex": 229028, - "Kind": 3 - }, - { - "EndIndex": 229034, - "Kind": 3 - }, - { - "EndIndex": 229058, - "Kind": 3 - }, - { - "EndIndex": 229341, - "Kind": 3 - }, - { - "EndIndex": 229365, - "Kind": 3 - }, - { - "EndIndex": 229371, - "Kind": 3 - }, - { - "EndIndex": 229386, - "Kind": 3 - }, - { - "EndIndex": 229408, - "Kind": 3 - }, - { - "EndIndex": 229422, - "Kind": 3 - }, - { - "EndIndex": 229428, - "Kind": 3 - }, - { - "EndIndex": 229443, - "Kind": 3 - }, - { - "EndIndex": 229464, - "Kind": 3 - }, - { - "EndIndex": 229478, - "Kind": 3 - }, - { - "EndIndex": 229484, - "Kind": 3 - }, - { - "EndIndex": 229499, - "Kind": 3 - }, - { - "EndIndex": 229520, - "Kind": 3 - }, - { - "EndIndex": 229534, - "Kind": 3 - }, - { - "EndIndex": 229540, - "Kind": 3 - }, - { - "EndIndex": 229542, - "Kind": 3 - }, - { - "EndIndex": 229565, - "Kind": 3 - }, - { - "EndIndex": 229795, - "Kind": 3 - }, - { - "EndIndex": 229818, - "Kind": 3 - }, - { - "EndIndex": 229820, - "Kind": 3 - }, - { - "EndIndex": 229847, - "Kind": 3 - }, - { - "EndIndex": 230087, - "Kind": 3 - }, - { - "EndIndex": 230097, - "Kind": 3 - }, - { - "EndIndex": 230099, - "Kind": 3 - }, - { - "EndIndex": 230121, - "Kind": 3 - }, - { - "EndIndex": 230609, - "Kind": 3 - }, - { - "EndIndex": 230632, - "Kind": 3 - }, - { - "EndIndex": 230673, - "Kind": 3 - }, - { - "EndIndex": 230741, - "Kind": 3 - }, - { - "EndIndex": 230765, - "Kind": 3 - }, - { - "EndIndex": 230771, - "Kind": 3 - }, - { - "EndIndex": 230810, - "Kind": 3 - }, - { - "EndIndex": 230849, - "Kind": 3 - }, - { - "EndIndex": 230863, - "Kind": 3 - }, - { - "EndIndex": 230869, - "Kind": 3 - }, - { - "EndIndex": 230907, - "Kind": 3 - }, - { - "EndIndex": 231399, - "Kind": 3 - }, - { - "EndIndex": 231413, - "Kind": 3 - }, - { - "EndIndex": 231419, - "Kind": 3 - }, - { - "EndIndex": 231437, - "Kind": 3 - }, - { - "EndIndex": 231470, - "Kind": 3 - }, - { - "EndIndex": 231621, - "Kind": 3 - }, - { - "EndIndex": 231642, - "Kind": 3 - }, - { - "EndIndex": 231648, - "Kind": 3 - }, - { - "EndIndex": 231673, - "Kind": 3 - }, - { - "EndIndex": 231703, - "Kind": 3 - }, - { - "EndIndex": 231722, - "Kind": 3 - }, - { - "EndIndex": 231728, - "Kind": 3 - }, - { - "EndIndex": 231743, - "Kind": 3 - }, - { - "EndIndex": 231768, - "Kind": 3 - }, - { - "EndIndex": 231822, - "Kind": 3 - }, - { - "EndIndex": 231836, - "Kind": 3 - }, - { - "EndIndex": 231842, - "Kind": 3 - }, - { - "EndIndex": 231857, - "Kind": 3 - }, - { - "EndIndex": 231888, - "Kind": 3 - }, - { - "EndIndex": 231954, - "Kind": 3 - }, - { - "EndIndex": 231968, - "Kind": 3 - }, - { - "EndIndex": 231974, - "Kind": 3 - }, - { - "EndIndex": 231992, - "Kind": 3 - }, - { - "EndIndex": 232034, - "Kind": 3 - }, - { - "EndIndex": 232360, - "Kind": 3 - }, - { - "EndIndex": 232382, - "Kind": 3 - }, - { - "EndIndex": 232388, - "Kind": 3 - }, - { - "EndIndex": 232403, - "Kind": 3 - }, - { - "EndIndex": 232433, - "Kind": 3 - }, - { - "EndIndex": 232471, - "Kind": 3 - }, - { - "EndIndex": 232485, - "Kind": 3 - }, - { - "EndIndex": 232491, - "Kind": 3 - }, - { - "EndIndex": 232493, - "Kind": 3 - }, - { - "EndIndex": 232517, - "Kind": 3 - }, - { - "EndIndex": 232649, - "Kind": 3 - }, - { - "EndIndex": 232668, - "Kind": 3 - }, - { - "EndIndex": 232670, - "Kind": 3 - }, - { - "EndIndex": 232690, - "Kind": 3 - }, - { - "EndIndex": 233001, - "Kind": 3 - }, - { - "EndIndex": 233022, - "Kind": 3 - }, - { - "EndIndex": 233061, - "Kind": 3 - }, - { - "EndIndex": 233100, - "Kind": 3 - }, - { - "EndIndex": 233114, - "Kind": 3 - }, - { - "EndIndex": 233120, - "Kind": 3 - }, - { - "EndIndex": 233162, - "Kind": 3 - }, - { - "EndIndex": 233477, - "Kind": 3 - }, - { - "EndIndex": 233491, - "Kind": 3 - }, - { - "EndIndex": 233497, - "Kind": 3 - }, - { - "EndIndex": 233515, - "Kind": 3 - }, - { - "EndIndex": 233548, - "Kind": 3 - }, - { - "EndIndex": 233699, - "Kind": 3 - }, - { - "EndIndex": 233720, - "Kind": 3 - }, - { - "EndIndex": 233726, - "Kind": 3 - }, - { - "EndIndex": 233751, - "Kind": 3 - }, - { - "EndIndex": 233784, - "Kind": 3 - }, - { - "EndIndex": 233806, - "Kind": 3 - }, - { - "EndIndex": 233812, - "Kind": 3 - }, - { - "EndIndex": 233837, - "Kind": 3 - }, - { - "EndIndex": 233870, - "Kind": 3 - }, - { - "EndIndex": 233884, - "Kind": 3 - }, - { - "EndIndex": 233890, - "Kind": 3 - }, - { - "EndIndex": 233917, - "Kind": 3 - }, - { - "EndIndex": 233967, - "Kind": 3 - }, - { - "EndIndex": 233997, - "Kind": 3 - }, - { - "EndIndex": 234003, - "Kind": 3 - }, - { - "EndIndex": 234021, - "Kind": 3 - }, - { - "EndIndex": 234063, - "Kind": 3 - }, - { - "EndIndex": 234389, - "Kind": 3 - }, - { - "EndIndex": 234411, - "Kind": 3 - }, - { - "EndIndex": 234417, - "Kind": 3 - }, - { - "EndIndex": 234419, - "Kind": 3 - } - ], - "FileSize": 234419, - "Id": -1981595346, - "Name": "builtins", - "IndexSpan": null -} \ No newline at end of file diff --git a/src/Caching/Test/Files/MemberLocations.json b/src/Caching/Test/Files/MemberLocations.json index 883fc6859..1269c8e2f 100644 --- a/src/Caching/Test/Files/MemberLocations.json +++ b/src/Caching/Test/Files/MemberLocations.json @@ -24,8 +24,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": 799444, "Name": "sum", "IndexSpan": { @@ -36,7 +36,7 @@ ], "Variables": [ { - "Value": "bool", + "Value": "t:bool", "Id": -529376420, "Name": "__debug__", "IndexSpan": { @@ -45,7 +45,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": -1636005055, "Name": "__doc__", "IndexSpan": { @@ -54,7 +54,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": 875442003, "Name": "__file__", "IndexSpan": { @@ -63,7 +63,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": 1097116834, "Name": "__name__", "IndexSpan": { @@ -72,7 +72,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": 75395663, "Name": "__package__", "IndexSpan": { @@ -81,7 +81,7 @@ } }, { - "Value": "list", + "Value": "t:list", "Id": 1154586556, "Name": "__path__", "IndexSpan": { @@ -90,7 +90,7 @@ } }, { - "Value": "dict", + "Value": "t:dict", "Id": 817929997, "Name": "__dict__", "IndexSpan": { @@ -112,7 +112,7 @@ { "Documentation": null, "Bases": [ - "object" + "t:object" ], "Methods": [ { @@ -122,7 +122,7 @@ "Parameters": [ { "Name": "self", - "Type": "module:B", + "Type": "t:module:B", "DefaultValue": null, "Kind": 0 } @@ -131,8 +131,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": 935009768, "Name": "methodB2", "IndexSpan": { @@ -160,24 +160,6 @@ "Id": 833, "Name": "x", "IndexSpan": null - }, - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } } ], "GenericParameters": null, @@ -185,7 +167,7 @@ { "Documentation": null, "Bases": [ - "object" + "t:object" ], "Methods": [ { @@ -195,7 +177,7 @@ "Parameters": [ { "Name": "self", - "Type": "module:C", + "Type": "t:module:C", "DefaultValue": null, "Kind": 0 } @@ -204,8 +186,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": 965872103, "Name": "__init__", "IndexSpan": { @@ -220,7 +202,7 @@ "Parameters": [ { "Name": "self", - "Type": "module:C", + "Type": "t:module:C", "DefaultValue": null, "Kind": 0 } @@ -229,8 +211,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": -1909501045, "Name": "methodC", "IndexSpan": { @@ -240,26 +222,7 @@ } ], "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], + "Fields": [], "GenericParameters": null, "InnerClasses": [], "Id": 780, diff --git a/src/Caching/Test/Files/NestedClasses.json b/src/Caching/Test/Files/NestedClasses.json index 4549d8e3e..1ef88efe2 100644 --- a/src/Caching/Test/Files/NestedClasses.json +++ b/src/Caching/Test/Files/NestedClasses.json @@ -4,7 +4,7 @@ "Functions": [], "Variables": [ { - "Value": "bool", + "Value": "t:bool", "Id": -529376420, "Name": "__debug__", "IndexSpan": { @@ -13,7 +13,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": -1636005055, "Name": "__doc__", "IndexSpan": { @@ -22,7 +22,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": 875442003, "Name": "__file__", "IndexSpan": { @@ -31,7 +31,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": 1097116834, "Name": "__name__", "IndexSpan": { @@ -40,7 +40,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": 75395663, "Name": "__package__", "IndexSpan": { @@ -49,7 +49,7 @@ } }, { - "Value": "list", + "Value": "t:list", "Id": 1154586556, "Name": "__path__", "IndexSpan": { @@ -58,7 +58,7 @@ } }, { - "Value": "dict", + "Value": "t:dict", "Id": 817929997, "Name": "__dict__", "IndexSpan": { @@ -89,7 +89,7 @@ { "Documentation": null, "Bases": [ - "object" + "t:object" ], "Methods": [ { @@ -99,7 +99,7 @@ "Parameters": [ { "Name": "self", - "Type": "module:A", + "Type": "t:module:A", "DefaultValue": null, "Kind": 0 } @@ -108,8 +108,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": -1909501047, "Name": "methodA", "IndexSpan": { @@ -119,26 +119,7 @@ } ], "Properties": [], - "Fields": [ - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], + "Fields": [], "GenericParameters": null, "InnerClasses": [], "Id": 778, @@ -151,7 +132,7 @@ { "Documentation": null, "Bases": [ - "object" + "t:object" ], "Methods": [ { @@ -161,7 +142,7 @@ "Parameters": [ { "Name": "self", - "Type": "module:B", + "Type": "t:module:B", "DefaultValue": null, "Kind": 0 } @@ -170,8 +151,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": 935009767, "Name": "methodB1", "IndexSpan": { @@ -186,7 +167,7 @@ "Parameters": [ { "Name": "self", - "Type": "module:B", + "Type": "t:module:B", "DefaultValue": null, "Kind": 0 } @@ -195,8 +176,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": 935009768, "Name": "methodB2", "IndexSpan": { @@ -212,24 +193,6 @@ "Id": 833, "Name": "x", "IndexSpan": null - }, - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } } ], "GenericParameters": null, @@ -237,7 +200,7 @@ { "Documentation": null, "Bases": [ - "object" + "t:object" ], "Methods": [ { @@ -247,7 +210,7 @@ "Parameters": [ { "Name": "self", - "Type": "module:C", + "Type": "t:module:C", "DefaultValue": null, "Kind": 0 } @@ -256,8 +219,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": 965872103, "Name": "__init__", "IndexSpan": { @@ -272,7 +235,7 @@ "Parameters": [ { "Name": "self", - "Type": "module:C", + "Type": "t:module:C", "DefaultValue": null, "Kind": 0 } @@ -281,8 +244,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": -1909501045, "Name": "methodC", "IndexSpan": { @@ -298,24 +261,6 @@ "Id": 834, "Name": "y", "IndexSpan": null - }, - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } } ], "GenericParameters": null, diff --git a/src/Caching/Test/Files/Requests.json b/src/Caching/Test/Files/Requests.json deleted file mode 100644 index 9d3fa1f73..000000000 --- a/src/Caching/Test/Files/Requests.json +++ /dev/null @@ -1,991 +0,0 @@ -{ - "UniqueId": "requests(2.21.0)", - "Documentation": "Requests HTTP Library\r\n~~~~~~~~~~~~~~~~~~~~~\r\n\r\nRequests is an HTTP library, written in Python, for human beings. Basic GET\r\nusage:\r\n\r\n >>> import requests\r\n >>> r = requests.get('https://www.python.org')\r\n >>> r.status_code\r\n 200\r\n >>> 'Python is a programming language' in r.content\r\n True\r\n\r\n... or POST:\r\n\r\n >>> payload = dict(key1='value1', key2='value2')\r\n >>> r = requests.post('https://httpbin.org/post', data=payload)\r\n >>> print(r.text)\r\n {\r\n ...\r\n \"form\": {\r\n \"key2\": \"value2\",\r\n \"key1\": \"value1\"\r\n },\r\n ...\r\n }\r\n\r\nThe other HTTP methods are supported - see `requests.api`. Full documentation\r\nis at .\r\n\r\n:copyright: (c) 2017 by Kenneth Reitz.\r\n:license: Apache 2.0, see LICENSE for more details.\r\n", - "Functions": [ - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "urllib3_version", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "chardet_version", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 435179778, - "Name": "check_compatibility", - "IndexSpan": { - "Start": 973, - "Length": 19 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "cryptography_version", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -399540245, - "Name": "_check_cryptography", - "IndexSpan": { - "Start": 1808, - "Length": 19 - } - } - ], - "Variables": [ - { - "Value": "urllib3", - "Id": 1260465222, - "Name": "urllib3", - "IndexSpan": { - "Start": 878, - "Length": 7 - } - }, - { - "Value": "chardet", - "Id": -2125975290, - "Name": "chardet", - "IndexSpan": { - "Start": 893, - "Length": 7 - } - }, - { - "Value": "warnings", - "Id": 1876311406, - "Name": "warnings", - "IndexSpan": { - "Start": 908, - "Length": 8 - } - }, - { - "Value": "requests.exceptions:RequestsDependencyWarning", - "Id": -802098666, - "Name": "RequestsDependencyWarning", - "IndexSpan": { - "Start": 941, - "Length": 25 - } - }, - { - "Value": "urllib3.contrib.pyopenssl", - "Id": -1632802014, - "Name": "pyopenssl", - "IndexSpan": { - "Start": 2657, - "Length": 9 - } - }, - { - "Value": "urllib3.exceptions:DependencyWarning", - "Id": -891041158, - "Name": "DependencyWarning", - "IndexSpan": { - "Start": 2960, - "Length": 17 - } - }, - { - "Value": "i:str", - "Id": 916650529, - "Name": "__title__", - "IndexSpan": { - "Start": 3055, - "Length": 9 - } - }, - { - "Value": "i:str", - "Id": -1883656187, - "Name": "__description__", - "IndexSpan": { - "Start": 3066, - "Length": 15 - } - }, - { - "Value": "i:str", - "Id": -1620207176, - "Name": "__url__", - "IndexSpan": { - "Start": 3083, - "Length": 7 - } - }, - { - "Value": "i:str", - "Id": 1161199201, - "Name": "__version__", - "IndexSpan": { - "Start": 3092, - "Length": 11 - } - }, - { - "Value": "i:int", - "Id": -1840123721, - "Name": "__build__", - "IndexSpan": { - "Start": 3129, - "Length": 9 - } - }, - { - "Value": "i:str", - "Id": 1654469090, - "Name": "__author__", - "IndexSpan": { - "Start": 3140, - "Length": 10 - } - }, - { - "Value": "i:str", - "Id": -94198849, - "Name": "__author_email__", - "IndexSpan": { - "Start": 3152, - "Length": 16 - } - }, - { - "Value": "i:str", - "Id": -386551926, - "Name": "__license__", - "IndexSpan": { - "Start": 3170, - "Length": 11 - } - }, - { - "Value": "i:str", - "Id": 1739624272, - "Name": "__copyright__", - "IndexSpan": { - "Start": 3207, - "Length": 13 - } - }, - { - "Value": "i:str", - "Id": 782136591, - "Name": "__cake__", - "IndexSpan": { - "Start": 3222, - "Length": 8 - } - }, - { - "Value": "requests.utils", - "Id": 770082554, - "Name": "utils", - "IndexSpan": { - "Start": 3246, - "Length": 5 - } - }, - { - "Value": "requests.packages", - "Id": 2129088004, - "Name": "packages", - "IndexSpan": { - "Start": 3266, - "Length": 8 - } - }, - { - "Value": "requests.models:Request", - "Id": -104689032, - "Name": "Request", - "IndexSpan": { - "Start": 3295, - "Length": 7 - } - }, - { - "Value": "requests.models:Response", - "Id": 1102541176, - "Name": "Response", - "IndexSpan": { - "Start": 3304, - "Length": 8 - } - }, - { - "Value": "requests.models:PreparedRequest", - "Id": 1337118331, - "Name": "PreparedRequest", - "IndexSpan": { - "Start": 3314, - "Length": 15 - } - }, - { - "Value": "requests.api:request", - "Id": -1769342312, - "Name": "request", - "IndexSpan": { - "Start": 3347, - "Length": 7 - } - }, - { - "Value": "requests.api:get", - "Id": 787423, - "Name": "get", - "IndexSpan": { - "Start": 3356, - "Length": 3 - } - }, - { - "Value": "requests.api:head", - "Id": 24439415, - "Name": "head", - "IndexSpan": { - "Start": 3361, - "Length": 4 - } - }, - { - "Value": "requests.api:post", - "Id": 24687927, - "Name": "post", - "IndexSpan": { - "Start": 3367, - "Length": 4 - } - }, - { - "Value": "requests.api:patch", - "Id": 764909201, - "Name": "patch", - "IndexSpan": { - "Start": 3373, - "Length": 5 - } - }, - { - "Value": "requests.api:put", - "Id": 796568, - "Name": "put", - "IndexSpan": { - "Start": 3380, - "Length": 3 - } - }, - { - "Value": "requests.api:delete", - "Id": 1897257090, - "Name": "delete", - "IndexSpan": { - "Start": 3385, - "Length": 6 - } - }, - { - "Value": "requests.api:options", - "Id": 180457127, - "Name": "options", - "IndexSpan": { - "Start": 3393, - "Length": 7 - } - }, - { - "Value": "requests.sessions:session", - "Id": -880047457, - "Name": "session", - "IndexSpan": { - "Start": 3423, - "Length": 7 - } - }, - { - "Value": "requests.sessions:Session", - "Id": 784605823, - "Name": "Session", - "IndexSpan": { - "Start": 3432, - "Length": 7 - } - }, - { - "Value": "i:requests.structures:LookupDict", - "Id": 753305199, - "Name": "codes", - "IndexSpan": { - "Start": 3466, - "Length": 5 - } - }, - { - "Value": "requests.exceptions:RequestException", - "Id": 355509431, - "Name": "RequestException", - "IndexSpan": { - "Start": 3502, - "Length": 16 - } - }, - { - "Value": "requests.exceptions:Timeout", - "Id": 1780673866, - "Name": "Timeout", - "IndexSpan": { - "Start": 3520, - "Length": 7 - } - }, - { - "Value": "requests.exceptions:URLRequired", - "Id": 1361573271, - "Name": "URLRequired", - "IndexSpan": { - "Start": 3529, - "Length": 11 - } - }, - { - "Value": "requests.exceptions:TooManyRedirects", - "Id": 511002043, - "Name": "TooManyRedirects", - "IndexSpan": { - "Start": 3546, - "Length": 16 - } - }, - { - "Value": "requests.exceptions:HTTPError", - "Id": -1546903511, - "Name": "HTTPError", - "IndexSpan": { - "Start": 3564, - "Length": 9 - } - }, - { - "Value": "requests.exceptions:ConnectionError", - "Id": 853386419, - "Name": "ConnectionError", - "IndexSpan": { - "Start": 3575, - "Length": 15 - } - }, - { - "Value": "requests.exceptions:FileModeWarning", - "Id": 1675678790, - "Name": "FileModeWarning", - "IndexSpan": { - "Start": 3596, - "Length": 15 - } - }, - { - "Value": "requests.exceptions:ConnectTimeout", - "Id": -1047738098, - "Name": "ConnectTimeout", - "IndexSpan": { - "Start": 3613, - "Length": 14 - } - }, - { - "Value": "requests.exceptions:ReadTimeout", - "Id": -1711523244, - "Name": "ReadTimeout", - "IndexSpan": { - "Start": 3629, - "Length": 11 - } - }, - { - "Value": "logging", - "Id": 1772213096, - "Name": "logging", - "IndexSpan": { - "Start": 3719, - "Length": 7 - } - }, - { - "Value": "logging:NullHandler", - "Id": -1600735444, - "Name": "NullHandler", - "IndexSpan": { - "Start": 3747, - "Length": 11 - } - }, - { - "Value": "typing:Any", - "Id": 751189, - "Name": "Any", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Classes": [], - "NewLines": [ - { - "EndIndex": 24, - "Kind": 1 - }, - { - "EndIndex": 25, - "Kind": 1 - }, - { - "EndIndex": 32, - "Kind": 1 - }, - { - "EndIndex": 63, - "Kind": 1 - }, - { - "EndIndex": 93, - "Kind": 1 - }, - { - "EndIndex": 106, - "Kind": 1 - }, - { - "EndIndex": 107, - "Kind": 1 - }, - { - "EndIndex": 111, - "Kind": 1 - }, - { - "EndIndex": 133, - "Kind": 1 - }, - { - "EndIndex": 155, - "Kind": 1 - }, - { - "EndIndex": 156, - "Kind": 1 - }, - { - "EndIndex": 232, - "Kind": 1 - }, - { - "EndIndex": 239, - "Kind": 1 - }, - { - "EndIndex": 240, - "Kind": 1 - }, - { - "EndIndex": 263, - "Kind": 1 - }, - { - "EndIndex": 313, - "Kind": 1 - }, - { - "EndIndex": 334, - "Kind": 1 - }, - { - "EndIndex": 341, - "Kind": 1 - }, - { - "EndIndex": 396, - "Kind": 1 - }, - { - "EndIndex": 404, - "Kind": 1 - }, - { - "EndIndex": 405, - "Kind": 1 - }, - { - "EndIndex": 418, - "Kind": 1 - }, - { - "EndIndex": 419, - "Kind": 1 - }, - { - "EndIndex": 471, - "Kind": 1 - }, - { - "EndIndex": 538, - "Kind": 1 - }, - { - "EndIndex": 559, - "Kind": 1 - }, - { - "EndIndex": 564, - "Kind": 1 - }, - { - "EndIndex": 573, - "Kind": 1 - }, - { - "EndIndex": 588, - "Kind": 1 - }, - { - "EndIndex": 613, - "Kind": 1 - }, - { - "EndIndex": 637, - "Kind": 1 - }, - { - "EndIndex": 645, - "Kind": 1 - }, - { - "EndIndex": 654, - "Kind": 1 - }, - { - "EndIndex": 659, - "Kind": 1 - }, - { - "EndIndex": 660, - "Kind": 1 - }, - { - "EndIndex": 738, - "Kind": 1 - }, - { - "EndIndex": 774, - "Kind": 1 - }, - { - "EndIndex": 775, - "Kind": 1 - }, - { - "EndIndex": 814, - "Kind": 1 - }, - { - "EndIndex": 866, - "Kind": 1 - }, - { - "EndIndex": 870, - "Kind": 1 - }, - { - "EndIndex": 871, - "Kind": 1 - }, - { - "EndIndex": 886, - "Kind": 1 - }, - { - "EndIndex": 901, - "Kind": 1 - }, - { - "EndIndex": 917, - "Kind": 1 - }, - { - "EndIndex": 967, - "Kind": 1 - }, - { - "EndIndex": 968, - "Kind": 1 - }, - { - "EndIndex": 969, - "Kind": 1 - }, - { - "EndIndex": 1028, - "Kind": 1 - }, - { - "EndIndex": 1077, - "Kind": 1 - }, - { - "EndIndex": 1159, - "Kind": 1 - }, - { - "EndIndex": 1160, - "Kind": 1 - }, - { - "EndIndex": 1219, - "Kind": 1 - }, - { - "EndIndex": 1253, - "Kind": 1 - }, - { - "EndIndex": 1289, - "Kind": 1 - }, - { - "EndIndex": 1290, - "Kind": 1 - }, - { - "EndIndex": 1329, - "Kind": 1 - }, - { - "EndIndex": 1385, - "Kind": 1 - }, - { - "EndIndex": 1446, - "Kind": 1 - }, - { - "EndIndex": 1479, - "Kind": 1 - }, - { - "EndIndex": 1501, - "Kind": 1 - }, - { - "EndIndex": 1524, - "Kind": 1 - }, - { - "EndIndex": 1547, - "Kind": 1 - }, - { - "EndIndex": 1548, - "Kind": 1 - }, - { - "EndIndex": 1587, - "Kind": 1 - }, - { - "EndIndex": 1644, - "Kind": 1 - }, - { - "EndIndex": 1705, - "Kind": 1 - }, - { - "EndIndex": 1737, - "Kind": 1 - }, - { - "EndIndex": 1759, - "Kind": 1 - }, - { - "EndIndex": 1780, - "Kind": 1 - }, - { - "EndIndex": 1802, - "Kind": 1 - }, - { - "EndIndex": 1803, - "Kind": 1 - }, - { - "EndIndex": 1804, - "Kind": 1 - }, - { - "EndIndex": 1851, - "Kind": 1 - }, - { - "EndIndex": 1878, - "Kind": 1 - }, - { - "EndIndex": 1887, - "Kind": 1 - }, - { - "EndIndex": 1966, - "Kind": 1 - }, - { - "EndIndex": 1989, - "Kind": 1 - }, - { - "EndIndex": 2004, - "Kind": 1 - }, - { - "EndIndex": 2005, - "Kind": 1 - }, - { - "EndIndex": 2046, - "Kind": 1 - }, - { - "EndIndex": 2148, - "Kind": 1 - }, - { - "EndIndex": 2206, - "Kind": 1 - }, - { - "EndIndex": 2207, - "Kind": 1 - }, - { - "EndIndex": 2256, - "Kind": 1 - }, - { - "EndIndex": 2261, - "Kind": 1 - }, - { - "EndIndex": 2327, - "Kind": 1 - }, - { - "EndIndex": 2364, - "Kind": 1 - }, - { - "EndIndex": 2440, - "Kind": 1 - }, - { - "EndIndex": 2519, - "Kind": 1 - }, - { - "EndIndex": 2564, - "Kind": 1 - }, - { - "EndIndex": 2565, - "Kind": 1 - }, - { - "EndIndex": 2620, - "Kind": 1 - }, - { - "EndIndex": 2625, - "Kind": 1 - }, - { - "EndIndex": 2667, - "Kind": 1 - }, - { - "EndIndex": 2703, - "Kind": 1 - }, - { - "EndIndex": 2704, - "Kind": 1 - }, - { - "EndIndex": 2737, - "Kind": 1 - }, - { - "EndIndex": 2802, - "Kind": 1 - }, - { - "EndIndex": 2848, - "Kind": 1 - }, - { - "EndIndex": 2868, - "Kind": 1 - }, - { - "EndIndex": 2877, - "Kind": 1 - }, - { - "EndIndex": 2878, - "Kind": 1 - }, - { - "EndIndex": 2929, - "Kind": 1 - }, - { - "EndIndex": 2978, - "Kind": 1 - }, - { - "EndIndex": 3029, - "Kind": 1 - }, - { - "EndIndex": 3030, - "Kind": 1 - }, - { - "EndIndex": 3104, - "Kind": 1 - }, - { - "EndIndex": 3182, - "Kind": 1 - }, - { - "EndIndex": 3231, - "Kind": 1 - }, - { - "EndIndex": 3232, - "Kind": 1 - }, - { - "EndIndex": 3252, - "Kind": 1 - }, - { - "EndIndex": 3275, - "Kind": 1 - }, - { - "EndIndex": 3330, - "Kind": 1 - }, - { - "EndIndex": 3401, - "Kind": 1 - }, - { - "EndIndex": 3440, - "Kind": 1 - }, - { - "EndIndex": 3472, - "Kind": 1 - }, - { - "EndIndex": 3498, - "Kind": 1 - }, - { - "EndIndex": 3542, - "Kind": 1 - }, - { - "EndIndex": 3592, - "Kind": 1 - }, - { - "EndIndex": 3641, - "Kind": 1 - }, - { - "EndIndex": 3643, - "Kind": 1 - }, - { - "EndIndex": 3644, - "Kind": 1 - }, - { - "EndIndex": 3712, - "Kind": 1 - }, - { - "EndIndex": 3727, - "Kind": 1 - }, - { - "EndIndex": 3759, - "Kind": 1 - }, - { - "EndIndex": 3760, - "Kind": 1 - }, - { - "EndIndex": 3814, - "Kind": 1 - }, - { - "EndIndex": 3815, - "Kind": 1 - }, - { - "EndIndex": 3858, - "Kind": 1 - }, - { - "EndIndex": 3921, - "Kind": 1 - } - ], - "FileSize": 3921, - "Id": -203071489, - "Name": "requests", - "IndexSpan": null -} \ No newline at end of file diff --git a/src/Caching/Test/Files/SmokeTest.json b/src/Caching/Test/Files/SmokeTest.json index 66c6cd305..be1c77d98 100644 --- a/src/Caching/Test/Files/SmokeTest.json +++ b/src/Caching/Test/Files/SmokeTest.json @@ -11,8 +11,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": 24395611, "Name": "func", "IndexSpan": { @@ -23,7 +23,7 @@ ], "Variables": [ { - "Value": "bool", + "Value": "t:bool", "Id": -529376420, "Name": "__debug__", "IndexSpan": { @@ -32,7 +32,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": -1636005055, "Name": "__doc__", "IndexSpan": { @@ -41,7 +41,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": 875442003, "Name": "__file__", "IndexSpan": { @@ -50,7 +50,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": 1097116834, "Name": "__name__", "IndexSpan": { @@ -59,7 +59,7 @@ } }, { - "Value": "str", + "Value": "t:str", "Id": 75395663, "Name": "__package__", "IndexSpan": { @@ -68,7 +68,7 @@ } }, { - "Value": "list", + "Value": "t:list", "Id": 1154586556, "Name": "__path__", "IndexSpan": { @@ -77,7 +77,7 @@ } }, { - "Value": "dict", + "Value": "t:dict", "Id": 817929997, "Name": "__dict__", "IndexSpan": { @@ -108,7 +108,7 @@ { "Documentation": null, "Bases": [ - "object" + "t:object" ], "Methods": [ { @@ -118,7 +118,7 @@ "Parameters": [ { "Name": "self", - "Type": "module:C", + "Type": "t:module:C", "DefaultValue": null, "Kind": 0 } @@ -127,8 +127,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": 965872103, "Name": "__init__", "IndexSpan": { @@ -143,7 +143,7 @@ "Parameters": [ { "Name": "self", - "Type": "module:C", + "Type": "t:module:C", "DefaultValue": null, "Kind": 0 } @@ -152,8 +152,8 @@ } ], "Attributes": 0, - "Classes": null, - "Functions": null, + "Classes": [], + "Functions": [], "Id": -2139806792, "Name": "method", "IndexSpan": { @@ -187,24 +187,6 @@ "Id": 834, "Name": "y", "IndexSpan": null - }, - { - "Value": "dict", - "Id": 817929997, - "Name": "__dict__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "object", - "Id": 1225024228, - "Name": "__weakref__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } } ], "GenericParameters": null, diff --git a/src/Caching/Test/Files/Sys.json b/src/Caching/Test/Files/Sys.json deleted file mode 100644 index 81e6f9371..000000000 --- a/src/Caching/Test/Files/Sys.json +++ /dev/null @@ -1,12601 +0,0 @@ -{ - "UniqueId": "sys(3.7)", - "Documentation": "This module provides access to some objects used or maintained by the\ninterpreter and to functions that interact strongly with the interpreter.\n\nDynamic objects:\n\nargv -- command line arguments; argv[0] is the script pathname if known\npath -- module search path; path[0] is the script directory, else ''\nmodules -- dictionary of loaded modules\n\ndisplayhook -- called to show results in an interactive session\nexcepthook -- called to handle any uncaught exception other than SystemExit\n To customize printing in an interactive session or to install a custom\n top-level exception handler, assign other functions to replace these.\n\nstdin -- standard input file object; used by input()\nstdout -- standard output file object; used by print()\nstderr -- standard error object; used for error messages\n By assigning other file objects (or objects that behave like files)\n to these, it is possible to redirect all of the interpreter's I/O.\n\nlast_type -- type of last uncaught exception\nlast_value -- value of last uncaught exception\nlast_traceback -- traceback of last uncaught exception\n These three are only available in an interactive session after a\n traceback has been printed.\n\nStatic objects:\n\nbuiltin_module_names -- tuple of module names built into this interpreter\ncopyright -- copyright notice pertaining to this interpreter\nexec_prefix -- prefix used to find the machine-specific Python library\nexecutable -- absolute path of the executable binary of the Python interpreter\nfloat_info -- a struct sequence with information about the float implementation.\nfloat_repr_style -- string indicating the style of repr() output for floats\nhash_info -- a struct sequence with information about the hash algorithm.\nhexversion -- version information encoded as a single integer\nimplementation -- Python implementation information.\nint_info -- a struct sequence with information about the int implementation.\nmaxsize -- the largest supported length of containers.\nmaxunicode -- the value of the largest Unicode code point\nplatform -- platform identifier\nprefix -- prefix used to find the Python library\nthread_info -- a struct sequence with information about the thread implementation.\nversion -- the version of this interpreter as a string\nversion_info -- version information as a named tuple\ndllhandle -- [Windows only] integer handle of the Python DLL\nwinver -- [Windows only] version number of the Python DLL\n_enablelegacywindowsfsencoding -- [Windows only] \n__stdin__ -- the original stdin; don't touch!\n__stdout__ -- the original stdout; don't touch!\n__stderr__ -- the original stderr; don't touch!\n__displayhook__ -- the original displayhook; don't touch!\n__excepthook__ -- the original excepthook; don't touch!\n\nFunctions:\n\ndisplayhook() -- print an object to the screen, and save it in builtins._\nexcepthook() -- print an exception and its traceback to sys.stderr\nexc_info() -- return thread-safe information about the current exception\nexit() -- exit the interpreter by raising SystemExit\ngetdlopenflags() -- returns flags to be used for dlopen() calls\ngetprofile() -- get the global profiling function\ngetrefcount() -- return the reference count for an object (plus one :-)\ngetrecursionlimit() -- return the max recursion depth for the interpreter\ngetsizeof() -- return the size of an object in bytes\ngettrace() -- get the global debug tracing function\nsetcheckinterval() -- control how often the interpreter checks for events\nsetdlopenflags() -- set the flags to be used for dlopen() calls\nsetprofile() -- set the global profiling function\nsetrecursionlimit() -- set the max recursion depth for the interpreter\nsettrace() -- set the global debug tracing function\n", - "Functions": [ - { - "Documentation": "breakpointhook(*args, **kws)\n\nThis hook function is called by built-in breakpoint().\n", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1623088213, - "Name": "__breakpointhook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "displayhook(object) -> None\n\nPrint an object to sys.stdout and also save it in builtins._\n", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 629764782, - "Name": "__displayhook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "excepthook(exctype, value, traceback) -> None\n\nHandle an exception by displaying it with a traceback on sys.stderr.\n", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1425218131, - "Name": "__excepthook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1727507378, - "Name": "__interactivehook__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "_clear_type_cache() -> None\nClear the internal type lookup cache.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:__NoneType__" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1527505257, - "Name": "_clear_type_cache", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "_current_frames() -> dictionary\n\nReturn a dictionary mapping each current thread T's thread id to T's\ncurrent stack frame.\n\nThis function should be used for specialized purposes only.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:dict" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 813545300, - "Name": "_current_frames", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "_debugmallocstats()\n\nPrint summary info to stderr about the state of\npymalloc's structures.\n\nIn Py_DEBUG mode, also perform some expensive internal consistency\nchecks.\n", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1370295892, - "Name": "_debugmallocstats", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "_enablelegacywindowsfsencoding()\n\nChanges the default filesystem encoding to mbcs:replace for consistency\nwith earlier versions of Python. See PEP 529 for more information.\n\nThis is equivalent to defining the PYTHONLEGACYWINDOWSFSENCODING \nenvironment variable before launching Python.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1047770159, - "Name": "_enablelegacywindowsfsencoding", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "_getframe([depth]) -> frameobject\n\nReturn a frame object from the call stack. If optional integer depth is\ngiven, return the frame object that many calls below the top of the stack.\nIf that is deeper than the call stack, ValueError is raised. The default\nfor depth is zero, returning the frame at the top of the call stack.\n\nThis function should be used for internal and specialized\npurposes only.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:types:FrameType" - }, - { - "Parameters": [ - { - "Name": "depth", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:types:FrameType" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1848744703, - "Name": "_getframe", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "breakpointhook(*args, **kws)\n\nThis hook function is called by built-in breakpoint().\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kws", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1414470549, - "Name": "breakpointhook", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "call_tracing(func, args) -> object\n\nCall func(*args), while tracing is enabled. The tracing state is\nsaved, and restored afterwards. This is intended to be called from\na debugger from a checkpoint, to recursively debug some other code.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "fn", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": "typing:Any", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:typing:_T" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1158985352, - "Name": "call_tracing", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "callstats() -> tuple of integers\n\nReturn a tuple of function call statistics, if CALL_PROFILE was defined\nwhen Python was built. Otherwise, return None.\n\nWhen enabled, this function returns detailed, implementation-specific\ndetails about the number of function calls executed. The return value is\na 11-tuple where the entries in the tuple are counts of:\n0. all function calls\n1. calls to PyFunction_Type objects\n2. PyFunction calls that do not create an argument tuple\n3. PyFunction calls that do not create an argument tuple\n and bypass PyEval_EvalCodeEx()\n4. PyMethod calls\n5. PyMethod calls on bound methods\n6. PyType calls\n7. PyCFunction calls\n8. generator calls\n9. All other calls\n10. Number of stack pops performed by call_function()", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1252442422, - "Name": "callstats", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "displayhook(object) -> None\n\nPrint an object to sys.stdout and also save it in builtins._\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "value", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:__NoneType__" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 388872302, - "Name": "displayhook", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "exc_info() -> (type, value, traceback)\n\nReturn information about the most recent exception caught by an except\nclause in the current stack frame or in an older stack frame.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -935045484, - "Name": "exc_info", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "excepthook(exctype, value, traceback) -> None\n\nHandle an exception by displaying it with a traceback on sys.stderr.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "type_", - "Type": "typing:Type[BaseException]", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": "BaseException", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "traceback", - "Type": "types:TracebackType", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:__NoneType__" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 305517843, - "Name": "excepthook", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "exit([status])\n\nExit the interpreter by raising SystemExit(status).\nIf the status is omitted or None, it defaults to zero (i.e., success).\nIf the status is an integer, it will be used as the system exit status.\nIf it is another kind of object, it will be printed and the system\nexit status will be one (i.e., failure).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "arg", - "Type": "object", - "DefaultValue": "i:ellipsis", - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 24368565, - "Name": "exit", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "get_asyncgen_hooks()\n\nReturn a namedtuple of installed asynchronous generators hooks (firstiter, finalizer).", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -932626587, - "Name": "get_asyncgen_hooks", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Check status of origin tracking for coroutine objects in this thread.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1605124845, - "Name": "get_coroutine_origin_tracking_depth", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "get_coroutine_wrapper()\n\nReturn the wrapper for coroutine objects set by sys.set_coroutine_wrapper.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1829443124, - "Name": "get_coroutine_wrapper", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getallocatedblocks() -> integer\n\nReturn the number of memory blocks currently allocated, regardless of their\nsize.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1953654962, - "Name": "getallocatedblocks", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getcheckinterval() -> current check interval; see setcheckinterval().", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2065023054, - "Name": "getcheckinterval", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getdefaultencoding() -> string\n\nReturn the current default string encoding used by the Unicode \nimplementation.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1935348949, - "Name": "getdefaultencoding", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getfilesystemencodeerrors() -> string\n\nReturn the error mode used to convert Unicode filenames in\noperating system filenames.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 346962379, - "Name": "getfilesystemencodeerrors", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getfilesystemencoding() -> string\n\nReturn the encoding used to convert Unicode filenames in\noperating system filenames.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -946006243, - "Name": "getfilesystemencoding", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getprofile()\n\nReturn the profiling function set with sys.setprofile.\nSee the profiler chapter in the library manual.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 682573034, - "Name": "getprofile", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getrecursionlimit()\n\nReturn the current value of the recursion limit, the maximum depth\nof the Python interpreter stack. This limit prevents infinite\nrecursion from causing an overflow of the C stack and crashing Python.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 949225272, - "Name": "getrecursionlimit", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getrefcount(object) -> integer\n\nReturn the reference count of object. The count returned is generally\none higher than you might expect, because it includes the (temporary)\nreference as an argument to getrefcount().", - "Overloads": [ - { - "Parameters": [ - { - "Name": "arg", - "Type": "typing:Any", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -37310149, - "Name": "getrefcount", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getsizeof(object, default) -> int\n\nReturn the size of object in bytes.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "obj", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - }, - { - "Parameters": [ - { - "Name": "obj", - "Type": "object", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "default", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1485394487, - "Name": "getsizeof", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getswitchinterval() -> current thread switch interval; see setswitchinterval().", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:float" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1633191528, - "Name": "getswitchinterval", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "gettrace()\n\nReturn the global debug tracing function set with sys.settrace.\nSee the debugger chapter in the library manual.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -920747834, - "Name": "gettrace", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "getwindowsversion()\n\nReturn information about the running version of Windows as a named tuple.\nThe members are named: major, minor, build, platform, service_pack,\nservice_pack_major, service_pack_minor, suite_mask, and product_type. For\nbackward compatibility, only the first 5 items are available by indexing.\nAll elements are numbers, except service_pack and platform_type which are\nstrings, and platform_version which is a 3-tuple. Platform is always 2.\nProduct_type may be 1 for a workstation, 2 for a domain controller, 3 for a\nserver. Platform_version is a 3-tuple containing a version number that is\nintended for identifying the OS rather than feature detection.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:sys:_WinVersion" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1280212332, - "Name": "getwindowsversion", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "intern(string) -> string\n\n``Intern'' the given string. This enters the string in the (global)\ntable of interned strings whose purpose is to speed up dictionary lookups.\nReturn the string itself or the previously interned string object with the\nsame value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "string", - "Type": "str", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2048952809, - "Name": "intern", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "is_finalizing()\nReturn True if Python is exiting.", - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1710543065, - "Name": "is_finalizing", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "set_asyncgen_hooks(*, firstiter=None, finalizer=None)\n\nSet a finalizer for async generators objects.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "firstiter", - "Type": null, - "DefaultValue": null, - "Kind": 3 - }, - { - "Name": "finalizer", - "Type": null, - "DefaultValue": null, - "Kind": 3 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -12592935, - "Name": "set_asyncgen_hooks", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Enable or disable origin tracking for coroutine objects in this thread.\n\nCoroutine objects will track 'depth' frames of traceback information about\nwhere they came from, available in their cr_origin attribute. Set depth of 0\nto disable.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "depth", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 836059129, - "Name": "set_coroutine_origin_tracking_depth", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "set_coroutine_wrapper(wrapper)\n\nSet a wrapper for coroutine objects.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "wrapper", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 706767832, - "Name": "set_coroutine_wrapper", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "setcheckinterval(n)\n\nTell the Python interpreter to check for asynchronous events every\nn instructions. This also affects how often thread switches occur.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "interval", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:__NoneType__" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 233580226, - "Name": "setcheckinterval", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "setprofile(function)\n\nSet the profiling function. It will be called on each function call\nand return. See the profiler chapter in the library manual.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "profilefunc", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:__NoneType__" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1675589026, - "Name": "setprofile", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "setrecursionlimit(n)\n\nSet the maximum depth of the Python interpreter stack to n. This\nlimit prevents infinite recursion from causing an overflow of the C\nstack and crashing Python. The highest possible limit is platform-\ndependent.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "limit", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:__NoneType__" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 9072452, - "Name": "setrecursionlimit", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "setswitchinterval(n)\n\nSet the ideal thread switching delay inside the Python interpreter\nThe actual frequency of switching threads can be lower if the\ninterpreter executes long sequences of uninterruptible code\n(this is implementation-specific and workload-dependent).\n\nThe parameter must represent the desired switching delay in seconds\nA typical value is 0.005 (5 milliseconds).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "interval", - "Type": "float", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:__NoneType__" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1721622948, - "Name": "setswitchinterval", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "settrace(function)\n\nSet the global debug tracing function. It will be called on each\nfunction call. See the debugger chapter in the library manual.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "tracefunc", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:__NoneType__" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1481860294, - "Name": "settrace", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 503242166, - "Name": "getdlopenflags", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "n", - "Type": "int", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:__NoneType__" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1268494038, - "Name": "setdlopenflags", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "on_flag", - "Type": "bool", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:__NoneType__" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1891924589, - "Name": "settscdump", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1618095583, - "Name": "gettotalrefcount", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Variables": [ - { - "Value": "_io", - "Id": 668243680, - "Name": "_mod__io", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "builtins", - "Id": -1070584715, - "Name": "_mod_builtins", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "types", - "Id": -2043043116, - "Name": "_mod_types", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": -1636005055, - "Name": "__doc__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": 1097116834, - "Name": "__name__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": 75395663, - "Name": "__package__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:_io:TextIOWrapper", - "Id": 1612032761, - "Name": "__stderr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:_io:TextIOWrapper", - "Id": 329210449, - "Name": "__stdin__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:_io:TextIOWrapper", - "Id": 1621359266, - "Name": "__stdout__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": 677051350, - "Name": "_framework", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:tuple", - "Id": 24173482, - "Name": "_git", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:NoneType", - "Id": 749413383, - "Name": "_home", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:dict", - "Id": 1595009614, - "Name": "_xoptions", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:int", - "Id": 1834311484, - "Name": "api_version", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:list", - "Id": 24243575, - "Name": "argv", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": 1664944041, - "Name": "base_exec_prefix", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": 1039099721, - "Name": "base_prefix", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:list", - "Id": 1963179240, - "Name": "builtin_module_names", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": 2033693967, - "Name": "byteorder", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": 1298046352, - "Name": "copyright", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:int", - "Id": -1200168491, - "Name": "dllhandle", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:bool", - "Id": 1675585612, - "Name": "dont_write_bytecode", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": 62274953, - "Name": "exec_prefix", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": -2135911519, - "Name": "executable", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": 92603457, - "Name": "float_repr_style", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:int", - "Id": -471599948, - "Name": "hexversion", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:_implementation", - "Id": 1997289353, - "Name": "implementation", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:int", - "Id": -2020000914, - "Name": "maxsize", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:int", - "Id": 842058832, - "Name": "maxunicode", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:list", - "Id": -1294259224, - "Name": "meta_path", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:dict", - "Id": -1637601392, - "Name": "modules", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:list", - "Id": 24674492, - "Name": "path", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:list", - "Id": -1506404755, - "Name": "path_hooks", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:dict", - "Id": 376899064, - "Name": "path_importer_cache", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": -1042062966, - "Name": "platform", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": -2042362519, - "Name": "prefix", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:_io:TextIOWrapper", - "Id": -1954658503, - "Name": "stderr", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:_io:TextIOWrapper", - "Id": 768230609, - "Name": "stdin", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:_io:TextIOWrapper", - "Id": -1954648798, - "Name": "stdout", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": 1781540065, - "Name": "version", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:list", - "Id": -707130143, - "Name": "warnoptions", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:str", - "Id": -1849986786, - "Name": "winver", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:sys:__float_info", - "Id": 602612744, - "Name": "float_info", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:sys:__hash_info", - "Id": 84475656, - "Name": "hash_info", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:sys:__int_info", - "Id": 1942821909, - "Name": "int_info", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:sys:__thread_info", - "Id": 604643660, - "Name": "thread_info", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:sys:__version_info", - "Id": 1738857804, - "Name": "version_info", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "typing:List", - "Id": 23609685, - "Name": "List", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "typing:Sequence", - "Id": -1502554888, - "Name": "Sequence", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "typing:Any", - "Id": 751189, - "Name": "Any", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "typing:Dict", - "Id": 23370861, - "Name": "Dict", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "typing:Tuple", - "Id": 739642865, - "Name": "Tuple", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "typing:Optional", - "Id": 1363847319, - "Name": "Optional", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "typing:Union", - "Id": 740351224, - "Name": "Union", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "typing:TypeVar", - "Id": -2053481098, - "Name": "TypeVar", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "typing:Type", - "Id": 23863281, - "Name": "Type", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "types:FrameType", - "Id": -1970702352, - "Name": "FrameType", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "_importlib_modulespec:ModuleType", - "Id": -1551859907, - "Name": "ModuleType", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "types:TracebackType", - "Id": -612342225, - "Name": "TracebackType", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "importlib.abc:MetaPathFinder", - "Id": -1792761721, - "Name": "MetaPathFinder", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "typing:_T", - "Id": 25132, - "Name": "_T", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:types:TracebackType", - "Id": 2060329242, - "Name": "last_traceback", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Value": "i:tuple", - "Id": -1174870545, - "Name": "subversion", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - } - ], - "Classes": [ - { - "Documentation": "sys.flags\n\nFlags provided through command line arguments or environment vars.", - "Bases": [ - "tuple", - "object" - ], - "Methods": [ - { - "Documentation": "Return self+value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1639102358, - "Name": "__add__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return key in self.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1841774666, - "Name": "__contains__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement delattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:NoneType" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 2095540485, - "Name": "__delattr__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Default dir() implementation.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:list" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1636169386, - "Name": "__dir__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self==value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748372547, - "Name": "__eq__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Default object formatter.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "format_spec", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:str" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 695475534, - "Name": "__format__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "sys.flags\n\nFlags provided through command line arguments or environment vars.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:NoneType" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__float_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__float_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__float_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "sys:__float_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__float_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__float_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "sys.float_info\n\nA structseq holding information about the float type. It contains low level\ninformation about the precision and internal representation. Please study\nyour system's :file:`float.h` for more information.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__float_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "sys:__float_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:NoneType" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__float_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__float_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__float_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__hash_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__hash_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__hash_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "sys:__hash_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__hash_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__hash_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "hash_info\n\nA struct sequence providing parameters used for computing\nhashes. The attributes are read only.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__hash_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "sys:__hash_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:NoneType" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__hash_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__hash_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__hash_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__int_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__int_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__int_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "sys:__int_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__int_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__int_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "sys.int_info\n\nA struct sequence that holds information about Python's\ninternal representation of integers. The attributes are read only.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__int_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "sys:__int_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:NoneType" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__int_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__int_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__int_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__thread_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__thread_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__thread_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "sys:__thread_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__thread_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__thread_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "sys.thread_info\n\nA struct sequence holding information about the thread implementation.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__thread_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "sys:__thread_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:NoneType" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Implement iter(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__thread_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 971292143, - "Name": "__iter__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__thread_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__thread_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__version_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748420597, - "Name": "__ge__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return getattr(self, name).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__version_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "name", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1329277859, - "Name": "__getattribute__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self[key].", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__version_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "key", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -293179214, - "Name": "__getitem__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": null, - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "sys:__version_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "self", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:tuple" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -488627138, - "Name": "__getnewargs__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self>value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__version_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748435012, - "Name": "__gt__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return hash(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__version_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 925523557, - "Name": "__hash__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "sys.version_info\n\nVersion information as a named tuple.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__version_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "args", - "Type": null, - "DefaultValue": null, - "Kind": 1 - }, - { - "Name": "kwargs", - "Type": null, - "DefaultValue": null, - "Kind": 2 - } - ], - "ReturnType": null - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 965872103, - "Name": "__init__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.\n", - "Overloads": [ - { - "Parameters": [ - { - "Name": "cls", - "Type": "sys:__version_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:NoneType" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1040523408, - "Name": "__init_subclass__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self<=value.", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__version_info", - "DefaultValue": null, - "Kind": 0 - }, - { - "Name": "value", - "Type": null, - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:bool" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": 1748569552, - "Name": "__le__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return len(self).", - "Overloads": [ - { - "Parameters": [ - { - "Name": "self", - "Type": "sys:__version_info", - "DefaultValue": null, - "Kind": 0 - } - ], - "ReturnType": "i:int" - } - ], - "Attributes": 0, - "Classes": null, - "Functions": null, - "Id": -1628904226, - "Name": "__len__", - "IndexSpan": { - "Start": 0, - "Length": 0 - } - }, - { - "Documentation": "Return self GetBaselineFileName(TestContext.TestName); [TestMethod, Priority(0)] + [Ignore("Builtins module have custom member handling. We do not persist it yet.")] public async Task Builtins() { var analysis = await GetAnalysisAsync(string.Empty); var builtins = analysis.Document.Interpreter.ModuleResolution.BuiltinsModule; @@ -53,18 +54,22 @@ public async Task Builtins() { [TestMethod, Priority(0)] - public async Task Sys() { - var analysis = await GetAnalysisAsync("import sys"); - var sys = analysis.Document.Interpreter.ModuleResolution.GetImportedModule("sys"); - var model = ModuleModel.FromAnalysis(sys.Analysis, Services); + public Task Sys() => TestModule("sys"); - var json = ToJson(model); - Baseline.CompareToFile(BaselineFileName, json); + [TestMethod, Priority(0)] + public Task Io() => TestModule("io"); - using (var dbModule = new PythonDbModule(model, sys.FilePath, Services)) { - dbModule.Should().HaveSameMembersAs(sys); - } - } + [TestMethod, Priority(0)] + public Task Re() => TestModule("re"); + + [TestMethod, Priority(0)] + public Task Os() => TestModule("os"); + + [TestMethod, Priority(0)] + public Task Logging() => TestModule("logging"); + + [TestMethod, Priority(0)] + public Task Types() => TestModule("types"); [TestMethod, Priority(0)] public async Task Requests() { @@ -88,11 +93,23 @@ import requests // Verify this looks like a version. new Version(u.Substring(open + 1, u.IndexOf(')') - open - 1)); - var json = ToJson(model); - Baseline.CompareToFile(BaselineFileName, json); + CompareBaselineAndRestore(model, rq); + } + + private async Task TestModule(string name) { + var analysis = await GetAnalysisAsync($"import {name}"); + var m = analysis.Document.Interpreter.ModuleResolution.GetImportedModule(name); + var model = ModuleModel.FromAnalysis(m.Analysis, Services); + + CompareBaselineAndRestore(model, m); + } + + private void CompareBaselineAndRestore(ModuleModel model, IPythonModule m) { + //var json = ToJson(model); + //Baseline.CompareToFile(BaselineFileName, json); - using (var dbModule = new PythonDbModule(model, rq.FilePath, Services)) { - dbModule.Should().HaveSameMembersAs(rq); + using (var dbModule = new PythonDbModule(model, m.FilePath, Services)) { + dbModule.Should().HaveSameMembersAs(m); } } } diff --git a/src/Caching/Test/ReferencesTests.cs b/src/Caching/Test/ReferencesTests.cs index 435b8df76..ca75fb8fe 100644 --- a/src/Caching/Test/ReferencesTests.cs +++ b/src/Caching/Test/ReferencesTests.cs @@ -104,8 +104,8 @@ import logging var model = ModuleModel.FromAnalysis(logging.Analysis, Services); var dbModule = new PythonDbModule(model, logging.FilePath, Services); - analysis.Document.Interpreter.ModuleResolution.SpecializeModule("logging", x => dbModule); - + analysis.Document.Interpreter.ModuleResolution.SpecializeModule("logging", x => dbModule, replaceExisting: true); + var moduleName = $"{analysis.Document.Name}_db.py"; var modulePath = TestData.GetTestSpecificPath(moduleName); analysis = await GetAnalysisAsync(code, Services, moduleName, modulePath); diff --git a/src/LanguageServer/Impl/Completion/ExpressionCompletion.cs b/src/LanguageServer/Impl/Completion/ExpressionCompletion.cs index a199acae7..5e9ff8d33 100644 --- a/src/LanguageServer/Impl/Completion/ExpressionCompletion.cs +++ b/src/LanguageServer/Impl/Completion/ExpressionCompletion.cs @@ -13,15 +13,13 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System.Collections.Generic; -using System.Linq; using Microsoft.Python.Analysis; -using Microsoft.Python.Analysis.Analyzer; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; -using Microsoft.Python.Core; using Microsoft.Python.LanguageServer.Protocol; using Microsoft.Python.Parsing.Ast; +using System.Collections.Generic; +using System.Linq; namespace Microsoft.Python.LanguageServer.Completion { internal static class ExpressionCompletion { diff --git a/src/LanguageServer/Impl/Implementation/Server.Telemetry.cs b/src/LanguageServer/Impl/Implementation/Server.Telemetry.cs index 97a954490..4dcfdd079 100644 --- a/src/LanguageServer/Impl/Implementation/Server.Telemetry.cs +++ b/src/LanguageServer/Impl/Implementation/Server.Telemetry.cs @@ -48,6 +48,7 @@ private void OnAnalysisComplete(object sender, AnalysisCompleteEventArgs e) { te.Measurements["workingMB"] = workingMB; te.Measurements["elapsedMs"] = e.MillisecondsElapsed; te.Measurements["moduleCount"] = e.ModuleCount; + te.Measurements["rdtCount"] = _rdt.DocumentCount; telemetry.SendTelemetryAsync(te).DoNotWait(); } diff --git a/src/LanguageServer/Impl/Implementation/Server.cs b/src/LanguageServer/Impl/Implementation/Server.cs index 5b54c9714..2db04f569 100644 --- a/src/LanguageServer/Impl/Implementation/Server.cs +++ b/src/LanguageServer/Impl/Implementation/Server.cs @@ -15,7 +15,6 @@ using System; using System.Diagnostics; -using System.IO; using System.Linq; using System.Reflection; using System.Threading; @@ -125,9 +124,14 @@ public async Task InitializeAsync(InitializeParams @params, Ca _rootDir = PathUtils.NormalizePathAndTrim(_rootDir); } - Version.TryParse(@params.initializationOptions.interpreter.properties?.Version, out var version); + var interpreterVersionString = @params.initializationOptions.interpreter.properties?.Version; + if (string.IsNullOrEmpty(interpreterVersionString)) { + _log?.Log(TraceEventType.Warning, Resources.PythonInterpreterVersionNotSpecified); + interpreterVersionString = "3.7"; + } + Version.TryParse(interpreterVersionString, out var version); - var configuration = new InterpreterConfiguration(null, null, + var configuration = new InterpreterConfiguration( interpreterPath: @params.initializationOptions.interpreter.properties?.InterpreterPath, version: version ) { @@ -139,8 +143,11 @@ public async Task InitializeAsync(InitializeParams @params, Ca TypeshedPath = @params.initializationOptions.typeStubSearchPaths.FirstOrDefault() }; - if (@params.initializationOptions.enableAnalysCache != false) { + if (@params.initializationOptions.enableAnalysisCache != false) { + _log?.Log(TraceEventType.Information, Resources.AnalysisCacheEnabled); _services.AddService(new ModuleDatabase(_services)); + } else { + _log?.Log(TraceEventType.Information, Resources.AnalysisCacheDisabled); } _interpreter = await PythonInterpreter.CreateAsync(configuration, _rootDir, _services, cancellationToken); @@ -184,9 +191,9 @@ public void DidChangeConfiguration(DidChangeConfigurationParams @params, Cancell _disposableBag.ThrowIfDisposed(); switch (@params.settings) { case ServerSettings settings: { - if (HandleConfigurationChanges(settings)) { - RestartAnalysis(); - } + Settings = settings; + _symbolHierarchyMaxSymbols = Settings.analysis.symbolsHierarchyMaxSymbols; + _completionSource.Options = Settings.completion; break; } default: @@ -205,27 +212,6 @@ private void DisplayStartupInfo() { : Resources.InitializingForPythonInterpreter.FormatInvariant(_interpreter.Configuration.InterpreterPath)); } - private bool HandleConfigurationChanges(ServerSettings newSettings) { - var oldSettings = Settings; - Settings = newSettings; - - _symbolHierarchyMaxSymbols = Settings.analysis.symbolsHierarchyMaxSymbols; - _completionSource.Options = Settings.completion; - - if (oldSettings == null) { - return true; - } - - if (!newSettings.analysis.errors.SetEquals(oldSettings.analysis.errors) || - !newSettings.analysis.warnings.SetEquals(oldSettings.analysis.warnings) || - !newSettings.analysis.information.SetEquals(oldSettings.analysis.information) || - !newSettings.analysis.disabled.SetEquals(oldSettings.analysis.disabled)) { - return true; - } - - return false; - } - private IDocumentationSource ChooseDocumentationSource(string[] kinds) { if (kinds == null) { return new PlainTextDocumentationSource(); @@ -267,33 +253,21 @@ private void ResetPathWatcher() { if (_searchPaths == null || !_searchPaths.SequenceEqual(paths)) { _searchPaths = paths; _pathsWatcher?.Dispose(); - _pathsWatcher = new PathsWatcher(_searchPaths, () => NotifyPackagesChanged(), _log); + _pathsWatcher = new PathsWatcher(_searchPaths, NotifyPackagesChanged, _log); } } - public void NotifyPackagesChanged(CancellationToken cancellationToken = default) { - var interpreter = _services.GetService(); + private void NotifyPackagesChanged() { _log?.Log(TraceEventType.Information, Resources.ReloadingModules); - // No need to reload typeshed resolution since it is a static storage. - // User does can add stubs while application is running, but it is - // by design at this time that the app should be restarted. - interpreter.ModuleResolution.ReloadAsync(cancellationToken).ContinueWith(t => { - _log?.Log(TraceEventType.Information, Resources.Done); - _log?.Log(TraceEventType.Information, Resources.AnalysisRestarted); - RestartAnalysis(); - + _services.GetService().ResetAnalyzer().ContinueWith(t => { if (_watchSearchPaths) { ResetPathWatcher(); } - }, cancellationToken).DoNotWait(); - } - - private void RestartAnalysis() { - var analyzer = Services.GetService(); - analyzer.ResetAnalyzer(); - _rdt.ReloadAll(); + _log?.Log(TraceEventType.Information, Resources.Done); + _log?.Log(TraceEventType.Information, Resources.AnalysisRestarted); + }).DoNotWait(); } } } diff --git a/src/LanguageServer/Impl/Indexing/MostRecentDocumentSymbols.cs b/src/LanguageServer/Impl/Indexing/MostRecentDocumentSymbols.cs index 2096e26fc..fe8b6969b 100644 --- a/src/LanguageServer/Impl/Indexing/MostRecentDocumentSymbols.cs +++ b/src/LanguageServer/Impl/Indexing/MostRecentDocumentSymbols.cs @@ -7,6 +7,7 @@ using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Core; using Microsoft.Python.Core.Diagnostics; +using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.LanguageServer.Indexing { class MostRecentDocumentSymbols : IMostRecentDocumentSymbols { @@ -120,7 +121,20 @@ public void Dispose() { } private async Task> IndexAsync(IDocument doc, CancellationToken indexCt) { - var ast = await doc.GetAstAsync(indexCt); + PythonAst ast = null; + + for (var i = 0; i < 5; i++) { + ast = await doc.GetAstAsync(indexCt); + if (ast != null) { + break; + } + await Task.Delay(100); + } + + if (ast == null) { + return Array.Empty(); + } + indexCt.ThrowIfCancellationRequested(); var walker = new SymbolIndexWalker(ast); ast.Walk(walker); diff --git a/src/LanguageServer/Impl/LanguageServer.Configuration.cs b/src/LanguageServer/Impl/LanguageServer.Configuration.cs index 1129c6a83..1ac34b14a 100644 --- a/src/LanguageServer/Impl/LanguageServer.Configuration.cs +++ b/src/LanguageServer/Impl/LanguageServer.Configuration.cs @@ -36,7 +36,9 @@ public async Task DidChangeConfiguration(JToken token, CancellationToken cancell using (await _prioritizer.ConfigurationPriorityAsync(cancellationToken)) { var settings = new LanguageServerSettings(); - var rootSection = token["settings"]; + // https://github.com/microsoft/python-language-server/issues/915 + // If token or settings are missing, assume defaults. + var rootSection = token?["settings"]; var pythonSection = rootSection?["python"]; if (pythonSection == null) { return; diff --git a/src/LanguageServer/Impl/Protocol/Classes.cs b/src/LanguageServer/Impl/Protocol/Classes.cs index 6d8e7ec31..0359ed96c 100644 --- a/src/LanguageServer/Impl/Protocol/Classes.cs +++ b/src/LanguageServer/Impl/Protocol/Classes.cs @@ -162,7 +162,7 @@ public sealed class InterpreterProperties { /// /// Turns off analysis caching. /// - public bool? enableAnalysCache; + public bool? enableAnalysisCache; } [Serializable] diff --git a/src/LanguageServer/Impl/Resources.Designer.cs b/src/LanguageServer/Impl/Resources.Designer.cs index b832d5839..135b8a537 100644 --- a/src/LanguageServer/Impl/Resources.Designer.cs +++ b/src/LanguageServer/Impl/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Microsoft.Python.LanguageServer { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -60,6 +60,24 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Analysis cache disabled.. + /// + internal static string AnalysisCacheDisabled { + get { + return ResourceManager.GetString("AnalysisCacheDisabled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Analysis cache enabled.. + /// + internal static string AnalysisCacheEnabled { + get { + return ResourceManager.GetString("AnalysisCacheEnabled", resourceCulture); + } + } + /// /// Looks up a localized string similar to Code analysis is in progress.... /// @@ -132,6 +150,15 @@ internal static string LineFormatter_UnmatchedToken { } } + /// + /// Looks up a localized string similar to Python interpreter version not specified. Assuming latests 3.x.. + /// + internal static string PythonInterpreterVersionNotSpecified { + get { + return ResourceManager.GetString("PythonInterpreterVersionNotSpecified", resourceCulture); + } + } + /// /// Looks up a localized string similar to Reloading modules... . /// diff --git a/src/LanguageServer/Impl/Resources.resx b/src/LanguageServer/Impl/Resources.resx index 3a720034d..2e2f7bb58 100644 --- a/src/LanguageServer/Impl/Resources.resx +++ b/src/LanguageServer/Impl/Resources.resx @@ -117,6 +117,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Analysis cache disabled. + + + Analysis cache enabled. + Code analysis is in progress... @@ -141,6 +147,9 @@ Unmatched token '{0}' on line {1}; line formatting may not be accurate. + + Python interpreter version not specified. Assuming latests 3.x. + Reloading modules... diff --git a/src/LanguageServer/Impl/Sources/DefinitionSource.cs b/src/LanguageServer/Impl/Sources/DefinitionSource.cs index a00579b4f..7a52c8b75 100644 --- a/src/LanguageServer/Impl/Sources/DefinitionSource.cs +++ b/src/LanguageServer/Impl/Sources/DefinitionSource.cs @@ -193,7 +193,7 @@ private Reference TryFromVariable(string name, IDocumentAnalysis analysis, Sourc definingMember = null; var m = analysis.ExpressionEvaluator.LookupNameInScopes(name, out var scope); - if (m == null || !(scope.Variables[name] is IVariable v)) { + if (m == null || scope.Module.ModuleType == ModuleType.Builtins || !(scope.Variables[name] is IVariable v)) { return null; } @@ -283,7 +283,8 @@ private bool CanNavigateToModule(Uri uri) { } private static bool CanNavigateToModule(IPythonModule m) - => m?.ModuleType == ModuleType.Stub || + => m?.ModuleType == ModuleType.User || + m?.ModuleType == ModuleType.Stub || m?.ModuleType == ModuleType.Package || m?.ModuleType == ModuleType.Library || m?.ModuleType == ModuleType.Specialized; diff --git a/src/Parsing/Test/PythonInstallPathResolver.cs b/src/Parsing/Test/PythonInstallPathResolver.cs index 31676648e..37fae5fb2 100644 --- a/src/Parsing/Test/PythonInstallPathResolver.cs +++ b/src/Parsing/Test/PythonInstallPathResolver.cs @@ -37,6 +37,5 @@ public static class PythonInstallPathResolver { public interface IPythonInstallPathResolver { InterpreterConfiguration GetCorePythonConfiguration(InterpreterArchitecture architecture, Version version); InterpreterConfiguration GetCondaPythonConfiguration(InterpreterArchitecture architecture, Version version); - InterpreterConfiguration GetIronPythonConfiguration(bool x64); } } diff --git a/src/Parsing/Test/PythonVersion.cs b/src/Parsing/Test/PythonVersion.cs index a0d7be0ac..612db44f4 100644 --- a/src/Parsing/Test/PythonVersion.cs +++ b/src/Parsing/Test/PythonVersion.cs @@ -25,11 +25,9 @@ public PythonVersion(InterpreterConfiguration config, bool cPython = false) { IsCPython = cPython; } - public override string ToString() => Configuration.Description; public string LibraryPath => Configuration.LibraryPath; public string InterpreterPath => Configuration.InterpreterPath; public PythonLanguageVersion Version => Configuration.Version.ToLanguageVersion(); - public string Id => Configuration.Id; public bool Isx64 => Configuration.Architecture == InterpreterArchitecture.x64; public InterpreterArchitecture Architecture => Configuration.Architecture; } diff --git a/src/Parsing/Test/PythonVersions.cs b/src/Parsing/Test/PythonVersions.cs index 771aef56b..a199eba79 100644 --- a/src/Parsing/Test/PythonVersions.cs +++ b/src/Parsing/Test/PythonVersions.cs @@ -26,7 +26,6 @@ public static class PythonVersions { public static readonly InterpreterConfiguration Python36 = GetCPythonVersion(PythonLanguageVersion.V36, InterpreterArchitecture.x86); public static readonly InterpreterConfiguration Python37 = GetCPythonVersion(PythonLanguageVersion.V37, InterpreterArchitecture.x86); public static readonly InterpreterConfiguration Python38 = GetCPythonVersion(PythonLanguageVersion.V38, InterpreterArchitecture.x86); - public static readonly InterpreterConfiguration IronPython27 = GetIronPythonVersion(false); public static readonly InterpreterConfiguration Python27_x64 = GetCPythonVersion(PythonLanguageVersion.V27, InterpreterArchitecture.x64); public static readonly InterpreterConfiguration Python35_x64 = GetCPythonVersion(PythonLanguageVersion.V35, InterpreterArchitecture.x64); public static readonly InterpreterConfiguration Python36_x64 = GetCPythonVersion(PythonLanguageVersion.V36, InterpreterArchitecture.x64); @@ -38,8 +37,6 @@ public static class PythonVersions { public static readonly InterpreterConfiguration Anaconda36_x64 = GetAnacondaVersion(PythonLanguageVersion.V36, InterpreterArchitecture.x64); public static readonly InterpreterConfiguration Anaconda37 = GetAnacondaVersion(PythonLanguageVersion.V37, InterpreterArchitecture.x86); public static readonly InterpreterConfiguration Anaconda37_x64 = GetAnacondaVersion(PythonLanguageVersion.V37, InterpreterArchitecture.x64); - public static readonly InterpreterConfiguration IronPython27_x64 = GetIronPythonVersion(true); - public static readonly InterpreterConfiguration Jython27 = GetJythonVersion(PythonLanguageVersion.V27); public static IEnumerable AnacondaVersions => GetVersions( Anaconda36, @@ -52,8 +49,6 @@ public static class PythonVersions { public static IEnumerable Versions => GetVersions( Python27, Python27_x64, - IronPython27, - IronPython27_x64, Python35, Python35_x64, Python36, @@ -61,7 +56,7 @@ public static class PythonVersions { Python37, Python37_x64, Python38, - Python38_x64, Jython27); + Python38_x64); public static InterpreterConfiguration Required_Python27X => Python27 ?? Python27_x64 ?? NotInstalled("v2.7"); public static InterpreterConfiguration Required_Python35X => Python35 ?? Python35_x64 ?? NotInstalled("v3.5"); @@ -122,50 +117,6 @@ private static InterpreterConfiguration GetCPythonVersion(PythonLanguageVersion private static InterpreterConfiguration GetAnacondaVersion(PythonLanguageVersion version, InterpreterArchitecture arch) => PythonInstallPathResolver.Instance.GetCondaPythonConfiguration(arch, version.ToVersion()); - private static InterpreterConfiguration GetIronPythonVersion(bool x64) { - return PythonInstallPathResolver.Instance.GetIronPythonConfiguration(x64); - } - - private static InterpreterConfiguration GetJythonVersion(PythonLanguageVersion version) { - var candidates = new List(); - var ver = version.ToVersion(); - var path1 = string.Format("jython{0}{1}*", ver.Major, ver.Minor); - var path2 = string.Format("jython{0}.{1}*", ver.Major, ver.Minor); - - foreach (var drive in DriveInfo.GetDrives()) { - if (drive.DriveType != DriveType.Fixed) { - continue; - } - - try { - candidates.AddRange(drive.RootDirectory.EnumerateDirectories(path1)); - candidates.AddRange(drive.RootDirectory.EnumerateDirectories(path2)); - } catch { - } - } - - foreach (var dir in candidates) { - var interpreter = dir.EnumerateFiles("jython.bat").FirstOrDefault(); - if (interpreter == null) { - continue; - } - - var libPath = dir.EnumerateDirectories("Lib").FirstOrDefault(); - if (libPath == null || !libPath.EnumerateFiles("site.py").Any()) { - continue; - } - - return new InterpreterConfiguration( - id: $"Global|Jython|{version.ToVersion()}", - description: string.Format("Jython {0}", version.ToVersion()), - interpreterPath: interpreter.FullName, - version: version.ToVersion() - ); - } - - return null; - } - private static InterpreterConfiguration NotInstalled(string version) { Assert.Inconclusive($"Python interpreter {version} is not installed"); return null; diff --git a/src/Parsing/Test/UnixPythonInstallPathResolver.cs b/src/Parsing/Test/UnixPythonInstallPathResolver.cs index 1cdf77605..4931a52b7 100644 --- a/src/Parsing/Test/UnixPythonInstallPathResolver.cs +++ b/src/Parsing/Test/UnixPythonInstallPathResolver.cs @@ -40,8 +40,6 @@ public InterpreterConfiguration GetCorePythonConfiguration(InterpreterArchitectu public InterpreterConfiguration GetCondaPythonConfiguration(InterpreterArchitecture architecture, Version version) => architecture == InterpreterArchitecture.x86 ? null : _condaCache.TryGetValue(version, out var interpreterConfiguration) ? interpreterConfiguration : null; - public InterpreterConfiguration GetIronPythonConfiguration(bool x64) => null; - private void GetConfigurationsFromKnownPaths() { var homePath = Environment.GetEnvironmentVariable("HOME"); var foldersFromPathVariable = Environment.GetEnvironmentVariable("PATH")?.Split(':') ?? Array.Empty(); @@ -90,8 +88,6 @@ private InterpreterConfiguration GetConfiguration(string idPrefix, string python var sitePackagesPath = GetSitePackagesLocation(pythonFilePath); return new InterpreterConfiguration( - id: $"{idPrefix}|{version}", - description: $"{idPrefix} {version} ({architecture})", interpreterPath: pythonFilePath, pathVar: pythonFilePath, libPath: libPath, diff --git a/src/Parsing/Test/WindowsPythonInstallPathResolver.cs b/src/Parsing/Test/WindowsPythonInstallPathResolver.cs index 9ec3a57fe..2a77e4ded 100644 --- a/src/Parsing/Test/WindowsPythonInstallPathResolver.cs +++ b/src/Parsing/Test/WindowsPythonInstallPathResolver.cs @@ -40,34 +40,9 @@ public InterpreterConfiguration GetCondaPythonConfiguration(InterpreterArchitect private InterpreterConfiguration GetPythonConfiguration(string prefix, InterpreterArchitecture architecture, Version version) => _registryCache.FirstOrDefault(configuration => - configuration.Id.StartsWith(prefix) && configuration.Architecture == architecture && configuration.Version == version); - public InterpreterConfiguration GetIronPythonConfiguration(bool x64) { - var installPath = GetIronPythonInstallDir(); - if (!Directory.Exists(installPath)) { - return null; - } - - var exeName = x64 ? "ipy64.exe" : "ipy.exe"; - // IronPython changed to Any CPU for ipy.exe and ipy32.exe for 32-bit in 2.7.8 - if (File.Exists(Path.Combine(installPath, "ipy32.exe"))) { - exeName = x64 ? "ipy.exe" : "ipy32.exe"; - } - - return new InterpreterConfiguration( - id: x64 ? "IronPython|2.7-64" : "IronPython|2.7-32", - description: string.Format("IronPython {0} 2.7", x64 ? "64-bit" : "32-bit"), - interpreterPath: Path.Combine(installPath, exeName), - libPath: Path.Combine(installPath, "Lib"), - sitePackagesPath: Path.Combine(installPath, "Lib", "site-packages"), - architecture: x64 ? InterpreterArchitecture.x64 : InterpreterArchitecture.x86, - version: new Version(2, 7), - pathVar: "IRONPYTHONPATH" - ); - } - private List FindPythonConfigurationsInRegistry() { var configurations = new List(); @@ -87,7 +62,6 @@ private List FindPythonConfigurationsInRegistry() { } } - InterpreterConfiguration.DisambiguateDescriptions(configurations); return configurations; } @@ -183,16 +157,8 @@ InterpreterArchitecture assumedArchitecture } var pathVar = tagKey.GetValue("PathEnvironmentVariable") as string ?? "PYTHONPATH"; - var id = $"Global|{company}|{tag}"; - - var description = tagKey.GetValue("DisplayName") as string; - if (string.IsNullOrEmpty(description)) { - description = pythonCoreCompatibility ? "Python {0}{1: ()}".FormatUI(version, architecture) : "{0} {1}".FormatUI(company, tag); - } return new InterpreterConfiguration( - id: id, - description: description, interpreterPath: exePath, pathVar: pathVar, libPath: Path.Combine(prefixPath, "Lib"), From f267b80e783cabce9b366f8ef2afb11f66f8e847 Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Thu, 15 Aug 2019 13:11:35 -0700 Subject: [PATCH 06/60] Add persistence tests for 60+ system modules (#1429) * Remove old qualified name * Node storage * Class and scope to use AST map * Library analysis * Fix SO * Keep small AST with imports * AST reduction * Final field * Initial * Reload * Ignore post-final requests * Drop AST * Remove local variables * Test fixes * Fix overload match * Tests * Add locks * Remove local variables * Drop file content to save memory * Cache PEP hints * Recreate AST * Fix specialization * Fix locations * usings * Test fixes * Add options to keep data in memory * Fix test * Fix lambda parameters * Fix argument set Fix global scope node * Fix overload doc * Fix stub merge errors * Fix async issues * Undo some changes * Fix test * Fix race condition * Partial * Models and views * Restore log null checks * Fix merge conflict * Fix merge issue * Null check * Partial * Partial * Partial * Fix test * Partial * Partial * First test * Baseline comparison * Builtins * Partial * Type fixes * Fix type names, part I * Qualified name * Properly write variables * Partial * Construct module from model * Test * Variable creations * Factories * Factories * Split construction * Restore * Save builtins * Test passes * Qualified name * Better export detection * Test fixes * More consistent qualified names * Sys test * Demo * Complete sys write/read * Partial * Partial * Test staility * Perf bug * Baseline, remove debug code, deactivate db * Test fixes * Test fix * Simplify a bit * Baselines and use : separator * Baselines * PR feedback * Merge master * Remove registry reference * PR feedback * PR feedback * Restore persistence + update test * Better handle persistent module in dependencies * Undo * Add location converter abstraction * Store member location * Fix merge issue * Basic locations test * Navigation * Add test * Update baselines * Type restore - initial * Remove debug code * Partial * Fix stub merge * Various model fixes * Improve module handling * Qualified name improvements * Fix unbound case * Improve stub merge * Fix qualified names of typing * Handle stub-only modules * Add tests for io, re and sys * Better handle named tuple * Handle module circular references * Handle else in platform and version clauses + handle it in symbol collector * Formatting * Fix walk of multi-level if statement * Unify package search in imports * Fix tests * Undo change * Port changes from dbtype * Partial * Named tuple support * Baseline updates * Debug code * Support types * Properly compare class member declaring type * Nested classes and functions persistence * Undo debug * Fix numpy restore * Baselines * Fix tests * Update AnyStr test reflecting changes to AnyStr behavior * Exclude baselines from git diff * Fix gitattr * Move git setting to root * Try no path * Test fixes * Undo change * Additional stub merge fixes * Baseline updates * Fix goto def * Protect specific type creation * Track documentaton source * More reliable tests + simplification * Typo * Cleanup * Basic classification * Fix merge error * Module unique id fixes * Stricted check to save analysis * Revert "Fix tests" This reverts commit 247a8c38741324452cc5a8eeb412a9784441bd8b. * Revert "Unify package search in imports" This reverts commit 67fed10d1c892de07a9a920b5396d53d7473b977. * Don't clear scope variables with inner classes * Fix typo * Many new tests * Fix collections test * Fix CTypes * Initial * Update test * Merge issues * Fix CTypes again * Fix null bases * Tell between class members with/without self better * TypeVar support * Add bound/covariant * Fix Enum reassignments * Fix Random * Fix import * over local declarations (Socket) * Move interface * Fix reference search * Enable asyncio test * More tests * Enable dataclasses * Add inspect and gzip * More tests * Add setting * Add handling of import position relative to the variable * Caching level changes * Update baselines --- .../Evaluation/ExpressionEval.Scopes.cs | 9 +- .../Analyzer/Handlers/AssignmentHandler.cs | 15 +- .../Analyzer/Handlers/FromImportHandler.cs | 33 ++- .../Ast/Impl/Analyzer/ModuleWalker.cs | 6 +- .../Ast/Impl/Definitions/AnalysisOptions.cs | 24 ++ .../Definitions/IGenericTypeParameter.cs | 3 + .../Typing/Types/GenericTypeParameter.cs | 48 +++- .../Specializations/Typing/TypingModule.cs | 2 + .../Impl/Types/PythonClassType.Generics.cs | 10 +- .../Ast/Impl/Types/PythonClassType.cs | 6 +- src/Analysis/Ast/Impl/Types/PythonType.cs | 3 +- .../Ast/Impl/Utilities/ReentrancyGuard.cs | 2 +- .../Impl/Extensions/IndexSpanExtensions.cs | 2 + src/Caching/Impl/Factories/ModuleFactory.cs | 17 +- src/Caching/Impl/Factories/TypeVarFactory.cs | 36 +++ src/Caching/Impl/GlobalScope.cs | 11 +- .../Microsoft.Python.Analysis.Caching.csproj | 3 + src/Caching/Impl/Models/FunctionModel.cs | 1 - src/Caching/Impl/Models/MemberModel.cs | 2 - src/Caching/Impl/Models/ModuleModel.cs | 22 +- src/Caching/Impl/Models/TypeVarModel.cs | 24 +- src/Caching/Impl/ModuleDatabase.cs | 29 ++- src/Caching/Impl/ModuleUniqueId.cs | 21 +- src/Caching/Test/ClassesTests.cs | 6 +- src/Caching/Test/CoreTests.cs | 4 +- src/Caching/Test/Files/MemberLocations.json | 1 + src/Caching/Test/Files/NestedClasses.json | 19 +- src/Caching/Test/Files/SmokeTest.json | 1 + src/Caching/Test/Files/VersionHandling2.json | 1 + src/Caching/Test/Files/VersionHandling3.json | 1 + src/Caching/Test/LibraryModulesTests.cs | 211 +++++++++++++++++- src/Caching/Test/ReferencesTests.cs | 4 +- src/Core/Impl/Extensions/StringExtensions.cs | 1 + .../Impl/LanguageServer.Configuration.cs | 9 + .../Impl/Sources/DefinitionSource.cs | 2 +- 35 files changed, 502 insertions(+), 87 deletions(-) create mode 100644 src/Caching/Impl/Factories/TypeVarFactory.cs diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Scopes.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Scopes.cs index 7ecf1dee4..5c775f42a 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Scopes.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Scopes.cs @@ -43,15 +43,18 @@ public void DeclareVariable(string name, IMember value, VariableSource source) public void DeclareVariable(string name, IMember value, VariableSource source, IPythonModule module) => DeclareVariable(name, value, source, new Location(module)); - public void DeclareVariable(string name, IMember value, VariableSource source, Node location, bool overwrite = false) + public void DeclareVariable(string name, IMember value, VariableSource source, Node location, bool overwrite = true) => DeclareVariable(name, value, source, GetLocationOfName(location), overwrite); - public void DeclareVariable(string name, IMember value, VariableSource source, Location location, bool overwrite = false) { + public void DeclareVariable(string name, IMember value, VariableSource source, Location location, bool overwrite = true) { + var member = GetInScope(name); + if (member != null && !overwrite) { + return; + } if (source == VariableSource.Import && value is IVariable v) { CurrentScope.LinkVariable(name, v, location); return; } - var member = GetInScope(name); if (member != null) { if (!value.IsUnknown()) { CurrentScope.DeclareVariable(name, value, source, location); diff --git a/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs b/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs index 42b2f958c..7503d5a06 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs @@ -58,18 +58,25 @@ public void HandleAssignment(AssignmentStatement node) { } foreach (var ne in node.Left.OfType()) { + IScope scope; if (Eval.CurrentScope.NonLocals[ne.Name] != null) { - Eval.LookupNameInScopes(ne.Name, out var scope, LookupOptions.Nonlocal); + Eval.LookupNameInScopes(ne.Name, out scope, LookupOptions.Nonlocal); scope?.Variables[ne.Name].Assign(value, Eval.GetLocationOfName(ne)); continue; } - if (Eval.CurrentScope.Globals[ne.Name] != null) { - Eval.LookupNameInScopes(ne.Name, out var scope, LookupOptions.Global); + Eval.LookupNameInScopes(ne.Name, out scope, LookupOptions.Global); scope?.Variables[ne.Name].Assign(value, Eval.GetLocationOfName(ne)); continue; } + var m = Eval.LookupNameInScopes(ne.Name, out scope); + if(m?.MemberType == PythonMemberType.Class) { + // Ignore assignments to classes: enum.py does Enum = None + // which prevents persistence from restoring proper type from enum:Enum. + continue; + } + var source = value.IsGeneric() ? VariableSource.Generic : VariableSource.Declaration; Eval.DeclareVariable(ne.Name, value ?? Module.Interpreter.UnknownType, source, Eval.GetLocationOfName(ne)); } @@ -97,7 +104,7 @@ private void TryHandleClassVariable(AssignmentStatement node, IMember value) { var cls = m.GetPythonType(); if (cls != null) { using (Eval.OpenScope(Eval.Module, cls.ClassDefinition, out _)) { - Eval.DeclareVariable(mex.Name, value, VariableSource.Declaration, Eval.GetLocationOfName(mex), true); + Eval.DeclareVariable(mex.Name, value, VariableSource.Declaration, Eval.GetLocationOfName(mex)); } } } diff --git a/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs b/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs index 182f83d5d..50edd0261 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs @@ -59,7 +59,7 @@ private void AssignVariables(FromImportStatement node, IImportSearchResult impor // TODO: warn this is not a good style per // TODO: https://docs.python.org/3/faq/programming.html#what-are-the-best-practices-for-using-import-in-a-module // TODO: warn this is invalid if not in the global scope. - HandleModuleImportStar(variableModule, imports is ImplicitPackageImport); + HandleModuleImportStar(variableModule, imports is ImplicitPackageImport, node.StartIndex); return; } @@ -68,14 +68,16 @@ private void AssignVariables(FromImportStatement node, IImportSearchResult impor if (!string.IsNullOrEmpty(memberName)) { var nameExpression = asNames[i] ?? names[i]; var variableName = nameExpression?.Name ?? memberName; - var exported = variableModule.Analysis?.GlobalScope.Variables[memberName] ?? variableModule.GetMember(memberName); + var variable = variableModule.Analysis?.GlobalScope?.Variables[memberName]; + var exported = variable ?? variableModule.GetMember(memberName); var value = exported ?? GetValueFromImports(variableModule, imports as IImportChildrenSource, memberName); - Eval.DeclareVariable(variableName, value, VariableSource.Import, nameExpression); + // Do not allow imported variables to override local declarations + Eval.DeclareVariable(variableName, value, VariableSource.Import, nameExpression, CanOverwriteVariable(variableName, node.StartIndex)); } } } - private void HandleModuleImportStar(PythonVariableModule variableModule, bool isImplicitPackage) { + private void HandleModuleImportStar(PythonVariableModule variableModule, bool isImplicitPackage, int importPosition) { if (variableModule.Module == Module) { // from self import * won't define any new members return; @@ -100,10 +102,31 @@ private void HandleModuleImportStar(PythonVariableModule variableModule, bool is } var variable = variableModule.Analysis?.GlobalScope?.Variables[memberName]; - Eval.DeclareVariable(memberName, variable ?? member, VariableSource.Import); + // Do not allow imported variables to override local declarations + Eval.DeclareVariable(memberName, variable ?? member, VariableSource.Import, Eval.DefaultLocation, CanOverwriteVariable(memberName, importPosition)); } } + private bool CanOverwriteVariable(string name, int importPosition) { + var v = Eval.CurrentScope.Variables[name]; + if(v == null) { + return true; // Variable does not exist + } + // Allow overwrite if import is below the variable. Consider + // x = 1 + // x = 2 + // from A import * # brings another x + // x = 3 + var references = v.References.Where(r => r.DocumentUri == Module.Uri).ToArray(); + if(references.Length == 0) { + // No references to the variable in this file - the variable + // is imported from another module. OK to overwrite. + return true; + } + var firstAssignmentPosition = references.Min(r => r.Span.ToIndexSpan(Ast).Start); + return firstAssignmentPosition < importPosition; + } + private IMember GetValueFromImports(PythonVariableModule parentModule, IImportChildrenSource childrenSource, string memberName) { if (childrenSource == null || !childrenSource.TryGetChildImport(memberName, out var childImport)) { return Interpreter.UnknownType; diff --git a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs index a2c1759b9..e8aba3904 100644 --- a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs +++ b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs @@ -255,7 +255,7 @@ private void MergeStub() { switch (sourceType) { case null: // Nothing in sources, but there is type in the stub. Declare it. - if (v.Source == VariableSource.Declaration) { + if (v.Source == VariableSource.Declaration || v.Source == VariableSource.Generic) { Eval.DeclareVariable(v.Name, v.Value, v.Source); } break; @@ -347,6 +347,10 @@ private static bool IsStubBetterType(IPythonType sourceType, IPythonType stubTyp if (sourceType.MemberType == PythonMemberType.Function && stubType.MemberType == PythonMemberType.Class) { return true; } + // Random replaces method (variable) by a function. + if (sourceType.MemberType == PythonMemberType.Method && stubType.MemberType == PythonMemberType.Function) { + return true; + } return sourceType.MemberType == stubType.MemberType; } diff --git a/src/Analysis/Ast/Impl/Definitions/AnalysisOptions.cs b/src/Analysis/Ast/Impl/Definitions/AnalysisOptions.cs index 36c4eb180..dcf73ec35 100644 --- a/src/Analysis/Ast/Impl/Definitions/AnalysisOptions.cs +++ b/src/Analysis/Ast/Impl/Definitions/AnalysisOptions.cs @@ -14,6 +14,25 @@ // permissions and limitations under the License. namespace Microsoft.Python.Analysis { + public enum AnalysisCachingLevel { + /// + /// No caching of analysis. + /// + None, + + /// + /// Cache analysis results of system (language) modules. + /// Do not cache user-installed modules or site-packages. + /// + System, + + /// + /// Full caching, includes system and library modules. + /// Does not enable caching of user code analysis. + /// + Library + } + public class AnalysisOptions { public bool LintingEnabled { get; set; } @@ -29,5 +48,10 @@ public class AnalysisOptions { /// improve performance when library code has to be re-analyzed. /// public bool KeepLibraryAst { get; set; } + + /// + /// Defines level of caching analysis engine will maintain. + /// + public AnalysisCachingLevel AnalysisCachingLevel { get; set; } } } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericTypeParameter.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericTypeParameter.cs index 9aca942a0..77d631f2d 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericTypeParameter.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericTypeParameter.cs @@ -27,5 +27,8 @@ public interface IGenericTypeParameter: IPythonType, IEquatable /// See 'https://docs.python.org/3/library/typing.html#typing.TypeVar' IReadOnlyList Constraints { get; } + IPythonType Bound { get; } + IPythonType Covariant { get; } + IPythonType Contravariant { get; } } } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs index 0cdc143fb..f523601d1 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs @@ -25,15 +25,33 @@ namespace Microsoft.Python.Analysis.Specializations.Typing.Types { internal sealed class GenericTypeParameter : PythonType, IGenericTypeParameter { - public GenericTypeParameter(string name, IPythonModule declaringModule, IReadOnlyList constraints, string documentation, IndexSpan location) - : base(name, new Location(declaringModule), documentation) { + public GenericTypeParameter( + string name, + IPythonModule declaringModule, + IReadOnlyList constraints, + IPythonType bound, + IPythonType covariant, + IPythonType contravariant, + Location location) + : base(name, location, GetDocumentation(name, constraints, bound, covariant, contravariant)) { Constraints = constraints ?? Array.Empty(); + Bound = bound; + Covariant = covariant; + Contravariant = contravariant; } + + #region IGenericTypeParameter public IReadOnlyList Constraints { get; } + public IPythonType Bound { get; } + public IPythonType Covariant { get; } + public IPythonType Contravariant { get; } + #endregion + #region IPythonType public override BuiltinTypeId TypeId => BuiltinTypeId.Type; public override PythonMemberType MemberType => PythonMemberType.Generic; public override bool IsSpecialized => true; + #endregion private static bool TypeVarArgumentsValid(IArgumentSet argSet) { var args = argSet.Arguments; @@ -90,23 +108,29 @@ public static IPythonType FromTypeVar(IArgumentSet argSet, IPythonModule declari // Type constraints may be specified as type name strings. var typeString = (a as IPythonConstant)?.GetString(); return !string.IsNullOrEmpty(typeString) ? argSet.Eval.GetTypeFromString(typeString) : a.GetPythonType(); - }).ToArray() ?? Array.Empty(); + }).ToArray(); + + var bound = args.Where(a => a.Name == "bound").Select(a => a.Value as IPythonType).FirstOrDefault(); + var covariant = args.Where(a => a.Name == "covariant").Select(a => a.Value as IPythonType).FirstOrDefault(); + var contravariant = args.Where(a => a.Name == "contravariant").Select(a => a.Value as IPythonType).FirstOrDefault(); - var documentation = GetDocumentation(args, constraints); - return new GenericTypeParameter(name, declaringModule, constraints, documentation, location); + return new GenericTypeParameter(name, declaringModule, constraints, bound, covariant, contravariant, new Location(declaringModule, location)); } - private static string GetDocumentation(IReadOnlyList args, IReadOnlyList constraints) { - var name = (args[0].Value as IPythonConstant).GetString(); - var keyWordArgs = args.Skip(1) - .Where(x => !x.ValueIsDefault) - .Select(x => $"{x.Name}={(x.Value as IPythonConstant)?.Value}"); + private static string GetDocumentation(string name, IReadOnlyList constraints, IPythonType bound, IPythonType covariant, IPythonType contravariant) { + var constaintStrings = constraints != null ? constraints.Select(c => c.IsUnknown() ? "?" : c.Name) : Enumerable.Empty(); + var boundStrings = bound.IsUnknown() ? Enumerable.Empty() : Enumerable.Repeat($"bound={bound.Name}", 1); + var covariantStrings = covariant.IsUnknown() ? Enumerable.Empty() : Enumerable.Repeat($"covariant={covariant.Name}", 1); + var contravariantStrings = contravariant.IsUnknown() ? Enumerable.Empty() : Enumerable.Repeat($"contravariant={contravariant.Name}", 1); + + var docArgs = Enumerable.Repeat($"'{name}'", 1) + .Concat(constaintStrings).Concat(boundStrings).Concat(covariantStrings).Concat(contravariantStrings); - var docArgs = constraints.Select(c => c.IsUnknown() ? "?" : c.Name).Concat(keyWordArgs).Prepend($"'{name}'"); var documentation = CodeFormatter.FormatSequence("TypeVar", '(', docArgs); return documentation; } - public bool Equals(IGenericTypeParameter other) => Name.Equals(other.Name); + public bool Equals(IGenericTypeParameter other) => Name.Equals(other?.Name); } + } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs b/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs index cc36d4c0d..bd444a1cd 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs @@ -103,6 +103,8 @@ private void SpecializeMembers() { _members["ValuesView"] = new SpecializedGenericType("ValuesView", CreateValuesViewType, this); _members["ItemsView"] = new SpecializedGenericType("ItemsView", CreateItemsViewType, this); + _members["AbstractSet"] = new SpecializedGenericType("AbstractSet", + typeArgs => CreateListType("AbstractSet", BuiltinTypeId.Set, typeArgs, true), this); _members["Set"] = new SpecializedGenericType("Set", typeArgs => CreateListType("Set", BuiltinTypeId.Set, typeArgs, true), this); _members["MutableSet"] = new SpecializedGenericType("MutableSet", diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs index fdf4c2188..a4101de0a 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs @@ -15,6 +15,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Utilities; @@ -23,13 +24,14 @@ namespace Microsoft.Python.Analysis.Types { internal partial class PythonClassType { + private readonly object _genericParameterLock = new object(); + private readonly ReentrancyGuard _genericSpecializationGuard = new ReentrancyGuard(); + private readonly ReentrancyGuard _genericResolutionGuard = new ReentrancyGuard(); + private bool _isGeneric; - private object _genericParameterLock = new object(); private Dictionary _specificTypeCache; private Dictionary _genericParameters; private IReadOnlyList _parameters = new List(); - private ReentrancyGuard _genericSpecializationGuard = new ReentrancyGuard(); - private ReentrancyGuard _genericResolutionGuard = new ReentrancyGuard(); #region IGenericType /// @@ -66,7 +68,7 @@ public IPythonType CreateSpecificType(IArgumentSet args) { // type parameter T -> int, U -> str, etc. var genericTypeToSpecificType = GetSpecificTypes(args, genericTypeParameters, newBases); - PythonClassType classType = new PythonClassType(BaseName, new Location(DeclaringModule)); + var classType = new PythonClassType(BaseName, new Location(DeclaringModule)); // Storing generic parameters allows methods returning generic types // to know what type parameter returns what specific type StoreGenericParameters(classType, genericTypeParameters, genericTypeToSpecificType); diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.cs index b1ac669fe..8a6acfd6c 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.cs @@ -40,7 +40,7 @@ internal enum ClassDocumentationSource { private readonly ReentrancyGuard _memberGuard = new ReentrancyGuard(); private string _genericName; - private List _bases; + private List _bases = new List(); private IReadOnlyList _mro; private string _documentation; @@ -187,7 +187,7 @@ public IReadOnlyList Mro { if (_mro != null) { return _mro; } - if (_bases == null) { + if (_bases.Count == 0) { return new IPythonType[] { this }; } _mro = new IPythonType[] { this }; @@ -211,7 +211,7 @@ public IReadOnlyList Mro { internal override void SetDocumentation(string documentation) => _documentation = documentation; internal void SetBases(IEnumerable bases) { - if (_bases != null) { + if (_bases.Count > 0) { return; // Already set } diff --git a/src/Analysis/Ast/Impl/Types/PythonType.cs b/src/Analysis/Ast/Impl/Types/PythonType.cs index fa6520372..c6d1067b6 100644 --- a/src/Analysis/Ast/Impl/Types/PythonType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonType.cs @@ -64,13 +64,12 @@ public override void AddReference(Location location) { #region IPythonType - public virtual string Name => TypeId == BuiltinTypeId.Ellipsis ? "..." : BaseName; - public virtual string QualifiedName => DeclaringModule.ModuleType == ModuleType.Builtins ? TypeId == BuiltinTypeId.Ellipsis ? "ellipsis" : Name : this.GetQualifiedName(); + public virtual string Name => TypeId == BuiltinTypeId.Ellipsis ? "..." : BaseName; public virtual string Documentation { get; private set; } public virtual BuiltinTypeId TypeId => _typeId; public string BaseName { get; } diff --git a/src/Analysis/Ast/Impl/Utilities/ReentrancyGuard.cs b/src/Analysis/Ast/Impl/Utilities/ReentrancyGuard.cs index cbccd3e6b..8adbd2782 100644 --- a/src/Analysis/Ast/Impl/Utilities/ReentrancyGuard.cs +++ b/src/Analysis/Ast/Impl/Utilities/ReentrancyGuard.cs @@ -40,7 +40,7 @@ public IDisposable Push(T t, out bool reentered) { public void Pop() { _stack.Value.Pop(); - if(_stack.Value.Count == 0) { + if (_stack.Value.Count == 0) { _stack.Value = null; } } diff --git a/src/Caching/Impl/Extensions/IndexSpanExtensions.cs b/src/Caching/Impl/Extensions/IndexSpanExtensions.cs index 44f43d018..3381df3f7 100644 --- a/src/Caching/Impl/Extensions/IndexSpanExtensions.cs +++ b/src/Caching/Impl/Extensions/IndexSpanExtensions.cs @@ -14,11 +14,13 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System.Diagnostics; using Microsoft.Python.Analysis.Caching.Models; using Microsoft.Python.Core.Text; namespace Microsoft.Python.Analysis.Caching { internal static class IndexSpanExtensions { + [DebuggerStepThrough] public static IndexSpanModel ToModel(this IndexSpan span) => new IndexSpanModel { Start = span.Start, Length = span.Length diff --git a/src/Caching/Impl/Factories/ModuleFactory.cs b/src/Caching/Impl/Factories/ModuleFactory.cs index 9627076a8..ddc18af8e 100644 --- a/src/Caching/Impl/Factories/ModuleFactory.cs +++ b/src/Caching/Impl/Factories/ModuleFactory.cs @@ -37,6 +37,7 @@ internal sealed class ModuleFactory : IDisposable { public FunctionFactory FunctionFactory { get; } public PropertyFactory PropertyFactory { get; } public VariableFactory VariableFactory { get; } + public TypeVarFactory TypeVarFactory { get; } public Location DefaultLocation { get; } public ModuleFactory(ModuleModel model, IPythonModule module) { @@ -44,6 +45,7 @@ public ModuleFactory(ModuleModel model, IPythonModule module) { ClassFactory = new ClassFactory(model.Classes, this); FunctionFactory = new FunctionFactory(model.Functions, this); VariableFactory = new VariableFactory(model.Variables, this); + TypeVarFactory = new TypeVarFactory(model.TypeVars, this); PropertyFactory = new PropertyFactory(this); DefaultLocation = new Location(Module); } @@ -52,6 +54,7 @@ public void Dispose() { ClassFactory.Dispose(); FunctionFactory.Dispose(); VariableFactory.Dispose(); + TypeVarFactory.Dispose(); } public IPythonType ConstructType(string qualifiedName) => ConstructMember(qualifiedName)?.GetPythonType(); @@ -194,12 +197,14 @@ private IReadOnlyList GetTypeArguments(string memberName, out strin var argumentString = memberName.Substring(openBracket + 1, closeBracket - openBracket - 1); // Extract type names from argument string. Note that types themselves // can have arguments: Union[int, Union[int, Union[str, bool]], ...]. - var arguments = TypeNames.GetTypeNames(argumentString, ','); - foreach (var a in arguments) { - var t = ConstructType(a); - // TODO: better handle generics type definitions from TypeVar. - // https://github.com/microsoft/python-language-server/issues/1214 - t = t ?? new GenericTypeParameter(a, Module, Array.Empty(), string.Empty, DefaultLocation.IndexSpan); + var qualifiedNames = TypeNames.GetTypeNames(argumentString, ','); + foreach (var qn in qualifiedNames) { + var t = ConstructType(qn); + if (t == null) { + TypeNames.DeconstructQualifiedName(qn, out var parts); + typeName = string.Join(".", parts.MemberNames); + t = new GenericTypeParameter(typeName, Module, Array.Empty(), null, null, null, DefaultLocation); + } typeArgs.Add(t); } typeName = memberName.Substring(0, openBracket); diff --git a/src/Caching/Impl/Factories/TypeVarFactory.cs b/src/Caching/Impl/Factories/TypeVarFactory.cs new file mode 100644 index 000000000..f9cf8025c --- /dev/null +++ b/src/Caching/Impl/Factories/TypeVarFactory.cs @@ -0,0 +1,36 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using System.Linq; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Specializations.Typing.Types; +using Microsoft.Python.Analysis.Types; + +namespace Microsoft.Python.Analysis.Caching.Factories { + internal sealed class TypeVarFactory : FactoryBase { + public TypeVarFactory(IEnumerable models, ModuleFactory mf) + : base(models, mf) { + } + + public override IPythonType CreateMember(TypeVarModel tvm, IPythonType declaringType) { + var constraints = tvm.Constraints.Select(c => ModuleFactory.ConstructType(c)).ToArray(); + var bound = ModuleFactory.ConstructType(tvm.Bound); + var covariant = ModuleFactory.ConstructType(tvm.Covariant); + var contravariant = ModuleFactory.ConstructType(tvm.Contravariant); + return new GenericTypeParameter(tvm.Name, ModuleFactory.Module, constraints, bound, covariant, contravariant, ModuleFactory.DefaultLocation); + } + } +} diff --git a/src/Caching/Impl/GlobalScope.cs b/src/Caching/Impl/GlobalScope.cs index d484c0d66..84d7324fc 100644 --- a/src/Caching/Impl/GlobalScope.cs +++ b/src/Caching/Impl/GlobalScope.cs @@ -32,23 +32,26 @@ public GlobalScope(ModuleModel model, IPythonModule module, IServiceContainer se Name = model.Name; using (var mf = new ModuleFactory(model, module)) { - // TODO: store real location in models + foreach (var tvm in model.TypeVars) { + var t = mf.TypeVarFactory.Construct(tvm); + _scopeVariables.DeclareVariable(tvm.Name, t, VariableSource.Generic, mf.DefaultLocation); + } // Member creation may be non-linear. Consider function A returning instance // of a class or type info of a function which hasn't been created yet. // Thus check if member has already been created first. foreach (var cm in model.Classes) { - var cls = mf.ClassFactory.Construct(cm, null); + var cls = mf.ClassFactory.Construct(cm); _scopeVariables.DeclareVariable(cm.Name, cls, VariableSource.Declaration, mf.DefaultLocation); } foreach (var fm in model.Functions) { - var ft = mf.FunctionFactory.Construct(fm, null); + var ft = mf.FunctionFactory.Construct(fm); _scopeVariables.DeclareVariable(fm.Name, ft, VariableSource.Declaration, mf.DefaultLocation); } foreach (var vm in model.Variables) { - var v = mf.VariableFactory.Construct(vm, null); + var v = mf.VariableFactory.Construct(vm); _scopeVariables.DeclareVariable(vm.Name, v.Value, VariableSource.Declaration, mf.DefaultLocation); } // TODO: re-declare __doc__, __name__, etc. diff --git a/src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj b/src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj index e81ee3640..5f17847f4 100644 --- a/src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj +++ b/src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj @@ -21,6 +21,9 @@ + + + diff --git a/src/Caching/Impl/Models/FunctionModel.cs b/src/Caching/Impl/Models/FunctionModel.cs index 6049b5476..4608ff719 100644 --- a/src/Caching/Impl/Models/FunctionModel.cs +++ b/src/Caching/Impl/Models/FunctionModel.cs @@ -18,7 +18,6 @@ using System.Linq; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Utilities; -using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; namespace Microsoft.Python.Analysis.Caching.Models { diff --git a/src/Caching/Impl/Models/MemberModel.cs b/src/Caching/Impl/Models/MemberModel.cs index 1a4561e94..253ea6b54 100644 --- a/src/Caching/Impl/Models/MemberModel.cs +++ b/src/Caching/Impl/Models/MemberModel.cs @@ -13,8 +13,6 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using Microsoft.Python.Core.Text; - namespace Microsoft.Python.Analysis.Caching.Models { internal abstract class MemberModel { public int Id { get; set; } diff --git a/src/Caching/Impl/Models/ModuleModel.cs b/src/Caching/Impl/Models/ModuleModel.cs index 883c774d8..7fe06f118 100644 --- a/src/Caching/Impl/Models/ModuleModel.cs +++ b/src/Caching/Impl/Models/ModuleModel.cs @@ -15,6 +15,7 @@ using System.Collections.Generic; using System.Linq; +using Microsoft.Python.Analysis.Caching.Factories; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; @@ -31,6 +32,7 @@ internal sealed class ModuleModel : MemberModel { public FunctionModel[] Functions { get; set; } public VariableModel[] Variables { get; set; } public ClassModel[] Classes { get; set; } + public TypeVarModel[] TypeVars { get; set; } /// /// Collection of new line information for conversion of linear spans @@ -43,18 +45,30 @@ internal sealed class ModuleModel : MemberModel { /// public int FileSize { get; set; } - // TODO: TypeVars, ... + public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceContainer services, AnalysisCachingLevel options) { + var uniqueId = analysis.Document.GetUniqueId(services, options); + if(uniqueId == null) { + // Caching level setting does not permit this module to be persisted. + return null; + } - public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceContainer services) { var variables = new Dictionary(); var functions = new Dictionary(); var classes = new Dictionary(); + var typeVars = new Dictionary(); // Go directly through variables which names are listed in GetMemberNames // as well as variables that are declarations. var exportedNames = new HashSet(analysis.Document.GetMemberNames()); foreach (var v in analysis.GlobalScope.Variables - .Where(v => exportedNames.Contains(v.Name) || v.Source == VariableSource.Declaration || v.Source == VariableSource.Builtin)) { + .Where(v => exportedNames.Contains(v.Name) || + v.Source == VariableSource.Declaration || + v.Source == VariableSource.Builtin || + v.Source == VariableSource.Generic)) { + + if (v.Value is IGenericTypeParameter && !typeVars.ContainsKey(v.Name)) { + typeVars[v.Name] = TypeVarModel.FromGeneric(v); + } switch (v.Value) { case IPythonFunctionType ft when ft.IsLambda(): @@ -90,7 +104,6 @@ when cls.DeclaringModule.Equals(analysis.Document) || cls.DeclaringModule.Equals } } - var uniqueId = analysis.Document.GetUniqueId(services); return new ModuleModel { Id = uniqueId.GetStableHash(), UniqueId = uniqueId, @@ -99,6 +112,7 @@ when cls.DeclaringModule.Equals(analysis.Document) || cls.DeclaringModule.Equals Functions = functions.Values.ToArray(), Variables = variables.Values.ToArray(), Classes = classes.Values.ToArray(), + TypeVars = typeVars.Values.ToArray(), NewLines = analysis.Ast.NewLineLocations.Select(l => new NewLineModel { EndIndex = l.EndIndex, Kind = l.Kind diff --git a/src/Caching/Impl/Models/TypeVarModel.cs b/src/Caching/Impl/Models/TypeVarModel.cs index eeae11354..fba7dd8a1 100644 --- a/src/Caching/Impl/Models/TypeVarModel.cs +++ b/src/Caching/Impl/Models/TypeVarModel.cs @@ -14,11 +14,29 @@ // permissions and limitations under the License. using System.Diagnostics; +using System.Linq; +using Microsoft.Python.Analysis.Specializations.Typing; +using Microsoft.Python.Analysis.Values; +using Microsoft.Python.Core; namespace Microsoft.Python.Analysis.Caching.Models { - [DebuggerDisplay("t:{Name}")] - internal sealed class TypeVarModel { - public string Name { get; set; } + [DebuggerDisplay("TypeVar:{Name}")] + internal sealed class TypeVarModel: MemberModel { public string[] Constraints { get; set; } + public string Bound { get; set; } + public string Covariant { get; set; } + public string Contravariant { get; set; } + + public static TypeVarModel FromGeneric(IVariable v) { + var g = (IGenericTypeParameter)v.Value; + return new TypeVarModel { + Id = g.Name.GetStableHash(), + Name = g.Name, + Constraints = g.Constraints.Select(c => c.GetPersistentQualifiedName()).ToArray(), + Bound = g.Bound.GetPersistentQualifiedName(), + Covariant = g.Covariant.GetPersistentQualifiedName(), + Contravariant = g.Contravariant.GetPersistentQualifiedName() + }; + } } } diff --git a/src/Caching/Impl/ModuleDatabase.cs b/src/Caching/Impl/ModuleDatabase.cs index 3c7e2779e..97af51827 100644 --- a/src/Caching/Impl/ModuleDatabase.cs +++ b/src/Caching/Impl/ModuleDatabase.cs @@ -39,6 +39,7 @@ public ModuleDatabase(IServiceContainer services) { _services = services; _log = services.GetService(); _fs = services.GetService(); + var cfs = services.GetService(); _databaseFolder = Path.Combine(cfs.CacheFolder, $"analysis.v{_databaseFormatVersion}"); } @@ -54,6 +55,11 @@ public ModuleDatabase(IServiceContainer services) { /// Module storage state public ModuleStorageState TryCreateModule(string moduleName, string filePath, out IPythonModule module) { module = null; + + if (GetCachingLevel() == AnalysisCachingLevel.None) { + return ModuleStorageState.DoesNotExist; + } + // We don't cache results here. Module resolution service decides when to call in here // and it is responsible of overall management of the loaded Python modules. for (var retries = 50; retries > 0; --retries) { @@ -89,12 +95,16 @@ public ModuleStorageState TryCreateModule(string moduleName, string filePath, ou /// Writes module data to the database. /// public Task StoreModuleAnalysisAsync(IDocumentAnalysis analysis, CancellationToken cancellationToken = default) - => Task.Run(() => StoreModuleAnalysis(analysis, cancellationToken)); + => Task.Run(() => StoreModuleAnalysis(analysis, cancellationToken), cancellationToken); /// /// Determines if module analysis exists in the storage. /// public bool ModuleExistsInStorage(string moduleName, string filePath) { + if(GetCachingLevel() == AnalysisCachingLevel.None) { + return false; + } + for (var retries = 50; retries > 0; --retries) { try { var dbPath = FindDatabaseFile(moduleName, filePath); @@ -107,7 +117,17 @@ public bool ModuleExistsInStorage(string moduleName, string filePath) { } private void StoreModuleAnalysis(IDocumentAnalysis analysis, CancellationToken cancellationToken = default) { - var model = ModuleModel.FromAnalysis(analysis, _services); + var cachingLevel = GetCachingLevel(); + if(cachingLevel == AnalysisCachingLevel.None) { + return; + } + + var model = ModuleModel.FromAnalysis(analysis, _services, cachingLevel); + if (model == null) { + // Caching level setting does not permit this module to be persisted. + return; + } + Exception ex = null; for (var retries = 50; retries > 0; --retries) { cancellationToken.ThrowIfCancellationRequested(); @@ -146,7 +166,7 @@ private void StoreModuleAnalysis(IDocumentAnalysis analysis, CancellationToken c /// private string FindDatabaseFile(string moduleName, string filePath) { var interpreter = _services.GetService(); - var uniqueId = ModuleUniqueId.GetUniqueId(moduleName, filePath, ModuleType.Specialized, _services); + var uniqueId = ModuleUniqueId.GetUniqueId(moduleName, filePath, ModuleType.Specialized, _services, GetCachingLevel()); if (string.IsNullOrEmpty(uniqueId)) { return null; } @@ -170,5 +190,8 @@ private string FindDatabaseFile(string moduleName, string filePath) { dbPath = Path.Combine(_databaseFolder, $"{uniqueId}({pythonVersion.Major}).db"); return _fs.FileExists(dbPath) ? dbPath : null; } + + private AnalysisCachingLevel GetCachingLevel() + => _services.GetService()?.Options.AnalysisCachingLevel ?? AnalysisCachingLevel.None; } } diff --git a/src/Caching/Impl/ModuleUniqueId.cs b/src/Caching/Impl/ModuleUniqueId.cs index 879211599..9cf4fd376 100644 --- a/src/Caching/Impl/ModuleUniqueId.cs +++ b/src/Caching/Impl/ModuleUniqueId.cs @@ -25,19 +25,28 @@ namespace Microsoft.Python.Analysis.Caching { internal static class ModuleUniqueId { - public static string GetUniqueId(this IPythonModule module, IServiceContainer services) - => GetUniqueId(module.Name, module.FilePath, module.ModuleType, services); - - public static string GetUniqueId(string moduleName, string filePath, ModuleType moduleType, IServiceContainer services) { - var interpreter = services.GetService(); - var fs = services.GetService(); + public static string GetUniqueId(this IPythonModule module, IServiceContainer services, AnalysisCachingLevel cachingLevel) + => GetUniqueId(module.Name, module.FilePath, module.ModuleType, services, cachingLevel); + public static string GetUniqueId(string moduleName, string filePath, ModuleType moduleType, IServiceContainer services, AnalysisCachingLevel cachingLevel) { + if(cachingLevel == AnalysisCachingLevel.None) { + return null; + } if (moduleType == ModuleType.User) { // Only for tests. return $"{moduleName}"; } + var interpreter = services.GetService(); + var fs = services.GetService(); + var modulePathType = GetModulePathType(filePath, interpreter.ModuleResolution.LibraryPaths, fs); + switch(modulePathType) { + case PythonLibraryPathType.Site when cachingLevel < AnalysisCachingLevel.Library: + return null; + case PythonLibraryPathType.StdLib when cachingLevel < AnalysisCachingLevel.System: + return null; + } if (!string.IsNullOrEmpty(filePath) && modulePathType == PythonLibraryPathType.Site) { // Module can be a submodule of a versioned package. In this case we want to use diff --git a/src/Caching/Test/ClassesTests.cs b/src/Caching/Test/ClassesTests.cs index adaa23093..facbf28ff 100644 --- a/src/Caching/Test/ClassesTests.cs +++ b/src/Caching/Test/ClassesTests.cs @@ -52,15 +52,15 @@ def methodC(self): return False def methodB1(self): - return C() + return self.C() def methodB2(self): - return C().y + return self.C().y c = B().methodB1() "; var analysis = await GetAnalysisAsync(code); - var model = ModuleModel.FromAnalysis(analysis, Services); + var model = ModuleModel.FromAnalysis(analysis, Services, AnalysisCachingLevel.Library); var json = ToJson(model); Baseline.CompareToFile(BaselineFileName, json); } diff --git a/src/Caching/Test/CoreTests.cs b/src/Caching/Test/CoreTests.cs index c5cd6ea1e..4b1adaafa 100644 --- a/src/Caching/Test/CoreTests.cs +++ b/src/Caching/Test/CoreTests.cs @@ -59,7 +59,7 @@ def func(): c = C() "; var analysis = await GetAnalysisAsync(code); - var model = ModuleModel.FromAnalysis(analysis, Services); + var model = ModuleModel.FromAnalysis(analysis, Services, AnalysisCachingLevel.Library); var json = ToJson(model); Baseline.CompareToFile(BaselineFileName, json); } @@ -106,7 +106,7 @@ def func(a): ... .Which.Should().HaveSingleOverload() .Which.Should().HaveParameters(is3x ? new[] { "a", "b", "c" } : new[] { "a" }); - var model = ModuleModel.FromAnalysis(analysis, Services); + var model = ModuleModel.FromAnalysis(analysis, Services, AnalysisCachingLevel.Library); var json = ToJson(model); Baseline.CompareToFile(GetBaselineFileNameWithSuffix(is3x ? "3" : "2"), json); } diff --git a/src/Caching/Test/Files/MemberLocations.json b/src/Caching/Test/Files/MemberLocations.json index 1269c8e2f..a5c60043f 100644 --- a/src/Caching/Test/Files/MemberLocations.json +++ b/src/Caching/Test/Files/MemberLocations.json @@ -241,6 +241,7 @@ } } ], + "TypeVars": [], "NewLines": [ { "EndIndex": 2, diff --git a/src/Caching/Test/Files/NestedClasses.json b/src/Caching/Test/Files/NestedClasses.json index 1ef88efe2..a74431141 100644 --- a/src/Caching/Test/Files/NestedClasses.json +++ b/src/Caching/Test/Files/NestedClasses.json @@ -80,7 +80,7 @@ "Id": 812, "Name": "c", "IndexSpan": { - "Start": 323, + "Start": 333, "Length": 1 } } @@ -181,7 +181,7 @@ "Id": 935009768, "Name": "methodB2", "IndexSpan": { - "Start": 282, + "Start": 287, "Length": 8 } } @@ -281,6 +281,7 @@ } } ], + "TypeVars": [], "NewLines": [ { "EndIndex": 2, @@ -351,31 +352,31 @@ "Kind": 3 }, { - "EndIndex": 272, + "EndIndex": 277, "Kind": 3 }, { - "EndIndex": 274, + "EndIndex": 279, "Kind": 3 }, { - "EndIndex": 299, + "EndIndex": 304, "Kind": 3 }, { - "EndIndex": 321, + "EndIndex": 331, "Kind": 3 }, { - "EndIndex": 323, + "EndIndex": 333, "Kind": 3 }, { - "EndIndex": 343, + "EndIndex": 353, "Kind": 3 } ], - "FileSize": 343, + "FileSize": 353, "Id": -2131035837, "Name": "module", "IndexSpan": null diff --git a/src/Caching/Test/Files/SmokeTest.json b/src/Caching/Test/Files/SmokeTest.json index be1c77d98..00b940866 100644 --- a/src/Caching/Test/Files/SmokeTest.json +++ b/src/Caching/Test/Files/SmokeTest.json @@ -199,6 +199,7 @@ } } ], + "TypeVars": [], "NewLines": [ { "EndIndex": 2, diff --git a/src/Caching/Test/Files/VersionHandling2.json b/src/Caching/Test/Files/VersionHandling2.json index 1e75eb30c..74643926a 100644 --- a/src/Caching/Test/Files/VersionHandling2.json +++ b/src/Caching/Test/Files/VersionHandling2.json @@ -94,6 +94,7 @@ } ], "Classes": [], + "TypeVars": [], "NewLines": [ { "EndIndex": 2, diff --git a/src/Caching/Test/Files/VersionHandling3.json b/src/Caching/Test/Files/VersionHandling3.json index 2ce8f4e38..707ef1020 100644 --- a/src/Caching/Test/Files/VersionHandling3.json +++ b/src/Caching/Test/Files/VersionHandling3.json @@ -106,6 +106,7 @@ } ], "Classes": [], + "TypeVars": [], "NewLines": [ { "EndIndex": 2, diff --git a/src/Caching/Test/LibraryModulesTests.cs b/src/Caching/Test/LibraryModulesTests.cs index cb319750c..fc1fe5d51 100644 --- a/src/Caching/Test/LibraryModulesTests.cs +++ b/src/Caching/Test/LibraryModulesTests.cs @@ -43,7 +43,7 @@ public void TestInitialize() public async Task Builtins() { var analysis = await GetAnalysisAsync(string.Empty); var builtins = analysis.Document.Interpreter.ModuleResolution.BuiltinsModule; - var model = ModuleModel.FromAnalysis(builtins.Analysis, Services); + var model = ModuleModel.FromAnalysis(builtins.Analysis, Services, AnalysisCachingLevel.Library); var json = ToJson(model); Baseline.CompareToFile(BaselineFileName, json); @@ -52,25 +52,224 @@ public async Task Builtins() { dbModule.Should().HaveSameMembersAs(builtins); } + [TestMethod, Priority(0)] + public Task Ast() => TestModule("ast"); [TestMethod, Priority(0)] - public Task Sys() => TestModule("sys"); + public Task Asyncio() => TestModule("asyncio"); + + [TestMethod, Priority(0)] + public Task Base64() => TestModule("base64"); + + [TestMethod, Priority(0)] + public Task Bisect() => TestModule("bisect"); + + [TestMethod, Priority(0)] + public Task Calendar() => TestModule("calendar"); + + [TestMethod, Priority(0)] + public Task Collections() => TestModule("collections"); + + [TestMethod, Priority(0)] + public Task Concurrent() => TestModule("concurrent"); + + [TestMethod, Priority(0)] + public Task Crypt() => TestModule("crypt"); + + [TestMethod, Priority(0)] + [Ignore("_DRMapping type issue. Consider merge of module to stub so OrderedDict resolves to generic from the collections stub.")] + public Task Csv() => TestModule("csv"); + + [TestMethod, Priority(0)] + public Task CTypes() => TestModule("ctypes"); + + [TestMethod, Priority(0)] + public Task Curses() => TestModule("curses"); + + [TestMethod, Priority(0)] + public Task Dataclasses() => TestModule("dataclasses"); + + [TestMethod, Priority(0)] + public Task Datetime() => TestModule("datetime"); + + [TestMethod, Priority(0)] + public Task Dbm() => TestModule("dbm"); + + [TestMethod, Priority(0)] + public Task Distutils() => TestModule("distutils"); + + [TestMethod, Priority(0)] + public Task Email() => TestModule("email"); + + [TestMethod, Priority(0)] + public Task Encodings() => TestModule("encodings"); + + [TestMethod, Priority(0)] + public Task Enum() => TestModule("enum"); + + [TestMethod, Priority(0)] + public Task Filecmp() => TestModule("filecmp"); + + [TestMethod, Priority(0)] + public Task Fileinput() => TestModule("fileinput"); + + [TestMethod, Priority(0)] + public Task Fractions() => TestModule("fractions"); + + [TestMethod, Priority(0)] + public Task Ftplib() => TestModule("ftplib"); + + [TestMethod, Priority(0)] + public Task Functools() => TestModule("functools"); + + [TestMethod, Priority(0)] + public Task Genericpath() => TestModule("genericpath"); + + [TestMethod, Priority(0)] + public Task Glob() => TestModule("glob"); + + [TestMethod, Priority(0)] + public Task Gzip() => TestModule("gzip"); + + [TestMethod, Priority(0)] + public Task Hashlib() => TestModule("hashlib"); + + [TestMethod, Priority(0)] + public Task Heapq() => TestModule("heapq"); + + [TestMethod, Priority(0)] + public Task Html() => TestModule("html"); + + [TestMethod, Priority(0)] + public Task Http() => TestModule("http"); + + [TestMethod, Priority(0)] + public Task Importlib() => TestModule("importlib"); + + [TestMethod, Priority(0)] + public Task Imaplib() => TestModule("imaplib"); + + [TestMethod, Priority(0)] + public Task Imghdr() => TestModule("imghdr"); + + [TestMethod, Priority(0)] + public Task Inspect() => TestModule("inspect"); [TestMethod, Priority(0)] public Task Io() => TestModule("io"); [TestMethod, Priority(0)] - public Task Re() => TestModule("re"); + public Task Json() => TestModule("json"); + + [TestMethod, Priority(0)] + public Task Logging() => TestModule("logging"); + + [TestMethod, Priority(0)] + public Task Lzma() => TestModule("lzma"); + + [TestMethod, Priority(0)] + public Task Mailbox() => TestModule("mailbox"); + + [TestMethod, Priority(0)] + public Task Multiprocessing() => TestModule("multiprocessing"); [TestMethod, Priority(0)] public Task Os() => TestModule("os"); [TestMethod, Priority(0)] - public Task Logging() => TestModule("logging"); + public Task Pickle() => TestModule("pickle"); + + [TestMethod, Priority(0)] + public Task Pipes() => TestModule("pipes"); + + [TestMethod, Priority(0)] + public Task Pkgutil() => TestModule("pkgutil"); + + [TestMethod, Priority(0)] + [Ignore("Specialize Enum. See PlistFormat = enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__)")] + public Task Plistlib() => TestModule("plistlib"); + + [TestMethod, Priority(0)] + public Task Pstats() => TestModule("pstats"); + + [TestMethod, Priority(0)] + public Task Pydoc() => TestModule("pydoc"); + + [TestMethod, Priority(0)] + public Task Queue() => TestModule("queue"); + + [TestMethod, Priority(0)] + public Task Random() => TestModule("random"); + + [TestMethod, Priority(0)] + public Task Re() => TestModule("re"); + + [TestMethod, Priority(0)] + public Task Reprlib() => TestModule("reprlib"); + + [TestMethod, Priority(0)] + public Task Signal() => TestModule("signal"); + + [TestMethod, Priority(0)] + public Task Site() => TestModule("site"); + + [TestMethod, Priority(0)] + public Task Socket() => TestModule("socket"); + + [TestMethod, Priority(0)] + public Task Sqlite3() => TestModule("sqlite3"); + + [TestMethod, Priority(0)] + public Task Statistics() => TestModule("statistics"); + + [TestMethod, Priority(0)] + public Task String() => TestModule("string"); + + [TestMethod, Priority(0)] + public Task Ssl() => TestModule("ssl"); + + [TestMethod, Priority(0)] + public Task Sys() => TestModule("sys"); + + [TestMethod, Priority(0)] + public Task Time() => TestModule("time"); + + [TestMethod, Priority(0)] + public Task Threading() => TestModule("threading"); + + [TestMethod, Priority(0)] + public Task Tkinter() => TestModule("tkinter"); + + [TestMethod, Priority(0)] + public Task Token() => TestModule("token"); + + [TestMethod, Priority(0)] + public Task Trace() => TestModule("trace"); [TestMethod, Priority(0)] public Task Types() => TestModule("types"); + [TestMethod, Priority(0)] + public Task Unittest() => TestModule("unittest"); + + [TestMethod, Priority(0)] + public Task Urllib() => TestModule("urllib"); + + [TestMethod, Priority(0)] + public Task Uuid() => TestModule("uuid"); + + [TestMethod, Priority(0)] + public Task Weakref() => TestModule("weakref"); + + [TestMethod, Priority(0)] + public Task Xml() => TestModule("xml"); + + [TestMethod, Priority(0)] + public Task XmlRpc() => TestModule("xmlrpc"); + + [TestMethod, Priority(0)] + public Task Zipfile() => TestModule("zipfile"); + [TestMethod, Priority(0)] public async Task Requests() { const string code = @" @@ -85,7 +284,7 @@ import requests } var rq = analysis.Document.Interpreter.ModuleResolution.GetImportedModule("requests"); - var model = ModuleModel.FromAnalysis(rq.Analysis, Services); + var model = ModuleModel.FromAnalysis(rq.Analysis, Services, AnalysisCachingLevel.Library); var u = model.UniqueId; u.Should().Contain("(").And.EndWith(")"); @@ -99,7 +298,7 @@ import requests private async Task TestModule(string name) { var analysis = await GetAnalysisAsync($"import {name}"); var m = analysis.Document.Interpreter.ModuleResolution.GetImportedModule(name); - var model = ModuleModel.FromAnalysis(m.Analysis, Services); + var model = ModuleModel.FromAnalysis(m.Analysis, Services, AnalysisCachingLevel.Library); CompareBaselineAndRestore(model, m); } diff --git a/src/Caching/Test/ReferencesTests.cs b/src/Caching/Test/ReferencesTests.cs index ca75fb8fe..867cd95c3 100644 --- a/src/Caching/Test/ReferencesTests.cs +++ b/src/Caching/Test/ReferencesTests.cs @@ -62,7 +62,7 @@ def methodB2(self): return 2 "; var analysis = await GetAnalysisAsync(code); - var model = ModuleModel.FromAnalysis(analysis, Services); + var model = ModuleModel.FromAnalysis(analysis, Services, AnalysisCachingLevel.Library); var json = ToJson(model); Baseline.CompareToFile(BaselineFileName, json); @@ -101,7 +101,7 @@ import logging "; var analysis = await GetAnalysisAsync(code); var logging = analysis.Document.Interpreter.ModuleResolution.GetImportedModule("logging"); - var model = ModuleModel.FromAnalysis(logging.Analysis, Services); + var model = ModuleModel.FromAnalysis(logging.Analysis, Services, AnalysisCachingLevel.Library); var dbModule = new PythonDbModule(model, logging.FilePath, Services); analysis.Document.Interpreter.ModuleResolution.SpecializeModule("logging", x => dbModule, replaceExisting: true); diff --git a/src/Core/Impl/Extensions/StringExtensions.cs b/src/Core/Impl/Extensions/StringExtensions.cs index a5044e33f..be0b1f899 100644 --- a/src/Core/Impl/Extensions/StringExtensions.cs +++ b/src/Core/Impl/Extensions/StringExtensions.cs @@ -303,6 +303,7 @@ public static string NormalizeLineEndings(this string s, string lineEnding = nul return string.Join(lineEnding, s.SplitLines()); } + [DebuggerStepThrough] public static int GetStableHash(this string s) { unchecked { var hash = 23; diff --git a/src/LanguageServer/Impl/LanguageServer.Configuration.cs b/src/LanguageServer/Impl/LanguageServer.Configuration.cs index 1ac34b14a..5e0de734f 100644 --- a/src/LanguageServer/Impl/LanguageServer.Configuration.cs +++ b/src/LanguageServer/Impl/LanguageServer.Configuration.cs @@ -80,6 +80,7 @@ private void HandleDiagnosticsChanges(JToken pythonSection, LanguageServerSettin var optionsProvider = _services.GetService(); optionsProvider.Options.KeepLibraryLocalVariables = GetSetting(memory, "keepLibraryLocalVariables", false); optionsProvider.Options.KeepLibraryAst = GetSetting(memory, "keepLibraryAst", false); + optionsProvider.Options.AnalysisCachingLevel = GetAnalysisCachingLevel(analysis); } internal static void HandleLintingOnOff(IServiceContainer services, bool linterEnabled) { @@ -100,5 +101,13 @@ internal static void HandleLintingOnOff(IServiceContainer services, bool linterE ds.Replace(m.Uri, entries, DiagnosticSource.Linter); } } + + private AnalysisCachingLevel GetAnalysisCachingLevel(JToken analysisKey) { + var s = GetSetting(analysisKey, "cachingLevel", "None"); + if (s.EqualsIgnoreCase("System")) { + return AnalysisCachingLevel.System; + } + return s.EqualsIgnoreCase("Library") ? AnalysisCachingLevel.Library : AnalysisCachingLevel.None; + } } } diff --git a/src/LanguageServer/Impl/Sources/DefinitionSource.cs b/src/LanguageServer/Impl/Sources/DefinitionSource.cs index 7a52c8b75..159277950 100644 --- a/src/LanguageServer/Impl/Sources/DefinitionSource.cs +++ b/src/LanguageServer/Impl/Sources/DefinitionSource.cs @@ -192,7 +192,7 @@ private Reference HandleImport(IDocumentAnalysis analysis, ImportStatement state private Reference TryFromVariable(string name, IDocumentAnalysis analysis, SourceLocation location, Node statement, out ILocatedMember definingMember) { definingMember = null; - var m = analysis.ExpressionEvaluator.LookupNameInScopes(name, out var scope); + var m = analysis.ExpressionEvaluator.LookupNameInScopes(name, out var scope, LookupOptions.All); if (m == null || scope.Module.ModuleType == ModuleType.Builtins || !(scope.Variables[name] is IVariable v)) { return null; } From 69806e0e049a4c66ac48590ad02c85999a3a587e Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Fri, 16 Aug 2019 09:50:14 -0700 Subject: [PATCH 07/60] Test update (we no longer reassign classes) --- src/Analysis/Ast/Test/AssignmentTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Analysis/Ast/Test/AssignmentTests.cs b/src/Analysis/Ast/Test/AssignmentTests.cs index b586c1200..38c321319 100644 --- a/src/Analysis/Ast/Test/AssignmentTests.cs +++ b/src/Analysis/Ast/Test/AssignmentTests.cs @@ -319,13 +319,13 @@ class D: ... } [TestMethod, Priority(0)] - public async Task AssignAfterClassDef() { + public async Task NoClassAssign() { const string code = @" class D: ... D = 5 "; var analysis = await GetAnalysisAsync(code); - analysis.Should().HaveVariable("D").OfType(BuiltinTypeId.Int); + analysis.Should().HaveVariable("D").OfType(BuiltinTypeId.Type); } [TestMethod, Priority(0)] From 356ae4bef4ac4aec174912cbdd93c883ff2c71f1 Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Fri, 16 Aug 2019 12:48:48 -0700 Subject: [PATCH 08/60] Fix typing tests --- .../Impl/Extensions/ArgumentSetExtensions.cs | 5 +-- .../Definitions/IGenericTypeParameter.cs | 6 ++-- .../Typing/Types/GenericTypeParameter.cs | 31 ++++++++++--------- src/Caching/Impl/Models/TypeVarModel.cs | 12 +++---- 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs b/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs index ef999a511..d74f9bf61 100644 --- a/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs @@ -17,6 +17,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Linq; +using System.Security.Cryptography.X509Certificates; using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Types.Collections; @@ -34,8 +35,8 @@ public static IReadOnlyList> Arguments(this IArgument public static T Argument(this IArgumentSet args, int index) where T : class => args.Arguments[index].Value as T; - public static T GetArgumentValue(this IArgumentSet args, string name) where T : class { - var value = args.Arguments.FirstOrDefault(a => name.Equals(a.Name))?.Value; + public static T GetArgumentValue(this IArgumentSet args, string name, bool excludeDefault = true) where T : class { + var value = args.Arguments.FirstOrDefault(a => name.Equals(a.Name) && !(excludeDefault && a.ValueIsDefault))?.Value; if (value == null && args.DictionaryArgument?.Arguments != null && args.DictionaryArgument.Arguments.TryGetValue(name, out var m)) { return m as T; } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericTypeParameter.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericTypeParameter.cs index 77d631f2d..fa506c5a7 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericTypeParameter.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericTypeParameter.cs @@ -27,8 +27,8 @@ public interface IGenericTypeParameter: IPythonType, IEquatable /// See 'https://docs.python.org/3/library/typing.html#typing.TypeVar' IReadOnlyList Constraints { get; } - IPythonType Bound { get; } - IPythonType Covariant { get; } - IPythonType Contravariant { get; } + object Bound { get; } + object Covariant { get; } + object Contravariant { get; } } } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs index f523601d1..636fc7f02 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs @@ -29,9 +29,9 @@ public GenericTypeParameter( string name, IPythonModule declaringModule, IReadOnlyList constraints, - IPythonType bound, - IPythonType covariant, - IPythonType contravariant, + object bound, + object covariant, + object contravariant, Location location) : base(name, location, GetDocumentation(name, constraints, bound, covariant, contravariant)) { Constraints = constraints ?? Array.Empty(); @@ -41,16 +41,20 @@ public GenericTypeParameter( } #region IGenericTypeParameter + public IReadOnlyList Constraints { get; } - public IPythonType Bound { get; } - public IPythonType Covariant { get; } - public IPythonType Contravariant { get; } + public object Bound { get; } + public object Covariant { get; } + public object Contravariant { get; } + #endregion #region IPythonType + public override BuiltinTypeId TypeId => BuiltinTypeId.Type; public override PythonMemberType MemberType => PythonMemberType.Generic; public override bool IsSpecialized => true; + #endregion private static bool TypeVarArgumentsValid(IArgumentSet argSet) { @@ -110,18 +114,18 @@ public static IPythonType FromTypeVar(IArgumentSet argSet, IPythonModule declari return !string.IsNullOrEmpty(typeString) ? argSet.Eval.GetTypeFromString(typeString) : a.GetPythonType(); }).ToArray(); - var bound = args.Where(a => a.Name == "bound").Select(a => a.Value as IPythonType).FirstOrDefault(); - var covariant = args.Where(a => a.Name == "covariant").Select(a => a.Value as IPythonType).FirstOrDefault(); - var contravariant = args.Where(a => a.Name == "contravariant").Select(a => a.Value as IPythonType).FirstOrDefault(); + var bound = argSet.GetArgumentValue("bound")?.Value; + var covariant = argSet.GetArgumentValue("covariant")?.Value; + var contravariant = argSet.GetArgumentValue("contravariant")?.Value; return new GenericTypeParameter(name, declaringModule, constraints, bound, covariant, contravariant, new Location(declaringModule, location)); } - private static string GetDocumentation(string name, IReadOnlyList constraints, IPythonType bound, IPythonType covariant, IPythonType contravariant) { + private static string GetDocumentation(string name, IReadOnlyList constraints, object bound, object covariant, object contravariant) { var constaintStrings = constraints != null ? constraints.Select(c => c.IsUnknown() ? "?" : c.Name) : Enumerable.Empty(); - var boundStrings = bound.IsUnknown() ? Enumerable.Empty() : Enumerable.Repeat($"bound={bound.Name}", 1); - var covariantStrings = covariant.IsUnknown() ? Enumerable.Empty() : Enumerable.Repeat($"covariant={covariant.Name}", 1); - var contravariantStrings = contravariant.IsUnknown() ? Enumerable.Empty() : Enumerable.Repeat($"contravariant={contravariant.Name}", 1); + var boundStrings = bound != null ? Enumerable.Repeat($"bound={bound}", 1) : Enumerable.Empty(); + var covariantStrings = covariant != null ? Enumerable.Repeat($"covariant={covariant}", 1) : Enumerable.Empty(); + var contravariantStrings = contravariant != null ? Enumerable.Repeat($"contravariant={contravariant}", 1) : Enumerable.Empty(); var docArgs = Enumerable.Repeat($"'{name}'", 1) .Concat(constaintStrings).Concat(boundStrings).Concat(covariantStrings).Concat(contravariantStrings); @@ -132,5 +136,4 @@ private static string GetDocumentation(string name, IReadOnlyList c public bool Equals(IGenericTypeParameter other) => Name.Equals(other?.Name); } - } diff --git a/src/Caching/Impl/Models/TypeVarModel.cs b/src/Caching/Impl/Models/TypeVarModel.cs index fba7dd8a1..0735f1739 100644 --- a/src/Caching/Impl/Models/TypeVarModel.cs +++ b/src/Caching/Impl/Models/TypeVarModel.cs @@ -23,9 +23,9 @@ namespace Microsoft.Python.Analysis.Caching.Models { [DebuggerDisplay("TypeVar:{Name}")] internal sealed class TypeVarModel: MemberModel { public string[] Constraints { get; set; } - public string Bound { get; set; } - public string Covariant { get; set; } - public string Contravariant { get; set; } + public object Bound { get; set; } + public object Covariant { get; set; } + public object Contravariant { get; set; } public static TypeVarModel FromGeneric(IVariable v) { var g = (IGenericTypeParameter)v.Value; @@ -33,9 +33,9 @@ public static TypeVarModel FromGeneric(IVariable v) { Id = g.Name.GetStableHash(), Name = g.Name, Constraints = g.Constraints.Select(c => c.GetPersistentQualifiedName()).ToArray(), - Bound = g.Bound.GetPersistentQualifiedName(), - Covariant = g.Covariant.GetPersistentQualifiedName(), - Contravariant = g.Contravariant.GetPersistentQualifiedName() + Bound = g.Bound, + Covariant = g.Covariant, + Contravariant = g.Contravariant }; } } From 36a1d72dd1dd324d4d91bdd3d32f358d77d058f2 Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Fri, 16 Aug 2019 12:51:01 -0700 Subject: [PATCH 09/60] Update baseline --- src/Analysis/Ast/Test/LibraryTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Analysis/Ast/Test/LibraryTests.cs b/src/Analysis/Ast/Test/LibraryTests.cs index 3a8935918..a26e53139 100644 --- a/src/Analysis/Ast/Test/LibraryTests.cs +++ b/src/Analysis/Ast/Test/LibraryTests.cs @@ -40,7 +40,7 @@ public async Task Random() { foreach (var fnName in new[] { @"seed", @"randrange", @"gauss" }) { analysis.Should().HaveVariable(fnName).Which - .Should().HaveType(BuiltinTypeId.Method) + .Should().HaveType(BuiltinTypeId.Function) .And.Value.GetPythonType().Documentation.Should().NotBeNullOrEmpty(); } } From 41c94e7e05bc3f0855ff4d472fd7e8a2a51fd93c Mon Sep 17 00:00:00 2001 From: Alexander Sher Date: Fri, 16 Aug 2019 15:21:04 -0500 Subject: [PATCH 10/60] Fix missing keys issue (#1451) --- .../Modules/Resolution/TypeshedResolution.cs | 1 + src/Analysis/Ast/Test/ScrapeTests.cs | 3 +- .../Impl/DependencyResolution/ImportRoot.cs | 3 +- .../Impl/Interpreter/PythonLibraryPath.cs | 14 ++------ src/Caching/Impl/ModuleUniqueId.cs | 35 ++++++++++++------- src/Caching/Test/LibraryModulesTests.cs | 7 +++- src/Core/Impl/IO/DirectoryInfoProxy.cs | 2 +- .../Impl/Sources/ReferenceSource.cs | 2 +- 8 files changed, 36 insertions(+), 31 deletions(-) diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/TypeshedResolution.cs b/src/Analysis/Ast/Impl/Modules/Resolution/TypeshedResolution.cs index bcb56b6e5..c43f3acf1 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/TypeshedResolution.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/TypeshedResolution.cs @@ -60,6 +60,7 @@ protected override IPythonModule CreateModule(string name) { _log?.Log(TraceEventType.Warning, "Unsupported native module in stubs", moduleImport.FullName, moduleImport.ModulePath); return null; } + return new StubPythonModule(moduleImport.FullName, moduleImport.ModulePath, true, _services); } diff --git a/src/Analysis/Ast/Test/ScrapeTests.cs b/src/Analysis/Ast/Test/ScrapeTests.cs index ceed5b90b..34d6a8caf 100644 --- a/src/Analysis/Ast/Test/ScrapeTests.cs +++ b/src/Analysis/Ast/Test/ScrapeTests.cs @@ -262,8 +262,7 @@ await FullStdLibTest(v, "win32ui" ); } - - + private async Task FullStdLibTest(InterpreterConfiguration configuration, params string[] skipModules) { configuration.AssertInstalled(); var moduleUri = TestData.GetDefaultModuleUri(); diff --git a/src/Analysis/Core/Impl/DependencyResolution/ImportRoot.cs b/src/Analysis/Core/Impl/DependencyResolution/ImportRoot.cs index 32a88da99..503eb6c6a 100644 --- a/src/Analysis/Core/Impl/DependencyResolution/ImportRoot.cs +++ b/src/Analysis/Core/Impl/DependencyResolution/ImportRoot.cs @@ -1,5 +1,4 @@ - -// Copyright(c) Microsoft Corporation +// Copyright(c) Microsoft Corporation // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the License); you may not use diff --git a/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs b/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs index 2f01a80fe..b7d438a88 100644 --- a/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs +++ b/src/Analysis/Core/Impl/Interpreter/PythonLibraryPath.cs @@ -137,7 +137,8 @@ public static async Task> GetSearchPathsAsync(Interpret } } - var standardLibraryPath = GetStandardLibraryPath(fs, config); + var ospy = PathUtils.FindFile(fs, config.LibraryPath, "os.py"); + var standardLibraryPath = !string.IsNullOrEmpty(ospy) ? IOPath.GetDirectoryName(ospy) : string.Empty; if (!string.IsNullOrEmpty(standardLibraryPath)) { return GetDefaultSearchPaths(fs, standardLibraryPath); } @@ -145,17 +146,6 @@ public static async Task> GetSearchPathsAsync(Interpret return Array.Empty(); } - public static string GetStandardLibraryPath(IFileSystem fs, InterpreterConfiguration config) { - var ospy = PathUtils.FindFile(fs, config.LibraryPath, "os.py"); - return !string.IsNullOrEmpty(ospy) ? IOPath.GetDirectoryName(ospy) : string.Empty; - } - - public static string GetSitePackagesPath(IFileSystem fs, InterpreterConfiguration config) - => GetSitePackagesPath(GetStandardLibraryPath(fs, config)); - - public static string GetSitePackagesPath(string standardLibraryPath) - => !string.IsNullOrEmpty(standardLibraryPath) ? IOPath.Combine(standardLibraryPath, "site-packages") : string.Empty; - /// /// Gets the set of search paths by running the interpreter. /// diff --git a/src/Caching/Impl/ModuleUniqueId.cs b/src/Caching/Impl/ModuleUniqueId.cs index 9cf4fd376..744195d3e 100644 --- a/src/Caching/Impl/ModuleUniqueId.cs +++ b/src/Caching/Impl/ModuleUniqueId.cs @@ -17,6 +17,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using Microsoft.Python.Analysis.Core.DependencyResolution; using Microsoft.Python.Analysis.Core.Interpreter; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; @@ -39,8 +40,9 @@ public static string GetUniqueId(string moduleName, string filePath, ModuleType var interpreter = services.GetService(); var fs = services.GetService(); - - var modulePathType = GetModulePathType(filePath, interpreter.ModuleResolution.LibraryPaths, fs); + + var moduleResolution = interpreter.ModuleResolution; + var modulePathType = GetModulePathType(filePath, moduleResolution.LibraryPaths, fs); switch(modulePathType) { case PythonLibraryPathType.Site when cachingLevel < AnalysisCachingLevel.Library: return null; @@ -82,19 +84,28 @@ public static string GetUniqueId(string moduleName, string filePath, ModuleType return $"{moduleName}({config.Version.Major}.{config.Version.Minor})"; } - // If all else fails, hash module data. - return $"{moduleName}.{HashModuleContent(Path.GetDirectoryName(filePath), fs)}"; + var parent = moduleResolution.CurrentPathResolver.GetModuleParentFromModuleName(moduleName); + var hash = HashModuleFileSizes(parent); + // If all else fails, hash modules file sizes. + return $"{moduleName}.{(ulong)hash}"; } - private static string HashModuleContent(string moduleFolder, IFileSystem fs) { - // Hash file sizes - var total = fs - .GetFileSystemEntries(moduleFolder, "*.*", SearchOption.AllDirectories) - .Where(fs.FileExists) - .Select(fs.FileSize) - .Aggregate((hash, e) => unchecked(hash * 31 ^ e.GetHashCode())); + private static long HashModuleFileSizes(IImportChildrenSource source) { + var hash = 0L; + var names = source.GetChildrenNames(); + foreach (var name in names) { + if (source.TryGetChildImport(name, out var child)) { + if (child is ModuleImport moduleImport) { + hash = unchecked(hash * 31 ^ moduleImport.ModuleFileSize); + } + + if (child is IImportChildrenSource childSource) { + hash = unchecked(hash * 31 ^ HashModuleFileSizes(childSource)); + } + } + } - return ((uint)total).ToString(); + return hash; } private static PythonLibraryPathType GetModulePathType(string modulePath, IEnumerable libraryPaths, IFileSystem fs) { diff --git a/src/Caching/Test/LibraryModulesTests.cs b/src/Caching/Test/LibraryModulesTests.cs index fc1fe5d51..cbe98895d 100644 --- a/src/Caching/Test/LibraryModulesTests.cs +++ b/src/Caching/Test/LibraryModulesTests.cs @@ -20,6 +20,7 @@ using Microsoft.Python.Analysis.Caching.Tests.FluentAssertions; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Tests; using Microsoft.VisualStudio.TestTools.UnitTesting; using TestUtilities; @@ -120,6 +121,7 @@ public async Task Builtins() { public Task Ftplib() => TestModule("ftplib"); [TestMethod, Priority(0)] + [Ignore] public Task Functools() => TestModule("functools"); [TestMethod, Priority(0)] @@ -173,6 +175,9 @@ public async Task Builtins() { [TestMethod, Priority(0)] public Task Multiprocessing() => TestModule("multiprocessing"); + [TestMethod, Priority(0)] + public Task Numpy() => TestModule("numpy"); + [TestMethod, Priority(0)] public Task Os() => TestModule("os"); @@ -296,7 +301,7 @@ import requests } private async Task TestModule(string name) { - var analysis = await GetAnalysisAsync($"import {name}"); + var analysis = await GetAnalysisAsync($"import {name}", PythonVersions.Python37_x64); var m = analysis.Document.Interpreter.ModuleResolution.GetImportedModule(name); var model = ModuleModel.FromAnalysis(m.Analysis, Services, AnalysisCachingLevel.Library); diff --git a/src/Core/Impl/IO/DirectoryInfoProxy.cs b/src/Core/Impl/IO/DirectoryInfoProxy.cs index 2e694045f..0104e3675 100644 --- a/src/Core/Impl/IO/DirectoryInfoProxy.cs +++ b/src/Core/Impl/IO/DirectoryInfoProxy.cs @@ -53,7 +53,7 @@ public IEnumerable EnumerateFileSystemInfos(string searchPatter public IEnumerable EnumerateFileSystemInfos(string[] includePatterns, string[] excludePatterns) { var matcher = GetMatcher(includePatterns, excludePatterns); - PatternMatchingResult matchResult = SafeExecuteMatcher(matcher); + var matchResult = SafeExecuteMatcher(matcher); return matchResult.Files.Select((filePatternMatch) => { var path = PathUtils.NormalizePath(filePatternMatch.Path); return CreateFileSystemInfoProxy(new FileInfo(path)); diff --git a/src/LanguageServer/Impl/Sources/ReferenceSource.cs b/src/LanguageServer/Impl/Sources/ReferenceSource.cs index 99f670fe8..3f162a173 100644 --- a/src/LanguageServer/Impl/Sources/ReferenceSource.cs +++ b/src/LanguageServer/Impl/Sources/ReferenceSource.cs @@ -100,7 +100,7 @@ private async Task FindAllReferencesAsync(string name, IPythonModul return new List<(Uri, long)>(); } - var interpreterPaths = interpreter.ModuleResolution.InterpreterPaths.ToArray(); + var interpreterPaths = interpreter.ModuleResolution.InterpreterPaths; var files = new List<(Uri, long)>(); foreach (var filePath in fs.GetFiles(root, "*.py", SearchOption.AllDirectories).Select(Path.GetFullPath)) { From 628417439ab724444dfd99e9d0a6b308241f9beb Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Fri, 16 Aug 2019 18:22:04 -0700 Subject: [PATCH 11/60] Typevar fix --- src/Analysis/Ast/Test/AnalysisTestBase.cs | 2 -- src/Caching/Impl/Factories/TypeVarFactory.cs | 11 ++++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Analysis/Ast/Test/AnalysisTestBase.cs b/src/Analysis/Ast/Test/AnalysisTestBase.cs index 142acc7b2..bd19426dd 100644 --- a/src/Analysis/Ast/Test/AnalysisTestBase.cs +++ b/src/Analysis/Ast/Test/AnalysisTestBase.cs @@ -64,8 +64,6 @@ protected Task CreateServicesAsync(InterpreterConfiguration con protected async Task CreateServicesAsync(string root, InterpreterConfiguration configuration, string stubCacheFolderPath = null, IServiceManager sm = null, string[] searchPaths = null) { configuration = configuration ?? PythonVersions.LatestAvailable; configuration.AssertInstalled(); - stubCacheFolderPath = stubCacheFolderPath ?? TestData.GetAstAnalysisCachePath(configuration.Version, true); - Trace.TraceInformation("Cache Path: " + stubCacheFolderPath); configuration.SearchPaths = searchPaths ?? new[] { GetAnalysisTestDataFilesPath() }; configuration.TypeshedPath = TestData.GetDefaultTypeshedPath(); diff --git a/src/Caching/Impl/Factories/TypeVarFactory.cs b/src/Caching/Impl/Factories/TypeVarFactory.cs index f9cf8025c..00e38668c 100644 --- a/src/Caching/Impl/Factories/TypeVarFactory.cs +++ b/src/Caching/Impl/Factories/TypeVarFactory.cs @@ -25,12 +25,9 @@ public TypeVarFactory(IEnumerable models, ModuleFactory mf) : base(models, mf) { } - public override IPythonType CreateMember(TypeVarModel tvm, IPythonType declaringType) { - var constraints = tvm.Constraints.Select(c => ModuleFactory.ConstructType(c)).ToArray(); - var bound = ModuleFactory.ConstructType(tvm.Bound); - var covariant = ModuleFactory.ConstructType(tvm.Covariant); - var contravariant = ModuleFactory.ConstructType(tvm.Contravariant); - return new GenericTypeParameter(tvm.Name, ModuleFactory.Module, constraints, bound, covariant, contravariant, ModuleFactory.DefaultLocation); - } + public override IPythonType CreateMember(TypeVarModel tvm, IPythonType declaringType) + => new GenericTypeParameter(tvm.Name, ModuleFactory.Module, + tvm.Constraints.Select(c => ModuleFactory.ConstructType(c)).ToArray(), + tvm.Bound, tvm.Covariant, tvm.Contravariant, ModuleFactory.DefaultLocation); } } From 86c84261d77be716ae0165427bc450b9065fb5e4 Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Wed, 21 Aug 2019 15:26:45 -0700 Subject: [PATCH 12/60] Persistence of generics and named tuples (#1459) * Remove old qualified name * Node storage * Class and scope to use AST map * Library analysis * Fix SO * Keep small AST with imports * AST reduction * Final field * Initial * Reload * Ignore post-final requests * Drop AST * Remove local variables * Test fixes * Fix overload match * Tests * Add locks * Remove local variables * Drop file content to save memory * Cache PEP hints * Recreate AST * Fix specialization * Fix locations * usings * Test fixes * Add options to keep data in memory * Fix test * Fix lambda parameters * Fix argument set Fix global scope node * Fix overload doc * Fix stub merge errors * Fix async issues * Undo some changes * Fix test * Fix race condition * Partial * Models and views * Restore log null checks * Fix merge conflict * Fix merge issue * Null check * Partial * Partial * Partial * Fix test * Partial * Partial * First test * Baseline comparison * Builtins * Partial * Type fixes * Fix type names, part I * Qualified name * Properly write variables * Partial * Construct module from model * Test * Variable creations * Factories * Factories * Split construction * Restore * Save builtins * Test passes * Qualified name * Better export detection * Test fixes * More consistent qualified names * Sys test * Demo * Complete sys write/read * Partial * Partial * Test staility * Perf bug * Baseline, remove debug code, deactivate db * Test fixes * Test fix * Simplify a bit * Baselines and use : separator * Baselines * PR feedback * Merge master * Remove registry reference * PR feedback * PR feedback * Restore persistence + update test * Better handle persistent module in dependencies * Undo * Add location converter abstraction * Store member location * Fix merge issue * Basic locations test * Navigation * Add test * Update baselines * Type restore - initial * Remove debug code * Partial * Fix stub merge * Various model fixes * Improve module handling * Qualified name improvements * Fix unbound case * Improve stub merge * Fix qualified names of typing * Handle stub-only modules * Add tests for io, re and sys * Better handle named tuple * Handle module circular references * Handle else in platform and version clauses + handle it in symbol collector * Formatting * Fix walk of multi-level if statement * Unify package search in imports * Fix tests * Undo change * Port changes from dbtype * Partial * Named tuple support * Baseline updates * Debug code * Support types * Properly compare class member declaring type * Nested classes and functions persistence * Undo debug * Fix numpy restore * Baselines * Fix tests * Update AnyStr test reflecting changes to AnyStr behavior * Exclude baselines from git diff * Fix gitattr * Move git setting to root * Try no path * Test fixes * Undo change * Additional stub merge fixes * Baseline updates * Fix goto def * Protect specific type creation * Track documentaton source * More reliable tests + simplification * Typo * Cleanup * Basic classification * Fix merge error * Module unique id fixes * Stricted check to save analysis * Revert "Fix tests" This reverts commit 247a8c38741324452cc5a8eeb412a9784441bd8b. * Revert "Unify package search in imports" This reverts commit 67fed10d1c892de07a9a920b5396d53d7473b977. * Don't clear scope variables with inner classes * Fix typo * Many new tests * Fix collections test * Fix CTypes * Initial * Update test * Merge issues * Fix CTypes again * Fix null bases * Tell between class members with/without self better * TypeVar support * Add bound/covariant * Fix Enum reassignments * Fix Random * Fix import * over local declarations (Socket) * Move interface * Fix reference search * Enable asyncio test * More tests * Enable dataclasses * Add inspect and gzip * More tests * Add setting * Add handling of import position relative to the variable * Caching level changes * Partial * Rework * Fix null * Update baselines * Functools pass * Reverse stub merge * Partial * Partial ctypes * Update variables post merge * Fix ctypes * Merge issues * Fix typevar * Add caching on construction * Assorted fixes * Named tuples * Work around os stub oddness * Fix generic qualified names * Ignore lambdas * Support named tuples as bases * Baselines * Test updates * Named tuple tests * PR feedback * Using * Move diagnostics to GenericBase * PR feedback --- .../Evaluation/ExpressionEval.Generics.cs | 47 +---- .../Ast/Impl/Analyzer/ModuleWalker.cs | 198 ++++++++++-------- .../Impl/Analyzer/Symbols/ClassEvaluator.cs | 1 - .../Analyzer/Symbols/FunctionEvaluator.cs | 2 +- .../Impl/Extensions/ArgumentSetExtensions.cs | 2 - .../Extensions/PythonFunctionExtensions.cs | 4 +- .../Resolution/ModuleResolutionBase.cs | 6 +- .../BuiltinsSpecializations.cs | 23 +- ...ClassParameter.cs => IGenericClassBase.cs} | 2 +- .../Typing/Definitions/IGenericType.cs | 2 +- .../Definitions/ITypingNamedTupleType.cs | 1 - .../Typing/Types/GenericClassBase.cs | 87 ++++++++ .../Typing/Types/GenericClassParameter.cs | 44 ---- .../Typing/Types/GenericType.cs | 62 ++++-- .../Typing/Types/GenericTypeParameter.cs | 3 +- .../Typing/Types/NamedTupleType.cs | 36 +++- .../Typing/Types/TypingTupleType.cs | 1 - .../Specializations/Typing/TypingModule.cs | 41 ++-- .../Typing/TypingTypeFactory.cs | 8 +- .../Types/Collections/PythonCollectionType.cs | 19 +- .../Definitions/IPythonCollectionType.cs | 2 +- .../Impl/Types/PythonClassType.Generics.cs | 104 +++++---- .../Ast/Impl/Types/PythonClassType.cs | 28 ++- .../Ast/Impl/Types/PythonFunctionOverload.cs | 10 +- src/Analysis/Ast/Impl/Types/PythonType.cs | 2 +- .../Ast/Impl/Types/PythonTypeWrapper.cs | 10 +- src/Analysis/Ast/Test/ClassesTests.cs | 21 ++ src/Analysis/Ast/Test/EnumTests.cs | 48 +++++ .../Test/FluentAssertions/MemberAssertions.cs | 18 +- src/Analysis/Ast/Test/FunctionTests.cs | 4 +- src/Analysis/Ast/Test/GenericsTests.cs | 30 +++ src/Analysis/Ast/Test/ImportTests.cs | 9 - src/Analysis/Ast/Test/TypingTests.cs | 9 +- .../Core/Impl/Interpreter/ModulePath.cs | 4 - src/Caching/Impl/Factories/ClassFactory.cs | 54 ----- src/Caching/Impl/Factories/FactoryBase.cs | 73 ------- src/Caching/Impl/Factories/FunctionFactory.cs | 58 ----- src/Caching/Impl/Factories/PropertyFactory.cs | 37 ---- src/Caching/Impl/Factories/TypeVarFactory.cs | 33 --- src/Caching/Impl/Factories/VariableFactory.cs | 32 --- src/Caching/Impl/GlobalScope.cs | 60 +++--- src/Caching/Impl/Models/CallableModel.cs | 94 +++++++++ src/Caching/Impl/Models/ClassModel.cs | 134 ++++++++++-- src/Caching/Impl/Models/FunctionModel.cs | 94 ++++----- .../Impl/Models/GenericParameterValueModel.cs | 32 +++ src/Caching/Impl/Models/IndexSpanModel.cs | 4 +- src/Caching/Impl/Models/MemberModel.cs | 34 +++ src/Caching/Impl/Models/ModuleModel.cs | 35 +++- src/Caching/Impl/Models/NamedTupleModel.cs | 54 +++++ src/Caching/Impl/Models/PropertyModel.cs | 38 ++-- src/Caching/Impl/Models/TypeVarModel.cs | 15 +- src/Caching/Impl/Models/VariableModel.cs | 11 + .../Impl/{Factories => }/ModuleFactory.cs | 181 ++++++++-------- src/Caching/Impl/PythonDbModule.cs | 6 +- src/Caching/Impl/QualifiedNameParts.cs | 3 +- src/Caching/Impl/TypeNames.cs | 8 +- src/Caching/Test/ClassesTests.cs | 86 ++++++++ .../Test/Files/ClassOwnDocumentation.json | 188 +++++++++++++++++ src/Caching/Test/Files/MemberLocations.json | 46 +++- src/Caching/Test/Files/NestedClasses.json | 57 +++-- src/Caching/Test/Files/SmokeTest.json | 34 ++- src/Caching/Test/Files/VersionHandling2.json | 12 +- src/Caching/Test/Files/VersionHandling3.json | 12 +- src/Caching/Test/LibraryModulesTests.cs | 4 +- .../Test/GoToDefinitionTests.cs | 20 ++ 65 files changed, 1558 insertions(+), 879 deletions(-) rename src/Analysis/Ast/Impl/Specializations/Typing/Definitions/{IGenericClassParameter.cs => IGenericClassBase.cs} (95%) create mode 100644 src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs delete mode 100644 src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassParameter.cs create mode 100644 src/Analysis/Ast/Test/EnumTests.cs delete mode 100644 src/Caching/Impl/Factories/ClassFactory.cs delete mode 100644 src/Caching/Impl/Factories/FactoryBase.cs delete mode 100644 src/Caching/Impl/Factories/FunctionFactory.cs delete mode 100644 src/Caching/Impl/Factories/PropertyFactory.cs delete mode 100644 src/Caching/Impl/Factories/TypeVarFactory.cs delete mode 100644 src/Caching/Impl/Factories/VariableFactory.cs create mode 100644 src/Caching/Impl/Models/CallableModel.cs create mode 100644 src/Caching/Impl/Models/GenericParameterValueModel.cs create mode 100644 src/Caching/Impl/Models/NamedTupleModel.cs rename src/Caching/Impl/{Factories => }/ModuleFactory.cs (69%) create mode 100644 src/Caching/Test/Files/ClassOwnDocumentation.json diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs index cd4c7611b..fde0ffe46 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs @@ -63,57 +63,14 @@ private IMember GetValueFromGeneric(IMember target, Expression expr) { /// /// Returns whether the arguments to Generic are valid /// - private bool GenericClassParameterValid(IReadOnlyList genericTypeArgs, IReadOnlyList args, Expression expr) { - // All arguments to Generic must be type parameters - // e.g. Generic[T, str] throws a runtime error - if (genericTypeArgs.Count != args.Count) { - ReportDiagnostics(Module.Uri, new DiagnosticsEntry( - Resources.GenericNotAllTypeParameters, - GetLocation(expr).Span, - ErrorCodes.TypingGenericArguments, - Severity.Warning, - DiagnosticSource.Analysis)); - return false; - } - - // All arguments to Generic must be distinct - if (genericTypeArgs.Distinct().Count() != genericTypeArgs.Count) { - ReportDiagnostics(Module.Uri, new DiagnosticsEntry( - Resources.GenericNotAllUnique, - GetLocation(expr).Span, - ErrorCodes.TypingGenericArguments, - Severity.Warning, - DiagnosticSource.Analysis)); - return false; - } - - return true; - } /// /// Given generic type and list of arguments in the expression like /// Mapping[T1, int, ...] or Mapping[str, int] where Mapping inherits from Generic[K,T] creates generic class base /// (if the former) on specific type (if the latter). /// - private IMember CreateSpecificTypeFromIndex(IGenericType gt, IReadOnlyList args, Expression expr) { - var genericTypeArgs = args.OfType().ToArray(); - - if (gt.Name.EqualsOrdinal("Generic")) { - if (!GenericClassParameterValid(genericTypeArgs, args, expr)) { - return UnknownType; - } - - // Generic[T1, T2, ...] expression. Create generic base for the class. - return new GenericClassParameter(genericTypeArgs, Module); - } - - // For other types just use supplied arguments - if (args.Count > 0) { - return gt.CreateSpecificType(new ArgumentSet(args, expr, this)); - } - - return UnknownType; - } + private IMember CreateSpecificTypeFromIndex(IGenericType gt, IReadOnlyList args, Expression expr) + => args.Count > 0 ? gt.CreateSpecificType(new ArgumentSet(args, expr, this)) : UnknownType; private IReadOnlyList EvaluateIndex(IndexExpression expr) { var indices = new List(); diff --git a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs index e8aba3904..8aab07e9c 100644 --- a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs +++ b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs @@ -16,7 +16,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Xml.Serialization; using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Modules; @@ -246,118 +245,133 @@ private void MergeStub() { var sourceType = sourceVar?.Value.GetPythonType(); // If stub says 'Any' but we have better type, keep the current type. - if (!IsStubBetterType(sourceType, stubType)) { + if (stubType.DeclaringModule is TypingModule && stubType.Name == "Any") { continue; } + TryReplaceMember(v, sourceType, stubType); + } + + UpdateVariables(); + } + + private void TryReplaceMember(IVariable v, IPythonType sourceType, IPythonType stubType) { + // If type does not exist in module, but exists in stub, declare it unless it is an import. + // If types are the classes, take class from the stub, then add missing members. + // Otherwise, replace type from one from the stub. + switch (sourceType) { + case null: + // Nothing in sources, but there is type in the stub. Declare it. + if (v.Source == VariableSource.Declaration || v.Source == VariableSource.Generic) { + Eval.DeclareVariable(v.Name, v.Value, v.Source); + } + break; - // If type does not exist in module, but exists in stub, declare it unless it is an import. - // If types are the classes, merge members. Otherwise, replace type from one from the stub. - switch (sourceType) { - case null: - // Nothing in sources, but there is type in the stub. Declare it. - if (v.Source == VariableSource.Declaration || v.Source == VariableSource.Generic) { - Eval.DeclareVariable(v.Name, v.Value, v.Source); + case PythonClassType sourceClass when Module.Equals(sourceClass.DeclaringModule): + // Transfer documentation first so we get class documentation + // that came from class definition win over one that may + // come from __init__ during the member merge below. + TransferDocumentationAndLocation(sourceClass, stubType); + + // Replace the class entirely since stub members may use generic types + // and the class definition is important. We transfer missing members + // from the original class to the stub. + Eval.DeclareVariable(v.Name, v.Value, v.Source); + + // Go through source class members and pick those that are + // not present in the stub class. + foreach (var name in sourceClass.GetMemberNames()) { + + var sourceMember = sourceClass.GetMember(name); + if (sourceMember.IsUnknown()) { + continue; // Anything is better than unknowns. } - break; + var sourceMemberType = sourceMember?.GetPythonType(); - case PythonClassType cls when Module.Equals(cls.DeclaringModule): - // Transfer documentation first so we get class documentation - // that came from class definition win over one that may - // come from __init__ during the member merge below. - TransferDocumentationAndLocation(sourceType, stubType); + var stubMember = stubType.GetMember(name); + var stubMemberType = stubMember.GetPythonType(); - // If class exists and belongs to this module, add or replace - // its members with ones from the stub, preserving documentation. // Don't augment types that do not come from this module. - // Do not replace __class__ since it has to match class type and we are not - // replacing class type, we are only merging members. - foreach (var name in stubType.GetMemberNames().Except(new[] { "__class__", "__base__", "__bases__", "__mro__", "mro" })) { - var stubMember = stubType.GetMember(name); - var member = cls.GetMember(name); - - var memberType = member?.GetPythonType(); - var stubMemberType = stubMember.GetPythonType(); - - if (sourceType.IsBuiltin || stubType.IsBuiltin) { - // If stub type does not have an immediate member such as __init__() and - // rather have it inherited from object, we do not want to use the inherited - // since current class may either have its own of inherits it from the object. - continue; - } - - if (stubMemberType?.MemberType == PythonMemberType.Method && stubMemberType?.DeclaringModule.ModuleType == ModuleType.Builtins) { - // Leave methods coming from object at the object and don't copy them into the derived class. - } - - if (!IsStubBetterType(memberType, stubMemberType)) { - continue; - } - - // Get documentation from the current type, if any, since stubs - // typically do not contain documentation while scraped code does. - TransferDocumentationAndLocation(memberType, stubMemberType); - cls.AddMember(name, stubMember, overwrite: true); + if (sourceType.IsBuiltin || stubType.IsBuiltin) { + // If source type does not have an immediate member such as __init__() and + // rather have it inherited from object, we do not want to use the inherited + // since stub class may either have its own of inherits it from the object. + continue; } - break; - case IPythonModule _: - // We do not re-declare modules. - break; - - default: - var stubModule = stubType.DeclaringModule; - if (stubType is IPythonModule || stubModule.ModuleType == ModuleType.Builtins) { - // Modules members that are modules should remain as they are, i.e. os.path - // should remain library with its own stub attached. - break; + if (stubMemberType?.MemberType == PythonMemberType.Method && stubMemberType?.DeclaringModule.ModuleType == ModuleType.Builtins) { + // Leave methods coming from object at the object and don't copy them into the derived class. } - // We do not re-declaring variables that are imported. - if (v.Source == VariableSource.Declaration) { - // Re-declare variable with the data from the stub. - TransferDocumentationAndLocation(sourceType, stubType); - // TODO: choose best type between the scrape and the stub. Stub probably should always win. - var source = Eval.CurrentScope.Variables[v.Name]?.Source ?? v.Source; - Eval.DeclareVariable(v.Name, v.Value, source); + + // Get documentation from the current type, if any, since stubs + // typically do not contain documentation while scraped code does. + TransferDocumentationAndLocation(sourceMemberType, stubMemberType); + + // If stub says 'Any' but we have better type, use member from the original class. + if (stubMember != null && !(stubType.DeclaringModule is TypingModule && stubType.Name == "Any")) { + continue; // Stub already have the member, don't replace. } + (stubType as PythonType)?.AddMember(name, stubMember, overwrite: true); + } + break; + + case IPythonModule _: + // We do not re-declare modules. + break; + + default: + var stubModule = stubType.DeclaringModule; + if (stubType is IPythonModule || stubModule.ModuleType == ModuleType.Builtins) { + // Modules members that are modules should remain as they are, i.e. os.path + // should remain library with its own stub attached. break; - } + } + // We do not re-declaring variables that are imported. + if (v.Source == VariableSource.Declaration) { + // Re-declare variable with the data from the stub. + TransferDocumentationAndLocation(sourceType, stubType); + // TODO: choose best type between the scrape and the stub. Stub probably should always win. + var source = Eval.CurrentScope.Variables[v.Name]?.Source ?? v.Source; + Eval.DeclareVariable(v.Name, v.Value, source); + } + + break; } } - private static bool IsStubBetterType(IPythonType sourceType, IPythonType stubType) { - if (stubType.IsUnknown()) { - // Do not use worse types than what is in the module. - return false; - } - if (sourceType.IsUnknown()) { - return true; // Anything is better than unknowns. - } - if (sourceType.DeclaringModule.ModuleType == ModuleType.Specialized) { - // Types in specialized modules should never be touched. - return false; - } - if (stubType.DeclaringModule is TypingModule && stubType.Name == "Any") { - // If stub says 'Any' but we have better type, keep the current type. - return false; - } - // Types should be compatible except it is allowed to replace function by a class. - // Consider stub of threading that replaces def RLock(): by class RLock(). - // Similarly, in _json, make_scanner function is replaced by a class. - if (sourceType.MemberType == PythonMemberType.Function && stubType.MemberType == PythonMemberType.Class) { - return true; - } - // Random replaces method (variable) by a function. - if (sourceType.MemberType == PythonMemberType.Method && stubType.MemberType == PythonMemberType.Function) { - return true; + private void UpdateVariables() { + // Second pass: if we replaced any classes by new from the stub, we need to update + // variables that may still be holding old content. For example, ctypes + // declares 'c_voidp = c_void_p' so when we replace 'class c_void_p' + // by class from the stub, we need to go and update 'c_voidp' variable. + foreach (var v in GlobalScope.Variables) { + var variableType = v.Value.GetPythonType(); + if (!variableType.DeclaringModule.Equals(Module) && !variableType.DeclaringModule.Equals(Module.Stub)) { + continue; + } + // Check if type that the variable references actually declared here. + var typeInScope = GlobalScope.Variables[variableType.Name].GetPythonType(); + if (typeInScope == null || variableType == typeInScope) { + continue; + } + + if (v.Value == variableType) { + Eval.DeclareVariable(v.Name, typeInScope, v.Source); + } else if (v.Value is IPythonInstance) { + Eval.DeclareVariable(v.Name, new PythonInstance(typeInScope), v.Source); + } } - return sourceType.MemberType == stubType.MemberType; } private static void TransferDocumentationAndLocation(IPythonType s, IPythonType d) { - if (s.IsUnknown() || d.IsBuiltin || s.IsBuiltin) { + if (s.IsUnknown() || s.IsBuiltin || d == null || d.IsBuiltin) { return; // Do not transfer location of unknowns or builtins } + + if (d.DeclaringModule != s.DeclaringModule.Stub) { + return; // Do not change unrelated types. + } + // Documentation and location are always get transferred from module type // to the stub type and never the other way around. This makes sure that // we show documentation from the original module and goto definition @@ -368,7 +382,7 @@ private static void TransferDocumentationAndLocation(IPythonType s, IPythonType var transferDoc = true; if (src is PythonClassType srcClass && dst is PythonClassType dstClass) { // Higher lever source wins - if(srcClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Class || + if (srcClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Class || (srcClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Init && dstClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Base)) { dstClass.SetDocumentation(srcClass.Documentation); transferDoc = false; diff --git a/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs b/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs index 3f26a08a7..1901366ff 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs @@ -54,7 +54,6 @@ public void EvaluateClass() { var bases = ProcessBases(); _class.SetBases(bases); - _class.DecideGeneric(); // Declare __class__ variable in the scope. Eval.DeclareVariable("__class__", _class, VariableSource.Declaration); ProcessClassBody(); diff --git a/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs b/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs index 365a0bd12..f0ea79c9f 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs @@ -73,7 +73,7 @@ public override void Evaluate() { v => v.GetPythonType() == null && v.GetPythonType() == null) ) { - ((VariableCollection)Eval.CurrentScope.Variables).Clear(); + ((VariableCollection)Eval.CurrentScope.Variables).Clear(); } } } diff --git a/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs b/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs index d74f9bf61..6699f54d8 100644 --- a/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/ArgumentSetExtensions.cs @@ -13,9 +13,7 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. - using System.Collections.Generic; -using System.ComponentModel; using System.Linq; using System.Security.Cryptography.X509Certificates; using Microsoft.Python.Analysis.Analyzer.Evaluation; diff --git a/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs index 4c6ec4e7f..36f3ac42f 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs @@ -39,9 +39,9 @@ public static IScope GetScope(this IPythonFunctionType f) { return gs?.TraverseBreadthFirst(s => s.Children).FirstOrDefault(s => s.Node == f.FunctionDefinition); } - public static string GetQualifiedName(this IPythonClassMember cm) { + public static string GetQualifiedName(this IPythonClassMember cm, string baseName = null) { var s = new Stack(); - s.Push(cm.Name); + s.Push(baseName ?? cm.Name); for (var p = cm.DeclaringType as IPythonClassMember; p != null; p = p.DeclaringType as IPythonClassMember) { s.Push(p.Name); } diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs b/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs index 4c2c557d1..e8e1ca8c4 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs @@ -17,7 +17,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Threading; using Microsoft.Python.Analysis.Caching; using Microsoft.Python.Analysis.Core.DependencyResolution; using Microsoft.Python.Analysis.Core.Interpreter; @@ -35,7 +34,6 @@ internal abstract class ModuleResolutionBase { protected readonly IFileSystem _fs; protected readonly ILogger _log; protected readonly IUIService _ui; - protected readonly bool _requireInitPy; protected ConcurrentDictionary Modules { get; } = new ConcurrentDictionary(); protected PathResolver PathResolver { get; set; } @@ -50,9 +48,7 @@ protected ModuleResolutionBase(string root, IServiceContainer services) { _fs = services.GetService(); _log = services.GetService(); _ui = services.GetService(); - - _requireInitPy = ModulePath.PythonVersionRequiresInitPyFiles(_interpreter.Configuration.Version); - } + } public string Root { get; protected set; } public ImmutableArray InterpreterPaths { get; protected set; } = ImmutableArray.Empty; diff --git a/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs b/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs index 7815fe4a8..7efa0a679 100644 --- a/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs +++ b/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs @@ -20,21 +20,22 @@ using Microsoft.Python.Analysis.Types.Collections; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Analysis.Values.Collections; +using Microsoft.Python.Core.Text; namespace Microsoft.Python.Analysis.Specializations { public static class BuiltinsSpecializations { - public static IMember Identity(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { + public static IMember Identity(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet, IndexSpan indexSpan) { var args = argSet.Values(); return args.Count > 0 ? args.FirstOrDefault(a => !a.IsUnknown()) ?? args[0] : null; } - public static IMember TypeInfo(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { + public static IMember TypeInfo(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet, IndexSpan indexSpan) { var args = argSet.Values(); var t = args.Count > 0 ? args[0].GetPythonType() : module.Interpreter.GetBuiltinType(BuiltinTypeId.Type); return t.ToBound(); } - public static IMember Iterator(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { + public static IMember Iterator(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet, IndexSpan indexSpan) { var args = argSet.Values(); if (args.Count > 0) { if (args[0] is IPythonCollection seq) { @@ -48,21 +49,21 @@ public static IMember Iterator(IPythonModule module, IPythonFunctionOverload ove return null; } - public static IMember List(IPythonInterpreter interpreter, IPythonFunctionOverload overload, IArgumentSet argSet) + public static IMember List(IPythonInterpreter interpreter, IPythonFunctionOverload overload, IArgumentSet argSet, IndexSpan indexSpan) => PythonCollectionType.CreateList(interpreter.ModuleResolution.BuiltinsModule, argSet); - public static IMember ListOfStrings(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { + public static IMember ListOfStrings(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet, IndexSpan indexSpan) { var type = new TypingListType("List", module.Interpreter.GetBuiltinType(BuiltinTypeId.Str), module.Interpreter, false); return new TypingList(type); } - public static IMember DictStringToObject(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { + public static IMember DictStringToObject(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet, IndexSpan indexSpan) { var str = module.Interpreter.GetBuiltinType(BuiltinTypeId.Str); var obj = module.Interpreter.GetBuiltinType(BuiltinTypeId.Object); var type = new TypingDictionaryType("Dict", str, obj, module.Interpreter, false); return new TypingDictionary(type); } - public static IMember Next(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { + public static IMember Next(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet, IndexSpan indexSpan) { var args = argSet.Values(); return args.Count > 0 && args[0] is IPythonIterator it ? it.Next : null; } @@ -76,7 +77,7 @@ public static IMember __iter__(IPythonInterpreter interpreter, BuiltinTypeId con return fn; } - public static IMember Range(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { + public static IMember Range(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet, IndexSpan indexSpan) { var args = argSet.Values(); if (args.Count > 0) { var type = new PythonCollectionType(BuiltinTypeId.List, module.Interpreter.ModuleResolution.BuiltinsModule, false); @@ -85,12 +86,12 @@ public static IMember Range(IPythonModule module, IPythonFunctionOverload overlo return null; } - public static IMember CollectionItem(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { + public static IMember CollectionItem(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet, IndexSpan indexSpan) { var args = argSet.Values(); return args.Count > 0 && args[0] is PythonCollection c ? c.Contents.FirstOrDefault() : null; } - public static IMember Open(IPythonModule declaringModule, IPythonFunctionOverload overload, IArgumentSet argSet) { + public static IMember Open(IPythonModule declaringModule, IPythonFunctionOverload overload, IArgumentSet argSet, IndexSpan indexSpan) { var mode = argSet.GetArgumentValue("mode"); var binary = false; @@ -118,7 +119,7 @@ public static IMember Open(IPythonModule declaringModule, IPythonFunctionOverloa return returnType != null ? new PythonInstance(returnType) : null; } - public static IMember GetAttr(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet) { + public static IMember GetAttr(IPythonModule module, IPythonFunctionOverload overload, IArgumentSet argSet, IndexSpan indexSpan) { // TODO: Try __getattr__ first; this may not be as reliable in practice // given we could be assuming that __getattr__ always returns the same type, // which is incorrect more often than not. diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericClassParameter.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericClassBase.cs similarity index 95% rename from src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericClassParameter.cs rename to src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericClassBase.cs index 10cbc03f9..e5ca22b09 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericClassParameter.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericClassBase.cs @@ -20,7 +20,7 @@ namespace Microsoft.Python.Analysis.Specializations.Typing { /// /// Represents Generic[T1, T2, ...]. Used as a base class to generic classes. /// - public interface IGenericClassParameter: IPythonType { + public interface IGenericClassBase: IPythonType { /// /// List of T1, T2, ... generic type parameters /// diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericType.cs index 79e6fbc27..195194d09 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericType.cs @@ -26,7 +26,7 @@ public interface IGenericType : IPythonTemplateType { /// Type parameters such as in Tuple[T1, T2. ...] or /// Generic[_T1, _T2, ...] as returned by TypeVar. /// - IReadOnlyList Parameters { get; } + IReadOnlyList FormalGenericParameters { get; } bool IsGeneric { get; } } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/ITypingNamedTupleType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/ITypingNamedTupleType.cs index 17d5acbe8..bc22e2a3a 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/ITypingNamedTupleType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/ITypingNamedTupleType.cs @@ -20,7 +20,6 @@ namespace Microsoft.Python.Analysis.Specializations.Typing { /// Represents typing.NamedTuple. /// public interface ITypingNamedTupleType : ITypingTupleType { - string TupleName { get; } IReadOnlyList ItemNames { get; } } } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs new file mode 100644 index 000000000..c16728806 --- /dev/null +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs @@ -0,0 +1,87 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Python.Analysis.Diagnostics; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Parsing; +using ErrorCodes = Microsoft.Python.Analysis.Diagnostics.ErrorCodes; + +namespace Microsoft.Python.Analysis.Specializations.Typing.Types { + /// + /// Represents Generic[T1, T2, ...] base. When class is instantiated + /// or methods evaluated, class generic parameters are matched to + /// generic type parameters from TypeVar. + /// + internal sealed class GenericClassBase : PythonClassType, IGenericClassBase { + internal GenericClassBase(IReadOnlyList typeArgs, IPythonInterpreter interpreter) + : base("Generic", new Location(interpreter.ModuleResolution.GetSpecializedModule("typing"))) { + TypeParameters = typeArgs ?? Array.Empty(); + } + + #region IPythonType + public override PythonMemberType MemberType => PythonMemberType.Generic; + public override string Documentation => Name; + #endregion + + #region IPythonClassType + public override bool IsGeneric => true; + public override IReadOnlyDictionary GenericParameters + => TypeParameters.ToDictionary(tp => tp, tp => tp as IPythonType ?? UnknownType); + + public override IPythonType CreateSpecificType(IArgumentSet args) { + if (!GenericClassParameterValid(args)) { + return UnknownType; + } + return new GenericClassBase(args.Arguments.Select(a => a.Value).OfType().ToArray(), DeclaringModule.Interpreter); + } + + #endregion + + public IReadOnlyList TypeParameters { get; } + + private bool GenericClassParameterValid(IArgumentSet args) { + var genericTypeArgs = args.Values().ToArray(); + var allArgs = args.Values().ToArray(); + // All arguments to Generic must be type parameters + // e.g. Generic[T, str] throws a runtime error + var e = args.Eval; + if (genericTypeArgs.Length != allArgs.Length) { + e.ReportDiagnostics(args.Eval.Module.Uri, new DiagnosticsEntry( + Resources.GenericNotAllTypeParameters, + e.GetLocation(args.Expression).Span, + ErrorCodes.TypingGenericArguments, + Severity.Warning, + DiagnosticSource.Analysis)); + return false; + } + + // All arguments to Generic must be distinct + if (genericTypeArgs.Distinct().ToArray().Length != genericTypeArgs.Length) { + e.ReportDiagnostics(args.Eval.Module.Uri, new DiagnosticsEntry( + Resources.GenericNotAllUnique, + e.GetLocation(args.Expression).Span, + ErrorCodes.TypingGenericArguments, + Severity.Warning, + DiagnosticSource.Analysis)); + return false; + } + + return true; + } + } +} diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassParameter.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassParameter.cs deleted file mode 100644 index 164d021d8..000000000 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassParameter.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.Python.Analysis.Types; -using Microsoft.Python.Core; -using Microsoft.Python.Core.Disposables; - -namespace Microsoft.Python.Analysis.Specializations.Typing.Types { - /// - /// Represents Generic[T1, T2, ...] parameter. When class is instantiated - /// or methods evaluated, class generic parameters are matched to - /// generic type parameters from TypeVar. - /// - internal sealed class GenericClassParameter : PythonClassType, IGenericClassParameter { - internal GenericClassParameter(IReadOnlyList typeArgs, IPythonModule declaringModule) - : base("Generic", new Location(declaringModule)) { - TypeParameters = typeArgs ?? new List(); - } - - public override bool IsGeneric => true; - - public override IReadOnlyDictionary GenericParameters - => TypeParameters.ToDictionary(tp => tp, tp => tp as IPythonType ?? UnknownType) ?? EmptyDictionary.Instance; - - public IReadOnlyList TypeParameters { get; } - - public override PythonMemberType MemberType => PythonMemberType.Generic; - } -} diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs index 6aa95d21f..75752d2b1 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs @@ -14,7 +14,6 @@ // permissions and limitations under the License. using System; -using System.Collections; using System.Collections.Generic; using System.Linq; using Microsoft.Python.Analysis.Types; @@ -26,21 +25,23 @@ namespace Microsoft.Python.Analysis.Specializations.Typing.Types { /// /// Base class for generic types and type declarations. /// - internal class SpecializedGenericType : LocatedMember, IGenericType { + internal sealed class SpecializedGenericType : LocatedMember, IGenericType { internal SpecificTypeConstructor SpecificTypeConstructor { get; } /// /// Constructs generic type with generic type parameters. Typically used /// in generic classes such as when handling Generic[_T] base. /// - public SpecializedGenericType(string name, IReadOnlyList parameters, IPythonModule declaringModule) - : this(name, declaringModule) { - Parameters = parameters ?? throw new ArgumentNullException(nameof(parameters)); + public SpecializedGenericType(string name, string qualifiedName, IReadOnlyList parameters, IPythonModule declaringModule) + : this(name, qualifiedName, declaringModule) { + FormalGenericParameters = parameters ?? throw new ArgumentNullException(nameof(parameters)); } /// /// Constructs generic type with dynamic type constructor. /// Typically used in type specialization scenarios. + /// Type created with this constructor cannot be persisted + /// since it does not have qualified name. /// /// Type name including parameters, such as Iterator[T] /// Constructor of specific types. @@ -48,20 +49,53 @@ public SpecializedGenericType(string name, IReadOnlyList /// Type id. Used in type comparisons such as when matching /// function arguments. For example, Iterator[T] normally has type id of ListIterator. /// Optional type parameters as declared by TypeVar. + /// Optional documentation. Defaults to . public SpecializedGenericType( string name, SpecificTypeConstructor specificTypeConstructor, IPythonModule declaringModule, BuiltinTypeId typeId = BuiltinTypeId.Unknown, - IReadOnlyList parameters = null - ) : this(name, declaringModule) { + IReadOnlyList parameters = null, + string documentation = null + ) : this(name, null, declaringModule) { SpecificTypeConstructor = specificTypeConstructor ?? throw new ArgumentNullException(nameof(specificTypeConstructor)); TypeId = typeId; - Parameters = parameters ?? Array.Empty(); + FormalGenericParameters = parameters ?? Array.Empty(); + Documentation = documentation ?? name; } - private SpecializedGenericType(string name, IPythonModule declaringModule) : base(declaringModule) { + /// + /// Constructs generic type with dynamic type constructor. + /// Typically used in type specialization scenarios. + /// + /// Type name including parameters, such as Iterator[T] + /// Qualified type name including parameters, such as typing:Iterator[module:T] + /// Constructor of specific types. + /// Declaring module. + /// Type id. Used in type comparisons such as when matching + /// function arguments. For example, Iterator[T] normally has type id of ListIterator. + /// Optional type parameters as declared by TypeVar. + /// Optional documentation. Defaults to . + public SpecializedGenericType( + string name, + string qualifiedName, + SpecificTypeConstructor specificTypeConstructor, + IPythonModule declaringModule, + BuiltinTypeId typeId = BuiltinTypeId.Unknown, + IReadOnlyList parameters = null, + string documentation = null + ) : this(name, qualifiedName, declaringModule) { + SpecificTypeConstructor = specificTypeConstructor ?? throw new ArgumentNullException(nameof(specificTypeConstructor)); + TypeId = typeId; + FormalGenericParameters = parameters ?? Array.Empty(); + Documentation = documentation ?? name; + } + + private SpecializedGenericType(string name, string qualifiedName, IPythonModule declaringModule) + : base(declaringModule) { Name = name ?? throw new ArgumentNullException(nameof(name)); + QualifiedName = qualifiedName ?? $"{declaringModule.Name}:{name}"; + Documentation = Name; } public override PythonMemberType MemberType => PythonMemberType.Generic; @@ -70,15 +104,15 @@ private SpecializedGenericType(string name, IPythonModule declaringModule) : bas /// Type parameters such as in Tuple[T1, T2. ...] or /// Generic[_T1, _T2, ...] as returned by TypeVar. /// - public IReadOnlyList Parameters { get; } + public IReadOnlyList FormalGenericParameters { get; } #region IPythonType public string Name { get; } - public string QualifiedName => this.GetQualifiedName(); + public string QualifiedName { get; } public IMember GetMember(string name) => null; public IEnumerable GetMemberNames() => Enumerable.Empty(); public BuiltinTypeId TypeId { get; } = BuiltinTypeId.Unknown; - public virtual string Documentation => Name; + public string Documentation { get; } public bool IsBuiltin => false; public bool IsAbstract => true; public bool IsSpecialized => true; @@ -96,8 +130,8 @@ public IMember CreateInstance(string typeName, IArgumentSet args) { : specific.CreateInstance(typeName); } - public virtual IMember Call(IPythonInstance instance, string memberName, IArgumentSet args) => DeclaringModule.Interpreter.UnknownType; - public virtual IMember Index(IPythonInstance instance, IArgumentSet args) => DeclaringModule.Interpreter.UnknownType; + public IMember Call(IPythonInstance instance, string memberName, IArgumentSet args) => DeclaringModule.Interpreter.UnknownType; + public IMember Index(IPythonInstance instance, IArgumentSet args) => DeclaringModule.Interpreter.UnknownType; /// /// Creates instance of a type information with the specific diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs index 636fc7f02..c02bac873 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs @@ -27,7 +27,6 @@ namespace Microsoft.Python.Analysis.Specializations.Typing.Types { internal sealed class GenericTypeParameter : PythonType, IGenericTypeParameter { public GenericTypeParameter( string name, - IPythonModule declaringModule, IReadOnlyList constraints, object bound, object covariant, @@ -118,7 +117,7 @@ public static IPythonType FromTypeVar(IArgumentSet argSet, IPythonModule declari var covariant = argSet.GetArgumentValue("covariant")?.Value; var contravariant = argSet.GetArgumentValue("contravariant")?.Value; - return new GenericTypeParameter(name, declaringModule, constraints, bound, covariant, contravariant, new Location(declaringModule, location)); + return new GenericTypeParameter(name, constraints, bound, covariant, contravariant, new Location(declaringModule, location)); } private static string GetDocumentation(string name, IReadOnlyList constraints, object bound, object covariant, object contravariant) { diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/NamedTupleType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/NamedTupleType.cs index cfad82980..2ecd670e5 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/NamedTupleType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/NamedTupleType.cs @@ -21,32 +21,50 @@ using Microsoft.Python.Analysis.Utilities; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +using Microsoft.Python.Core.Text; namespace Microsoft.Python.Analysis.Specializations.Typing.Types { internal sealed class NamedTupleType : TypingTupleType, ITypingNamedTupleType { + // Since named tuple operates as a new, separate type, we need to track + // its location rather than delegating down to the general wrapper over + // Python built-in tuple. + private sealed class NamedTupleLocatedMember: LocatedMember { + public NamedTupleLocatedMember(Location location) : base(location) { } + public override PythonMemberType MemberType => PythonMemberType.Class; + } + private readonly NamedTupleLocatedMember _locatedMember; + /// /// Creates type info for a strongly-typed tuple, such as Tuple[T1, T2, ...]. /// - public NamedTupleType(string tupleName, IReadOnlyList itemNames, IReadOnlyList itemTypes, IPythonModule declaringModule, IPythonInterpreter interpreter) - : base(itemTypes, declaringModule, interpreter) { - TupleName = tupleName ?? throw new ArgumentNullException(nameof(tupleName)); + public NamedTupleType(string tupleName, IReadOnlyList itemNames, IReadOnlyList itemTypes, IPythonModule declaringModule, IndexSpan indexSpan) + : base(itemTypes, declaringModule, declaringModule.Interpreter) { + Name = tupleName ?? throw new ArgumentNullException(nameof(tupleName)); ItemNames = itemNames; var typeNames = itemTypes.Select(t => t.IsUnknown() ? string.Empty : t.Name); var pairs = itemNames.Zip(typeNames, (name, typeName) => string.IsNullOrEmpty(typeName) ? name : $"{name}: {typeName}"); - Name = CodeFormatter.FormatSequence(tupleName, '(', pairs); + Documentation = CodeFormatter.FormatSequence(tupleName, '(', pairs); - typeNames = itemTypes.Select(t => t.IsUnknown() ? string.Empty : t.QualifiedName); - pairs = itemNames.Zip(typeNames, (name, typeName) => string.IsNullOrEmpty(typeName) ? name : $"{name}: {typeName}"); - QualifiedName = CodeFormatter.FormatSequence($"{declaringModule.Name}:{tupleName}", '(', pairs); + _locatedMember = new NamedTupleLocatedMember(new Location(declaringModule, indexSpan)); } - public string TupleName { get; } public IReadOnlyList ItemNames { get; } + #region IPythonType public override string Name { get; } - public override string QualifiedName { get; } + public override string QualifiedName => $"{DeclaringModule.Name}:{Name}"; // Named tuple name is a type name as class. public override bool IsSpecialized => true; + public override string Documentation { get; } + #endregion + + #region ILocatedMember + public override Location Location => _locatedMember.Location; + public override LocationInfo Definition => _locatedMember.Definition; + public override IReadOnlyList References => _locatedMember.References; + public override void AddReference(Location location) => _locatedMember.AddReference(location); + public override void RemoveReferences(IPythonModule module) => _locatedMember.RemoveReferences(module); + #endregion public override IMember CreateInstance(string typeName, IArgumentSet args) => new TypingTuple(this); diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs index f393516d2..52358c16c 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/TypingTupleType.cs @@ -14,7 +14,6 @@ // permissions and limitations under the License. using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Specializations.Typing.Values; using Microsoft.Python.Analysis.Types; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs b/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs index 5538e7aaf..c854b16b0 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs @@ -23,6 +23,7 @@ using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; using Microsoft.Python.Core.Diagnostics; +using Microsoft.Python.Core.Text; using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Ast; @@ -61,8 +62,8 @@ private void SpecializeMembers() { // When called, create generic parameter type. For documentation // use original TypeVar declaration so it appear as a tooltip. - o.SetReturnValueProvider((declaringModule, overload, args) - => GenericTypeParameter.FromTypeVar(args, declaringModule)); + o.SetReturnValueProvider((declaringModule, overload, args, indexSpan) + => GenericTypeParameter.FromTypeVar(args, declaringModule, indexSpan)); fn.AddOverload(o); _members["TypeVar"] = fn; @@ -75,7 +76,7 @@ private void SpecializeMembers() { o = new PythonFunctionOverload(fn.Name, location); // When called, create generic parameter type. For documentation // use original TypeVar declaration so it appear as a tooltip. - o.SetReturnValueProvider((declaringModule, overload, args) => { + o.SetReturnValueProvider((declaringModule, overload, args, indexSpan) => { var a = args.Values(); return a.Count == 1 ? a[0] : Interpreter.UnknownType; }); @@ -125,15 +126,17 @@ private void SpecializeMembers() { _members["Counter"] = Specialized.Function("Counter", this, GetMemberDocumentation("Counter"), new PythonInstance(Interpreter.GetBuiltinType(BuiltinTypeId.Int))); - _members["SupportsInt"] = Interpreter.GetBuiltinType(BuiltinTypeId.Int); - _members["SupportsFloat"] = Interpreter.GetBuiltinType(BuiltinTypeId.Float); - _members["SupportsComplex"] = Interpreter.GetBuiltinType(BuiltinTypeId.Complex); - _members["SupportsBytes"] = Interpreter.GetBuiltinType(BuiltinTypeId.Bytes); + // TODO: make these classes that support __float__, etc per spec. + //_members["SupportsInt"] = Interpreter.GetBuiltinType(BuiltinTypeId.Int); + //_members["SupportsFloat"] = Interpreter.GetBuiltinType(BuiltinTypeId.Float); + //_members["SupportsComplex"] = Interpreter.GetBuiltinType(BuiltinTypeId.Complex); + //_members["SupportsBytes"] = Interpreter.GetBuiltinType(BuiltinTypeId.Bytes); _members["ByteString"] = Interpreter.GetBuiltinType(BuiltinTypeId.Bytes); fn = PythonFunctionType.Specialize("NamedTuple", this, GetMemberDocumentation("NamedTuple")); o = new PythonFunctionOverload(fn.Name, location); - o.SetReturnValueProvider((declaringModule, overload, args) => CreateNamedTuple(args.Values(), declaringModule)); + o.SetReturnValueProvider((declaringModule, overload, args, indexSpan) + => CreateNamedTuple(args.Values(), declaringModule, indexSpan)); fn.AddOverload(o); _members["NamedTuple"] = fn; @@ -154,7 +157,7 @@ private IPythonType SpecializeNewType(Location location) { var o = new PythonFunctionOverload(fn.Name, location); // When called, create generic parameter type. For documentation // use original TypeVar declaration so it appear as a tooltip. - o.SetReturnValueProvider((interpreter, overload, args) => CreateTypeAlias(args)); + o.SetReturnValueProvider((interpreter, overload, args, indexSpan) => CreateTypeAlias(args)); o.SetParameters(new[] { new ParameterInfo("name", Interpreter.GetBuiltinType(BuiltinTypeId.Str), ParameterKind.Normal, null), new ParameterInfo("tp", Interpreter.GetBuiltinType(BuiltinTypeId.Type), ParameterKind.Normal, null), @@ -279,7 +282,7 @@ private IPythonType CreateUnion(IReadOnlyList typeArgs) { return Interpreter.UnknownType; } - private IPythonType CreateNamedTuple(IReadOnlyList typeArgs, IPythonModule declaringModule) { + private IPythonType CreateNamedTuple(IReadOnlyList typeArgs, IPythonModule declaringModule, IndexSpan indexSpan) { if (typeArgs.Count != 2) { // TODO: report wrong number of arguments return Interpreter.UnknownType; @@ -324,7 +327,7 @@ private IPythonType CreateNamedTuple(IReadOnlyList typeArgs, IPythonMod itemNames.Add(itemName2); itemTypes.Add(c.Contents[1].GetPythonType()); } - return TypingTypeFactory.CreateNamedTupleType(Interpreter, tupleName, itemNames, itemTypes, declaringModule); + return TypingTypeFactory.CreateNamedTupleType(tupleName, itemNames, itemTypes, declaringModule, indexSpan); } private IPythonType CreateOptional(IReadOnlyList typeArgs) { @@ -363,7 +366,7 @@ private IPythonType CreateGenericClassParameter(IReadOnlyList typeA if (typeArgs.Count > 0) { var typeDefs = typeArgs.OfType().ToArray(); if (typeDefs.Length == typeArgs.Count) { - return new GenericClassParameter(typeDefs, this); + return new GenericClassBase(typeDefs, Interpreter); } else { // TODO: report argument mismatch } @@ -372,10 +375,14 @@ private IPythonType CreateGenericClassParameter(IReadOnlyList typeA return Interpreter.UnknownType; } - private IPythonType ToGenericTemplate(string typeName, IReadOnlyList typeArgs, BuiltinTypeId typeId) - => _members[typeName] is SpecializedGenericType gt - ? new SpecializedGenericType(CodeFormatter.FormatSequence(typeName, '[', typeArgs), gt.SpecificTypeConstructor, this, typeId, - typeArgs.OfType().ToList()) - : Interpreter.UnknownType; + private IPythonType ToGenericTemplate(string typeName, IReadOnlyList typeArgs, BuiltinTypeId typeId) { + if (_members[typeName] is SpecializedGenericType gt) { + var name = CodeFormatter.FormatSequence(typeName, '[', typeArgs); + var qualifiedName = CodeFormatter.FormatSequence($"typing:{typeName}", '[', typeArgs.Select(t => t.QualifiedName)); + var args = typeArgs.OfType().ToList(); + return new SpecializedGenericType(name, qualifiedName, gt.SpecificTypeConstructor, this, typeId, args); + } + return Interpreter.UnknownType; + } } } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/TypingTypeFactory.cs b/src/Analysis/Ast/Impl/Specializations/Typing/TypingTypeFactory.cs index 540615aac..d78037e8a 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/TypingTypeFactory.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/TypingTypeFactory.cs @@ -19,6 +19,7 @@ using Microsoft.Python.Analysis.Specializations.Typing.Values; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Utilities; +using Microsoft.Python.Core.Text; namespace Microsoft.Python.Analysis.Specializations.Typing { internal static class TypingTypeFactory { @@ -55,11 +56,8 @@ public static ITypingListType CreateItemsViewType(IPythonInterpreter interpreter public static IPythonType CreateUnionType(IPythonInterpreter interpreter, IReadOnlyList types, IPythonModule declaringModule) => new PythonUnionType(types.Select(a => a.GetPythonType()), declaringModule); - public static ITypingNamedTupleType CreateNamedTupleType(IPythonInterpreter interpreter, string tupleName, IReadOnlyList itemNames, IReadOnlyList itemTypes, IPythonModule declaringModule) - => new NamedTupleType(tupleName, itemNames, itemTypes, declaringModule, interpreter); - - public static IPythonType CreateOptionalType(IPythonModule declaringModule, IPythonType type) - => new OptionalType(declaringModule, type); + public static ITypingNamedTupleType CreateNamedTupleType(string tupleName, IReadOnlyList itemNames, IReadOnlyList itemTypes, IPythonModule declaringModule, IndexSpan indexSpan) + => new NamedTupleType(tupleName, itemNames, itemTypes, declaringModule, indexSpan); public static IPythonType CreateType(IPythonModule declaringModule, IPythonType type) => new TypingType(declaringModule, type); diff --git a/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs b/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs index e8e6f598f..4ea5c59ae 100644 --- a/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs +++ b/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs @@ -16,9 +16,11 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Analysis.Values.Collections; using Microsoft.Python.Core; +using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Types.Collections { /// @@ -63,8 +65,23 @@ public override IMember Call(IPythonInstance instance, string memberName, IArgum public override IMember Index(IPythonInstance instance, IArgumentSet args) => (instance as IPythonCollection)?.Index(args) ?? UnknownType; + + public IPythonType CreateSpecificType(IArgumentSet typeArguments) { + throw new NotImplementedException(); + } + #endregion + #region IPythonClassType + public IPythonType DeclaringType => (InnerType as IPythonClassType)?.DeclaringType; + public IReadOnlyList FormalGenericParameters => (InnerType as IPythonClassType)?.FormalGenericParameters ?? Array.Empty(); + public bool IsGeneric => (InnerType as IPythonClassType)?.IsGeneric == true; + public ClassDefinition ClassDefinition => (InnerType as IPythonClassType)?.ClassDefinition; + public IReadOnlyList Mro => (InnerType as IPythonClassType)?.Mro ?? Array.Empty(); + public IReadOnlyList Bases => (InnerType as IPythonClassType)?.Bases ?? Array.Empty(); + public IReadOnlyDictionary GenericParameters + => (InnerType as IPythonClassType)?.GenericParameters ?? EmptyDictionary.Instance; + #endregion public static IPythonCollection CreateList(IPythonModule declaringModule, IArgumentSet args) { var exact = true; @@ -107,7 +124,7 @@ public static IPythonCollection CreateSet(IPythonModule declaringModule, IReadOn return new PythonCollection(collectionType, contents, flatten, exact: exact); } - public override bool Equals(object obj) + public override bool Equals(object obj) => obj is IPythonType pt && (PythonTypeComparer.Instance.Equals(pt, this) || PythonTypeComparer.Instance.Equals(pt, InnerType)); public override int GetHashCode() => PythonTypeComparer.Instance.GetHashCode(this); } diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IPythonCollectionType.cs b/src/Analysis/Ast/Impl/Types/Definitions/IPythonCollectionType.cs index 000fa0987..115c6168b 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IPythonCollectionType.cs +++ b/src/Analysis/Ast/Impl/Types/Definitions/IPythonCollectionType.cs @@ -19,7 +19,7 @@ namespace Microsoft.Python.Analysis.Types { /// /// Represents instance of a collection. /// - public interface IPythonCollectionType : IPythonType { + public interface IPythonCollectionType : IPythonClassType { /// /// Type of the collection iterator. /// diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs index a4101de0a..e8716c754 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs @@ -15,7 +15,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Utilities; @@ -28,10 +27,14 @@ internal partial class PythonClassType { private readonly ReentrancyGuard _genericSpecializationGuard = new ReentrancyGuard(); private readonly ReentrancyGuard _genericResolutionGuard = new ReentrancyGuard(); - private bool _isGeneric; + private string _nameWithParameters; // Name of the class with generic parameters like abc[int]. + private string _qualifiedNameWithParameters; // Qualified name with qualified parameter names for persistence. + private Dictionary _specificTypeCache; - private Dictionary _genericParameters; - private IReadOnlyList _parameters = new List(); + // Actual assigned parameters for generic class. + private Dictionary _genericActualParameters; + // Not yet set generic parameters i.e. TypeVars from Generic[T1, T2, ...]. + private IReadOnlyList _genericParameters = new List(); #region IGenericType /// @@ -41,10 +44,9 @@ internal partial class PythonClassType { /// {T, T} /// Where T is a generic type parameter that needs to be filled in by the class /// - public virtual IReadOnlyList Parameters => _parameters ?? Array.Empty(); - - public virtual bool IsGeneric => _isGeneric; + public virtual IReadOnlyList FormalGenericParameters => _genericParameters ?? Array.Empty(); + public virtual bool IsGeneric { get; private set; } #endregion /// @@ -59,7 +61,7 @@ internal partial class PythonClassType { /// B[int] defines the type parameter T to be of type int and type parameter U to be type str. /// B[int] inherits from A[int, str] /// - public IPythonType CreateSpecificType(IArgumentSet args) { + public virtual IPythonType CreateSpecificType(IArgumentSet args) { lock (_genericParameterLock) { var genericTypeParameters = GetTypeParameters(); var newBases = new List(); @@ -69,14 +71,14 @@ public IPythonType CreateSpecificType(IArgumentSet args) { var genericTypeToSpecificType = GetSpecificTypes(args, genericTypeParameters, newBases); var classType = new PythonClassType(BaseName, new Location(DeclaringModule)); + classType.SetDocumentation(Documentation); + // Storing generic parameters allows methods returning generic types // to know what type parameter returns what specific type StoreGenericParameters(classType, genericTypeParameters, genericTypeToSpecificType); // Set generic name - if (!classType._genericParameters.IsNullOrEmpty()) { - classType._genericName = CodeFormatter.FormatSequence(BaseName, '[', classType._genericParameters.Values); - } + classType.SetNames(); // Locking so threads can only access class after it's been initialized // Store generic parameters first so name updates correctly, then check if class type has been cached @@ -86,7 +88,7 @@ public IPythonType CreateSpecificType(IArgumentSet args) { } _specificTypeCache[classType.Name] = classType; - // Prevent reentrancy when resolving generic class where method may be returning instance of type of the same class. + // Prevent re-entrancy when resolving generic class where method may be returning instance of type of the same class. // e.g // class C(Generic[T]): // def tmp(self): @@ -101,13 +103,13 @@ public IPythonType CreateSpecificType(IArgumentSet args) { // Bases can be null when not set var bases = Bases ?? Array.Empty(); // Get declared generic class parameters, i.e. Generic[T1, T2, ...], Optional[Generic[T1, ...]] - var genericClassParameters = bases.OfType().ToArray(); + var genericClassParameters = bases.OfType().ToArray(); // Get list of bases that are generic but not generic class parameters, e.g A[T], B[T] but not Generic[T1, T2] var genericTypeBases = bases.Except(genericClassParameters).OfType().Where(g => g.IsGeneric).ToArray(); - // Removing all generic bases, and will only specialize genericTypeBases, remove generic class paramters entirely - // We remove generic class paramters entirely because the type information is now stored in GenericParameters field + // Removing all generic bases, and will only specialize genericTypeBases, remove generic class parameters entirely + // We remove generic class parameters entirely because the type information is now stored in GenericParameters field // We still need generic bases so we can specialize them var specificBases = bases.Except(genericTypeBases).Except(genericClassParameters).ToList(); @@ -115,7 +117,7 @@ public IPythonType CreateSpecificType(IArgumentSet args) { foreach (var gt in genericTypeBases) { // Look through generic type bases and see if any of their required type parameters // have received a specific type, and if so create specific type - var st = gt.Parameters + var st = gt.FormalGenericParameters .Select(p => classType.GenericParameters.TryGetValue(p, out var t) ? t : null) .Where(p => !p.IsUnknown()) .ToArray(); @@ -129,9 +131,7 @@ public IPythonType CreateSpecificType(IArgumentSet args) { // Set specific class bases classType.SetBases(specificBases.Concat(newBases)); - // Now that parameters are set, check if class is generic - classType._parameters = classType._genericParameters.Values.Distinct().OfType().ToList(); - classType.DecideGeneric(); + classType.SetGenericParameters(); // Transfer members from generic to specific type. SetClassMembers(classType, args); } @@ -144,13 +144,13 @@ public IPythonType CreateSpecificType(IArgumentSet args) { /// private IGenericTypeParameter[] GetTypeParameters() { // Case when updating with specific type and already has type parameters, return them - if (!Parameters.IsNullOrEmpty()) { - return Parameters.ToArray(); + if (!FormalGenericParameters.IsNullOrEmpty()) { + return FormalGenericParameters.ToArray(); } var bases = Bases ?? Array.Empty(); var fromBases = new HashSet(); - var genericClassParameter = bases.OfType().FirstOrDefault(); + var genericClassParameter = bases.OfType().FirstOrDefault(); // If Generic[...] is present, ordering of type variables is determined from that if (genericClassParameter != null && genericClassParameter.TypeParameters != null) { @@ -158,8 +158,8 @@ private IGenericTypeParameter[] GetTypeParameters() { } else { // otherwise look at the generic class bases foreach (var gt in bases.OfType()) { - if (gt.Parameters != null) { - fromBases.UnionWith(gt.Parameters); + if (gt.FormalGenericParameters != null) { + fromBases.UnionWith(gt.FormalGenericParameters); } } } @@ -216,7 +216,7 @@ private IReadOnlyDictionary GetSpecificTypes // will have BultinTypeId.Dict and we can figure out specific types from // the content of the collection. var b = _bases.OfType().Where(g => g.IsGeneric).FirstOrDefault(x => x.TypeId == type.TypeId); - if (b != null && !b.Parameters.IsNullOrEmpty()) { + if (b != null && !b.FormalGenericParameters.IsNullOrEmpty()) { newBases.Add(type); // Optimistically assign argument types if they match. // Handle common cases directly. @@ -254,22 +254,21 @@ private IReadOnlyDictionary GetSpecificTypes } /// - /// Points the generic type parameter in class type to their corresponding specific type (or a generic - /// type parameter if no specific type was provided) + /// Points the generic type parameter in class type to their corresponding specific type + /// (or a generic type parameter if no specific type was provided) /// - private void StoreGenericParameters(PythonClassType classType, IGenericTypeParameter[] genericParameters, IReadOnlyDictionary genericToSpecificTypes) { + internal void StoreGenericParameters(PythonClassType specificClassType, IGenericTypeParameter[] genericParameters, IReadOnlyDictionary genericToSpecificTypes) { // copy original generic parameters over and try to fill them in - classType._genericParameters = new Dictionary(GenericParameters.ToDictionary(k => k.Key, k => k.Value)); + specificClassType._genericActualParameters = new Dictionary(GenericParameters.ToDictionary(k => k.Key, k => k.Value)); // Case when creating a new specific class type - if (Parameters.Count == 0) { + if (FormalGenericParameters.Count == 0) { // Assign class type generic type parameters to specific types - for (var i = 0; i < genericParameters.Length; i++) { - var gb = genericParameters[i]; - classType._genericParameters[gb] = genericToSpecificTypes.TryGetValue(gb, out var v) ? v : null; + foreach (var gb in genericParameters) { + specificClassType._genericActualParameters[gb] = genericToSpecificTypes.TryGetValue(gb, out var v) ? v : null; } } else { - // When Parameters field is not empty then need to update generic parameters field + // When FormalGenericParameters field is not empty then need to update generic parameters field foreach (var gp in GenericParameters.Keys) { if (GenericParameters[gp] is IGenericTypeParameter specificType) { // Get unfilled type parameter or type parameter that was filled with another type parameter @@ -278,7 +277,7 @@ private void StoreGenericParameters(PythonClassType classType, IGenericTypeParam // class A(Generic[T]): // class B(A[U]) // A has T => U - classType._genericParameters[gp] = genericToSpecificTypes.TryGetValue(specificType, out var v) ? v : null; + specificClassType._genericActualParameters[gp] = genericToSpecificTypes.TryGetValue(specificType, out var v) ? v : null; } } } @@ -300,26 +299,26 @@ private void StoreGenericParameters(PythonClassType classType, IGenericTypeParam /// Dictionary or name (T1) to specific type to populate. private void GetSpecificTypeFromArgumentValue(IGenericType gt, object argumentValue, IDictionary specificTypes) { switch (argumentValue) { - case IPythonDictionary dict when gt.Parameters.Count == 2: + case IPythonDictionary dict when gt.FormalGenericParameters.Count == 2: var keyType = dict.Keys.FirstOrDefault()?.GetPythonType(); var valueType = dict.Values.FirstOrDefault()?.GetPythonType(); if (!keyType.IsUnknown()) { - specificTypes[gt.Parameters[0]] = keyType; + specificTypes[gt.FormalGenericParameters[0]] = keyType; } if (!valueType.IsUnknown()) { - specificTypes[gt.Parameters[1]] = valueType; + specificTypes[gt.FormalGenericParameters[1]] = valueType; } break; - case IPythonIterable iter when gt.TypeId == BuiltinTypeId.List && gt.Parameters.Count == 1: + case IPythonIterable iter when gt.TypeId == BuiltinTypeId.List && gt.FormalGenericParameters.Count == 1: var itemType = iter.GetIterator().Next.GetPythonType(); if (!itemType.IsUnknown()) { - specificTypes[gt.Parameters[0]] = itemType; + specificTypes[gt.FormalGenericParameters[0]] = itemType; } break; - case IPythonCollection coll when gt.TypeId == BuiltinTypeId.Tuple && gt.Parameters.Count >= 1: + case IPythonCollection coll when gt.TypeId == BuiltinTypeId.Tuple && gt.FormalGenericParameters.Count >= 1: var itemTypes = coll.Contents.Select(m => m.GetPythonType()).ToArray(); - for (var i = 0; i < Math.Min(itemTypes.Length, gt.Parameters.Count); i++) { - specificTypes[gt.Parameters[i]] = itemTypes[i]; + for (var i = 0; i < Math.Min(itemTypes.Length, gt.FormalGenericParameters.Count); i++) { + specificTypes[gt.FormalGenericParameters[i]] = itemTypes[i]; } break; } @@ -374,12 +373,27 @@ private void SetClassMembers(PythonClassType classType, IArgumentSet args) { /// Determines if the class is generic. /// A class is generic if it has at least one unfilled generic type parameters or one of its bases is generic /// - public void DecideGeneric() { + private void DecideGeneric() { using (_genericResolutionGuard.Push(this, out var reentered)) { if (!reentered) { - _isGeneric = !Parameters.IsNullOrEmpty() || (Bases?.OfType().Any(g => g.IsGeneric) ?? false); + IsGeneric = !FormalGenericParameters.IsNullOrEmpty() || (Bases?.OfType().Any(g => g.IsGeneric) ?? false); } } } + + private void SetNames() { + // Based on available data, calculate name of generic with parameters, if any, + // as well as qualified name. + if (!_genericActualParameters.IsNullOrEmpty()) { + _nameWithParameters = CodeFormatter.FormatSequence(BaseName, '[', _genericActualParameters.Values); + _qualifiedNameWithParameters = CodeFormatter.FormatSequence(BaseName, '[', _genericActualParameters.Values.Select(v => v.QualifiedName)); + } + } + + private void SetGenericParameters() { + _genericParameters = _genericActualParameters.Values.Distinct().OfType().ToList(); + // Now that parameters are set, check if class is generic + DecideGeneric(); + } } } diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.cs index 8a6acfd6c..47de859fc 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.cs @@ -29,7 +29,7 @@ using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Types { - [DebuggerDisplay("Class {Name}")] + [DebuggerDisplay("Class {" + nameof(Name) + "}")] internal partial class PythonClassType : PythonType, IPythonClassType, IEquatable { internal enum ClassDocumentationSource { Class, @@ -39,7 +39,6 @@ internal enum ClassDocumentationSource { private static readonly string[] _classMethods = { "mro", "__dict__", @"__weakref__" }; private readonly ReentrancyGuard _memberGuard = new ReentrancyGuard(); - private string _genericName; private List _bases = new List(); private IReadOnlyList _mro; private string _documentation; @@ -61,14 +60,13 @@ public PythonClassType( DeclaringType = declaringType; } + #region IPythonType /// /// If class has generic type parameters, returns that form, e.g 'A[T1, int, ...]', otherwise returns base, e.g 'A' /// - public override string Name => _genericName ?? base.Name; - - #region IPythonType + public override string Name => _nameWithParameters ?? base.Name; + public override string QualifiedName => this.GetQualifiedName(_qualifiedNameWithParameters); public override PythonMemberType MemberType => PythonMemberType.Class; - public IPythonType DeclaringType { get; } public override IEnumerable GetMemberNames() { var names = new HashSet(); @@ -136,8 +134,9 @@ public override string Documentation { if (string.IsNullOrEmpty(_documentation) && Bases != null) { // If still not found, try bases. var o = DeclaringModule.Interpreter.GetBuiltinType(BuiltinTypeId.Object); - _documentation = Bases.FirstOrDefault(b => b != o && !string.IsNullOrEmpty(b?.Documentation)) - ?.Documentation; + _documentation = Bases + .FirstOrDefault(b => b != o && !(b is IGenericClassBase) && !string.IsNullOrEmpty(b?.Documentation))? + .Documentation; DocumentationSource = ClassDocumentationSource.Base; } } @@ -175,7 +174,10 @@ public override IMember Index(IPythonInstance instance, IArgumentSet args) { return fromBases ?? defaultReturn; } + #endregion + #region IPythonClassMember + public IPythonType DeclaringType { get; } #endregion #region IPythonClass @@ -203,12 +205,16 @@ public IReadOnlyList Mro { /// Has the map {T: int, K: str} /// public virtual IReadOnlyDictionary GenericParameters => - _genericParameters ?? EmptyDictionary.Instance; + _genericActualParameters ?? EmptyDictionary.Instance; #endregion internal ClassDocumentationSource DocumentationSource { get; private set; } - internal override void SetDocumentation(string documentation) => _documentation = documentation; + + internal override void SetDocumentation(string documentation) { + _documentation = documentation; + DocumentationSource = ClassDocumentationSource.Class; + } internal void SetBases(IEnumerable bases) { if (_bases.Count > 0) { @@ -234,6 +240,8 @@ internal void SetBases(IEnumerable bases) { } // Invalidate MRO _mro = null; + DecideGeneric(); + if (DeclaringModule is BuiltinsPythonModule) { // TODO: If necessary, we can set __bases__ on builtins when the module is fully analyzed. return; diff --git a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs index 0ffb34091..13bd73618 100644 --- a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs +++ b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs @@ -20,6 +20,7 @@ using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +using Microsoft.Python.Core.Text; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Types { @@ -30,18 +31,19 @@ namespace Microsoft.Python.Analysis.Types { /// Module making the call. /// Function overload the return value is requested for. /// Call arguments. - /// + /// Location of the call expression. public delegate IMember ReturnValueProvider( IPythonModule declaringModule, IPythonFunctionOverload overload, - IArgumentSet args); + IArgumentSet args, + IndexSpan indexSpan); internal sealed class PythonFunctionOverload : LocatedMember, IPythonFunctionOverload { private readonly string _returnDocumentation; // Allow dynamic function specialization, such as defining return types for builtin // functions that are impossible to scrape and that are missing from stubs. - // Parameters: declaring module, overload for the return value, list of arguments. + // FormalGenericParameters: declaring module, overload for the return value, list of arguments. private ReturnValueProvider _returnValueProvider; // Return value can be an instance or a type info. Consider type(C()) returning @@ -116,7 +118,7 @@ public string GetReturnDocumentation(IPythonType self = null) { public IMember Call(IArgumentSet args, IPythonType self) { if (!_fromAnnotation) { // First try supplied specialization callback. - var rt = _returnValueProvider?.Invoke(args.Eval.Module, this, args); + var rt = _returnValueProvider?.Invoke(args.Eval.Module, this, args, default); if (!rt.IsUnknown()) { return rt; } diff --git a/src/Analysis/Ast/Impl/Types/PythonType.cs b/src/Analysis/Ast/Impl/Types/PythonType.cs index c6d1067b6..13ee18cfd 100644 --- a/src/Analysis/Ast/Impl/Types/PythonType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonType.cs @@ -22,7 +22,7 @@ using Microsoft.Python.Core.Diagnostics; namespace Microsoft.Python.Analysis.Types { - [DebuggerDisplay("{Name}")] + [DebuggerDisplay("{" + nameof(Name) + "}")] internal class PythonType : LocatedMember, IPythonType {//, IEquatable { private readonly object _lock = new object(); private Dictionary _members; diff --git a/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs b/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs index 5265555fc..f24ffa4a9 100644 --- a/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs +++ b/src/Analysis/Ast/Impl/Types/PythonTypeWrapper.cs @@ -80,11 +80,11 @@ public virtual IMember Index(IPythonInstance instance, IArgumentSet args) #endregion #region ILocatedMember - public Location Location => InnerType?.Location ?? default; - public LocationInfo Definition => InnerType?.Definition ?? LocationInfo.Empty; - public IReadOnlyList References => InnerType?.References ?? Array.Empty(); - public void AddReference(Location location) => InnerType?.AddReference(location); - public void RemoveReferences(IPythonModule module) => InnerType?.RemoveReferences(module); + public virtual Location Location => InnerType?.Location ?? default; + public virtual LocationInfo Definition => InnerType?.Definition ?? LocationInfo.Empty; + public virtual IReadOnlyList References => InnerType?.References ?? Array.Empty(); + public virtual void AddReference(Location location) => InnerType?.AddReference(location); + public virtual void RemoveReferences(IPythonModule module) => InnerType?.RemoveReferences(module); #endregion #region IMemberContainer diff --git a/src/Analysis/Ast/Test/ClassesTests.cs b/src/Analysis/Ast/Test/ClassesTests.cs index 2e3008dda..685ce1688 100644 --- a/src/Analysis/Ast/Test/ClassesTests.cs +++ b/src/Analysis/Ast/Test/ClassesTests.cs @@ -574,6 +574,27 @@ class C(B): analysis.Should().HaveClass("C").Which.Should().HaveDocumentation("class C doc"); } + [TestMethod, Priority(0)] + public async Task NoDocFromObject() { + const string code = @" +class A(object): ... +"; + var analysis = await GetAnalysisAsync(code); + analysis.Should().HaveClass("A").Which.Documentation.Should().BeNull(); + } + + [TestMethod, Priority(0)] + public async Task NoDocFromGeneric() { + const string code = @" +from typing import Generic, TypeVar + +T = TypeVar('T') +class A(Generic[T]): ... +"; + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + analysis.Should().HaveClass("A").Which.Documentation.Should().BeNull(); + } + [TestMethod, Priority(0)] public async Task GetAttr() { const string code = @" diff --git a/src/Analysis/Ast/Test/EnumTests.cs b/src/Analysis/Ast/Test/EnumTests.cs new file mode 100644 index 000000000..d2c0af494 --- /dev/null +++ b/src/Analysis/Ast/Test/EnumTests.cs @@ -0,0 +1,48 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Analysis.Tests.FluentAssertions; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Parsing.Tests; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Tests { + [TestClass] + public class EnumTests : AnalysisTestBase { + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + + [TestMethod, Priority(0)] + public async Task BasicEnum() { + const string code = @" +import enum +x = enum.Enum('a', 'b', 'c') +"; + var analysis = await GetAnalysisAsync(code); + var x = analysis.Should().HaveVariable("x").Which; + } + } +} diff --git a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs index 8aec6db86..876886d81 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs @@ -15,11 +15,13 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions; using FluentAssertions.Execution; using FluentAssertions.Primitives; +using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using static Microsoft.Python.Analysis.Tests.FluentAssertions.AssertionsUtilities; @@ -124,7 +126,7 @@ public void HaveSameMembersAs(IMember other) { missingNames.Should().BeEmpty("Subject has missing names: ", missingNames); extraNames.Should().BeEmpty("Subject has extra names: ", extraNames); - foreach (var n in subjectMemberNames) { + foreach (var n in subjectMemberNames.Except(Enumerable.Repeat("__base__", 1))) { var subjectMember = subjectType.GetMember(n); var otherMember = otherContainer.GetMember(n); var subjectMemberType = subjectMember.GetPythonType(); @@ -137,9 +139,23 @@ public void HaveSameMembersAs(IMember other) { subjectMemberType.MemberType.Should().Be(otherMemberType.MemberType); + if(subjectMemberType is IPythonClassType subjectClass) { + var otherClass = otherMemberType as IPythonClassType; + otherClass.Should().NotBeNull(); + + if(subjectClass is IGenericType gt) { + otherClass.Should().BeAssignableTo(); + otherClass.IsGeneric.Should().Be(gt.IsGeneric); + } + + //Debug.Assert(subjectClass.Bases.Count == otherClass.Bases.Count); + subjectClass.Bases.Count.Should().BeGreaterOrEqualTo(otherClass.Bases.Count); + } + if (string.IsNullOrEmpty(subjectMemberType.Documentation)) { otherMemberType.Documentation.Should().BeNullOrEmpty(); } else { + //Debug.Assert(subjectMemberType.Documentation == otherMemberType.Documentation); subjectMemberType.Documentation.Should().Be(otherMemberType.Documentation); } diff --git a/src/Analysis/Ast/Test/FunctionTests.cs b/src/Analysis/Ast/Test/FunctionTests.cs index a8baa20dd..f8c4e8928 100644 --- a/src/Analysis/Ast/Test/FunctionTests.cs +++ b/src/Analysis/Ast/Test/FunctionTests.cs @@ -88,8 +88,8 @@ def f(a, b): "; var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); var pt = analysis.Should().HaveVariable("pt").Which; - pt.Should().HaveType("Point(x, y)").And.HaveMember("x"); - pt.Should().HaveType("Point(x, y)").And.HaveMember("y"); + pt.Should().HaveType("Point").And.HaveMember("x"); + pt.Should().HaveType("Point").And.HaveMember("y"); } [TestMethod, Priority(0)] diff --git a/src/Analysis/Ast/Test/GenericsTests.cs b/src/Analysis/Ast/Test/GenericsTests.cs index 1d3e17b26..aa62c7cd3 100644 --- a/src/Analysis/Ast/Test/GenericsTests.cs +++ b/src/Analysis/Ast/Test/GenericsTests.cs @@ -389,6 +389,22 @@ from typing import Dict .And.HaveVariable("y").OfType(BuiltinTypeId.Float); } + [TestMethod, Priority(0)] + [Ignore("https://github.com/microsoft/python-language-server/issues/1454")] + public async Task DictPartialParams() { + const string code = @" +from typing import Dict, Generic, TypeVar + +T = TypeVar('T') +class A(Genetic[T], Dict[T, int]) : ... +"; + + var analysis = await GetAnalysisAsync(code); + analysis.Should().HaveClass("A") + .Which.Should().HaveBase("Dict[T, int]"); + } + + [TestMethod, Priority(0)] public async Task GenericDictArg() { const string code = @" @@ -869,6 +885,20 @@ def getT(self) -> T: } [TestMethod, Priority(0)] + public async Task GenericBit() { + const string code = @" +from typing import TypeVar, Generic + +_T = TypeVar('_T') + +class A(Generic[_T]): ... +"; + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + analysis.Diagnostics.Should().BeEmpty(); + var c = analysis.Should().HaveVariable("A").Which.Value.GetPythonType(); + c.IsGeneric.Should().BeTrue(); + } + public async Task GenericClassBaseChain() { const string code = @" from typing import TypeVar, Generic, List diff --git a/src/Analysis/Ast/Test/ImportTests.cs b/src/Analysis/Ast/Test/ImportTests.cs index 5ce08f316..69fd7bfda 100644 --- a/src/Analysis/Ast/Test/ImportTests.cs +++ b/src/Analysis/Ast/Test/ImportTests.cs @@ -223,15 +223,6 @@ public async Task FromFuture() { analysis.Should().HaveFunction("print"); } - [TestMethod, Priority(0)] - public async Task PreferTypeToAny() { - var analysis = await GetAnalysisAsync(@"from TypingConstants import *", PythonVersions.LatestAvailable3X); - analysis.Should().HaveVariable("ONE").Which.Should().HaveType("Any"); - analysis.Should().HaveVariable("TWO").Which.Should().HaveType(BuiltinTypeId.Str); - var a = analysis.Should().HaveClass("A").Which; - a.GetMember("x").Should().HaveType(BuiltinTypeId.Int); - } - [TestMethod, Priority(0)] public async Task StarImportDoesNotOverwriteFunction() { const string code = @" diff --git a/src/Analysis/Ast/Test/TypingTests.cs b/src/Analysis/Ast/Test/TypingTests.cs index 606ecc3c5..2df9a7df7 100644 --- a/src/Analysis/Ast/Test/TypingTests.cs +++ b/src/Analysis/Ast/Test/TypingTests.cs @@ -144,7 +144,6 @@ public async Task Containers() { const string code = @" from typing import * -i : SupportsInt = ... lst_i : List[int] = ... lst_i_0 = lst_i[0] @@ -169,8 +168,7 @@ from typing import * ; var analysis = await GetAnalysisAsync(code); - analysis.Should().HaveVariable("i").OfType(BuiltinTypeId.Int) - .And.HaveVariable("lst_i").OfType("List[int]") + analysis.Should().HaveVariable("lst_i").OfType("List[int]") .And.HaveVariable("lst_i_0").OfType(BuiltinTypeId.Int) .And.HaveVariable("u").OfType("Union[Mapping[int, str], MappingView[str, float], MutableMapping[int, List[str]]]") .And.HaveVariable("dct_s_i").OfType("Mapping[str, int]") @@ -235,9 +233,10 @@ from typing import * "; var analysis = await GetAnalysisAsync(code); - analysis.Should().HaveVariable("n1").OfType("n1(x: int, y: float)") + analysis.Should().HaveVariable("n1").OfType("n1") + .Which.Value.Should().HaveDocumentation("n1(x: int, y: float)"); - .And.HaveVariable("n1_x").OfType(BuiltinTypeId.Int) + analysis.Should().HaveVariable("n1_x").OfType(BuiltinTypeId.Int) .And.HaveVariable("n1_y").OfType(BuiltinTypeId.Float) .And.HaveVariable("n1_0").OfType(BuiltinTypeId.Int) diff --git a/src/Analysis/Core/Impl/Interpreter/ModulePath.cs b/src/Analysis/Core/Impl/Interpreter/ModulePath.cs index 99dba57f1..206b01f21 100644 --- a/src/Analysis/Core/Impl/Interpreter/ModulePath.cs +++ b/src/Analysis/Core/Impl/Interpreter/ModulePath.cs @@ -15,11 +15,7 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; using System.Text.RegularExpressions; using Microsoft.Python.Core; using Microsoft.Python.Core.IO; diff --git a/src/Caching/Impl/Factories/ClassFactory.cs b/src/Caching/Impl/Factories/ClassFactory.cs deleted file mode 100644 index f0c9be0f6..000000000 --- a/src/Caching/Impl/Factories/ClassFactory.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.Python.Analysis.Caching.Models; -using Microsoft.Python.Analysis.Types; -using Microsoft.Python.Core; -using Microsoft.Python.Parsing; - -namespace Microsoft.Python.Analysis.Caching.Factories { - internal sealed class ClassFactory : FactoryBase { - public ClassFactory(IEnumerable classes, ModuleFactory mf) - : base(classes, mf) { - } - - public override PythonClassType CreateMember(ClassModel cm, IPythonType declaringType) - => new PythonClassType(cm.Name, new Location(ModuleFactory.Module, cm.IndexSpan.ToSpan())); - - protected override void CreateMemberParts(ClassModel cm, PythonClassType cls) { - // In Python 3 exclude object since type creation will add it automatically. - var is3x = ModuleFactory.Module.Interpreter.LanguageVersion.Is3x(); - var bases = cm.Bases.Select(b => is3x && b == "object" ? null : TryCreate(b)).ExcludeDefault().ToArray(); - cls.SetBases(bases); - cls.SetDocumentation(cm.Documentation); - - foreach (var f in cm.Methods) { - cls.AddMember(f.Name, ModuleFactory.FunctionFactory.Construct(f, cls, false), false); - } - foreach (var p in cm.Properties) { - cls.AddMember(p.Name, ModuleFactory.PropertyFactory.Construct(p, cls), false); - } - foreach (var c in cm.InnerClasses) { - cls.AddMember(c.Name, Construct(c, cls, false), false); - } - foreach(var vm in cm.Fields) { - var v = ModuleFactory.VariableFactory.Construct(vm, cls, false); - cls.AddMember(v.Name, v, false); - } - } - } -} diff --git a/src/Caching/Impl/Factories/FactoryBase.cs b/src/Caching/Impl/Factories/FactoryBase.cs deleted file mode 100644 index 2120879a2..000000000 --- a/src/Caching/Impl/Factories/FactoryBase.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.Python.Analysis.Caching.Models; -using Microsoft.Python.Analysis.Types; - -namespace Microsoft.Python.Analysis.Caching.Factories { - /// - /// Represents base factory that implements creation of a type - /// from its model (persistent form). - /// - internal abstract class FactoryBase : IDisposable - where TModel : MemberModel - where TMember : IMember { - - private class ModelData { - public TModel Model; - public TMember Member; - } - - private readonly Dictionary _data; - - protected ModuleFactory ModuleFactory { get; } - - protected FactoryBase(IEnumerable models, ModuleFactory mf) { - ModuleFactory = mf; - _data = models.ToDictionary(k => k.Name, v => new ModelData { Model = v }); - } - - public TMember TryCreate(string name, IPythonType declaringType = null) - => _data.TryGetValue(name, out var data) ? Construct(data.Model, declaringType) : default; - - /// - /// Constructs member from its persistent model. - /// - public TMember Construct(TModel cm, IPythonType declaringType = null, bool cached = true) { - TMember m; - - if (!cached) { - m = CreateMember(cm, declaringType); - CreateMemberParts(cm, m); - return m; - } - - var data = _data[cm.Name]; - if (data.Member == null) { - data.Member = CreateMember(data.Model, declaringType); - CreateMemberParts(cm, data.Member); - } - return data.Member; - } - - public virtual void Dispose() => _data.Clear(); - - public abstract TMember CreateMember(TModel model, IPythonType declaringType); - protected virtual void CreateMemberParts(TModel model, TMember member) { } - } -} diff --git a/src/Caching/Impl/Factories/FunctionFactory.cs b/src/Caching/Impl/Factories/FunctionFactory.cs deleted file mode 100644 index 07503bedb..000000000 --- a/src/Caching/Impl/Factories/FunctionFactory.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.Python.Analysis.Caching.Models; -using Microsoft.Python.Analysis.Types; - -namespace Microsoft.Python.Analysis.Caching.Factories { - internal sealed class FunctionFactory: FactoryBase { - public FunctionFactory(IEnumerable classes, ModuleFactory mf) - : base(classes, mf) { - } - - public override IPythonFunctionType CreateMember(FunctionModel fm, IPythonType declaringType) { - var ft = new PythonFunctionType(fm.Name, new Location(ModuleFactory.Module, fm.IndexSpan.ToSpan()), declaringType, fm.Documentation); - - foreach (var om in fm.Overloads) { - var o = new PythonFunctionOverload(fm.Name, new Location(ModuleFactory.Module, fm.IndexSpan.ToSpan())); - o.SetDocumentation(fm.Documentation); - o.SetReturnValue(ModuleFactory.ConstructMember(om.ReturnType), true); - o.SetParameters(om.Parameters.Select(ConstructParameter).ToArray()); - ft.AddOverload(o); - } - - foreach(var model in fm.Functions) { - var f = CreateMember(model, ft); - if (f != null) { - ft.AddMember(f.Name, f, overwrite: true); - } - } - - foreach (var model in fm.Classes) { - var c = ModuleFactory.ClassFactory.CreateMember(model, ft); - if (c != null) { - ft.AddMember(c.Name, c, overwrite: true); - } - } - - return ft; - } - - private IParameterInfo ConstructParameter(ParameterModel pm) - => new ParameterInfo(pm.Name, ModuleFactory.ConstructType(pm.Type), pm.Kind, ModuleFactory.ConstructMember(pm.DefaultValue)); - } -} diff --git a/src/Caching/Impl/Factories/PropertyFactory.cs b/src/Caching/Impl/Factories/PropertyFactory.cs deleted file mode 100644 index dfbfb51f0..000000000 --- a/src/Caching/Impl/Factories/PropertyFactory.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using Microsoft.Python.Analysis.Caching.Models; -using Microsoft.Python.Analysis.Types; - -namespace Microsoft.Python.Analysis.Caching.Factories { - internal sealed class PropertyFactory { - private readonly ModuleFactory _mf; - - public PropertyFactory(ModuleFactory mf) { - _mf = mf; - } - - public IPythonPropertyType Construct(PropertyModel pm, IPythonClassType cls) { - var prop = new PythonPropertyType(pm.Name, new Location(_mf.Module, pm.IndexSpan.ToSpan()), cls, (pm.Attributes & FunctionAttributes.Abstract) != 0); - prop.SetDocumentation(pm.Documentation); - var o = new PythonFunctionOverload(pm.Name, _mf.DefaultLocation); - o.SetDocumentation(pm.Documentation); // TODO: own documentation? - o.SetReturnValue(_mf.ConstructMember(pm.ReturnType), true); - prop.AddOverload(o); - return prop; - } - } -} diff --git a/src/Caching/Impl/Factories/TypeVarFactory.cs b/src/Caching/Impl/Factories/TypeVarFactory.cs deleted file mode 100644 index 00e38668c..000000000 --- a/src/Caching/Impl/Factories/TypeVarFactory.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.Python.Analysis.Caching.Models; -using Microsoft.Python.Analysis.Specializations.Typing.Types; -using Microsoft.Python.Analysis.Types; - -namespace Microsoft.Python.Analysis.Caching.Factories { - internal sealed class TypeVarFactory : FactoryBase { - public TypeVarFactory(IEnumerable models, ModuleFactory mf) - : base(models, mf) { - } - - public override IPythonType CreateMember(TypeVarModel tvm, IPythonType declaringType) - => new GenericTypeParameter(tvm.Name, ModuleFactory.Module, - tvm.Constraints.Select(c => ModuleFactory.ConstructType(c)).ToArray(), - tvm.Bound, tvm.Covariant, tvm.Contravariant, ModuleFactory.DefaultLocation); - } -} diff --git a/src/Caching/Impl/Factories/VariableFactory.cs b/src/Caching/Impl/Factories/VariableFactory.cs deleted file mode 100644 index ad624d183..000000000 --- a/src/Caching/Impl/Factories/VariableFactory.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System.Collections.Generic; -using Microsoft.Python.Analysis.Caching.Models; -using Microsoft.Python.Analysis.Types; -using Microsoft.Python.Analysis.Values; - -namespace Microsoft.Python.Analysis.Caching.Factories { - internal sealed class VariableFactory : FactoryBase { - public VariableFactory(IEnumerable models, ModuleFactory mf) - : base(models, mf) { - } - - public override IVariable CreateMember(VariableModel vm, IPythonType declaringType) { - var m = ModuleFactory.ConstructMember(vm.Value) ?? ModuleFactory.Module.Interpreter.UnknownType; - return new Variable(vm.Name, m, VariableSource.Declaration, new Location(ModuleFactory.Module, vm.IndexSpan?.ToSpan() ?? default)); - } - } -} diff --git a/src/Caching/Impl/GlobalScope.cs b/src/Caching/Impl/GlobalScope.cs index 84d7324fc..ba0c8b4fa 100644 --- a/src/Caching/Impl/GlobalScope.cs +++ b/src/Caching/Impl/GlobalScope.cs @@ -16,48 +16,53 @@ using System; using System.Collections.Generic; using System.Linq; -using Microsoft.Python.Analysis.Caching.Factories; using Microsoft.Python.Analysis.Caching.Models; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; -using Microsoft.Python.Core; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Caching { internal sealed class GlobalScope : IGlobalScope { private readonly VariableCollection _scopeVariables = new VariableCollection(); + private ModuleModel _model; - public GlobalScope(ModuleModel model, IPythonModule module, IServiceContainer services) { + public GlobalScope(ModuleModel model, IPythonModule module) { + _model = model; Module = module; Name = model.Name; + } - using (var mf = new ModuleFactory(model, module)) { - foreach (var tvm in model.TypeVars) { - var t = mf.TypeVarFactory.Construct(tvm); - _scopeVariables.DeclareVariable(tvm.Name, t, VariableSource.Generic, mf.DefaultLocation); - } - - // Member creation may be non-linear. Consider function A returning instance - // of a class or type info of a function which hasn't been created yet. - // Thus check if member has already been created first. - foreach (var cm in model.Classes) { - var cls = mf.ClassFactory.Construct(cm); - _scopeVariables.DeclareVariable(cm.Name, cls, VariableSource.Declaration, mf.DefaultLocation); - } - - foreach (var fm in model.Functions) { - var ft = mf.FunctionFactory.Construct(fm); - _scopeVariables.DeclareVariable(fm.Name, ft, VariableSource.Declaration, mf.DefaultLocation); - } - - foreach (var vm in model.Variables) { - var v = mf.VariableFactory.Construct(vm); - _scopeVariables.DeclareVariable(vm.Name, v.Value, VariableSource.Declaration, mf.DefaultLocation); - } - // TODO: re-declare __doc__, __name__, etc. + public void ReconstructVariables() { + // Member creation may be non-linear. Consider function A returning instance + // of a class or type info of a function which hasn't been created yet. + // Thus first create members so we can find then, then populate them with content. + var mf = new ModuleFactory(_model, Module); + foreach (var tvm in _model.TypeVars) { + var t = tvm.Construct(mf, null); + _scopeVariables.DeclareVariable(tvm.Name, t, VariableSource.Generic, mf.DefaultLocation); + } + foreach (var ntm in _model.NamedTuples) { + var nt = ntm.Construct(mf, null); + _scopeVariables.DeclareVariable(ntm.Name, nt, VariableSource.Declaration, mf.DefaultLocation); } + foreach (var cm in _model.Classes) { + var cls = cm.Construct(mf, null); + _scopeVariables.DeclareVariable(cm.Name, cls, VariableSource.Declaration, mf.DefaultLocation); + } + foreach (var fm in _model.Functions) { + var ft = fm.Construct(mf, null); + _scopeVariables.DeclareVariable(fm.Name, ft, VariableSource.Declaration, mf.DefaultLocation); + } + foreach (var vm in _model.Variables) { + var v = (IVariable)vm.Construct(mf, null); + _scopeVariables.DeclareVariable(vm.Name, v.Value, VariableSource.Declaration, mf.DefaultLocation); + } + + // TODO: re-declare __doc__, __name__, etc. + _model = null; } + #region IScope public string Name { get; } public ScopeStatement Node => null; public IScope OuterScope => null; @@ -72,5 +77,6 @@ public GlobalScope(ModuleModel model, IPythonModule module, IServiceContainer se public void DeclareVariable(string name, IMember value, VariableSource source, Location location = default) { } public void LinkVariable(string name, IVariable v, Location location) => throw new NotImplementedException() { }; + #endregion } } diff --git a/src/Caching/Impl/Models/CallableModel.cs b/src/Caching/Impl/Models/CallableModel.cs new file mode 100644 index 000000000..ef74613bf --- /dev/null +++ b/src/Caching/Impl/Models/CallableModel.cs @@ -0,0 +1,94 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Utilities; +using Microsoft.Python.Core; +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable MemberCanBePrivate.Global + +namespace Microsoft.Python.Analysis.Caching.Models { + [Serializable] + internal abstract class CallableModel : MemberModel { + public string Documentation { get; set; } + public FunctionAttributes Attributes { get; set; } + public ClassModel[] Classes { get; set; } + public FunctionModel[] Functions { get; set; } + + [NonSerialized] + private readonly ReentrancyGuard _processing = new ReentrancyGuard(); + protected CallableModel() { } // For de-serializer from JSON + + protected CallableModel(IPythonType callable) { + var functions = new List(); + var classes = new List(); + + foreach (var name in callable.GetMemberNames()) { + var m = callable.GetMember(name); + + // Only take members from this class, skip members from bases. + using (_processing.Push(m, out var reentered)) { + if (reentered) { + continue; + } + switch (m) { + case IPythonFunctionType ft1 when ft1.IsLambda(): + break; + case IPythonFunctionType ft2: + functions.Add(new FunctionModel(ft2)); + break; + case IPythonClassType cls: + classes.Add(new ClassModel(cls)); + break; + } + } + } + + Id = callable.Name.GetStableHash(); + Name = callable.Name; + QualifiedName = callable.QualifiedName; + Documentation = callable.Documentation; + Classes = classes.ToArray(); + Functions = functions.ToArray(); + IndexSpan = callable.Location.IndexSpan.ToModel(); + + Attributes = FunctionAttributes.Normal; + if (callable.IsAbstract) { + Attributes |= FunctionAttributes.Abstract; + } + if(callable is IPythonFunctionType ft) { + if(ft.IsClassMethod) { + Attributes |= FunctionAttributes.ClassMethod; + } + if (ft.IsStatic) { + Attributes |= FunctionAttributes.Static; + } + } + //if (callable is IPythonPropertyType p) { + // if (p.IsClassMethod) { + // Attributes |= FunctionAttributes.ClassMethod; + // } + // if (p.IsStatic) { + // Attributes |= FunctionAttributes.Static; + // } + //} + } + + protected override IEnumerable GetMemberModels() => Classes.Concat(Functions); + } +} diff --git a/src/Caching/Impl/Models/ClassModel.cs b/src/Caching/Impl/Models/ClassModel.cs index aa2786670..225a96614 100644 --- a/src/Caching/Impl/Models/ClassModel.cs +++ b/src/Caching/Impl/Models/ClassModel.cs @@ -13,32 +13,47 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Utilities; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +using Microsoft.Python.Parsing; + +// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global +// ReSharper disable MemberCanBePrivate.Global namespace Microsoft.Python.Analysis.Caching.Models { - [DebuggerDisplay("cls:{Name}")] + [Serializable] + [DebuggerDisplay("cls:{" + nameof(Name) + "}")] internal sealed class ClassModel : MemberModel { public string Documentation { get; set; } public string[] Bases { get; set; } + public NamedTupleModel[] NamedTupleBases { get; set; } public FunctionModel[] Methods { get; set; } public PropertyModel[] Properties { get; set; } public VariableModel[] Fields { get; set; } - public string[] GenericParameters { get; set; } - public ClassModel[] InnerClasses { get; set; } + public ClassModel[] Classes { get; set; } - private readonly ReentrancyGuard _processing = new ReentrancyGuard(); + /// + /// FormalGenericParameters of the Generic[...] base class, if any. + /// + public string[] GenericBaseParameters { get; set; } + /// + /// Values assigned to the generic parameters, if any. + /// + public GenericParameterValueModel[] GenericParameterValues { get; set; } - public static ClassModel FromType(IPythonClassType cls) => new ClassModel(cls); + [NonSerialized] private readonly ReentrancyGuard _processing = new ReentrancyGuard(); + [NonSerialized] private PythonClassType _cls; public ClassModel() { } // For de-serializer from JSON - private ClassModel(IPythonClassType cls) { + public ClassModel(IPythonClassType cls) { var methods = new List(); var properties = new List(); var fields = new List(); @@ -57,20 +72,21 @@ private ClassModel(IPythonClassType cls) { if (reentered) { continue; } + switch (m) { case IPythonClassType ct when ct.Name == name: if (!ct.DeclaringModule.Equals(cls.DeclaringModule)) { continue; } - innerClasses.Add(FromType(ct)); + innerClasses.Add(new ClassModel(ct)); break; case IPythonFunctionType ft when ft.IsLambda(): break; case IPythonFunctionType ft when ft.Name == name: - methods.Add(FunctionModel.FromType(ft)); + methods.Add(new FunctionModel(ft)); break; case IPythonPropertyType prop when prop.Name == name: - properties.Add(PropertyModel.FromType(prop)); + properties.Add(new PropertyModel(prop)); break; case IPythonInstance inst: fields.Add(VariableModel.FromInstance(name, inst)); @@ -84,14 +100,108 @@ private ClassModel(IPythonClassType cls) { Name = cls.TypeId == BuiltinTypeId.Ellipsis ? "ellipsis" : cls.Name; Id = Name.GetStableHash(); + QualifiedName = cls.QualifiedName; IndexSpan = cls.Location.IndexSpan.ToModel(); - Documentation = cls.Documentation; - Bases = cls.Bases.OfType().Select(t => t.GetPersistentQualifiedName()).ToArray(); + // Only persist documentation from this class, leave bases or __init__ alone. + Documentation = (cls as PythonClassType)?.DocumentationSource == PythonClassType.ClassDocumentationSource.Class ? cls.Documentation : null; + + + var ntBases = cls.Bases.OfType().ToArray(); + NamedTupleBases = ntBases.Select(b => new NamedTupleModel(b)).ToArray(); + + Bases = cls.Bases.Except(ntBases).Select(t => t.GetPersistentQualifiedName()).ToArray(); Methods = methods.ToArray(); Properties = properties.ToArray(); Fields = fields.ToArray(); - InnerClasses = innerClasses.ToArray(); + Classes = innerClasses.ToArray(); + + if (cls.IsGeneric) { + // Only check immediate bases, i.e. when class itself has Generic[T] base. + var gcp = cls.Bases.OfType().FirstOrDefault(); + GenericBaseParameters = gcp?.TypeParameters.Select(p => p.Name).ToArray(); + } + // If class is generic, we must save its generic base definition + // so on restore we'll be able to re-create the class as generic. + GenericBaseParameters = GenericBaseParameters ?? Array.Empty(); + + GenericParameterValues = cls.GenericParameters + .Select(p => new GenericParameterValueModel { Name = p.Key.Name, Type = p.Value.GetPersistentQualifiedName() }) + .ToArray(); + } + + protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) { + if (_cls != null) { + return _cls; + } + _cls = new PythonClassType(Name, new Location(mf.Module, IndexSpan.ToSpan())); + + var bases = CreateBases(mf); + + _cls.SetBases(bases); + _cls.SetDocumentation(Documentation); + + if (GenericParameterValues.Length > 0) { + _cls.StoreGenericParameters(_cls, + _cls.GenericParameters.Keys.ToArray(), + GenericParameterValues.ToDictionary( + k => _cls.GenericParameters.Keys.First(x => x.Name == k.Name), + v => mf.ConstructType(v.Type) + ) + ); + } + + foreach (var f in Methods) { + var m = f.Construct(mf, _cls); + _cls.AddMember(f.Name, m, false); + } + + foreach (var p in Properties) { + var m = p.Construct(mf, _cls); + _cls.AddMember(p.Name, m, false); + } + + foreach (var c in Classes) { + var m = c.Construct(mf, _cls); + _cls.AddMember(c.Name, m, false); + } + + foreach (var vm in Fields) { + var m = vm.Construct(mf, _cls); + _cls.AddMember(vm.Name, m, false); + } + + return _cls; } + + private IPythonType[] CreateBases(ModuleFactory mf) { + var ntBases = NamedTupleBases.Select(ntb => ntb.Construct(mf, _cls)).OfType().ToArray(); + + var is3x = mf.Module.Interpreter.LanguageVersion.Is3x(); + var basesNames = Bases.Select(b => is3x && b == "object" ? null : b).ExcludeDefault().ToArray(); + var bases = basesNames.Select(mf.ConstructType).ExcludeDefault().Concat(ntBases).ToArray(); + + if (GenericBaseParameters.Length > 0) { + // Generic class. Need to reconstruct generic base so code can then + // create specific types off the generic class. + var genericBase = bases.OfType().FirstOrDefault(b => b.Name == "Generic"); + if (genericBase != null) { + var typeVars = GenericBaseParameters.Select(n => mf.Module.GlobalScope.Variables[n]?.Value).OfType().ToArray(); + Debug.Assert(typeVars.Length > 0, "Class generic type parameters were not defined in the module during restore"); + if (typeVars.Length > 0) { + var genericWithParameters = genericBase.CreateSpecificType(new ArgumentSet(typeVars, null, null)); + if (genericWithParameters != null) { + bases = bases.Except(Enumerable.Repeat(genericBase, 1)).Concat(Enumerable.Repeat(genericWithParameters, 1)).ToArray(); + } + } + } else { + Debug.Fail("Generic class does not have generic base."); + } + } + return bases; + } + + protected override IEnumerable GetMemberModels() + => Classes.Concat(Methods).Concat(Properties).Concat(Fields); } } diff --git a/src/Caching/Impl/Models/FunctionModel.cs b/src/Caching/Impl/Models/FunctionModel.cs index 4608ff719..88da25f78 100644 --- a/src/Caching/Impl/Models/FunctionModel.cs +++ b/src/Caching/Impl/Models/FunctionModel.cs @@ -13,28 +13,59 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System.Collections.Generic; +using System; using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Types; -using Microsoft.Python.Analysis.Utilities; -using Microsoft.Python.Core; +// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global +// ReSharper disable MemberCanBePrivate.Global namespace Microsoft.Python.Analysis.Caching.Models { - [DebuggerDisplay("f:{Name}")] - internal sealed class FunctionModel : MemberModel { - public string Documentation { get; set; } + [Serializable] + [DebuggerDisplay("f:{" + nameof(Name) + "}")] + internal sealed class FunctionModel : CallableModel { public OverloadModel[] Overloads { get; set; } - public FunctionAttributes Attributes { get; set; } - public ClassModel[] Classes { get; set; } - public FunctionModel[] Functions { get; set; } + public FunctionModel() { } // For de-serializer from JSON + + [NonSerialized] private PythonFunctionType _function; + + public FunctionModel(IPythonFunctionType func) : base(func) { + Overloads = func.Overloads.Select(FromOverload).ToArray(); + } + + protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) { + if (_function != null) { + return _function; + } + _function = new PythonFunctionType(Name, new Location(mf.Module, IndexSpan.ToSpan()), declaringType, Documentation); + + // Create inner functions and classes first since function + // may be returning one of them. + foreach (var model in Functions) { + var f = model.Construct(mf, _function); + _function.AddMember(Name, f, overwrite: true); + } - private readonly ReentrancyGuard _processing = new ReentrancyGuard(); + foreach (var cm in Classes) { + var c = cm.Construct(mf, _function); + _function.AddMember(cm.Name, c, overwrite: true); + } - public static FunctionModel FromType(IPythonFunctionType ft) => new FunctionModel(ft); + foreach (var om in Overloads) { + var o = new PythonFunctionOverload(Name, new Location(mf.Module, IndexSpan.ToSpan())); + o.SetDocumentation(Documentation); + o.SetReturnValue(mf.ConstructMember(om.ReturnType), true); + o.SetParameters(om.Parameters.Select(p => ConstructParameter(mf, p)).ToArray()); + _function.AddOverload(o); + } - private static OverloadModel FromOverload(IPythonFunctionOverload o) { - return new OverloadModel { + return _function; + } + private IParameterInfo ConstructParameter(ModuleFactory mf, ParameterModel pm) + => new ParameterInfo(pm.Name, mf.ConstructType(pm.Type), pm.Kind, mf.ConstructMember(pm.DefaultValue)); + + private static OverloadModel FromOverload(IPythonFunctionOverload o) + => new OverloadModel { Parameters = o.Parameters.Select(p => new ParameterModel { Name = p.Name, Type = p.Type.GetPersistentQualifiedName(), @@ -43,42 +74,5 @@ private static OverloadModel FromOverload(IPythonFunctionOverload o) { }).ToArray(), ReturnType = o.StaticReturnValue.GetPersistentQualifiedName() }; - } - - public FunctionModel() { } // For de-serializer from JSON - - private FunctionModel(IPythonFunctionType func) { - var functions = new List(); - var classes = new List(); - - foreach (var name in func.GetMemberNames()) { - var m = func.GetMember(name); - - // Only take members from this class, skip members from bases. - using (_processing.Push(m, out var reentered)) { - if (reentered) { - continue; - } - switch (m) { - case IPythonFunctionType ft when ft.IsLambda(): - break; - case IPythonFunctionType ft: - functions.Add(FromType(ft)); - break; - case IPythonClassType cls: - classes.Add(ClassModel.FromType(cls)); - break; - } - } - } - - Id = func.Name.GetStableHash(); - Name = func.Name; - IndexSpan = func.Location.IndexSpan.ToModel(); - Documentation = func.Documentation; - Overloads = func.Overloads.Select(FromOverload).ToArray(); - Classes = classes.ToArray(); - Functions = functions.ToArray(); - } } } diff --git a/src/Caching/Impl/Models/GenericParameterValueModel.cs b/src/Caching/Impl/Models/GenericParameterValueModel.cs new file mode 100644 index 000000000..17f0c68f6 --- /dev/null +++ b/src/Caching/Impl/Models/GenericParameterValueModel.cs @@ -0,0 +1,32 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +namespace Microsoft.Python.Analysis.Caching.Models { + /// + /// Model for actual values assigned to generic parameters. + /// I.e. if class is based on Generic[T], what is assigned to T. + /// + internal sealed class GenericParameterValueModel { + /// + /// Generic parameter name as defined by TypeVar, such as T. + /// + public string Name { get; set; } + + /// + /// Qualified name of the type assigned to T. + /// + public string Type { get; set; } + } +} diff --git a/src/Caching/Impl/Models/IndexSpanModel.cs b/src/Caching/Impl/Models/IndexSpanModel.cs index e6af970ba..b9ccc45d7 100644 --- a/src/Caching/Impl/Models/IndexSpanModel.cs +++ b/src/Caching/Impl/Models/IndexSpanModel.cs @@ -14,13 +14,15 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System.Diagnostics; using Microsoft.Python.Core.Text; +// ReSharper disable MemberCanBePrivate.Global namespace Microsoft.Python.Analysis.Caching.Models { + [DebuggerDisplay("{Start}:({Length})")] internal sealed class IndexSpanModel { public int Start { get; set; } public int Length { get; set; } - public IndexSpan ToSpan() => new IndexSpan(Start, Length); } } diff --git a/src/Caching/Impl/Models/MemberModel.cs b/src/Caching/Impl/Models/MemberModel.cs index 253ea6b54..24d512fcf 100644 --- a/src/Caching/Impl/Models/MemberModel.cs +++ b/src/Caching/Impl/Models/MemberModel.cs @@ -13,10 +13,44 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Python.Analysis.Types; +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global + namespace Microsoft.Python.Analysis.Caching.Models { + [Serializable] internal abstract class MemberModel { + /// + /// Member unique id in the database. + /// public int Id { get; set; } + + /// + /// Member name, such as name of a class. + /// public string Name { get; set; } + + /// + /// Member qualified name within the module, such as A.B.C. + /// + public string QualifiedName { get; set; } + + /// + /// Member location in the module original source code. + /// public IndexSpanModel IndexSpan { get; set; } + + [NonSerialized] + private IMember _member; + + public IMember Construct(ModuleFactory mf, IPythonType declaringType) + => _member ?? (_member = ReConstruct(mf, declaringType)); + protected abstract IMember ReConstruct(ModuleFactory mf, IPythonType declaringType); + + public virtual MemberModel GetModel(string name) => GetMemberModels().FirstOrDefault(m => m.Name == name); + protected virtual IEnumerable GetMemberModels() => Enumerable.Empty(); } } diff --git a/src/Caching/Impl/Models/ModuleModel.cs b/src/Caching/Impl/Models/ModuleModel.cs index 7fe06f118..dfe859d35 100644 --- a/src/Caching/Impl/Models/ModuleModel.cs +++ b/src/Caching/Impl/Models/ModuleModel.cs @@ -13,15 +13,18 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; -using Microsoft.Python.Analysis.Caching.Factories; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +// ReSharper disable MemberCanBePrivate.Global namespace Microsoft.Python.Analysis.Caching.Models { + [Serializable] internal sealed class ModuleModel : MemberModel { /// /// Module unique id that includes version. @@ -33,6 +36,7 @@ internal sealed class ModuleModel : MemberModel { public VariableModel[] Variables { get; set; } public ClassModel[] Classes { get; set; } public TypeVarModel[] TypeVars { get; set; } + public NamedTupleModel[] NamedTuples { get; set; } /// /// Collection of new line information for conversion of linear spans @@ -45,6 +49,8 @@ internal sealed class ModuleModel : MemberModel { /// public int FileSize { get; set; } + [NonSerialized] private Dictionary _modelCache; + public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceContainer services, AnalysisCachingLevel options) { var uniqueId = analysis.Document.GetUniqueId(services, options); if(uniqueId == null) { @@ -56,6 +62,7 @@ public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceConta var functions = new Dictionary(); var classes = new Dictionary(); var typeVars = new Dictionary(); + var namedTuples = new Dictionary(); // Go directly through variables which names are listed in GetMemberNames // as well as variables that are declarations. @@ -68,9 +75,13 @@ public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceConta if (v.Value is IGenericTypeParameter && !typeVars.ContainsKey(v.Name)) { typeVars[v.Name] = TypeVarModel.FromGeneric(v); + continue; } switch (v.Value) { + case ITypingNamedTupleType nt: + namedTuples[nt.Name] = new NamedTupleModel(nt); + continue; case IPythonFunctionType ft when ft.IsLambda(): // No need to persist lambdas. continue; @@ -92,7 +103,7 @@ public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceConta case IPythonClassType cls when cls.DeclaringModule.Equals(analysis.Document) || cls.DeclaringModule.Equals(analysis.Document.Stub): if (!classes.ContainsKey(cls.Name)) { - classes[cls.Name] = ClassModel.FromType(cls); + classes[cls.Name] = new ClassModel(cls); continue; } break; @@ -113,6 +124,7 @@ when cls.DeclaringModule.Equals(analysis.Document) || cls.DeclaringModule.Equals Variables = variables.Values.ToArray(), Classes = classes.Values.ToArray(), TypeVars = typeVars.Values.ToArray(), + NamedTuples = namedTuples.Values.ToArray(), NewLines = analysis.Ast.NewLineLocations.Select(l => new NewLineModel { EndIndex = l.EndIndex, Kind = l.Kind @@ -128,13 +140,28 @@ private static FunctionModel GetFunctionModel(IDocumentAnalysis analysis, IVaria // star import. Their stubs, however, come from 'os' stub. The function then have declaring // module as 'nt' rather than 'os' and 'nt' does not have a stub. In this case use function // model like if function was declared in 'os'. - return FunctionModel.FromType(f); + return new FunctionModel(f); } if (f.DeclaringModule.Equals(analysis.Document) || f.DeclaringModule.Equals(analysis.Document.Stub)) { - return FunctionModel.FromType(f); + return new FunctionModel(f); } return null; } + + protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) => throw new NotImplementedException(); + + public override MemberModel GetModel(string name) { + if (_modelCache == null) { + var models = TypeVars.Concat(NamedTuples).Concat(Classes).Concat(Functions).Concat(Variables); + _modelCache = new Dictionary(); + foreach (var m in models) { + Debug.Assert(!_modelCache.ContainsKey(m.Name)); + _modelCache[m.Name] = m; + } + } + + return _modelCache.TryGetValue(name, out var model) ? model : null; + } } } diff --git a/src/Caching/Impl/Models/NamedTupleModel.cs b/src/Caching/Impl/Models/NamedTupleModel.cs new file mode 100644 index 000000000..5f17059c9 --- /dev/null +++ b/src/Caching/Impl/Models/NamedTupleModel.cs @@ -0,0 +1,54 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; +using System.Diagnostics; +using System.Linq; +using Microsoft.Python.Analysis.Specializations.Typing; +using Microsoft.Python.Analysis.Specializations.Typing.Types; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Core; + +namespace Microsoft.Python.Analysis.Caching.Models { + [Serializable] + [DebuggerDisplay("n:{" + nameof(Name) + "}")] + internal sealed class NamedTupleModel: MemberModel { + public string[] ItemNames { get; set; } + public string[] ItemTypes { get; set; } + + [NonSerialized] private NamedTupleType _namedTuple; + + public NamedTupleModel() { } // For de-serializer from JSON + + public NamedTupleModel(ITypingNamedTupleType nt) { + Id = nt.Name.GetStableHash(); + Name = nt.Name; + QualifiedName = nt.QualifiedName; + IndexSpan = nt.Location.IndexSpan.ToModel(); + ItemNames = nt.ItemNames.ToArray(); + ItemTypes = nt.ItemTypes.Select(t => t.QualifiedName).ToArray(); + } + + protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) { + if (_namedTuple != null) { + return _namedTuple; + } + + var itemTypes = ItemTypes.Select(mf.ConstructType).ToArray(); + _namedTuple = new NamedTupleType(Name, ItemNames, itemTypes, mf.Module, IndexSpan.ToSpan()); + return _namedTuple; + } + } +} diff --git a/src/Caching/Impl/Models/PropertyModel.cs b/src/Caching/Impl/Models/PropertyModel.cs index 91cb0feef..a5b33e025 100644 --- a/src/Caching/Impl/Models/PropertyModel.cs +++ b/src/Caching/Impl/Models/PropertyModel.cs @@ -13,24 +13,36 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System; using Microsoft.Python.Analysis.Types; -using Microsoft.Python.Core; +// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global +// ReSharper disable MemberCanBePrivate.Global namespace Microsoft.Python.Analysis.Caching.Models { - internal sealed class PropertyModel: MemberModel { - public string Documentation { get; set; } + [Serializable] + internal sealed class PropertyModel : CallableModel { public string ReturnType { get; set; } - public FunctionAttributes Attributes { get; set; } + public PropertyModel() { } // For de-serializer from JSON - public static PropertyModel FromType(IPythonPropertyType prop) { - return new PropertyModel { - Id = prop.Name.GetStableHash(), - Name = prop.Name, - IndexSpan = prop.Location.IndexSpan.ToModel(), - Documentation = prop.Documentation, - ReturnType = prop.ReturnType.GetPersistentQualifiedName() - // TODO: attributes. - }; + [NonSerialized] private PythonPropertyType _property; + + public PropertyModel(IPythonPropertyType prop) : base(prop) { + ReturnType = prop.ReturnType.GetPersistentQualifiedName(); + } + + protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) { + if (_property != null) { + return _property; + } + _property = new PythonPropertyType(Name, new Location(mf.Module, IndexSpan.ToSpan()), declaringType, (Attributes & FunctionAttributes.Abstract) != 0); + _property.SetDocumentation(Documentation); + + var o = new PythonFunctionOverload(Name, mf.DefaultLocation); + o.SetDocumentation(Documentation); + o.SetReturnValue(mf.ConstructMember(ReturnType), true); + _property.AddOverload(o); + + return _property; } } } diff --git a/src/Caching/Impl/Models/TypeVarModel.cs b/src/Caching/Impl/Models/TypeVarModel.cs index 0735f1739..5a7bfb2e7 100644 --- a/src/Caching/Impl/Models/TypeVarModel.cs +++ b/src/Caching/Impl/Models/TypeVarModel.cs @@ -13,15 +13,20 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System; using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Specializations.Typing; +using Microsoft.Python.Analysis.Specializations.Typing.Types; +using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +// ReSharper disable MemberCanBePrivate.Global namespace Microsoft.Python.Analysis.Caching.Models { - [DebuggerDisplay("TypeVar:{Name}")] - internal sealed class TypeVarModel: MemberModel { + [Serializable] + [DebuggerDisplay("TypeVar:{" + nameof(Name) + "}")] + internal sealed class TypeVarModel : MemberModel { public string[] Constraints { get; set; } public object Bound { get; set; } public object Covariant { get; set; } @@ -32,11 +37,17 @@ public static TypeVarModel FromGeneric(IVariable v) { return new TypeVarModel { Id = g.Name.GetStableHash(), Name = g.Name, + QualifiedName = g.QualifiedName, Constraints = g.Constraints.Select(c => c.GetPersistentQualifiedName()).ToArray(), Bound = g.Bound, Covariant = g.Covariant, Contravariant = g.Contravariant }; } + + protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) + => new GenericTypeParameter(Name, + Constraints.Select(mf.ConstructType).ToArray(), + Bound, Covariant, Contravariant, mf.DefaultLocation); } } diff --git a/src/Caching/Impl/Models/VariableModel.cs b/src/Caching/Impl/Models/VariableModel.cs index e6467d312..c3e2696cf 100644 --- a/src/Caching/Impl/Models/VariableModel.cs +++ b/src/Caching/Impl/Models/VariableModel.cs @@ -13,12 +13,15 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System; using System.Diagnostics; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +// ReSharper disable MemberCanBePrivate.Global namespace Microsoft.Python.Analysis.Caching.Models { + [Serializable] [DebuggerDisplay("v:{Name} = {Value}")] internal sealed class VariableModel: MemberModel { public string Value { get; set; } @@ -26,6 +29,7 @@ internal sealed class VariableModel: MemberModel { public static VariableModel FromVariable(IVariable v) => new VariableModel { Id = v.Name.GetStableHash(), Name = v.Name, + QualifiedName = v.Name, IndexSpan = v.Location.IndexSpan.ToModel(), Value = v.Value.GetPersistentQualifiedName() }; @@ -33,14 +37,21 @@ internal sealed class VariableModel: MemberModel { public static VariableModel FromInstance(string name, IPythonInstance inst) => new VariableModel { Id = name.GetStableHash(), Name = name, + QualifiedName = name, Value = inst.GetPersistentQualifiedName() }; public static VariableModel FromType(string name, IPythonType t) => new VariableModel { Id = name.GetStableHash(), Name = name, + QualifiedName = name, IndexSpan = t.Location.IndexSpan.ToModel(), Value = t.GetPersistentQualifiedName() }; + + protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) { + var m = mf.ConstructMember(Value) ?? mf.Module.Interpreter.UnknownType; + return new Variable(Name, m, VariableSource.Declaration, new Location(mf.Module, IndexSpan?.ToSpan() ?? default)); + } } } diff --git a/src/Caching/Impl/Factories/ModuleFactory.cs b/src/Caching/Impl/ModuleFactory.cs similarity index 69% rename from src/Caching/Impl/Factories/ModuleFactory.cs rename to src/Caching/Impl/ModuleFactory.cs index ddc18af8e..c8bd49041 100644 --- a/src/Caching/Impl/Factories/ModuleFactory.cs +++ b/src/Caching/Impl/ModuleFactory.cs @@ -26,37 +26,26 @@ using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; -namespace Microsoft.Python.Analysis.Caching.Factories { - internal sealed class ModuleFactory : IDisposable { +namespace Microsoft.Python.Analysis.Caching { + /// + /// Constructs module from its persistent model. + /// + internal sealed class ModuleFactory { // TODO: better resolve circular references. private readonly ReentrancyGuard _typeReentrancy = new ReentrancyGuard(); private readonly ReentrancyGuard _moduleReentrancy = new ReentrancyGuard(); + private readonly ModuleModel _model; public IPythonModule Module { get; } - public ClassFactory ClassFactory { get; } - public FunctionFactory FunctionFactory { get; } - public PropertyFactory PropertyFactory { get; } - public VariableFactory VariableFactory { get; } - public TypeVarFactory TypeVarFactory { get; } public Location DefaultLocation { get; } public ModuleFactory(ModuleModel model, IPythonModule module) { + _model = model; + Module = module; - ClassFactory = new ClassFactory(model.Classes, this); - FunctionFactory = new FunctionFactory(model.Functions, this); - VariableFactory = new VariableFactory(model.Variables, this); - TypeVarFactory = new TypeVarFactory(model.TypeVars, this); - PropertyFactory = new PropertyFactory(this); DefaultLocation = new Location(Module); } - public void Dispose() { - ClassFactory.Dispose(); - FunctionFactory.Dispose(); - VariableFactory.Dispose(); - TypeVarFactory.Dispose(); - } - public IPythonType ConstructType(string qualifiedName) => ConstructMember(qualifiedName)?.GetPythonType(); public IMember ConstructMember(string qualifiedName) { @@ -65,34 +54,74 @@ public IMember ConstructMember(string qualifiedName) { return null; } - // TODO: better resolve circular references. - using (_typeReentrancy.Push(qualifiedName, out var reentered)) { - if (reentered) { - return null; + // See if member is a module first. + var module = GetModule(parts); + if (module == null) { + return null; + } + + var member = parts.ModuleName == Module.Name + ? GetMemberFromThisModule(parts.MemberNames) + : GetMemberFromModule(module, parts.MemberNames); + + if (parts.ObjectType != ObjectType.Instance) { + return member; + } + + var t = member.GetPythonType() ?? module.Interpreter.UnknownType; + return new PythonInstance(t); + } + + private IMember GetMemberFromThisModule(IReadOnlyList memberNames) { + if (memberNames.Count == 0) { + return null; + } + + // Try from cache first + MemberModel currentModel = _model; + IMember m = null; + IPythonType declaringType = null; + + foreach (var name in memberNames) { + // Check if name has type arguments such as Union[int, str] + // Note that types can be nested like Union[int, Union[A, B]] + var memberName = name; + var typeArgs = GetTypeArguments(memberName, out var typeName); + if (!string.IsNullOrEmpty(typeName) && typeName != name) { + memberName = typeName; } - // See if member is a module first. - var module = GetModule(parts); - if (module == null) { + + if(memberName == "") { return null; } - if (parts.ObjectType == ObjectType.NamedTuple) { - return ConstructNamedTuple(parts.MemberNames[0], module); + var nextModel = currentModel.GetModel(memberName); + Debug.Assert(nextModel != null); + if (nextModel == null) { + return null; } - var member = parts.ModuleName == Module.Name - ? GetMemberFromThisModule(parts.MemberNames) - : GetMemberFromModule(module, parts.MemberNames); - - if (parts.ObjectType != ObjectType.Instance) { - return member; + m = nextModel.Construct(this, declaringType); + Debug.Assert(m != null); + if (m is IGenericType gt && typeArgs.Count > 0) { + m = gt.CreateSpecificType(new ArgumentSet(typeArgs, null, null)); } - var t = member.GetPythonType() ?? module.Interpreter.UnknownType; - return new PythonInstance(t); + currentModel = nextModel; + declaringType = m as IPythonType; + Debug.Assert(declaringType != null); + if (declaringType == null) { + return null; + } } + + return m; } + private IMember GetMemberFromModule(IPythonModule module, IReadOnlyList memberNames) + => memberNames.Count == 0 ? module : GetMember(module, memberNames); + + private IPythonModule GetModule(QualifiedNameParts parts) { if (parts.ModuleName == Module.Name) { return Module; @@ -118,38 +147,8 @@ private IPythonModule GetModule(QualifiedNameParts parts) { } } - private IMember GetMemberFromModule(IPythonModule module, IReadOnlyList memberNames) - => memberNames.Count == 0 ? module : GetMember(module, memberNames); - - private IMember GetBuiltinMember(IBuiltinsPythonModule builtins, string memberName) { - if (memberName.StartsWithOrdinal("__")) { - memberName = memberName.Substring(2, memberName.Length - 4); - } - - switch (memberName) { - case "NoneType": - return builtins.Interpreter.GetBuiltinType(BuiltinTypeId.NoneType); - case "Unknown": - return builtins.Interpreter.UnknownType; - } - return builtins.GetMember(memberName); - } - - private IMember GetMemberFromThisModule(IReadOnlyList memberNames) { - if (memberNames.Count == 0) { - return null; - } - - var name = memberNames[0]; - var root = ClassFactory.TryCreate(name) - ?? (FunctionFactory.TryCreate(name) - ?? (IMember)VariableFactory.TryCreate(name)); - - return GetMember(root, memberNames.Skip(1)); - } - private IMember GetMember(IMember root, IEnumerable memberNames) { - IMember member = root; + var member = root; foreach (var n in memberNames) { var memberName = n; // Check if name has type arguments such as Union[int, str] @@ -168,6 +167,11 @@ private IMember GetMember(IMember root, IEnumerable memberNames) { member = GetBuiltinMember(builtins, memberName) ?? builtins.Interpreter.UnknownType; } else { member = mc?.GetMember(memberName); + // Work around problem that some stubs have incorrectly named tuples. + // For example, in posix.pyi variable for the named tuple is not named as the tuple: + // sched_param = NamedTuple('sched_priority', [('sched_priority', int),]) + member = member ?? (mc as PythonModule)?.GlobalScope.Variables + .FirstOrDefault(v => v.Value is ITypingNamedTupleType nt && nt.Name == memberName); } if (member == null) { @@ -183,6 +187,20 @@ private IMember GetMember(IMember root, IEnumerable memberNames) { return member; } + private IMember GetBuiltinMember(IBuiltinsPythonModule builtins, string memberName) { + if (memberName.StartsWithOrdinal("__")) { + memberName = memberName.Substring(2, memberName.Length - 4); + } + + switch (memberName) { + case "NoneType": + return builtins.Interpreter.GetBuiltinType(BuiltinTypeId.NoneType); + case "Unknown": + return builtins.Interpreter.UnknownType; + } + return builtins.GetMember(memberName); + } + private IReadOnlyList GetTypeArguments(string memberName, out string typeName) { typeName = null; // TODO: better handle generics. @@ -203,7 +221,7 @@ private IReadOnlyList GetTypeArguments(string memberName, out strin if (t == null) { TypeNames.DeconstructQualifiedName(qn, out var parts); typeName = string.Join(".", parts.MemberNames); - t = new GenericTypeParameter(typeName, Module, Array.Empty(), null, null, null, DefaultLocation); + t = new GenericTypeParameter(typeName, Array.Empty(), null, null, null, DefaultLocation); } typeArgs.Add(t); } @@ -212,32 +230,5 @@ private IReadOnlyList GetTypeArguments(string memberName, out strin } return typeArgs; } - - private ITypingNamedTupleType ConstructNamedTuple(string tupleString, IPythonModule module) { - // tuple_name(name: type, name: type, ...) - // time_result(columns: int, lines: int) - var openBraceIndex = tupleString.IndexOf('('); - var closeBraceIndex = tupleString.IndexOf(')'); - var name = tupleString.Substring(0, openBraceIndex); - var argString = tupleString.Substring(openBraceIndex + 1, closeBraceIndex - openBraceIndex - 1); - - var itemNames = new List(); - var itemTypes = new List(); - var start = 0; - - for (var i = 0; i < argString.Length; i++) { - var ch = argString[i]; - if (ch == ':') { - itemNames.Add(argString.Substring(start, i - start).Trim()); - i++; - var paramType = TypeNames.GetTypeName(argString, ref i, ','); - var t = ConstructType(paramType); - itemTypes.Add(t ?? module.Interpreter.UnknownType); - start = i + 1; - } - } - - return new NamedTupleType(name, itemNames, itemTypes, module, module.Interpreter); - } } } diff --git a/src/Caching/Impl/PythonDbModule.cs b/src/Caching/Impl/PythonDbModule.cs index 91a8defa6..addc97053 100644 --- a/src/Caching/Impl/PythonDbModule.cs +++ b/src/Caching/Impl/PythonDbModule.cs @@ -28,7 +28,11 @@ internal sealed class PythonDbModule : SpecializedModule { public PythonDbModule(ModuleModel model, string filePath, IServiceContainer services) : base(model.Name, filePath, services) { - GlobalScope = new GlobalScope(model, this, services); + + var gs = new GlobalScope(model, this); + GlobalScope = gs; + gs.ReconstructVariables(); + Documentation = model.Documentation; _newLines = model.NewLines.Select(nl => new NewLineLocation(nl.EndIndex, nl.Kind)).ToArray(); diff --git a/src/Caching/Impl/QualifiedNameParts.cs b/src/Caching/Impl/QualifiedNameParts.cs index 3bbb431bb..defe456fd 100644 --- a/src/Caching/Impl/QualifiedNameParts.cs +++ b/src/Caching/Impl/QualifiedNameParts.cs @@ -21,8 +21,7 @@ public enum ObjectType { Instance, Module, VariableModule, - BuiltinModule, - NamedTuple + BuiltinModule } internal struct QualifiedNameParts { diff --git a/src/Caching/Impl/TypeNames.cs b/src/Caching/Impl/TypeNames.cs index d60025128..c1e1e7f0e 100644 --- a/src/Caching/Impl/TypeNames.cs +++ b/src/Caching/Impl/TypeNames.cs @@ -32,15 +32,13 @@ public static string GetPersistentQualifiedName(this IMember m) { if (!t.IsUnknown()) { switch (m) { case IPythonInstance _: // constants and strings map here. - return t is ITypingNamedTupleType nt1 ? $"n:{nt1.QualifiedName}" : $"i:{t.QualifiedName}"; + return $"i:{t.QualifiedName}"; case IBuiltinsPythonModule b: return $"b:{b.QualifiedName}"; case PythonVariableModule vm: return $"p:{vm.QualifiedName}"; case IPythonModule mod: return $"m:{mod.QualifiedName}"; - case ITypingNamedTupleType nt2: - return $"n:{nt2.QualifiedName}"; case IPythonType pt when pt.DeclaringModule.ModuleType == ModuleType.Builtins: return $"t:{(pt.TypeId == BuiltinTypeId.Ellipsis ? "ellipsis" : pt.QualifiedName)}"; case IPythonType pt: @@ -82,8 +80,6 @@ private static void GetObjectTypeFromPrefix(string qualifiedName, ref QualifiedN parts.ObjectType = ObjectType.BuiltinModule; } else if (qualifiedName.StartsWith("t:")) { parts.ObjectType = ObjectType.Type; - } else if (qualifiedName.StartsWith("n:")) { - parts.ObjectType = ObjectType.NamedTuple; } else { // Unprefixed name is typically an argument to another type like Union[int, typing:Any] parts.ObjectType = ObjectType.Type; @@ -111,7 +107,7 @@ private static void GetModuleNameAndMembers(string qualifiedName, ref QualifiedN } return; } - + // Extract module name and member names, of any. parts.ModuleName = typeName.Substring(0, moduleSeparatorIndex); var memberNamesOffset = parts.ModuleName.Length + 1; diff --git a/src/Caching/Test/ClassesTests.cs b/src/Caching/Test/ClassesTests.cs index facbf28ff..3aa6c225c 100644 --- a/src/Caching/Test/ClassesTests.cs +++ b/src/Caching/Test/ClassesTests.cs @@ -64,5 +64,91 @@ def methodB2(self): var json = ToJson(model); Baseline.CompareToFile(BaselineFileName, json); } + + [TestMethod, Priority(0)] + public async Task ForwardDeclarations() { + const string code = @" +x = 'str' + +class A: + def methodA1(self): + return B() + + def methodA2(self): + return func() + +class B: + class C: + def methodC(self): + return func() + + def methodB1(self): + def a(): + return 1 + return a + +def func(): + return 1 + +a = B().methodB1() +b = A().methodA1() +"; + var analysis = await GetAnalysisAsync(code); + analysis.Should().HaveVariable("a").Which.Should().HaveType("a"); + analysis.Should().HaveVariable("b").Which.Should().HaveType("B"); + + var model = ModuleModel.FromAnalysis(analysis, Services, AnalysisCachingLevel.Library); + //var json = ToJson(model); + //Baseline.CompareToFile(BaselineFileName, json); + + using (var dbModule = new PythonDbModule(model, analysis.Document.FilePath, Services)) { + dbModule.Should().HaveSameMembersAs(analysis.Document); + } + } + + [TestMethod, Priority(0)] + public async Task GenericClass() { + const string code = @" +from typing import Generic, TypeVar, Dict + +K = TypeVar('K') +V = TypeVar('V') + +class A(Generic[K, V], Dict[K, V]): + def key(self) -> K: + return K + + def value(self): + return V + +x = A(1, 'a') +"; + var analysis = await GetAnalysisAsync(code); + var model = ModuleModel.FromAnalysis(analysis, Services, AnalysisCachingLevel.Library); + //var json = ToJson(model); + //Baseline.CompareToFile(BaselineFileName, json); + + using (var dbModule = new PythonDbModule(model, analysis.Document.FilePath, Services)) { + dbModule.Should().HaveSameMembersAs(analysis.Document); + } + } + + [TestMethod, Priority(0)] + public async Task ClassOwnDocumentation() { + const string code = @" +class A: + '''class A doc''' + +class B(A): + def __init__(self): + '''__init__ doc''' + return +"; + var analysis = await GetAnalysisAsync(code); + var model = ModuleModel.FromAnalysis(analysis, Services, AnalysisCachingLevel.Library); + var json = ToJson(model); + // In JSON, class A should have 'class A doc' documentation while B should have none. + Baseline.CompareToFile(BaselineFileName, json); + } } } diff --git a/src/Caching/Test/Files/ClassOwnDocumentation.json b/src/Caching/Test/Files/ClassOwnDocumentation.json new file mode 100644 index 000000000..fb93f52f8 --- /dev/null +++ b/src/Caching/Test/Files/ClassOwnDocumentation.json @@ -0,0 +1,188 @@ +{ + "UniqueId": "module", + "Documentation": "", + "Functions": [], + "Variables": [ + { + "Value": "t:bool", + "Id": -529376420, + "Name": "__debug__", + "QualifiedName": "__debug__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "t:str", + "Id": -1636005055, + "Name": "__doc__", + "QualifiedName": "__doc__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "t:str", + "Id": 875442003, + "Name": "__file__", + "QualifiedName": "__file__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "t:str", + "Id": 1097116834, + "Name": "__name__", + "QualifiedName": "__name__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "t:str", + "Id": 75395663, + "Name": "__package__", + "QualifiedName": "__package__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "t:list", + "Id": 1154586556, + "Name": "__path__", + "QualifiedName": "__path__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, + { + "Value": "t:dict", + "Id": 817929997, + "Name": "__dict__", + "QualifiedName": "__dict__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + } + ], + "Classes": [ + { + "Documentation": "class A doc", + "Bases": [ + "t:object" + ], + "NamedTupleBases": [], + "Methods": [], + "Properties": [], + "Fields": [], + "Classes": [], + "GenericBaseParameters": [], + "GenericParameterValues": [], + "Id": 778, + "Name": "A", + "QualifiedName": "module:A", + "IndexSpan": { + "Start": 8, + "Length": 1 + } + }, + { + "Documentation": null, + "Bases": [ + "t:module:A", + "t:object" + ], + "NamedTupleBases": [], + "Methods": [ + { + "Overloads": [ + { + "Parameters": [ + { + "Name": "self", + "Type": "t:module:B", + "DefaultValue": null, + "Kind": 0 + } + ], + "ReturnType": null + } + ], + "Documentation": null, + "Attributes": 0, + "Classes": [], + "Functions": [], + "Id": 965872103, + "Name": "__init__", + "QualifiedName": "module:B.__init__", + "IndexSpan": { + "Start": 58, + "Length": 8 + } + } + ], + "Properties": [], + "Fields": [], + "Classes": [], + "GenericBaseParameters": [], + "GenericParameterValues": [], + "Id": 779, + "Name": "B", + "QualifiedName": "module:B", + "IndexSpan": { + "Start": 43, + "Length": 1 + } + } + ], + "TypeVars": [], + "NamedTuples": [], + "NewLines": [ + { + "EndIndex": 2, + "Kind": 3 + }, + { + "EndIndex": 12, + "Kind": 3 + }, + { + "EndIndex": 35, + "Kind": 3 + }, + { + "EndIndex": 37, + "Kind": 3 + }, + { + "EndIndex": 50, + "Kind": 3 + }, + { + "EndIndex": 75, + "Kind": 3 + }, + { + "EndIndex": 99, + "Kind": 3 + }, + { + "EndIndex": 115, + "Kind": 3 + } + ], + "FileSize": 115, + "Id": -2131035837, + "Name": "module", + "QualifiedName": null, + "IndexSpan": null +} \ No newline at end of file diff --git a/src/Caching/Test/Files/MemberLocations.json b/src/Caching/Test/Files/MemberLocations.json index a5c60043f..57b4101fd 100644 --- a/src/Caching/Test/Files/MemberLocations.json +++ b/src/Caching/Test/Files/MemberLocations.json @@ -3,7 +3,6 @@ "Documentation": "", "Functions": [ { - "Documentation": null, "Overloads": [ { "Parameters": [ @@ -23,11 +22,13 @@ "ReturnType": null } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": 799444, "Name": "sum", + "QualifiedName": "module:sum", "IndexSpan": { "Start": 19, "Length": 3 @@ -39,6 +40,7 @@ "Value": "t:bool", "Id": -529376420, "Name": "__debug__", + "QualifiedName": "__debug__", "IndexSpan": { "Start": 0, "Length": 0 @@ -48,6 +50,7 @@ "Value": "t:str", "Id": -1636005055, "Name": "__doc__", + "QualifiedName": "__doc__", "IndexSpan": { "Start": 0, "Length": 0 @@ -57,6 +60,7 @@ "Value": "t:str", "Id": 875442003, "Name": "__file__", + "QualifiedName": "__file__", "IndexSpan": { "Start": 0, "Length": 0 @@ -66,6 +70,7 @@ "Value": "t:str", "Id": 1097116834, "Name": "__name__", + "QualifiedName": "__name__", "IndexSpan": { "Start": 0, "Length": 0 @@ -75,6 +80,7 @@ "Value": "t:str", "Id": 75395663, "Name": "__package__", + "QualifiedName": "__package__", "IndexSpan": { "Start": 0, "Length": 0 @@ -84,6 +90,7 @@ "Value": "t:list", "Id": 1154586556, "Name": "__path__", + "QualifiedName": "__path__", "IndexSpan": { "Start": 0, "Length": 0 @@ -93,6 +100,7 @@ "Value": "t:dict", "Id": 817929997, "Name": "__dict__", + "QualifiedName": "__dict__", "IndexSpan": { "Start": 0, "Length": 0 @@ -102,6 +110,7 @@ "Value": "i:str", "Id": 833, "Name": "x", + "QualifiedName": "x", "IndexSpan": { "Start": 2, "Length": 1 @@ -114,9 +123,9 @@ "Bases": [ "t:object" ], + "NamedTupleBases": [], "Methods": [ { - "Documentation": null, "Overloads": [ { "Parameters": [ @@ -130,11 +139,13 @@ "ReturnType": "i:int" } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": 935009768, "Name": "methodB2", + "QualifiedName": "module:B.methodB2", "IndexSpan": { "Start": 253, "Length": 8 @@ -143,11 +154,14 @@ ], "Properties": [ { - "Documentation": "", "ReturnType": "i:int", + "Documentation": "", "Attributes": 0, + "Classes": [], + "Functions": [], "Id": -947452202, "Name": "propertyB", + "QualifiedName": "module:B.propertyB", "IndexSpan": { "Start": 207, "Length": 9 @@ -159,25 +173,25 @@ "Value": "i:int", "Id": 833, "Name": "x", + "QualifiedName": "x", "IndexSpan": null } ], - "GenericParameters": null, - "InnerClasses": [ + "Classes": [ { "Documentation": null, "Bases": [ "t:object" ], + "NamedTupleBases": [], "Methods": [ { - "Documentation": null, "Overloads": [ { "Parameters": [ { "Name": "self", - "Type": "t:module:C", + "Type": "t:module:B.C", "DefaultValue": null, "Kind": 0 } @@ -185,24 +199,25 @@ "ReturnType": null } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": 965872103, "Name": "__init__", + "QualifiedName": "module:B.C.__init__", "IndexSpan": { "Start": 101, "Length": 8 } }, { - "Documentation": null, "Overloads": [ { "Parameters": [ { "Name": "self", - "Type": "t:module:C", + "Type": "t:module:B.C", "DefaultValue": null, "Kind": 0 } @@ -210,11 +225,13 @@ "ReturnType": null } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": -1909501045, "Name": "methodC", + "QualifiedName": "module:B.C.methodC", "IndexSpan": { "Start": 148, "Length": 7 @@ -223,18 +240,23 @@ ], "Properties": [], "Fields": [], - "GenericParameters": null, - "InnerClasses": [], + "Classes": [], + "GenericBaseParameters": [], + "GenericParameterValues": [], "Id": 780, "Name": "C", + "QualifiedName": "module:B.C", "IndexSpan": { "Start": 85, "Length": 1 } } ], + "GenericBaseParameters": [], + "GenericParameterValues": [], "Id": 779, "Name": "B", + "QualifiedName": "module:B", "IndexSpan": { "Start": 57, "Length": 1 @@ -242,6 +264,7 @@ } ], "TypeVars": [], + "NamedTuples": [], "NewLines": [ { "EndIndex": 2, @@ -331,5 +354,6 @@ "FileSize": 288, "Id": -2131035837, "Name": "module", + "QualifiedName": null, "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/NestedClasses.json b/src/Caching/Test/Files/NestedClasses.json index a74431141..bfe0b4731 100644 --- a/src/Caching/Test/Files/NestedClasses.json +++ b/src/Caching/Test/Files/NestedClasses.json @@ -7,6 +7,7 @@ "Value": "t:bool", "Id": -529376420, "Name": "__debug__", + "QualifiedName": "__debug__", "IndexSpan": { "Start": 0, "Length": 0 @@ -16,6 +17,7 @@ "Value": "t:str", "Id": -1636005055, "Name": "__doc__", + "QualifiedName": "__doc__", "IndexSpan": { "Start": 0, "Length": 0 @@ -25,6 +27,7 @@ "Value": "t:str", "Id": 875442003, "Name": "__file__", + "QualifiedName": "__file__", "IndexSpan": { "Start": 0, "Length": 0 @@ -34,6 +37,7 @@ "Value": "t:str", "Id": 1097116834, "Name": "__name__", + "QualifiedName": "__name__", "IndexSpan": { "Start": 0, "Length": 0 @@ -43,6 +47,7 @@ "Value": "t:str", "Id": 75395663, "Name": "__package__", + "QualifiedName": "__package__", "IndexSpan": { "Start": 0, "Length": 0 @@ -52,6 +57,7 @@ "Value": "t:list", "Id": 1154586556, "Name": "__path__", + "QualifiedName": "__path__", "IndexSpan": { "Start": 0, "Length": 0 @@ -61,6 +67,7 @@ "Value": "t:dict", "Id": 817929997, "Name": "__dict__", + "QualifiedName": "__dict__", "IndexSpan": { "Start": 0, "Length": 0 @@ -70,15 +77,17 @@ "Value": "i:str", "Id": 833, "Name": "x", + "QualifiedName": "x", "IndexSpan": { "Start": 2, "Length": 1 } }, { - "Value": "i:module:C", + "Value": "i:module:B.C", "Id": 812, "Name": "c", + "QualifiedName": "c", "IndexSpan": { "Start": 333, "Length": 1 @@ -91,9 +100,9 @@ "Bases": [ "t:object" ], + "NamedTupleBases": [], "Methods": [ { - "Documentation": null, "Overloads": [ { "Parameters": [ @@ -107,11 +116,13 @@ "ReturnType": "i:bool" } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": -1909501047, "Name": "methodA", + "QualifiedName": "module:A.methodA", "IndexSpan": { "Start": 33, "Length": 7 @@ -120,10 +131,12 @@ ], "Properties": [], "Fields": [], - "GenericParameters": null, - "InnerClasses": [], + "Classes": [], + "GenericBaseParameters": [], + "GenericParameterValues": [], "Id": 778, "Name": "A", + "QualifiedName": "module:A", "IndexSpan": { "Start": 21, "Length": 1 @@ -134,9 +147,9 @@ "Bases": [ "t:object" ], + "NamedTupleBases": [], "Methods": [ { - "Documentation": null, "Overloads": [ { "Parameters": [ @@ -147,21 +160,22 @@ "Kind": 0 } ], - "ReturnType": "i:module:C" + "ReturnType": "i:module:B.C" } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": 935009767, "Name": "methodB1", + "QualifiedName": "module:B.methodB1", "IndexSpan": { "Start": 235, "Length": 8 } }, { - "Documentation": null, "Overloads": [ { "Parameters": [ @@ -175,11 +189,13 @@ "ReturnType": "i:int" } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": 935009768, "Name": "methodB2", + "QualifiedName": "module:B.methodB2", "IndexSpan": { "Start": 287, "Length": 8 @@ -192,25 +208,25 @@ "Value": "i:int", "Id": 833, "Name": "x", + "QualifiedName": "x", "IndexSpan": null } ], - "GenericParameters": null, - "InnerClasses": [ + "Classes": [ { "Documentation": null, "Bases": [ "t:object" ], + "NamedTupleBases": [], "Methods": [ { - "Documentation": null, "Overloads": [ { "Parameters": [ { "Name": "self", - "Type": "t:module:C", + "Type": "t:module:B.C", "DefaultValue": null, "Kind": 0 } @@ -218,24 +234,25 @@ "ReturnType": null } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": 965872103, "Name": "__init__", + "QualifiedName": "module:B.C.__init__", "IndexSpan": { "Start": 122, "Length": 8 } }, { - "Documentation": null, "Overloads": [ { "Parameters": [ { "Name": "self", - "Type": "t:module:C", + "Type": "t:module:B.C", "DefaultValue": null, "Kind": 0 } @@ -243,11 +260,13 @@ "ReturnType": "i:bool" } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": -1909501045, "Name": "methodC", + "QualifiedName": "module:B.C.methodC", "IndexSpan": { "Start": 175, "Length": 7 @@ -260,21 +279,27 @@ "Value": "i:int", "Id": 834, "Name": "y", + "QualifiedName": "y", "IndexSpan": null } ], - "GenericParameters": null, - "InnerClasses": [], + "Classes": [], + "GenericBaseParameters": [], + "GenericParameterValues": [], "Id": 780, "Name": "C", + "QualifiedName": "module:B.C", "IndexSpan": { "Start": 106, "Length": 1 } } ], + "GenericBaseParameters": [], + "GenericParameterValues": [], "Id": 779, "Name": "B", + "QualifiedName": "module:B", "IndexSpan": { "Start": 78, "Length": 1 @@ -282,6 +307,7 @@ } ], "TypeVars": [], + "NamedTuples": [], "NewLines": [ { "EndIndex": 2, @@ -379,5 +405,6 @@ "FileSize": 353, "Id": -2131035837, "Name": "module", + "QualifiedName": null, "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/SmokeTest.json b/src/Caching/Test/Files/SmokeTest.json index 00b940866..0f8ebe708 100644 --- a/src/Caching/Test/Files/SmokeTest.json +++ b/src/Caching/Test/Files/SmokeTest.json @@ -3,18 +3,19 @@ "Documentation": "", "Functions": [ { - "Documentation": null, "Overloads": [ { "Parameters": [], "ReturnType": "i:float" } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": 24395611, "Name": "func", + "QualifiedName": "module:func", "IndexSpan": { "Start": 207, "Length": 4 @@ -26,6 +27,7 @@ "Value": "t:bool", "Id": -529376420, "Name": "__debug__", + "QualifiedName": "__debug__", "IndexSpan": { "Start": 0, "Length": 0 @@ -35,6 +37,7 @@ "Value": "t:str", "Id": -1636005055, "Name": "__doc__", + "QualifiedName": "__doc__", "IndexSpan": { "Start": 0, "Length": 0 @@ -44,6 +47,7 @@ "Value": "t:str", "Id": 875442003, "Name": "__file__", + "QualifiedName": "__file__", "IndexSpan": { "Start": 0, "Length": 0 @@ -53,6 +57,7 @@ "Value": "t:str", "Id": 1097116834, "Name": "__name__", + "QualifiedName": "__name__", "IndexSpan": { "Start": 0, "Length": 0 @@ -62,6 +67,7 @@ "Value": "t:str", "Id": 75395663, "Name": "__package__", + "QualifiedName": "__package__", "IndexSpan": { "Start": 0, "Length": 0 @@ -71,6 +77,7 @@ "Value": "t:list", "Id": 1154586556, "Name": "__path__", + "QualifiedName": "__path__", "IndexSpan": { "Start": 0, "Length": 0 @@ -80,6 +87,7 @@ "Value": "t:dict", "Id": 817929997, "Name": "__dict__", + "QualifiedName": "__dict__", "IndexSpan": { "Start": 0, "Length": 0 @@ -89,6 +97,7 @@ "Value": "i:str", "Id": 833, "Name": "x", + "QualifiedName": "x", "IndexSpan": { "Start": 2, "Length": 1 @@ -98,6 +107,7 @@ "Value": "i:module:C", "Id": 812, "Name": "c", + "QualifiedName": "c", "IndexSpan": { "Start": 234, "Length": 1 @@ -110,9 +120,9 @@ "Bases": [ "t:object" ], + "NamedTupleBases": [], "Methods": [ { - "Documentation": null, "Overloads": [ { "Parameters": [ @@ -126,18 +136,19 @@ "ReturnType": null } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": 965872103, "Name": "__init__", + "QualifiedName": "module:C.__init__", "IndexSpan": { "Start": 45, "Length": 8 } }, { - "Documentation": null, "Overloads": [ { "Parameters": [ @@ -151,11 +162,13 @@ "ReturnType": "i:float" } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": -2139806792, "Name": "method", + "QualifiedName": "module:C.method", "IndexSpan": { "Start": 100, "Length": 6 @@ -164,11 +177,14 @@ ], "Properties": [ { - "Documentation": "", "ReturnType": "i:int", + "Documentation": "", "Attributes": 0, + "Classes": [], + "Functions": [], "Id": 24690682, "Name": "prop", + "QualifiedName": "module:C.prop", "IndexSpan": { "Start": 163, "Length": 4 @@ -180,19 +196,23 @@ "Value": "i:int", "Id": 833, "Name": "x", + "QualifiedName": "x", "IndexSpan": null }, { "Value": "i:int", "Id": 834, "Name": "y", + "QualifiedName": "y", "IndexSpan": null } ], - "GenericParameters": null, - "InnerClasses": [], + "Classes": [], + "GenericBaseParameters": [], + "GenericParameterValues": [], "Id": 780, "Name": "C", + "QualifiedName": "module:C", "IndexSpan": { "Start": 21, "Length": 1 @@ -200,6 +220,7 @@ } ], "TypeVars": [], + "NamedTuples": [], "NewLines": [ { "EndIndex": 2, @@ -281,5 +302,6 @@ "FileSize": 243, "Id": -2131035837, "Name": "module", + "QualifiedName": null, "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/VersionHandling2.json b/src/Caching/Test/Files/VersionHandling2.json index 74643926a..f7b1ca27c 100644 --- a/src/Caching/Test/Files/VersionHandling2.json +++ b/src/Caching/Test/Files/VersionHandling2.json @@ -3,7 +3,6 @@ "Documentation": "", "Functions": [ { - "Documentation": null, "Overloads": [ { "Parameters": [ @@ -17,11 +16,13 @@ "ReturnType": null } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": 24395611, "Name": "func", + "QualifiedName": "module:func", "IndexSpan": { "Start": 77, "Length": 4 @@ -33,6 +34,7 @@ "Value": "t:bool", "Id": -529376420, "Name": "__debug__", + "QualifiedName": "__debug__", "IndexSpan": { "Start": 0, "Length": 0 @@ -42,6 +44,7 @@ "Value": "t:str", "Id": -1636005055, "Name": "__doc__", + "QualifiedName": "__doc__", "IndexSpan": { "Start": 0, "Length": 0 @@ -51,6 +54,7 @@ "Value": "t:str", "Id": 875442003, "Name": "__file__", + "QualifiedName": "__file__", "IndexSpan": { "Start": 0, "Length": 0 @@ -60,6 +64,7 @@ "Value": "t:str", "Id": 1097116834, "Name": "__name__", + "QualifiedName": "__name__", "IndexSpan": { "Start": 0, "Length": 0 @@ -69,6 +74,7 @@ "Value": "t:str", "Id": 75395663, "Name": "__package__", + "QualifiedName": "__package__", "IndexSpan": { "Start": 0, "Length": 0 @@ -78,6 +84,7 @@ "Value": "t:list", "Id": 1154586556, "Name": "__path__", + "QualifiedName": "__path__", "IndexSpan": { "Start": 0, "Length": 0 @@ -87,6 +94,7 @@ "Value": "t:dict", "Id": 817929997, "Name": "__dict__", + "QualifiedName": "__dict__", "IndexSpan": { "Start": 0, "Length": 0 @@ -95,6 +103,7 @@ ], "Classes": [], "TypeVars": [], + "NamedTuples": [], "NewLines": [ { "EndIndex": 2, @@ -120,5 +129,6 @@ "FileSize": 91, "Id": -2131035837, "Name": "module", + "QualifiedName": null, "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/VersionHandling3.json b/src/Caching/Test/Files/VersionHandling3.json index 707ef1020..af4e9c068 100644 --- a/src/Caching/Test/Files/VersionHandling3.json +++ b/src/Caching/Test/Files/VersionHandling3.json @@ -3,7 +3,6 @@ "Documentation": "", "Functions": [ { - "Documentation": null, "Overloads": [ { "Parameters": [ @@ -29,11 +28,13 @@ "ReturnType": null } ], + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], "Id": 24395611, "Name": "func", + "QualifiedName": "module:func", "IndexSpan": { "Start": 42, "Length": 4 @@ -45,6 +46,7 @@ "Value": "t:bool", "Id": -529376420, "Name": "__debug__", + "QualifiedName": "__debug__", "IndexSpan": { "Start": 0, "Length": 0 @@ -54,6 +56,7 @@ "Value": "t:str", "Id": -1636005055, "Name": "__doc__", + "QualifiedName": "__doc__", "IndexSpan": { "Start": 0, "Length": 0 @@ -63,6 +66,7 @@ "Value": "t:str", "Id": 875442003, "Name": "__file__", + "QualifiedName": "__file__", "IndexSpan": { "Start": 0, "Length": 0 @@ -72,6 +76,7 @@ "Value": "t:str", "Id": 1097116834, "Name": "__name__", + "QualifiedName": "__name__", "IndexSpan": { "Start": 0, "Length": 0 @@ -81,6 +86,7 @@ "Value": "t:str", "Id": 75395663, "Name": "__package__", + "QualifiedName": "__package__", "IndexSpan": { "Start": 0, "Length": 0 @@ -90,6 +96,7 @@ "Value": "t:list", "Id": 1154586556, "Name": "__path__", + "QualifiedName": "__path__", "IndexSpan": { "Start": 0, "Length": 0 @@ -99,6 +106,7 @@ "Value": "t:dict", "Id": 817929997, "Name": "__dict__", + "QualifiedName": "__dict__", "IndexSpan": { "Start": 0, "Length": 0 @@ -107,6 +115,7 @@ ], "Classes": [], "TypeVars": [], + "NamedTuples": [], "NewLines": [ { "EndIndex": 2, @@ -132,5 +141,6 @@ "FileSize": 91, "Id": -2131035837, "Name": "module", + "QualifiedName": null, "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/LibraryModulesTests.cs b/src/Caching/Test/LibraryModulesTests.cs index cbe98895d..9f9b710ff 100644 --- a/src/Caching/Test/LibraryModulesTests.cs +++ b/src/Caching/Test/LibraryModulesTests.cs @@ -78,7 +78,6 @@ public async Task Builtins() { public Task Crypt() => TestModule("crypt"); [TestMethod, Priority(0)] - [Ignore("_DRMapping type issue. Consider merge of module to stub so OrderedDict resolves to generic from the collections stub.")] public Task Csv() => TestModule("csv"); [TestMethod, Priority(0)] @@ -121,7 +120,6 @@ public async Task Builtins() { public Task Ftplib() => TestModule("ftplib"); [TestMethod, Priority(0)] - [Ignore] public Task Functools() => TestModule("functools"); [TestMethod, Priority(0)] @@ -191,7 +189,7 @@ public async Task Builtins() { public Task Pkgutil() => TestModule("pkgutil"); [TestMethod, Priority(0)] - [Ignore("Specialize Enum. See PlistFormat = enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__)")] + [Ignore("https://github.com/microsoft/python-language-server/issues/1434")] public Task Plistlib() => TestModule("plistlib"); [TestMethod, Priority(0)] diff --git a/src/LanguageServer/Test/GoToDefinitionTests.cs b/src/LanguageServer/Test/GoToDefinitionTests.cs index 35ddf0619..441bcc895 100644 --- a/src/LanguageServer/Test/GoToDefinitionTests.cs +++ b/src/LanguageServer/Test/GoToDefinitionTests.cs @@ -464,5 +464,25 @@ def foo(self): reference.range.Should().Be(2, 8, 2, 16); reference.uri.AbsolutePath.Should().Contain("bar.py"); } + + [TestMethod, Priority(0)] + public async Task NamedTuple() { + const string code = @" +from typing import NamedTuple + +Point = NamedTuple('Point', ['x', 'y']) + +def f(a, b): + return Point(a, b) + +pt = Point(1, 2) +"; + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + var ds = new DefinitionSource(Services); + + var reference = ds.FindDefinition(analysis, new SourceLocation(7, 14), out _); + reference.Should().NotBeNull(); + reference.range.Should().Be(3, 0, 3, 5); + } } } From a82c356e2071ec688078ba49c0a9c1d8969fa893 Mon Sep 17 00:00:00 2001 From: Alexander Sher Date: Thu, 22 Aug 2019 16:24:53 -0500 Subject: [PATCH 13/60] - Fix #1455: AF: Library module of type Stub has been analyzed already! (#1470) - Restore task handling in unit tests - Throw exception from Debug.Fail instead of FailFast --- .../Ast/Impl/Analyzer/AnalysisModuleKey.cs | 35 +- .../Ast/Impl/Analyzer/PythonAnalyzer.cs | 14 +- .../Ast/Impl/Analyzer/PythonAnalyzerEntry.cs | 2 +- .../Impl/Analyzer/PythonAnalyzerSession.cs | 8 +- .../Analyzer/Symbols/FunctionEvaluator.cs | 1 + .../FunctionDefinitionExtensions.cs | 17 +- .../Impl/Extensions/PythonModuleExtensions.cs | 3 + .../Impl/Extensions/PythonTypeExtensions.cs | 4 + .../Impl/Modules/Definitions/ModuleType.cs | 5 + src/Caching/Impl/ModuleUniqueId.cs | 3 +- src/Core/Impl/Extensions/TaskExtensions.cs | 8 +- src/Core/Test/TestLogger.cs | 1 - .../Core/Impl/Ben.Demystifier/ILReader.cs | 108 --- .../StringBuilderExtensions.cs | 811 ------------------ .../Impl/Ben.Demystifier/TypeNameHelper.cs | 147 ---- .../Core/Impl/Ben.Demystifier/readme.txt | 1 - src/UnitTests/Core/Impl/TaskObserver.cs | 84 +- .../Core/Impl/TestEnvironmentImpl.cs | 33 +- src/UnitTests/Core/Impl/UnitTests.Core.csproj | 1 + 19 files changed, 138 insertions(+), 1148 deletions(-) delete mode 100644 src/UnitTests/Core/Impl/Ben.Demystifier/ILReader.cs delete mode 100644 src/UnitTests/Core/Impl/Ben.Demystifier/StringBuilderExtensions.cs delete mode 100644 src/UnitTests/Core/Impl/Ben.Demystifier/TypeNameHelper.cs delete mode 100644 src/UnitTests/Core/Impl/Ben.Demystifier/readme.txt diff --git a/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs b/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs index 944c6a9e9..489ad4d72 100644 --- a/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs +++ b/src/Analysis/Ast/Impl/Analyzer/AnalysisModuleKey.cs @@ -23,48 +23,41 @@ namespace Microsoft.Python.Analysis.Analyzer { [DebuggerDisplay("{Name} : {FilePath}")] internal readonly struct AnalysisModuleKey : IEquatable { - private enum KeyType { Default, Typeshed, LibraryAsDocument } - - private readonly KeyType _type; public string Name { get; } public string FilePath { get; } - public bool IsTypeshed => _type == KeyType.Typeshed; - public bool IsLibraryAsDocument => _type == KeyType.LibraryAsDocument; + public bool IsTypeshed { get; } + public bool IsNonUserAsDocument { get; } public AnalysisModuleKey(IPythonModule module) { Name = module.Name; FilePath = module.ModuleType == ModuleType.CompiledBuiltin ? null : module.FilePath; - _type = module is StubPythonModule stub && stub.IsTypeshed - ? KeyType.Typeshed - : module.ModuleType == ModuleType.Library && module is IDocument document && document.IsOpen - ? KeyType.LibraryAsDocument - : KeyType.Default; + IsTypeshed = module is StubPythonModule stub && stub.IsTypeshed; + IsNonUserAsDocument = (module.IsNonUserFile() || module.IsCompiled()) && module is IDocument document && document.IsOpen; } - public AnalysisModuleKey(string name, string filePath, bool isTypeshed) { - Name = name; - FilePath = filePath; - _type = isTypeshed ? KeyType.Typeshed : KeyType.Default; - } + public AnalysisModuleKey(string name, string filePath, bool isTypeshed) + : this(name, filePath, isTypeshed, false) { } - private AnalysisModuleKey(string name, string filePath, KeyType type) { + private AnalysisModuleKey(string name, string filePath, bool isTypeshed, bool isNonUserAsDocument) { Name = name; FilePath = filePath; - _type = type; + IsTypeshed = isTypeshed; + IsNonUserAsDocument = isNonUserAsDocument; } - public AnalysisModuleKey GetLibraryAsDocumentKey() => new AnalysisModuleKey(Name, FilePath, KeyType.LibraryAsDocument); + public AnalysisModuleKey GetNonUserAsDocumentKey() => new AnalysisModuleKey(Name, FilePath, IsTypeshed, true); public bool Equals(AnalysisModuleKey other) - => Name.EqualsOrdinal(other.Name) && FilePath.PathEquals(other.FilePath) && _type == other._type; + => Name.EqualsOrdinal(other.Name) && FilePath.PathEquals(other.FilePath) && IsTypeshed == other.IsTypeshed && IsNonUserAsDocument == other.IsNonUserAsDocument; public override bool Equals(object obj) => obj is AnalysisModuleKey other && Equals(other); public override int GetHashCode() { unchecked { - var hashCode = (Name != null ? Name.GetHashCode() : 0); + var hashCode = Name != null ? Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (FilePath != null ? FilePath.GetPathHashCode() : 0); - hashCode = (hashCode * 397) ^ _type.GetHashCode(); + hashCode = (hashCode * 397) ^ IsTypeshed.GetHashCode(); + hashCode = (hashCode * 397) ^ IsNonUserAsDocument.GetHashCode(); return hashCode; } } diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs index 7bae2ca29..bc9203727 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs @@ -17,6 +17,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis.Caching; @@ -166,9 +167,9 @@ public void EnqueueDocumentForAnalysis(IPythonModule module, PythonAst ast, int // It is possible that parsing request for the library has been started when document is open, // but it is closed at the moment of analysis and then become open again. // In this case, we still need to analyze the document, but using correct entry. - var libraryAsDocumentKey = key.GetLibraryAsDocumentKey(); - if (entry.PreviousAnalysis is LibraryAnalysis && _analysisEntries.TryGetValue(libraryAsDocumentKey, out var documentEntry)) { - key = libraryAsDocumentKey; + var nonUserAsDocumentKey = key.GetNonUserAsDocumentKey(); + if (entry.PreviousAnalysis is LibraryAnalysis && _analysisEntries.TryGetValue(nonUserAsDocumentKey, out var documentEntry)) { + key = nonUserAsDocumentKey; entry = documentEntry; } @@ -239,7 +240,7 @@ private void AnalyzeDocument(in AnalysisModuleKey key, in PythonAnalyzerEntry en ActivityTracker.StartTracking(); _log?.Log(TraceEventType.Verbose, $"Analysis of {entry.Module.Name}({entry.Module.ModuleType}) queued"); - var graphVersion = _dependencyResolver.ChangeValue(key, entry, entry.IsUserOrBuiltin || key.IsLibraryAsDocument, dependencies); + var graphVersion = _dependencyResolver.ChangeValue(key, entry, entry.IsUserOrBuiltin || key.IsNonUserAsDocument, dependencies); lock (_syncObj) { if (_version > graphVersion) { @@ -301,6 +302,11 @@ private bool TryCreateSession(in int graphVersion, in PythonAnalyzerEntry entry, } private void StartNextSession(Task task) { + if (task.IsFaulted && task.Exception != null) { + var exception = task.Exception.InnerException; + ExceptionDispatchInfo.Capture(exception).Throw(); + } + PythonAnalyzerSession session; lock (_syncObj) { if (_nextSession == null) { diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs index c09dbdfad..b69b2d446 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs @@ -113,7 +113,7 @@ public bool IsValidVersion(int version, out IPythonModule module, out PythonAst } if (ast == null) { - Debug.Assert(!(_previousAnalysis is LibraryAnalysis), $"Library module {module.Name} of type {module.ModuleType} has been analyzed already!"); + Debug.Assert(!(_analysisVersion <= version && _previousAnalysis is LibraryAnalysis), $"Library module {module.Name} of type {module.ModuleType} has been analyzed already!"); return false; } diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index 71ae97c95..712f49bb1 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -17,6 +17,7 @@ using System.Diagnostics; using System.Linq; using System.Runtime; +using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis.Analyzer.Evaluation; @@ -29,6 +30,7 @@ using Microsoft.Python.Core; using Microsoft.Python.Core.Logging; using Microsoft.Python.Core.Services; +using Microsoft.Python.Core.Testing; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Analyzer { @@ -210,6 +212,7 @@ private async Task AnalyzeAffectedEntriesAsync(Stopwatch stopWatch) { if (Interlocked.Increment(ref _runningTasks) >= _maxTaskRunning || _walker.Remaining == 1) { RunAnalysis(node, stopWatch); } else { + ace.AddOne(); StartAnalysis(node, ace, stopWatch).DoNotWait(); } } @@ -250,7 +253,6 @@ private Task StartAnalysis(IDependencyChainNode node, Async /// private void Analyze(IDependencyChainNode node, AsyncCountdownEvent ace, Stopwatch stopWatch) { try { - ace?.AddOne(); var entry = node.Value; if (!entry.IsValidVersion(_walker.Version, out var module, out var ast)) { @@ -372,6 +374,10 @@ private void LogException(IPythonModule module, Exception exception) { if (_log != null) { _log.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) failed. {exception}"); } + + if (TestEnvironment.Current != null) { + ExceptionDispatchInfo.Capture(exception).Throw(); + } } private IDocumentAnalysis CreateAnalysis(IDependencyChainNode node, IDocument document, PythonAst ast, int version, ModuleWalker walker, bool isCanceled) { diff --git a/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs b/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs index f0ea79c9f..f50d4f705 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Symbols/FunctionEvaluator.cs @@ -125,6 +125,7 @@ public override bool Walk(AssignmentStatement node) { public override bool Walk(ReturnStatement node) { var value = Eval.GetValueFromExpression(node.Expression); if (value != null) { + // although technically legal, __init__ in a constructor should not have a not-none return value if (_function.IsDunderInit() && !value.IsOfType(BuiltinTypeId.NoneType)) { Eval.ReportDiagnostics(Module.Uri, new DiagnosticsEntry( diff --git a/src/Analysis/Ast/Impl/Extensions/FunctionDefinitionExtensions.cs b/src/Analysis/Ast/Impl/Extensions/FunctionDefinitionExtensions.cs index 6cf42b965..bc9017442 100644 --- a/src/Analysis/Ast/Impl/Extensions/FunctionDefinitionExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/FunctionDefinitionExtensions.cs @@ -1,4 +1,19 @@ -using Microsoft.Python.Analysis.Types; +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using Microsoft.Python.Analysis.Types; namespace Microsoft.Python.Analysis { public static class ClassMemberExtensions { diff --git a/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs index df277f34f..caa2b5b34 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonModuleExtensions.cs @@ -67,5 +67,8 @@ internal static string GetComment(this IPythonModule module, int lineNum) { return line.Substring(commentPos + 1).Trim('\t', ' '); } + + internal static bool IsNonUserFile(this IPythonModule module) => module.ModuleType.IsNonUserFile(); + internal static bool IsCompiled(this IPythonModule module) => module.ModuleType.IsCompiled(); } } diff --git a/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs index 1075dc642..e94bf3161 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs @@ -27,5 +27,9 @@ public static bool IsGenericParameter(this IPythonType value) public static bool IsGeneric(this IPythonType value) => value is IGenericTypeParameter || (value is IGenericType gt && gt.IsGeneric); + + public static string GetQualifiedName(this IPythonType t) => $"{t.DeclaringModule.Name}:{t.Name}"; + + internal static IPythonType ToBound(this IPythonType t) => t is PythonFunctionType.PythonUnboundMethod m ? m.Function : t; } } diff --git a/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs b/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs index 64ab06683..a18205271 100644 --- a/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs +++ b/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs @@ -60,4 +60,9 @@ public enum ModuleType { /// Specialized } + + public static class ModuleTypeExtensions { + public static bool IsNonUserFile(this ModuleType type) => type == ModuleType.Library || type == ModuleType.Stub; + public static bool IsCompiled(this ModuleType type) => type == ModuleType.Compiled || type == ModuleType.CompiledBuiltin; + } } diff --git a/src/Caching/Impl/ModuleUniqueId.cs b/src/Caching/Impl/ModuleUniqueId.cs index 744195d3e..51762ecfe 100644 --- a/src/Caching/Impl/ModuleUniqueId.cs +++ b/src/Caching/Impl/ModuleUniqueId.cs @@ -78,8 +78,7 @@ public static string GetUniqueId(string moduleName, string filePath, ModuleType } var config = interpreter.Configuration; - if (moduleType == ModuleType.Builtins || moduleType == ModuleType.CompiledBuiltin || - string.IsNullOrEmpty(filePath) || modulePathType == PythonLibraryPathType.StdLib) { + if (moduleType.IsCompiled() || string.IsNullOrEmpty(filePath) || modulePathType == PythonLibraryPathType.StdLib) { // If module is a standard library, unique id is its name + interpreter version. return $"{moduleName}({config.Version.Major}.{config.Version.Minor})"; } diff --git a/src/Core/Impl/Extensions/TaskExtensions.cs b/src/Core/Impl/Extensions/TaskExtensions.cs index d824dfed6..76643bb4f 100644 --- a/src/Core/Impl/Extensions/TaskExtensions.cs +++ b/src/Core/Impl/Extensions/TaskExtensions.cs @@ -17,7 +17,7 @@ using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; -using Microsoft.Python.Core.Threading; +using Microsoft.Python.Core.Testing; namespace Microsoft.Python.Core { public static class TaskExtensions { @@ -52,6 +52,12 @@ private static void SetCompletionResultToContinuation(Task task, object st /// is always ignored. /// public static void DoNotWait(this Task task) { + if (TestEnvironment.Current != null && TestEnvironment.Current.TryAddTaskToWait(task)) { + if (!task.IsCompleted) { + return; + } + } + if (task.IsCompleted) { ReThrowTaskException(task); return; diff --git a/src/Core/Test/TestLogger.cs b/src/Core/Test/TestLogger.cs index 4f633e2d2..8270c5f15 100644 --- a/src/Core/Test/TestLogger.cs +++ b/src/Core/Test/TestLogger.cs @@ -37,7 +37,6 @@ public void Dispose() { public TraceEventType LogLevel { get; set; } = TraceEventType.Verbose; public void Log(TraceEventType eventType, IFormattable message) => Log(eventType, message.ToString()); public void Log(TraceEventType eventType, string message) { - var m = $"[{TestEnvironmentImpl.Elapsed()}]: {message}"; switch (eventType) { case TraceEventType.Error: diff --git a/src/UnitTests/Core/Impl/Ben.Demystifier/ILReader.cs b/src/UnitTests/Core/Impl/Ben.Demystifier/ILReader.cs deleted file mode 100644 index 2a75c8e32..000000000 --- a/src/UnitTests/Core/Impl/Ben.Demystifier/ILReader.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Ben A Adams. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// -// Python Tools for Visual Studio -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System; -using System.Reflection; -using System.Reflection.Emit; - -namespace TestUtilities.Ben.Demystifier { - internal sealed class ILReader { - private static readonly OpCode[] singleByteOpCode; - private static readonly OpCode[] doubleByteOpCode; - - private readonly byte[] _cil; - private int _ptr; - - public ILReader(byte[] cil) => _cil = cil; - - public OpCode OpCode { get; private set; } - public int MetadataToken { get; private set; } - public MemberInfo Operand { get; private set; } - - public bool Read(MethodBase methodInfo) { - if (_ptr < _cil.Length) { - OpCode = ReadOpCode(); - Operand = ReadOperand(OpCode, methodInfo); - return true; - } - return false; - } - - private OpCode ReadOpCode() { - var instruction = ReadByte(); - return instruction < 254 ? singleByteOpCode[instruction] : doubleByteOpCode[ReadByte()]; - } - - private MemberInfo ReadOperand(OpCode code, MethodBase methodInfo) { - MetadataToken = 0; - switch (code.OperandType) { - case OperandType.InlineMethod: - MetadataToken = ReadInt(); - Type[] methodArgs = null; - if (methodInfo.GetType() != typeof(ConstructorInfo) && !methodInfo.GetType().IsSubclassOf(typeof(ConstructorInfo))) { - methodArgs = methodInfo.GetGenericArguments(); - } - - Type[] typeArgs = null; - if (methodInfo.DeclaringType != null) { - typeArgs = methodInfo.DeclaringType.GetGenericArguments(); - } - - try { - return methodInfo.Module.ResolveMember(MetadataToken, typeArgs, methodArgs); - } catch { - // Can return System.ArgumentException : Token xxx is not a valid MemberInfo token in the scope of module xxx.dll - return null; - } - default: - return null; - } - } - - private byte ReadByte() => _cil[_ptr++]; - - private int ReadInt() { - var b1 = ReadByte(); - var b2 = ReadByte(); - var b3 = ReadByte(); - var b4 = ReadByte(); - return b1 | b2 << 8 | b3 << 16 | b4 << 24; - } - - static ILReader(){ - singleByteOpCode = new OpCode[225]; - doubleByteOpCode = new OpCode[31]; - - var fields = GetOpCodeFields(); - - foreach (var field in fields) { - var code = (OpCode)field.GetValue(null); - if (code.OpCodeType == OpCodeType.Nternal) - continue; - - if (code.Size == 1) - singleByteOpCode[code.Value] = code; - else - doubleByteOpCode[code.Value & 0xff] = code; - } - } - - private static FieldInfo[] GetOpCodeFields() => typeof(OpCodes).GetFields(BindingFlags.Public | BindingFlags.Static); - } -} diff --git a/src/UnitTests/Core/Impl/Ben.Demystifier/StringBuilderExtensions.cs b/src/UnitTests/Core/Impl/Ben.Demystifier/StringBuilderExtensions.cs deleted file mode 100644 index f2cfa0105..000000000 --- a/src/UnitTests/Core/Impl/Ben.Demystifier/StringBuilderExtensions.cs +++ /dev/null @@ -1,811 +0,0 @@ -// Copyright (c) Ben A Adams. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// -// Python Tools for Visual Studio -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.ExceptionServices; -using System.Security; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace TestUtilities.Ben.Demystifier { - public static class StringBuilderExtensions { - public static StringBuilder AppendException(this StringBuilder stringBuilder, Exception exception) { - stringBuilder.Append(exception.Message); - - if (exception.InnerException != null) { - stringBuilder - .Append(" ---> ") - .AppendException(exception.InnerException) - .AppendLine() - .Append(" --- End of inner exception stack trace ---"); - } - - var frames = new StackTrace(exception, true).GetFrames(); - if (frames != null && frames.Length > 0) { - stringBuilder.AppendLine().AppendFrames(frames); - } - - return stringBuilder; - } - - public static StringBuilder AppendFrames(this StringBuilder stringBuilder, StackFrame[] frames) { - if (frames == null || frames.Length == 0) { - return stringBuilder; - } - - for (var i = 0; i < frames.Length; i++) { - var frame = frames[i]; - var method = frame.GetMethod(); - - // Always show last stackFrame - if (!ShowInStackTrace(method) && i != frames.Length - 1) { - continue; - } - - if (i > 0) { - stringBuilder.AppendLine(); - } - - stringBuilder - .Append(" at ") - .AppendMethod(GetMethodDisplay(method)); - - var filePath = frame.GetFileName(); - if (!string.IsNullOrEmpty(filePath) && Uri.TryCreate(filePath, UriKind.Absolute, out var uri)) { - try { - filePath = uri.IsFile ? Path.GetFullPath(filePath) : uri.ToString(); - stringBuilder.Append(" in ").Append(filePath); - } catch (PathTooLongException) { } catch (SecurityException) { } - } - - var lineNo = frame.GetFileLineNumber(); - if (lineNo != 0) { - stringBuilder.Append(":line "); - stringBuilder.Append(lineNo); - } - } - - return stringBuilder; - } - - private static void AppendMethod(this StringBuilder builder, ResolvedMethod method) { - if (method.IsAsync) { - builder.Append("async "); - } - - if (method.ReturnParameter.Type != null) { - builder - .AppendParameter(method.ReturnParameter) - .Append(" "); - } - - var isSubMethodOrLambda = !string.IsNullOrEmpty(method.SubMethod) || method.IsLambda; - - builder - .AppendMethodName(method.Name, method.DeclaringTypeName, isSubMethodOrLambda) - .Append(method.GenericArguments) - .AppendParameters(method.Parameters, method.MethodBase != null); - - if (isSubMethodOrLambda) { - builder - .Append("+") - .Append(method.SubMethod) - .AppendParameters(method.SubMethodParameters, method.SubMethodBase != null); - - if (method.IsLambda) { - builder.Append(" => { }"); - - if (method.Ordinal.HasValue) { - builder.Append(" ["); - builder.Append(method.Ordinal); - builder.Append("]"); - } - } - } - } - - public static StringBuilder AppendMethodName(this StringBuilder stringBuilder, string name, string declaringTypeName, bool isSubMethodOrLambda) { - if (!string.IsNullOrEmpty(declaringTypeName)) { - if (name == ".ctor") { - if (!isSubMethodOrLambda) { - stringBuilder.Append("new "); - } - - stringBuilder.Append(declaringTypeName); - } else if (name == ".cctor") { - stringBuilder - .Append("static ") - .Append(declaringTypeName); - } else { - stringBuilder - .Append(declaringTypeName) - .Append(".") - .Append(name); - } - } else { - stringBuilder.Append(name); - } - - return stringBuilder; - } - - private static void AppendParameters(this StringBuilder stringBuilder, List parameters, bool condition) { - stringBuilder.Append("("); - if (parameters != null) { - if (condition) { - stringBuilder.AppendParameters(parameters); - } else { - stringBuilder.Append("?"); - } - } - stringBuilder.Append(")"); - } - - private static void AppendParameters(this StringBuilder stringBuilder, List parameters) { - var isFirst = true; - foreach (var param in parameters) { - if (isFirst) { - isFirst = false; - } else { - stringBuilder.Append(", "); - } - stringBuilder.AppendParameter(param); - } - } - - private static StringBuilder AppendParameter(this StringBuilder stringBuilder, ResolvedParameter parameter) { - if (!string.IsNullOrEmpty(parameter.Prefix)) { - stringBuilder.Append(parameter.Prefix).Append(" "); - } - - stringBuilder.Append(parameter.Type); - if (!string.IsNullOrEmpty(parameter.Name)) { - stringBuilder.Append(" ").Append(parameter.Name); - } - - return stringBuilder; - } - - private static bool ShowInStackTrace(MethodBase method) { - try { - var type = method.DeclaringType; - if (type == null) { - return true; - } - - if (type == typeof(Task<>) && method.Name == "InnerInvoke") { - return false; - } - - if (type == typeof(Task)) { - switch (method.Name) { - case "ExecuteWithThreadLocal": - case "Execute": - case "ExecutionContextCallback": - case "ExecuteEntry": - case "InnerInvoke": - return false; - } - } - - if (type == typeof(ExecutionContext)) { - switch (method.Name) { - case "RunInternal": - case "Run": - return false; - } - } - - // Don't show any methods marked with the StackTraceHiddenAttribute - // https://github.com/dotnet/coreclr/pull/14652 - foreach (var attibute in method.GetCustomAttributesData()) { - // internal Attribute, match on name - if (attibute.AttributeType.Name == "StackTraceHiddenAttribute") { - return false; - } - } - - foreach (var attibute in type.GetCustomAttributesData()) { - // internal Attribute, match on name - if (attibute.AttributeType.Name == "StackTraceHiddenAttribute") { - return false; - } - } - - // Fallbacks for runtime pre-StackTraceHiddenAttribute - if (type == typeof(ExceptionDispatchInfo) && method.Name == nameof(ExceptionDispatchInfo)) { - return false; - } - - if (type == typeof(TaskAwaiter) || - type == typeof(TaskAwaiter<>) || - type == typeof(ConfiguredTaskAwaitable.ConfiguredTaskAwaiter) || - type == typeof(ConfiguredTaskAwaitable<>.ConfiguredTaskAwaiter)) { - switch (method.Name) { - case "HandleNonSuccessAndDebuggerNotification": - case "ThrowForNonSuccess": - case "ValidateEnd": - case "GetResult": - return false; - } - } else if (type.FullName == "System.ThrowHelper") { - return false; - } - } catch { - // GetCustomAttributesData can throw - return true; - } - - return true; - } - - private static ResolvedMethod GetMethodDisplay(MethodBase originMethod) { - var methodDisplayInfo = new ResolvedMethod(); - - // Special case: no method available - if (originMethod == null) { - return methodDisplayInfo; - } - - var method = originMethod; - methodDisplayInfo.SubMethodBase = method; - - // Type name - var type = method.DeclaringType; - var subMethodName = method.Name; - var methodName = method.Name; - - if (type != null && type.IsDefined(typeof(CompilerGeneratedAttribute)) && - (typeof(IAsyncStateMachine).IsAssignableFrom(type) || typeof(IEnumerator).IsAssignableFrom(type))) { - - methodDisplayInfo.IsAsync = typeof(IAsyncStateMachine).IsAssignableFrom(type); - - // Convert StateMachine methods to correct overload +MoveNext() - if (!TryResolveStateMachineMethod(ref method, out type)) { - methodDisplayInfo.SubMethodBase = null; - subMethodName = null; - } - - methodName = method.Name; - } - - // Method name - methodDisplayInfo.MethodBase = method; - methodDisplayInfo.Name = methodName; - if (method.Name.IndexOf("<", StringComparison.Ordinal) >= 0) { - if (TryResolveGeneratedName(ref method, out type, out methodName, out subMethodName, out var kind, out var ordinal)) { - methodName = method.Name; - methodDisplayInfo.MethodBase = method; - methodDisplayInfo.Name = methodName; - methodDisplayInfo.Ordinal = ordinal; - } else { - methodDisplayInfo.MethodBase = null; - } - - methodDisplayInfo.IsLambda = (kind == GeneratedNameKind.LambdaMethod); - - if (methodDisplayInfo.IsLambda && type != null) { - if (methodName == ".cctor") { - var fields = type.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); - foreach (var field in fields) { - var value = field.GetValue(field); - if (value is Delegate d) { - if (ReferenceEquals(d.Method, originMethod) && d.Target.ToString() == originMethod.DeclaringType?.ToString()) { - methodDisplayInfo.Name = field.Name; - methodDisplayInfo.IsLambda = false; - method = originMethod; - break; - } - } - } - } - } - } - - if (subMethodName != methodName) { - methodDisplayInfo.SubMethod = subMethodName; - } - - // ResolveStateMachineMethod may have set declaringType to null - if (type != null) { - var declaringTypeName = TypeNameHelper.GetTypeDisplayName(type, fullName: true, includeGenericParameterNames: true); - methodDisplayInfo.DeclaringTypeName = declaringTypeName; - } - - if (method is MethodInfo mi) { - var returnParameter = mi.ReturnParameter; - if (returnParameter != null) { - methodDisplayInfo.ReturnParameter = GetParameter(mi.ReturnParameter); - } else { - methodDisplayInfo.ReturnParameter = new ResolvedParameter(string.Empty - , TypeNameHelper.GetTypeDisplayName(mi.ReturnType, fullName: false, includeGenericParameterNames: true) - , mi.ReturnType - , string.Empty); - } - } - - if (method.IsGenericMethod) { - var genericArguments = method.GetGenericArguments(); - var genericArgumentsString = string.Join(", ", genericArguments - .Select(arg => TypeNameHelper.GetTypeDisplayName(arg, fullName: false, includeGenericParameterNames: true))); - methodDisplayInfo.GenericArguments += "<" + genericArgumentsString + ">"; - methodDisplayInfo.ResolvedGenericArguments = genericArguments; - } - - // Method parameters - var parameters = method.GetParameters(); - if (parameters.Length > 0) { - var resolvedParameters = new List(parameters.Length); - for (var i = 0; i < parameters.Length; i++) { - resolvedParameters.Add(GetParameter(parameters[i])); - } - methodDisplayInfo.Parameters = resolvedParameters; - } - - if (methodDisplayInfo.SubMethodBase == methodDisplayInfo.MethodBase) { - methodDisplayInfo.SubMethodBase = null; - } else if (methodDisplayInfo.SubMethodBase != null) { - parameters = methodDisplayInfo.SubMethodBase.GetParameters(); - if (parameters.Length > 0) { - var parameterList = new List(parameters.Length); - foreach (var parameter in parameters) { - var param = GetParameter(parameter); - if (param.Name?.StartsWith("<") ?? true) { - continue; - } - - parameterList.Add(param); - } - - methodDisplayInfo.SubMethodParameters = parameterList; - } - } - - return methodDisplayInfo; - } - - private static bool TryResolveGeneratedName(ref MethodBase method - , out Type type - , out string methodName - , out string subMethodName - , out GeneratedNameKind kind - , out int? ordinal) { - - kind = GeneratedNameKind.None; - type = method.DeclaringType; - subMethodName = null; - ordinal = null; - methodName = method.Name; - - var generatedName = methodName; - - if (!TryParseGeneratedName(generatedName, out kind, out var openBracketOffset, out var closeBracketOffset)) { - return false; - } - - methodName = generatedName.Substring(openBracketOffset + 1, closeBracketOffset - openBracketOffset - 1); - - switch (kind) { - case GeneratedNameKind.LocalFunction: { - var localNameStart = generatedName.IndexOf((char)kind, closeBracketOffset + 1); - if (localNameStart < 0) { - break; - } - - localNameStart += 3; - - if (localNameStart < generatedName.Length) { - var localNameEnd = generatedName.IndexOf("|", localNameStart, StringComparison.Ordinal); - if (localNameEnd > 0) { - subMethodName = generatedName.Substring(localNameStart, localNameEnd - localNameStart); - } - } - break; - } - case GeneratedNameKind.LambdaMethod: - subMethodName = ""; - break; - } - - var dt = method.DeclaringType; - if (dt == null) { - return false; - } - - var matchHint = GetMatchHint(kind, method); - var matchName = methodName; - - var candidateMethods = dt.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly).Where(m => m.Name == matchName); - if (TryResolveSourceMethod(candidateMethods, kind, matchHint, ref method, ref type, out ordinal)) { - return true; - } - - var candidateConstructors = dt.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly).Where(m => m.Name == matchName); - if (TryResolveSourceMethod(candidateConstructors, kind, matchHint, ref method, ref type, out ordinal)) { - return true; - } - - const int MaxResolveDepth = 10; - for (var i = 0; i < MaxResolveDepth; i++) { - dt = dt.DeclaringType; - if (dt == null) { - return false; - } - - candidateMethods = dt.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly).Where(m => m.Name == matchName); - if (TryResolveSourceMethod(candidateMethods, kind, matchHint, ref method, ref type, out ordinal)) { - return true; - } - - candidateConstructors = dt.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly).Where(m => m.Name == matchName); - if (TryResolveSourceMethod(candidateConstructors, kind, matchHint, ref method, ref type, out ordinal)) { - return true; - } - - if (methodName == ".cctor") { - candidateConstructors = dt.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.DeclaredOnly).Where(m => m.Name == matchName); - foreach (var cctor in candidateConstructors) { - method = cctor; - type = dt; - return true; - } - } - } - - return false; - } - - private static bool TryResolveSourceMethod(IEnumerable candidateMethods - , GeneratedNameKind kind - , string matchHint - , ref MethodBase method - , ref Type type - , out int? ordinal) { - - ordinal = null; - foreach (var candidateMethod in candidateMethods) { - var methodBody = candidateMethod.GetMethodBody(); - if (methodBody != null && kind == GeneratedNameKind.LambdaMethod) { - foreach (var v in methodBody.LocalVariables) { - if (v.LocalType == type) { - GetOrdinal(method, ref ordinal); - } - method = candidateMethod; - type = method.DeclaringType; - return true; - } - } - - try { - var rawIL = methodBody?.GetILAsByteArray(); - if (rawIL == null) { - continue; - } - - var reader = new ILReader(rawIL); - while (reader.Read(candidateMethod)) { - if (reader.Operand is MethodBase mb) { - if (method == mb || (matchHint != null && method.Name.Contains(matchHint))) { - if (kind == GeneratedNameKind.LambdaMethod) { - GetOrdinal(method, ref ordinal); - } - - method = candidateMethod; - type = method.DeclaringType; - return true; - } - } - } - } catch { - // https://github.com/benaadams/Ben.Demystifier/issues/32 - // Skip methods where il can't be interpreted - } - } - - return false; - } - - private static void GetOrdinal(MethodBase method, ref int? ordinal) { - var lamdaStart = method.Name.IndexOf((char)GeneratedNameKind.LambdaMethod + "__", StringComparison.Ordinal) + 3; - if (lamdaStart > 3) { - var secondStart = method.Name.IndexOf("_", lamdaStart, StringComparison.Ordinal) + 1; - if (secondStart > 0) { - lamdaStart = secondStart; - } - - if (!int.TryParse(method.Name.Substring(lamdaStart), out var foundOrdinal)) { - ordinal = null; - return; - } - - ordinal = foundOrdinal; - - var methods = method.DeclaringType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly); - - var startName = method.Name.Substring(0, lamdaStart); - var count = 0; - foreach (var m in methods) { - if (m.Name.Length > lamdaStart && m.Name.StartsWith(startName)) { - count++; - - if (count > 1) { - break; - } - } - } - - if (count <= 1) { - ordinal = null; - } - } - } - - private static string GetMatchHint(GeneratedNameKind kind, MethodBase method) { - var methodName = method.Name; - - switch (kind) { - case GeneratedNameKind.LocalFunction: - var start = methodName.IndexOf("|", StringComparison.Ordinal); - if (start < 1) { - return null; - } - - var end = methodName.IndexOf("_", start, StringComparison.Ordinal) + 1; - if (end <= start) { - return null; - } - - return methodName.Substring(start, end - start); - default: - return null; - } - } - - // Parse the generated name. Returns true for names of the form - // [CS$]<[middle]>c[__[suffix]] where [CS$] is included for certain - // generated names, where [middle] and [__[suffix]] are optional, - // and where c is a single character in [1-9a-z] - // (csharp\LanguageAnalysis\LIB\SpecialName.cpp). - private static bool TryParseGeneratedName(string name, out GeneratedNameKind kind, out int openBracketOffset, out int closeBracketOffset) { - openBracketOffset = -1; - if (name.StartsWith("CS$<", StringComparison.Ordinal)) { - openBracketOffset = 3; - } else if (name.StartsWith("<", StringComparison.Ordinal)) { - openBracketOffset = 0; - } - - if (openBracketOffset >= 0) { - closeBracketOffset = IndexOfBalancedParenthesis(name, openBracketOffset, '>'); - if (closeBracketOffset >= 0 && closeBracketOffset + 1 < name.Length) { - int c = name[closeBracketOffset + 1]; - // Note '0' is not special. - if ((c >= '1' && c <= '9') || (c >= 'a' && c <= 'z')) { - kind = (GeneratedNameKind)c; - return true; - } - } - } - - kind = GeneratedNameKind.None; - openBracketOffset = -1; - closeBracketOffset = -1; - return false; - } - - private static int IndexOfBalancedParenthesis(string str, int openingOffset, char closing) { - var opening = str[openingOffset]; - - var depth = 1; - for (var i = openingOffset + 1; i < str.Length; i++) { - var c = str[i]; - if (c == opening) { - depth++; - } else if (c == closing) { - depth--; - if (depth == 0) { - return i; - } - } - } - - return -1; - } - - private static string GetPrefix(ParameterInfo parameter, Type parameterType) { - if (parameter.IsOut) { - return "out"; - } - - if (parameterType != null && parameterType.IsByRef) { - var attribs = parameter.GetCustomAttributes(inherit: false); - if (attribs?.Length > 0) { - foreach (var attrib in attribs) { - if (attrib is Attribute att && att.GetType().Namespace == "System.Runtime.CompilerServices" && att.GetType().Name == "IsReadOnlyAttribute") { - return "in"; - } - } - } - - return "ref"; - } - - return string.Empty; - } - - private static ResolvedParameter GetParameter(ParameterInfo parameter) { - var parameterType = parameter.ParameterType; - var prefix = GetPrefix(parameter, parameterType); - var parameterTypeString = "?"; - - if (parameterType.IsGenericType) { - var customAttribs = parameter.GetCustomAttributes(inherit: false); - - // We don't use System.ValueTuple yet - - //if (customAttribs.Length > 0) { - // var tupleNames = customAttribs.OfType().FirstOrDefault()?.TransformNames; - - // if (tupleNames?.Count > 0) { - // return GetValueTupleParameter(tupleNames, prefix, parameter.Name, parameterType); - // } - //} - } - - if (parameterType.IsByRef) { - parameterType = parameterType.GetElementType(); - } - - parameterTypeString = TypeNameHelper.GetTypeDisplayName(parameterType, fullName: false, includeGenericParameterNames: true); - - return new ResolvedParameter(parameter.Name, parameterTypeString, parameterType, prefix); - } - - private static ResolvedParameter GetValueTupleParameter(List tupleNames, string prefix, string name, Type parameterType) { - var sb = new StringBuilder(); - sb.Append("("); - var args = parameterType.GetGenericArguments(); - for (var i = 0; i < args.Length; i++) { - if (i > 0) { - sb.Append(", "); - } - - sb.Append(TypeNameHelper.GetTypeDisplayName(args[i], fullName: false, includeGenericParameterNames: true)); - - if (i >= tupleNames.Count) { - continue; - } - - var argName = tupleNames[i]; - if (argName == null) { - continue; - } - - sb.Append(" "); - sb.Append(argName); - } - - sb.Append(")"); - - return new ResolvedParameter(name, sb.ToString(), parameterType, prefix); - } - - private static bool TryResolveStateMachineMethod(ref MethodBase method, out Type declaringType) { - Debug.Assert(method != null); - Debug.Assert(method.DeclaringType != null); - - declaringType = method.DeclaringType; - - var parentType = declaringType.DeclaringType; - if (parentType == null) { - return false; - } - - var methods = parentType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly); - - foreach (var candidateMethod in methods) { - var attributes = candidateMethod.GetCustomAttributes(); - - foreach (var asma in attributes) { - if (asma.StateMachineType == declaringType) { - method = candidateMethod; - declaringType = candidateMethod.DeclaringType; - // Mark the iterator as changed; so it gets the + annotation of the original method - // async statemachines resolve directly to their builder methods so aren't marked as changed - return asma is IteratorStateMachineAttribute; - } - } - } - - return false; - } - - private enum GeneratedNameKind { - None = 0, - - // Used by EE: - ThisProxyField = '4', - HoistedLocalField = '5', - DisplayClassLocalOrField = '8', - LambdaMethod = 'b', - LambdaDisplayClass = 'c', - StateMachineType = 'd', - LocalFunction = 'g', // note collision with Deprecated_InitializerLocal, however this one is only used for method names - - // Used by EnC: - AwaiterField = 'u', - HoistedSynthesizedLocalField = 's', - - // Currently not parsed: - StateMachineStateField = '1', - IteratorCurrentBackingField = '2', - StateMachineParameterProxyField = '3', - ReusableHoistedLocalField = '7', - LambdaCacheField = '9', - FixedBufferField = 'e', - AnonymousType = 'f', - TransparentIdentifier = 'h', - AnonymousTypeField = 'i', - AutoPropertyBackingField = 'k', - IteratorCurrentThreadIdField = 'l', - IteratorFinallyMethod = 'm', - BaseMethodWrapper = 'n', - AsyncBuilderField = 't', - DynamicCallSiteContainerType = 'o', - DynamicCallSiteField = 'p' - } - - private struct ResolvedMethod { - public MethodBase MethodBase { get; set; } - public string DeclaringTypeName { get; set; } - public bool IsAsync { get; set; } - public bool IsLambda { get; set; } - public ResolvedParameter ReturnParameter { get; set; } - public string Name { get; set; } - public int? Ordinal { get; set; } - public string GenericArguments { get; set; } - public Type[] ResolvedGenericArguments { get; set; } - public MethodBase SubMethodBase { get; set; } - public string SubMethod { get; set; } - public List Parameters { get; set; } - public List SubMethodParameters { get; set; } - } - - private struct ResolvedParameter { - public string Name { get; } - public string Type { get; } - public Type ResolvedType { get; } - public string Prefix { get; } - - public ResolvedParameter(string name, string type, Type resolvedType, string prefix) { - Name = name; - Type = type; - ResolvedType = resolvedType; - Prefix = prefix; - } - } - } -} diff --git a/src/UnitTests/Core/Impl/Ben.Demystifier/TypeNameHelper.cs b/src/UnitTests/Core/Impl/Ben.Demystifier/TypeNameHelper.cs deleted file mode 100644 index e3f9eb6cf..000000000 --- a/src/UnitTests/Core/Impl/Ben.Demystifier/TypeNameHelper.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// -// Copyright (c) Ben A Adams. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// -// Python Tools for Visual Studio -// Copyright(c) Microsoft Corporation -// All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the License); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS -// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY -// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -// MERCHANTABILITY OR NON-INFRINGEMENT. -// -// See the Apache Version 2.0 License for specific language governing -// permissions and limitations under the License. - -using System; -using System.Collections.Generic; -using System.Text; - -namespace TestUtilities.Ben.Demystifier { - // Adapted from https://github.com/aspnet/Common/blob/dev/shared/Microsoft.Extensions.TypeNameHelper.Sources/TypeNameHelper.cs - internal sealed class TypeNameHelper { - private static readonly Dictionary _builtInTypeNames = new Dictionary { - { typeof(void), "void" }, - { typeof(bool), "bool" }, - { typeof(byte), "byte" }, - { typeof(char), "char" }, - { typeof(decimal), "decimal" }, - { typeof(double), "double" }, - { typeof(float), "float" }, - { typeof(int), "int" }, - { typeof(long), "long" }, - { typeof(object), "object" }, - { typeof(sbyte), "sbyte" }, - { typeof(short), "short" }, - { typeof(string), "string" }, - { typeof(uint), "uint" }, - { typeof(ulong), "ulong" }, - { typeof(ushort), "ushort" } - }; - - /// - /// Pretty print a type name. - /// - /// The . - /// true to print a fully qualified name. - /// true to include generic parameter names. - /// The pretty printed type name. - public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false) { - var builder = new StringBuilder(); - ProcessType(builder, type, new DisplayNameOptions(fullName, includeGenericParameterNames)); - return builder.ToString(); - } - - private static void ProcessType(StringBuilder builder, Type type, DisplayNameOptions options) { - if (type.IsGenericType) { - var genericArguments = type.GetGenericArguments(); - ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); - } else if (type.IsArray) { - ProcessArrayType(builder, type, options); - } else if (_builtInTypeNames.TryGetValue(type, out var builtInName)) { - builder.Append(builtInName); - } else if (type.Namespace == nameof(System)) { - builder.Append(type.Name); - } else if (type.IsGenericParameter) { - if (options.IncludeGenericParameterNames) { - builder.Append(type.Name); - } - } - else { - builder.Append(options.FullName ? type.FullName ?? type.Name : type.Name); - } - } - - private static void ProcessArrayType(StringBuilder builder, Type type, DisplayNameOptions options) { - var innerType = type; - while (innerType != null && innerType.IsArray){ - innerType = innerType.GetElementType(); - } - - ProcessType(builder, innerType, options); - - while (type != null && type.IsArray) { - builder.Append('['); - builder.Append(',', type.GetArrayRank() - 1); - builder.Append(']'); - type = type.GetElementType(); - } - } - - private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, DisplayNameOptions options) { - var offset = 0; - if (type.IsNested && type.DeclaringType != null) { - offset = type.DeclaringType.GetGenericArguments().Length; - } - - if (options.FullName) { - if (type.IsNested) { - ProcessGenericType(builder, type.DeclaringType, genericArguments, offset, options); - builder.Append('+'); - } else if (!string.IsNullOrEmpty(type.Namespace)) { - builder.Append(type.Namespace); - builder.Append('.'); - } - } - - var genericPartIndex = type.Name.IndexOf('`'); - if (genericPartIndex <= 0) { - builder.Append(type.Name); - return; - } - - builder.Append(type.Name, 0, genericPartIndex); - - builder.Append('<'); - for (var i = offset; i < length; i++) { - ProcessType(builder, genericArguments[i], options); - if (i + 1 == length) { - continue; - } - - builder.Append(','); - if (options.IncludeGenericParameterNames || !genericArguments[i + 1].IsGenericParameter) { - builder.Append(' '); - } - } - builder.Append('>'); - } - - private struct DisplayNameOptions { - public DisplayNameOptions(bool fullName, bool includeGenericParameterNames) { - FullName = fullName; - IncludeGenericParameterNames = includeGenericParameterNames; - } - - public bool FullName { get; } - public bool IncludeGenericParameterNames { get; } - } - } -} diff --git a/src/UnitTests/Core/Impl/Ben.Demystifier/readme.txt b/src/UnitTests/Core/Impl/Ben.Demystifier/readme.txt deleted file mode 100644 index eda6df587..000000000 --- a/src/UnitTests/Core/Impl/Ben.Demystifier/readme.txt +++ /dev/null @@ -1 +0,0 @@ -The folder contains modified version of the Ben.Demystifier (https://github.com/benaadams/Ben.Demystifier) which makes it easier to read modern .net stack traces \ No newline at end of file diff --git a/src/UnitTests/Core/Impl/TaskObserver.cs b/src/UnitTests/Core/Impl/TaskObserver.cs index 73041992f..b4337a5c2 100644 --- a/src/UnitTests/Core/Impl/TaskObserver.cs +++ b/src/UnitTests/Core/Impl/TaskObserver.cs @@ -21,15 +21,16 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using FluentAssertions; using FluentAssertions.Execution; -using TestUtilities.Ben.Demystifier; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TestUtilities { internal class TaskObserver { private readonly int _secondsTimeout; private readonly Action _afterTaskCompleted; private readonly TaskCompletionSource _tcs; - private readonly ConcurrentDictionary _stackTraces; + private readonly ConcurrentDictionary _stackTraces; private int _count; private bool _isTestCompleted; @@ -37,18 +38,23 @@ public TaskObserver(int secondsTimeout) { _secondsTimeout = secondsTimeout; _afterTaskCompleted = AfterTaskCompleted; _tcs = new TaskCompletionSource(); - _stackTraces = new ConcurrentDictionary(); + _stackTraces = new ConcurrentDictionary(); } - public void Add(Task task) { + public bool TryAdd(Task task) { + if (!_stackTraces.TryAdd(task, GetFilteredStackTrace())) { + return false; + } + + Interlocked.Increment(ref _count); // No reason to watch for task if it is completed already if (task.IsCompleted) { - task.GetAwaiter().GetResult(); + AfterTaskCompleted(task); + } else { + task.ContinueWith(_afterTaskCompleted, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); } - Interlocked.Increment(ref _count); - _stackTraces.TryAdd(task, GetFilteredStackTrace()); - task.ContinueWith(_afterTaskCompleted, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); + return true; } public void WaitForObservedTask() { @@ -62,20 +68,23 @@ public void WaitForObservedTask() { } } + [CustomAssertion] private void Summarize() { - var incompleteTasks = new Queue>(); - var failedTasks = new Queue>(); + var incompleteTasks = new Queue<(Task, StackTrace)>(); + var failedTasks = new Queue(); foreach (var kvp in _stackTraces) { var task = kvp.Key; + var stackTrace = kvp.Value; + if (!task.IsCompleted) { - incompleteTasks.Enqueue(kvp); + incompleteTasks.Enqueue((task, stackTrace)); } else if (task.IsFaulted && task.Exception != null) { var aggregateException = task.Exception.Flatten(); var exception = aggregateException.InnerExceptions.Count == 1 ? aggregateException.InnerException : aggregateException; - failedTasks.Enqueue(new KeyValuePair(kvp.Value, exception)); + failedTasks.Enqueue(exception); } } @@ -99,16 +108,14 @@ private void Summarize() { } while (incompleteTasks.Count > 0) { - var kvp = incompleteTasks.Dequeue(); - var task = kvp.Key; + var (task, stackTrace) = incompleteTasks.Dequeue(); message .Append("Id: ") .Append(task.Id) .Append(", status: ") .Append(task.Status) .AppendLine() - .AppendFrames(kvp.Value) - .AppendLine() + .AppendLine(new EnhancedStackTrace(stackTrace).ToString()) .AppendLine(); } @@ -133,20 +140,15 @@ private void Summarize() { } while (failedTasks.Count > 0) { - var kvp = failedTasks.Dequeue(); + var exception = failedTasks.Dequeue(); message - .Append(kvp.Value.GetType().Name) - .Append(": ") - .AppendException(kvp.Value) - .AppendLine() - .Append(" --- Task stack trace: ---") - .AppendLine() - .AppendFrames(kvp.Key) + .AppendDemystified(exception) .AppendLine() .AppendLine(); } - Execute.Assertion.FailWith(message.ToString()); + Assert.Fail(message.ToString()); + //Execute.Assertion.FailWith(message.ToString()); } private void TestCompleted() { @@ -169,27 +171,23 @@ private void AfterTaskCompleted(Task task) { } } - private static StackFrame[] GetFilteredStackTrace() { - var stackTrace = new StackTrace(2, true).GetFrames() ?? new StackFrame[0]; - var filteredStackTrace = new List(); - var skip = true; - foreach (var frame in stackTrace) { + private static StackTrace GetFilteredStackTrace() { + var skipCount = 2; + var stackTrace = new StackTrace(skipCount, true); + var frames = stackTrace.GetFrames(); + if (frames == null) { + return stackTrace; + } + + foreach (var frame in frames) { + skipCount++; var frameMethod = frame.GetMethod(); - if (skip) { - if (frameMethod.Name == "DoNotWait" && frameMethod.DeclaringType?.Name == "TaskExtensions") { - skip = false; - } - continue; + if (frameMethod.Name == "DoNotWait" && frameMethod.DeclaringType?.Name == "TaskExtensions") { + return new StackTrace(skipCount, true); } - - if (frameMethod.DeclaringType?.Namespace?.StartsWith("Microsoft.VisualStudio.TestPlatform.MSTestFramework", StringComparison.Ordinal) ?? false) { - continue; - } - - filteredStackTrace.Add(frame); } - return filteredStackTrace.ToArray(); + return stackTrace; } } -} \ No newline at end of file +} diff --git a/src/UnitTests/Core/Impl/TestEnvironmentImpl.cs b/src/UnitTests/Core/Impl/TestEnvironmentImpl.cs index be91f43e0..7f94fb7e5 100644 --- a/src/UnitTests/Core/Impl/TestEnvironmentImpl.cs +++ b/src/UnitTests/Core/Impl/TestEnvironmentImpl.cs @@ -18,13 +18,37 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Reflection; +using System.Runtime.ExceptionServices; +using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; namespace TestUtilities { public class TestEnvironmentImpl { + private static readonly FieldInfo _stackTraceStringField = typeof(Exception).GetField("_stackTraceString", BindingFlags.Instance | BindingFlags.NonPublic); + private static readonly FieldInfo _showDialogField = typeof(Debug).GetField("s_ShowDialog", BindingFlags.Static | BindingFlags.NonPublic); + protected internal static TestEnvironmentImpl Instance { get; protected set; } + protected TestEnvironmentImpl() { + TryOverrideShowDialog(); + } + + private static void TryOverrideShowDialog() { + if (_showDialogField != null) { + _showDialogField.SetValue(null, new Action(ThrowAssertException)); + } + } + + private static void ThrowAssertException(string stackTrace, string message, string detailMessage, string errorSource) { + var exception = new Exception(message); + if (_stackTraceStringField != null) { + _stackTraceStringField.SetValue(exception, stackTrace); + } + throw exception; + } + public static TimeSpan Elapsed() => Instance?._stopwatch.Value?.Elapsed ?? new TimeSpan(); public static void TestInitialize(string testFullName, int secondsTimeout = 10) => Instance?.BeforeTestRun(testFullName, secondsTimeout); public static void TestCleanup() => Instance?.AfterTestRun(); @@ -44,11 +68,7 @@ public TestEnvironmentImpl AddAssemblyResolvePaths(params string[] paths) { public bool TryAddTaskToWait(Task task) { var taskObserver = _taskObserver.Value; - if (taskObserver == null) { - return false; - } - taskObserver.Add(task); - return true; + return taskObserver != null && taskObserver.TryAdd(task); } protected virtual void BeforeTestRun(string testFullName, int secondsTimeout) { @@ -95,9 +115,10 @@ protected virtual void AfterTestRun() { } _taskObserver.Value?.WaitForObservedTask(); + } finally { _stopwatch.Value?.Stop(); TestData.ClearTestRunScope(); - } finally { + _stopwatch.Value = null; _taskObserver.Value = null; } diff --git a/src/UnitTests/Core/Impl/UnitTests.Core.csproj b/src/UnitTests/Core/Impl/UnitTests.Core.csproj index 3f8ed1e09..3a1e90721 100644 --- a/src/UnitTests/Core/Impl/UnitTests.Core.csproj +++ b/src/UnitTests/Core/Impl/UnitTests.Core.csproj @@ -7,6 +7,7 @@ + From 79685eb9b7047a8fa2e3b70be8fa0658f7245d0e Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Mon, 26 Aug 2019 11:49:47 -0700 Subject: [PATCH 14/60] Update baselines since __spec__ member was added --- src/Caching/Test/Files/ClassOwnDocumentation.json | 10 ++++++++++ src/Caching/Test/Files/MemberLocations.json | 10 ++++++++++ src/Caching/Test/Files/NestedClasses.json | 10 ++++++++++ src/Caching/Test/Files/SmokeTest.json | 10 ++++++++++ src/Caching/Test/Files/VersionHandling2.json | 10 ++++++++++ src/Caching/Test/Files/VersionHandling3.json | 10 ++++++++++ src/UnitTests/Core/Impl/Baseline.cs | 8 ++++---- 7 files changed, 64 insertions(+), 4 deletions(-) diff --git a/src/Caching/Test/Files/ClassOwnDocumentation.json b/src/Caching/Test/Files/ClassOwnDocumentation.json index fb93f52f8..f6a6c7d35 100644 --- a/src/Caching/Test/Files/ClassOwnDocumentation.json +++ b/src/Caching/Test/Files/ClassOwnDocumentation.json @@ -72,6 +72,16 @@ "Start": 0, "Length": 0 } + }, + { + "Value": "t:object", + "Id": 1253875154, + "Name": "__spec__", + "QualifiedName": "__spec__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Classes": [ diff --git a/src/Caching/Test/Files/MemberLocations.json b/src/Caching/Test/Files/MemberLocations.json index 57b4101fd..ec98ba59b 100644 --- a/src/Caching/Test/Files/MemberLocations.json +++ b/src/Caching/Test/Files/MemberLocations.json @@ -106,6 +106,16 @@ "Length": 0 } }, + { + "Value": "t:object", + "Id": 1253875154, + "Name": "__spec__", + "QualifiedName": "__spec__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, { "Value": "i:str", "Id": 833, diff --git a/src/Caching/Test/Files/NestedClasses.json b/src/Caching/Test/Files/NestedClasses.json index bfe0b4731..a4de61c16 100644 --- a/src/Caching/Test/Files/NestedClasses.json +++ b/src/Caching/Test/Files/NestedClasses.json @@ -73,6 +73,16 @@ "Length": 0 } }, + { + "Value": "t:object", + "Id": 1253875154, + "Name": "__spec__", + "QualifiedName": "__spec__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, { "Value": "i:str", "Id": 833, diff --git a/src/Caching/Test/Files/SmokeTest.json b/src/Caching/Test/Files/SmokeTest.json index 0f8ebe708..5fc51e763 100644 --- a/src/Caching/Test/Files/SmokeTest.json +++ b/src/Caching/Test/Files/SmokeTest.json @@ -93,6 +93,16 @@ "Length": 0 } }, + { + "Value": "t:object", + "Id": 1253875154, + "Name": "__spec__", + "QualifiedName": "__spec__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } + }, { "Value": "i:str", "Id": 833, diff --git a/src/Caching/Test/Files/VersionHandling2.json b/src/Caching/Test/Files/VersionHandling2.json index f7b1ca27c..02e6c7f13 100644 --- a/src/Caching/Test/Files/VersionHandling2.json +++ b/src/Caching/Test/Files/VersionHandling2.json @@ -99,6 +99,16 @@ "Start": 0, "Length": 0 } + }, + { + "Value": "t:object", + "Id": 1253875154, + "Name": "__spec__", + "QualifiedName": "__spec__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Classes": [], diff --git a/src/Caching/Test/Files/VersionHandling3.json b/src/Caching/Test/Files/VersionHandling3.json index af4e9c068..0ee5f389c 100644 --- a/src/Caching/Test/Files/VersionHandling3.json +++ b/src/Caching/Test/Files/VersionHandling3.json @@ -111,6 +111,16 @@ "Start": 0, "Length": 0 } + }, + { + "Value": "t:object", + "Id": 1253875154, + "Name": "__spec__", + "QualifiedName": "__spec__", + "IndexSpan": { + "Start": 0, + "Length": 0 + } } ], "Classes": [], diff --git a/src/UnitTests/Core/Impl/Baseline.cs b/src/UnitTests/Core/Impl/Baseline.cs index 2d3d129e6..181ebf3f0 100644 --- a/src/UnitTests/Core/Impl/Baseline.cs +++ b/src/UnitTests/Core/Impl/Baseline.cs @@ -18,6 +18,7 @@ using System.IO; using System.Text; using FluentAssertions; +using FluentAssertions.Execution; namespace TestUtilities { [ExcludeFromCodeCoverage] @@ -112,13 +113,12 @@ public static void CompareToFile(string baselineFile, string actual, bool regene actual = actual.Trim(); var expected = File.ReadAllText(baselineFile).Trim(); var line = CompareLines(expected, actual, out var baseLine, out var actualLine, out var index, ignoreCase); - line.Should().Be(0, - $@"there should be no difference at line {line} + Execute.Assertion.ForCondition(line == 0) + .FailWith($@"there should be no difference at line {line} Expected:{baseLine.Trim()} Actual:{actualLine.Trim()} BaselineFile:{Path.GetFileName(baselineFile)} - Difference at column {index}{Environment.NewLine}" - ); + Difference at column {index}{Environment.NewLine}"); } } } From 0f7f7ca94cc438d9438ad7f4df0293e8c73035a4 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Mon, 26 Aug 2019 15:59:25 -0700 Subject: [PATCH 15/60] Undo some of changes to match master. --- .../Evaluation/ExpressionEval.Generics.cs | 45 +++++++++++++++++-- .../Typing/Types/GenericClassBase.cs | 42 +---------------- src/Analysis/Ast/Impl/Types/ArgumentSet.cs | 11 ++--- .../Ast/Impl/Types/PythonFunctionOverload.cs | 3 +- 4 files changed, 48 insertions(+), 53 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs index 49746d0cd..c1a4f1ff3 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Generics.cs @@ -61,17 +61,56 @@ private IMember GetValueFromGeneric(IMember target, Expression expr) { } /// - /// Returns whether the arguments to Generic are valid + /// Determines if arguments to Generic are valid /// + // TODO: move check to GenericClassBase. This requires extensive changes to SpecificTypeConstructor. + private bool GenericClassParameterValid(IReadOnlyList genericTypeArgs, IReadOnlyList args, Expression expr) { + // All arguments to Generic must be type parameters + // e.g. Generic[T, str] throws a runtime error + if (genericTypeArgs.Count != args.Count) { + ReportDiagnostics(Module.Uri, new DiagnosticsEntry( + Resources.GenericNotAllTypeParameters, + GetLocation(expr).Span, + ErrorCodes.TypingGenericArguments, + Severity.Warning, + DiagnosticSource.Analysis)); + return false; + } + + // All arguments to Generic must be distinct + if (genericTypeArgs.Distinct().Count() != genericTypeArgs.Count) { + ReportDiagnostics(Module.Uri, new DiagnosticsEntry( + Resources.GenericNotAllUnique, + GetLocation(expr).Span, + ErrorCodes.TypingGenericArguments, + Severity.Warning, + DiagnosticSource.Analysis)); + return false; + } + + return true; + } /// /// Given generic type and list of arguments in the expression like /// Mapping[T1, int, ...] or Mapping[str, int] where Mapping inherits from Generic[K,T] creates generic class base /// (if the former) on specific type (if the latter). /// - private IMember CreateSpecificTypeFromIndex(IGenericType gt, IReadOnlyList args, Expression expr) - => gt.CreateSpecificType(new ArgumentSet(args, expr, this)); + private IMember CreateSpecificTypeFromIndex(IGenericType gt, IReadOnlyList args, Expression expr) { + var genericTypeArgs = args.OfType().ToArray(); + // TODO: move check to GenericClassBase. This requires extensive changes to SpecificTypeConstructor. + if (gt.Name.EqualsOrdinal("Generic")) { + if (!GenericClassParameterValid(genericTypeArgs, args, expr)) { + return UnknownType; + } + // Generic[T1, T2, ...] expression. Create generic base for the class. + return new GenericClassBase(genericTypeArgs, Module.Interpreter); + } + + // For other types just use supplied arguments + return args.Count > 0 ? gt.CreateSpecificType(new ArgumentSet(args, expr, this)) : UnknownType; + } private IReadOnlyList EvaluateIndex(IndexExpression expr) { var indices = new List(); if (expr.Index is TupleExpression tex) { diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs index 0446a09bc..c3f6c573a 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs @@ -16,10 +16,7 @@ using System; using System.Collections.Generic; using System.Linq; -using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Types; -using Microsoft.Python.Parsing; -using ErrorCodes = Microsoft.Python.Analysis.Diagnostics.ErrorCodes; namespace Microsoft.Python.Analysis.Specializations.Typing.Types { /// @@ -43,45 +40,10 @@ internal GenericClassBase(IReadOnlyList typeArgs, IPython public override IReadOnlyDictionary GenericParameters => TypeParameters.ToDictionary(tp => tp, tp => tp as IPythonType ?? UnknownType); - public override IPythonType CreateSpecificType(IArgumentSet args) { - if (!GenericClassParameterValid(args)) { - return UnknownType; - } - return new GenericClassBase(args.Arguments.Select(a => a.Value).OfType().ToArray(), DeclaringModule.Interpreter); - } - + public override IPythonType CreateSpecificType(IArgumentSet args) + => new GenericClassBase(args.Arguments.Select(a => a.Value).OfType().ToArray(), DeclaringModule.Interpreter); #endregion public IReadOnlyList TypeParameters { get; } - - private static bool GenericClassParameterValid(IArgumentSet args) { - var genericTypeArgs = args.Values().ToArray(); - var allArgs = args.Values().ToArray(); - // All arguments to Generic must be type parameters - // e.g. Generic[T, str] throws a runtime error - var e = args.Eval; - if (genericTypeArgs.Length != allArgs.Length) { - e.ReportDiagnostics(args.Eval.Module.Uri, new DiagnosticsEntry( - Resources.GenericNotAllTypeParameters, - e.GetLocation(args.Expression).Span, - ErrorCodes.TypingGenericArguments, - Severity.Warning, - DiagnosticSource.Analysis)); - return false; - } - - // All arguments to Generic must be distinct - if (genericTypeArgs.Distinct().ToArray().Length != genericTypeArgs.Length) { - e.ReportDiagnostics(args.Eval.Module.Uri, new DiagnosticsEntry( - Resources.GenericNotAllUnique, - e.GetLocation(args.Expression).Span, - ErrorCodes.TypingGenericArguments, - Severity.Warning, - DiagnosticSource.Analysis)); - return false; - } - - return true; - } } } diff --git a/src/Analysis/Ast/Impl/Types/ArgumentSet.cs b/src/Analysis/Ast/Impl/Types/ArgumentSet.cs index 45aca6f2c..fa4c1bebf 100644 --- a/src/Analysis/Ast/Impl/Types/ArgumentSet.cs +++ b/src/Analysis/Ast/Impl/Types/ArgumentSet.cs @@ -62,21 +62,16 @@ public static ArgumentSet Empty(Expression expr, IExpressionEvaluator eval) { } /// - /// Creates a set of arguments for a call - /// - /// Use in the cases a corresponding function is unknown, but it is still convenient to have the context - /// of the expression which the arguments are needed for and the evaluator that is analyzing - /// that expression. - /// + /// Creates a set of arguments for a call. /// /// Arguments for the call. /// Expression for the call. - /// Evaluator of the current analysis. + /// Evaluator of the current analysis of arguments are to be evaluated. + /// Can be null if arguments are already known. public ArgumentSet(IReadOnlyList args, Expression expr, IExpressionEvaluator eval) { _arguments = args.Select(t => new Argument(t)).ToList(); Expression = expr; Eval = eval; - _evaluated = true; } diff --git a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs index 0a750ce40..c8d25f417 100644 --- a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs +++ b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs @@ -191,8 +191,7 @@ private IMember CreateSpecificReturnFromTypeVar(IPythonClassType selfClassType, } // Try getting type from passed in arguments - var typeFromArgs = args?.Arguments.FirstOrDefault(a => returnType.Equals(a.Type))?.Value as IMember; - if (typeFromArgs != null) { + if (args?.Arguments.FirstOrDefault(a => returnType.Equals(a.Type))?.Value is IMember typeFromArgs) { return typeFromArgs; } From 252d30315aa67130671ad7741838b73f6db0808b Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Mon, 26 Aug 2019 16:22:00 -0700 Subject: [PATCH 16/60] Fix null ref --- src/Caching/Impl/Models/TypeVarModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Caching/Impl/Models/TypeVarModel.cs b/src/Caching/Impl/Models/TypeVarModel.cs index bf854d305..a3f5c4fc5 100644 --- a/src/Caching/Impl/Models/TypeVarModel.cs +++ b/src/Caching/Impl/Models/TypeVarModel.cs @@ -39,7 +39,7 @@ public static TypeVarModel FromGeneric(IVariable v) { Name = g.Name, QualifiedName = g.QualifiedName, Constraints = g.Constraints.Select(c => c.GetPersistentQualifiedName()).ToArray(), - Bound = g.Bound.QualifiedName, + Bound = g.Bound?.QualifiedName, Covariant = g.Covariant, Contravariant = g.Contravariant }; From b92334930091afe9c34c1912b37a3e450200ca42 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Tue, 3 Sep 2019 15:56:55 -0700 Subject: [PATCH 17/60] Resolve conflicts --- .../Typing/Definitions/IGenericType.cs | 2 +- .../Typing/Types/GenericType.cs | 15 +++--- .../Types/Collections/PythonCollectionType.cs | 11 ++-- .../Impl/Types/PythonClassType.Generics.cs | 51 +++++++++---------- .../Ast/Impl/Types/PythonClassType.cs | 4 +- src/Caching/Impl/GlobalScope.cs | 1 + src/Caching/Impl/Models/ClassModel.cs | 3 +- 7 files changed, 44 insertions(+), 43 deletions(-) diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericType.cs index 195194d09..79e6fbc27 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Definitions/IGenericType.cs @@ -26,7 +26,7 @@ public interface IGenericType : IPythonTemplateType { /// Type parameters such as in Tuple[T1, T2. ...] or /// Generic[_T1, _T2, ...] as returned by TypeVar. /// - IReadOnlyList FormalGenericParameters { get; } + IReadOnlyList Parameters { get; } bool IsGeneric { get; } } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs index 75752d2b1..49c978c48 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericType.cs @@ -34,7 +34,7 @@ internal sealed class SpecializedGenericType : LocatedMember, IGenericType { /// public SpecializedGenericType(string name, string qualifiedName, IReadOnlyList parameters, IPythonModule declaringModule) : this(name, qualifiedName, declaringModule) { - FormalGenericParameters = parameters ?? throw new ArgumentNullException(nameof(parameters)); + Parameters = parameters ?? throw new ArgumentNullException(nameof(parameters)); } /// @@ -60,7 +60,7 @@ public SpecializedGenericType( ) : this(name, null, declaringModule) { SpecificTypeConstructor = specificTypeConstructor ?? throw new ArgumentNullException(nameof(specificTypeConstructor)); TypeId = typeId; - FormalGenericParameters = parameters ?? Array.Empty(); + Parameters = parameters ?? Array.Empty(); Documentation = documentation ?? name; } @@ -87,7 +87,7 @@ public SpecializedGenericType( ) : this(name, qualifiedName, declaringModule) { SpecificTypeConstructor = specificTypeConstructor ?? throw new ArgumentNullException(nameof(specificTypeConstructor)); TypeId = typeId; - FormalGenericParameters = parameters ?? Array.Empty(); + Parameters = parameters ?? Array.Empty(); Documentation = documentation ?? name; } @@ -98,13 +98,18 @@ private SpecializedGenericType(string name, string qualifiedName, IPythonModule Documentation = Name; } + #region IMember public override PythonMemberType MemberType => PythonMemberType.Generic; + #endregion + #region IGenericType /// /// Type parameters such as in Tuple[T1, T2. ...] or /// Generic[_T1, _T2, ...] as returned by TypeVar. /// - public IReadOnlyList FormalGenericParameters { get; } + public IReadOnlyList Parameters { get; } + public bool IsGeneric => true; + #endregion #region IPythonType public string Name { get; } @@ -117,8 +122,6 @@ private SpecializedGenericType(string name, string qualifiedName, IPythonModule public bool IsAbstract => true; public bool IsSpecialized => true; - public bool IsGeneric => true; - public IMember CreateInstance(string typeName, IArgumentSet args) { var types = GetTypesFromValues(args.Arguments); if (types.Count != args.Arguments.Count) { diff --git a/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs b/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs index 4ea5c59ae..aa3d89372 100644 --- a/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs +++ b/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs @@ -72,15 +72,18 @@ public IPythonType CreateSpecificType(IArgumentSet typeArguments) { #endregion + #region IGenericType + public IReadOnlyList Parameters => (InnerType as IGenericType)?.Parameters ?? Array.Empty(); + public bool IsGeneric => (InnerType as IPythonClassType)?.IsGeneric == true; + public IReadOnlyDictionary GenericParameters + => (InnerType as IPythonClassType)?.GenericParameters ?? EmptyDictionary.Instance; + #endregion + #region IPythonClassType public IPythonType DeclaringType => (InnerType as IPythonClassType)?.DeclaringType; - public IReadOnlyList FormalGenericParameters => (InnerType as IPythonClassType)?.FormalGenericParameters ?? Array.Empty(); - public bool IsGeneric => (InnerType as IPythonClassType)?.IsGeneric == true; public ClassDefinition ClassDefinition => (InnerType as IPythonClassType)?.ClassDefinition; public IReadOnlyList Mro => (InnerType as IPythonClassType)?.Mro ?? Array.Empty(); public IReadOnlyList Bases => (InnerType as IPythonClassType)?.Bases ?? Array.Empty(); - public IReadOnlyDictionary GenericParameters - => (InnerType as IPythonClassType)?.GenericParameters ?? EmptyDictionary.Instance; #endregion public static IPythonCollection CreateList(IPythonModule declaringModule, IArgumentSet args) { diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs index 2600ce788..7c811aeca 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs @@ -41,7 +41,7 @@ internal partial class PythonClassType { /// {T, T} /// Where T is a generic type parameter that needs to be filled in by the class /// - public virtual IReadOnlyList FormalGenericParameters => _genericParameters ?? Array.Empty(); + public virtual IReadOnlyList Parameters => _parameters ?? Array.Empty(); public virtual bool IsGeneric { get; private set; } #endregion @@ -58,7 +58,7 @@ internal partial class PythonClassType { /// B[int] defines the type parameter T to be of type int and type parameter U to be type str. /// B[int] inherits from A[int, str] /// - public IPythonType CreateSpecificType(IArgumentSet args) { + public virtual IPythonType CreateSpecificType(IArgumentSet args) { lock (_membersLock) { var newGenericTypeParameters = GetTypeParameters(); var newBases = new List(); @@ -114,7 +114,7 @@ public IPythonType CreateSpecificType(IArgumentSet args) { foreach (var gt in genericTypeBases) { // Look through generic type bases and see if any of their required type parameters // have received a specific type, and if so create specific type - var st = gt.FormalGenericParameters + var st = gt.Parameters .Select(p => classType.GenericParameters.TryGetValue(p, out var t) ? t : null) .Where(p => !p.IsUnknown()) .ToArray(); @@ -129,8 +129,6 @@ public IPythonType CreateSpecificType(IArgumentSet args) { // Set specific class bases classType.SetBases(specificBases.Concat(newBases), args.Eval.CurrentScope); // Now that parameters are set, check if class is generic - classType._parameters = classType._genericParameters.Values.Distinct().OfType().ToList(); - classType.DecideGeneric(); classType.SetGenericParameters(); // Transfer members from generic to specific type. classType.SetClassMembers(this, args); @@ -144,8 +142,8 @@ public IPythonType CreateSpecificType(IArgumentSet args) { /// private IGenericTypeParameter[] GetTypeParameters() { // Case when updating with specific type and already has type parameters, return them - if (!FormalGenericParameters.IsNullOrEmpty()) { - return FormalGenericParameters.ToArray(); + if (!Parameters.IsNullOrEmpty()) { + return Parameters.ToArray(); } var bases = Bases ?? Array.Empty(); @@ -158,8 +156,8 @@ private IGenericTypeParameter[] GetTypeParameters() { } else { // otherwise look at the generic class bases foreach (var gt in bases.OfType()) { - if (gt.FormalGenericParameters != null) { - fromBases.UnionWith(gt.FormalGenericParameters); + if (gt.Parameters != null) { + fromBases.UnionWith(gt.Parameters); } } } @@ -216,7 +214,7 @@ ICollection newBases // will have BuiltinTypeId.Dict and we can figure out specific types from // the content of the collection. var b = _bases.OfType().Where(g => g.IsGeneric).FirstOrDefault(x => x.TypeId == type.TypeId); - if (b != null && !b.FormalGenericParameters.IsNullOrEmpty()) { + if (b != null && !b.Parameters.IsNullOrEmpty()) { newBases.Add(type); // Optimistically assign argument types if they match. // Handle common cases directly. @@ -258,7 +256,7 @@ ICollection newBases /// Points the generic type parameter in class type to their corresponding specific type /// (or a generic type parameter if no specific type was provided) /// - private void StoreGenericParameters( + internal void StoreGenericParameters( IPythonClassType templateClass, IEnumerable newGenericParameters, IReadOnlyDictionary genericToSpecificTypes) { @@ -287,9 +285,7 @@ private void StoreGenericParameters( } } - if (!_genericParameters.IsNullOrEmpty()) { - _genericName = CodeFormatter.FormatSequence(BaseName, '[', _genericParameters.Values); - } + SetNames(); } /// @@ -308,26 +304,26 @@ private void StoreGenericParameters( /// Dictionary or name (T1) to specific type to populate. private static void GetSpecificTypeFromArgumentValue(IGenericType gt, object argumentValue, IDictionary specificTypes) { switch (argumentValue) { - case IPythonDictionary dict when gt.FormalGenericParameters.Count == 2: + case IPythonDictionary dict when gt.Parameters.Count == 2: var keyType = dict.Keys.FirstOrDefault()?.GetPythonType(); var valueType = dict.Values.FirstOrDefault()?.GetPythonType(); if (!keyType.IsUnknown()) { - specificTypes[gt.FormalGenericParameters[0]] = keyType; + specificTypes[gt.Parameters[0]] = keyType; } if (!valueType.IsUnknown()) { - specificTypes[gt.FormalGenericParameters[1]] = valueType; + specificTypes[gt.Parameters[1]] = valueType; } break; - case IPythonIterable iter when gt.TypeId == BuiltinTypeId.List && gt.FormalGenericParameters.Count == 1: + case IPythonIterable iter when gt.TypeId == BuiltinTypeId.List && gt.Parameters.Count == 1: var itemType = iter.GetIterator().Next.GetPythonType(); if (!itemType.IsUnknown()) { - specificTypes[gt.FormalGenericParameters[0]] = itemType; + specificTypes[gt.Parameters[0]] = itemType; } break; - case IPythonCollection coll when gt.TypeId == BuiltinTypeId.Tuple && gt.FormalGenericParameters.Count >= 1: + case IPythonCollection coll when gt.TypeId == BuiltinTypeId.Tuple && gt.Parameters.Count >= 1: var itemTypes = coll.Contents.Select(m => m.GetPythonType()).ToArray(); - for (var i = 0; i < Math.Min(itemTypes.Length, gt.FormalGenericParameters.Count); i++) { - specificTypes[gt.FormalGenericParameters[i]] = itemTypes[i]; + for (var i = 0; i < Math.Min(itemTypes.Length, gt.Parameters.Count); i++) { + specificTypes[gt.Parameters[i]] = itemTypes[i]; } break; } @@ -385,7 +381,7 @@ private void SetClassMembers(IPythonClassType templateClass, IArgumentSet args) private void DecideGeneric() { using (_genericResolutionGuard.Push(this, out var reentered)) { if (!reentered) { - IsGeneric = !FormalGenericParameters.IsNullOrEmpty() || (Bases?.OfType().Any(g => g.IsGeneric) ?? false); + IsGeneric = !Parameters.IsNullOrEmpty() || (Bases?.OfType().Any(g => g.IsGeneric) ?? false); } } } @@ -393,15 +389,14 @@ private void DecideGeneric() { private void SetNames() { // Based on available data, calculate name of generic with parameters, if any, // as well as qualified name. - if (!_genericActualParameters.IsNullOrEmpty()) { - _nameWithParameters = CodeFormatter.FormatSequence(BaseName, '[', _genericActualParameters.Values); - _qualifiedNameWithParameters = CodeFormatter.FormatSequence(BaseName, '[', _genericActualParameters.Values.Select(v => v.QualifiedName)); + if (!_genericParameters.IsNullOrEmpty()) { + _nameWithParameters = CodeFormatter.FormatSequence(BaseName, '[', _genericParameters.Values); + _qualifiedNameWithParameters = CodeFormatter.FormatSequence(BaseName, '[', _genericParameters.Values.Select(v => v.QualifiedName)); } } private void SetGenericParameters() { - _genericParameters = _genericActualParameters.Values.Distinct().OfType().ToList(); - // Now that parameters are set, check if class is generic + _parameters = _genericParameters.Values.Distinct().OfType().ToList(); DecideGeneric(); } } diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.cs index 55ca2cf65..ba0f42eb9 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.cs @@ -25,7 +25,6 @@ using Microsoft.Python.Analysis.Values; using Microsoft.Python.Analysis.Values.Collections; using Microsoft.Python.Core; -using Microsoft.Python.Core.Diagnostics; using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Ast; @@ -42,7 +41,6 @@ internal enum ClassDocumentationSource { private readonly ReentrancyGuard _memberGuard = new ReentrancyGuard(); private readonly object _membersLock = new object(); - private string _genericName; private List _bases; private IReadOnlyList _mro; private string _documentation; @@ -217,7 +215,7 @@ public IReadOnlyList Mro { /// Has the map {T: int, K: str} /// public virtual IReadOnlyDictionary GenericParameters => - _genericActualParameters ?? EmptyDictionary.Instance; + _genericParameters ?? EmptyDictionary.Instance; #endregion diff --git a/src/Caching/Impl/GlobalScope.cs b/src/Caching/Impl/GlobalScope.cs index ba0c8b4fa..47808dccc 100644 --- a/src/Caching/Impl/GlobalScope.cs +++ b/src/Caching/Impl/GlobalScope.cs @@ -72,6 +72,7 @@ public void ReconstructVariables() { public IVariableCollection Variables => _scopeVariables; public IVariableCollection NonLocals => VariableCollection.Empty; public IVariableCollection Globals => VariableCollection.Empty; + public IVariableCollection Imported => VariableCollection.Empty; public IPythonModule Module { get; } IGlobalScope IScope.GlobalScope => this; diff --git a/src/Caching/Impl/Models/ClassModel.cs b/src/Caching/Impl/Models/ClassModel.cs index 225a96614..2b5aa0a70 100644 --- a/src/Caching/Impl/Models/ClassModel.cs +++ b/src/Caching/Impl/Models/ClassModel.cs @@ -142,7 +142,8 @@ protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringTy _cls.SetDocumentation(Documentation); if (GenericParameterValues.Length > 0) { - _cls.StoreGenericParameters(_cls, + _cls.StoreGenericParameters( + _cls, _cls.GenericParameters.Keys.ToArray(), GenericParameterValues.ToDictionary( k => _cls.GenericParameters.Keys.First(x => x.Name == k.Name), From 28ce8e355e25d523a83a7ed5f201e4939f76fa51 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Tue, 3 Sep 2019 16:55:58 -0700 Subject: [PATCH 18/60] Fix null ref on bases due to new AnyStr behavior --- src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs | 2 +- src/Analysis/Ast/Impl/Types/PythonClassType.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs index 7c811aeca..c74fe841b 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs @@ -205,7 +205,7 @@ ICollection newBases } // Don't add generic type parameters to bases - if (!(arg.Value is IGenericTypeParameter) && arg.Value is IMember member && !member.GetPythonType().IsUnknown()) { + if (_bases != null && !(arg.Value is IGenericTypeParameter) && arg.Value is IMember member && !member.GetPythonType().IsUnknown()) { var type = member.GetPythonType(); // Type may be a specific type created off generic or just a type // for the copy constructor. Consider 'class A(Generic[K, V], Mapping[K, V])' diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.cs index ba0f42eb9..a21cd81a5 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.cs @@ -199,7 +199,7 @@ public IReadOnlyList Mro { if (_mro != null) { return _mro; } - if (_bases.Count == 0) { + if (_bases == null || _bases.Count == 0) { return new IPythonType[] { this }; } _mro = new IPythonType[] { this }; From e7f29d776fada1e6d15f90879d6da5e604b0a4da Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Thu, 5 Sep 2019 10:12:10 -0700 Subject: [PATCH 19/60] Handling dependencies in module persistence (#1471) * Partial * Models and views * Restore log null checks * Fix merge conflict * Fix merge issue * Null check * Partial * Partial * Partial * Fix test * Partial * Partial * First test * Baseline comparison * Builtins * Partial * Type fixes * Fix type names, part I * Qualified name * Properly write variables * Partial * Construct module from model * Test * Variable creations * Factories * Factories * Split construction * Restore * Save builtins * Test passes * Qualified name * Better export detection * Test fixes * More consistent qualified names * Sys test * Demo * Complete sys write/read * Partial * Partial * Test staility * Perf bug * Baseline, remove debug code, deactivate db * Test fixes * Test fix * Simplify a bit * Baselines and use : separator * Baselines * PR feedback * Merge master * Remove registry reference * PR feedback * PR feedback * Restore persistence + update test * Better handle persistent module in dependencies * Undo * Add location converter abstraction * Store member location * Fix merge issue * Basic locations test * Navigation * Add test * Update baselines * Type restore - initial * Remove debug code * Partial * Fix stub merge * Various model fixes * Improve module handling * Qualified name improvements * Fix unbound case * Improve stub merge * Fix qualified names of typing * Handle stub-only modules * Add tests for io, re and sys * Better handle named tuple * Handle module circular references * Handle else in platform and version clauses + handle it in symbol collector * Formatting * Fix walk of multi-level if statement * Unify package search in imports * Fix tests * Undo change * Port changes from dbtype * Partial * Named tuple support * Baseline updates * Debug code * Support types * Properly compare class member declaring type * Nested classes and functions persistence * Undo debug * Fix numpy restore * Baselines * Fix tests * Update AnyStr test reflecting changes to AnyStr behavior * Exclude baselines from git diff * Fix gitattr * Move git setting to root * Try no path * Test fixes * Undo change * Additional stub merge fixes * Baseline updates * Fix goto def * Protect specific type creation * Track documentaton source * More reliable tests + simplification * Typo * Cleanup * Basic classification * Fix merge error * Module unique id fixes * Stricted check to save analysis * Revert "Fix tests" This reverts commit 247a8c38741324452cc5a8eeb412a9784441bd8b. * Revert "Unify package search in imports" This reverts commit 67fed10d1c892de07a9a920b5396d53d7473b977. * Don't clear scope variables with inner classes * Fix typo * Many new tests * Fix collections test * Fix CTypes * Initial * Update test * Merge issues * Fix CTypes again * Fix null bases * Tell between class members with/without self better * TypeVar support * Add bound/covariant * Fix Enum reassignments * Fix Random * Fix import * over local declarations (Socket) * Move interface * Fix reference search * Enable asyncio test * More tests * Enable dataclasses * Add inspect and gzip * More tests * Add setting * Add handling of import position relative to the variable * Caching level changes * Partial * Rework * Fix null * Update baselines * Functools pass * Reverse stub merge * Partial * Partial ctypes * Update variables post merge * Fix ctypes * Merge issues * Fix typevar * Add caching on construction * Assorted fixes * Named tuples * Work around os stub oddness * Fix generic qualified names * Ignore lambdas * Support named tuples as bases * Baselines * Test updates * Named tuple tests * PR feedback * Using * Separate creation and population for better handling of forward references. * Add dependency provider * Merge issues * Better class creation * Partial * Dependency providers * Add IsPersistent flag * Make special global scope * Move dependency fetch earlier * Replace AST walk by interface * Make analysis sequence closer to master * Undo some * Undo debug * Show dependencies in log * null check * Update tests * Make sure factory looks in correct scope Enable assertions in tests * Separate stub dependencies * Don't try and merge from empty stub * Match generic parameters by name * Use qualified names in generics Minor tests cleanup * Back to names * Update tests * usings * Fix dependencies for stub * Null check * PR feedback * PR feedback + fix merge issue in generics * Test fixes + PR feedback * Baseline updates * PR feedback * Restore original order * Order * Merge issues * Make cancellation closer to original * Pass cancellation to module walker * Simplify --- .../Impl/Analyzer/Definitions/IAnalyzable.cs | 7 + .../Ast/Impl/Analyzer/ModuleWalker.cs | 64 +++-- .../Ast/Impl/Analyzer/PythonAnalyzer.cs | 2 +- .../Ast/Impl/Analyzer/PythonAnalyzerEntry.cs | 82 +----- .../Impl/Analyzer/PythonAnalyzerSession.cs | 123 +++++---- .../Definitions/IModuleDatabaseService.cs | 36 ++- .../Impl/Dependencies/DependencyCollector.cs | 77 ++++++ .../Ast/Impl/Dependencies/DependencyWalker.cs | 53 ++++ .../IDependencyProvider.cs} | 32 +-- .../Impl/Dependencies/IDependencyResolver.cs | 1 - .../Impl/Documents/RunningDocumentTable.cs | 4 +- .../Ast/Impl/Extensions/AnalysisExtensions.cs | 2 + .../Impl/Extensions/PythonClassExtensions.cs | 4 +- .../Extensions/PythonFunctionExtensions.cs | 2 +- .../Impl/Extensions/PythonTypeExtensions.cs | 1 - .../Ast/Impl/Modules/BuiltinsPythonModule.cs | 2 +- .../Modules/CompiledBuiltinPythonModule.cs | 4 +- .../Ast/Impl/Modules/CompiledPythonModule.cs | 4 +- .../Definitions/ModuleCreationOptions.cs | 6 +- .../Impl/Modules/Definitions/ModuleType.cs | 1 + .../Ast/Impl/Modules/DependencyProvider.cs | 53 ++++ src/Analysis/Ast/Impl/Modules/PythonModule.cs | 34 ++- .../Ast/Impl/Modules/PythonVariableModule.cs | 10 +- .../Resolution/MainModuleResolution.cs | 49 ++-- .../Ast/Impl/Modules/SpecializedModule.cs | 7 +- .../Ast/Impl/Modules/StubPythonModule.cs | 2 +- .../Typing/Types/GenericClassBase.cs | 7 +- .../Typing/Types/GenericTypeParameter.cs | 27 +- .../Types/Collections/PythonCollectionType.cs | 4 +- .../Types/Definitions/IPythonClassType.cs | 2 +- .../Impl/Types/Definitions/IPythonModule.cs | 5 + .../Impl/Types/PythonClassType.Generics.cs | 40 +-- .../Ast/Impl/Types/PythonClassType.cs | 11 +- .../Ast/Impl/Types/PythonFunctionOverload.cs | 8 +- src/Analysis/Ast/Impl/Types/PythonType.cs | 14 +- .../Test/FluentAssertions/MemberAssertions.cs | 9 +- src/Analysis/Ast/Test/TypeshedTests.cs | 2 +- src/Analysis/Ast/Test/TypingTests.cs | 17 +- .../Impl/DependencyResolution/AstUtilities.cs | 13 +- .../Impl/DependencyResolution/ModuleImport.cs | 1 + src/Caching/Impl/Models/ClassModel.cs | 55 ++-- src/Caching/Impl/Models/FromImportModel.cs | 25 ++ src/Caching/Impl/Models/FunctionModel.cs | 29 +-- src/Caching/Impl/Models/ImportModel.cs | 24 ++ src/Caching/Impl/Models/MemberModel.cs | 17 +- src/Caching/Impl/Models/ModuleModel.cs | 64 ++++- src/Caching/Impl/Models/NamedTupleModel.cs | 5 +- src/Caching/Impl/Models/PropertyModel.cs | 13 +- src/Caching/Impl/Models/TypeVarModel.cs | 4 +- src/Caching/Impl/Models/VariableModel.cs | 6 +- src/Caching/Impl/ModuleDatabase.cs | 175 +++++++++---- src/Caching/Impl/ModuleFactory.cs | 25 +- src/Caching/Impl/Properties/AssemblyInfo.cs | 1 + src/Caching/Impl/PythonDbModule.cs | 12 +- src/Caching/Impl/QualifiedNameParts.cs | 2 + ...{GlobalScope.cs => RestoredGlobalScope.cs} | 51 ++-- src/Caching/Impl/TypeNames.cs | 11 +- src/Caching/Test/AnalysisCachingTestBase.cs | 54 +++- src/Caching/Test/ClassesTests.cs | 4 +- .../Test/Files/ClassOwnDocumentation.json | 6 +- src/Caching/Test/Files/MemberLocations.json | 6 +- src/Caching/Test/Files/NestedClasses.json | 6 +- src/Caching/Test/Files/SmokeTest.json | 6 +- src/Caching/Test/Files/VersionHandling2.json | 6 +- src/Caching/Test/Files/VersionHandling3.json | 6 +- src/Caching/Test/LibraryModulesTests.cs | 16 +- src/Caching/Test/ReferencesTests.cs | 30 +-- src/Core/Impl/OS/ProcessServices.cs | 22 +- src/Core/Test/PriorityProducerConsumerTest.cs | 234 +++++++++-------- src/LanguageServer/Test/IndexManagerTests.cs | 245 +++++++++--------- src/LanguageServer/Test/IndexParserTests.cs | 46 ++-- src/LanguageServer/Test/SymbolIndexTests.cs | 174 +++++++------ src/UnitTests/Core/Impl/Baseline.cs | 61 ++--- 73 files changed, 1378 insertions(+), 885 deletions(-) create mode 100644 src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs create mode 100644 src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs rename src/Analysis/Ast/Impl/{Caching/Definitions/ModuleStorageState.cs => Dependencies/IDependencyProvider.cs} (52%) create mode 100644 src/Analysis/Ast/Impl/Modules/DependencyProvider.cs create mode 100644 src/Caching/Impl/Models/FromImportModel.cs create mode 100644 src/Caching/Impl/Models/ImportModel.cs rename src/Caching/Impl/{GlobalScope.cs => RestoredGlobalScope.cs} (67%) diff --git a/src/Analysis/Ast/Impl/Analyzer/Definitions/IAnalyzable.cs b/src/Analysis/Ast/Impl/Analyzer/Definitions/IAnalyzable.cs index 8d4b9751d..2b9182661 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Definitions/IAnalyzable.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Definitions/IAnalyzable.cs @@ -13,11 +13,18 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using Microsoft.Python.Analysis.Dependencies; + namespace Microsoft.Python.Analysis.Analyzer { /// /// Represents document that can be analyzed asynchronously. /// internal interface IAnalyzable { + /// + /// Returns object that can calculate dependencies of this entry. + /// + IDependencyProvider DependencyProvider { get; } + /// /// Notifies document that analysis is about to begin. /// diff --git a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs index 8aab07e9c..ddd730e48 100644 --- a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs +++ b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs @@ -16,6 +16,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Threading; using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Modules; @@ -32,30 +33,36 @@ namespace Microsoft.Python.Analysis.Analyzer { internal class ModuleWalker : AnalysisWalker { private const string AllVariableName = "__all__"; private readonly IDocumentAnalysis _stubAnalysis; + private readonly CancellationToken _cancellationToken; // A hack to use __all__ export in the most simple case. private int _allReferencesCount; private bool _allIsUsable = true; - public ModuleWalker(IServiceContainer services, IPythonModule module, PythonAst ast) + public ModuleWalker(IServiceContainer services, IPythonModule module, PythonAst ast, CancellationToken cancellationToken) : base(new ExpressionEval(services, module, ast)) { _stubAnalysis = Module.Stub is IDocument doc ? doc.GetAnyAnalysis() : null; + _cancellationToken = cancellationToken; } public override bool Walk(NameExpression node) { if (Eval.CurrentScope == Eval.GlobalScope && node.Name == AllVariableName) { _allReferencesCount++; } + + _cancellationToken.ThrowIfCancellationRequested(); return base.Walk(node); } public override bool Walk(AugmentedAssignStatement node) { HandleAugmentedAllAssign(node); + _cancellationToken.ThrowIfCancellationRequested(); return base.Walk(node); } public override bool Walk(CallExpression node) { HandleAllAppendExtend(node); + _cancellationToken.ThrowIfCancellationRequested(); return base.Walk(node); } @@ -146,6 +153,7 @@ private bool IsHandleableAll(Node node) { public override bool Walk(PythonAst node) { Check.InvalidOperation(() => Ast == node, "walking wrong AST"); + _cancellationToken.ThrowIfCancellationRequested(); // Collect basic information about classes and functions in order // to correctly process forward references. Does not determine @@ -181,16 +189,20 @@ public override bool Walk(PythonAst node) { // Classes and functions are walked by their respective evaluators public override bool Walk(ClassDefinition node) { + _cancellationToken.ThrowIfCancellationRequested(); SymbolTable.Evaluate(node); return false; } public override bool Walk(FunctionDefinition node) { + _cancellationToken.ThrowIfCancellationRequested(); SymbolTable.Evaluate(node); return false; } public void Complete() { + _cancellationToken.ThrowIfCancellationRequested(); + SymbolTable.EvaluateAll(); SymbolTable.ReplacedByStubs.Clear(); MergeStub(); @@ -220,11 +232,13 @@ public void Complete() { /// of the definitions. Stub may contains those so we need to merge it in. /// private void MergeStub() { - if (Module.ModuleType == ModuleType.User) { + _cancellationToken.ThrowIfCancellationRequested(); + + if (Module.ModuleType == ModuleType.User || Module.ModuleType == ModuleType.Stub) { return; } // No stub, no merge. - if (_stubAnalysis == null) { + if (_stubAnalysis.IsEmpty()) { return; } // TODO: figure out why module is getting analyzed before stub. @@ -248,6 +262,18 @@ private void MergeStub() { if (stubType.DeclaringModule is TypingModule && stubType.Name == "Any") { continue; } + + if (sourceVar?.Source == VariableSource.Import && + sourceVar.GetPythonType()?.DeclaringModule.Stub != null) { + // Keep imported types as they are defined in the library. For example, + // 'requests' imports NullHandler as 'from logging import NullHandler'. + // But 'requests' also declares NullHandler in its stub (but not in the main code) + // and that declaration does not have documentation or location. Therefore avoid + // taking types that are stub-only when similar type is imported from another + // module that also has a stub. + continue; + } + TryReplaceMember(v, sourceType, stubType); } @@ -257,7 +283,7 @@ private void MergeStub() { private void TryReplaceMember(IVariable v, IPythonType sourceType, IPythonType stubType) { // If type does not exist in module, but exists in stub, declare it unless it is an import. // If types are the classes, take class from the stub, then add missing members. - // Otherwise, replace type from one from the stub. + // Otherwise, replace type by one from the stub. switch (sourceType) { case null: // Nothing in sources, but there is type in the stub. Declare it. @@ -379,28 +405,26 @@ private static void TransferDocumentationAndLocation(IPythonType s, IPythonType if (s != d && s is PythonType src && d is PythonType dst) { // If type is a class, then doc can either come from class definition node of from __init__. // If class has doc from the class definition, don't stomp on it. - var transferDoc = true; if (src is PythonClassType srcClass && dst is PythonClassType dstClass) { // Higher lever source wins if (srcClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Class || (srcClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Init && dstClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Base)) { dstClass.SetDocumentation(srcClass.Documentation); - transferDoc = false; } - } - - // Sometimes destination (stub type) already has documentation. This happens when stub type - // is used to augment more than one type. For example, in threading module RLock stub class - // replaces both RLock function and _RLock class making 'factory' function RLock to look - // like a class constructor. Effectively a single stub type is used for more than one type - // in the source and two source types may have different documentation. Thus transferring doc - // from one source type affects documentation of another type. It may be better to clone stub - // type and separate instances for separate source type, but for now we'll just avoid stomping - // on the existing documentation. - if (transferDoc && string.IsNullOrEmpty(dst.Documentation)) { - var srcDocumentation = src.Documentation; - if (!string.IsNullOrEmpty(srcDocumentation)) { - dst.SetDocumentation(srcDocumentation); + } else { + // Sometimes destination (stub type) already has documentation. This happens when stub type + // is used to augment more than one type. For example, in threading module RLock stub class + // replaces both RLock function and _RLock class making 'factory' function RLock to look + // like a class constructor. Effectively a single stub type is used for more than one type + // in the source and two source types may have different documentation. Thus transferring doc + // from one source type affects documentation of another type. It may be better to clone stub + // type and separate instances for separate source type, but for now we'll just avoid stomping + // on the existing documentation. + if (string.IsNullOrEmpty(dst.Documentation)) { + var srcDocumentation = src.Documentation; + if (!string.IsNullOrEmpty(srcDocumentation)) { + dst.SetDocumentation(srcDocumentation); + } } } diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs index bc9203727..cfa8b64c0 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs @@ -238,7 +238,7 @@ internal void RaiseAnalysisComplete(int moduleCount, double msElapsed) private void AnalyzeDocument(in AnalysisModuleKey key, in PythonAnalyzerEntry entry, in ImmutableArray dependencies) { _analysisCompleteEvent.Reset(); ActivityTracker.StartTracking(); - _log?.Log(TraceEventType.Verbose, $"Analysis of {entry.Module.Name}({entry.Module.ModuleType}) queued"); + _log?.Log(TraceEventType.Verbose, $"Analysis of {entry.Module.Name} ({entry.Module.ModuleType}) queued. Dependencies: {string.Join(", ", dependencies.Select(d => d.IsTypeshed ? $"{d.Name} (stub)" : d.Name))}"); var graphVersion = _dependencyResolver.ChangeValue(key, entry, entry.IsUserOrBuiltin || key.IsNonUserAsDocument, dependencies); diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs index 1a4772371..f3a8a6046 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs @@ -19,15 +19,13 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using Microsoft.Python.Analysis.Core.DependencyResolution; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; -using Microsoft.Python.Core; using Microsoft.Python.Core.Collections; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Analyzer { - [DebuggerDisplay("{_module.Name}({_module.ModuleType})")] + [DebuggerDisplay("{_module.Name} : {_module.ModuleType}")] internal sealed class PythonAnalyzerEntry { private readonly object _syncObj = new object(); private TaskCompletionSource _analysisTcs; @@ -248,20 +246,13 @@ public bool Invalidate(IPythonModule module, PythonAst ast, int bufferVersion, i } private HashSet FindDependencies(IPythonModule module, PythonAst ast, int bufferVersion) { - if (_bufferVersion > bufferVersion) { - return new HashSet(); - } - - var walker = new DependencyWalker(module); - ast.Walk(walker); - var dependencies = walker.Dependencies; - dependencies.Remove(new AnalysisModuleKey(module)); + var dependencyProvider = (module as IAnalyzable)?.DependencyProvider; + var dependencies = _bufferVersion <= bufferVersion && module is IAnalyzable analyzable && analyzable.DependencyProvider != null + ? dependencyProvider.GetDependencies() + : new HashSet(); return dependencies; } - private static bool Ignore(IModuleManagement moduleResolution, string fullName, string modulePath) - => moduleResolution.BuiltinModuleName.EqualsOrdinal(fullName) || moduleResolution.IsSpecializedModule(fullName, modulePath); - private void UpdateAnalysisTcs(int analysisVersion) { _analysisVersion = analysisVersion; if (_analysisTcs.Task.Status == TaskStatus.RanToCompletion) { @@ -273,69 +264,6 @@ private void UpdateAnalysisTcs(int analysisVersion) { } } - private class DependencyWalker : PythonWalker { - private readonly IPythonModule _module; - private readonly bool _isTypeshed; - private readonly IModuleManagement _moduleResolution; - private readonly PathResolverSnapshot _pathResolver; - - public HashSet Dependencies { get; } - - public DependencyWalker(IPythonModule module) { - _module = module; - _isTypeshed = module is StubPythonModule stub && stub.IsTypeshed; - _moduleResolution = module.Interpreter.ModuleResolution; - _pathResolver = _isTypeshed - ? module.Interpreter.TypeshedResolution.CurrentPathResolver - : _moduleResolution.CurrentPathResolver; - - Dependencies = new HashSet(); - - if (module.Stub != null) { - Dependencies.Add(new AnalysisModuleKey(module.Stub)); - } - } - - public override bool Walk(ImportStatement import) { - var forceAbsolute = import.ForceAbsolute; - foreach (var moduleName in import.Names) { - var importNames = ImmutableArray.Empty; - foreach (var nameExpression in moduleName.Names) { - importNames = importNames.Add(nameExpression.Name); - var imports = _pathResolver.GetImportsFromAbsoluteName(_module.FilePath, importNames, forceAbsolute); - HandleSearchResults(imports); - } - } - return false; - } - - public override bool Walk(FromImportStatement fromImport) { - var imports = _pathResolver.FindImports(_module.FilePath, fromImport); - HandleSearchResults(imports); - if (imports is IImportChildrenSource childrenSource) { - foreach (var name in fromImport.Names) { - if (childrenSource.TryGetChildImport(name.Name, out var childImport)) { - HandleSearchResults(childImport); - } - } - } - - return false; - } - - private void HandleSearchResults(IImportSearchResult searchResult) { - switch (searchResult) { - case ModuleImport moduleImport when !Ignore(_moduleResolution, moduleImport.FullName, moduleImport.ModulePath): - Dependencies.Add(new AnalysisModuleKey(moduleImport.FullName, moduleImport.ModulePath, _isTypeshed)); - return; - case PossibleModuleImport possibleModuleImport when !Ignore(_moduleResolution, possibleModuleImport.PrecedingModuleFullName, possibleModuleImport.PrecedingModulePath): - Dependencies.Add(new AnalysisModuleKey(possibleModuleImport.PrecedingModuleFullName, possibleModuleImport.PrecedingModulePath, _isTypeshed)); - return; - default: - return; - } - } - } } } diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index eeb5c6b20..9abc1b5a6 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -236,7 +236,7 @@ private async Task AnalyzeAffectedEntriesAsync(Stopwatch stopWatch) { private bool IsAnalyzedLibraryInLoop(IDependencyChainNode node, IDocumentAnalysis currentAnalysis) => !node.HasMissingDependencies && currentAnalysis is LibraryAnalysis && node.IsWalkedWithDependencies && node.IsValidVersion; - private void RunAnalysis(IDependencyChainNode node, Stopwatch stopWatch) + private void RunAnalysis(IDependencyChainNode node, Stopwatch stopWatch) => ExecutionContext.Run(ExecutionContext.Capture(), s => Analyze(node, null, stopWatch), null); private Task StartAnalysis(IDependencyChainNode node, AsyncCountdownEvent ace, Stopwatch stopWatch) @@ -334,83 +334,74 @@ private void AnalyzeEntry(IDependencyChainNode node, Python var analyzable = module as IAnalyzable; analyzable?.NotifyAnalysisBegins(); - var walker = new ModuleWalker(_services, module, ast); - ast.Walk(walker); - + var analysis = DoAnalyzeEntry(node, (IDocument)module, ast, version); _analyzerCancellationToken.ThrowIfCancellationRequested(); - walker.Complete(); - _analyzerCancellationToken.ThrowIfCancellationRequested(); + if (analysis != null) { + analyzable?.NotifyAnalysisComplete(analysis); + entry.TrySetAnalysis(analysis, version); + + if (module.ModuleType == ModuleType.User) { + var linterDiagnostics = _analyzer.LintModule(module); + _diagnosticsService?.Replace(entry.Module.Uri, linterDiagnostics, DiagnosticSource.Linter); + } + } + } + + private IDocumentAnalysis DoAnalyzeEntry(IDependencyChainNode node, IDocument document, PythonAst ast, int version) { + var moduleType = node.Value.Module.ModuleType; bool isCanceled; lock (_syncObj) { isCanceled = _isCanceled; } - if (!isCanceled) { - node?.MarkWalked(); + if (moduleType.CanBeCached() && _moduleDatabaseService?.ModuleExistsInStorage(document.Name, document.FilePath) == true) { + if (!isCanceled && _moduleDatabaseService.TryRestoreGlobalScope(document, out var gs)) { + if (_log != null) { + _log.Log(TraceEventType.Verbose, "Restored from database: ", document.Name); + } + var analysis = new DocumentAnalysis(document, 1, gs, new ExpressionEval(_services, document, document.GetAst()), Array.Empty()); + gs.ReconstructVariables(); + return analysis; + } + return null; } - var analysis = CreateAnalysis(node, (IDocument)module, ast, version, walker, isCanceled); - analyzable?.NotifyAnalysisComplete(analysis); - entry.TrySetAnalysis(analysis, version); - - if (module.ModuleType == ModuleType.User) { - var linterDiagnostics = _analyzer.LintModule(module); - _diagnosticsService?.Replace(entry.Module.Uri, linterDiagnostics, DiagnosticSource.Linter); - } - } - - private void LogCompleted(IDependencyChainNode node, IPythonModule module, Stopwatch stopWatch, TimeSpan startTime) { - if (_log != null) { - var completed = node != null && module.Analysis is LibraryAnalysis ? "completed for library" : "completed"; - var message = node != null - ? $"Analysis of {module.Name} ({module.ModuleType}) on depth {node.VertexDepth} {completed} in {(stopWatch.Elapsed - startTime).TotalMilliseconds} ms." - : $"Out of order analysis of {module.Name}({module.ModuleType}) completed in {(stopWatch.Elapsed - startTime).TotalMilliseconds} ms."; - _log.Log(TraceEventType.Verbose, message); - } - } + var walker = new ModuleWalker(_services, document, ast, _analyzerCancellationToken); + ast.Walk(walker); + walker.Complete(); - private void LogCanceled(IPythonModule module) { - if (_log != null) { - _log.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) canceled."); + lock (_syncObj) { + isCanceled = _isCanceled; } - } - - private void LogException(IPythonModule module, Exception exception) { - if (_log != null) { - _log.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) failed. {exception}"); + if (!isCanceled) { + node.MarkWalked(); } - if (TestEnvironment.Current != null) { - ExceptionDispatchInfo.Capture(exception).Throw(); - } + return CreateAnalysis(node, document, ast, version, walker, isCanceled); } private IDocumentAnalysis CreateAnalysis(IDependencyChainNode node, IDocument document, PythonAst ast, int version, ModuleWalker walker, bool isCanceled) { var canHaveLibraryAnalysis = false; - var saveAnalysis = false; + // Don't try to drop builtins; it causes issues elsewhere. // We probably want the builtin module's AST and other info for evaluation. switch (document.ModuleType) { case ModuleType.Library: case ModuleType.Compiled: case ModuleType.CompiledBuiltin: - canHaveLibraryAnalysis = true; - saveAnalysis = true; - break; - case ModuleType.Stub: canHaveLibraryAnalysis = true; break; } var createLibraryAnalysis = !isCanceled && - node != null && - !node.HasMissingDependencies && - canHaveLibraryAnalysis && - !document.IsOpen && - node.HasOnlyWalkedDependencies && - node.IsValidVersion; + node != null && + !node.HasMissingDependencies && + canHaveLibraryAnalysis && + !document.IsOpen && + node.HasOnlyWalkedDependencies && + node.IsValidVersion; if (!createLibraryAnalysis) { return new DocumentAnalysis(document, version, walker.GlobalScope, walker.Eval, walker.StarImportMemberNames); @@ -420,15 +411,41 @@ private IDocumentAnalysis CreateAnalysis(IDependencyChainNode(); + dbs?.StoreModuleAnalysisAsync(analysis, CancellationToken.None).DoNotWait(); return analysis; } + + private void LogCompleted(IDependencyChainNode node, IPythonModule module, Stopwatch stopWatch, TimeSpan startTime) { + if (_log != null) { + var completed = node != null && module.Analysis is LibraryAnalysis ? "completed for library" : "completed"; + var message = node != null + ? $"Analysis of {module.Name} ({module.ModuleType}) on depth {node.VertexDepth} {completed} in {(stopWatch.Elapsed - startTime).TotalMilliseconds} ms." + : $"Out of order analysis of {module.Name}({module.ModuleType}) completed in {(stopWatch.Elapsed - startTime).TotalMilliseconds} ms."; + _log.Log(TraceEventType.Verbose, message); + } + } + + private void LogCanceled(IPythonModule module) { + if (_log != null) { + _log.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) canceled."); + } + } + + private void LogException(IPythonModule module, Exception exception) { + if (_log != null) { + _log.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) failed. {exception}"); + } + + if (TestEnvironment.Current != null) { + ExceptionDispatchInfo.Capture(exception).Throw(); + } + } + private enum State { NotStarted = 0, Started = 1, diff --git a/src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs b/src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs index bd1989aa1..9477a952f 100644 --- a/src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs +++ b/src/Analysis/Ast/Impl/Caching/Definitions/IModuleDatabaseService.cs @@ -15,19 +15,36 @@ using System.Threading; using System.Threading.Tasks; +using Microsoft.Python.Analysis.Dependencies; using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; namespace Microsoft.Python.Analysis.Caching { + /// + /// Represents global scope that has been restored from + /// the database but has not been fully populated yet. + /// Used to attach to analysis so variables can be + /// accessed during classes and methods restoration. + /// + internal interface IRestoredGlobalScope : IGlobalScope { + void ReconstructVariables(); + } + internal interface IModuleDatabaseService { /// - /// Creates module representation from module persistent state. + /// Creates global scope from module persistent state. + /// Global scope is then can be used to construct module analysis. + /// + /// Python module to restore analysis for. + /// Python module global scope. + bool TryRestoreGlobalScope(IPythonModule module, out IRestoredGlobalScope gs); + + /// + /// Retrieves dependencies from the module persistent state. /// - /// Module name. If the name is not qualified - /// the module will ge resolved against active Python version. - /// Module file path. - /// Python module. - /// Module storage state - ModuleStorageState TryCreateModule(string moduleName, string filePath, out IPythonModule module); + /// Python module to restore analysis for. + /// Python module dependency provider. + bool TryRestoreDependencies(IPythonModule module, out IDependencyProvider dp); /// /// Writes module data to the database. @@ -38,5 +55,10 @@ internal interface IModuleDatabaseService { /// Determines if module analysis exists in the storage. /// bool ModuleExistsInStorage(string moduleName, string filePath); + + /// + /// Clear cached data. + /// + void Clear(); } } diff --git a/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs b/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs new file mode 100644 index 000000000..9087cd2ee --- /dev/null +++ b/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs @@ -0,0 +1,77 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Core.DependencyResolution; +using Microsoft.Python.Analysis.Modules; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Core; + +namespace Microsoft.Python.Analysis.Dependencies { + internal sealed class DependencyCollector { + private readonly IPythonModule _module; + private readonly bool _isTypeshed; + private readonly IModuleManagement _moduleResolution; + private readonly PathResolverSnapshot _pathResolver; + + public HashSet Dependencies { get; } = new HashSet(); + + public DependencyCollector(IPythonModule module) { + _module = module; + _isTypeshed = module is StubPythonModule stub && stub.IsTypeshed; + _moduleResolution = module.Interpreter.ModuleResolution; + _pathResolver = _isTypeshed + ? module.Interpreter.TypeshedResolution.CurrentPathResolver + : _moduleResolution.CurrentPathResolver; + + if (module.Stub != null) { + Dependencies.Add(new AnalysisModuleKey(module.Stub)); + } + } + + public void AddImport(IReadOnlyList importNames, bool forceAbsolute) { + var imports = _pathResolver.GetImportsFromAbsoluteName(_module.FilePath, importNames, forceAbsolute); + HandleSearchResults(imports); + } + + public void AddFromImport(IReadOnlyList importNames, int dotCount, bool forceAbsolute) { + var imports = _pathResolver.FindImports(_module.FilePath, importNames, dotCount, forceAbsolute); + HandleSearchResults(imports); + if (imports is IImportChildrenSource childrenSource) { + foreach (var name in importNames) { + if (childrenSource.TryGetChildImport(name, out var childImport)) { + HandleSearchResults(childImport); + } + } + } + } + + private void HandleSearchResults(IImportSearchResult searchResult) { + switch (searchResult) { + case ModuleImport moduleImport when !Ignore(_moduleResolution, moduleImport.FullName, moduleImport.ModulePath): + Dependencies.Add(new AnalysisModuleKey(moduleImport.FullName, moduleImport.ModulePath, _isTypeshed)); + return; + case PossibleModuleImport possibleModuleImport when !Ignore(_moduleResolution, possibleModuleImport.PrecedingModuleFullName, possibleModuleImport.PrecedingModulePath): + Dependencies.Add(new AnalysisModuleKey(possibleModuleImport.PrecedingModuleFullName, possibleModuleImport.PrecedingModulePath, _isTypeshed)); + return; + default: + return; + } + } + private static bool Ignore(IModuleManagement moduleResolution, string fullName, string modulePath) + => moduleResolution.BuiltinModuleName.EqualsOrdinal(fullName) || moduleResolution.IsSpecializedModule(fullName, modulePath); + } +} diff --git a/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs b/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs new file mode 100644 index 000000000..9b2b1502f --- /dev/null +++ b/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs @@ -0,0 +1,53 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using System.Linq; +using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Core.Collections; +using Microsoft.Python.Parsing.Ast; + +namespace Microsoft.Python.Analysis.Dependencies { + internal sealed class DependencyWalker : PythonWalker { + private readonly DependencyCollector _dependencyCollector; + + public HashSet Dependencies => _dependencyCollector.Dependencies; + + public DependencyWalker(IPythonModule module, PythonAst ast) { + _dependencyCollector = new DependencyCollector(module); + ast.Walk(this); + } + + public override bool Walk(ImportStatement import) { + var forceAbsolute = import.ForceAbsolute; + foreach (var moduleName in import.Names) { + var importNames = ImmutableArray.Empty; + foreach (var nameExpression in moduleName.Names) { + importNames = importNames.Add(nameExpression.Name); + _dependencyCollector.AddImport(importNames, forceAbsolute); + } + } + return false; + } + + public override bool Walk(FromImportStatement fromImport) { + var rootNames = fromImport.Root.Names.Select(n => n.Name).ToArray(); + var dotCount = fromImport.Root is RelativeModuleName relativeName ? relativeName.DotCount : 0; + _dependencyCollector.AddFromImport(rootNames, dotCount, fromImport.ForceAbsolute); + return false; + } + } +} diff --git a/src/Analysis/Ast/Impl/Caching/Definitions/ModuleStorageState.cs b/src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs similarity index 52% rename from src/Analysis/Ast/Impl/Caching/Definitions/ModuleStorageState.cs rename to src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs index bbf14c809..d0a911f5b 100644 --- a/src/Analysis/Ast/Impl/Caching/Definitions/ModuleStorageState.cs +++ b/src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs @@ -13,30 +13,16 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -namespace Microsoft.Python.Analysis.Caching { +using System.Collections.Generic; +using Microsoft.Python.Analysis.Analyzer; + +namespace Microsoft.Python.Analysis.Dependencies { /// - /// Describes module data stored in a database. + /// Implements provider that can supply list of imports to the dependency analysis. + /// Regular modules provide dependency from the AST, persistent/database modules + /// provide dependencies from their models. /// - public enum ModuleStorageState { - /// - /// Module does not exist in the database. - /// - DoesNotExist, - - /// - /// Partial data. This means module is still being analyzed - /// and the data on the module members is incomplete. - /// - Partial, - - /// - /// Modules exist and the analysis is complete. - /// - Complete, - - /// - /// Storage is corrupted or incompatible. - /// - Corrupted + internal interface IDependencyProvider { + HashSet GetDependencies(); } } diff --git a/src/Analysis/Ast/Impl/Dependencies/IDependencyResolver.cs b/src/Analysis/Ast/Impl/Dependencies/IDependencyResolver.cs index 02fdfbdfd..3816803e3 100644 --- a/src/Analysis/Ast/Impl/Dependencies/IDependencyResolver.cs +++ b/src/Analysis/Ast/Impl/Dependencies/IDependencyResolver.cs @@ -13,7 +13,6 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using Microsoft.Python.Analysis.Analyzer; using Microsoft.Python.Core.Collections; namespace Microsoft.Python.Analysis.Dependencies { diff --git a/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs b/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs index 1f802edd8..810632abc 100644 --- a/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs +++ b/src/Analysis/Ast/Impl/Documents/RunningDocumentTable.cs @@ -241,10 +241,10 @@ private DocumentEntry CreateDocument(ModuleCreationOptions mco) { IDocument document; switch (mco.ModuleType) { case ModuleType.Compiled when TryAddModulePath(mco): - document = new CompiledPythonModule(mco.ModuleName, ModuleType.Compiled, mco.FilePath, mco.Stub, _services); + document = new CompiledPythonModule(mco.ModuleName, ModuleType.Compiled, mco.FilePath, mco.Stub, mco.IsPersistent, _services); break; case ModuleType.CompiledBuiltin: - document = new CompiledBuiltinPythonModule(mco.ModuleName, mco.Stub, _services); + document = new CompiledBuiltinPythonModule(mco.ModuleName, mco.Stub, mco.IsPersistent, _services); break; case ModuleType.User: TryAddModulePath(mco); diff --git a/src/Analysis/Ast/Impl/Extensions/AnalysisExtensions.cs b/src/Analysis/Ast/Impl/Extensions/AnalysisExtensions.cs index 555a21567..6995f53b3 100644 --- a/src/Analysis/Ast/Impl/Extensions/AnalysisExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/AnalysisExtensions.cs @@ -22,6 +22,8 @@ namespace Microsoft.Python.Analysis { public static class AnalysisExtensions { + public static bool IsEmpty(this IDocumentAnalysis analysis) => analysis == null || analysis is EmptyAnalysis; + public static IScope FindScope(this IDocumentAnalysis analysis, SourceLocation location) => analysis.GlobalScope.FindScope(analysis.Document, location); diff --git a/src/Analysis/Ast/Impl/Extensions/PythonClassExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonClassExtensions.cs index 7ee3f4a85..d8705f253 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonClassExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonClassExtensions.cs @@ -61,8 +61,8 @@ public static bool IsPrivateMember(this IPythonClassType cls, string memberName) /// /// Gets specific type for the given generic type parameter, resolving bounds as well /// - public static bool GetSpecificType(this IPythonClassType cls, IGenericTypeParameter param, out IPythonType specificType) { - cls.GenericParameters.TryGetValue(param, out specificType); + public static bool GetSpecificType(this IPythonClassType cls, string paramName, out IPythonType specificType) { + cls.GenericParameters.TryGetValue(paramName, out specificType); // If type has not been found, check if the type parameter has an upper bound and use that if (specificType is IGenericTypeParameter gtp && gtp.Bound != null) { specificType = gtp.Bound; diff --git a/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs index 36f3ac42f..560d46332 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonFunctionExtensions.cs @@ -47,7 +47,7 @@ public static string GetQualifiedName(this IPythonClassMember cm, string baseNam } return cm.DeclaringModule.ModuleType == ModuleType.Builtins ? string.Join(".", s) - : $"{cm.DeclaringModule.Name}:{string.Join(".", s)}"; + : $"{cm.DeclaringModule.QualifiedName}:{string.Join(".", s)}"; } } } diff --git a/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs index e94bf3161..75a20a039 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonTypeExtensions.cs @@ -15,7 +15,6 @@ using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; -using Microsoft.Python.Core; namespace Microsoft.Python.Analysis { public static class PythonTypeExtensions { diff --git a/src/Analysis/Ast/Impl/Modules/BuiltinsPythonModule.cs b/src/Analysis/Ast/Impl/Modules/BuiltinsPythonModule.cs index 095df7033..72988f5a2 100644 --- a/src/Analysis/Ast/Impl/Modules/BuiltinsPythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/BuiltinsPythonModule.cs @@ -35,7 +35,7 @@ internal sealed class BuiltinsPythonModule : CompiledPythonModule, IBuiltinsPyth private IPythonType _boolType; public BuiltinsPythonModule(string moduleName, string filePath, IServiceContainer services) - : base(moduleName, ModuleType.Builtins, filePath, null, services) { } // TODO: builtins stub + : base(moduleName, ModuleType.Builtins, filePath, null, false, services) { } // TODO: builtins stub & persistence public override IMember GetMember(string name) => _hiddenNames.Contains(name) ? null : base.GetMember(name); diff --git a/src/Analysis/Ast/Impl/Modules/CompiledBuiltinPythonModule.cs b/src/Analysis/Ast/Impl/Modules/CompiledBuiltinPythonModule.cs index e020e7b26..500e4dbca 100644 --- a/src/Analysis/Ast/Impl/Modules/CompiledBuiltinPythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/CompiledBuiltinPythonModule.cs @@ -23,8 +23,8 @@ namespace Microsoft.Python.Analysis.Modules { /// Represents compiled module that is built into the language. /// internal sealed class CompiledBuiltinPythonModule : CompiledPythonModule { - public CompiledBuiltinPythonModule(string moduleName, IPythonModule stub, IServiceContainer services) - : base(moduleName, ModuleType.CompiledBuiltin, MakeFakeFilePath(moduleName, services), stub, services) { } + public CompiledBuiltinPythonModule(string moduleName, IPythonModule stub, bool isPersistent, IServiceContainer services) + : base(moduleName, ModuleType.CompiledBuiltin, MakeFakeFilePath(moduleName, services), stub, isPersistent, services) { } protected override string[] GetScrapeArguments(IPythonInterpreter interpreter) => !InstallPath.TryGetFile("scrape_module.py", out var sm) ? null : new [] { "-W", "ignore", "-B", "-E", sm, "-u8", Name }; diff --git a/src/Analysis/Ast/Impl/Modules/CompiledPythonModule.cs b/src/Analysis/Ast/Impl/Modules/CompiledPythonModule.cs index 1335a8ccf..662b25d30 100644 --- a/src/Analysis/Ast/Impl/Modules/CompiledPythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/CompiledPythonModule.cs @@ -26,8 +26,8 @@ namespace Microsoft.Python.Analysis.Modules { internal class CompiledPythonModule : PythonModule { protected IStubCache StubCache => Interpreter.ModuleResolution.StubCache; - public CompiledPythonModule(string moduleName, ModuleType moduleType, string filePath, IPythonModule stub, IServiceContainer services) - : base(moduleName, filePath, moduleType, stub, services) { } + public CompiledPythonModule(string moduleName, ModuleType moduleType, string filePath, IPythonModule stub, bool isPersistent, IServiceContainer services) + : base(moduleName, filePath, moduleType, stub, isPersistent, services) { } public override string Documentation => GetMember("__doc__").TryGetConstant(out var s) ? s : string.Empty; diff --git a/src/Analysis/Ast/Impl/Modules/Definitions/ModuleCreationOptions.cs b/src/Analysis/Ast/Impl/Modules/Definitions/ModuleCreationOptions.cs index f9c1dc9aa..f3b1058c8 100644 --- a/src/Analysis/Ast/Impl/Modules/Definitions/ModuleCreationOptions.cs +++ b/src/Analysis/Ast/Impl/Modules/Definitions/ModuleCreationOptions.cs @@ -14,7 +14,6 @@ // permissions and limitations under the License. using System; -using Microsoft.Python.Analysis.Core.Interpreter; using Microsoft.Python.Analysis.Types; namespace Microsoft.Python.Analysis.Modules { @@ -48,5 +47,10 @@ public sealed class ModuleCreationOptions { /// Module stub, if any. /// public IPythonModule Stub { get; set; } + + /// + /// Indicates if module is restored from database. + /// + public bool IsPersistent { get; set; } } } diff --git a/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs b/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs index a18205271..dba391b96 100644 --- a/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs +++ b/src/Analysis/Ast/Impl/Modules/Definitions/ModuleType.cs @@ -64,5 +64,6 @@ public enum ModuleType { public static class ModuleTypeExtensions { public static bool IsNonUserFile(this ModuleType type) => type == ModuleType.Library || type == ModuleType.Stub; public static bool IsCompiled(this ModuleType type) => type == ModuleType.Compiled || type == ModuleType.CompiledBuiltin; + public static bool CanBeCached(this ModuleType type) => type == ModuleType.Library || type == ModuleType.Compiled || type == ModuleType.CompiledBuiltin; } } diff --git a/src/Analysis/Ast/Impl/Modules/DependencyProvider.cs b/src/Analysis/Ast/Impl/Modules/DependencyProvider.cs new file mode 100644 index 000000000..ab77d7c4e --- /dev/null +++ b/src/Analysis/Ast/Impl/Modules/DependencyProvider.cs @@ -0,0 +1,53 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Caching; +using Microsoft.Python.Analysis.Dependencies; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Core; + +namespace Microsoft.Python.Analysis.Modules { + internal sealed class DependencyProvider: IDependencyProvider { + private readonly IPythonModule _module; + private readonly IModuleDatabaseService _dbService; + + public static IDependencyProvider Empty { get; } = new EmptyDependencyProvider(); + + public DependencyProvider(IPythonModule module, IServiceContainer services) { + _dbService = services.GetService(); + _module = module; + } + + #region IDependencyProvider + public HashSet GetDependencies() { + var ast = _module.GetAst(); + + if (_dbService != null && _dbService.TryRestoreDependencies(_module, out var dp)) { + return dp.GetDependencies(); + } + + // TODO: try and handle LoadFunctionDependencyModules functionality here. + var dw = new DependencyWalker(_module, ast); + return dw.Dependencies; + } + #endregion + + private sealed class EmptyDependencyProvider: IDependencyProvider { + public HashSet GetDependencies() => new HashSet(); + } + } +} diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.cs index c9c0b4576..a78501c59 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.cs @@ -22,7 +22,9 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis.Analyzer; -using Microsoft.Python.Analysis.Core.Interpreter; +using Microsoft.Python.Analysis.Analyzer.Evaluation; +using Microsoft.Python.Analysis.Caching; +using Microsoft.Python.Analysis.Dependencies; using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Specializations.Typing; @@ -86,12 +88,13 @@ protected PythonModule(string name, ModuleType moduleType, IServiceContainer ser SetDeclaringModule(this); } - protected PythonModule(string moduleName, string filePath, ModuleType moduleType, IPythonModule stub, IServiceContainer services) : + protected PythonModule(string moduleName, string filePath, ModuleType moduleType, IPythonModule stub, bool isPersistent, IServiceContainer services) : this(new ModuleCreationOptions { ModuleName = moduleName, FilePath = filePath, ModuleType = moduleType, - Stub = stub + Stub = stub, + IsPersistent = isPersistent }, services) { } internal PythonModule(ModuleCreationOptions creationOptions, IServiceContainer services) @@ -117,12 +120,13 @@ internal PythonModule(ModuleCreationOptions creationOptions, IServiceContainer s ContentState = State.Analyzed; } + IsPersistent = creationOptions.IsPersistent; InitializeContent(creationOptions.Content, 0); } #region IPythonType public string Name { get; } - public string QualifiedName => Name; + public string QualifiedName => ModuleType == ModuleType.Stub ? $"{Name}(stub)" : Name; public BuiltinTypeId TypeId => BuiltinTypeId.Module; public bool IsBuiltin => true; public bool IsAbstract => false; @@ -168,7 +172,7 @@ public virtual IEnumerable GetMemberNames() { if (valueType is PythonModule) { return false; // Do not re-export modules. } - if(valueType is IPythonFunctionType f && f.IsLambda()) { + if (valueType is IPythonFunctionType f && f.IsLambda()) { return false; } if (this is TypingModule) { @@ -178,7 +182,7 @@ public virtual IEnumerable GetMemberNames() { // assigned with types from typing. Example: // from typing import Any # do NOT export Any // x = Union[int, str] # DO export x - if(valueType?.DeclaringModule is TypingModule && v.Name == valueType.Name) { + if (valueType?.DeclaringModule is TypingModule && v.Name == valueType.Name) { return false; } return true; @@ -191,12 +195,10 @@ public virtual IEnumerable GetMemberNames() { public override LocationInfo Definition => new LocationInfo(Uri.ToAbsolutePath(), Uri, 0, 0); #endregion + #region IPythonModule public virtual string FilePath { get; protected set; } public virtual Uri Uri { get; } - - #region IPythonModule public IDocumentAnalysis Analysis { get; private set; } - public IPythonInterpreter Interpreter { get; } /// @@ -216,6 +218,11 @@ public virtual IEnumerable GetMemberNames() { /// wants to see library code and not a stub. /// public IPythonModule PrimaryModule { get; private set; } + + /// + /// Indicates if module is restored from database. + /// + public bool IsPersistent { get; } #endregion #region IDisposable @@ -259,7 +266,7 @@ public string Content { return _buffer.Text; } } - } + } #endregion #region Parsing @@ -399,6 +406,7 @@ public override void Add(string message, SourceSpan span, int errorCode, Severit #endregion #region IAnalyzable + public virtual IDependencyProvider DependencyProvider => new DependencyProvider(this, Services); public void NotifyAnalysisBegins() { lock (_syncObj) { @@ -522,7 +530,11 @@ private void InitializeContent(string content, int version) { private void LoadContent(string content, int version) { if (ContentState < State.Loading) { try { - content = content ?? LoadContent(); + if (IsPersistent) { + content = string.Empty; + } else { + content = content ?? LoadContent(); + } _buffer.Reset(version, content); ContentState = State.Loaded; } catch (IOException) { } catch (UnauthorizedAccessException) { } diff --git a/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs b/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs index e28964258..d81d6a85c 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs @@ -16,9 +16,8 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Python.Analysis.Core.Interpreter; +using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Dependencies; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; @@ -52,6 +51,7 @@ internal sealed class PythonVariableModule : LocatedMember, IPythonModule, IEqua public BuiltinTypeId TypeId => BuiltinTypeId.Module; public Uri Uri => Module?.Uri; public override PythonMemberType MemberType => PythonMemberType.Module; + public bool IsPersistent => Module?.IsPersistent == true; public PythonVariableModule(string name, IPythonInterpreter interpreter) : base(null) { Name = name; @@ -80,5 +80,9 @@ public PythonVariableModule(IPythonModule module): base(module) { public SourceLocation IndexToLocation(int index) => (Module as ILocationConverter)?.IndexToLocation(index) ?? default; public int LocationToIndex(SourceLocation location) => (Module as ILocationConverter)?.LocationToIndex(location) ?? default; #endregion + + #region IDependencyProvider + public IDependencyProvider DependencyProvider => (Module as IAnalyzable)?.DependencyProvider; + #endregion } } diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs index 24d56166f..26c0d3f83 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs @@ -62,9 +62,8 @@ protected override IPythonModule CreateModule(string name) { return null; } - IPythonModule module; if (moduleImport.ModulePath != null) { - module = GetRdt().GetDocument(new Uri(moduleImport.ModulePath)); + var module = GetRdt().GetDocument(new Uri(moduleImport.ModulePath)); if (module != null) { GetRdt().LockDocument(module.Uri); return module; @@ -72,31 +71,31 @@ protected override IPythonModule CreateModule(string name) { } var dbs = GetDbService(); - if (dbs != null && dbs.TryCreateModule(name, moduleImport.ModulePath, out module) != ModuleStorageState.DoesNotExist && module != null) { - SpecializeModule(name, s => module); - return module; - } - - // If there is a stub, make sure it is loaded and attached - // First check stub next to the module. - if (!TryCreateModuleStub(name, moduleImport.ModulePath, out var stub)) { - // If nothing found, try Typeshed. - stub = Interpreter.TypeshedResolution.GetOrLoadModule(moduleImport.IsBuiltin ? name : moduleImport.FullName); - } + moduleImport.IsPersistent = dbs != null && dbs.ModuleExistsInStorage(name, moduleImport.ModulePath); + + IPythonModule stub = null; + if (!moduleImport.IsPersistent) { + // If there is a stub, make sure it is loaded and attached + // First check stub next to the module. + if (!TryCreateModuleStub(name, moduleImport.ModulePath, out stub)) { + // If nothing found, try Typeshed. + stub = Interpreter.TypeshedResolution.GetOrLoadModule(moduleImport.IsBuiltin ? name : moduleImport.FullName); + } - // If stub is created and its path equals to module, return that stub as module - if (stub != null && stub.FilePath.PathEquals(moduleImport.ModulePath)) { - return stub; + // If stub is created and its path equals to module, return that stub as module + if (stub != null && stub.FilePath.PathEquals(moduleImport.ModulePath)) { + return stub; + } } if (moduleImport.IsBuiltin) { Log?.Log(TraceEventType.Verbose, "Create built-in compiled (scraped) module: ", name, Configuration.InterpreterPath); - return new CompiledBuiltinPythonModule(name, stub, Services); + return new CompiledBuiltinPythonModule(name, stub, moduleImport.IsPersistent, Services); } if (moduleImport.IsCompiled) { Log?.Log(TraceEventType.Verbose, "Create compiled (scraped): ", moduleImport.FullName, moduleImport.ModulePath, moduleImport.RootPath); - return new CompiledPythonModule(moduleImport.FullName, ModuleType.Compiled, moduleImport.ModulePath, stub, Services); + return new CompiledPythonModule(moduleImport.FullName, ModuleType.Compiled, moduleImport.ModulePath, stub, moduleImport.IsPersistent, Services); } Log?.Log(TraceEventType.Verbose, "Import: ", moduleImport.FullName, moduleImport.ModulePath); @@ -106,7 +105,8 @@ protected override IPythonModule CreateModule(string name) { ModuleName = moduleImport.FullName, ModuleType = moduleImport.IsLibrary ? ModuleType.Library : ModuleType.User, FilePath = moduleImport.ModulePath, - Stub = stub + Stub = stub, + IsPersistent = moduleImport.IsPersistent }; return GetRdt().AddModule(mco); @@ -161,15 +161,8 @@ public IPythonModule GetSpecializedModule(string fullName, bool allowCreation = /// /// Determines of module is specialized or exists in the database. /// - public bool IsSpecializedModule(string fullName, string modulePath = null) { - if (_specialized.ContainsKey(fullName)) { - return true; - } - if (modulePath != null && Path.GetExtension(modulePath) == ".pyi") { - return false; - } - return GetDbService()?.ModuleExistsInStorage(fullName, modulePath) == true; - } + public bool IsSpecializedModule(string fullName, string modulePath = null) + => _specialized.ContainsKey(fullName); internal async Task AddBuiltinTypesToPathResolverAsync(CancellationToken cancellationToken = default) { var analyzer = Services.GetService(); diff --git a/src/Analysis/Ast/Impl/Modules/SpecializedModule.cs b/src/Analysis/Ast/Impl/Modules/SpecializedModule.cs index 0e3e5fbcb..771acd25f 100644 --- a/src/Analysis/Ast/Impl/Modules/SpecializedModule.cs +++ b/src/Analysis/Ast/Impl/Modules/SpecializedModule.cs @@ -13,6 +13,7 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using Microsoft.Python.Analysis.Dependencies; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Core; using Microsoft.Python.Core.IO; @@ -31,11 +32,15 @@ namespace Microsoft.Python.Analysis.Modules { /// internal abstract class SpecializedModule : PythonModule { protected SpecializedModule(string name, string modulePath, IServiceContainer services) - : base(name, modulePath, ModuleType.Specialized, null, services) { } + : base(name, modulePath, ModuleType.Specialized, null, false, services) { } protected override string LoadContent() { // Exceptions are handled in the base return FileSystem.FileExists(FilePath) ? FileSystem.ReadTextWithRetry(FilePath) : string.Empty; } + + #region IAnalyzable + public override IDependencyProvider DependencyProvider => Modules.DependencyProvider.Empty; + #endregion } } diff --git a/src/Analysis/Ast/Impl/Modules/StubPythonModule.cs b/src/Analysis/Ast/Impl/Modules/StubPythonModule.cs index 83fa0ffbe..862daf817 100644 --- a/src/Analysis/Ast/Impl/Modules/StubPythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/StubPythonModule.cs @@ -25,7 +25,7 @@ internal class StubPythonModule : CompiledPythonModule { public bool IsTypeshed { get; } public StubPythonModule(string moduleName, string stubPath, bool isTypeshed, IServiceContainer services) - : base(moduleName, ModuleType.Stub, stubPath, null, services) { + : base(moduleName, ModuleType.Stub, stubPath, null, false, services) { IsTypeshed = isTypeshed; } diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs index c3f6c573a..7bea95f73 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericClassBase.cs @@ -37,10 +37,9 @@ internal GenericClassBase(IReadOnlyList typeArgs, IPython #region IPythonClassType public override bool IsGeneric => true; - public override IReadOnlyDictionary GenericParameters - => TypeParameters.ToDictionary(tp => tp, tp => tp as IPythonType ?? UnknownType); - - public override IPythonType CreateSpecificType(IArgumentSet args) + public override IReadOnlyDictionary GenericParameters + => TypeParameters.ToDictionary(tp => tp.Name, tp => tp as IPythonType ?? UnknownType); + public override IPythonType CreateSpecificType(IArgumentSet args) => new GenericClassBase(args.Arguments.Select(a => a.Value).OfType().ToArray(), DeclaringModule.Interpreter); #endregion diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs index e89b342c7..d59dd27ac 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/Types/GenericTypeParameter.cs @@ -33,7 +33,8 @@ public GenericTypeParameter( object covariant, object contravariant, IndexSpan indexSpan) - : base(name, new Location(declaringModule, indexSpan), GetDocumentation(name, constraints, bound, covariant, contravariant)) { + : base(name, new Location(declaringModule, indexSpan), + GetDocumentation(name, constraints, bound, covariant, contravariant, declaringModule)) { Constraints = constraints ?? Array.Empty(); Bound = bound; Covariant = covariant; @@ -106,8 +107,12 @@ private static IPythonType GetBoundType(IArgumentSet argSet) { switch (rawBound) { case IPythonType t: return t; - case IPythonConstant c when c.GetString() != null: - return eval.GetTypeFromString(c.GetString()); + case IPythonConstant c: + var s = c.GetString(); + if (!string.IsNullOrEmpty(s)) { + return eval.GetTypeFromString(s) ?? argSet.Eval.UnknownType; + } + return argSet.Eval.UnknownType; default: return rawBound.GetPythonType(); } @@ -118,7 +123,6 @@ public static IPythonType FromTypeVar(IArgumentSet argSet, IPythonModule declari return declaringModule.Interpreter.UnknownType; } - var args = argSet.Arguments; var constraintArgs = argSet.ListArgument?.Values ?? Array.Empty(); var name = argSet.GetArgumentValue("name")?.GetString(); @@ -135,9 +139,20 @@ public static IPythonType FromTypeVar(IArgumentSet argSet, IPythonModule declari return new GenericTypeParameter(name, declaringModule, constraints, bound, covariant, contravariant, indexSpan); } - private static string GetDocumentation(string name, IReadOnlyList constraints, object bound, object covariant, object contravariant) { + private static string GetDocumentation(string name, IReadOnlyList constraints, IPythonType bound, object covariant, object contravariant, IPythonModule declaringModule) { var constaintStrings = constraints != null ? constraints.Select(c => c.IsUnknown() ? "?" : c.Name) : Enumerable.Empty(); - var boundStrings = bound != null ? Enumerable.Repeat($"bound={bound}", 1) : Enumerable.Empty(); + + var boundStrings = Enumerable.Empty(); + if (bound != null) { + string boundName; + if(bound.DeclaringModule.Equals(declaringModule) || bound.DeclaringModule is IBuiltinsPythonModule) { + boundName = bound.Name; + } else { + boundName = $"{bound.DeclaringModule.Name}.{bound.Name}"; + } + boundStrings = Enumerable.Repeat($"bound={boundName}", 1); + } + var covariantStrings = covariant != null ? Enumerable.Repeat($"covariant={covariant}", 1) : Enumerable.Empty(); var contravariantStrings = contravariant != null ? Enumerable.Repeat($"contravariant={contravariant}", 1) : Enumerable.Empty(); diff --git a/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs b/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs index aa3d89372..839d7adf2 100644 --- a/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs +++ b/src/Analysis/Ast/Impl/Types/Collections/PythonCollectionType.cs @@ -75,8 +75,8 @@ public IPythonType CreateSpecificType(IArgumentSet typeArguments) { #region IGenericType public IReadOnlyList Parameters => (InnerType as IGenericType)?.Parameters ?? Array.Empty(); public bool IsGeneric => (InnerType as IPythonClassType)?.IsGeneric == true; - public IReadOnlyDictionary GenericParameters - => (InnerType as IPythonClassType)?.GenericParameters ?? EmptyDictionary.Instance; + public IReadOnlyDictionary GenericParameters + => (InnerType as IPythonClassType)?.GenericParameters ?? EmptyDictionary.Instance; #endregion #region IPythonClassType diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs b/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs index 697f3e862..2079cb2e2 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs +++ b/src/Analysis/Ast/Impl/Types/Definitions/IPythonClassType.cs @@ -41,6 +41,6 @@ public interface IPythonClassType : IPythonClassMember, IGenericType { /// If class is created off generic template, represents /// pairs of the generic parameter / actual supplied type. /// - IReadOnlyDictionary GenericParameters { get; } + IReadOnlyDictionary GenericParameters { get; } } } diff --git a/src/Analysis/Ast/Impl/Types/Definitions/IPythonModule.cs b/src/Analysis/Ast/Impl/Types/Definitions/IPythonModule.cs index 2c12d9f9a..168670be1 100644 --- a/src/Analysis/Ast/Impl/Types/Definitions/IPythonModule.cs +++ b/src/Analysis/Ast/Impl/Types/Definitions/IPythonModule.cs @@ -63,5 +63,10 @@ public interface IPythonModule : IPythonType { /// wants to see library code and not a stub. /// IPythonModule PrimaryModule { get; } + + /// + /// Indicates if module is restored from database. + /// + bool IsPersistent { get; } } } diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs index c74fe841b..9490079e6 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.Generics.cs @@ -30,12 +30,12 @@ internal partial class PythonClassType { private string _qualifiedNameWithParameters; // Qualified name with qualified parameter names for persistence. private Dictionary _specificTypeCache; - private Dictionary _genericParameters; + private Dictionary _genericParameters; private IReadOnlyList _parameters = new List(); #region IGenericType /// - /// List of unfilled generic type parameters. Represented as entries in the GenericParameters dictionary + /// List of unfilled generic type parameters. Represented as entries in the ActualGenericParameters dictionary /// that have both key and value as generic type parameters /// e.g /// {T, T} @@ -72,7 +72,7 @@ public virtual IPythonType CreateSpecificType(IArgumentSet args) { // Storing generic parameters allows methods returning generic types // to know what type parameter returns what specific type - classType.StoreGenericParameters(this, newGenericTypeParameters, genericTypeToSpecificType); + classType.StoreGenericParameters(this, newGenericTypeParameters.Select(p => p.Name).ToArray(), genericTypeToSpecificType); // Set generic name classType.SetNames(); @@ -115,7 +115,7 @@ public virtual IPythonType CreateSpecificType(IArgumentSet args) { // Look through generic type bases and see if any of their required type parameters // have received a specific type, and if so create specific type var st = gt.Parameters - .Select(p => classType.GenericParameters.TryGetValue(p, out var t) ? t : null) + .Select(p => classType.GenericParameters.TryGetValue(p.Name, out var t) ? t : null) .Where(p => !p.IsUnknown()) .ToArray(); if (st.Length > 0) { @@ -127,7 +127,7 @@ public virtual IPythonType CreateSpecificType(IArgumentSet args) { } // Set specific class bases - classType.SetBases(specificBases.Concat(newBases), args.Eval.CurrentScope); + classType.SetBases(specificBases.Concat(newBases), args.Eval?.CurrentScope); // Now that parameters are set, check if class is generic classType.SetGenericParameters(); // Transfer members from generic to specific type. @@ -168,13 +168,13 @@ private IGenericTypeParameter[] GetTypeParameters() { /// Given an argument set, returns a dictionary mapping generic type parameter to the supplied specific /// type from arguments. /// - private IReadOnlyDictionary GetSpecificTypes( + private IReadOnlyDictionary GetSpecificTypes( IArgumentSet args, IReadOnlyList genericTypeParameters, ICollection newBases ) { // For now, map each type parameter to itself, and we can fill in the value as we go - var genericTypeToSpecificType = genericTypeParameters.ToDictionary(gtp => gtp, gtp => gtp as IPythonType); + var genericTypeToSpecificType = genericTypeParameters.ToDictionary(gtp => gtp.Name, gtp => gtp as IPythonType); // Arguments passed are those of __init__ or copy constructor or index expression A[int, str, ...]. // The arguments do not necessarily match all of the declared generic parameters. @@ -190,11 +190,11 @@ ICollection newBases // __init__(self, v: _T), v is annotated as a generic type definition // Check if its generic type name matches any of the generic class parameters i.e. if there is // an argument like 'v: _T' we need to check if class has matching Generic[_T] or A[_T] in bases. - if (genericTypeToSpecificType.ContainsKey(argTypeDefinition)) { + if (genericTypeToSpecificType.ContainsKey(argTypeDefinition.Name)) { // TODO: Check if specific type matches generic type parameter constraints and report mismatches. // Assign specific type. if (arg.Value is IMember m && m.GetPythonType() is IPythonType pt) { - genericTypeToSpecificType[argTypeDefinition] = pt; + genericTypeToSpecificType[argTypeDefinition.Name] = pt; } else { // TODO: report supplied parameter is not a type. } @@ -241,8 +241,8 @@ ICollection newBases var type = member.GetPythonType(); if (!type.IsUnknown()) { var gtd = gtIndex < genericTypeParameters.Count ? genericTypeParameters[gtIndex] : null; - if (gtd != null && genericTypeToSpecificType.TryGetValue(gtd, out var s) && s is IGenericTypeParameter) { - genericTypeToSpecificType[gtd] = type; + if (gtd != null && genericTypeToSpecificType.TryGetValue(gtd.Name, out var s) && s is IGenericTypeParameter) { + genericTypeToSpecificType[gtd.Name] = type; } gtIndex++; } @@ -258,8 +258,8 @@ ICollection newBases /// internal void StoreGenericParameters( IPythonClassType templateClass, - IEnumerable newGenericParameters, - IReadOnlyDictionary genericToSpecificTypes) { + IEnumerable newGenericParameters, + IReadOnlyDictionary genericToSpecificTypes) { // copy original generic parameters over and try to fill them in _genericParameters = templateClass.GenericParameters.ToDictionary(k => k.Key, k => k.Value); @@ -280,7 +280,7 @@ internal void StoreGenericParameters( // class A(Generic[T]): // class B(A[U]) // A has T => U - _genericParameters[gp] = genericToSpecificTypes.TryGetValue(specificType, out var v) ? v : null; + _genericParameters[gp] = genericToSpecificTypes.TryGetValue(specificType.Name, out var v) ? v : null; } } } @@ -302,28 +302,28 @@ internal void StoreGenericParameters( /// Generic type (Generic[T1, T2, ...], A[T1, T2, ..], etc.). /// Argument value passed to the class constructor. /// Dictionary or name (T1) to specific type to populate. - private static void GetSpecificTypeFromArgumentValue(IGenericType gt, object argumentValue, IDictionary specificTypes) { + private void GetSpecificTypeFromArgumentValue(IGenericType gt, object argumentValue, IDictionary specificTypes) { switch (argumentValue) { case IPythonDictionary dict when gt.Parameters.Count == 2: var keyType = dict.Keys.FirstOrDefault()?.GetPythonType(); var valueType = dict.Values.FirstOrDefault()?.GetPythonType(); if (!keyType.IsUnknown()) { - specificTypes[gt.Parameters[0]] = keyType; + specificTypes[gt.Parameters[0].Name] = keyType; } if (!valueType.IsUnknown()) { - specificTypes[gt.Parameters[1]] = valueType; + specificTypes[gt.Parameters[1].Name] = valueType; } break; case IPythonIterable iter when gt.TypeId == BuiltinTypeId.List && gt.Parameters.Count == 1: var itemType = iter.GetIterator().Next.GetPythonType(); if (!itemType.IsUnknown()) { - specificTypes[gt.Parameters[0]] = itemType; + specificTypes[gt.Parameters[0].Name] = itemType; } break; case IPythonCollection coll when gt.TypeId == BuiltinTypeId.Tuple && gt.Parameters.Count >= 1: var itemTypes = coll.Contents.Select(m => m.GetPythonType()).ToArray(); for (var i = 0; i < Math.Min(itemTypes.Length, gt.Parameters.Count); i++) { - specificTypes[gt.Parameters[i]] = itemTypes[i]; + specificTypes[gt.Parameters[i].Name] = itemTypes[i]; } break; } @@ -361,7 +361,7 @@ private void SetClassMembers(IPythonClassType templateClass, IArgumentSet args) specificType = tt.CreateSpecificType(args); break; case IGenericTypeParameter gtd: - GenericParameters.TryGetValue(gtd, out specificType); + GenericParameters.TryGetValue(gtd.Name, out specificType); break; } diff --git a/src/Analysis/Ast/Impl/Types/PythonClassType.cs b/src/Analysis/Ast/Impl/Types/PythonClassType.cs index a21cd81a5..0f35ff1d9 100644 --- a/src/Analysis/Ast/Impl/Types/PythonClassType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonClassType.cs @@ -214,8 +214,8 @@ public IReadOnlyList Mro { /// class B(A[int, str]): ... /// Has the map {T: int, K: str} /// - public virtual IReadOnlyDictionary GenericParameters => - _genericParameters ?? EmptyDictionary.Instance; + public virtual IReadOnlyDictionary GenericParameters => + _genericParameters ?? EmptyDictionary.Instance; #endregion @@ -226,6 +226,13 @@ internal override void SetDocumentation(string documentation) { DocumentationSource = ClassDocumentationSource.Class; } + /// + /// Sets class bases. If scope is provided, detects loops in base classes and removes them. + /// + /// List of base types. + /// Current scope to look up base types. + /// Can be null if class is restored from database, in which case + /// there is no need to try and disambiguate bases. internal void SetBases(IEnumerable bases, IScope currentScope = null) { if (_bases != null) { return; // Already set diff --git a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs index d5e122867..d50c55fce 100644 --- a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs +++ b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs @@ -161,7 +161,7 @@ private IMember CreateSpecificReturnFromClassType(IPythonClassType selfClassType // -> A[_T1, _T2, ...] // Match arguments IReadOnlyList typeArgs = null; - var classGenericParameters = selfClassType?.GenericParameters.Keys.ToArray() ?? Array.Empty(); + var classGenericParameters = selfClassType?.GenericParameters.Keys.ToArray() ?? Array.Empty(); if (classGenericParameters.Length > 0 && selfClassType != null) { // Declaring class is specific and provides definitions of generic parameters typeArgs = classGenericParameters @@ -181,7 +181,7 @@ private IMember CreateSpecificReturnFromClassType(IPythonClassType selfClassType } private IMember CreateSpecificReturnFromTypeVar(IPythonClassType selfClassType, IArgumentSet args, IGenericTypeParameter returnType) { - if (selfClassType.GetSpecificType(returnType, out var specificType)) { + if (selfClassType.GetSpecificType(returnType.Name, out var specificType)) { return new PythonInstance(specificType); } @@ -189,10 +189,10 @@ private IMember CreateSpecificReturnFromTypeVar(IPythonClassType selfClassType, var baseType = selfClassType.Mro .OfType() .Skip(1) - .FirstOrDefault(b => b.GetMember(ClassMember.Name) != null && b.GenericParameters.ContainsKey(returnType)); + .FirstOrDefault(b => b.GetMember(ClassMember.Name) != null && b.GenericParameters.ContainsKey(returnType.Name)); // Try and infer return value from base class - if (baseType != null && baseType.GetSpecificType(returnType, out specificType)) { + if (baseType != null && baseType.GetSpecificType(returnType.Name, out specificType)) { return new PythonInstance(specificType); } diff --git a/src/Analysis/Ast/Impl/Types/PythonType.cs b/src/Analysis/Ast/Impl/Types/PythonType.cs index 8db2ab7cd..8058a08c8 100644 --- a/src/Analysis/Ast/Impl/Types/PythonType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonType.cs @@ -23,7 +23,7 @@ namespace Microsoft.Python.Analysis.Types { [DebuggerDisplay("{" + nameof(Name) + "}")] - internal class PythonType : LocatedMember, IPythonType {//, IEquatable { + internal class PythonType : LocatedMember, IPythonType { private readonly object _lock = new object(); private Dictionary _members; private BuiltinTypeId _typeId; @@ -159,16 +159,14 @@ internal IMember AddMember(string name, IMember member, bool overwrite) { } } - internal void MakeReadOnly() => _readonly = true; + internal void MakeReadOnly() { + lock (_lock) { + _readonly = true; + } + } internal bool IsHidden => ContainsMember("__hidden__"); protected bool ContainsMember(string name) => Members.ContainsKey(name); protected IPythonType UnknownType => DeclaringModule.Interpreter.UnknownType; - - //public bool Equals(IPythonType other) => PythonTypeComparer.Instance.Equals(this, other); - - //public override bool Equals(object obj) - // => obj is IPythonType pt && PythonTypeComparer.Instance.Equals(this, pt); - //public override int GetHashCode() => 0; } } diff --git a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs index 876886d81..77887be1a 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs @@ -138,8 +138,9 @@ public void HaveSameMembersAs(IMember other) { } subjectMemberType.MemberType.Should().Be(otherMemberType.MemberType); + Debug.Assert(subjectMemberType.MemberType == otherMemberType.MemberType); - if(subjectMemberType is IPythonClassType subjectClass) { + if (subjectMemberType is IPythonClassType subjectClass) { var otherClass = otherMemberType as IPythonClassType; otherClass.Should().NotBeNull(); @@ -163,8 +164,10 @@ public void HaveSameMembersAs(IMember other) { case PythonMemberType.Class: // Restored collections (like instance of tuple) turn into classes // rather than into collections with content since we don't track - // collection content in libraries. - subjectMemberType.QualifiedName.Should().Be(otherMemberType.QualifiedName); + // collection content in libraries. We don't compare qualified names + // since original module may be source or a stub and that is not + // preserved during restore. + // subjectMemberType.QualifiedName.Should().Be(otherMemberType.QualifiedName); break; case PythonMemberType.Function: case PythonMemberType.Method: diff --git a/src/Analysis/Ast/Test/TypeshedTests.cs b/src/Analysis/Ast/Test/TypeshedTests.cs index 9b1a72c6f..9ab18657b 100644 --- a/src/Analysis/Ast/Test/TypeshedTests.cs +++ b/src/Analysis/Ast/Test/TypeshedTests.cs @@ -45,7 +45,7 @@ import sys e1, e2, e3 = sys.exc_info() "; var analysis = await GetAnalysisAsync(code); - // sys.exc_info() -> (exception_type, exception_value, traceback) + // def exc_info() -> Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]: ... var f = analysis.Should() .HaveVariable("e1").OfType(BuiltinTypeId.Type) .And.HaveVariable("e2").OfType("BaseException") diff --git a/src/Analysis/Ast/Test/TypingTests.cs b/src/Analysis/Ast/Test/TypingTests.cs index 2df9a7df7..31d9fd1de 100644 --- a/src/Analysis/Ast/Test/TypingTests.cs +++ b/src/Analysis/Ast/Test/TypingTests.cs @@ -83,10 +83,25 @@ from typing import TypeVar [TestMethod, Priority(0)] - public async Task KeywordArgMixDocCheck() { + public async Task TypeVarBoundToUnknown() { const string code = @" from typing import TypeVar X = TypeVar('X', bound='hello', covariant=True) +"; + var analysis = await GetAnalysisAsync(code); + analysis.Should().HaveVariable("X") + .Which.Value.Should().HaveDocumentation("TypeVar('X', bound=Unknown, covariant=True)"); + analysis.Should().HaveGenericVariable("X"); + } + + [TestMethod, Priority(0)] + public async Task TypeVarBoundToStringName() { + const string code = @" +from typing import TypeVar + +X = TypeVar('X', bound='hello', covariant=True) + +class hello: ... "; var analysis = await GetAnalysisAsync(code); analysis.Should().HaveVariable("X") diff --git a/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs b/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs index 132d06ff1..1c7dcfaed 100644 --- a/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs +++ b/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs @@ -13,16 +13,21 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System.Collections.Generic; using System.Linq; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Core.DependencyResolution { public static class AstUtilities { public static IImportSearchResult FindImports(this PathResolverSnapshot pathResolver, string modulePath, FromImportStatement fromImportStatement) { - var rootNames = fromImportStatement.Root.Names.Select(n => n.Name); - return fromImportStatement.Root is RelativeModuleName relativeName - ? pathResolver.GetImportsFromRelativePath(modulePath, relativeName.DotCount, rootNames) - : pathResolver.GetImportsFromAbsoluteName(modulePath, rootNames, fromImportStatement.ForceAbsolute); + var rootNames = fromImportStatement.Root.Names.Select(n => n.Name).ToArray(); + var dotCount = fromImportStatement.Root is RelativeModuleName relativeName ? relativeName.DotCount : 0; + return pathResolver.FindImports(modulePath, rootNames, dotCount, fromImportStatement.ForceAbsolute); } + + public static IImportSearchResult FindImports(this PathResolverSnapshot pathResolver, string modulePath, IReadOnlyList rootNames, int dotCount, bool forceAbsolute) + => dotCount > 0 + ? pathResolver.GetImportsFromRelativePath(modulePath, dotCount, rootNames) + : pathResolver.GetImportsFromAbsoluteName(modulePath, rootNames, forceAbsolute); } } diff --git a/src/Analysis/Core/Impl/DependencyResolution/ModuleImport.cs b/src/Analysis/Core/Impl/DependencyResolution/ModuleImport.cs index b229ab80e..9d95188e3 100644 --- a/src/Analysis/Core/Impl/DependencyResolution/ModuleImport.cs +++ b/src/Analysis/Core/Impl/DependencyResolution/ModuleImport.cs @@ -27,6 +27,7 @@ public class ModuleImport : IImportChildrenSource { public bool IsCompiled { get; } public bool IsLibrary { get; } public bool IsBuiltin => IsCompiled && ModulePath == null; + public bool IsPersistent { get; set; } public ModuleImport(IImportChildrenSource childrenSource, string name, string fullName, string rootPath, string modulePath, long moduleFileSize, bool isCompiled, bool isLibrary) { _childrenSource = childrenSource; diff --git a/src/Caching/Impl/Models/ClassModel.cs b/src/Caching/Impl/Models/ClassModel.cs index 2b5aa0a70..527816157 100644 --- a/src/Caching/Impl/Models/ClassModel.cs +++ b/src/Caching/Impl/Models/ClassModel.cs @@ -40,7 +40,7 @@ internal sealed class ClassModel : MemberModel { public ClassModel[] Classes { get; set; } /// - /// FormalGenericParameters of the Generic[...] base class, if any. + /// GenericParameters of the Generic[...] base class, if any. /// public string[] GenericBaseParameters { get; set; } /// @@ -106,7 +106,6 @@ public ClassModel(IPythonClassType cls) { // Only persist documentation from this class, leave bases or __init__ alone. Documentation = (cls as PythonClassType)?.DocumentationSource == PythonClassType.ClassDocumentationSource.Class ? cls.Documentation : null; - var ntBases = cls.Bases.OfType().ToArray(); NamedTupleBases = ntBases.Select(b => new NamedTupleModel(b)).ToArray(); @@ -126,17 +125,16 @@ public ClassModel(IPythonClassType cls) { GenericBaseParameters = GenericBaseParameters ?? Array.Empty(); GenericParameterValues = cls.GenericParameters - .Select(p => new GenericParameterValueModel { Name = p.Key.Name, Type = p.Value.GetPersistentQualifiedName() }) + .Select(p => new GenericParameterValueModel { Name = p.Key, Type = p.Value.GetPersistentQualifiedName() }) .ToArray(); } - protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) { - if (_cls != null) { + public override IMember Create(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) { + if(_cls != null) { return _cls; } _cls = new PythonClassType(Name, new Location(mf.Module, IndexSpan.ToSpan())); - - var bases = CreateBases(mf); + var bases = CreateBases(mf, gs); _cls.SetBases(bases); _cls.SetDocumentation(Documentation); @@ -146,37 +144,32 @@ protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringTy _cls, _cls.GenericParameters.Keys.ToArray(), GenericParameterValues.ToDictionary( - k => _cls.GenericParameters.Keys.First(x => x.Name == k.Name), + k => _cls.GenericParameters.Keys.First(x => x == k.Name), v => mf.ConstructType(v.Type) ) ); } - foreach (var f in Methods) { - var m = f.Construct(mf, _cls); - _cls.AddMember(f.Name, m, false); - } - - foreach (var p in Properties) { - var m = p.Construct(mf, _cls); - _cls.AddMember(p.Name, m, false); - } - - foreach (var c in Classes) { - var m = c.Construct(mf, _cls); - _cls.AddMember(c.Name, m, false); + var all = Classes.Concat(Properties).Concat(Methods).Concat(Fields); + foreach (var m in all) { + _cls.AddMember(m.Name, m.Create(mf, _cls, gs), false); } + return _cls; + } - foreach (var vm in Fields) { - var m = vm.Construct(mf, _cls); - _cls.AddMember(vm.Name, m, false); + public override void Populate(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) { + var all = Classes.Concat(Properties).Concat(Methods).Concat(Fields); + foreach (var m in all) { + m.Populate(mf, _cls, gs); } - - return _cls; } - private IPythonType[] CreateBases(ModuleFactory mf) { - var ntBases = NamedTupleBases.Select(ntb => ntb.Construct(mf, _cls)).OfType().ToArray(); + private IEnumerable CreateBases(ModuleFactory mf, IGlobalScope gs) { + var ntBases = NamedTupleBases.Select(ntb => { + var n = ntb.Create(mf, _cls, gs); + ntb.Populate(mf, _cls, gs); + return n; + }).OfType().ToArray(); var is3x = mf.Module.Interpreter.LanguageVersion.Is3x(); var basesNames = Bases.Select(b => is3x && b == "object" ? null : b).ExcludeDefault().ToArray(); @@ -184,11 +177,11 @@ private IPythonType[] CreateBases(ModuleFactory mf) { if (GenericBaseParameters.Length > 0) { // Generic class. Need to reconstruct generic base so code can then - // create specific types off the generic class. + // create specific types off the generic class. var genericBase = bases.OfType().FirstOrDefault(b => b.Name == "Generic"); if (genericBase != null) { - var typeVars = GenericBaseParameters.Select(n => mf.Module.GlobalScope.Variables[n]?.Value).OfType().ToArray(); - Debug.Assert(typeVars.Length > 0, "Class generic type parameters were not defined in the module during restore"); + var typeVars = GenericBaseParameters.Select(n => gs.Variables[n]?.Value).OfType().ToArray(); + //Debug.Assert(typeVars.Length > 0, "Class generic type parameters were not defined in the module during restore"); if (typeVars.Length > 0) { var genericWithParameters = genericBase.CreateSpecificType(new ArgumentSet(typeVars, null, null)); if (genericWithParameters != null) { diff --git a/src/Caching/Impl/Models/FromImportModel.cs b/src/Caching/Impl/Models/FromImportModel.cs new file mode 100644 index 000000000..bda4d9774 --- /dev/null +++ b/src/Caching/Impl/Models/FromImportModel.cs @@ -0,0 +1,25 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +namespace Microsoft.Python.Analysis.Caching.Models { + /// + /// Represents from import statement for dependency resolution. + /// + internal sealed class FromImportModel { + public string[] RootNames { get; set; } + public int DotCount { get; set; } + public bool ForceAbsolute { get; set; } + } +} diff --git a/src/Caching/Impl/Models/FunctionModel.cs b/src/Caching/Impl/Models/FunctionModel.cs index 88da25f78..7c50a97cd 100644 --- a/src/Caching/Impl/Models/FunctionModel.cs +++ b/src/Caching/Impl/Models/FunctionModel.cs @@ -17,6 +17,8 @@ using System.Diagnostics; using System.Linq; using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; + // ReSharper disable AutoPropertyCanBeMadeGetOnly.Global // ReSharper disable MemberCanBePrivate.Global @@ -33,22 +35,18 @@ public FunctionModel(IPythonFunctionType func) : base(func) { Overloads = func.Overloads.Select(FromOverload).ToArray(); } - protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) { - if (_function != null) { - return _function; - } - _function = new PythonFunctionType(Name, new Location(mf.Module, IndexSpan.ToSpan()), declaringType, Documentation); + public override IMember Create(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) + => _function ?? (_function = new PythonFunctionType(Name, new Location(mf.Module, IndexSpan.ToSpan()), declaringType, Documentation)); - // Create inner functions and classes first since function - // may be returning one of them. - foreach (var model in Functions) { - var f = model.Construct(mf, _function); - _function.AddMember(Name, f, overwrite: true); - } + public override void Populate(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) { + // Create inner functions and classes first since function may be returning one of them. + var all = Classes.Concat(Functions).ToArray(); - foreach (var cm in Classes) { - var c = cm.Construct(mf, _function); - _function.AddMember(cm.Name, c, overwrite: true); + foreach (var model in all) { + _function.AddMember(Name, model.Create(mf, _function, gs), overwrite: true); + } + foreach (var model in all) { + model.Populate(mf, _function, gs); } foreach (var om in Overloads) { @@ -58,9 +56,8 @@ protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringTy o.SetParameters(om.Parameters.Select(p => ConstructParameter(mf, p)).ToArray()); _function.AddOverload(o); } - - return _function; } + private IParameterInfo ConstructParameter(ModuleFactory mf, ParameterModel pm) => new ParameterInfo(pm.Name, mf.ConstructType(pm.Type), pm.Kind, mf.ConstructMember(pm.DefaultValue)); diff --git a/src/Caching/Impl/Models/ImportModel.cs b/src/Caching/Impl/Models/ImportModel.cs new file mode 100644 index 000000000..e99b58fcf --- /dev/null +++ b/src/Caching/Impl/Models/ImportModel.cs @@ -0,0 +1,24 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +namespace Microsoft.Python.Analysis.Caching.Models { + /// + /// Represents import statement for dependency resolution. + /// + internal sealed class ImportModel { + public string[] ModuleNames { get; set; } + public bool ForceAbsolute { get; set; } + } +} diff --git a/src/Caching/Impl/Models/MemberModel.cs b/src/Caching/Impl/Models/MemberModel.cs index 24d512fcf..e7ce43282 100644 --- a/src/Caching/Impl/Models/MemberModel.cs +++ b/src/Caching/Impl/Models/MemberModel.cs @@ -17,6 +17,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; // ReSharper disable MemberCanBeProtected.Global // ReSharper disable UnusedAutoPropertyAccessor.Global @@ -43,13 +44,17 @@ internal abstract class MemberModel { /// public IndexSpanModel IndexSpan { get; set; } - [NonSerialized] - private IMember _member; - - public IMember Construct(ModuleFactory mf, IPythonType declaringType) - => _member ?? (_member = ReConstruct(mf, declaringType)); - protected abstract IMember ReConstruct(ModuleFactory mf, IPythonType declaringType); + /// + /// Create member for declaration but does not construct its parts just yet. + /// Used as a first pass in two-pass handling of forward declarations. + /// + public abstract IMember Create(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs); + /// + /// Populate member with content, such as create class methods, etc. + /// + public abstract void Populate(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs); + public virtual MemberModel GetModel(string name) => GetMemberModels().FirstOrDefault(m => m.Name == name); protected virtual IEnumerable GetMemberModels() => Enumerable.Empty(); } diff --git a/src/Caching/Impl/Models/ModuleModel.cs b/src/Caching/Impl/Models/ModuleModel.cs index dfe859d35..c67837cb3 100644 --- a/src/Caching/Impl/Models/ModuleModel.cs +++ b/src/Caching/Impl/Models/ModuleModel.cs @@ -21,6 +21,7 @@ using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +using Microsoft.Python.Parsing.Ast; // ReSharper disable MemberCanBePrivate.Global namespace Microsoft.Python.Analysis.Caching.Models { @@ -49,11 +50,16 @@ internal sealed class ModuleModel : MemberModel { /// public int FileSize { get; set; } + public ImportModel[] Imports { get; set; } + public FromImportModel[] FromImports { get; set; } + public ImportModel[] StubImports { get; set; } + public FromImportModel[] StubFromImports { get; set; } + [NonSerialized] private Dictionary _modelCache; public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceContainer services, AnalysisCachingLevel options) { var uniqueId = analysis.Document.GetUniqueId(services, options); - if(uniqueId == null) { + if (uniqueId == null) { // Caching level setting does not permit this module to be persisted. return null; } @@ -68,9 +74,9 @@ public static ModuleModel FromAnalysis(IDocumentAnalysis analysis, IServiceConta // as well as variables that are declarations. var exportedNames = new HashSet(analysis.Document.GetMemberNames()); foreach (var v in analysis.GlobalScope.Variables - .Where(v => exportedNames.Contains(v.Name) || - v.Source == VariableSource.Declaration || - v.Source == VariableSource.Builtin || + .Where(v => exportedNames.Contains(v.Name) || + v.Source == VariableSource.Declaration || + v.Source == VariableSource.Builtin || v.Source == VariableSource.Generic)) { if (v.Value is IGenericTypeParameter && !typeVars.ContainsKey(v.Name)) { @@ -115,10 +121,20 @@ when cls.DeclaringModule.Equals(analysis.Document) || cls.DeclaringModule.Equals } } + // Take dependencies from imports. If module has stub we should also take + // dependencies from there since persistent state is based on types that + // are combination of stub and the module. Sometimes stub may import more + // and we must make sure dependencies are restored before the module. + var primaryDependencyWalker = new DependencyWalker(analysis.Ast); + var stubDependencyWalker = analysis.Document.Stub != null ? new DependencyWalker(analysis.Document.Stub.Analysis.Ast) : null; + var stubImports = stubDependencyWalker?.Imports ?? Enumerable.Empty(); + var stubFromImports = stubDependencyWalker?.FromImports ?? Enumerable.Empty(); + return new ModuleModel { Id = uniqueId.GetStableHash(), UniqueId = uniqueId, Name = analysis.Document.Name, + QualifiedName = analysis.Document.QualifiedName, Documentation = analysis.Document.Documentation, Functions = functions.Values.ToArray(), Variables = variables.Values.ToArray(), @@ -129,7 +145,11 @@ when cls.DeclaringModule.Equals(analysis.Document) || cls.DeclaringModule.Equals EndIndex = l.EndIndex, Kind = l.Kind }).ToArray(), - FileSize = analysis.Ast.EndIndex + FileSize = analysis.Ast.EndIndex, + Imports = primaryDependencyWalker.Imports.ToArray(), + FromImports = primaryDependencyWalker.FromImports.ToArray(), + StubImports = stubImports.ToArray(), + StubFromImports = stubFromImports.ToArray() }; } @@ -149,8 +169,6 @@ private static FunctionModel GetFunctionModel(IDocumentAnalysis analysis, IVaria return null; } - protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) => throw new NotImplementedException(); - public override MemberModel GetModel(string name) { if (_modelCache == null) { var models = TypeVars.Concat(NamedTuples).Concat(Classes).Concat(Functions).Concat(Variables); @@ -160,8 +178,38 @@ public override MemberModel GetModel(string name) { _modelCache[m.Name] = m; } } - return _modelCache.TryGetValue(name, out var model) ? model : null; } + + public override IMember Create(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) => throw new NotImplementedException(); + public override void Populate(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) => throw new NotImplementedException(); + + private sealed class DependencyWalker : PythonWalker { + public List Imports { get; } = new List(); + public List FromImports { get; } = new List(); + + public DependencyWalker(PythonAst ast) { + ast.Walk(this); + } + + public override bool Walk(ImportStatement import) { + var model = new ImportModel { + ForceAbsolute = import.ForceAbsolute, + ModuleNames = import.Names.SelectMany(mn => mn.Names).Select(n => n.Name).ToArray() + }; + Imports.Add(model); + return false; + } + + public override bool Walk(FromImportStatement fromImport) { + var model = new FromImportModel { + ForceAbsolute = fromImport.ForceAbsolute, + RootNames = fromImport.Root.Names.Select(n => n.Name).ToArray(), + DotCount = fromImport.Root is RelativeModuleName rn ? rn.DotCount : 0 + }; + FromImports.Add(model); + return false; + } + } } } diff --git a/src/Caching/Impl/Models/NamedTupleModel.cs b/src/Caching/Impl/Models/NamedTupleModel.cs index 5f17059c9..82fed074b 100644 --- a/src/Caching/Impl/Models/NamedTupleModel.cs +++ b/src/Caching/Impl/Models/NamedTupleModel.cs @@ -19,6 +19,7 @@ using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Specializations.Typing.Types; using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; namespace Microsoft.Python.Analysis.Caching.Models { @@ -41,7 +42,7 @@ public NamedTupleModel(ITypingNamedTupleType nt) { ItemTypes = nt.ItemTypes.Select(t => t.QualifiedName).ToArray(); } - protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) { + public override IMember Create(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) { if (_namedTuple != null) { return _namedTuple; } @@ -50,5 +51,7 @@ protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringTy _namedTuple = new NamedTupleType(Name, ItemNames, itemTypes, mf.Module, IndexSpan.ToSpan()); return _namedTuple; } + + public override void Populate(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) { } } } diff --git a/src/Caching/Impl/Models/PropertyModel.cs b/src/Caching/Impl/Models/PropertyModel.cs index a5b33e025..e608584e0 100644 --- a/src/Caching/Impl/Models/PropertyModel.cs +++ b/src/Caching/Impl/Models/PropertyModel.cs @@ -15,6 +15,8 @@ using System; using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; + // ReSharper disable AutoPropertyCanBeMadeGetOnly.Global // ReSharper disable MemberCanBePrivate.Global @@ -30,19 +32,16 @@ public PropertyModel(IPythonPropertyType prop) : base(prop) { ReturnType = prop.ReturnType.GetPersistentQualifiedName(); } - protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) { - if (_property != null) { - return _property; - } - _property = new PythonPropertyType(Name, new Location(mf.Module, IndexSpan.ToSpan()), declaringType, (Attributes & FunctionAttributes.Abstract) != 0); + public override IMember Create(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) + => _property ?? (_property = new PythonPropertyType(Name, new Location(mf.Module, IndexSpan.ToSpan()), declaringType, (Attributes & FunctionAttributes.Abstract) != 0)); + + public override void Populate(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) { _property.SetDocumentation(Documentation); var o = new PythonFunctionOverload(Name, mf.DefaultLocation); o.SetDocumentation(Documentation); o.SetReturnValue(mf.ConstructMember(ReturnType), true); _property.AddOverload(o); - - return _property; } } } diff --git a/src/Caching/Impl/Models/TypeVarModel.cs b/src/Caching/Impl/Models/TypeVarModel.cs index a3f5c4fc5..e630d801f 100644 --- a/src/Caching/Impl/Models/TypeVarModel.cs +++ b/src/Caching/Impl/Models/TypeVarModel.cs @@ -45,9 +45,11 @@ public static TypeVarModel FromGeneric(IVariable v) { }; } - protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) + public override IMember Create(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) => new GenericTypeParameter(Name, mf.Module, Constraints.Select(mf.ConstructType).ToArray(), mf.ConstructType(Bound), Covariant, Contravariant, default); + + public override void Populate(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) { } } } diff --git a/src/Caching/Impl/Models/VariableModel.cs b/src/Caching/Impl/Models/VariableModel.cs index c3e2696cf..892dac8ac 100644 --- a/src/Caching/Impl/Models/VariableModel.cs +++ b/src/Caching/Impl/Models/VariableModel.cs @@ -23,7 +23,7 @@ namespace Microsoft.Python.Analysis.Caching.Models { [Serializable] [DebuggerDisplay("v:{Name} = {Value}")] - internal sealed class VariableModel: MemberModel { + internal sealed class VariableModel : MemberModel { public string Value { get; set; } public static VariableModel FromVariable(IVariable v) => new VariableModel { @@ -49,9 +49,11 @@ internal sealed class VariableModel: MemberModel { Value = t.GetPersistentQualifiedName() }; - protected override IMember ReConstruct(ModuleFactory mf, IPythonType declaringType) { + public override IMember Create(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) { var m = mf.ConstructMember(Value) ?? mf.Module.Interpreter.UnknownType; return new Variable(Name, m, VariableSource.Declaration, new Location(mf.Module, IndexSpan?.ToSpan() ?? default)); } + + public override void Populate(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) { } } } diff --git a/src/Caching/Impl/ModuleDatabase.cs b/src/Caching/Impl/ModuleDatabase.cs index 97af51827..a58ee0118 100644 --- a/src/Caching/Impl/ModuleDatabase.cs +++ b/src/Caching/Impl/ModuleDatabase.cs @@ -14,12 +14,15 @@ // permissions and limitations under the License. using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; using LiteDB; +using Microsoft.Python.Analysis.Analyzer; using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Dependencies; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core; @@ -27,9 +30,12 @@ using Microsoft.Python.Core.Logging; namespace Microsoft.Python.Analysis.Caching { - public sealed class ModuleDatabase : IModuleDatabaseService { + internal sealed class ModuleDatabase : IModuleDatabaseService { private const int _databaseFormatVersion = 1; + private readonly Dictionary _dependencies = new Dictionary(); + private readonly object _lock = new object(); + private readonly IServiceContainer _services; private readonly ILogger _log; private readonly IFileSystem _fs; @@ -39,56 +45,56 @@ public ModuleDatabase(IServiceContainer services) { _services = services; _log = services.GetService(); _fs = services.GetService(); - + var cfs = services.GetService(); _databaseFolder = Path.Combine(cfs.CacheFolder, $"analysis.v{_databaseFormatVersion}"); } /// - /// Retrieves module representation from module index database - /// or null if module does not exist. + /// Retrieves dependencies from the module persistent state. /// - /// Module name. If the name is not qualified - /// the module will ge resolved against active Python version. - /// Module file path. - /// Python module. - /// Module storage state - public ModuleStorageState TryCreateModule(string moduleName, string filePath, out IPythonModule module) { - module = null; + /// Python module to restore analysis for. + /// Python module dependency provider. + public bool TryRestoreDependencies(IPythonModule module, out IDependencyProvider dp) { + dp = null; - if (GetCachingLevel() == AnalysisCachingLevel.None) { - return ModuleStorageState.DoesNotExist; + if (GetCachingLevel() == AnalysisCachingLevel.None || !module.ModuleType.CanBeCached()) { + return false; } - // We don't cache results here. Module resolution service decides when to call in here - // and it is responsible of overall management of the loaded Python modules. - for (var retries = 50; retries > 0; --retries) { - try { - // TODO: make combined db rather than per module? - var dbPath = FindDatabaseFile(moduleName, filePath); - if (string.IsNullOrEmpty(dbPath)) { - return ModuleStorageState.DoesNotExist; - } + lock (_lock) { + if (_dependencies.TryGetValue(module.Name, out dp)) { + return true; + } + if (FindModuleModel(module.Name, module.FilePath, out var model)) { + dp = new DependencyProvider(module, model); + _dependencies[module.Name] = dp; + return true; + } + } + return false; + } - using (var db = new LiteDatabase(dbPath)) { - if (!db.CollectionExists("modules")) { - return ModuleStorageState.Corrupted; - } + /// + /// Creates global scope from module persistent state. + /// Global scope is then can be used to construct module analysis. + /// + /// Python module to restore analysis for. + /// Python module global scope. + public bool TryRestoreGlobalScope(IPythonModule module, out IRestoredGlobalScope gs) { + gs = null; - var modules = db.GetCollection("modules"); - var model = modules.Find(m => m.Name == moduleName).FirstOrDefault(); - if (model == null) { - return ModuleStorageState.DoesNotExist; - } + if (GetCachingLevel() == AnalysisCachingLevel.None || !module.ModuleType.CanBeCached()) { + return false; + } - module = new PythonDbModule(model, filePath, _services); - return ModuleStorageState.Complete; - } - } catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) { - Thread.Sleep(10); + lock (_lock) { + if (FindModuleModel(module.Name, module.FilePath, out var model)) { + gs = new RestoredGlobalScope(model, module); } } - return ModuleStorageState.DoesNotExist; + + return gs != null; } /// @@ -101,14 +107,16 @@ public Task StoreModuleAnalysisAsync(IDocumentAnalysis analysis, CancellationTok /// Determines if module analysis exists in the storage. /// public bool ModuleExistsInStorage(string moduleName, string filePath) { - if(GetCachingLevel() == AnalysisCachingLevel.None) { + if (GetCachingLevel() == AnalysisCachingLevel.None) { return false; } for (var retries = 50; retries > 0; --retries) { try { - var dbPath = FindDatabaseFile(moduleName, filePath); - return !string.IsNullOrEmpty(dbPath); + lock (_lock) { + var dbPath = FindDatabaseFile(moduleName, filePath); + return !string.IsNullOrEmpty(dbPath); + } } catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) { Thread.Sleep(10); } @@ -116,9 +124,15 @@ public bool ModuleExistsInStorage(string moduleName, string filePath) { return false; } + public void Clear() { + lock (_lock) { + _dependencies.Clear(); + } + } + private void StoreModuleAnalysis(IDocumentAnalysis analysis, CancellationToken cancellationToken = default) { var cachingLevel = GetCachingLevel(); - if(cachingLevel == AnalysisCachingLevel.None) { + if (cachingLevel == AnalysisCachingLevel.None) { return; } @@ -130,24 +144,26 @@ private void StoreModuleAnalysis(IDocumentAnalysis analysis, CancellationToken c Exception ex = null; for (var retries = 50; retries > 0; --retries) { - cancellationToken.ThrowIfCancellationRequested(); - try { - if (!_fs.DirectoryExists(_databaseFolder)) { - _fs.CreateDirectory(_databaseFolder); - } - + lock (_lock) { cancellationToken.ThrowIfCancellationRequested(); - using (var db = new LiteDatabase(Path.Combine(_databaseFolder, $"{model.UniqueId}.db"))) { - var modules = db.GetCollection("modules"); - modules.Upsert(model); - return; + try { + if (!_fs.DirectoryExists(_databaseFolder)) { + _fs.CreateDirectory(_databaseFolder); + } + + cancellationToken.ThrowIfCancellationRequested(); + using (var db = new LiteDatabase(Path.Combine(_databaseFolder, $"{model.UniqueId}.db"))) { + var modules = db.GetCollection("modules"); + modules.Upsert(model); + return; + } + } catch (Exception ex1) when (ex1 is IOException || ex1 is UnauthorizedAccessException) { + ex = ex1; + Thread.Sleep(10); + } catch (Exception ex2) { + ex = ex2; + break; } - } catch (Exception ex1) when (ex1 is IOException || ex1 is UnauthorizedAccessException) { - ex = ex1; - Thread.Sleep(10); - } catch (Exception ex2) { - ex = ex2; - break; } } @@ -191,7 +207,52 @@ private string FindDatabaseFile(string moduleName, string filePath) { return _fs.FileExists(dbPath) ? dbPath : null; } + private bool FindModuleModel(string moduleName, string filePath, out ModuleModel model) { + model = null; + + // We don't cache results here. Module resolution service decides when to call in here + // and it is responsible of overall management of the loaded Python modules. + for (var retries = 50; retries > 0; --retries) { + try { + // TODO: make combined db rather than per module? + var dbPath = FindDatabaseFile(moduleName, filePath); + if (string.IsNullOrEmpty(dbPath)) { + return false; + } + + using (var db = new LiteDatabase(dbPath)) { + if (!db.CollectionExists("modules")) { + return false; + } + + var modules = db.GetCollection("modules"); + model = modules.Find(m => m.Name == moduleName).FirstOrDefault(); + return model != null; + } + } catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) { + Thread.Sleep(10); + } + } + return false; + } private AnalysisCachingLevel GetCachingLevel() => _services.GetService()?.Options.AnalysisCachingLevel ?? AnalysisCachingLevel.None; + + private sealed class DependencyProvider : IDependencyProvider { + private readonly HashSet _dependencies; + + public DependencyProvider(IPythonModule module, ModuleModel model) { + var dc = new DependencyCollector(module); + foreach (var imp in model.Imports) { + dc.AddImport(imp.ModuleNames, imp.ForceAbsolute); + } + foreach (var fi in model.FromImports) { + dc.AddFromImport(fi.RootNames, fi.DotCount, fi.ForceAbsolute); + } + _dependencies = dc.Dependencies; + } + + public HashSet GetDependencies() => _dependencies; + } } } diff --git a/src/Caching/Impl/ModuleFactory.cs b/src/Caching/Impl/ModuleFactory.cs index 10d0f1651..4fad9d9da 100644 --- a/src/Caching/Impl/ModuleFactory.cs +++ b/src/Caching/Impl/ModuleFactory.cs @@ -31,22 +31,26 @@ namespace Microsoft.Python.Analysis.Caching { /// Constructs module from its persistent model. /// internal sealed class ModuleFactory { + /// For use in tests so missing members will assert. + internal static bool EnableMissingMemberAssertions { get; set; } + // TODO: better resolve circular references. - private readonly ReentrancyGuard _typeReentrancy = new ReentrancyGuard(); private readonly ReentrancyGuard _moduleReentrancy = new ReentrancyGuard(); private readonly ModuleModel _model; + private readonly IGlobalScope _gs; public IPythonModule Module { get; } public Location DefaultLocation { get; } - public ModuleFactory(ModuleModel model, IPythonModule module) { + public ModuleFactory(ModuleModel model, IPythonModule module, IGlobalScope gs) { _model = model; - + _gs = gs; Module = module; DefaultLocation = new Location(Module); } - public IPythonType ConstructType(string qualifiedName) => ConstructMember(qualifiedName)?.GetPythonType(); + public IPythonType ConstructType(string qualifiedName) + => ConstructMember(qualifiedName)?.GetPythonType(); public IMember ConstructMember(string qualifiedName) { // Determine module name, member chain and if this is an instance. @@ -101,8 +105,9 @@ private IMember GetMemberFromThisModule(IReadOnlyList memberNames) { return null; } - m = nextModel.Construct(this, declaringType); + m = nextModel.Create(this, declaringType, _gs); Debug.Assert(m != null); + if (m is IGenericType gt && typeArgs.Count > 0) { m = gt.CreateSpecificType(new ArgumentSet(typeArgs, null, null)); } @@ -136,13 +141,13 @@ private IPythonModule GetModule(QualifiedNameParts parts) { // from the stub and the main module was never loaded. This, for example, // happens with io which has member with mmap type coming from mmap // stub rather than the primary mmap module. - var m = Module.Interpreter.ModuleResolution.GetImportedModule(parts.ModuleName); - // Try stub-only case (ex _importlib_modulespec). - m = m ?? Module.Interpreter.TypeshedResolution.GetImportedModule(parts.ModuleName); + var m = parts.IsStub + ? Module.Interpreter.TypeshedResolution.GetImportedModule(parts.ModuleName) + : Module.Interpreter.ModuleResolution.GetImportedModule(parts.ModuleName); + if (m != null) { return parts.ObjectType == ObjectType.VariableModule ? new PythonVariableModule(m) : m; } - return null; } } @@ -175,7 +180,7 @@ private IMember GetMember(IMember root, IEnumerable memberNames) { } if (member == null) { - Debug.Assert(member != null); + Debug.Assert(member != null || EnableMissingMemberAssertions == false); break; } diff --git a/src/Caching/Impl/Properties/AssemblyInfo.cs b/src/Caching/Impl/Properties/AssemblyInfo.cs index 9d32fae0c..d2256d3fe 100644 --- a/src/Caching/Impl/Properties/AssemblyInfo.cs +++ b/src/Caching/Impl/Properties/AssemblyInfo.cs @@ -16,3 +16,4 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Microsoft.Python.Analysis.Caching.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] +[assembly: InternalsVisibleTo("Microsoft.Python.LanguageServer, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] diff --git a/src/Caching/Impl/PythonDbModule.cs b/src/Caching/Impl/PythonDbModule.cs index addc97053..8da9634ed 100644 --- a/src/Caching/Impl/PythonDbModule.cs +++ b/src/Caching/Impl/PythonDbModule.cs @@ -28,17 +28,17 @@ internal sealed class PythonDbModule : SpecializedModule { public PythonDbModule(ModuleModel model, string filePath, IServiceContainer services) : base(model.Name, filePath, services) { - - var gs = new GlobalScope(model, this); - GlobalScope = gs; - gs.ReconstructVariables(); - Documentation = model.Documentation; - _newLines = model.NewLines.Select(nl => new NewLineLocation(nl.EndIndex, nl.Kind)).ToArray(); _fileSize = model.FileSize; } + public void Construct(ModuleModel model) { + var gs = new RestoredGlobalScope(model, this); + GlobalScope = gs; + gs.ReconstructVariables(); + } + protected override string LoadContent() => string.Empty; public override string Documentation { get; } diff --git a/src/Caching/Impl/QualifiedNameParts.cs b/src/Caching/Impl/QualifiedNameParts.cs index defe456fd..4d1d33539 100644 --- a/src/Caching/Impl/QualifiedNameParts.cs +++ b/src/Caching/Impl/QualifiedNameParts.cs @@ -29,6 +29,8 @@ internal struct QualifiedNameParts { public ObjectType ObjectType; /// Module name. public string ModuleName; + /// Indicates if module is a stub. + public bool IsStub; /// Module member names such as 'A', 'B', 'C' from module:A.B.C. public IReadOnlyList MemberNames; } diff --git a/src/Caching/Impl/GlobalScope.cs b/src/Caching/Impl/RestoredGlobalScope.cs similarity index 67% rename from src/Caching/Impl/GlobalScope.cs rename to src/Caching/Impl/RestoredGlobalScope.cs index 47808dccc..43170d1f4 100644 --- a/src/Caching/Impl/GlobalScope.cs +++ b/src/Caching/Impl/RestoredGlobalScope.cs @@ -22,44 +22,45 @@ using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Caching { - internal sealed class GlobalScope : IGlobalScope { + internal sealed class RestoredGlobalScope : IRestoredGlobalScope { private readonly VariableCollection _scopeVariables = new VariableCollection(); - private ModuleModel _model; + private ModuleModel _model; // Non-readonly b/c of DEBUG conditional. + private ModuleFactory _factory; // Non-readonly b/c of DEBUG conditional. - public GlobalScope(ModuleModel model, IPythonModule module) { - _model = model; - Module = module; + public RestoredGlobalScope(ModuleModel model, IPythonModule module) { + _model = model ?? throw new ArgumentNullException(nameof(model)); + Module = module ?? throw new ArgumentNullException(nameof(module)); Name = model.Name; + _factory = new ModuleFactory(_model, Module, this); + DeclareVariables(); } public void ReconstructVariables() { + var models = _model.TypeVars.Concat(_model.NamedTuples).Concat(_model.Classes).Concat(_model.Functions); + foreach (var m in models.Concat(_model.Variables)) { + m.Populate(_factory, null, this); + } + // TODO: re-declare __doc__, __name__, etc. +#if !DEBUG + _model = null; + _factory = null; +#endif + } + + private void DeclareVariables() { // Member creation may be non-linear. Consider function A returning instance // of a class or type info of a function which hasn't been created yet. // Thus first create members so we can find then, then populate them with content. - var mf = new ModuleFactory(_model, Module); - foreach (var tvm in _model.TypeVars) { - var t = tvm.Construct(mf, null); - _scopeVariables.DeclareVariable(tvm.Name, t, VariableSource.Generic, mf.DefaultLocation); - } - foreach (var ntm in _model.NamedTuples) { - var nt = ntm.Construct(mf, null); - _scopeVariables.DeclareVariable(ntm.Name, nt, VariableSource.Declaration, mf.DefaultLocation); - } - foreach (var cm in _model.Classes) { - var cls = cm.Construct(mf, null); - _scopeVariables.DeclareVariable(cm.Name, cls, VariableSource.Declaration, mf.DefaultLocation); - } - foreach (var fm in _model.Functions) { - var ft = fm.Construct(mf, null); - _scopeVariables.DeclareVariable(fm.Name, ft, VariableSource.Declaration, mf.DefaultLocation); + var mf = new ModuleFactory(_model, Module, this); + var models = _model.TypeVars.Concat(_model.NamedTuples).Concat(_model.Classes).Concat(_model.Functions); + + foreach (var m in models) { + _scopeVariables.DeclareVariable(m.Name, m.Create(mf, null, this), VariableSource.Generic, mf.DefaultLocation); } foreach (var vm in _model.Variables) { - var v = (IVariable)vm.Construct(mf, null); + var v = (IVariable)vm.Create(mf, null, this); _scopeVariables.DeclareVariable(vm.Name, v.Value, VariableSource.Declaration, mf.DefaultLocation); } - - // TODO: re-declare __doc__, __name__, etc. - _model = null; } #region IScope diff --git a/src/Caching/Impl/TypeNames.cs b/src/Caching/Impl/TypeNames.cs index c1e1e7f0e..2d12f482a 100644 --- a/src/Caching/Impl/TypeNames.cs +++ b/src/Caching/Impl/TypeNames.cs @@ -17,7 +17,6 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Python.Analysis.Modules; -using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; @@ -103,6 +102,7 @@ private static void GetModuleNameAndMembers(string qualifiedName, ref QualifiedN default: parts.ModuleName = typeName; parts.MemberNames = Array.Empty(); + DetermineModuleType(ref parts); break; } return; @@ -112,6 +112,15 @@ private static void GetModuleNameAndMembers(string qualifiedName, ref QualifiedN parts.ModuleName = typeName.Substring(0, moduleSeparatorIndex); var memberNamesOffset = parts.ModuleName.Length + 1; parts.MemberNames = GetTypeNames(typeName.Substring(memberNamesOffset), '.'); + + DetermineModuleType(ref parts); + } + + private static void DetermineModuleType(ref QualifiedNameParts parts) { + if (parts.ModuleName.EndsWith("(stub)")) { + parts.ModuleName = parts.ModuleName.Substring(0, parts.ModuleName.Length - 6); + parts.IsStub = true; + } } public static IReadOnlyList GetTypeNames(string qualifiedTypeName, char separator) { diff --git a/src/Caching/Test/AnalysisCachingTestBase.cs b/src/Caching/Test/AnalysisCachingTestBase.cs index 34927e303..4da2db6b3 100644 --- a/src/Caching/Test/AnalysisCachingTestBase.cs +++ b/src/Caching/Test/AnalysisCachingTestBase.cs @@ -16,13 +16,22 @@ using System.IO; using System.Reflection; using System.Text; +using System.Threading.Tasks; +using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Caching.Tests.FluentAssertions; using Microsoft.Python.Analysis.Tests; +using Microsoft.Python.Analysis.Types; using Newtonsoft.Json; using TestUtilities; namespace Microsoft.Python.Analysis.Caching.Tests { public abstract class AnalysisCachingTestBase: AnalysisTestBase { - protected string ToJson(object model) { + protected AnalysisCachingTestBase() { + ModuleFactory.EnableMissingMemberAssertions = true; + } + + protected static string ToJson(object model) { var sb = new StringBuilder(); using (var sw = new StringWriter(sb)) using (var jw = new JsonTextWriter(sw)) { @@ -45,5 +54,48 @@ protected string GetBaselineFileName(string testName, string suffix = null) => Path.ChangeExtension(suffix == null ? Path.Combine(BaselineFilesFolder, testName) : Path.Combine(BaselineFilesFolder, testName + suffix), "json"); + + internal PythonDbModule CreateDbModule(ModuleModel model, string modulePath) { + var dbModule = new PythonDbModule(model, modulePath, Services); + dbModule.Construct(model); + return dbModule; + } + + internal async Task CompareBaselineAndRestoreAsync(ModuleModel model, IPythonModule m) { + //var json = ToJson(model); + //Baseline.CompareToFile(BaselineFileName, json); + + // In real case dependency analysis will restore model dependencies. + // Here we don't go through the dependency analysis so we have to + // manually restore dependent modules. + foreach (var imp in model.Imports) { + foreach (var name in imp.ModuleNames) { + m.Interpreter.ModuleResolution.GetOrLoadModule(name); + } + } + foreach (var imp in model.FromImports) { + foreach (var name in imp.RootNames) { + m.Interpreter.ModuleResolution.GetOrLoadModule(name); + } + } + + foreach (var imp in model.StubImports) { + foreach (var name in imp.ModuleNames) { + m.Interpreter.TypeshedResolution.GetOrLoadModule(name); + } + } + foreach (var imp in model.StubFromImports) { + foreach (var name in imp.RootNames) { + m.Interpreter.TypeshedResolution.GetOrLoadModule(name); + } + } + + var analyzer = Services.GetService(); + await analyzer.WaitForCompleteAnalysisAsync(); + + using (var dbModule = CreateDbModule(model, m.FilePath)) { + dbModule.Should().HaveSameMembersAs(m); + } + } } } diff --git a/src/Caching/Test/ClassesTests.cs b/src/Caching/Test/ClassesTests.cs index 3aa6c225c..b046213fb 100644 --- a/src/Caching/Test/ClassesTests.cs +++ b/src/Caching/Test/ClassesTests.cs @@ -101,7 +101,7 @@ def func(): //var json = ToJson(model); //Baseline.CompareToFile(BaselineFileName, json); - using (var dbModule = new PythonDbModule(model, analysis.Document.FilePath, Services)) { + using (var dbModule = CreateDbModule(model, analysis.Document.FilePath)) { dbModule.Should().HaveSameMembersAs(analysis.Document); } } @@ -128,7 +128,7 @@ def value(self): //var json = ToJson(model); //Baseline.CompareToFile(BaselineFileName, json); - using (var dbModule = new PythonDbModule(model, analysis.Document.FilePath, Services)) { + using (var dbModule = CreateDbModule(model, analysis.Document.FilePath)) { dbModule.Should().HaveSameMembersAs(analysis.Document); } } diff --git a/src/Caching/Test/Files/ClassOwnDocumentation.json b/src/Caching/Test/Files/ClassOwnDocumentation.json index f6a6c7d35..647537712 100644 --- a/src/Caching/Test/Files/ClassOwnDocumentation.json +++ b/src/Caching/Test/Files/ClassOwnDocumentation.json @@ -191,8 +191,12 @@ } ], "FileSize": 115, + "Imports": [], + "FromImports": [], + "StubImports": [], + "StubFromImports": [], "Id": -2131035837, "Name": "module", - "QualifiedName": null, + "QualifiedName": "module", "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/MemberLocations.json b/src/Caching/Test/Files/MemberLocations.json index ec98ba59b..bc8123835 100644 --- a/src/Caching/Test/Files/MemberLocations.json +++ b/src/Caching/Test/Files/MemberLocations.json @@ -362,8 +362,12 @@ } ], "FileSize": 288, + "Imports": [], + "FromImports": [], + "StubImports": [], + "StubFromImports": [], "Id": -2131035837, "Name": "module", - "QualifiedName": null, + "QualifiedName": "module", "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/NestedClasses.json b/src/Caching/Test/Files/NestedClasses.json index a4de61c16..efb7c122d 100644 --- a/src/Caching/Test/Files/NestedClasses.json +++ b/src/Caching/Test/Files/NestedClasses.json @@ -413,8 +413,12 @@ } ], "FileSize": 353, + "Imports": [], + "FromImports": [], + "StubImports": [], + "StubFromImports": [], "Id": -2131035837, "Name": "module", - "QualifiedName": null, + "QualifiedName": "module", "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/SmokeTest.json b/src/Caching/Test/Files/SmokeTest.json index 5fc51e763..8774ad298 100644 --- a/src/Caching/Test/Files/SmokeTest.json +++ b/src/Caching/Test/Files/SmokeTest.json @@ -310,8 +310,12 @@ } ], "FileSize": 243, + "Imports": [], + "FromImports": [], + "StubImports": [], + "StubFromImports": [], "Id": -2131035837, "Name": "module", - "QualifiedName": null, + "QualifiedName": "module", "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/VersionHandling2.json b/src/Caching/Test/Files/VersionHandling2.json index 02e6c7f13..ee4d02e74 100644 --- a/src/Caching/Test/Files/VersionHandling2.json +++ b/src/Caching/Test/Files/VersionHandling2.json @@ -137,8 +137,12 @@ } ], "FileSize": 91, + "Imports": [], + "FromImports": [], + "StubImports": [], + "StubFromImports": [], "Id": -2131035837, "Name": "module", - "QualifiedName": null, + "QualifiedName": "module", "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/Files/VersionHandling3.json b/src/Caching/Test/Files/VersionHandling3.json index 0ee5f389c..1d92c7ff2 100644 --- a/src/Caching/Test/Files/VersionHandling3.json +++ b/src/Caching/Test/Files/VersionHandling3.json @@ -149,8 +149,12 @@ } ], "FileSize": 91, + "Imports": [], + "FromImports": [], + "StubImports": [], + "StubFromImports": [], "Id": -2131035837, "Name": "module", - "QualifiedName": null, + "QualifiedName": "module", "IndexSpan": null } \ No newline at end of file diff --git a/src/Caching/Test/LibraryModulesTests.cs b/src/Caching/Test/LibraryModulesTests.cs index 9f9b710ff..ec4ad2e7d 100644 --- a/src/Caching/Test/LibraryModulesTests.cs +++ b/src/Caching/Test/LibraryModulesTests.cs @@ -20,7 +20,6 @@ using Microsoft.Python.Analysis.Caching.Tests.FluentAssertions; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; -using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Tests; using Microsoft.VisualStudio.TestTools.UnitTesting; using TestUtilities; @@ -181,7 +180,7 @@ public async Task Builtins() { [TestMethod, Priority(0)] public Task Pickle() => TestModule("pickle"); - + [TestMethod, Priority(0)] public Task Pipes() => TestModule("pipes"); @@ -295,7 +294,7 @@ import requests // Verify this looks like a version. new Version(u.Substring(open + 1, u.IndexOf(')') - open - 1)); - CompareBaselineAndRestore(model, rq); + await CompareBaselineAndRestoreAsync(model, rq); } private async Task TestModule(string name) { @@ -303,16 +302,7 @@ private async Task TestModule(string name) { var m = analysis.Document.Interpreter.ModuleResolution.GetImportedModule(name); var model = ModuleModel.FromAnalysis(m.Analysis, Services, AnalysisCachingLevel.Library); - CompareBaselineAndRestore(model, m); - } - - private void CompareBaselineAndRestore(ModuleModel model, IPythonModule m) { - //var json = ToJson(model); - //Baseline.CompareToFile(BaselineFileName, json); - - using (var dbModule = new PythonDbModule(model, m.FilePath, Services)) { - dbModule.Should().HaveSameMembersAs(m); - } + await CompareBaselineAndRestoreAsync(model, m); } } } diff --git a/src/Caching/Test/ReferencesTests.cs b/src/Caching/Test/ReferencesTests.cs index 867cd95c3..76b9ac803 100644 --- a/src/Caching/Test/ReferencesTests.cs +++ b/src/Caching/Test/ReferencesTests.cs @@ -15,13 +15,12 @@ using System.Threading.Tasks; using FluentAssertions; -using Microsoft.Python.Analysis.Caching.Tests.FluentAssertions; using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Caching.Tests.FluentAssertions; +using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSubstitute; using TestUtilities; -using Microsoft.Python.Analysis.Modules; namespace Microsoft.Python.Analysis.Caching.Tests { [TestClass] @@ -67,6 +66,8 @@ def methodB2(self): Baseline.CompareToFile(BaselineFileName, json); using (var dbModule = new PythonDbModule(model, analysis.Document.FilePath, Services)) { + dbModule.Construct(model); + var sum = dbModule.GetMember("sum") as IPythonFunctionType; sum.Should().NotBeNull(); sum.Definition.Span.Should().Be(4, 5, 4, 8); @@ -103,23 +104,16 @@ import logging var logging = analysis.Document.Interpreter.ModuleResolution.GetImportedModule("logging"); var model = ModuleModel.FromAnalysis(logging.Analysis, Services, AnalysisCachingLevel.Library); - var dbModule = new PythonDbModule(model, logging.FilePath, Services); - analysis.Document.Interpreter.ModuleResolution.SpecializeModule("logging", x => dbModule, replaceExisting: true); - - var moduleName = $"{analysis.Document.Name}_db.py"; - var modulePath = TestData.GetTestSpecificPath(moduleName); - analysis = await GetAnalysisAsync(code, Services, moduleName, modulePath); - - var v = analysis.Should().HaveVariable("logging").Which; - var vm = v.Value.Should().BeOfType().Which; - var m = vm.Module.Should().BeOfType().Which; + await CompareBaselineAndRestoreAsync(model, logging); - var critical = m.GetMember("critical") as IPythonFunctionType; - critical.Should().NotBeNull(); + using (var m = CreateDbModule(model, logging.FilePath)) { + var critical = m.GetMember("critical") as IPythonFunctionType; + critical.Should().NotBeNull(); - var span = critical.Definition.Span; - span.Start.Line.Should().BeGreaterThan(1000); - (span.End.Column - span.Start.Column).Should().Be("critical".Length); + var span = critical.Definition.Span; + span.Start.Line.Should().BeGreaterThan(1000); + (span.End.Column - span.Start.Column).Should().Be("critical".Length); + } } } } diff --git a/src/Core/Impl/OS/ProcessServices.cs b/src/Core/Impl/OS/ProcessServices.cs index 1f74efd40..e9a7c5b72 100644 --- a/src/Core/Impl/OS/ProcessServices.cs +++ b/src/Core/Impl/OS/ProcessServices.cs @@ -39,20 +39,20 @@ public IProcess Start(string path) { public async Task ExecuteAndCaptureOutputAsync(ProcessStartInfo startInfo, CancellationToken cancellationToken = default) { var output = string.Empty; - var process = Start(startInfo); + using (var process = Start(startInfo)) { - if (startInfo.RedirectStandardError && process is PlatformProcess p) { - p.Process.ErrorDataReceived += (s, e) => { }; - p.Process.BeginErrorReadLine(); - } + if (startInfo.RedirectStandardError && process is PlatformProcess p) { + p.Process.ErrorDataReceived += (s, e) => { }; + p.Process.BeginErrorReadLine(); + } - try { - output = await process.StandardOutput.ReadToEndAsync(); - await process.WaitForExitAsync(30000, cancellationToken); - } catch (IOException) { - } catch (OperationCanceledException) { } + try { + output = await process.StandardOutput.ReadToEndAsync(); + await process.WaitForExitAsync(30000, cancellationToken); + } catch (IOException) { } catch (OperationCanceledException) { } - return output; + return output; + } } } } diff --git a/src/Core/Test/PriorityProducerConsumerTest.cs b/src/Core/Test/PriorityProducerConsumerTest.cs index 62c755ca6..a0a5132ac 100644 --- a/src/Core/Test/PriorityProducerConsumerTest.cs +++ b/src/Core/Test/PriorityProducerConsumerTest.cs @@ -24,95 +24,102 @@ namespace Microsoft.Python.Core.Tests { public class PriorityProducerConsumerTest { [TestMethod, Priority(0)] public void PriorityProducerConsumer_NoPending() { - var ppc = new PriorityProducerConsumer(); - ppc.Produce(5); - var consumerTask = ppc.ConsumeAsync(); - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); - Assert.AreEqual(5, consumerTask.Result); + using (var ppc = new PriorityProducerConsumer()) { + ppc.Produce(5); + var consumerTask = ppc.ConsumeAsync(); + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); + Assert.AreEqual(5, consumerTask.Result); + } } [TestMethod, Priority(0)] public void PriorityProducerConsumer_NoPending_Priority1() { - var ppc = new PriorityProducerConsumer(2); - ppc.Produce(5); - ppc.Produce(6, 1); - var consumerTask = ppc.ConsumeAsync(); - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); - Assert.AreEqual(5, consumerTask.Result); + using (var ppc = new PriorityProducerConsumer(2)) { + ppc.Produce(5); + ppc.Produce(6, 1); + var consumerTask = ppc.ConsumeAsync(); + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); + Assert.AreEqual(5, consumerTask.Result); + } } [TestMethod, Priority(0)] public void PriorityProducerConsumer_NoPending_Priority2() { - var ppc = new PriorityProducerConsumer(2); - ppc.Produce(6, 1); - ppc.Produce(5); - var consumerTask = ppc.ConsumeAsync(); - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); - Assert.AreEqual(5, consumerTask.Result); + using (var ppc = new PriorityProducerConsumer(2)) { + ppc.Produce(6, 1); + ppc.Produce(5); + var consumerTask = ppc.ConsumeAsync(); + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); + Assert.AreEqual(5, consumerTask.Result); + } } [TestMethod, Priority(0)] public void PriorityProducerConsumer_NoPending_Duplicates1() { - var ppc = new PriorityProducerConsumer(3, true); - ppc.Produce(5, 2); - ppc.Produce(6, 1); - ppc.Produce(5); - var consumerTask1 = ppc.ConsumeAsync(); - var consumerTask2 = ppc.ConsumeAsync(); - var consumerTask3 = ppc.ConsumeAsync(); - - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask1.Status); - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask2.Status); - Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask3.Status); - Assert.AreEqual(5, consumerTask1.Result); - Assert.AreEqual(6, consumerTask2.Result); + using (var ppc = new PriorityProducerConsumer(3, true)) { + ppc.Produce(5, 2); + ppc.Produce(6, 1); + ppc.Produce(5); + var consumerTask1 = ppc.ConsumeAsync(); + var consumerTask2 = ppc.ConsumeAsync(); + var consumerTask3 = ppc.ConsumeAsync(); + + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask1.Status); + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask2.Status); + Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask3.Status); + Assert.AreEqual(5, consumerTask1.Result); + Assert.AreEqual(6, consumerTask2.Result); + } } [TestMethod, Priority(0)] public void PriorityProducerConsumer_NoPending_Duplicates2() { - var ppc = new PriorityProducerConsumer(3, true); - ppc.Produce(5); - ppc.Produce(6, 1); - ppc.Produce(5, 2); - var consumerTask1 = ppc.ConsumeAsync(); - var consumerTask2 = ppc.ConsumeAsync(); - var consumerTask3 = ppc.ConsumeAsync(); - - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask1.Status); - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask2.Status); - Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask3.Status); - Assert.AreEqual(5, consumerTask1.Result); - Assert.AreEqual(6, consumerTask2.Result); + using (var ppc = new PriorityProducerConsumer(3, true)) { + ppc.Produce(5); + ppc.Produce(6, 1); + ppc.Produce(5, 2); + var consumerTask1 = ppc.ConsumeAsync(); + var consumerTask2 = ppc.ConsumeAsync(); + var consumerTask3 = ppc.ConsumeAsync(); + + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask1.Status); + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask2.Status); + Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask3.Status); + Assert.AreEqual(5, consumerTask1.Result); + Assert.AreEqual(6, consumerTask2.Result); + } } [TestMethod, Priority(0)] public void PriorityProducerConsumer_NoPending_Duplicates3() { - var ppc = new PriorityProducerConsumer(3, true); - ppc.Produce(5, 1); - ppc.Produce(6, 1); - ppc.Produce(5, 1); - var consumerTask1 = ppc.ConsumeAsync(); - var consumerTask2 = ppc.ConsumeAsync(); - var consumerTask3 = ppc.ConsumeAsync(); - - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask1.Status); - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask2.Status); - Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask3.Status); - Assert.AreEqual(6, consumerTask1.Result); - Assert.AreEqual(5, consumerTask2.Result); + using (var ppc = new PriorityProducerConsumer(3, true)) { + ppc.Produce(5, 1); + ppc.Produce(6, 1); + ppc.Produce(5, 1); + var consumerTask1 = ppc.ConsumeAsync(); + var consumerTask2 = ppc.ConsumeAsync(); + var consumerTask3 = ppc.ConsumeAsync(); + + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask1.Status); + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask2.Status); + Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask3.Status); + Assert.AreEqual(6, consumerTask1.Result); + Assert.AreEqual(5, consumerTask2.Result); + } } [TestMethod, Priority(0)] public async Task PriorityProducerConsumer_Pending() { - var ppc = new PriorityProducerConsumer(); - var consumerTask = ppc.ConsumeAsync(); - Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask.Status); + using (var ppc = new PriorityProducerConsumer()) { + var consumerTask = ppc.ConsumeAsync(); + Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask.Status); - ppc.Produce(5); - await consumerTask; + ppc.Produce(5); + await consumerTask; - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); - Assert.AreEqual(5, consumerTask.Result); + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); + Assert.AreEqual(5, consumerTask.Result); + } } [TestMethod, Priority(0)] @@ -131,69 +138,72 @@ public async Task PriorityProducerConsumer_Pending_Dispose() { [TestMethod, Priority(0)] public async Task PriorityProducerConsumer_Pending_Priority1() { - var ppc = new PriorityProducerConsumer(2); - var consumerTask = ppc.ConsumeAsync(); - Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask.Status); + using (var ppc = new PriorityProducerConsumer(2)) { + var consumerTask = ppc.ConsumeAsync(); + Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask.Status); - ppc.Produce(5); - ppc.Produce(6, 1); - await consumerTask; + ppc.Produce(5); + ppc.Produce(6, 1); + await consumerTask; - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); - Assert.AreEqual(5, consumerTask.Result); + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); + Assert.AreEqual(5, consumerTask.Result); + } } [TestMethod, Priority(0)] public async Task PriorityProducerConsumer_Pending_Priority2() { - var ppc = new PriorityProducerConsumer(2); - var consumerTask1 = ppc.ConsumeAsync(); - var consumerTask2 = ppc.ConsumeAsync(); - Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask1.Status); - Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask2.Status); + using (var ppc = new PriorityProducerConsumer(2)) { + var consumerTask1 = ppc.ConsumeAsync(); + var consumerTask2 = ppc.ConsumeAsync(); + Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask1.Status); + Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask2.Status); - ppc.Produce(6, 1); - await consumerTask1; + ppc.Produce(6, 1); + await consumerTask1; - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask1.Status); - Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask2.Status); - Assert.AreEqual(6, consumerTask1.Result); + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask1.Status); + Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask2.Status); + Assert.AreEqual(6, consumerTask1.Result); - ppc.Produce(5); - await consumerTask2; + ppc.Produce(5); + await consumerTask2; - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask2.Status); - Assert.AreEqual(5, consumerTask2.Result); + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask2.Status); + Assert.AreEqual(5, consumerTask2.Result); + } } [TestMethod, Priority(0)] public async Task PriorityProducerConsumer_Pending_Priority3() { - var ppc = new PriorityProducerConsumer(2); - var values = new int[3]; - var tcsConsumer = new TaskCompletionSource(); - var tcsProducer = new TaskCompletionSource(); - var consumerTask = Task.Run(async () => { - for (var i = 0; i < 3; i++) { - var task = ppc.ConsumeAsync(); - tcsConsumer.TrySetResult(true); - values[i] = await task; - await tcsProducer.Task; - } - }); - - Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask.Status); - - await tcsConsumer.Task; - ppc.Produce(5, 1); - ppc.Produce(6, 1); - ppc.Produce(7); - tcsProducer.SetResult(false); - - await consumerTask; - - Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); - Assert.AreEqual(5, values[0]); - Assert.AreEqual(7, values[1]); - Assert.AreEqual(6, values[2]); + using (var ppc = new PriorityProducerConsumer(2)) { + var values = new int[3]; + var tcsConsumer = new TaskCompletionSource(); + var tcsProducer = new TaskCompletionSource(); + var consumerTask = Task.Run(async () => { + for (var i = 0; i < 3; i++) { + var task = ppc.ConsumeAsync(); + tcsConsumer.TrySetResult(true); + values[i] = await task; + await tcsProducer.Task; + } + }); + + Assert.AreEqual(TaskStatus.WaitingForActivation, consumerTask.Status); + + await tcsConsumer.Task; + ppc.Produce(5, 1); + ppc.Produce(6, 1); + ppc.Produce(7); + tcsProducer.SetResult(false); + + await consumerTask; + + Assert.AreEqual(TaskStatus.RanToCompletion, consumerTask.Status); + Assert.AreEqual(5, values[0]); + Assert.AreEqual(7, values[1]); + Assert.AreEqual(6, values[2]); + } } } } diff --git a/src/LanguageServer/Test/IndexManagerTests.cs b/src/LanguageServer/Test/IndexManagerTests.cs index d71ae58e8..00071495d 100644 --- a/src/LanguageServer/Test/IndexManagerTests.cs +++ b/src/LanguageServer/Test/IndexManagerTests.cs @@ -52,91 +52,96 @@ public void Cleanup() { [TestMethod, Priority(0)] public async Task AddsRootDirectoryAsync() { - var context = new IndexTestContext(this); - context.FileWithXVarInRootDir(); - context.AddFileToRoot($"{_rootPath}\foo.py", MakeStream("y = 1")); + using (var context = new IndexTestContext(this)) { + context.FileWithXVarInRootDir(); + context.AddFileToRoot($"{_rootPath}\foo.py", MakeStream("y = 1")); - var indexManager = context.GetDefaultIndexManager(); - await indexManager.IndexWorkspace(); + var indexManager = context.GetDefaultIndexManager(); + await indexManager.IndexWorkspace(); - var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); - symbols.Should().HaveCount(2); + var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); + symbols.Should().HaveCount(2); + } } [TestMethod, Priority(0)] public async Task IgnoresNonPythonFiles() { - var context = new IndexTestContext(this); - - var nonPythonTestFileInfo = MakeFileInfoProxy($"{_rootPath}/bla.txt"); - context.AddFileInfoToRootTestFS(nonPythonTestFileInfo); + using (var context = new IndexTestContext(this)) { + var nonPythonTestFileInfo = MakeFileInfoProxy($"{_rootPath}/bla.txt"); + context.AddFileInfoToRootTestFS(nonPythonTestFileInfo); - IIndexManager indexManager = context.GetDefaultIndexManager(); - await indexManager.IndexWorkspace(); + var indexManager = context.GetDefaultIndexManager(); + await indexManager.IndexWorkspace(); - context.FileSystem.DidNotReceive().FileExists(nonPythonTestFileInfo.FullName); + context.FileSystem.DidNotReceive().FileExists(nonPythonTestFileInfo.FullName); + } } [TestMethod, Priority(0)] public async Task CanOpenFiles() { - string nonRootPath = "C:/nonRoot"; - var context = new IndexTestContext(this); - var pythonTestFileInfo = MakeFileInfoProxy($"{nonRootPath}/bla.py"); - IDocument doc = DocumentWithAst("x = 1"); + var nonRootPath = "C:/nonRoot"; + using (var context = new IndexTestContext(this)) { + var pythonTestFileInfo = MakeFileInfoProxy($"{nonRootPath}/bla.py"); + var doc = DocumentWithAst("x = 1"); - IIndexManager indexManager = context.GetDefaultIndexManager(); - indexManager.ProcessNewFile(pythonTestFileInfo.FullName, doc); + var indexManager = context.GetDefaultIndexManager(); + indexManager.ProcessNewFile(pythonTestFileInfo.FullName, doc); - var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); - SymbolsShouldBeOnlyX(symbols); + var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); + SymbolsShouldBeOnlyX(symbols); + } } [TestMethod, Priority(0)] public async Task UpdateFilesOnWorkspaceIndexesLatestAsync() { - var context = new IndexTestContext(this); - var pythonTestFilePath = context.FileWithXVarInRootDir(); + using (var context = new IndexTestContext(this)) { + var pythonTestFilePath = context.FileWithXVarInRootDir(); - var indexManager = context.GetDefaultIndexManager(); - await indexManager.IndexWorkspace(); + var indexManager = context.GetDefaultIndexManager(); + await indexManager.IndexWorkspace(); - indexManager.ReIndexFile(pythonTestFilePath, DocumentWithAst("y = 1")); + indexManager.ReIndexFile(pythonTestFilePath, DocumentWithAst("y = 1")); - var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); - symbols.Should().HaveCount(1); - symbols.First().Kind.Should().BeEquivalentTo(SymbolKind.Variable); - symbols.First().Name.Should().BeEquivalentTo("y"); + var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); + symbols.Should().HaveCount(1); + symbols.First().Kind.Should().BeEquivalentTo(SymbolKind.Variable); + symbols.First().Name.Should().BeEquivalentTo("y"); + } } [TestMethod, Priority(0)] public async Task CloseNonWorkspaceFilesRemovesFromIndexAsync() { - var context = new IndexTestContext(this); - var pythonTestFileInfo = MakeFileInfoProxy("C:/nonRoot/bla.py"); - context.FileSystem.IsPathUnderRoot(_rootPath, pythonTestFileInfo.FullName).Returns(false); + using (var context = new IndexTestContext(this)) { + var pythonTestFileInfo = MakeFileInfoProxy("C:/nonRoot/bla.py"); + context.FileSystem.IsPathUnderRoot(_rootPath, pythonTestFileInfo.FullName).Returns(false); - var indexManager = context.GetDefaultIndexManager(); - indexManager.ProcessNewFile(pythonTestFileInfo.FullName, DocumentWithAst("x = 1")); - indexManager.ProcessClosedFile(pythonTestFileInfo.FullName); + var indexManager = context.GetDefaultIndexManager(); + indexManager.ProcessNewFile(pythonTestFileInfo.FullName, DocumentWithAst("x = 1")); + indexManager.ProcessClosedFile(pythonTestFileInfo.FullName); - await SymbolIndexShouldBeEmpty(indexManager); + await SymbolIndexShouldBeEmpty(indexManager); + } } [TestMethod, Priority(0)] public async Task CloseWorkspaceFilesReUpdatesIndexAsync() { - var context = new IndexTestContext(this); - var pythonTestFilePath = context.FileWithXVarInRootDir(); - context.FileSystem.IsPathUnderRoot(_rootPath, pythonTestFilePath).Returns(true); - - var indexManager = context.GetDefaultIndexManager(); - await indexManager.IndexWorkspace(); - - indexManager.ProcessNewFile(pythonTestFilePath, DocumentWithAst("r = 1")); - // It Needs to remake the stream for the file, previous one is closed - context.FileSystem.FileExists(pythonTestFilePath).Returns(true); - context.SetFileOpen(pythonTestFilePath, MakeStream("x = 1")); - context.FileSystem.IsPathUnderRoot(_rootPath, pythonTestFilePath).Returns(true); - indexManager.ProcessClosedFile(pythonTestFilePath); - - var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); - SymbolsShouldBeOnlyX(symbols); + using (var context = new IndexTestContext(this)) { + var pythonTestFilePath = context.FileWithXVarInRootDir(); + context.FileSystem.IsPathUnderRoot(_rootPath, pythonTestFilePath).Returns(true); + + var indexManager = context.GetDefaultIndexManager(); + await indexManager.IndexWorkspace(); + + indexManager.ProcessNewFile(pythonTestFilePath, DocumentWithAst("r = 1")); + // It Needs to remake the stream for the file, previous one is closed + context.FileSystem.FileExists(pythonTestFilePath).Returns(true); + context.SetFileOpen(pythonTestFilePath, MakeStream("x = 1")); + context.FileSystem.IsPathUnderRoot(_rootPath, pythonTestFilePath).Returns(true); + indexManager.ProcessClosedFile(pythonTestFilePath); + + var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); + SymbolsShouldBeOnlyX(symbols); + } } [TestMethod, Priority(0)] @@ -144,92 +149,97 @@ public async Task ProcessFileIfIndexedAfterCloseIgnoresUpdateAsync() { // If events get to index manager in the order: [open, close, update] // it should not reindex file - var context = new IndexTestContext(this); - var pythonTestFileInfo = MakeFileInfoProxy("C:/nonRoot/bla.py"); + using (var context = new IndexTestContext(this)) { + var pythonTestFileInfo = MakeFileInfoProxy("C:/nonRoot/bla.py"); - var indexManager = context.GetDefaultIndexManager(); - indexManager.ProcessNewFile(pythonTestFileInfo.FullName, DocumentWithAst("x = 1")); - indexManager.ProcessClosedFile(pythonTestFileInfo.FullName); + var indexManager = context.GetDefaultIndexManager(); + indexManager.ProcessNewFile(pythonTestFileInfo.FullName, DocumentWithAst("x = 1")); + indexManager.ProcessClosedFile(pythonTestFileInfo.FullName); - context.FileSystem.IsPathUnderRoot(_rootPath, pythonTestFileInfo.FullName).Returns(false); - indexManager.ReIndexFile(pythonTestFileInfo.FullName, DocumentWithAst("x = 1")); + context.FileSystem.IsPathUnderRoot(_rootPath, pythonTestFileInfo.FullName).Returns(false); + indexManager.ReIndexFile(pythonTestFileInfo.FullName, DocumentWithAst("x = 1")); - await SymbolIndexShouldBeEmpty(indexManager); + await SymbolIndexShouldBeEmpty(indexManager); + } } [TestMethod, Priority(0)] public async Task WorkspaceSymbolsAddsRootDirectory() { - var context = new IndexTestContext(this); + using (var context = new IndexTestContext(this)) { + var pythonTestFilePath = context.FileWithXVarInRootDir(); - var pythonTestFilePath = context.FileWithXVarInRootDir(); + var indexManager = context.GetDefaultIndexManager(); + await indexManager.IndexWorkspace(); - var indexManager = context.GetDefaultIndexManager(); - await indexManager.IndexWorkspace(); - - var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); - SymbolsShouldBeOnlyX(symbols); + var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); + SymbolsShouldBeOnlyX(symbols); + } } [TestMethod, Priority(0)] public async Task WorkspaceSymbolsLimited() { - var context = new IndexTestContext(this); + using (var context = new IndexTestContext(this)) { + for (var fileNumber = 0; fileNumber < 10; fileNumber++) { + context.AddFileToRoot($"{_rootPath}\bla{fileNumber}.py", MakeStream($"x{fileNumber} = 1")); + } - for (int fileNumber = 0; fileNumber < 10; fileNumber++) { - context.AddFileToRoot($"{_rootPath}\bla{fileNumber}.py", MakeStream($"x{fileNumber} = 1")); - } - var indexManager = context.GetDefaultIndexManager(); - await indexManager.IndexWorkspace(); + var indexManager = context.GetDefaultIndexManager(); + await indexManager.IndexWorkspace(); - const int amountOfSymbols = 3; + const int amountOfSymbols = 3; - var symbols = await indexManager.WorkspaceSymbolsAsync("", amountOfSymbols); - symbols.Should().HaveCount(amountOfSymbols); + var symbols = await indexManager.WorkspaceSymbolsAsync("", amountOfSymbols); + symbols.Should().HaveCount(amountOfSymbols); + } } [TestMethod, Priority(0)] public async Task HierarchicalDocumentSymbolsAsync() { - var context = new IndexTestContext(this); - var pythonTestFilePath = context.FileWithXVarInRootDir(); + using (var context = new IndexTestContext(this)) { + var pythonTestFilePath = context.FileWithXVarInRootDir(); - var indexManager = context.GetDefaultIndexManager(); - await indexManager.IndexWorkspace(); + var indexManager = context.GetDefaultIndexManager(); + await indexManager.IndexWorkspace(); - var symbols = await indexManager.HierarchicalDocumentSymbolsAsync(pythonTestFilePath); - SymbolsShouldBeOnlyX(symbols); + var symbols = await indexManager.HierarchicalDocumentSymbolsAsync(pythonTestFilePath); + SymbolsShouldBeOnlyX(symbols); + } } [TestMethod, Priority(0)] public async Task LatestVersionASTVersionIsIndexed() { - var context = new IndexTestContext(this); - var pythonTestFilePath = context.FileWithXVarInRootDir(); - - var indexManager = context.GetDefaultIndexManager(); - indexManager.ProcessNewFile(pythonTestFilePath, DocumentWithAst("y = 1")); - indexManager.ProcessClosedFile(pythonTestFilePath); - indexManager.ProcessNewFile(pythonTestFilePath, DocumentWithAst("z = 1")); - - var symbols = await indexManager.HierarchicalDocumentSymbolsAsync(pythonTestFilePath); - symbols.Should().HaveCount(1); - symbols.First().Kind.Should().BeEquivalentTo(SymbolKind.Variable); - symbols.First().Name.Should().BeEquivalentTo("z"); + using (var context = new IndexTestContext(this)) { + var pythonTestFilePath = context.FileWithXVarInRootDir(); + + var indexManager = context.GetDefaultIndexManager(); + indexManager.ProcessNewFile(pythonTestFilePath, DocumentWithAst("y = 1")); + indexManager.ProcessClosedFile(pythonTestFilePath); + indexManager.ProcessNewFile(pythonTestFilePath, DocumentWithAst("z = 1")); + + var symbols = await indexManager.HierarchicalDocumentSymbolsAsync(pythonTestFilePath); + symbols.Should().HaveCount(1); + symbols.First().Kind.Should().BeEquivalentTo(SymbolKind.Variable); + symbols.First().Name.Should().BeEquivalentTo("z"); + } } [TestMethod, Priority(0)] public async Task AddFilesToPendingChanges() { - var context = new IndexTestContext(this); - var f1 = context.AddFileToRoot($"{_rootPath}/fileA.py", MakeStream("")); - var f2 = context.AddFileToRoot($"{_rootPath}/fileB.py", MakeStream("")); + using (var context = new IndexTestContext(this)) { + var f1 = context.AddFileToRoot($"{_rootPath}/fileA.py", MakeStream("")); + var f2 = context.AddFileToRoot($"{_rootPath}/fileB.py", MakeStream("")); - var indexManager = context.GetDefaultIndexManager(); - await indexManager.IndexWorkspace(); + var indexManager = context.GetDefaultIndexManager(); + await indexManager.IndexWorkspace(); - indexManager.AddPendingDoc(DocumentWithAst("y = 1", f1)); - indexManager.AddPendingDoc(DocumentWithAst("x = 1", f2)); + indexManager.AddPendingDoc(DocumentWithAst("y = 1", f1)); + indexManager.AddPendingDoc(DocumentWithAst("x = 1", f2)); - context.SetIdleEvent(Raise.Event()); + context.SetIdleEvent(Raise.Event()); - var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); - symbols.Should().HaveCount(2); + var symbols = await indexManager.WorkspaceSymbolsAsync("", maxSymbolsCount); + symbols.Should().HaveCount(2); + } } private static void SymbolsShouldBeOnlyX(IEnumerable symbols) { @@ -249,8 +259,8 @@ private class IndexTestContext : IDisposable { private readonly List _rootFileList = new List(); private readonly IIdleTimeService _idleTimeService = Substitute.For(); private readonly PythonLanguageVersion _pythonLanguageVersion = PythonVersions.LatestAvailable3X.Version.ToLanguageVersion(); + private readonly IndexManagerTests _tests; private IIndexManager _indexM; - private IndexManagerTests _tests; public IndexTestContext(IndexManagerTests tests) { _tests = tests; @@ -271,9 +281,7 @@ public void AddFileInfoToRootTestFS(FileInfoProxy fileInfo) { FileSystem.FileExists(fileInfo.FullName).Returns(true); } - public string FileWithXVarInRootDir() { - return AddFileToRoot($"{_rootPath}\bla.py", _tests.MakeStream("x = 1")); - } + public string FileWithXVarInRootDir() => AddFileToRoot($"{_rootPath}\bla.py", _tests.MakeStream("x = 1")); public IIndexManager GetDefaultIndexManager() { _indexM = new IndexManager(FileSystem, _pythonLanguageVersion, @@ -301,19 +309,16 @@ public void SetIdleEvent(EventHandler handler) { private void SetupRootDir() { var directoryInfo = Substitute.For(); directoryInfo.Match("", new string[] { }, new string[] { }).ReturnsForAnyArgs(callInfo => { - string path = callInfo.ArgAt(0); + var path = callInfo.ArgAt(0); return _rootFileList - .Where(fsInfo => PathEqualityComparer.Instance.Equals(fsInfo.FullName, path)) - .Count() > 0; + .Count(fsInfo => PathEqualityComparer.Instance.Equals(fsInfo.FullName, path)) > 0; }); // Doesn't work without 'forAnyArgs' directoryInfo.EnumerateFileSystemInfos(new string[] { }, new string[] { }).ReturnsForAnyArgs(_rootFileList); FileSystem.GetDirectoryInfo(_rootPath).Returns(directoryInfo); } - public void Dispose() { - _indexM?.Dispose(); - } + public void Dispose() => _indexM?.Dispose(); public void SetFileOpen(string pythonTestFilePath, Func returnFunc) { FileSystem.FileOpen(pythonTestFilePath, FileMode.Open, FileAccess.Read, FileShare.Read).Returns(returnFunc); @@ -326,7 +331,7 @@ internal void SetFileOpen(string path, Stream stream) { private IDocument DocumentWithAst(string testCode, string filePath = null) { filePath = filePath ?? $"{_rootPath}/{testCode}.py"; - IDocument doc = Substitute.For(); + var doc = Substitute.For(); doc.GetAstAsync().ReturnsForAnyArgs(Task.FromResult(MakeAst(testCode))); doc.Uri.Returns(new Uri(filePath)); return doc; @@ -338,13 +343,11 @@ private async Task SymbolIndexShouldBeEmpty(IIndexManager indexManager) { } public PythonAst MakeAst(string testCode) { - PythonLanguageVersion latestVersion = PythonVersions.LatestAvailable3X.Version.ToLanguageVersion(); + var latestVersion = PythonVersions.LatestAvailable3X.Version.ToLanguageVersion(); return Parser.CreateParser(MakeStream(testCode), latestVersion).ParseFile(); } - public Stream MakeStream(string str) { - return new MemoryStream(Encoding.UTF8.GetBytes(str)); - } + public Stream MakeStream(string str) => new MemoryStream(Encoding.UTF8.GetBytes(str)); public FileInfoProxy MakeFileInfoProxy(string filePath) => new FileInfoProxy(new FileInfo(filePath)); diff --git a/src/LanguageServer/Test/IndexParserTests.cs b/src/LanguageServer/Test/IndexParserTests.cs index ecd86654d..32e66ec26 100644 --- a/src/LanguageServer/Test/IndexParserTests.cs +++ b/src/LanguageServer/Test/IndexParserTests.cs @@ -56,15 +56,15 @@ public async Task ParseVariableInFileAsync() { using (var fileStream = MakeStream("x = 1")) { SetFileOpen(_fileSystem, testFilePath, fileStream); - IIndexParser indexParser = new IndexParser(_fileSystem, _pythonLanguageVersion); - var ast = await indexParser.ParseAsync(testFilePath); - - var symbols = GetIndexSymbols(ast); - symbols.Should().HaveCount(1); - symbols.First().Kind.Should().BeEquivalentTo(SymbolKind.Variable); - symbols.First().Name.Should().BeEquivalentTo("x"); + using (IIndexParser indexParser = new IndexParser(_fileSystem, _pythonLanguageVersion)) { + var ast = await indexParser.ParseAsync(testFilePath); + + var symbols = GetIndexSymbols(ast); + symbols.Should().HaveCount(1); + symbols.First().Kind.Should().BeEquivalentTo(SymbolKind.Variable); + symbols.First().Name.Should().BeEquivalentTo("x"); + } } - } private IReadOnlyList GetIndexSymbols(PythonAst ast) { @@ -81,8 +81,9 @@ public async Task ParseFileThatStopsExisting() { _fileSystem.FileExists(testFilePath).Returns(true); SetFileOpen(_fileSystem, testFilePath, _ => throw new FileNotFoundException()); - IIndexParser indexParser = new IndexParser(_fileSystem, _pythonLanguageVersion); - var ast = await indexParser.ParseAsync(testFilePath); + using (var indexParser = new IndexParser(_fileSystem, _pythonLanguageVersion)) { + await indexParser.ParseAsync(testFilePath); + } } [TestMethod, Priority(0)] @@ -94,26 +95,25 @@ public void CancelParsingAsync() { SetFileOpen(_fileSystem, testFilePath, fileStream); } - IIndexParser indexParser = new IndexParser(_fileSystem, _pythonLanguageVersion); - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); - cancellationTokenSource.Cancel(); + using (var indexParser = new IndexParser(_fileSystem, _pythonLanguageVersion)) + using (var cancellationTokenSource = new CancellationTokenSource()) { + cancellationTokenSource.Cancel(); - Func parse = async () => { - await indexParser.ParseAsync(testFilePath, cancellationTokenSource.Token); - }; - parse.Should().Throw(); + Func parse = async () => { + await indexParser.ParseAsync(testFilePath, cancellationTokenSource.Token); + }; + parse.Should().Throw(); + } } private void SetFileOpen(IFileSystem fileSystem, string path, Stream stream) { fileSystem.FileOpen(path, FileMode.Open, FileAccess.Read, FileShare.Read).Returns(stream); } - private void SetFileOpen(IFileSystem fileSystem, string path, Func p) { - fileSystem.FileOpen(path, FileMode.Open, FileAccess.Read, FileShare.Read).Returns(p); - } + private void SetFileOpen(IFileSystem fileSystem, string path, Func p) + => fileSystem.FileOpen(path, FileMode.Open, FileAccess.Read, FileShare.Read).Returns(p); - private Stream MakeStream(string str) { - return new MemoryStream(Encoding.UTF8.GetBytes(str)); - } + private Stream MakeStream(string str) + => new MemoryStream(Encoding.UTF8.GetBytes(str)); } } diff --git a/src/LanguageServer/Test/SymbolIndexTests.cs b/src/LanguageServer/Test/SymbolIndexTests.cs index 0a91ba2b0..861eb1cec 100644 --- a/src/LanguageServer/Test/SymbolIndexTests.cs +++ b/src/LanguageServer/Test/SymbolIndexTests.cs @@ -27,6 +27,7 @@ using Microsoft.Python.Parsing.Ast; using Microsoft.Python.Parsing.Tests; using Microsoft.Python.Tests.Utilities.FluentAssertions; +using Microsoft.Python.UnitTests.Core.FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using NSubstitute; using TestUtilities; @@ -51,14 +52,15 @@ public void TestCleanup() { [TestMethod, Priority(0)] public async Task IndexHierarchicalDocumentAsync() { - ISymbolIndex index = MakeSymbolIndex(); - var path = TestData.GetDefaultModulePath(); - index.Add(path, DocumentWithAst("x = 1")); + using (var index = MakeSymbolIndex()) { + var path = TestData.GetDefaultModulePath(); + index.Add(path, DocumentWithAst("x = 1")); - var symbols = await index.HierarchicalDocumentSymbolsAsync(path); - symbols.Should().BeEquivalentToWithStrictOrdering(new[] { - new HierarchicalSymbol("x", SymbolKind.Variable, new SourceSpan(1, 1, 1, 2)), - }); + var symbols = await index.HierarchicalDocumentSymbolsAsync(path); + symbols.Should().BeEquivalentToWithStrictOrdering(new[] { + new HierarchicalSymbol("x", SymbolKind.Variable, new SourceSpan(1, 1, 1, 2)) + }); + } } private static ISymbolIndex MakeSymbolIndex() { @@ -67,124 +69,130 @@ private static ISymbolIndex MakeSymbolIndex() { [TestMethod, Priority(0)] public async Task IndexHierarchicalDocumentUpdate() { - ISymbolIndex index = MakeSymbolIndex(); - var path = TestData.GetDefaultModulePath(); + using (var index = MakeSymbolIndex()) { + var path = TestData.GetDefaultModulePath(); - index.Add(path, DocumentWithAst("x = 1")); + index.Add(path, DocumentWithAst("x = 1")); - var symbols = await index.HierarchicalDocumentSymbolsAsync(path); - symbols.Should().BeEquivalentToWithStrictOrdering(new[] { - new HierarchicalSymbol("x", SymbolKind.Variable, new SourceSpan(1, 1, 1, 2)), - }); + var symbols = await index.HierarchicalDocumentSymbolsAsync(path); + symbols.Should().BeEquivalentToWithStrictOrdering(new[] { + new HierarchicalSymbol("x", SymbolKind.Variable, new SourceSpan(1, 1, 1, 2)) + }); - index.Add(path, DocumentWithAst("y = 1")); + index.Add(path, DocumentWithAst("y = 1")); - symbols = await index.HierarchicalDocumentSymbolsAsync(path); - symbols.Should().BeEquivalentToWithStrictOrdering(new[] { - new HierarchicalSymbol("y", SymbolKind.Variable, new SourceSpan(1, 1, 1, 2)), - }); + symbols = await index.HierarchicalDocumentSymbolsAsync(path); + symbols.Should().BeEquivalentToWithStrictOrdering(new[] { + new HierarchicalSymbol("y", SymbolKind.Variable, new SourceSpan(1, 1, 1, 2)) + }); + } } [TestMethod, Priority(0)] public async Task IndexHierarchicalDocumentNotFoundAsync() { - ISymbolIndex index = MakeSymbolIndex(); - var path = TestData.GetDefaultModulePath(); + using (var index = MakeSymbolIndex()) { + var path = TestData.GetDefaultModulePath(); - var symbols = await index.HierarchicalDocumentSymbolsAsync(path); - symbols.Should().BeEmpty(); + var symbols = await index.HierarchicalDocumentSymbolsAsync(path); + symbols.Should().BeEmpty(); + } } [TestMethod, Priority(0)] public async Task IndexWorkspaceSymbolsFlattenAsync() { - var code = @"class Foo(object): + const string code = @"class Foo(object): def foo(self, x): ..."; - ISymbolIndex index = MakeSymbolIndex(); - var path = TestData.GetDefaultModulePath(); + using (var index = MakeSymbolIndex()) { + var path = TestData.GetDefaultModulePath(); + index.Add(path, DocumentWithAst(code)); - index.Add(path, DocumentWithAst(code)); - - var symbols = await index.WorkspaceSymbolsAsync("", maxSymbols); - symbols.Should().BeEquivalentToWithStrictOrdering(new[] { - new FlatSymbol("Foo", SymbolKind.Class, path, new SourceSpan(1, 7, 1, 10)), - new FlatSymbol("foo", SymbolKind.Method, path, new SourceSpan(2, 9, 2, 12), "Foo"), - new FlatSymbol("self", SymbolKind.Variable, path, new SourceSpan(2, 13, 2, 17), "foo"), - new FlatSymbol("x", SymbolKind.Variable, path, new SourceSpan(2, 19, 2, 20), "foo"), - }); + var symbols = await index.WorkspaceSymbolsAsync("", maxSymbols); + symbols.Should().BeEquivalentToWithStrictOrdering(new[] { + new FlatSymbol("Foo", SymbolKind.Class, path, new SourceSpan(1, 7, 1, 10)), + new FlatSymbol("foo", SymbolKind.Method, path, new SourceSpan(2, 9, 2, 12), "Foo"), + new FlatSymbol("self", SymbolKind.Variable, path, new SourceSpan(2, 13, 2, 17), "foo"), + new FlatSymbol("x", SymbolKind.Variable, path, new SourceSpan(2, 19, 2, 20), "foo") + }); + } } [TestMethod, Priority(0)] public async Task IndexWorkspaceSymbolsFilteredAsync() { - var code = @"class Foo(object): + const string code = @"class Foo(object): def foo(self, x): ..."; - ISymbolIndex index = MakeSymbolIndex(); - var path = TestData.GetDefaultModulePath(); + using (var index = MakeSymbolIndex()) { + var path = TestData.GetDefaultModulePath(); - index.Add(path, DocumentWithAst(code)); + index.Add(path, DocumentWithAst(code)); - var symbols = await index.WorkspaceSymbolsAsync("x", maxSymbols); - symbols.Should().BeEquivalentToWithStrictOrdering(new[] { - new FlatSymbol("x", SymbolKind.Variable, path, new SourceSpan(2, 19, 2, 20), "foo"), - }); + var symbols = await index.WorkspaceSymbolsAsync("x", maxSymbols); + symbols.Should().BeEquivalentToWithStrictOrdering(new[] { + new FlatSymbol("x", SymbolKind.Variable, path, new SourceSpan(2, 19, 2, 20), "foo"), + }); + } } [TestMethod, Priority(0)] public async Task IndexWorkspaceSymbolsNotFoundAsync() { - ISymbolIndex index = MakeSymbolIndex(); - var path = TestData.GetDefaultModulePath(); - - var symbols = await index.WorkspaceSymbolsAsync("", maxSymbols); - symbols.Should().BeEmpty(); + using (var index = MakeSymbolIndex()) { + var path = TestData.GetDefaultModulePath(); + var symbols = await index.WorkspaceSymbolsAsync("", maxSymbols); + symbols.Should().BeEmpty(); + } } [TestMethod, Priority(0)] public async Task IndexWorkspaceSymbolsCaseInsensitiveAsync() { - var code = @"class Foo(object): + const string code = @"class Foo(object): def foo(self, x): ..."; - ISymbolIndex index = MakeSymbolIndex(); - var path = TestData.GetDefaultModulePath(); + using (var index = MakeSymbolIndex()) { + var path = TestData.GetDefaultModulePath(); + index.Add(path, DocumentWithAst(code)); - index.Add(path, DocumentWithAst(code)); - - var symbols = await index.WorkspaceSymbolsAsync("foo", maxSymbols); - symbols.Should().BeEquivalentToWithStrictOrdering(new[] { - new FlatSymbol("Foo", SymbolKind.Class, path, new SourceSpan(1, 7, 1, 10)), - new FlatSymbol("foo", SymbolKind.Method, path, new SourceSpan(2, 9, 2, 12), "Foo"), - }); + var symbols = await index.WorkspaceSymbolsAsync("foo", maxSymbols); + symbols.Should().BeEquivalentToWithStrictOrdering(new[] { + new FlatSymbol("Foo", SymbolKind.Class, path, new SourceSpan(1, 7, 1, 10)), + new FlatSymbol("foo", SymbolKind.Method, path, new SourceSpan(2, 9, 2, 12), "Foo"), + }); + } } [TestMethod, Priority(0)] public void MarkAsPendingWaitsForUpdates() { - ISymbolIndex index = MakeSymbolIndex(); - var path = TestData.GetDefaultModulePath(); - - index.Add(path, DocumentWithAst("x = 1")); - index.MarkAsPending(path); - var cts = new CancellationTokenSource(); - var t = index.HierarchicalDocumentSymbolsAsync(path, cts.Token); - t.IsCompleted.Should().BeFalse(); - cts.Cancel(); - Func cancelled = async () => { - await t; - }; - cancelled.Should().Throw(); + using (var index = MakeSymbolIndex()) { + var path = TestData.GetDefaultModulePath(); + + index.Add(path, DocumentWithAst("x = 1")); + index.MarkAsPending(path); + using (var cts = new CancellationTokenSource()) { + var t = index.HierarchicalDocumentSymbolsAsync(path, cts.Token); + t.Should().NotBeCompleted(); + cts.Cancel(); + Func cancelled = async () => { + await t; + }; + cancelled.Should().Throw(); + } + } } [TestMethod, Priority(0)] public async Task SymbolsAfterPendingWaitsForUpdateAsync() { - ISymbolIndex index = MakeSymbolIndex(); - var path = TestData.GetDefaultModulePath(); + using (var index = MakeSymbolIndex()) { + var path = TestData.GetDefaultModulePath(); - index.Add(path, DocumentWithAst("x = 1")); - index.MarkAsPending(path); - var t = index.WorkspaceSymbolsAsync("", maxSymbols); - index.ReIndex(path, DocumentWithAst("x = 1")); - var symbols = await t; - symbols.Should().BeEquivalentToWithStrictOrdering(new[] { - new FlatSymbol("x", SymbolKind.Variable, path, new SourceSpan(1, 1, 1, 2)), - }); + index.Add(path, DocumentWithAst("x = 1")); + index.MarkAsPending(path); + var t = index.WorkspaceSymbolsAsync("", maxSymbols); + index.ReIndex(path, DocumentWithAst("x = 1")); + var symbols = await t; + symbols.Should().BeEquivalentToWithStrictOrdering(new[] { + new FlatSymbol("x", SymbolKind.Variable, path, new SourceSpan(1, 1, 1, 2)) + }); + } } private PythonAst GetParse(string code, PythonLanguageVersion version = PythonLanguageVersion.V37) @@ -199,14 +207,14 @@ private IReadOnlyList WalkSymbols(string code, PythonLanguag private IDocument DocumentWithAst(string testCode, string filePath = null) { filePath = filePath ?? $"{_rootPath}/{testCode}.py"; - IDocument doc = Substitute.For(); + var doc = Substitute.For(); doc.GetAstAsync().ReturnsForAnyArgs(Task.FromResult(MakeAst(testCode))); doc.Uri.Returns(new Uri(filePath)); return doc; } private PythonAst MakeAst(string testCode) { - PythonLanguageVersion latestVersion = PythonVersions.LatestAvailable3X.Version.ToLanguageVersion(); + var latestVersion = PythonVersions.LatestAvailable3X.Version.ToLanguageVersion(); return Parser.CreateParser(MakeStream(testCode), latestVersion).ParseFile(); } diff --git a/src/UnitTests/Core/Impl/Baseline.cs b/src/UnitTests/Core/Impl/Baseline.cs index 181ebf3f0..74e87d235 100644 --- a/src/UnitTests/Core/Impl/Baseline.cs +++ b/src/UnitTests/Core/Impl/Baseline.cs @@ -54,50 +54,51 @@ public static void CompareStringLines(string expected, string actual) { } public static int CompareLines(string expected, string actual, out string expectedLine, out string actualLine, out int index, bool ignoreCase = false) { - var actualReader = new StringReader(actual); - var expectedReader = new StringReader(expected); + using (var actualReader = new StringReader(actual)) + using (var expectedReader = new StringReader(expected)) { - var lineNum = 1; - index = 0; + var lineNum = 1; + index = 0; - for (; ; lineNum++) { - expectedLine = expectedReader.ReadLine(); - actualLine = actualReader.ReadLine(); + for (;; lineNum++) { + expectedLine = expectedReader.ReadLine(); + actualLine = actualReader.ReadLine(); - if (expectedLine == null || actualLine == null) { - break; - } + if (expectedLine == null || actualLine == null) { + break; + } + + var minLength = Math.Min(expectedLine.Length, actualLine.Length); + for (var i = 0; i < minLength; i++) { + var act = actualLine[i]; + var exp = expectedLine[i]; - var minLength = Math.Min(expectedLine.Length, actualLine.Length); - for (var i = 0; i < minLength; i++) { - var act = actualLine[i]; - var exp = expectedLine[i]; + if (ignoreCase) { + act = char.ToLowerInvariant(act); + exp = char.ToLowerInvariant(exp); + } - if (ignoreCase) { - act = char.ToLowerInvariant(act); - exp = char.ToLowerInvariant(exp); + if (act != exp) { + index = i + 1; + return lineNum; + } } - if (act != exp) { - index = i + 1; + if (expectedLine.Length != actualLine.Length) { + index = minLength + 1; return lineNum; } } - if (expectedLine.Length != actualLine.Length) { - index = minLength + 1; - return lineNum; - } - } + if (expectedLine == null && actualLine == null) { + expectedLine = string.Empty; + actualLine = string.Empty; - if (expectedLine == null && actualLine == null) { - expectedLine = string.Empty; - actualLine = string.Empty; + return 0; + } - return 0; + return lineNum; } - - return lineNum; } public static void CompareToFile(string baselineFile, string actual, bool regenerateBaseline = false, bool ignoreCase = false) { From 8cf831fdff85a6b4e921942c105be0a522bb8115 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 5 Sep 2019 11:50:13 -0700 Subject: [PATCH 20/60] Upgrade to 3.0 --- src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj | 2 +- src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs | 1 + src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj | 2 +- src/Analysis/Core/Impl/Microsoft.Python.Analysis.Core.csproj | 2 +- src/Core/Impl/Microsoft.Python.Core.csproj | 2 +- src/Core/Test/Microsoft.Python.Core.Tests.csproj | 2 +- src/LanguageServer/Impl/Formatting/BlockFormatter.cs | 1 + src/LanguageServer/Impl/Formatting/LineFormatter.cs | 1 + src/LanguageServer/Impl/LanguageServer.cs | 2 +- src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj | 2 +- src/LanguageServer/Impl/Protocol/Classes.cs | 2 +- src/LanguageServer/Impl/Protocol/Messages.cs | 1 + src/LanguageServer/Impl/Sources/HoverSource.cs | 2 +- .../Test/FluentAssertions/TextEditCollectionAssertions.cs | 1 + .../Test/Microsoft.Python.LanguageServer.Tests.csproj | 2 +- src/Parsing/Impl/Microsoft.Python.Parsing.csproj | 2 +- src/Parsing/Test/Microsoft.Python.Parsing.Tests.csproj | 2 +- src/UnitTests/Core/Impl/UnitTests.Core.csproj | 2 +- 18 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj b/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj index 8f4bbee5a..f4f68aa84 100644 --- a/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj +++ b/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + netstandard2.1 Microsoft.Python.Analysis Microsoft.Python.Analysis diff --git a/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs b/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs index 9be29ed15..70ad06871 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs @@ -24,6 +24,7 @@ using Microsoft.Python.Core; using Microsoft.Python.Core.Text; using Microsoft.Python.Parsing; +using Range = Microsoft.Python.Core.Text.Range; namespace Microsoft.Python.Analysis.Tests.FluentAssertions { public static class AssertionsUtilities { diff --git a/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj b/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj index 4a7a9f7a7..2e5dfb031 100644 --- a/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj +++ b/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp2.2 + netcoreapp3.0 Microsoft.Python.Analysis.Tests Microsoft.Python.Analysis.Tests diff --git a/src/Analysis/Core/Impl/Microsoft.Python.Analysis.Core.csproj b/src/Analysis/Core/Impl/Microsoft.Python.Analysis.Core.csproj index 4e97b8e58..ea90bd130 100644 --- a/src/Analysis/Core/Impl/Microsoft.Python.Analysis.Core.csproj +++ b/src/Analysis/Core/Impl/Microsoft.Python.Analysis.Core.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + netstandard2.1 Microsoft.Python.Analysis Microsoft.Python.Analysis.Core diff --git a/src/Core/Impl/Microsoft.Python.Core.csproj b/src/Core/Impl/Microsoft.Python.Core.csproj index f41668645..f7cb41618 100644 --- a/src/Core/Impl/Microsoft.Python.Core.csproj +++ b/src/Core/Impl/Microsoft.Python.Core.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + netstandard2.1 Microsoft.Python.Core Microsoft.Python.Core diff --git a/src/Core/Test/Microsoft.Python.Core.Tests.csproj b/src/Core/Test/Microsoft.Python.Core.Tests.csproj index 1ca8be126..131762ab6 100644 --- a/src/Core/Test/Microsoft.Python.Core.Tests.csproj +++ b/src/Core/Test/Microsoft.Python.Core.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp2.2 + netcoreapp3.0 Microsoft.Python.Core.Tests Microsoft.Python.Core.Tests diff --git a/src/LanguageServer/Impl/Formatting/BlockFormatter.cs b/src/LanguageServer/Impl/Formatting/BlockFormatter.cs index 30e820c8a..adbd7cd52 100644 --- a/src/LanguageServer/Impl/Formatting/BlockFormatter.cs +++ b/src/LanguageServer/Impl/Formatting/BlockFormatter.cs @@ -24,6 +24,7 @@ using Microsoft.Python.Core.Diagnostics; using Microsoft.Python.Core.Text; using Microsoft.Python.LanguageServer.Protocol; +using Range = Microsoft.Python.Core.Text.Range; namespace Microsoft.Python.LanguageServer.Formatting { /// diff --git a/src/LanguageServer/Impl/Formatting/LineFormatter.cs b/src/LanguageServer/Impl/Formatting/LineFormatter.cs index 22720232b..88afbe1b7 100644 --- a/src/LanguageServer/Impl/Formatting/LineFormatter.cs +++ b/src/LanguageServer/Impl/Formatting/LineFormatter.cs @@ -24,6 +24,7 @@ using Microsoft.Python.Core.Text; using Microsoft.Python.LanguageServer.Protocol; using Microsoft.Python.Parsing; +using Range = Microsoft.Python.Core.Text.Range; namespace Microsoft.Python.LanguageServer.Formatting { /// diff --git a/src/LanguageServer/Impl/LanguageServer.cs b/src/LanguageServer/Impl/LanguageServer.cs index e522897de..5831b91fa 100644 --- a/src/LanguageServer/Impl/LanguageServer.cs +++ b/src/LanguageServer/Impl/LanguageServer.cs @@ -25,7 +25,6 @@ using Microsoft.Python.Core.Idle; using Microsoft.Python.Core.Logging; using Microsoft.Python.Core.Services; -using Microsoft.Python.Core.Text; using Microsoft.Python.Core.Threading; using Microsoft.Python.LanguageServer.Extensibility; using Microsoft.Python.LanguageServer.Protocol; @@ -33,6 +32,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using StreamJsonRpc; +using Range = Microsoft.Python.Core.Text.Range; namespace Microsoft.Python.LanguageServer.Implementation { /// diff --git a/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj b/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj index 58b65f302..c14e1229b 100644 --- a/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj +++ b/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj @@ -1,6 +1,6 @@  - netcoreapp2.2 + netcoreapp3.0 Microsoft.Python.LanguageServer Microsoft.Python.LanguageServer diff --git a/src/LanguageServer/Impl/Protocol/Classes.cs b/src/LanguageServer/Impl/Protocol/Classes.cs index 7f93794d9..a22bccf42 100644 --- a/src/LanguageServer/Impl/Protocol/Classes.cs +++ b/src/LanguageServer/Impl/Protocol/Classes.cs @@ -16,8 +16,8 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using Microsoft.Python.Core.Text; using Newtonsoft.Json; +using Range = Microsoft.Python.Core.Text.Range; namespace Microsoft.Python.LanguageServer.Protocol { [Serializable] diff --git a/src/LanguageServer/Impl/Protocol/Messages.cs b/src/LanguageServer/Impl/Protocol/Messages.cs index 7c70d3686..2fb1305bb 100644 --- a/src/LanguageServer/Impl/Protocol/Messages.cs +++ b/src/LanguageServer/Impl/Protocol/Messages.cs @@ -17,6 +17,7 @@ using System.Runtime.InteropServices; using System.Threading.Tasks; using Microsoft.Python.Core.Text; +using Range = Microsoft.Python.Core.Text.Range; namespace Microsoft.Python.LanguageServer.Protocol { [Serializable] diff --git a/src/LanguageServer/Impl/Sources/HoverSource.cs b/src/LanguageServer/Impl/Sources/HoverSource.cs index 83cdf51fa..22ed0aeb5 100644 --- a/src/LanguageServer/Impl/Sources/HoverSource.cs +++ b/src/LanguageServer/Impl/Sources/HoverSource.cs @@ -13,7 +13,6 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System; using Microsoft.Python.Analysis; using Microsoft.Python.Analysis.Analyzer; using Microsoft.Python.Analysis.Analyzer.Expressions; @@ -25,6 +24,7 @@ using Microsoft.Python.LanguageServer.Completion; using Microsoft.Python.LanguageServer.Protocol; using Microsoft.Python.Parsing.Ast; +using Range = Microsoft.Python.Core.Text.Range; namespace Microsoft.Python.LanguageServer.Sources { internal sealed class HoverSource { diff --git a/src/LanguageServer/Test/FluentAssertions/TextEditCollectionAssertions.cs b/src/LanguageServer/Test/FluentAssertions/TextEditCollectionAssertions.cs index d3e8534ad..cd4a556db 100644 --- a/src/LanguageServer/Test/FluentAssertions/TextEditCollectionAssertions.cs +++ b/src/LanguageServer/Test/FluentAssertions/TextEditCollectionAssertions.cs @@ -23,6 +23,7 @@ using Microsoft.Python.Core.Text; using Microsoft.Python.LanguageServer.Protocol; using static Microsoft.Python.Analysis.Tests.FluentAssertions.AssertionsUtilities; +using Range = Microsoft.Python.Core.Text.Range; namespace Microsoft.Python.LanguageServer.Tests.FluentAssertions { [ExcludeFromCodeCoverage] diff --git a/src/LanguageServer/Test/Microsoft.Python.LanguageServer.Tests.csproj b/src/LanguageServer/Test/Microsoft.Python.LanguageServer.Tests.csproj index 3bf4d084d..85c33691c 100644 --- a/src/LanguageServer/Test/Microsoft.Python.LanguageServer.Tests.csproj +++ b/src/LanguageServer/Test/Microsoft.Python.LanguageServer.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp2.2 + netcoreapp3.0 Microsoft.Python.LanguageServer.Tests Microsoft.Python.LanguageServer.Tests diff --git a/src/Parsing/Impl/Microsoft.Python.Parsing.csproj b/src/Parsing/Impl/Microsoft.Python.Parsing.csproj index 0b21cd07b..2773fbace 100644 --- a/src/Parsing/Impl/Microsoft.Python.Parsing.csproj +++ b/src/Parsing/Impl/Microsoft.Python.Parsing.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + netstandard2.1 Microsoft.Python.Parsing Microsoft.Python.Parsing diff --git a/src/Parsing/Test/Microsoft.Python.Parsing.Tests.csproj b/src/Parsing/Test/Microsoft.Python.Parsing.Tests.csproj index 8eeb7a1ed..23ff93b1d 100644 --- a/src/Parsing/Test/Microsoft.Python.Parsing.Tests.csproj +++ b/src/Parsing/Test/Microsoft.Python.Parsing.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp2.2 + netcoreapp3.0 Microsoft.Python.Parsing.Tests Microsoft.Python.Parsing.Tests diff --git a/src/UnitTests/Core/Impl/UnitTests.Core.csproj b/src/UnitTests/Core/Impl/UnitTests.Core.csproj index 3a1e90721..165ef15c4 100644 --- a/src/UnitTests/Core/Impl/UnitTests.Core.csproj +++ b/src/UnitTests/Core/Impl/UnitTests.Core.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + netstandard2.1 Microsoft.Python.UnitTests.Core Microsoft.Python.UnitTests.Core From 54d67cb646e94826152df3d60335b2c07f7b4c1d Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 5 Sep 2019 12:47:23 -0700 Subject: [PATCH 21/60] Undo change + .NET 3 --- .../Ast/Impl/Analyzer/PythonAnalyzerEntry.cs | 14 +++++++++++--- src/Analysis/Ast/Test/AnalysisTestBase.cs | 9 ++++----- .../Impl/Microsoft.Python.Analysis.Caching.csproj | 2 +- .../Microsoft.Python.Analysis.Caching.Tests.csproj | 2 +- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs index f3a8a6046..011e68978 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs @@ -246,10 +246,18 @@ public bool Invalidate(IPythonModule module, PythonAst ast, int bufferVersion, i } private HashSet FindDependencies(IPythonModule module, PythonAst ast, int bufferVersion) { + var dependencies = new HashSet(); + if (_bufferVersion > bufferVersion) { + return dependencies; + } + var dependencyProvider = (module as IAnalyzable)?.DependencyProvider; - var dependencies = _bufferVersion <= bufferVersion && module is IAnalyzable analyzable && analyzable.DependencyProvider != null - ? dependencyProvider.GetDependencies() - : new HashSet(); + var moduleDeps = dependencyProvider?.GetDependencies(); + if (moduleDeps != null) { + dependencies.UnionWith(moduleDeps); + } + + dependencies.Remove(new AnalysisModuleKey(module)); return dependencies; } diff --git a/src/Analysis/Ast/Test/AnalysisTestBase.cs b/src/Analysis/Ast/Test/AnalysisTestBase.cs index b44c85045..89d1fa046 100644 --- a/src/Analysis/Ast/Test/AnalysisTestBase.cs +++ b/src/Analysis/Ast/Test/AnalysisTestBase.cs @@ -63,7 +63,6 @@ protected Task CreateServicesAsync(InterpreterConfiguration con protected async Task CreateServicesAsync(string root, InterpreterConfiguration configuration, string stubCacheFolderPath = null, IServiceManager sm = null, string[] searchPaths = null) { configuration = configuration ?? PythonVersions.LatestAvailable; configuration.AssertInstalled(); - stubCacheFolderPath = stubCacheFolderPath ?? TestData.GetAstAnalysisCachePath(configuration.Version, true); Trace.TraceInformation("Cache Path: " + stubCacheFolderPath); searchPaths = searchPaths ?? new[] { GetAnalysisTestDataFilesPath() }; @@ -147,16 +146,16 @@ protected async Task GetAnalysisAsync( doc = new PythonModule(mco, services); } - TestLogger.Log(TraceEventType.Information, "Ast begin"); + TestLogger.Log(TraceEventType.Information, "Test: AST begin."); var ast = await doc.GetAstAsync(CancellationToken.None); ast.Should().NotBeNull(); - TestLogger.Log(TraceEventType.Information, "Ast end"); + TestLogger.Log(TraceEventType.Information, "Test: AST end."); - TestLogger.Log(TraceEventType.Information, "Analysis begin"); + TestLogger.Log(TraceEventType.Information, "Test: Analysis begin."); await services.GetService().WaitForCompleteAnalysisAsync(); var analysis = await doc.GetAnalysisAsync(-1); analysis.Should().NotBeNull(); - TestLogger.Log(TraceEventType.Information, "Analysis end"); + TestLogger.Log(TraceEventType.Information, "Test: Analysis end."); return analysis; } diff --git a/src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj b/src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj index 5f17847f4..73ddbba31 100644 --- a/src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj +++ b/src/Caching/Impl/Microsoft.Python.Analysis.Caching.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + netstandard2.1 Microsoft.Python.Analysis.Caching Microsoft.Python.Analysis.Caching diff --git a/src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj b/src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj index f0fe11140..98133eaab 100644 --- a/src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj +++ b/src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp2.2 + netcoreapp3.0 Microsoft.Python.Analysis.Caching.Tests Microsoft.Python.Analysis.Caching.Tests From 26ea552ede5fd72cb85867f5ddd9700ad9e1b5cd Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 5 Sep 2019 13:00:44 -0700 Subject: [PATCH 22/60] Get back to 2.0 --- src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj | 2 +- src/Analysis/Core/Impl/Microsoft.Python.Analysis.Core.csproj | 2 +- src/Core/Impl/Microsoft.Python.Core.csproj | 2 +- src/Parsing/Impl/Microsoft.Python.Parsing.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj b/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj index f4f68aa84..8f4bbee5a 100644 --- a/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj +++ b/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj @@ -1,6 +1,6 @@  - netstandard2.1 + netstandard2.0 Microsoft.Python.Analysis Microsoft.Python.Analysis diff --git a/src/Analysis/Core/Impl/Microsoft.Python.Analysis.Core.csproj b/src/Analysis/Core/Impl/Microsoft.Python.Analysis.Core.csproj index ea90bd130..4e97b8e58 100644 --- a/src/Analysis/Core/Impl/Microsoft.Python.Analysis.Core.csproj +++ b/src/Analysis/Core/Impl/Microsoft.Python.Analysis.Core.csproj @@ -1,6 +1,6 @@  - netstandard2.1 + netstandard2.0 Microsoft.Python.Analysis Microsoft.Python.Analysis.Core diff --git a/src/Core/Impl/Microsoft.Python.Core.csproj b/src/Core/Impl/Microsoft.Python.Core.csproj index f7cb41618..f41668645 100644 --- a/src/Core/Impl/Microsoft.Python.Core.csproj +++ b/src/Core/Impl/Microsoft.Python.Core.csproj @@ -1,6 +1,6 @@  - netstandard2.1 + netstandard2.0 Microsoft.Python.Core Microsoft.Python.Core diff --git a/src/Parsing/Impl/Microsoft.Python.Parsing.csproj b/src/Parsing/Impl/Microsoft.Python.Parsing.csproj index 2773fbace..0b21cd07b 100644 --- a/src/Parsing/Impl/Microsoft.Python.Parsing.csproj +++ b/src/Parsing/Impl/Microsoft.Python.Parsing.csproj @@ -1,6 +1,6 @@  - netstandard2.1 + netstandard2.0 Microsoft.Python.Parsing Microsoft.Python.Parsing From 227726c3d067ee1f33174aa4acab5f46cb8a2480 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 5 Sep 2019 13:26:13 -0700 Subject: [PATCH 23/60] Update components --- .../Ast/Test/Microsoft.Python.Analysis.Tests.csproj | 8 ++++---- .../Test/Microsoft.Python.Analysis.Caching.Tests.csproj | 8 ++++---- src/Core/Test/Microsoft.Python.Core.Tests.csproj | 6 +++--- .../Impl/Microsoft.Python.LanguageServer.csproj | 2 +- .../Test/Microsoft.Python.LanguageServer.Tests.csproj | 8 ++++---- src/Parsing/Test/Microsoft.Python.Parsing.Tests.csproj | 6 +++--- src/UnitTests/Core/Impl/UnitTests.Core.csproj | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj b/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj index f1a9763b2..3b87a46b2 100644 --- a/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj +++ b/src/Analysis/Ast/Test/Microsoft.Python.Analysis.Tests.csproj @@ -23,14 +23,14 @@ - - - + + + all runtime; build; native; contentfiles; analyzers - + diff --git a/src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj b/src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj index 98133eaab..514328cd5 100644 --- a/src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj +++ b/src/Caching/Test/Microsoft.Python.Analysis.Caching.Tests.csproj @@ -17,14 +17,14 @@ - - - + + + all runtime; build; native; contentfiles; analyzers - + diff --git a/src/Core/Test/Microsoft.Python.Core.Tests.csproj b/src/Core/Test/Microsoft.Python.Core.Tests.csproj index 675678349..f6cccffde 100644 --- a/src/Core/Test/Microsoft.Python.Core.Tests.csproj +++ b/src/Core/Test/Microsoft.Python.Core.Tests.csproj @@ -27,9 +27,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj b/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj index 68630cc62..14c19e3c7 100644 --- a/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj +++ b/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj @@ -31,7 +31,7 @@ - + diff --git a/src/LanguageServer/Test/Microsoft.Python.LanguageServer.Tests.csproj b/src/LanguageServer/Test/Microsoft.Python.LanguageServer.Tests.csproj index 85c33691c..dd43c522b 100644 --- a/src/LanguageServer/Test/Microsoft.Python.LanguageServer.Tests.csproj +++ b/src/LanguageServer/Test/Microsoft.Python.LanguageServer.Tests.csproj @@ -23,15 +23,15 @@ - + - - + + all runtime; build; native; contentfiles; analyzers - + diff --git a/src/Parsing/Test/Microsoft.Python.Parsing.Tests.csproj b/src/Parsing/Test/Microsoft.Python.Parsing.Tests.csproj index 23ff93b1d..b0c838cfb 100644 --- a/src/Parsing/Test/Microsoft.Python.Parsing.Tests.csproj +++ b/src/Parsing/Test/Microsoft.Python.Parsing.Tests.csproj @@ -27,10 +27,10 @@ - + - - + + all runtime; build; native; contentfiles; analyzers diff --git a/src/UnitTests/Core/Impl/UnitTests.Core.csproj b/src/UnitTests/Core/Impl/UnitTests.Core.csproj index 165ef15c4..9b5e111e0 100644 --- a/src/UnitTests/Core/Impl/UnitTests.Core.csproj +++ b/src/UnitTests/Core/Impl/UnitTests.Core.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers From 2dd8fcff0f7218ff0b6ab4331267006d41e607cf Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 5 Sep 2019 15:06:01 -0700 Subject: [PATCH 24/60] Display caching level Round time to reasonble fractions. --- build/Common.Build.Core.settings | 4 ++-- .../Ast/Impl/Analyzer/PythonAnalyzerSession.cs | 7 +++++-- src/LanguageServer/Impl/Implementation/Server.cs | 11 +---------- .../Impl/LanguageServer.Configuration.cs | 5 +++++ src/LanguageServer/Impl/Protocol/Classes.cs | 5 ----- src/LanguageServer/Impl/Resources.Designer.cs | 15 +++------------ src/LanguageServer/Impl/Resources.resx | 7 ++----- 7 files changed, 18 insertions(+), 36 deletions(-) diff --git a/build/Common.Build.Core.settings b/build/Common.Build.Core.settings index a38d4dbea..cc11ec495 100644 --- a/build/Common.Build.Core.settings +++ b/build/Common.Build.Core.settings @@ -9,8 +9,8 @@ + Please do not put Windows-specific or desktop-specific settings + here (these include C#, C++ or VS SDK settings and targets --> Debug 10.0 diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index 9abc1b5a6..f1f24e875 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -152,6 +152,7 @@ private async Task StartAsync() { _progress.ReportRemaining(remaining); if (isFinal) { var (modulesCount, totalMilliseconds) = ActivityTracker.EndTracking(); + totalMilliseconds = Math.Round(totalMilliseconds, 2); (_analyzer as PythonAnalyzer)?.RaiseAnalysisComplete(modulesCount, totalMilliseconds); _log?.Log(TraceEventType.Verbose, $"Analysis complete: {modulesCount} modules in {totalMilliseconds} ms."); } @@ -177,6 +178,7 @@ private static void LogResults(ILogger logger, double elapsed, int originalRemai return; } + elapsed = Math.Round(elapsed, 2); if (remaining == 0) { logger.Log(TraceEventType.Verbose, $"Analysis version {version} of {originalRemaining} entries has been completed in {elapsed} ms."); } else if (remaining < originalRemaining) { @@ -423,9 +425,10 @@ private IDocumentAnalysis CreateAnalysis(IDependencyChainNode node, IPythonModule module, Stopwatch stopWatch, TimeSpan startTime) { if (_log != null) { var completed = node != null && module.Analysis is LibraryAnalysis ? "completed for library" : "completed"; + var elapsed = Math.Round((stopWatch.Elapsed - startTime).TotalMilliseconds, 2); var message = node != null - ? $"Analysis of {module.Name} ({module.ModuleType}) on depth {node.VertexDepth} {completed} in {(stopWatch.Elapsed - startTime).TotalMilliseconds} ms." - : $"Out of order analysis of {module.Name}({module.ModuleType}) completed in {(stopWatch.Elapsed - startTime).TotalMilliseconds} ms."; + ? $"Analysis of {module.Name} ({module.ModuleType}) on depth {node.VertexDepth} {completed} in {elapsed} ms." + : $"Out of order analysis of {module.Name}({module.ModuleType}) completed in {elapsed} ms."; _log.Log(TraceEventType.Verbose, message); } } diff --git a/src/LanguageServer/Impl/Implementation/Server.cs b/src/LanguageServer/Impl/Implementation/Server.cs index d9ccb3e3c..57c823f1f 100644 --- a/src/LanguageServer/Impl/Implementation/Server.cs +++ b/src/LanguageServer/Impl/Implementation/Server.cs @@ -137,24 +137,15 @@ public async Task InitializedAsync(InitializedParams @params, CancellationToken Version.TryParse(initializationOptions?.interpreter.properties?.Version, out var version); - if (initializationOptions?.enableAnalysisCache != false) { - _log?.Log(TraceEventType.Information, Resources.AnalysisCacheEnabled); - _services.AddService(new ModuleDatabase(_services)); - } else { - _log?.Log(TraceEventType.Information, Resources.AnalysisCacheDisabled); - } - var configuration = new InterpreterConfiguration( interpreterPath: initializationOptions?.interpreter.properties?.InterpreterPath, version: version ); + _services.AddService(new ModuleDatabase(_services)); var typeshedPath = initializationOptions?.typeStubSearchPaths.FirstOrDefault(); userConfiguredPaths = userConfiguredPaths ?? initializationOptions?.searchPaths; _interpreter = await PythonInterpreter.CreateAsync(configuration, _rootDir, _services, typeshedPath, userConfiguredPaths.ToImmutableArray(), cancellationToken); - - _interpreter = await PythonInterpreter.CreateAsync(configuration, _rootDir, _services, typeshedPath, userConfiguredPaths.ToImmutableArray(), cancellationToken); - _services.AddService(_interpreter); _log?.Log(TraceEventType.Information, string.IsNullOrEmpty(_interpreter.Configuration.InterpreterPath) diff --git a/src/LanguageServer/Impl/LanguageServer.Configuration.cs b/src/LanguageServer/Impl/LanguageServer.Configuration.cs index bdf37ac5a..6357c7b29 100644 --- a/src/LanguageServer/Impl/LanguageServer.Configuration.cs +++ b/src/LanguageServer/Impl/LanguageServer.Configuration.cs @@ -16,11 +16,13 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis; using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Analysis.Caching; using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Modules; @@ -30,6 +32,7 @@ using Microsoft.Python.LanguageServer.Protocol; using Newtonsoft.Json.Linq; using StreamJsonRpc; +using DiagnosticSource = Microsoft.Python.Analysis.Diagnostics.DiagnosticSource; namespace Microsoft.Python.LanguageServer.Implementation { public sealed partial class LanguageServer { @@ -87,6 +90,8 @@ private void HandleDiagnosticsChanges(JToken pythonSection, LanguageServerSettin optionsProvider.Options.KeepLibraryLocalVariables = GetSetting(memory, "keepLibraryLocalVariables", false); optionsProvider.Options.KeepLibraryAst = GetSetting(memory, "keepLibraryAst", false); optionsProvider.Options.AnalysisCachingLevel = GetAnalysisCachingLevel(analysis); + + _logger?.Log(TraceEventType.Information, Resources.AnalysisCacheLevel.FormatInvariant(optionsProvider.Options.AnalysisCachingLevel)); } internal static void HandleLintingOnOff(IServiceContainer services, bool linterEnabled) { diff --git a/src/LanguageServer/Impl/Protocol/Classes.cs b/src/LanguageServer/Impl/Protocol/Classes.cs index a65ea4f82..a22bccf42 100644 --- a/src/LanguageServer/Impl/Protocol/Classes.cs +++ b/src/LanguageServer/Impl/Protocol/Classes.cs @@ -158,11 +158,6 @@ public sealed class InterpreterProperties { /// Path to a writable folder where analyzer can cache its data. /// public string cacheFolderPath; - - /// - /// Turns off analysis caching. - /// - public bool? enableAnalysisCache; } [Serializable] diff --git a/src/LanguageServer/Impl/Resources.Designer.cs b/src/LanguageServer/Impl/Resources.Designer.cs index 135b8a537..1f1b98988 100644 --- a/src/LanguageServer/Impl/Resources.Designer.cs +++ b/src/LanguageServer/Impl/Resources.Designer.cs @@ -61,20 +61,11 @@ internal Resources() { } /// - /// Looks up a localized string similar to Analysis cache disabled.. + /// Looks up a localized string similar to Analysis caching mode: {0}.. /// - internal static string AnalysisCacheDisabled { + internal static string AnalysisCacheLevel { get { - return ResourceManager.GetString("AnalysisCacheDisabled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Analysis cache enabled.. - /// - internal static string AnalysisCacheEnabled { - get { - return ResourceManager.GetString("AnalysisCacheEnabled", resourceCulture); + return ResourceManager.GetString("AnalysisCacheLevel", resourceCulture); } } diff --git a/src/LanguageServer/Impl/Resources.resx b/src/LanguageServer/Impl/Resources.resx index 2e2f7bb58..a971dcc40 100644 --- a/src/LanguageServer/Impl/Resources.resx +++ b/src/LanguageServer/Impl/Resources.resx @@ -117,11 +117,8 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Analysis cache disabled. - - - Analysis cache enabled. + + Analysis caching mode: {0}. Code analysis is in progress... From c0f16e65192c40f749290278e364673cebb814ab Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 5 Sep 2019 15:19:15 -0700 Subject: [PATCH 25/60] Fix null ref due to conflicting changes --- .../Ast/Impl/Analyzer/Handlers/FromImportHandler.cs | 2 +- src/Analysis/Ast/Impl/Extensions/AnalysisExtensions.cs | 2 +- .../Ast/Impl/Specializations/BuiltinsSpecializations.cs | 2 +- src/Analysis/Ast/Impl/Specializations/Specialized.cs | 4 ++-- .../Ast/Impl/Specializations/Typing/TypingModule.cs | 8 ++++---- src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs | 8 ++++---- src/Caching/Impl/Models/FunctionModel.cs | 2 +- src/Caching/Impl/Models/PropertyModel.cs | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs b/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs index 50edd0261..36efdf2a7 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs @@ -151,7 +151,7 @@ private void SpecializeFuture(FromImportStatement node) { var printNameExpression = node.Names.FirstOrDefault(n => n?.Name == "print_function"); if (printNameExpression != null) { var fn = new PythonFunctionType("print", new Location(Module), null, string.Empty); - var o = new PythonFunctionOverload(fn.Name, new Location(Module)); + var o = new PythonFunctionOverload(fn, new Location(Module)); var parameters = new List { new ParameterInfo("*values", Interpreter.GetBuiltinType(BuiltinTypeId.Object), ParameterKind.List, null), new ParameterInfo("sep", Interpreter.GetBuiltinType(BuiltinTypeId.Str), ParameterKind.KeywordOnly, null), diff --git a/src/Analysis/Ast/Impl/Extensions/AnalysisExtensions.cs b/src/Analysis/Ast/Impl/Extensions/AnalysisExtensions.cs index 6995f53b3..2ec61b377 100644 --- a/src/Analysis/Ast/Impl/Extensions/AnalysisExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/AnalysisExtensions.cs @@ -60,7 +60,7 @@ private static PythonFunctionType GetOrCreateFunction(this IDocumentAnalysis ana // 'type()' in code is a function call, not a type class instantiation. if (!(analysis.GlobalScope.Variables[name]?.Value is PythonFunctionType f)) { f = PythonFunctionType.Specialize(name, analysis.Document, string.Empty); - f.AddOverload(new PythonFunctionOverload(name, new Location(analysis.Document))); + f.AddOverload(new PythonFunctionOverload(f, new Location(analysis.Document))); analysis.GlobalScope.DeclareVariable(name, f, VariableSource.Declaration); } return f; diff --git a/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs b/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs index 7efa0a679..ea7694ec6 100644 --- a/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs +++ b/src/Analysis/Ast/Impl/Specializations/BuiltinsSpecializations.cs @@ -71,7 +71,7 @@ public static IMember Next(IPythonModule module, IPythonFunctionOverload overloa public static IMember __iter__(IPythonInterpreter interpreter, BuiltinTypeId contentTypeId) { var location = new Location(interpreter.ModuleResolution.BuiltinsModule); var fn = new PythonFunctionType(@"__iter__", location, null, string.Empty); - var o = new PythonFunctionOverload(fn.Name, location); + var o = new PythonFunctionOverload(fn, location); o.AddReturnValue(PythonTypeIterator.FromTypeId(interpreter, contentTypeId)); fn.AddOverload(o); return fn; diff --git a/src/Analysis/Ast/Impl/Specializations/Specialized.cs b/src/Analysis/Ast/Impl/Specializations/Specialized.cs index e71222bc4..6ec0e9e57 100644 --- a/src/Analysis/Ast/Impl/Specializations/Specialized.cs +++ b/src/Analysis/Ast/Impl/Specializations/Specialized.cs @@ -20,7 +20,7 @@ internal static class Specialized { public static IPythonPropertyType Property(string name, IPythonModule declaringModule, IPythonType declaringType, IMember returnValue) { var location = new Location(declaringModule); var prop = new PythonPropertyType(name, location, declaringType, false); - var o = new PythonFunctionOverload(prop.Name, location); + var o = new PythonFunctionOverload(prop, location); o.AddReturnValue(returnValue); prop.AddOverload(o); return prop; @@ -29,7 +29,7 @@ public static IPythonPropertyType Property(string name, IPythonModule declaringM public static IPythonFunctionType Function(string name, IPythonModule declaringModule, string documentation, IMember returnValue) { var location = new Location(declaringModule); var prop = PythonFunctionType.Specialize(name, declaringModule, documentation); - var o = new PythonFunctionOverload(prop.Name, location); + var o = new PythonFunctionOverload(prop, location); o.AddReturnValue(returnValue); prop.AddOverload(o); return prop; diff --git a/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs b/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs index 20e2bc712..1761b4a01 100644 --- a/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs +++ b/src/Analysis/Ast/Impl/Specializations/Typing/TypingModule.cs @@ -51,7 +51,7 @@ private void SpecializeMembers() { // TypeVar var fn = PythonFunctionType.Specialize("TypeVar", this, GetMemberDocumentation("TypeVar")); - var o = new PythonFunctionOverload(fn.Name, location); + var o = new PythonFunctionOverload(fn, location); o.SetParameters(new List { new ParameterInfo("name", Interpreter.GetBuiltinType(BuiltinTypeId.Str), ParameterKind.Normal, null), new ParameterInfo("constraints", Interpreter.GetBuiltinType(BuiltinTypeId.Str), ParameterKind.List, null), @@ -73,7 +73,7 @@ private void SpecializeMembers() { // Type fn = PythonFunctionType.Specialize("Type", this, GetMemberDocumentation("Type")); - o = new PythonFunctionOverload(fn.Name, location); + o = new PythonFunctionOverload(fn, location); // When called, create generic parameter type. For documentation // use original TypeVar declaration so it appear as a tooltip. o.SetReturnValueProvider((declaringModule, overload, args, indexSpan) => { @@ -134,7 +134,7 @@ private void SpecializeMembers() { _members["ByteString"] = Interpreter.GetBuiltinType(BuiltinTypeId.Bytes); fn = PythonFunctionType.Specialize("NamedTuple", this, GetMemberDocumentation("NamedTuple")); - o = new PythonFunctionOverload(fn.Name, location); + o = new PythonFunctionOverload(fn, location); o.SetReturnValueProvider((declaringModule, overload, args, indexSpan) => CreateNamedTuple(args.Values(), declaringModule, indexSpan)); fn.AddOverload(o); @@ -154,7 +154,7 @@ private string GetMemberDocumentation(string name) private IPythonType SpecializeNewType(Location location) { var fn = PythonFunctionType.Specialize("NewType", this, GetMemberDocumentation("NewType")); - var o = new PythonFunctionOverload(fn.Name, location); + var o = new PythonFunctionOverload(fn, location); // When called, create generic parameter type. For documentation // use original TypeVar declaration so it appear as a tooltip. o.SetReturnValueProvider((interpreter, overload, args, indexSpan) => CreateTypeAlias(args)); diff --git a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs index d50c55fce..e3158c24c 100644 --- a/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs +++ b/src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs @@ -51,15 +51,15 @@ internal sealed class PythonFunctionOverload : LocatedMember, IPythonFunctionOve private bool _fromAnnotation; public PythonFunctionOverload(IPythonClassMember cm, FunctionDefinition fd, Location location, string returnDocumentation) - : this(cm.Name, location) { - ClassMember = cm; + : this(cm, location) { Documentation = fd.GetDocumentation(); cm.DeclaringModule.AddAstNode(this, fd); _returnDocumentation = returnDocumentation; } - public PythonFunctionOverload(string name, Location location) : base(location) { - Name = name ?? throw new ArgumentNullException(nameof(name)); + public PythonFunctionOverload(IPythonClassMember cm, Location location) : base(location) { + ClassMember = cm ?? throw new ArgumentNullException(nameof(cm)); + Name = cm.Name ?? throw new ArgumentNullException(nameof(cm.Name)); } #region ILocatedMember diff --git a/src/Caching/Impl/Models/FunctionModel.cs b/src/Caching/Impl/Models/FunctionModel.cs index 7c50a97cd..dbfd63ddf 100644 --- a/src/Caching/Impl/Models/FunctionModel.cs +++ b/src/Caching/Impl/Models/FunctionModel.cs @@ -50,7 +50,7 @@ public override void Populate(ModuleFactory mf, IPythonType declaringType, IGlob } foreach (var om in Overloads) { - var o = new PythonFunctionOverload(Name, new Location(mf.Module, IndexSpan.ToSpan())); + var o = new PythonFunctionOverload(_function, new Location(mf.Module, IndexSpan.ToSpan())); o.SetDocumentation(Documentation); o.SetReturnValue(mf.ConstructMember(om.ReturnType), true); o.SetParameters(om.Parameters.Select(p => ConstructParameter(mf, p)).ToArray()); diff --git a/src/Caching/Impl/Models/PropertyModel.cs b/src/Caching/Impl/Models/PropertyModel.cs index e608584e0..296e50ef7 100644 --- a/src/Caching/Impl/Models/PropertyModel.cs +++ b/src/Caching/Impl/Models/PropertyModel.cs @@ -38,7 +38,7 @@ public override IMember Create(ModuleFactory mf, IPythonType declaringType, IGlo public override void Populate(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) { _property.SetDocumentation(Documentation); - var o = new PythonFunctionOverload(Name, mf.DefaultLocation); + var o = new PythonFunctionOverload(_property, mf.DefaultLocation); o.SetDocumentation(Documentation); o.SetReturnValue(mf.ConstructMember(ReturnType), true); _property.AddOverload(o); From 987a83741d3eae721fd28a83077ca9ab962d80cd Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 5 Sep 2019 15:38:49 -0700 Subject: [PATCH 26/60] Null ref fix --- src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index f1f24e875..5645adefe 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -351,7 +351,7 @@ private void AnalyzeEntry(IDependencyChainNode node, Python } private IDocumentAnalysis DoAnalyzeEntry(IDependencyChainNode node, IDocument document, PythonAst ast, int version) { - var moduleType = node.Value.Module.ModuleType; + var moduleType = document.ModuleType; bool isCanceled; lock (_syncObj) { @@ -378,7 +378,7 @@ private IDocumentAnalysis DoAnalyzeEntry(IDependencyChainNode Date: Thu, 5 Sep 2019 16:23:21 -0700 Subject: [PATCH 27/60] Simplify --- .../Ast/Impl/Analyzer/ModuleWalker.cs | 2 +- .../Impl/Analyzer/PythonAnalyzerSession.cs | 41 ++++++++++--------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs index ddd730e48..fc6ead2de 100644 --- a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs +++ b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs @@ -42,7 +42,7 @@ internal class ModuleWalker : AnalysisWalker { public ModuleWalker(IServiceContainer services, IPythonModule module, PythonAst ast, CancellationToken cancellationToken) : base(new ExpressionEval(services, module, ast)) { _stubAnalysis = Module.Stub is IDocument doc ? doc.GetAnyAnalysis() : null; - _cancellationToken = cancellationToken; + _cancellationToken = CancellationToken.None; } public override bool Walk(NameExpression node) { diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index 5645adefe..cba3d32f2 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -336,7 +336,7 @@ private void AnalyzeEntry(IDependencyChainNode node, Python var analyzable = module as IAnalyzable; analyzable?.NotifyAnalysisBegins(); - var analysis = DoAnalyzeEntry(node, (IDocument)module, ast, version); + var analysis = DoAnalyzeEntry(node, module, ast, version); _analyzerCancellationToken.ThrowIfCancellationRequested(); if (analysis != null) { @@ -350,38 +350,41 @@ private void AnalyzeEntry(IDependencyChainNode node, Python } } - private IDocumentAnalysis DoAnalyzeEntry(IDependencyChainNode node, IDocument document, PythonAst ast, int version) { - var moduleType = document.ModuleType; + private IDocumentAnalysis DoAnalyzeEntry(IDependencyChainNode node, IPythonModule module, PythonAst ast, int version) { + var moduleType = module.ModuleType; + IDocumentAnalysis analysis = null; - bool isCanceled; - lock (_syncObj) { - isCanceled = _isCanceled; - } - - if (moduleType.CanBeCached() && _moduleDatabaseService?.ModuleExistsInStorage(document.Name, document.FilePath) == true) { - if (!isCanceled && _moduleDatabaseService.TryRestoreGlobalScope(document, out var gs)) { + if (moduleType.CanBeCached() && _moduleDatabaseService?.ModuleExistsInStorage(module.Name, module.FilePath) == true) { + if (_moduleDatabaseService.TryRestoreGlobalScope(module, out var gs)) { if (_log != null) { - _log.Log(TraceEventType.Verbose, "Restored from database: ", document.Name); + _log.Log(TraceEventType.Verbose, "Restored from database: ", module.Name); } - var analysis = new DocumentAnalysis(document, 1, gs, new ExpressionEval(_services, document, document.GetAst()), Array.Empty()); + analysis = new DocumentAnalysis((IDocument)module, 1, gs, new ExpressionEval(_services, module, module.GetAst()), Array.Empty()); gs.ReconstructVariables(); - return analysis; + } else { + if (_log != null) { + _log.Log(TraceEventType.Verbose, "Restore from database failed for module ", module.Name); + } } - return null; } - var walker = new ModuleWalker(_services, document, ast, _analyzerCancellationToken); - ast.Walk(walker); - walker.Complete(); - + bool isCanceled; lock (_syncObj) { isCanceled = _isCanceled; } + + if (analysis == null) { + var walker = new ModuleWalker(_services, module, ast, _analyzerCancellationToken); + ast.Walk(walker); + walker.Complete(); + analysis = CreateAnalysis(node, (IDocument)module, ast, version, walker, isCanceled); + } + if (!isCanceled) { node?.MarkWalked(); } - return CreateAnalysis(node, document, ast, version, walker, isCanceled); + return analysis; } private IDocumentAnalysis CreateAnalysis(IDependencyChainNode node, IDocument document, PythonAst ast, int version, ModuleWalker walker, bool isCanceled) { From 28a4ce5e133ad215aa0a780646d0a05bd871a2a3 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 5 Sep 2019 16:33:10 -0700 Subject: [PATCH 28/60] Pass AST whish is required during analysis when module does not have its own yet. --- src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs | 2 +- .../Ast/Impl/Dependencies/IDependencyProvider.cs | 3 ++- src/Analysis/Ast/Impl/Modules/DependencyProvider.cs | 9 ++++----- src/Caching/Impl/ModuleDatabase.cs | 3 ++- src/LanguageServer/Impl/Program.cs | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs index 011e68978..0e430fc2c 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs @@ -252,7 +252,7 @@ private HashSet FindDependencies(IPythonModule module, Python } var dependencyProvider = (module as IAnalyzable)?.DependencyProvider; - var moduleDeps = dependencyProvider?.GetDependencies(); + var moduleDeps = dependencyProvider?.GetDependencies(ast); if (moduleDeps != null) { dependencies.UnionWith(moduleDeps); } diff --git a/src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs b/src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs index d0a911f5b..672da9490 100644 --- a/src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs +++ b/src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs @@ -15,6 +15,7 @@ using System.Collections.Generic; using Microsoft.Python.Analysis.Analyzer; +using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Dependencies { /// @@ -23,6 +24,6 @@ namespace Microsoft.Python.Analysis.Dependencies { /// provide dependencies from their models. /// internal interface IDependencyProvider { - HashSet GetDependencies(); + HashSet GetDependencies(PythonAst ast); } } diff --git a/src/Analysis/Ast/Impl/Modules/DependencyProvider.cs b/src/Analysis/Ast/Impl/Modules/DependencyProvider.cs index ab77d7c4e..ef670ff46 100644 --- a/src/Analysis/Ast/Impl/Modules/DependencyProvider.cs +++ b/src/Analysis/Ast/Impl/Modules/DependencyProvider.cs @@ -19,6 +19,7 @@ using Microsoft.Python.Analysis.Dependencies; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core; +using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Modules { internal sealed class DependencyProvider: IDependencyProvider { @@ -33,11 +34,9 @@ public DependencyProvider(IPythonModule module, IServiceContainer services) { } #region IDependencyProvider - public HashSet GetDependencies() { - var ast = _module.GetAst(); - + public HashSet GetDependencies(PythonAst ast) { if (_dbService != null && _dbService.TryRestoreDependencies(_module, out var dp)) { - return dp.GetDependencies(); + return dp.GetDependencies(ast); } // TODO: try and handle LoadFunctionDependencyModules functionality here. @@ -47,7 +46,7 @@ public HashSet GetDependencies() { #endregion private sealed class EmptyDependencyProvider: IDependencyProvider { - public HashSet GetDependencies() => new HashSet(); + public HashSet GetDependencies(PythonAst ast) => new HashSet(); } } } diff --git a/src/Caching/Impl/ModuleDatabase.cs b/src/Caching/Impl/ModuleDatabase.cs index a58ee0118..a1c61b3d8 100644 --- a/src/Caching/Impl/ModuleDatabase.cs +++ b/src/Caching/Impl/ModuleDatabase.cs @@ -28,6 +28,7 @@ using Microsoft.Python.Core; using Microsoft.Python.Core.IO; using Microsoft.Python.Core.Logging; +using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis.Caching { internal sealed class ModuleDatabase : IModuleDatabaseService { @@ -252,7 +253,7 @@ public DependencyProvider(IPythonModule module, ModuleModel model) { _dependencies = dc.Dependencies; } - public HashSet GetDependencies() => _dependencies; + public HashSet GetDependencies(PythonAst ast) => _dependencies; } } } diff --git a/src/LanguageServer/Impl/Program.cs b/src/LanguageServer/Impl/Program.cs index 024f9af18..24adfa924 100644 --- a/src/LanguageServer/Impl/Program.cs +++ b/src/LanguageServer/Impl/Program.cs @@ -13,7 +13,7 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -// #define WAIT_FOR_DEBUGGER +#define WAIT_FOR_DEBUGGER using System; using System.Diagnostics; From e24a4fdeff5317b1fb4ccc16af8a005589de641e Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Thu, 5 Sep 2019 22:26:54 -0700 Subject: [PATCH 29/60] tensorflow test --- src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs | 5 +++-- src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj | 1 - src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs | 4 ++-- src/Caching/Test/LibraryModulesTests.cs | 3 +++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs b/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs index 9b2b1502f..42a9b2650 100644 --- a/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs +++ b/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs @@ -26,8 +26,9 @@ internal sealed class DependencyWalker : PythonWalker { public HashSet Dependencies => _dependencyCollector.Dependencies; - public DependencyWalker(IPythonModule module, PythonAst ast) { + public DependencyWalker(IPythonModule module, PythonAst ast = null) { _dependencyCollector = new DependencyCollector(module); + ast = ast ?? module.GetAst(); ast.Walk(this); } @@ -44,7 +45,7 @@ public override bool Walk(ImportStatement import) { } public override bool Walk(FromImportStatement fromImport) { - var rootNames = fromImport.Root.Names.Select(n => n.Name).ToArray(); + var rootNames = fromImport.Root.Names.Select(n => n.Name); var dotCount = fromImport.Root is RelativeModuleName relativeName ? relativeName.DotCount : 0; _dependencyCollector.AddFromImport(rootNames, dotCount, fromImport.ForceAbsolute); return false; diff --git a/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj b/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj index 7d7bacfec..8f4bbee5a 100644 --- a/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj +++ b/src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj @@ -38,7 +38,6 @@ - diff --git a/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs b/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs index 1c7dcfaed..57c93cc1d 100644 --- a/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs +++ b/src/Analysis/Core/Impl/DependencyResolution/AstUtilities.cs @@ -20,12 +20,12 @@ namespace Microsoft.Python.Analysis.Core.DependencyResolution { public static class AstUtilities { public static IImportSearchResult FindImports(this PathResolverSnapshot pathResolver, string modulePath, FromImportStatement fromImportStatement) { - var rootNames = fromImportStatement.Root.Names.Select(n => n.Name).ToArray(); + var rootNames = fromImportStatement.Root.Names.Select(n => n.Name); var dotCount = fromImportStatement.Root is RelativeModuleName relativeName ? relativeName.DotCount : 0; return pathResolver.FindImports(modulePath, rootNames, dotCount, fromImportStatement.ForceAbsolute); } - public static IImportSearchResult FindImports(this PathResolverSnapshot pathResolver, string modulePath, IReadOnlyList rootNames, int dotCount, bool forceAbsolute) + public static IImportSearchResult FindImports(this PathResolverSnapshot pathResolver, string modulePath, IEnumerable rootNames, int dotCount, bool forceAbsolute) => dotCount > 0 ? pathResolver.GetImportsFromRelativePath(modulePath, dotCount, rootNames) : pathResolver.GetImportsFromAbsoluteName(modulePath, rootNames, forceAbsolute); diff --git a/src/Caching/Test/LibraryModulesTests.cs b/src/Caching/Test/LibraryModulesTests.cs index ec4ad2e7d..92f14ebcb 100644 --- a/src/Caching/Test/LibraryModulesTests.cs +++ b/src/Caching/Test/LibraryModulesTests.cs @@ -233,6 +233,9 @@ public async Task Builtins() { [TestMethod, Priority(0)] public Task Sys() => TestModule("sys"); + [TestMethod, Priority(0)] + public Task Tensorflow() => TestModule("tensorflow"); + [TestMethod, Priority(0)] public Task Time() => TestModule("time"); From c4404cfaf1bb99f0e8a655cee97c9ded004011e5 Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Thu, 5 Sep 2019 23:10:36 -0700 Subject: [PATCH 30/60] Fix from import model Add tensorflow test --- src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs | 4 ++-- src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs | 3 ++- src/Caching/Impl/Models/FromImportModel.cs | 1 + src/Caching/Impl/Models/ModuleModel.cs | 1 + src/Caching/Impl/ModuleDatabase.cs | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs b/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs index 9087cd2ee..6385af645 100644 --- a/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs +++ b/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs @@ -47,11 +47,11 @@ public void AddImport(IReadOnlyList importNames, bool forceAbsolute) { HandleSearchResults(imports); } - public void AddFromImport(IReadOnlyList importNames, int dotCount, bool forceAbsolute) { + public void AddFromImport(IEnumerable importNames, IEnumerable memberNames, int dotCount, bool forceAbsolute) { var imports = _pathResolver.FindImports(_module.FilePath, importNames, dotCount, forceAbsolute); HandleSearchResults(imports); if (imports is IImportChildrenSource childrenSource) { - foreach (var name in importNames) { + foreach (var name in memberNames) { if (childrenSource.TryGetChildImport(name, out var childImport)) { HandleSearchResults(childImport); } diff --git a/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs b/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs index 42a9b2650..ef43304a8 100644 --- a/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs +++ b/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs @@ -46,8 +46,9 @@ public override bool Walk(ImportStatement import) { public override bool Walk(FromImportStatement fromImport) { var rootNames = fromImport.Root.Names.Select(n => n.Name); + var memberNames = fromImport.Names.Select(n => n.Name); var dotCount = fromImport.Root is RelativeModuleName relativeName ? relativeName.DotCount : 0; - _dependencyCollector.AddFromImport(rootNames, dotCount, fromImport.ForceAbsolute); + _dependencyCollector.AddFromImport(rootNames, memberNames, dotCount, fromImport.ForceAbsolute); return false; } } diff --git a/src/Caching/Impl/Models/FromImportModel.cs b/src/Caching/Impl/Models/FromImportModel.cs index bda4d9774..f5a670056 100644 --- a/src/Caching/Impl/Models/FromImportModel.cs +++ b/src/Caching/Impl/Models/FromImportModel.cs @@ -19,6 +19,7 @@ namespace Microsoft.Python.Analysis.Caching.Models { /// internal sealed class FromImportModel { public string[] RootNames { get; set; } + public string[] MemberNames { get; set; } public int DotCount { get; set; } public bool ForceAbsolute { get; set; } } diff --git a/src/Caching/Impl/Models/ModuleModel.cs b/src/Caching/Impl/Models/ModuleModel.cs index c67837cb3..2459b121a 100644 --- a/src/Caching/Impl/Models/ModuleModel.cs +++ b/src/Caching/Impl/Models/ModuleModel.cs @@ -205,6 +205,7 @@ public override bool Walk(FromImportStatement fromImport) { var model = new FromImportModel { ForceAbsolute = fromImport.ForceAbsolute, RootNames = fromImport.Root.Names.Select(n => n.Name).ToArray(), + MemberNames = fromImport.Names.Select(n => n.Name).ToArray(), DotCount = fromImport.Root is RelativeModuleName rn ? rn.DotCount : 0 }; FromImports.Add(model); diff --git a/src/Caching/Impl/ModuleDatabase.cs b/src/Caching/Impl/ModuleDatabase.cs index a1c61b3d8..d04d63122 100644 --- a/src/Caching/Impl/ModuleDatabase.cs +++ b/src/Caching/Impl/ModuleDatabase.cs @@ -248,7 +248,7 @@ public DependencyProvider(IPythonModule module, ModuleModel model) { dc.AddImport(imp.ModuleNames, imp.ForceAbsolute); } foreach (var fi in model.FromImports) { - dc.AddFromImport(fi.RootNames, fi.DotCount, fi.ForceAbsolute); + dc.AddFromImport(fi.RootNames, fi.MemberNames, fi.DotCount, fi.ForceAbsolute); } _dependencies = dc.Dependencies; } From c20485b027d7aded7ff30177b67aebbe9e9cf4b1 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Fri, 6 Sep 2019 12:07:22 -0700 Subject: [PATCH 31/60] Undo debug --- src/LanguageServer/Impl/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LanguageServer/Impl/Program.cs b/src/LanguageServer/Impl/Program.cs index 24adfa924..024f9af18 100644 --- a/src/LanguageServer/Impl/Program.cs +++ b/src/LanguageServer/Impl/Program.cs @@ -13,7 +13,7 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -#define WAIT_FOR_DEBUGGER +// #define WAIT_FOR_DEBUGGER using System; using System.Diagnostics; From 119e1b275400617e56a4c4c3c7f526641f0af3fc Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Mon, 9 Sep 2019 14:43:10 -0700 Subject: [PATCH 32/60] Improve goto def in import and fix class base processing (#1529) * Update signing project to 3.0 * Upgrade to .NET 3.0 (#1521) * Upgrade to 3.0 * Get back to 2.0 * Add global.json for .NET SDK * Ensure FileInfo is not relative in DirectoryInfoProxy (#1519) * Ensure FileInfo is not relative in DirectoryInfoProxy * Add tests * Hadle import * Update dependencies (#1526) * Handle from import * Add test * Fix bad find and replace in AssertionsUtilities (#1527) * Merge issues * Add test (fails) * using * Fix merge of classes * Fix regression in bases Split merging into separate class * Fix null refs * Make common CanUpdateAnalysis check --- .../Ast/Impl/Analyzer/ModuleWalker.cs | 224 +------------ .../Impl/Analyzer/PythonAnalyzerSession.cs | 98 +++--- src/Analysis/Ast/Impl/Analyzer/StubMerger.cs | 303 ++++++++++++++++++ .../Impl/Analyzer/Symbols/ClassEvaluator.cs | 18 +- .../Ast/Impl/Specializations/Specialized.cs | 2 +- .../Ast/Impl/Types/PythonPropertyType.cs | 6 +- .../FluentAssertions/AssertionsUtilities.cs | 8 +- src/Analysis/Ast/Test/LibraryTests.cs | 4 +- src/Caching/Impl/Models/PropertyModel.cs | 2 +- src/Core/Impl/IO/DirectoryInfoProxy.cs | 2 +- src/Core/Test/AssemblySetup.cs | 34 ++ src/Core/Test/DirectoryInfoProxyTests.cs | 51 +++ .../Impl/Sources/DefinitionSource.cs | 131 +++++--- .../Impl/Sources/ReferenceSource.cs | 2 +- src/LanguageServer/Test/CompletionTests.cs | 2 +- .../Test/GoToDefinitionTests.cs | 90 +++++- src/Publish/SignLayout.csproj | 2 +- src/Publish/global.json | 5 + src/UnitTests/Core/Impl/UnitTests.Core.csproj | 2 +- 19 files changed, 654 insertions(+), 332 deletions(-) create mode 100644 src/Analysis/Ast/Impl/Analyzer/StubMerger.cs create mode 100644 src/Core/Test/AssemblySetup.cs create mode 100644 src/Core/Test/DirectoryInfoProxyTests.cs create mode 100644 src/Publish/global.json diff --git a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs index fc6ead2de..35a3ea3c4 100644 --- a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs +++ b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs @@ -13,20 +13,18 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Threading; using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Documents; -using Microsoft.Python.Analysis.Modules; -using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Types.Collections; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; using Microsoft.Python.Core.Diagnostics; using Microsoft.Python.Parsing.Ast; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading; namespace Microsoft.Python.Analysis.Analyzer { [DebuggerDisplay("{Module.Name} : {Module.ModuleType}")] @@ -205,7 +203,7 @@ public void Complete() { SymbolTable.EvaluateAll(); SymbolTable.ReplacedByStubs.Clear(); - MergeStub(); + new StubMerger(Eval).MergeStub(_stubAnalysis, _cancellationToken); if (_allIsUsable && _allReferencesCount >= 1 && GlobalScope.Variables.TryGetVariable(AllVariableName, out var variable) && variable?.Value is IPythonCollection collection && collection.IsExact) { @@ -221,217 +219,5 @@ public void Complete() { public GlobalScope GlobalScope => Eval.GlobalScope; public IReadOnlyList StarImportMemberNames { get; private set; } - - /// - /// Merges data from stub with the data from the module. - /// - /// - /// Functions are taken from the stub by the function walker since - /// information on the return type is needed during the analysis walk. - /// However, if the module is compiled (scraped), it often lacks some - /// of the definitions. Stub may contains those so we need to merge it in. - /// - private void MergeStub() { - _cancellationToken.ThrowIfCancellationRequested(); - - if (Module.ModuleType == ModuleType.User || Module.ModuleType == ModuleType.Stub) { - return; - } - // No stub, no merge. - if (_stubAnalysis.IsEmpty()) { - return; - } - // TODO: figure out why module is getting analyzed before stub. - // https://github.com/microsoft/python-language-server/issues/907 - // Debug.Assert(!(_stubAnalysis is EmptyAnalysis)); - - // Note that scrape can pick up more functions than the stub contains - // Or the stub can have definitions that scraping had missed. Therefore - // merge is the combination of the two with the documentation coming - // from the library source of from the scraped module. - foreach (var v in _stubAnalysis.GlobalScope.Variables) { - var stubType = v.Value.GetPythonType(); - if (stubType.IsUnknown()) { - continue; - } - - var sourceVar = Eval.GlobalScope.Variables[v.Name]; - var sourceType = sourceVar?.Value.GetPythonType(); - - // If stub says 'Any' but we have better type, keep the current type. - if (stubType.DeclaringModule is TypingModule && stubType.Name == "Any") { - continue; - } - - if (sourceVar?.Source == VariableSource.Import && - sourceVar.GetPythonType()?.DeclaringModule.Stub != null) { - // Keep imported types as they are defined in the library. For example, - // 'requests' imports NullHandler as 'from logging import NullHandler'. - // But 'requests' also declares NullHandler in its stub (but not in the main code) - // and that declaration does not have documentation or location. Therefore avoid - // taking types that are stub-only when similar type is imported from another - // module that also has a stub. - continue; - } - - TryReplaceMember(v, sourceType, stubType); - } - - UpdateVariables(); - } - - private void TryReplaceMember(IVariable v, IPythonType sourceType, IPythonType stubType) { - // If type does not exist in module, but exists in stub, declare it unless it is an import. - // If types are the classes, take class from the stub, then add missing members. - // Otherwise, replace type by one from the stub. - switch (sourceType) { - case null: - // Nothing in sources, but there is type in the stub. Declare it. - if (v.Source == VariableSource.Declaration || v.Source == VariableSource.Generic) { - Eval.DeclareVariable(v.Name, v.Value, v.Source); - } - break; - - case PythonClassType sourceClass when Module.Equals(sourceClass.DeclaringModule): - // Transfer documentation first so we get class documentation - // that came from class definition win over one that may - // come from __init__ during the member merge below. - TransferDocumentationAndLocation(sourceClass, stubType); - - // Replace the class entirely since stub members may use generic types - // and the class definition is important. We transfer missing members - // from the original class to the stub. - Eval.DeclareVariable(v.Name, v.Value, v.Source); - - // Go through source class members and pick those that are - // not present in the stub class. - foreach (var name in sourceClass.GetMemberNames()) { - - var sourceMember = sourceClass.GetMember(name); - if (sourceMember.IsUnknown()) { - continue; // Anything is better than unknowns. - } - var sourceMemberType = sourceMember?.GetPythonType(); - - var stubMember = stubType.GetMember(name); - var stubMemberType = stubMember.GetPythonType(); - - // Don't augment types that do not come from this module. - if (sourceType.IsBuiltin || stubType.IsBuiltin) { - // If source type does not have an immediate member such as __init__() and - // rather have it inherited from object, we do not want to use the inherited - // since stub class may either have its own of inherits it from the object. - continue; - } - - if (stubMemberType?.MemberType == PythonMemberType.Method && stubMemberType?.DeclaringModule.ModuleType == ModuleType.Builtins) { - // Leave methods coming from object at the object and don't copy them into the derived class. - } - - // Get documentation from the current type, if any, since stubs - // typically do not contain documentation while scraped code does. - TransferDocumentationAndLocation(sourceMemberType, stubMemberType); - - // If stub says 'Any' but we have better type, use member from the original class. - if (stubMember != null && !(stubType.DeclaringModule is TypingModule && stubType.Name == "Any")) { - continue; // Stub already have the member, don't replace. - } - - (stubType as PythonType)?.AddMember(name, stubMember, overwrite: true); - } - break; - - case IPythonModule _: - // We do not re-declare modules. - break; - - default: - var stubModule = stubType.DeclaringModule; - if (stubType is IPythonModule || stubModule.ModuleType == ModuleType.Builtins) { - // Modules members that are modules should remain as they are, i.e. os.path - // should remain library with its own stub attached. - break; - } - // We do not re-declaring variables that are imported. - if (v.Source == VariableSource.Declaration) { - // Re-declare variable with the data from the stub. - TransferDocumentationAndLocation(sourceType, stubType); - // TODO: choose best type between the scrape and the stub. Stub probably should always win. - var source = Eval.CurrentScope.Variables[v.Name]?.Source ?? v.Source; - Eval.DeclareVariable(v.Name, v.Value, source); - } - - break; - } - } - - private void UpdateVariables() { - // Second pass: if we replaced any classes by new from the stub, we need to update - // variables that may still be holding old content. For example, ctypes - // declares 'c_voidp = c_void_p' so when we replace 'class c_void_p' - // by class from the stub, we need to go and update 'c_voidp' variable. - foreach (var v in GlobalScope.Variables) { - var variableType = v.Value.GetPythonType(); - if (!variableType.DeclaringModule.Equals(Module) && !variableType.DeclaringModule.Equals(Module.Stub)) { - continue; - } - // Check if type that the variable references actually declared here. - var typeInScope = GlobalScope.Variables[variableType.Name].GetPythonType(); - if (typeInScope == null || variableType == typeInScope) { - continue; - } - - if (v.Value == variableType) { - Eval.DeclareVariable(v.Name, typeInScope, v.Source); - } else if (v.Value is IPythonInstance) { - Eval.DeclareVariable(v.Name, new PythonInstance(typeInScope), v.Source); - } - } - } - - private static void TransferDocumentationAndLocation(IPythonType s, IPythonType d) { - if (s.IsUnknown() || s.IsBuiltin || d == null || d.IsBuiltin) { - return; // Do not transfer location of unknowns or builtins - } - - if (d.DeclaringModule != s.DeclaringModule.Stub) { - return; // Do not change unrelated types. - } - - // Documentation and location are always get transferred from module type - // to the stub type and never the other way around. This makes sure that - // we show documentation from the original module and goto definition - // navigates to the module source and not to the stub. - if (s != d && s is PythonType src && d is PythonType dst) { - // If type is a class, then doc can either come from class definition node of from __init__. - // If class has doc from the class definition, don't stomp on it. - if (src is PythonClassType srcClass && dst is PythonClassType dstClass) { - // Higher lever source wins - if (srcClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Class || - (srcClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Init && dstClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Base)) { - dstClass.SetDocumentation(srcClass.Documentation); - } - } else { - // Sometimes destination (stub type) already has documentation. This happens when stub type - // is used to augment more than one type. For example, in threading module RLock stub class - // replaces both RLock function and _RLock class making 'factory' function RLock to look - // like a class constructor. Effectively a single stub type is used for more than one type - // in the source and two source types may have different documentation. Thus transferring doc - // from one source type affects documentation of another type. It may be better to clone stub - // type and separate instances for separate source type, but for now we'll just avoid stomping - // on the existing documentation. - if (string.IsNullOrEmpty(dst.Documentation)) { - var srcDocumentation = src.Documentation; - if (!string.IsNullOrEmpty(srcDocumentation)) { - dst.SetDocumentation(srcDocumentation); - } - } - } - - if (src.Location.IsValid) { - dst.Location = src.Location; - } - } - } } } diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index cba3d32f2..4032b0b03 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -252,23 +252,9 @@ private Task StartAnalysis(IDependencyChainNode node, Async private void Analyze(IDependencyChainNode node, AsyncCountdownEvent ace, Stopwatch stopWatch) { try { var entry = node.Value; - - if (!entry.CanUpdateAnalysis(_walker.Version, out var module, out var ast, out var currentAnalysis)) { - if (IsAnalyzedLibraryInLoop(node, currentAnalysis)) { - return; - } else if (ast == default) { - if (currentAnalysis == default) { - // Entry doesn't have ast yet. There should be at least one more session. - Cancel(); - } else { - Debug.Fail($"Library module {module.Name} of type {module.ModuleType} has been analyzed already!"); - } - } - - _log?.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) canceled."); + if (!CanUpdateAnalysis(entry, node, _walker.Version, out var module, out var ast, out var currentAnalysis)) { return; } - var startTime = stopWatch.Elapsed; AnalyzeEntry(node, entry, module, ast, _walker.Version); @@ -284,12 +270,14 @@ private void Analyze(IDependencyChainNode node, AsyncCountd node.MoveNext(); bool isCanceled; + int remaining; lock (_syncObj) { isCanceled = _isCanceled; + remaining = _walker.Remaining; } if (!isCanceled) { - _progress.ReportRemaining(_walker.Remaining); + _progress.ReportRemaining(remaining); } Interlocked.Decrement(ref _runningTasks); @@ -300,22 +288,9 @@ private void Analyze(IDependencyChainNode node, AsyncCountd private void AnalyzeEntry() { var stopWatch = _log != null ? Stopwatch.StartNew() : null; try { - if (!_entry.CanUpdateAnalysis(Version, out var module, out var ast, out var currentAnalysis)) { - if (currentAnalysis is LibraryAnalysis) { - return; - } else if (ast == default) { - if (currentAnalysis == default) { - // Entry doesn't have ast yet. There should be at least one more session. - Cancel(); - } else { - Debug.Fail($"Library module {module.Name} of type {module.ModuleType} has been analyzed already!"); - } - } - - _log?.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) canceled."); + if (!CanUpdateAnalysis(_entry, null, Version, out var module, out var ast, out var currentAnalysis)) { return; } - var startTime = stopWatch?.Elapsed ?? TimeSpan.Zero; AnalyzeEntry(null, _entry, module, ast, Version); @@ -331,6 +306,32 @@ private void AnalyzeEntry() { } } + private bool CanUpdateAnalysis( + PythonAnalyzerEntry entry, + IDependencyChainNode node, + int version, + out IPythonModule module, + out PythonAst ast, + out IDocumentAnalysis currentAnalysis) { + + if (!entry.CanUpdateAnalysis(version, out module, out ast, out currentAnalysis)) { + if (IsAnalyzedLibraryInLoop(node, currentAnalysis)) { + return false; + } else if (ast == default) { + if (currentAnalysis == default) { + // Entry doesn't have ast yet. There should be at least one more session. + Cancel(); + } else { + Debug.Fail($"Library module {module.Name} of type {module.ModuleType} has been analyzed already!"); + } + } + + _log?.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) canceled."); + return false; + } + return true; + } + private void AnalyzeEntry(IDependencyChainNode node, PythonAnalyzerEntry entry, IPythonModule module, PythonAst ast, int version) { // Now run the analysis. var analyzable = module as IAnalyzable; @@ -368,26 +369,17 @@ private IDocumentAnalysis DoAnalyzeEntry(IDependencyChainNode node, IDocument document, PythonAst ast, int version, ModuleWalker walker, bool isCanceled) { + private IDocumentAnalysis CreateAnalysis(IDependencyChainNode node, IDocument document, PythonAst ast, int version, ModuleWalker walker) { var canHaveLibraryAnalysis = false; // Don't try to drop builtins; it causes issues elsewhere. @@ -400,16 +392,22 @@ private IDocumentAnalysis CreateAnalysis(IDependencyChainNode x is ImportStatement || x is FromImportStatement); diff --git a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs new file mode 100644 index 000000000..98d1b3a43 --- /dev/null +++ b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs @@ -0,0 +1,303 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using Microsoft.Python.Analysis.Analyzer.Evaluation; +using Microsoft.Python.Analysis.Modules; +using Microsoft.Python.Analysis.Specializations.Typing; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; +using System.Linq; +using System.Threading; + +namespace Microsoft.Python.Analysis.Analyzer { + internal sealed class StubMerger { + private readonly ExpressionEval _eval; + + public StubMerger(ExpressionEval eval) { + _eval = eval; + } + + /// + /// Merges data from stub with the data from the module. + /// + /// + /// Types are taken from the stub while location and documentation comes from + /// source so code navigation takes user to the source and not to the stub. + /// Stub data, such as class methods are augmented by methods from source + /// since stub is not guaranteed to be complete. + /// + public void MergeStub(IDocumentAnalysis stubAnalysis, CancellationToken cancellationToken) { + cancellationToken.ThrowIfCancellationRequested(); + if (_eval.Module.ModuleType == ModuleType.User || _eval.Module.ModuleType == ModuleType.Stub) { + return; + } + // No stub, no merge. + if (stubAnalysis.IsEmpty()) { + return; + } + // TODO: figure out why module is getting analyzed before stub. + // https://github.com/microsoft/python-language-server/issues/907 + // Debug.Assert(!(_stubAnalysis is EmptyAnalysis)); + + // Stub is the primary information source. Take types from the stub + // and replace source types by stub types. Transfer location and documentation + // from source members to the stub types. + TransferTypesFromStub(stubAnalysis, cancellationToken); + + UpdateVariables(); + } + + /// + /// Transfers types from stub to source while preserving documentation and location. + /// + /// + /// Stub is the primary information source. Take types from the stub + /// and replace source types by stub types. Transfer location and documentation + /// from source members to the stub types. + /// + private void TransferTypesFromStub(IDocumentAnalysis stubAnalysis, CancellationToken cancellationToken) { + foreach (var v in stubAnalysis.GlobalScope.Variables) { + cancellationToken.ThrowIfCancellationRequested(); + + var stubType = v.Value.GetPythonType(); + if (stubType.IsUnknown()) { + continue; + } + // If stub says 'Any' but we have better type, keep the current type. + if (stubType.DeclaringModule is TypingModule && stubType.Name == "Any") { + continue; + } + + var sourceVar = _eval.GlobalScope.Variables[v.Name]; + var sourceType = sourceVar?.Value.GetPythonType(); + if (sourceType.IsUnknown()) { + continue; + } + + if (sourceVar?.Source == VariableSource.Import && + sourceVar.GetPythonType()?.DeclaringModule.Stub != null) { + // Keep imported types as they are defined in the library. For example, + // 'requests' imports NullHandler as 'from logging import NullHandler'. + // But 'requests' also declares NullHandler in its stub (but not in the main code) + // and that declaration does not have documentation or location. Therefore avoid + // taking types that are stub-only when similar type is imported from another + // module that also has a stub. + continue; + } + + TryReplaceMember(v, sourceType, stubType, cancellationToken); + } + } + + private void TryReplaceMember(IVariable v, IPythonType sourceType, IPythonType stubType, CancellationToken cancellationToken) { + // If type does not exist in module, but exists in stub, declare it unless it is an import. + // If types are the classes, take class from the stub, then add missing members. + // Otherwise, replace type by one from the stub. + switch (sourceType) { + case null: + // Nothing in source, but there is type in the stub. Declare it. + if (v.Source == VariableSource.Declaration || v.Source == VariableSource.Generic) { + _eval.DeclareVariable(v.Name, v.Value, v.Source); + } + break; + + case PythonClassType sourceClass: + MergeClass(v, sourceClass, stubType, cancellationToken); + break; + + case IPythonModule _: + // We do not re-declare modules. + break; + + default: + var stubModule = stubType.DeclaringModule; + if (stubType is IPythonModule || stubModule.ModuleType == ModuleType.Builtins) { + // Modules members that are modules should remain as they are, i.e. os.path + // should remain library with its own stub attached. + break; + } + // We do not re-declaring variables that are imported. + if (v.Source == VariableSource.Declaration) { + TransferDocumentationAndLocation(sourceType, stubType); + // Re-declare variable with the data from the stub. + var source = _eval.CurrentScope.Variables[v.Name]?.Source ?? v.Source; + _eval.DeclareVariable(v.Name, v.Value, source); + } + + break; + } + } + + private void MergeClass(IVariable v, IPythonClassType sourceClass, IPythonType stubType, CancellationToken cancellationToken) { + // Transfer documentation first so we get class documentation + // that comes from the class definition win over one that may + // come from __init__ during the member merge below. + TransferDocumentationAndLocation(sourceClass, stubType); + + // Replace the class entirely since stub members may use generic types + // and the class definition is important. We transfer missing members + // from the original class to the stub. + _eval.DeclareVariable(v.Name, v.Value, v.Source); + + // First pass: go through source class members and pick those + // that are not present in the stub class. + foreach (var name in sourceClass.GetMemberNames()) { + cancellationToken.ThrowIfCancellationRequested(); + + var sourceMember = sourceClass.GetMember(name); + if (sourceMember.IsUnknown()) { + continue; // Do not add unknowns to the stub. + } + var sourceMemberType = sourceMember?.GetPythonType(); + if (sourceMemberType is IPythonClassMember cm && cm.DeclaringType != sourceClass) { + continue; // Only take members from this class and not from bases. + } + if (!IsAcceptableModule(sourceMemberType)) { + continue; // Member does not come from module or its submodules. + } + + var stubMember = stubType.GetMember(name); + var stubMemberType = stubMember.GetPythonType(); + + // Get documentation from the current type, if any, since stubs + // typically do not contain documentation while scraped code does. + TransferDocumentationAndLocation(sourceMemberType, stubMemberType); + + // If stub says 'Any' but we have better type, use member from the original class. + if (stubMember != null && !(stubType.DeclaringModule is TypingModule && stubType.Name == "Any")) { + continue; // Stub already have the member, don't replace. + } + + (stubType as PythonType)?.AddMember(name, stubMember, overwrite: true); + } + + // Second pass: go through stub class members and if they don't have documentation + // or location, check if source class has same member and fetch it from there. + // The reason is that in the stub sometimes members are specified all in one + // class while in source they may come from bases. Example: datetime. + foreach (var name in stubType.GetMemberNames()) { + cancellationToken.ThrowIfCancellationRequested(); + + var stubMember = stubType.GetMember(name); + if (stubMember.IsUnknown()) { + continue; + } + var stubMemberType = stubMember.GetPythonType(); + if (stubMemberType is IPythonClassMember cm && cm.DeclaringType != stubType) { + continue; // Only take members from this class and not from bases. + } + + var sourceMember = sourceClass.GetMember(name); + if (sourceMember.IsUnknown()) { + continue; + } + + var sourceMemberType = sourceMember.GetPythonType(); + if (sourceMemberType.Location.IsValid && !stubMemberType.Location.IsValid) { + TransferDocumentationAndLocation(sourceMemberType, stubMemberType); + } + } + } + + private void UpdateVariables() { + // Second pass: if we replaced any classes by new from the stub, we need to update + // variables that may still be holding old content. For example, ctypes + // declares 'c_voidp = c_void_p' so when we replace 'class c_void_p' + // by class from the stub, we need to go and update 'c_voidp' variable. + foreach (var v in _eval.GlobalScope.Variables) { + var variableType = v.Value.GetPythonType(); + if (!IsAcceptableModule(variableType)) { + continue; + } + // Check if type that the variable references actually declared here. + var typeInScope = _eval.GlobalScope.Variables[variableType.Name].GetPythonType(); + if (typeInScope == null || variableType == typeInScope) { + continue; + } + + if (v.Value == variableType) { + _eval.DeclareVariable(v.Name, typeInScope, v.Source); + } else if (v.Value is IPythonInstance) { + _eval.DeclareVariable(v.Name, new PythonInstance(typeInScope), v.Source); + } + } + } + + private void TransferDocumentationAndLocation(IPythonType s, IPythonType d) { + if (s.IsUnknown() || s.DeclaringModule.ModuleType == ModuleType.Builtins || + d.IsUnknown() || d.DeclaringModule.ModuleType == ModuleType.Builtins) { + return; // Do not transfer location of unknowns or builtins + } + + // Stub may be one for multiple modules - when module consists of several + // submodules, there is typically only one stub for the main module. + // Types from 'unittest.case' (library) are stubbed in 'unittest' stub. + if (!IsAcceptableModule(s)) { + return; // Do not change unrelated types. + } + + // Documentation and location are always get transferred from module type + // to the stub type and never the other way around. This makes sure that + // we show documentation from the original module and goto definition + // navigates to the module source and not to the stub. + if (s != d && s is PythonType src && d is PythonType dst) { + // If type is a class, then doc can either come from class definition node of from __init__. + // If class has doc from the class definition, don't stomp on it. + if (src is PythonClassType srcClass && dst is PythonClassType dstClass) { + // Higher lever source wins + if (srcClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Class || + (srcClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Init && dstClass.DocumentationSource == PythonClassType.ClassDocumentationSource.Base)) { + dstClass.SetDocumentation(srcClass.Documentation); + } + } else { + // Sometimes destination (stub type) already has documentation. This happens when stub type + // is used to augment more than one type. For example, in threading module RLock stub class + // replaces both RLock function and _RLock class making 'factory' function RLock to look + // like a class constructor. Effectively a single stub type is used for more than one type + // in the source and two source types may have different documentation. Thus transferring doc + // from one source type affects documentation of another type. It may be better to clone stub + // type and separate instances for separate source type, but for now we'll just avoid stomping + // on the existing documentation. + if (string.IsNullOrEmpty(dst.Documentation)) { + var srcDocumentation = src.Documentation; + if (!string.IsNullOrEmpty(srcDocumentation)) { + dst.SetDocumentation(srcDocumentation); + } + } + } + + if (src.Location.IsValid) { + dst.Location = src.Location; + } + } + } + + /// + /// Determines if type comes from module that is part of this package. + /// + /// + /// Single stub file typically applies to all modules while types within + /// the package come from multiple modules. We need to determine if stub + /// does match the type module so we don't accidentally modify documentation + /// or location of unrelated types such as coming from the base object type. + /// + private bool IsAcceptableModule(IPythonType type) { + var thisModule = _eval.Module; + var typeModule = type.DeclaringModule; + var typeMainModuleName = typeModule.Name.Split('.').FirstOrDefault(); + return typeModule.Equals(thisModule) || typeMainModuleName == thisModule.Name; + } + } +} diff --git a/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs b/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs index c28d465b1..c563428c5 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Symbols/ClassEvaluator.cs @@ -109,16 +109,18 @@ private void ProcessClassBody() { } private IEnumerable ProcessBases() { - var bases = new List(); - foreach (var a in _classDef.Bases.Where(a => string.IsNullOrEmpty(a.Name))) { - if (IsValidBase(a)) { - TryAddBase(bases, a); - } else { - ReportInvalidBase(a); + // Base types must be evaluated in outer scope + using (Eval.OpenScope(Eval.CurrentScope.OuterScope)) { + var bases = new List(); + foreach (var a in _classDef.Bases.Where(a => string.IsNullOrEmpty(a.Name))) { + if (IsValidBase(a)) { + TryAddBase(bases, a); + } else { + ReportInvalidBase(a); + } } + return bases; } - - return bases; } private bool IsValidBase(Arg a) { diff --git a/src/Analysis/Ast/Impl/Specializations/Specialized.cs b/src/Analysis/Ast/Impl/Specializations/Specialized.cs index 6ec0e9e57..cc58646b3 100644 --- a/src/Analysis/Ast/Impl/Specializations/Specialized.cs +++ b/src/Analysis/Ast/Impl/Specializations/Specialized.cs @@ -19,7 +19,7 @@ namespace Microsoft.Python.Analysis.Specializations { internal static class Specialized { public static IPythonPropertyType Property(string name, IPythonModule declaringModule, IPythonType declaringType, IMember returnValue) { var location = new Location(declaringModule); - var prop = new PythonPropertyType(name, location, declaringType, false); + var prop = new PythonPropertyType(name, location, string.Empty, declaringType, false); var o = new PythonFunctionOverload(prop, location); o.AddReturnValue(returnValue); prop.AddOverload(o); diff --git a/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs b/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs index fdf4b7a66..12297dace 100644 --- a/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs +++ b/src/Analysis/Ast/Impl/Types/PythonPropertyType.cs @@ -22,12 +22,12 @@ internal sealed class PythonPropertyType : PythonType, IPythonPropertyType { private IPythonFunctionOverload _getter; public PythonPropertyType(FunctionDefinition fd, Location location, IPythonType declaringType, bool isAbstract) - : this(fd.Name, location, declaringType, isAbstract) { + : this(fd.Name, location, fd.GetDocumentation(), declaringType, isAbstract) { declaringType.DeclaringModule.AddAstNode(this, fd); } - public PythonPropertyType(string name, Location location, IPythonType declaringType, bool isAbstract) - : base(name, location, string.Empty, BuiltinTypeId.Property) { + public PythonPropertyType(string name, Location location, string documentation, IPythonType declaringType, bool isAbstract) + : base(name, location, documentation, BuiltinTypeId.Property) { DeclaringType = declaringType; IsAbstract = isAbstract; } diff --git a/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs b/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs index 70ad06871..7318a7c11 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs @@ -188,13 +188,13 @@ public static string DoubleEscape(string input) => input.Replace("\r", "\\\u200Br").Replace("\n", "\\\u200Bn").Replace("\t", @"\t"); [CustomAssertion] - public static Continuation AssertIsNotNull(this AssertionScope assertionScope, T instance, string subjectName, string itemName, string accessorName) + public static Continuation AssertIsNotNull(this IAssertionScope assertionScope, T instance, string subjectName, string itemName, string accessorName) where T : class => assertionScope.ForCondition(!(instance is null)) .FailWith($"Expected {subjectName} to have {itemName}{{reason}}, but {accessorName} is null."); [CustomAssertion] - public static Continuation AssertAtIndex(this AssertionScope assertionScope, IReadOnlyList collection, int index, string subjectName, string itemName) + public static Continuation AssertAtIndex(this IAssertionScope assertionScope, IReadOnlyList collection, int index, string subjectName, string itemName) where T : class => assertionScope.ForCondition(collection.Count > index) .FailWith($"Expected {subjectName} to have {itemName} of type {typeof(T).Name} at index {index}{{reason}}, but collection has only {collection.Count} items.", subjectName, itemName) .Then @@ -202,7 +202,7 @@ public static Continuation AssertAtIndex(this AssertionScope assertion .FailWith($"Expected {subjectName} to have {itemName} of type `{typeof(T).Name}` at index {index}{{reason}}, but its type is `{collection[index].GetType().Name}`."); [CustomAssertion] - public static Continuation AssertHasMember(this AssertionScope assertionScope, IMember m, string memberName, string analysisValueName, string memberPrintName, out IMember member) { + public static Continuation AssertHasMember(this IAssertionScope assertionScope, IMember m, string memberName, string analysisValueName, string memberPrintName, out IMember member) { var t = m.GetPythonType(); t.Should().BeAssignableTo(); try { @@ -217,7 +217,7 @@ public static Continuation AssertHasMember(this AssertionScope assertionScope, I } [CustomAssertion] - public static Continuation AssertHasMemberOfType(this AssertionScope assertionScope, IPythonType type, string memberName, string analysisValueName, string memberPrintName, out TMember typedMember) + public static Continuation AssertHasMemberOfType(this IAssertionScope assertionScope, IPythonType type, string memberName, string analysisValueName, string memberPrintName, out TMember typedMember) where TMember : class, IPythonType { var continuation = assertionScope.AssertHasMember(type, memberName, analysisValueName, memberPrintName, out var member) .Then diff --git a/src/Analysis/Ast/Test/LibraryTests.cs b/src/Analysis/Ast/Test/LibraryTests.cs index ddc791936..c68b33eef 100644 --- a/src/Analysis/Ast/Test/LibraryTests.cs +++ b/src/Analysis/Ast/Test/LibraryTests.cs @@ -54,8 +54,10 @@ public async Task Datetime() { module.Name.Should().Be("datetime"); var dt = module.Should().HaveMember("datetime").Which; + var day = dt.Should().HaveReadOnlyProperty("day").Which; + day.Documentation.Should().NotBeNullOrEmpty(); - dt.Should().HaveReadOnlyProperty("day").And.HaveMethod("now") + dt.Should().HaveMethod("now") .Which.Should().BeClassMethod().And.HaveSingleOverload() .Which.Should().HaveReturnType() .Which.Should().HaveMembers( diff --git a/src/Caching/Impl/Models/PropertyModel.cs b/src/Caching/Impl/Models/PropertyModel.cs index 296e50ef7..bea252b81 100644 --- a/src/Caching/Impl/Models/PropertyModel.cs +++ b/src/Caching/Impl/Models/PropertyModel.cs @@ -33,7 +33,7 @@ public PropertyModel(IPythonPropertyType prop) : base(prop) { } public override IMember Create(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) - => _property ?? (_property = new PythonPropertyType(Name, new Location(mf.Module, IndexSpan.ToSpan()), declaringType, (Attributes & FunctionAttributes.Abstract) != 0)); + => _property ?? (_property = new PythonPropertyType(Name, new Location(mf.Module, IndexSpan.ToSpan()), Documentation, declaringType, (Attributes & FunctionAttributes.Abstract) != 0)); public override void Populate(ModuleFactory mf, IPythonType declaringType, IGlobalScope gs) { _property.SetDocumentation(Documentation); diff --git a/src/Core/Impl/IO/DirectoryInfoProxy.cs b/src/Core/Impl/IO/DirectoryInfoProxy.cs index 0104e3675..1a6016dfb 100644 --- a/src/Core/Impl/IO/DirectoryInfoProxy.cs +++ b/src/Core/Impl/IO/DirectoryInfoProxy.cs @@ -55,7 +55,7 @@ public IEnumerable EnumerateFileSystemInfos(string[] includePat var matcher = GetMatcher(includePatterns, excludePatterns); var matchResult = SafeExecuteMatcher(matcher); return matchResult.Files.Select((filePatternMatch) => { - var path = PathUtils.NormalizePath(filePatternMatch.Path); + var path = PathUtils.NormalizePath(Path.Combine(_directoryInfo.FullName, filePatternMatch.Path)); return CreateFileSystemInfoProxy(new FileInfo(path)); }); } diff --git a/src/Core/Test/AssemblySetup.cs b/src/Core/Test/AssemblySetup.cs new file mode 100644 index 000000000..04083e46a --- /dev/null +++ b/src/Core/Test/AssemblySetup.cs @@ -0,0 +1,34 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using Microsoft.Python.Core.Testing; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Core.Tests { + [TestClass] + public sealed class AssemblySetup { + [AssemblyInitialize] + public static void Initialize(TestContext testContext) => AnalysisTestEnvironment.Initialize(); + + private class AnalysisTestEnvironment : TestEnvironmentImpl, ITestEnvironment { + public static void Initialize() { + var instance = new AnalysisTestEnvironment(); + Instance = instance; + TestEnvironment.Current = instance; + } + } + } +} diff --git a/src/Core/Test/DirectoryInfoProxyTests.cs b/src/Core/Test/DirectoryInfoProxyTests.cs new file mode 100644 index 000000000..a4a7efa8c --- /dev/null +++ b/src/Core/Test/DirectoryInfoProxyTests.cs @@ -0,0 +1,51 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Core.IO; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Core.Tests { + [TestClass] + public class DirectoryInfoProxyTests { + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + [TestMethod, Priority(0)] + public async Task EnumerateFileSystemInfos() { + var root = TestData.GetTestSpecificPath(); + await TestData.CreateTestSpecificFileAsync("a_y.py", "not important"); + await TestData.CreateTestSpecificFileAsync("b_y.py", "not important"); + await TestData.CreateTestSpecificFileAsync("c_z.py", "not important"); + + var proxy = new DirectoryInfoProxy(root); + var files = proxy.EnumerateFileSystemInfos(new[] { "*.py" }, new[] { "*z.py" }).OrderBy(x => x.FullName).ToArray(); + files.Should().HaveCount(2); + + files[0].FullName.Should().Be(Path.Combine(root, "a_y.py")); + files[1].FullName.Should().Be(Path.Combine(root, "b_y.py")); + } + } +} diff --git a/src/LanguageServer/Impl/Sources/DefinitionSource.cs b/src/LanguageServer/Impl/Sources/DefinitionSource.cs index 4a100f492..56f1e8a1a 100644 --- a/src/LanguageServer/Impl/Sources/DefinitionSource.cs +++ b/src/LanguageServer/Impl/Sources/DefinitionSource.cs @@ -24,9 +24,9 @@ using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; using Microsoft.Python.Core; +using Microsoft.Python.Core.Collections; using Microsoft.Python.Core.Text; using Microsoft.Python.LanguageServer.Completion; -using Microsoft.Python.LanguageServer.Documents; using Microsoft.Python.LanguageServer.Protocol; using Microsoft.Python.Parsing.Ast; @@ -113,49 +113,68 @@ public Reference FindDefinition(IDocumentAnalysis analysis, SourceLocation locat private Reference HandleFromImport(IDocumentAnalysis analysis, SourceLocation location, FromImportStatement statement, Node expr, out ILocatedMember definingMember) { definingMember = null; - // Are in the dotted name? + var mres = analysis.Document.Interpreter.ModuleResolution; + var imports = mres.CurrentPathResolver.FindImports(analysis.Document.FilePath, statement); + IPythonModule module = null; + switch (imports) { + case ModuleImport moduleImport: + module = mres.GetImportedModule(moduleImport.FullName); + break; + case ImplicitPackageImport packageImport: + module = mres.GetImportedModule(packageImport.FullName); + break; + } + + // Are we in the module name (i.e. A in 'from A import B')? var locationIndex = location.ToIndex(analysis.Ast); if (statement.Root.StartIndex <= locationIndex && locationIndex <= statement.Root.EndIndex) { - var mres = analysis.Document.Interpreter.ModuleResolution; - var imports = mres.CurrentPathResolver.FindImports(analysis.Document.FilePath, statement); - IPythonModule module = null; - switch (imports) { - case ModuleImport moduleImport: - module = mres.GetImportedModule(moduleImport.FullName); - break; - case ImplicitPackageImport packageImport: - module = mres.GetImportedModule(packageImport.FullName); - break; - } - definingMember = module; return module != null ? new Reference { range = default, uri = CanNavigateToModule(module) ? module.Uri : null } : null; } - // We are in what/as part - var nex = expr as NameExpression; - var name = nex?.Name; + if (module == null) { + return null; + } + + // Are we in the member name part (ie. B in 'from A import B')? + // Handle 'from A import B' similar to 'import A.B' + var partReference = FindModulePartReference(statement.Names, expr, module, out definingMember); + if (partReference != null) { + return partReference; + } + + // Are we in 'as' names? + var name = (expr as NameExpression)?.Name; if (string.IsNullOrEmpty(name)) { return null; } - // From X import A - var value = analysis.ExpressionEvaluator.GetValueFromExpression(nex); - if (value.IsUnknown()) { - // From X import A as B - var index = statement.Names.IndexOf(x => x?.Name == name); - if (index >= 0 && index < statement.AsNames.Count) { - value = analysis.ExpressionEvaluator.GetValueFromExpression(statement.AsNames[index]); + var asName = statement.AsNames.FirstOrDefault(x => x?.Name == name); + if (asName != null) { + var value = analysis.ExpressionEvaluator.GetValueFromExpression(asName); + if (!value.IsUnknown()) { + definingMember = value as ILocatedMember; + return FromMember(definingMember); } } - if (!value.IsUnknown()) { - definingMember = value as ILocatedMember; - return FromMember(definingMember); - } + return null; + } + private static Reference FindModulePartReference(ImmutableArray names, Node expr, IPythonModule module, out ILocatedMember definingMember) { + definingMember = null; + var part = names.FirstOrDefault(x => x.IndexSpan.Start <= expr.StartIndex && x.IndexSpan.Start <= expr.EndIndex); + if (part != null) { + var definition = module.Analysis.GlobalScope.Variables[part.Name]?.Definition; + if (definition != null) { + return new Reference { + range = definition.Span, + uri = CanNavigateToModule(module) ? module.Uri : null + }; + } + } return null; } @@ -167,20 +186,15 @@ private Reference HandleImport(IDocumentAnalysis analysis, ImportStatement state return null; } - var index = statement.Names.IndexOf(x => x?.MakeString() == name); - if (index < 0) { - return null; - } - - var module = analysis.Document.Interpreter.ModuleResolution.GetImportedModule(name); - if (module != null) { - definingMember = module; - return new Reference { range = default, uri = CanNavigateToModule(module) ? module.Uri : null }; + var reference = FindModuleNamePartReference(analysis, statement.Names, expr, out definingMember); + if(reference != null) { + return reference; } // Import A as B - if (index >= 0 && index < statement.AsNames.Count) { - var value = analysis.ExpressionEvaluator.GetValueFromExpression(statement.AsNames[index]); + var asName = statement.AsNames.FirstOrDefault(n => n.IndexSpan.Start <= expr.StartIndex && n.IndexSpan.Start <= expr.EndIndex); + if (asName != null) { + var value = analysis.ExpressionEvaluator.GetValueFromExpression(asName); if (!value.IsUnknown()) { definingMember = value as ILocatedMember; return FromMember(definingMember); @@ -189,6 +203,45 @@ private Reference HandleImport(IDocumentAnalysis analysis, ImportStatement state return null; } + /// + /// Given dotted name located reference to the part of the name. For example, given + /// 'os.path' and the name expression 'path' locates definition of 'path' part of 'os' module. + /// + private static Reference FindModuleNamePartReference(IDocumentAnalysis analysis, ImmutableArray dottedName, Node expr, out ILocatedMember definingMember) { + definingMember = null; + var moduleName = dottedName.FirstOrDefault(x => x.IndexSpan.Start <= expr.StartIndex && x.IndexSpan.Start <= expr.EndIndex); + if (moduleName == null) { + return null; + } + + var module = analysis.Document.Interpreter.ModuleResolution.GetImportedModule(moduleName.Names.First().Name); + foreach (var member in moduleName.Names.Skip(1)) { + if (module == null) { + return null; + } + + if (member.StartIndex >= expr.EndIndex) { + break; + } + + if (member.StartIndex <= expr.EndIndex && member.EndIndex <= expr.EndIndex) { + var definition = module.Analysis.GlobalScope.Variables[member.Name]?.Definition; + if (definition != null) { + return new Reference { + range = definition.Span, + uri = CanNavigateToModule(module) ? module.Uri : null + }; + } + } + module = module.GetMember(member.Name) as IPythonModule; + } + + if (module != null) { + definingMember = module; + return new Reference { range = default, uri = CanNavigateToModule(module) ? module.Uri : null }; + } + return null; + } private Reference TryFromVariable(string name, IDocumentAnalysis analysis, SourceLocation location, Node statement, out ILocatedMember definingMember) { definingMember = null; diff --git a/src/LanguageServer/Impl/Sources/ReferenceSource.cs b/src/LanguageServer/Impl/Sources/ReferenceSource.cs index 3f162a173..ca846f513 100644 --- a/src/LanguageServer/Impl/Sources/ReferenceSource.cs +++ b/src/LanguageServer/Impl/Sources/ReferenceSource.cs @@ -58,7 +58,7 @@ public async Task FindAllReferencesAsync(Uri uri, SourceLocation lo // If it is an implicitly declared variable, such as function or a class // then the location is invalid and the module is null. Use current module. - var declaringModule = rootDefinition.DeclaringModule ?? analysis.Document; + var declaringModule = rootDefinition?.DeclaringModule ?? analysis.Document; if (!string.IsNullOrEmpty(name) && (declaringModule.ModuleType == ModuleType.User || options == ReferenceSearchOptions.All)) { return await FindAllReferencesAsync(name, declaringModule, rootDefinition, location, definitionSource, cancellationToken); } diff --git a/src/LanguageServer/Test/CompletionTests.cs b/src/LanguageServer/Test/CompletionTests.cs index bb2cdd82a..625eba996 100644 --- a/src/LanguageServer/Test/CompletionTests.cs +++ b/src/LanguageServer/Test/CompletionTests.cs @@ -412,7 +412,7 @@ public async Task MarkupKindValid() { var cs = new CompletionSource(new PlainTextDocumentationSource(), ServerSettings.completion); var result = cs.GetCompletions(analysis, new SourceLocation(2, 5)); - result.Completions?.Select(i => i.documentation.kind) + result.Completions?.Select(i => i.documentation?.kind).ExcludeDefault() .Should().NotBeEmpty().And.BeSubsetOf(new[] { MarkupKind.PlainText, MarkupKind.Markdown }); } diff --git a/src/LanguageServer/Test/GoToDefinitionTests.cs b/src/LanguageServer/Test/GoToDefinitionTests.cs index b7729c25e..082ea06c2 100644 --- a/src/LanguageServer/Test/GoToDefinitionTests.cs +++ b/src/LanguageServer/Test/GoToDefinitionTests.cs @@ -13,7 +13,6 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. -using System; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -484,5 +483,94 @@ def f(a, b): reference.Should().NotBeNull(); reference.range.Should().Be(3, 0, 3, 5); } + + [TestMethod, Priority(0)] + public async Task ModulePartsNavigation() { + const string code = @" +import os.path +from os import path as os_path +print(os.path.basename('a/b/c')) +print(os_path.basename('a/b/c')) +"; + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + var ds = new DefinitionSource(Services); + + var reference = ds.FindDefinition(analysis, new SourceLocation(2, 9), out _); + reference.Should().NotBeNull(); + reference.range.Should().Be(0, 0, 0, 0); + reference.uri.AbsolutePath.Should().Contain("os.py"); + + reference = ds.FindDefinition(analysis, new SourceLocation(2, 13), out _); + reference.Should().NotBeNull(); + var line = File.ReadAllLines(reference.uri.AbsolutePath)[reference.range.start.line]; + line.Should().EndWith("as path"); + line.Substring(reference.range.start.character).Should().Be("path"); + + reference = ds.FindDefinition(analysis, new SourceLocation(3, 7), out _); + reference.Should().NotBeNull(); + reference.range.Should().Be(0, 0, 0, 0); + reference.uri.AbsolutePath.Should().Contain("os.py"); + + reference = ds.FindDefinition(analysis, new SourceLocation(3, 17), out _); + reference.Should().NotBeNull(); + line = File.ReadAllLines(reference.uri.AbsolutePath)[reference.range.start.line]; + line.Should().EndWith("as path"); + line.Substring(reference.range.start.character).Should().Be("path"); + + reference = ds.FindDefinition(analysis, new SourceLocation(3, 27), out _); + reference.Should().NotBeNull(); + line = File.ReadAllLines(reference.uri.AbsolutePath)[reference.range.start.line]; + line.Should().EndWith("as path"); + line.Substring(reference.range.start.character).Should().Be("path"); + + reference = ds.FindDefinition(analysis, new SourceLocation(4, 12), out _); + reference.Should().NotBeNull(); + line = File.ReadAllLines(reference.uri.AbsolutePath)[reference.range.start.line]; + line.Should().EndWith("as path"); + line.Substring(reference.range.start.character).Should().Be("path"); + + reference = ds.FindDefinition(analysis, new SourceLocation(5, 12), out _); + reference.Should().NotBeNull(); + line = File.ReadAllLines(reference.uri.AbsolutePath)[reference.range.start.line]; + line.Should().EndWith("as path"); + line.Substring(reference.range.start.character).Should().Be("path"); + } + + [TestMethod, Priority(0)] + public async Task Unittest() { + const string code = @" +from unittest import TestCase + +class MyTestCase(TestCase): + def test_example(self): + with self.assertRaises(ZeroDivisionError): + value = 1 / 0 + self.assertNotEqual(value, 1) +"; + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + var ds = new DefinitionSource(Services); + + var reference = ds.FindDefinition(analysis, new SourceLocation(6, 24), out _); + reference.Should().NotBeNull(); + reference.range.start.line.Should().BeGreaterThan(0); + reference.uri.AbsolutePath.Should().Contain("case.py"); + reference.uri.AbsolutePath.Should().NotContain("pyi"); + } + + [TestMethod, Priority(0)] + public async Task DateTimeProperty() { + const string code = @" +import datetime +x = datetime.datetime.day +"; + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + var ds = new DefinitionSource(Services); + + var reference = ds.FindDefinition(analysis, new SourceLocation(3, 15), out _); + reference.Should().NotBeNull(); + reference.range.start.line.Should().BeGreaterThan(0); + reference.uri.AbsolutePath.Should().Contain("datetime.py"); + reference.uri.AbsolutePath.Should().NotContain("pyi"); + } } } diff --git a/src/Publish/SignLayout.csproj b/src/Publish/SignLayout.csproj index b3aac5c65..37a0a6a4a 100644 --- a/src/Publish/SignLayout.csproj +++ b/src/Publish/SignLayout.csproj @@ -1,6 +1,6 @@ - netcoreapp2.2 + netcoreapp3.0 2008;$(NoWarn) diff --git a/src/Publish/global.json b/src/Publish/global.json new file mode 100644 index 000000000..9070cb969 --- /dev/null +++ b/src/Publish/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "3.0.100-preview9-014004" + } +} \ No newline at end of file diff --git a/src/UnitTests/Core/Impl/UnitTests.Core.csproj b/src/UnitTests/Core/Impl/UnitTests.Core.csproj index 9b5e111e0..b4b821830 100644 --- a/src/UnitTests/Core/Impl/UnitTests.Core.csproj +++ b/src/UnitTests/Core/Impl/UnitTests.Core.csproj @@ -8,7 +8,7 @@ - + all From 2313d44520fcb2ba7d4e6b4c138f402e092a429c Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Mon, 9 Sep 2019 17:15:00 -0700 Subject: [PATCH 33/60] Usings --- src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs | 8 ++++---- src/Analysis/Ast/Impl/Analyzer/StubMerger.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs index 35a3ea3c4..68f7a1cb1 100644 --- a/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs +++ b/src/Analysis/Ast/Impl/Analyzer/ModuleWalker.cs @@ -13,6 +13,10 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading; using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Documents; using Microsoft.Python.Analysis.Types; @@ -21,10 +25,6 @@ using Microsoft.Python.Core; using Microsoft.Python.Core.Diagnostics; using Microsoft.Python.Parsing.Ast; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Threading; namespace Microsoft.Python.Analysis.Analyzer { [DebuggerDisplay("{Module.Name} : {Module.ModuleType}")] diff --git a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs index 98d1b3a43..f48b08391 100644 --- a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs +++ b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs @@ -13,13 +13,14 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System.Diagnostics; +using System.Linq; +using System.Threading; using Microsoft.Python.Analysis.Analyzer.Evaluation; using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Specializations.Typing; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Analysis.Values; -using System.Linq; -using System.Threading; namespace Microsoft.Python.Analysis.Analyzer { internal sealed class StubMerger { @@ -47,9 +48,8 @@ public void MergeStub(IDocumentAnalysis stubAnalysis, CancellationToken cancella if (stubAnalysis.IsEmpty()) { return; } - // TODO: figure out why module is getting analyzed before stub. // https://github.com/microsoft/python-language-server/issues/907 - // Debug.Assert(!(_stubAnalysis is EmptyAnalysis)); + Debug.Assert(!(stubAnalysis is EmptyAnalysis)); // Stub is the primary information source. Take types from the stub // and replace source types by stub types. Transfer location and documentation From af2d7c73b46174a12e16135676d1aefc49dcfc2c Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Mon, 9 Sep 2019 21:08:15 -0700 Subject: [PATCH 34/60] Test fix --- .../Ast/Impl/Analyzer/PythonAnalyzerSession.cs | 14 +++++++++----- src/LanguageServer/Test/HoverTests.cs | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index 4032b0b03..c88728c1f 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -316,17 +316,21 @@ private bool CanUpdateAnalysis( if (!entry.CanUpdateAnalysis(version, out module, out ast, out currentAnalysis)) { if (IsAnalyzedLibraryInLoop(node, currentAnalysis)) { - return false; - } else if (ast == default) { + // Library analysis exists, don't analyze again + return false; + } + if (ast == default) { if (currentAnalysis == default) { // Entry doesn't have ast yet. There should be at least one more session. Cancel(); - } else { - Debug.Fail($"Library module {module.Name} of type {module.ModuleType} has been analyzed already!"); + _log?.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) canceled (no AST yet)."); + return false; } + //Debug.Fail($"Library module {module.Name} of type {module.ModuleType} has been analyzed already!"); + return true; } - _log?.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) canceled."); + _log?.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) canceled. Version: {version}, current: {module.Analysis.Version}."); return false; } return true; diff --git a/src/LanguageServer/Test/HoverTests.cs b/src/LanguageServer/Test/HoverTests.cs index 50d42aa2e..26f261ad5 100644 --- a/src/LanguageServer/Test/HoverTests.cs +++ b/src/LanguageServer/Test/HoverTests.cs @@ -89,7 +89,7 @@ public async Task HoverSpanCheck(bool is3x) { import datetime datetime.datetime.now().day "; - var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X); + var analysis = await GetAnalysisAsync(code, is3x ? PythonVersions.LatestAvailable3X : PythonVersions.LatestAnaconda2X); var hs = new HoverSource(new PlainTextDocumentationSource()); AssertHover(hs, analysis, new SourceLocation(3, 2), "module datetime*", new SourceSpan(3, 1, 3, 9)); From 8e3289c45f2d45a9ba851cc6bf91e1cca9a8948f Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Tue, 10 Sep 2019 11:10:46 -0700 Subject: [PATCH 35/60] Remove CompletionItemKind.None --- src/LanguageServer/Impl/Completion/CompletionItemSource.cs | 4 ++-- src/LanguageServer/Impl/Protocol/Enums.cs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/LanguageServer/Impl/Completion/CompletionItemSource.cs b/src/LanguageServer/Impl/Completion/CompletionItemSource.cs index 60e43e7a2..8e1fbc6ee 100644 --- a/src/LanguageServer/Impl/Completion/CompletionItemSource.cs +++ b/src/LanguageServer/Impl/Completion/CompletionItemSource.cs @@ -72,7 +72,7 @@ public static CompletionItemEx CreateCompletionItem(string text, CompletionItemK private static CompletionItemKind ToCompletionItemKind(PythonMemberType memberType) { switch (memberType) { - case PythonMemberType.Unknown: return CompletionItemKind.None; + case PythonMemberType.Unknown: return CompletionItemKind.Text; case PythonMemberType.Class: return CompletionItemKind.Class; case PythonMemberType.Instance: return CompletionItemKind.Value; case PythonMemberType.Function: return CompletionItemKind.Function; @@ -83,7 +83,7 @@ private static CompletionItemKind ToCompletionItemKind(PythonMemberType memberTy case PythonMemberType.Variable: return CompletionItemKind.Variable; case PythonMemberType.Generic: return CompletionItemKind.TypeParameter; } - return CompletionItemKind.None; + return CompletionItemKind.Text; } } } diff --git a/src/LanguageServer/Impl/Protocol/Enums.cs b/src/LanguageServer/Impl/Protocol/Enums.cs index 1bc87af14..08cfeef7a 100644 --- a/src/LanguageServer/Impl/Protocol/Enums.cs +++ b/src/LanguageServer/Impl/Protocol/Enums.cs @@ -146,7 +146,9 @@ public enum InsertTextFormat { } public enum CompletionItemKind { - None = 0, + // Do not return 0 or anything not in this list. + // See https://microsoft.github.io/language-server-protocol/specification + // VS Code converts values outside of the LSP range into Text. Text = 1, Method = 2, Function = 3, From af709580bbae4c8b35d2f46340ecca173a3520c2 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Tue, 10 Sep 2019 11:44:47 -0700 Subject: [PATCH 36/60] Add info to asserts --- src/Caching/Impl/ModuleFactory.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Caching/Impl/ModuleFactory.cs b/src/Caching/Impl/ModuleFactory.cs index 4fad9d9da..c66687872 100644 --- a/src/Caching/Impl/ModuleFactory.cs +++ b/src/Caching/Impl/ModuleFactory.cs @@ -49,7 +49,7 @@ public ModuleFactory(ModuleModel model, IPythonModule module, IGlobalScope gs) { DefaultLocation = new Location(Module); } - public IPythonType ConstructType(string qualifiedName) + public IPythonType ConstructType(string qualifiedName) => ConstructMember(qualifiedName)?.GetPythonType(); public IMember ConstructMember(string qualifiedName) { @@ -95,12 +95,12 @@ private IMember GetMemberFromThisModule(IReadOnlyList memberNames) { memberName = typeName; } - if(memberName == "") { + if (memberName == "") { return null; } var nextModel = currentModel.GetModel(memberName); - Debug.Assert(nextModel != null); + Debug.Assert(nextModel != null, $"Unable to find member {memberName} in module {Module.Name}"); if (nextModel == null) { return null; } @@ -141,8 +141,8 @@ private IPythonModule GetModule(QualifiedNameParts parts) { // from the stub and the main module was never loaded. This, for example, // happens with io which has member with mmap type coming from mmap // stub rather than the primary mmap module. - var m = parts.IsStub - ? Module.Interpreter.TypeshedResolution.GetImportedModule(parts.ModuleName) + var m = parts.IsStub + ? Module.Interpreter.TypeshedResolution.GetImportedModule(parts.ModuleName) : Module.Interpreter.ModuleResolution.GetImportedModule(parts.ModuleName); if (m != null) { @@ -180,7 +180,8 @@ private IMember GetMember(IMember root, IEnumerable memberNames) { } if (member == null) { - Debug.Assert(member != null || EnableMissingMemberAssertions == false); + var containerName = mc is IPythonType t ? t.Name : ""; + Debug.Assert(member != null || EnableMissingMemberAssertions == false, $"Unable to find member {memberName} in {containerName}."); break; } From 967e741dfa3305c0368c0e5825b7ffc6c7421562 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Tue, 10 Sep 2019 13:23:31 -0700 Subject: [PATCH 37/60] PR feedback --- src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs | 2 +- src/Analysis/Ast/Impl/Modules/DependencyProvider.cs | 4 ++-- src/Caching/Impl/Models/CallableModel.cs | 8 -------- src/Caching/Impl/ModuleDatabase.cs | 8 ++++---- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs b/src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs index 672da9490..3a0c8ba0d 100644 --- a/src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs +++ b/src/Analysis/Ast/Impl/Dependencies/IDependencyProvider.cs @@ -24,6 +24,6 @@ namespace Microsoft.Python.Analysis.Dependencies { /// provide dependencies from their models. /// internal interface IDependencyProvider { - HashSet GetDependencies(PythonAst ast); + ISet GetDependencies(PythonAst ast); } } diff --git a/src/Analysis/Ast/Impl/Modules/DependencyProvider.cs b/src/Analysis/Ast/Impl/Modules/DependencyProvider.cs index ef670ff46..1e0e4752a 100644 --- a/src/Analysis/Ast/Impl/Modules/DependencyProvider.cs +++ b/src/Analysis/Ast/Impl/Modules/DependencyProvider.cs @@ -34,7 +34,7 @@ public DependencyProvider(IPythonModule module, IServiceContainer services) { } #region IDependencyProvider - public HashSet GetDependencies(PythonAst ast) { + public ISet GetDependencies(PythonAst ast) { if (_dbService != null && _dbService.TryRestoreDependencies(_module, out var dp)) { return dp.GetDependencies(ast); } @@ -46,7 +46,7 @@ public HashSet GetDependencies(PythonAst ast) { #endregion private sealed class EmptyDependencyProvider: IDependencyProvider { - public HashSet GetDependencies(PythonAst ast) => new HashSet(); + public ISet GetDependencies(PythonAst ast) => new HashSet(); } } } diff --git a/src/Caching/Impl/Models/CallableModel.cs b/src/Caching/Impl/Models/CallableModel.cs index ef74613bf..323d5646f 100644 --- a/src/Caching/Impl/Models/CallableModel.cs +++ b/src/Caching/Impl/Models/CallableModel.cs @@ -79,14 +79,6 @@ protected CallableModel(IPythonType callable) { Attributes |= FunctionAttributes.Static; } } - //if (callable is IPythonPropertyType p) { - // if (p.IsClassMethod) { - // Attributes |= FunctionAttributes.ClassMethod; - // } - // if (p.IsStatic) { - // Attributes |= FunctionAttributes.Static; - // } - //} } protected override IEnumerable GetMemberModels() => Classes.Concat(Functions); diff --git a/src/Caching/Impl/ModuleDatabase.cs b/src/Caching/Impl/ModuleDatabase.cs index d04d63122..58237c502 100644 --- a/src/Caching/Impl/ModuleDatabase.cs +++ b/src/Caching/Impl/ModuleDatabase.cs @@ -32,7 +32,7 @@ namespace Microsoft.Python.Analysis.Caching { internal sealed class ModuleDatabase : IModuleDatabaseService { - private const int _databaseFormatVersion = 1; + private const int DatabaseFormatVersion = 1; private readonly Dictionary _dependencies = new Dictionary(); private readonly object _lock = new object(); @@ -48,7 +48,7 @@ public ModuleDatabase(IServiceContainer services) { _fs = services.GetService(); var cfs = services.GetService(); - _databaseFolder = Path.Combine(cfs.CacheFolder, $"analysis.v{_databaseFormatVersion}"); + _databaseFolder = Path.Combine(cfs.CacheFolder, $"analysis.v{DatabaseFormatVersion}"); } /// @@ -91,7 +91,7 @@ public bool TryRestoreGlobalScope(IPythonModule module, out IRestoredGlobalScope lock (_lock) { if (FindModuleModel(module.Name, module.FilePath, out var model)) { - gs = new RestoredGlobalScope(model, module); + gs = new RestoredGlobalScope(model, module); } } @@ -253,7 +253,7 @@ public DependencyProvider(IPythonModule module, ModuleModel model) { _dependencies = dc.Dependencies; } - public HashSet GetDependencies(PythonAst ast) => _dependencies; + public ISet GetDependencies(PythonAst ast) => _dependencies; } } } From 653fd808ffa1c47c9ec70b60805ab4beaaab6b36 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Tue, 10 Sep 2019 15:49:07 -0700 Subject: [PATCH 38/60] Undo test change, enable class reassignment Fix stub merge for TypeVar --- .../Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs | 7 ------- src/Analysis/Ast/Impl/Analyzer/StubMerger.cs | 3 --- src/Analysis/Ast/Test/AssignmentTests.cs | 4 ++-- src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs | 5 +++-- src/Caching/Test/LibraryModulesTests.cs | 1 + 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs b/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs index 1fdc244cd..a1582af45 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Handlers/AssignmentHandler.cs @@ -70,13 +70,6 @@ public void HandleAssignment(AssignmentStatement node) { continue; } - var m = Eval.LookupNameInScopes(ne.Name, out scope); - if(m?.MemberType == PythonMemberType.Class) { - // Ignore assignments to classes: enum.py does Enum = None - // which prevents persistence from restoring proper type from enum:Enum. - continue; - } - var source = value.IsGeneric() ? VariableSource.Generic : VariableSource.Declaration; var location = Eval.GetLocationOfName(ne); if (IsValidAssignment(ne.Name, location)) { diff --git a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs index f48b08391..230273bf7 100644 --- a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs +++ b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs @@ -82,9 +82,6 @@ private void TransferTypesFromStub(IDocumentAnalysis stubAnalysis, CancellationT var sourceVar = _eval.GlobalScope.Variables[v.Name]; var sourceType = sourceVar?.Value.GetPythonType(); - if (sourceType.IsUnknown()) { - continue; - } if (sourceVar?.Source == VariableSource.Import && sourceVar.GetPythonType()?.DeclaringModule.Stub != null) { diff --git a/src/Analysis/Ast/Test/AssignmentTests.cs b/src/Analysis/Ast/Test/AssignmentTests.cs index 38c321319..b586c1200 100644 --- a/src/Analysis/Ast/Test/AssignmentTests.cs +++ b/src/Analysis/Ast/Test/AssignmentTests.cs @@ -319,13 +319,13 @@ class D: ... } [TestMethod, Priority(0)] - public async Task NoClassAssign() { + public async Task AssignAfterClassDef() { const string code = @" class D: ... D = 5 "; var analysis = await GetAnalysisAsync(code); - analysis.Should().HaveVariable("D").OfType(BuiltinTypeId.Type); + analysis.Should().HaveVariable("D").OfType(BuiltinTypeId.Int); } [TestMethod, Priority(0)] diff --git a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs index 77887be1a..c10872a6d 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs @@ -149,9 +149,10 @@ public void HaveSameMembersAs(IMember other) { otherClass.IsGeneric.Should().Be(gt.IsGeneric); } + // See https://github.com/microsoft/python-language-server/issues/1533 on unittest. //Debug.Assert(subjectClass.Bases.Count == otherClass.Bases.Count); - subjectClass.Bases.Count.Should().BeGreaterOrEqualTo(otherClass.Bases.Count); - } + //subjectClass.Bases.Count.Should().BeGreaterOrEqualTo(otherClass.Bases.Count); + } if (string.IsNullOrEmpty(subjectMemberType.Documentation)) { otherMemberType.Documentation.Should().BeNullOrEmpty(); diff --git a/src/Caching/Test/LibraryModulesTests.cs b/src/Caching/Test/LibraryModulesTests.cs index 92f14ebcb..b01c751ef 100644 --- a/src/Caching/Test/LibraryModulesTests.cs +++ b/src/Caching/Test/LibraryModulesTests.cs @@ -219,6 +219,7 @@ public async Task Builtins() { public Task Socket() => TestModule("socket"); [TestMethod, Priority(0)] + [Ignore] public Task Sqlite3() => TestModule("sqlite3"); [TestMethod, Priority(0)] From 655818e24944f89c1aa73e173c709ad26bfb86f1 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Tue, 10 Sep 2019 17:21:02 -0700 Subject: [PATCH 39/60] Prevent merge of unrelated types --- src/Analysis/Ast/Impl/Analyzer/StubMerger.cs | 20 ++++--- .../Ast/Impl/Modules/PythonVariableModule.cs | 2 +- src/Analysis/Ast/Test/LibraryTests.cs | 2 + src/Analysis/Ast/Test/StubMergeTests.cs | 52 +++++++++++++++++++ src/Caching/Impl/RestoredGlobalScope.cs | 10 ++-- src/Caching/Test/LibraryModulesTests.cs | 1 - 6 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 src/Analysis/Ast/Test/StubMergeTests.cs diff --git a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs index 230273bf7..0af823ec1 100644 --- a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs +++ b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs @@ -213,7 +213,7 @@ private void UpdateVariables() { // variables that may still be holding old content. For example, ctypes // declares 'c_voidp = c_void_p' so when we replace 'class c_void_p' // by class from the stub, we need to go and update 'c_voidp' variable. - foreach (var v in _eval.GlobalScope.Variables) { + foreach (var v in _eval.GlobalScope.Variables.Where(v => v.Source == VariableSource.Declaration)) { var variableType = v.Value.GetPythonType(); if (!IsAcceptableModule(variableType)) { continue; @@ -232,24 +232,32 @@ private void UpdateVariables() { } } - private void TransferDocumentationAndLocation(IPythonType s, IPythonType d) { - if (s.IsUnknown() || s.DeclaringModule.ModuleType == ModuleType.Builtins || - d.IsUnknown() || d.DeclaringModule.ModuleType == ModuleType.Builtins) { + private void TransferDocumentationAndLocation(IPythonType sourceType, IPythonType stubType) { + if (sourceType.IsUnknown() || sourceType.DeclaringModule.ModuleType == ModuleType.Builtins || + stubType.IsUnknown() || stubType.DeclaringModule.ModuleType == ModuleType.Builtins) { return; // Do not transfer location of unknowns or builtins } // Stub may be one for multiple modules - when module consists of several // submodules, there is typically only one stub for the main module. // Types from 'unittest.case' (library) are stubbed in 'unittest' stub. - if (!IsAcceptableModule(s)) { + if (!IsAcceptableModule(sourceType)) { return; // Do not change unrelated types. } + // Destination must be from this module stub and not from other modules. + // Consider that 'email.headregistry' stub has DataHeader declaring 'datetime' + // property of type 'datetime' from 'datetime' module. We don't want to modify + // datetime type and change it's location to 'email.headregistry'. + if(stubType.DeclaringModule.ModuleType != ModuleType.Stub || stubType.DeclaringModule != _eval.Module.Stub) { + return; + } + // Documentation and location are always get transferred from module type // to the stub type and never the other way around. This makes sure that // we show documentation from the original module and goto definition // navigates to the module source and not to the stub. - if (s != d && s is PythonType src && d is PythonType dst) { + if (sourceType != stubType && sourceType is PythonType src && stubType is PythonType dst) { // If type is a class, then doc can either come from class definition node of from __init__. // If class has doc from the class definition, don't stomp on it. if (src is PythonClassType srcClass && dst is PythonClassType dstClass) { diff --git a/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs b/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs index d81d6a85c..6d4367218 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs @@ -46,7 +46,7 @@ internal sealed class PythonVariableModule : LocatedMember, IPythonModule, IEqua public bool IsSpecialized => Module?.IsSpecialized ?? false; public ModuleType ModuleType => Module?.ModuleType ?? ModuleType.Package; public IPythonModule PrimaryModule => null; - public IPythonModule Stub => null; + public IPythonModule Stub => Module?.Stub; public IGlobalScope GlobalScope => Module?.GlobalScope; public BuiltinTypeId TypeId => BuiltinTypeId.Module; public Uri Uri => Module?.Uri; diff --git a/src/Analysis/Ast/Test/LibraryTests.cs b/src/Analysis/Ast/Test/LibraryTests.cs index c68b33eef..721fd79d3 100644 --- a/src/Analysis/Ast/Test/LibraryTests.cs +++ b/src/Analysis/Ast/Test/LibraryTests.cs @@ -54,6 +54,8 @@ public async Task Datetime() { module.Name.Should().Be("datetime"); var dt = module.Should().HaveMember("datetime").Which; + dt.DeclaringModule.Name.Should().Be("datetime"); + var day = dt.Should().HaveReadOnlyProperty("day").Which; day.Documentation.Should().NotBeNullOrEmpty(); diff --git a/src/Analysis/Ast/Test/StubMergeTests.cs b/src/Analysis/Ast/Test/StubMergeTests.cs new file mode 100644 index 000000000..0fc22346d --- /dev/null +++ b/src/Analysis/Ast/Test/StubMergeTests.cs @@ -0,0 +1,52 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.Python.Analysis.Modules; +using Microsoft.Python.Analysis.Tests.FluentAssertions; +using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Parsing.Tests; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TestUtilities; + +namespace Microsoft.Python.Analysis.Tests { + [TestClass] + public class StubMergeTests : AnalysisTestBase { + public TestContext TestContext { get; set; } + + [TestInitialize] + public void TestInitialize() + => TestEnvironmentImpl.TestInitialize($"{TestContext.FullyQualifiedTestClassName}.{TestContext.TestName}"); + + [TestCleanup] + public void Cleanup() => TestEnvironmentImpl.TestCleanup(); + + [TestMethod, Priority(0)] + public async Task Datetime() { + var analysis = await GetAnalysisAsync("import datetime"); + + var module = analysis.Should().HaveVariable("datetime") + .Which.Should().HaveType().Which.Value as IPythonModule; + module.Should().NotBeNull(); + + var stub = module.Stub; + stub.Should().NotBeNull(); + + var dt = stub.Should().HaveClass("datetime").Which; + dt.DeclaringModule.Name.Should().Be("datetime"); + } + } +} diff --git a/src/Caching/Impl/RestoredGlobalScope.cs b/src/Caching/Impl/RestoredGlobalScope.cs index 43170d1f4..77e3bb255 100644 --- a/src/Caching/Impl/RestoredGlobalScope.cs +++ b/src/Caching/Impl/RestoredGlobalScope.cs @@ -52,12 +52,16 @@ private void DeclareVariables() { // of a class or type info of a function which hasn't been created yet. // Thus first create members so we can find then, then populate them with content. var mf = new ModuleFactory(_model, Module, this); - var models = _model.TypeVars.Concat(_model.NamedTuples).Concat(_model.Classes).Concat(_model.Functions); - foreach (var m in models) { + // Generics first + var typeVars = _model.TypeVars.Concat(_model.NamedTuples).Concat(_model.Classes).Concat(_model.Functions); + foreach (var m in typeVars) { _scopeVariables.DeclareVariable(m.Name, m.Create(mf, null, this), VariableSource.Generic, mf.DefaultLocation); } - foreach (var vm in _model.Variables) { + + // Declare variables in the order of appearance since later variables + // may use types declared in the preceding ones. + foreach (var vm in _model.Variables.OrderBy(m => m.IndexSpan.Start)) { var v = (IVariable)vm.Create(mf, null, this); _scopeVariables.DeclareVariable(vm.Name, v.Value, VariableSource.Declaration, mf.DefaultLocation); } diff --git a/src/Caching/Test/LibraryModulesTests.cs b/src/Caching/Test/LibraryModulesTests.cs index b01c751ef..92f14ebcb 100644 --- a/src/Caching/Test/LibraryModulesTests.cs +++ b/src/Caching/Test/LibraryModulesTests.cs @@ -219,7 +219,6 @@ public async Task Builtins() { public Task Socket() => TestModule("socket"); [TestMethod, Priority(0)] - [Ignore] public Task Sqlite3() => TestModule("sqlite3"); [TestMethod, Priority(0)] From 48561b8a760887df68482581a4340b4e08b659ba Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Tue, 10 Sep 2019 17:50:12 -0700 Subject: [PATCH 40/60] more tests --- src/Analysis/Ast/Impl/Analyzer/StubMerger.cs | 8 ++++---- src/Analysis/Ast/Test/StubMergeTests.cs | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs index 0af823ec1..7f7f75ad3 100644 --- a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs +++ b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs @@ -161,7 +161,7 @@ private void MergeClass(IVariable v, IPythonClassType sourceClass, IPythonType s if (sourceMemberType is IPythonClassMember cm && cm.DeclaringType != sourceClass) { continue; // Only take members from this class and not from bases. } - if (!IsAcceptableModule(sourceMemberType)) { + if (!IsFromThisModuleOrSubmodules(sourceMemberType)) { continue; // Member does not come from module or its submodules. } @@ -215,7 +215,7 @@ private void UpdateVariables() { // by class from the stub, we need to go and update 'c_voidp' variable. foreach (var v in _eval.GlobalScope.Variables.Where(v => v.Source == VariableSource.Declaration)) { var variableType = v.Value.GetPythonType(); - if (!IsAcceptableModule(variableType)) { + if (!IsFromThisModuleOrSubmodules(variableType)) { continue; } // Check if type that the variable references actually declared here. @@ -241,7 +241,7 @@ private void TransferDocumentationAndLocation(IPythonType sourceType, IPythonTyp // Stub may be one for multiple modules - when module consists of several // submodules, there is typically only one stub for the main module. // Types from 'unittest.case' (library) are stubbed in 'unittest' stub. - if (!IsAcceptableModule(sourceType)) { + if (!IsFromThisModuleOrSubmodules(sourceType)) { return; // Do not change unrelated types. } @@ -298,7 +298,7 @@ private void TransferDocumentationAndLocation(IPythonType sourceType, IPythonTyp /// does match the type module so we don't accidentally modify documentation /// or location of unrelated types such as coming from the base object type. /// - private bool IsAcceptableModule(IPythonType type) { + private bool IsFromThisModuleOrSubmodules(IPythonType type) { var thisModule = _eval.Module; var typeModule = type.DeclaringModule; var typeMainModuleName = typeModule.Name.Split('.').FirstOrDefault(); diff --git a/src/Analysis/Ast/Test/StubMergeTests.cs b/src/Analysis/Ast/Test/StubMergeTests.cs index 0fc22346d..1b67e8999 100644 --- a/src/Analysis/Ast/Test/StubMergeTests.cs +++ b/src/Analysis/Ast/Test/StubMergeTests.cs @@ -18,6 +18,7 @@ using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Tests.FluentAssertions; using Microsoft.Python.Analysis.Types; +using Microsoft.Python.Analysis.Values; using Microsoft.Python.Parsing.Tests; using Microsoft.VisualStudio.TestTools.UnitTesting; using TestUtilities; @@ -48,5 +49,18 @@ public async Task Datetime() { var dt = stub.Should().HaveClass("datetime").Which; dt.DeclaringModule.Name.Should().Be("datetime"); } + + [TestMethod, Priority(0)] + public async Task Os() { + var analysis = await GetAnalysisAsync("import os"); + + var module = analysis.Should().HaveVariable("os") + .Which.Should().HaveType().Which.Value as IPythonModule; + module.Should().NotBeNull(); + + var environ = module.Should().HaveMember("environ").Which; + var environType = environ.GetPythonType(); + environType.Documentation.Should().NotBeNullOrEmpty(); + } } } From 61014c18ba38b52c20336b7b1408b48fe7629e0c Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Tue, 10 Sep 2019 22:01:27 -0700 Subject: [PATCH 41/60] Fix variable update --- src/Analysis/Ast/Impl/Analyzer/StubMerger.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs index 7f7f75ad3..789d9deee 100644 --- a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs +++ b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs @@ -213,7 +213,7 @@ private void UpdateVariables() { // variables that may still be holding old content. For example, ctypes // declares 'c_voidp = c_void_p' so when we replace 'class c_void_p' // by class from the stub, we need to go and update 'c_voidp' variable. - foreach (var v in _eval.GlobalScope.Variables.Where(v => v.Source == VariableSource.Declaration)) { + foreach (var v in _eval.GlobalScope.Variables) { var variableType = v.Value.GetPythonType(); if (!IsFromThisModuleOrSubmodules(variableType)) { continue; From ab29574938788bfa39f7e2265b9f60b78b92c7c1 Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Tue, 10 Sep 2019 22:44:18 -0700 Subject: [PATCH 42/60] Null check --- src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index c88728c1f..1cd38e995 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -327,7 +327,7 @@ private bool CanUpdateAnalysis( return false; } //Debug.Fail($"Library module {module.Name} of type {module.ModuleType} has been analyzed already!"); - return true; + return false; } _log?.Log(TraceEventType.Verbose, $"Analysis of {module.Name}({module.ModuleType}) canceled. Version: {version}, current: {module.Analysis.Version}."); @@ -341,6 +341,7 @@ private void AnalyzeEntry(IDependencyChainNode node, Python var analyzable = module as IAnalyzable; analyzable?.NotifyAnalysisBegins(); + Debug.Assert(ast != null); var analysis = DoAnalyzeEntry(node, module, ast, version); _analyzerCancellationToken.ThrowIfCancellationRequested(); From 81e36cecde7fa3dd05ca71db05905ab9b132af6a Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Wed, 11 Sep 2019 09:57:08 -0700 Subject: [PATCH 43/60] Baselines --- src/Caching/Test/Files/MemberLocations.json | 2 +- src/Caching/Test/Files/SmokeTest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Caching/Test/Files/MemberLocations.json b/src/Caching/Test/Files/MemberLocations.json index bc8123835..91c00690d 100644 --- a/src/Caching/Test/Files/MemberLocations.json +++ b/src/Caching/Test/Files/MemberLocations.json @@ -165,7 +165,7 @@ "Properties": [ { "ReturnType": "i:int", - "Documentation": "", + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], diff --git a/src/Caching/Test/Files/SmokeTest.json b/src/Caching/Test/Files/SmokeTest.json index 8774ad298..3c94c2dc5 100644 --- a/src/Caching/Test/Files/SmokeTest.json +++ b/src/Caching/Test/Files/SmokeTest.json @@ -188,7 +188,7 @@ "Properties": [ { "ReturnType": "i:int", - "Documentation": "", + "Documentation": null, "Attributes": 0, "Classes": [], "Functions": [], From 8323cd20dd7c6dd21d7608d684842dc56cc0033e Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Wed, 11 Sep 2019 12:12:36 -0700 Subject: [PATCH 44/60] Move analysis complete event --- src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs | 6 ++++-- src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs | 4 ---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs index cfa8b64c0..3a1994ee6 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs @@ -232,8 +232,10 @@ public IReadOnlyList LoadedModules { public event EventHandler AnalysisComplete; - internal void RaiseAnalysisComplete(int moduleCount, double msElapsed) - => AnalysisComplete?.Invoke(this, new AnalysisCompleteEventArgs(moduleCount, msElapsed)); + internal void RaiseAnalysisComplete(int moduleCount, double msElapsed) { + _analysisCompleteEvent.Set(); + AnalysisComplete?.Invoke(this, new AnalysisCompleteEventArgs(moduleCount, msElapsed)); + } private void AnalyzeDocument(in AnalysisModuleKey key, in PythonAnalyzerEntry entry, in ImmutableArray dependencies) { _analysisCompleteEvent.Reset(); diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index 1cd38e995..df4615bb3 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -223,10 +223,6 @@ private async Task AnalyzeAffectedEntriesAsync(Stopwatch stopWatch) { if (_walker.MissingKeys.Count == 0 || _walker.MissingKeys.All(k => k.IsTypeshed)) { Interlocked.Exchange(ref _runningTasks, 0); - - if (!isCanceled) { - _analysisCompleteEvent.Set(); - } } else if (!isCanceled && _log != null && _log.LogLevel >= TraceEventType.Verbose) { _log?.Log(TraceEventType.Verbose, $"Missing keys: {string.Join(", ", _walker.MissingKeys)}"); } From f44c0517841ca02ba030a7b39c4bc78121df7839 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Wed, 11 Sep 2019 12:25:27 -0700 Subject: [PATCH 45/60] More stable enumeration --- src/Analysis/Ast/Impl/Analyzer/StubMerger.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs index 789d9deee..d084e623d 100644 --- a/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs +++ b/src/Analysis/Ast/Impl/Analyzer/StubMerger.cs @@ -68,7 +68,7 @@ public void MergeStub(IDocumentAnalysis stubAnalysis, CancellationToken cancella /// from source members to the stub types. /// private void TransferTypesFromStub(IDocumentAnalysis stubAnalysis, CancellationToken cancellationToken) { - foreach (var v in stubAnalysis.GlobalScope.Variables) { + foreach (var v in stubAnalysis.GlobalScope.Variables.ToArray()) { cancellationToken.ThrowIfCancellationRequested(); var stubType = v.Value.GetPythonType(); @@ -150,7 +150,7 @@ private void MergeClass(IVariable v, IPythonClassType sourceClass, IPythonType s // First pass: go through source class members and pick those // that are not present in the stub class. - foreach (var name in sourceClass.GetMemberNames()) { + foreach (var name in sourceClass.GetMemberNames().ToArray()) { cancellationToken.ThrowIfCancellationRequested(); var sourceMember = sourceClass.GetMember(name); @@ -184,7 +184,7 @@ private void MergeClass(IVariable v, IPythonClassType sourceClass, IPythonType s // or location, check if source class has same member and fetch it from there. // The reason is that in the stub sometimes members are specified all in one // class while in source they may come from bases. Example: datetime. - foreach (var name in stubType.GetMemberNames()) { + foreach (var name in stubType.GetMemberNames().ToArray()) { cancellationToken.ThrowIfCancellationRequested(); var stubMember = stubType.GetMember(name); @@ -213,7 +213,7 @@ private void UpdateVariables() { // variables that may still be holding old content. For example, ctypes // declares 'c_voidp = c_void_p' so when we replace 'class c_void_p' // by class from the stub, we need to go and update 'c_voidp' variable. - foreach (var v in _eval.GlobalScope.Variables) { + foreach (var v in _eval.GlobalScope.Variables.ToArray()) { var variableType = v.Value.GetPythonType(); if (!IsFromThisModuleOrSubmodules(variableType)) { continue; From 87093f314a74b2ac7f9997a09debdb98e373b605 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Wed, 11 Sep 2019 12:58:11 -0700 Subject: [PATCH 46/60] Improve restoring imports in tests --- .../Impl/Dependencies/DependencyCollector.cs | 4 ++-- src/Caching/Test/AnalysisCachingTestBase.cs | 19 +++++++------------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs b/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs index 6385af645..3b3c8385c 100644 --- a/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs +++ b/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs @@ -29,9 +29,9 @@ internal sealed class DependencyCollector { public HashSet Dependencies { get; } = new HashSet(); - public DependencyCollector(IPythonModule module) { + public DependencyCollector(IPythonModule module, bool? isTypeShed = null) { _module = module; - _isTypeshed = module is StubPythonModule stub && stub.IsTypeshed; + _isTypeshed = isTypeShed ?? module is StubPythonModule stub && stub.IsTypeshed; _moduleResolution = module.Interpreter.ModuleResolution; _pathResolver = _isTypeshed ? module.Interpreter.TypeshedResolution.CurrentPathResolver diff --git a/src/Caching/Test/AnalysisCachingTestBase.cs b/src/Caching/Test/AnalysisCachingTestBase.cs index 4da2db6b3..402136519 100644 --- a/src/Caching/Test/AnalysisCachingTestBase.cs +++ b/src/Caching/Test/AnalysisCachingTestBase.cs @@ -20,6 +20,7 @@ using Microsoft.Python.Analysis.Analyzer; using Microsoft.Python.Analysis.Caching.Models; using Microsoft.Python.Analysis.Caching.Tests.FluentAssertions; +using Microsoft.Python.Analysis.Dependencies; using Microsoft.Python.Analysis.Tests; using Microsoft.Python.Analysis.Types; using Newtonsoft.Json; @@ -68,26 +69,20 @@ internal async Task CompareBaselineAndRestoreAsync(ModuleModel model, IPythonMod // In real case dependency analysis will restore model dependencies. // Here we don't go through the dependency analysis so we have to // manually restore dependent modules. + var dp = new DependencyCollector(m); foreach (var imp in model.Imports) { - foreach (var name in imp.ModuleNames) { - m.Interpreter.ModuleResolution.GetOrLoadModule(name); - } + dp.AddImport(imp.ModuleNames, imp.ForceAbsolute); } foreach (var imp in model.FromImports) { - foreach (var name in imp.RootNames) { - m.Interpreter.ModuleResolution.GetOrLoadModule(name); - } + dp.AddFromImport(imp.RootNames, imp.MemberNames, imp.DotCount, imp.ForceAbsolute); } + var dps = new DependencyCollector(m, true); foreach (var imp in model.StubImports) { - foreach (var name in imp.ModuleNames) { - m.Interpreter.TypeshedResolution.GetOrLoadModule(name); - } + dps.AddImport(imp.ModuleNames, imp.ForceAbsolute); } foreach (var imp in model.StubFromImports) { - foreach (var name in imp.RootNames) { - m.Interpreter.TypeshedResolution.GetOrLoadModule(name); - } + dps.AddFromImport(imp.RootNames, imp.MemberNames, imp.DotCount, imp.ForceAbsolute); } var analyzer = Services.GetService(); From a81874e64ece123fa24449d3ecbf2b12dc78ec47 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Wed, 11 Sep 2019 13:16:57 -0700 Subject: [PATCH 47/60] Make extension for tests --- .../Impl/Dependencies/DependencyCollector.cs | 4 +-- .../Ast/Impl/Dependencies/DependencyWalker.cs | 2 +- .../DependencyCollectorExtensions.cs | 33 +++++++++++++++++++ src/Caching/Impl/ModuleDatabase.cs | 2 +- src/Caching/Test/AnalysisCachingTestBase.cs | 22 ++++++------- 5 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 src/Caching/Impl/Extensions/DependencyCollectorExtensions.cs diff --git a/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs b/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs index 3b3c8385c..586e314c1 100644 --- a/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs +++ b/src/Analysis/Ast/Impl/Dependencies/DependencyCollector.cs @@ -27,7 +27,7 @@ internal sealed class DependencyCollector { private readonly IModuleManagement _moduleResolution; private readonly PathResolverSnapshot _pathResolver; - public HashSet Dependencies { get; } = new HashSet(); + public ISet Dependencies { get; } = new HashSet(); public DependencyCollector(IPythonModule module, bool? isTypeShed = null) { _module = module; @@ -41,7 +41,7 @@ public DependencyCollector(IPythonModule module, bool? isTypeShed = null) { Dependencies.Add(new AnalysisModuleKey(module.Stub)); } } - + public void AddImport(IReadOnlyList importNames, bool forceAbsolute) { var imports = _pathResolver.GetImportsFromAbsoluteName(_module.FilePath, importNames, forceAbsolute); HandleSearchResults(imports); diff --git a/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs b/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs index ef43304a8..2f2270251 100644 --- a/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs +++ b/src/Analysis/Ast/Impl/Dependencies/DependencyWalker.cs @@ -24,7 +24,7 @@ namespace Microsoft.Python.Analysis.Dependencies { internal sealed class DependencyWalker : PythonWalker { private readonly DependencyCollector _dependencyCollector; - public HashSet Dependencies => _dependencyCollector.Dependencies; + public ISet Dependencies => _dependencyCollector.Dependencies; public DependencyWalker(IPythonModule module, PythonAst ast = null) { _dependencyCollector = new DependencyCollector(module); diff --git a/src/Caching/Impl/Extensions/DependencyCollectorExtensions.cs b/src/Caching/Impl/Extensions/DependencyCollectorExtensions.cs new file mode 100644 index 000000000..0c216a256 --- /dev/null +++ b/src/Caching/Impl/Extensions/DependencyCollectorExtensions.cs @@ -0,0 +1,33 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System.Collections.Generic; +using Microsoft.Python.Analysis.Caching.Models; +using Microsoft.Python.Analysis.Dependencies; + +namespace Microsoft.Python.Analysis.Caching { + internal static class DependencyCollectorExtensions { + public static void AddImports(this DependencyCollector dc, IEnumerable imports) { + foreach (var imp in imports) { + dc.AddImport(imp.ModuleNames, imp.ForceAbsolute); + } + } + public static void AddFromImports(this DependencyCollector dc, IEnumerable imports) { + foreach (var imp in imports) { + dc.AddFromImport(imp.RootNames, imp.MemberNames, imp.DotCount, imp.ForceAbsolute); + } + } + } +} diff --git a/src/Caching/Impl/ModuleDatabase.cs b/src/Caching/Impl/ModuleDatabase.cs index 58237c502..8e9dd1f88 100644 --- a/src/Caching/Impl/ModuleDatabase.cs +++ b/src/Caching/Impl/ModuleDatabase.cs @@ -240,7 +240,7 @@ private AnalysisCachingLevel GetCachingLevel() => _services.GetService()?.Options.AnalysisCachingLevel ?? AnalysisCachingLevel.None; private sealed class DependencyProvider : IDependencyProvider { - private readonly HashSet _dependencies; + private readonly ISet _dependencies; public DependencyProvider(IPythonModule module, ModuleModel model) { var dc = new DependencyCollector(module); diff --git a/src/Caching/Test/AnalysisCachingTestBase.cs b/src/Caching/Test/AnalysisCachingTestBase.cs index 402136519..8baa49828 100644 --- a/src/Caching/Test/AnalysisCachingTestBase.cs +++ b/src/Caching/Test/AnalysisCachingTestBase.cs @@ -69,20 +69,18 @@ internal async Task CompareBaselineAndRestoreAsync(ModuleModel model, IPythonMod // In real case dependency analysis will restore model dependencies. // Here we don't go through the dependency analysis so we have to // manually restore dependent modules. - var dp = new DependencyCollector(m); - foreach (var imp in model.Imports) { - dp.AddImport(imp.ModuleNames, imp.ForceAbsolute); - } - foreach (var imp in model.FromImports) { - dp.AddFromImport(imp.RootNames, imp.MemberNames, imp.DotCount, imp.ForceAbsolute); + var dc = new DependencyCollector(m); + dc.AddImports(model.Imports); + dc.AddFromImports(model.FromImports); + foreach(var dep in dc.Dependencies) { + m.Interpreter.ModuleResolution.GetOrLoadModule(dep.Name); } - var dps = new DependencyCollector(m, true); - foreach (var imp in model.StubImports) { - dps.AddImport(imp.ModuleNames, imp.ForceAbsolute); - } - foreach (var imp in model.StubFromImports) { - dps.AddFromImport(imp.RootNames, imp.MemberNames, imp.DotCount, imp.ForceAbsolute); + var dcs = new DependencyCollector(m, true); + dcs.AddImports(model.StubImports); + dcs.AddFromImports(model.StubFromImports); + foreach (var dep in dcs.Dependencies) { + m.Interpreter.TypeshedResolution.GetOrLoadModule(dep.Name); } var analyzer = Services.GetService(); From 6a6fbb2805263380bedbb0ebb744bdff62f7ab92 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Wed, 11 Sep 2019 17:02:25 -0700 Subject: [PATCH 48/60] Add URI null check --- src/Analysis/Ast/Impl/Modules/PythonModule.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.cs index a78501c59..b55efdedf 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.cs @@ -22,8 +22,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Python.Analysis.Analyzer; -using Microsoft.Python.Analysis.Analyzer.Evaluation; -using Microsoft.Python.Analysis.Caching; using Microsoft.Python.Analysis.Dependencies; using Microsoft.Python.Analysis.Diagnostics; using Microsoft.Python.Analysis.Documents; @@ -192,7 +190,7 @@ public virtual IEnumerable GetMemberNames() { #endregion #region ILocatedMember - public override LocationInfo Definition => new LocationInfo(Uri.ToAbsolutePath(), Uri, 0, 0); + public override LocationInfo Definition => Uri != null ? new LocationInfo(Uri.ToAbsolutePath(), Uri, 0, 0) : LocationInfo.Empty; #endregion #region IPythonModule From 8547a9b0be9a45c138e211f9b2ddf8bc068b99c7 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 12 Sep 2019 10:11:16 -0700 Subject: [PATCH 49/60] Fix completion typo --- src/LanguageServer/Test/HoverTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LanguageServer/Test/HoverTests.cs b/src/LanguageServer/Test/HoverTests.cs index 26f261ad5..2d8623d32 100644 --- a/src/LanguageServer/Test/HoverTests.cs +++ b/src/LanguageServer/Test/HoverTests.cs @@ -89,7 +89,7 @@ public async Task HoverSpanCheck(bool is3x) { import datetime datetime.datetime.now().day "; - var analysis = await GetAnalysisAsync(code, is3x ? PythonVersions.LatestAvailable3X : PythonVersions.LatestAnaconda2X); + var analysis = await GetAnalysisAsync(code, is3x ? PythonVersions.LatestAvailable3X : PythonVersions.LatestAvailable2X); var hs = new HoverSource(new PlainTextDocumentationSource()); AssertHover(hs, analysis, new SourceLocation(3, 2), "module datetime*", new SourceSpan(3, 1, 3, 9)); From 8aa373c99db0e321b73adb3e7bcd0e9f51275e13 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 12 Sep 2019 11:40:30 -0700 Subject: [PATCH 50/60] Add assert on unresolved modules --- src/Caching/Test/LibraryModulesTests.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Caching/Test/LibraryModulesTests.cs b/src/Caching/Test/LibraryModulesTests.cs index 92f14ebcb..4e2930520 100644 --- a/src/Caching/Test/LibraryModulesTests.cs +++ b/src/Caching/Test/LibraryModulesTests.cs @@ -302,8 +302,15 @@ import requests private async Task TestModule(string name) { var analysis = await GetAnalysisAsync($"import {name}", PythonVersions.Python37_x64); + var m = analysis.Document.Interpreter.ModuleResolution.GetImportedModule(name); + if (m.ModuleType == ModuleType.Unresolved) { + Assert.Inconclusive(@"Module {name} is not installed"); + return; + } + var model = ModuleModel.FromAnalysis(m.Analysis, Services, AnalysisCachingLevel.Library); + model.Should().NotBeNull($"Module {name} is either not installed or cannot be cached"); await CompareBaselineAndRestoreAsync(model, m); } From 820fdd44338691271d0e5778d5faeb98143797be Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 12 Sep 2019 12:14:07 -0700 Subject: [PATCH 51/60] Add more details to assert --- .../Ast/Test/FluentAssertions/MemberAssertions.cs | 10 +++++----- src/Caching/Test/LibraryModulesTests.cs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs index c10872a6d..b783668b5 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs @@ -137,8 +137,8 @@ public void HaveSameMembersAs(IMember other) { otherMember.Should().BeAssignableTo(); } - subjectMemberType.MemberType.Should().Be(otherMemberType.MemberType); - Debug.Assert(subjectMemberType.MemberType == otherMemberType.MemberType); + subjectMemberType.MemberType.Should().Be(otherMemberType.MemberType, $"Type name: {subjectMemberType.Name}"); + //Debug.Assert(subjectMemberType.MemberType == otherMemberType.MemberType); if (subjectMemberType is IPythonClassType subjectClass) { var otherClass = otherMemberType as IPythonClassType; @@ -146,7 +146,7 @@ public void HaveSameMembersAs(IMember other) { if(subjectClass is IGenericType gt) { otherClass.Should().BeAssignableTo(); - otherClass.IsGeneric.Should().Be(gt.IsGeneric); + otherClass.IsGeneric.Should().Be(gt.IsGeneric, $"Class name: {subjectClass.Name}"); } // See https://github.com/microsoft/python-language-server/issues/1533 on unittest. @@ -155,10 +155,10 @@ public void HaveSameMembersAs(IMember other) { } if (string.IsNullOrEmpty(subjectMemberType.Documentation)) { - otherMemberType.Documentation.Should().BeNullOrEmpty(); + otherMemberType.Documentation.Should().BeNullOrEmpty($"Type name: {subjectMemberType.Name}."); } else { //Debug.Assert(subjectMemberType.Documentation == otherMemberType.Documentation); - subjectMemberType.Documentation.Should().Be(otherMemberType.Documentation); + subjectMemberType.Documentation.Should().Be(otherMemberType.Documentation, $"Type name: {subjectMemberType.Name}."); } switch (subjectMemberType.MemberType) { diff --git a/src/Caching/Test/LibraryModulesTests.cs b/src/Caching/Test/LibraryModulesTests.cs index 4e2930520..6caa971a5 100644 --- a/src/Caching/Test/LibraryModulesTests.cs +++ b/src/Caching/Test/LibraryModulesTests.cs @@ -301,11 +301,11 @@ import requests } private async Task TestModule(string name) { - var analysis = await GetAnalysisAsync($"import {name}", PythonVersions.Python37_x64); + var analysis = await GetAnalysisAsync($"import {name}", PythonVersions.Python36_x64); var m = analysis.Document.Interpreter.ModuleResolution.GetImportedModule(name); - if (m.ModuleType == ModuleType.Unresolved) { - Assert.Inconclusive(@"Module {name} is not installed"); + if (m == null || m.ModuleType == ModuleType.Unresolved) { + Assert.Inconclusive($"Module {name} is not installed or otherwise could not be imported."); return; } From db002c4bb8c81992ab3b77db5a3fa565275283a0 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 12 Sep 2019 12:14:16 -0700 Subject: [PATCH 52/60] Using --- src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs index b783668b5..15eb36cbb 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs @@ -15,7 +15,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions; From 56b8d8830e7781f0a9103443ab7cc990b49828c7 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 12 Sep 2019 12:16:33 -0700 Subject: [PATCH 53/60] To 3.7 --- src/Caching/Test/LibraryModulesTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Caching/Test/LibraryModulesTests.cs b/src/Caching/Test/LibraryModulesTests.cs index 6caa971a5..0d0183579 100644 --- a/src/Caching/Test/LibraryModulesTests.cs +++ b/src/Caching/Test/LibraryModulesTests.cs @@ -301,7 +301,7 @@ import requests } private async Task TestModule(string name) { - var analysis = await GetAnalysisAsync($"import {name}", PythonVersions.Python36_x64); + var analysis = await GetAnalysisAsync($"import {name}", PythonVersions.Python37_x64); var m = analysis.Document.Interpreter.ModuleResolution.GetImportedModule(name); if (m == null || m.ModuleType == ModuleType.Unresolved) { From 68d38e7cb85b83a45732a5367a5a85326d4d8adb Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 12 Sep 2019 13:02:02 -0700 Subject: [PATCH 54/60] Implement check for big/little endian --- .../Analyzer/Handlers/ConditionalHandler.cs | 2 +- .../Impl/Analyzer/Symbols/SymbolCollector.cs | 2 +- .../Impl/Extensions/IfStatementExtensions.cs | 19 +++++++++++ .../Impl/Extensions/PythonWalkerExtensions.cs | 10 ++++-- src/Analysis/Ast/Test/ConditionalsTests.cs | 32 +++++++++++++++++++ src/Core/Impl/OS/IOSPlatform.cs | 1 + src/Core/Impl/OS/OSPlatform.cs | 2 ++ 7 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/Handlers/ConditionalHandler.cs b/src/Analysis/Ast/Impl/Analyzer/Handlers/ConditionalHandler.cs index 93c82cfd6..108bb0b31 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Handlers/ConditionalHandler.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Handlers/ConditionalHandler.cs @@ -25,6 +25,6 @@ public ConditionalHandler(AnalysisWalker walker) : base(walker) { } public bool HandleIf(IfStatement node) - => node.WalkIfWithSystemConditions(Walker, Ast.LanguageVersion, _platformService.IsWindows); + => node.WalkIfWithSystemConditions(Walker, Ast.LanguageVersion, _platformService); } } diff --git a/src/Analysis/Ast/Impl/Analyzer/Symbols/SymbolCollector.cs b/src/Analysis/Ast/Impl/Analyzer/Symbols/SymbolCollector.cs index 3e9bf8d35..b08c0f07e 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Symbols/SymbolCollector.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Symbols/SymbolCollector.cs @@ -48,7 +48,7 @@ private SymbolCollector(ModuleSymbolTable table, ExpressionEval eval) { private void Walk() => _eval.Ast.Walk(this); public override bool Walk(IfStatement node) - => node.WalkIfWithSystemConditions(this, _eval.Ast.LanguageVersion, _eval.Services.GetService().IsWindows); + => node.WalkIfWithSystemConditions(this, _eval.Ast.LanguageVersion, _eval.Services.GetService()); public override bool Walk(ClassDefinition cd) { if (IsDeprecated(cd)) { diff --git a/src/Analysis/Ast/Impl/Extensions/IfStatementExtensions.cs b/src/Analysis/Ast/Impl/Extensions/IfStatementExtensions.cs index 43a8e6869..02efaa287 100644 --- a/src/Analysis/Ast/Impl/Extensions/IfStatementExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/IfStatementExtensions.cs @@ -90,5 +90,24 @@ public static ConditionTestResult TryHandleOsPath(this IfStatementTest test, boo } return ConditionTestResult.Unrecognized; } + + public static ConditionTestResult TryHandleBigLittleEndian(this IfStatementTest test, bool isLittleEndian) { + if (test.Test is BinaryExpression cmp && + cmp.Left is MemberExpression me && (me.Target as NameExpression)?.Name == "sys" && me.Name == "byteorder" && + cmp.Right is ConstantExpression cex && cex.GetStringValue() is string s) { + switch (cmp.Operator) { + case PythonOperator.Equals when s == "little" && isLittleEndian: + return ConditionTestResult.WalkBody; + case PythonOperator.Equals when s == "big" && !isLittleEndian: + return ConditionTestResult.WalkBody; + case PythonOperator.NotEquals when s == "little" && !isLittleEndian: + return ConditionTestResult.WalkBody; + case PythonOperator.NotEquals when s == "big" && isLittleEndian: + return ConditionTestResult.WalkBody; + } + return ConditionTestResult.DontWalkBody; + } + return ConditionTestResult.Unrecognized; + } } } diff --git a/src/Analysis/Ast/Impl/Extensions/PythonWalkerExtensions.cs b/src/Analysis/Ast/Impl/Extensions/PythonWalkerExtensions.cs index affefbf2d..f3420b46f 100644 --- a/src/Analysis/Ast/Impl/Extensions/PythonWalkerExtensions.cs +++ b/src/Analysis/Ast/Impl/Extensions/PythonWalkerExtensions.cs @@ -13,21 +13,25 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using Microsoft.Python.Core.OS; using Microsoft.Python.Parsing; using Microsoft.Python.Parsing.Ast; namespace Microsoft.Python.Analysis { public static class PythonWalkerExtensions { - public static bool WalkIfWithSystemConditions(this IfStatement node, PythonWalker walker, PythonLanguageVersion languageVersion, bool isWindows) { + public static bool WalkIfWithSystemConditions(this IfStatement node, PythonWalker walker, PythonLanguageVersion languageVersion, IOSPlatform platform) { // System version, platform and os.path specializations var executeElse = false; foreach (var test in node.Tests) { var result = test.TryHandleSysVersionInfo(languageVersion); if (result == ConditionTestResult.Unrecognized) { - result = test.TryHandleSysPlatform(isWindows); + result = test.TryHandleSysPlatform(platform.IsWindows); if (result == ConditionTestResult.Unrecognized) { - result = test.TryHandleOsPath(isWindows); + result = test.TryHandleOsPath(platform.IsWindows); + if (result == ConditionTestResult.Unrecognized) { + result = test.TryHandleBigLittleEndian(platform.IsLittleEndian); + } } } diff --git a/src/Analysis/Ast/Test/ConditionalsTests.cs b/src/Analysis/Ast/Test/ConditionalsTests.cs index 054142dd1..a94654a82 100644 --- a/src/Analysis/Ast/Test/ConditionalsTests.cs +++ b/src/Analysis/Ast/Test/ConditionalsTests.cs @@ -168,6 +168,38 @@ def func(a, b): ... .Which.Should().HaveParameters(is3x ? new[] { "a" } : new[] { "a", "b" }); } + [DataRow(false)] + [DataRow(true)] + [DataTestMethod, Priority(0)] + public async Task BigLittleEndian(bool isLittleEndian) { + const string code = @" +if sys.byteorder == 'little': + x = 1 +else: + x = 'a' +"; + var platform = SubstitutePlatform(out var sm); + platform.IsLittleEndian.Returns(x => isLittleEndian); + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X, sm); + analysis.Should().HaveVariable("x").OfType(isLittleEndian ? BuiltinTypeId.Int : BuiltinTypeId.Str); + } + + [DataRow(false)] + [DataRow(true)] + [DataTestMethod, Priority(0)] + public async Task BigLittleEndianNotEqual(bool isLittleEndian) { + const string code = @" +if sys.byteorder != 'little': + x = 1 +else: + x = 'a' +"; + var platform = SubstitutePlatform(out var sm); + platform.IsLittleEndian.Returns(x => isLittleEndian); + var analysis = await GetAnalysisAsync(code, PythonVersions.LatestAvailable3X, sm); + analysis.Should().HaveVariable("x").OfType(!isLittleEndian ? BuiltinTypeId.Int : BuiltinTypeId.Str); + } + private IOSPlatform SubstitutePlatform(out IServiceManager sm) { sm = new ServiceManager(); var platform = Substitute.For(); diff --git a/src/Core/Impl/OS/IOSPlatform.cs b/src/Core/Impl/OS/IOSPlatform.cs index 0d14273ff..984441127 100644 --- a/src/Core/Impl/OS/IOSPlatform.cs +++ b/src/Core/Impl/OS/IOSPlatform.cs @@ -18,5 +18,6 @@ public interface IOSPlatform { bool IsWindows { get; } bool IsMac { get; } bool IsLinux { get; } + bool IsLittleEndian { get; } } } diff --git a/src/Core/Impl/OS/OSPlatform.cs b/src/Core/Impl/OS/OSPlatform.cs index c682ef5fb..09ddc752c 100644 --- a/src/Core/Impl/OS/OSPlatform.cs +++ b/src/Core/Impl/OS/OSPlatform.cs @@ -13,6 +13,7 @@ // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. +using System; using System.Runtime.InteropServices; namespace Microsoft.Python.Core.OS { @@ -20,5 +21,6 @@ public sealed class OSPlatform : IOSPlatform { public bool IsWindows => RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows); public bool IsMac => RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX); public bool IsLinux => RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux); + public bool IsLittleEndian => BitConverter.IsLittleEndian; } } From 93be7b1ce43aae0ce96bfe25ca48f717738b28c4 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Thu, 12 Sep 2019 16:53:49 -0700 Subject: [PATCH 55/60] Sync --- src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs | 1 + src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs index 3a1994ee6..a3b4ae45c 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs @@ -231,6 +231,7 @@ public IReadOnlyList LoadedModules { } public event EventHandler AnalysisComplete; + public bool IsFinalSession => _nextSession == null; internal void RaiseAnalysisComplete(int moduleCount, double msElapsed) { _analysisCompleteEvent.Set(); diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index df4615bb3..8fd9a5968 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -144,7 +144,7 @@ private async Task StartAsync() { lock (_syncObj) { isCanceled = _isCanceled; _state = State.Completed; - isFinal = _walker.MissingKeys.Count == 0 && !isCanceled && remaining == 0; + isFinal = (_walker.MissingKeys.Count == 0 && !isCanceled && remaining == 0) || (_analyzer as PythonAnalyzer)?.IsFinalSession == true; _walker = null; } From 2bdc31483c8fd0cf07879e1489b41273b98794e3 Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Fri, 13 Sep 2019 11:25:39 -0700 Subject: [PATCH 56/60] Synchronization Fix import model restore --- .../Ast/Impl/Analyzer/PythonAnalyzer.cs | 1 - .../Ast/Impl/Analyzer/PythonAnalyzerEntry.cs | 2 +- .../Impl/Analyzer/PythonAnalyzerSession.cs | 108 ++++++++++-------- .../Test/FluentAssertions/MemberAssertions.cs | 4 + .../DependencyCollectorExtensions.cs | 10 +- src/Caching/Impl/Models/DottedNameModel.cs | 23 ++++ src/Caching/Impl/Models/ImportModel.cs | 2 +- src/Caching/Impl/Models/ModuleModel.cs | 4 +- src/Caching/Impl/ModuleDatabase.cs | 9 +- .../Impl/Implementation/Server.cs | 2 +- 10 files changed, 103 insertions(+), 62 deletions(-) create mode 100644 src/Caching/Impl/Models/DottedNameModel.cs diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs index a3b4ae45c..3a1994ee6 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzer.cs @@ -231,7 +231,6 @@ public IReadOnlyList LoadedModules { } public event EventHandler AnalysisComplete; - public bool IsFinalSession => _nextSession == null; internal void RaiseAnalysisComplete(int moduleCount, double msElapsed) { _analysisCompleteEvent.Set(); diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs index 0e430fc2c..02503c64c 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerEntry.cs @@ -109,7 +109,7 @@ public bool CanUpdateAnalysis(int version, out IPythonModule module, out PythonA return true; } - return _analysisVersion <= version && !(_previousAnalysis is LibraryAnalysis); + return _analysisVersion <= version; } } diff --git a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs index 8fd9a5968..af049c36a 100644 --- a/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs +++ b/src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs @@ -144,7 +144,7 @@ private async Task StartAsync() { lock (_syncObj) { isCanceled = _isCanceled; _state = State.Completed; - isFinal = (_walker.MissingKeys.Count == 0 && !isCanceled && remaining == 0) || (_analyzer as PythonAnalyzer)?.IsFinalSession == true; + isFinal = _walker.MissingKeys.Count == 0 && !isCanceled && remaining == 0; _walker = null; } @@ -207,7 +207,13 @@ private async Task AnalyzeAffectedEntriesAsync(Stopwatch stopWatch) { ActivityTracker.OnEnqueueModule(node.Value.Module.FilePath); - if (Interlocked.Increment(ref _runningTasks) >= _maxTaskRunning || _walker.Remaining == 1) { + var taskLimitReached = false; + lock (_syncObj) { + _runningTasks++; + taskLimitReached = _runningTasks >= _maxTaskRunning || _walker.Remaining == 1; + } + + if (taskLimitReached) { RunAnalysis(node, stopWatch); } else { ace.AddOne(); @@ -218,13 +224,11 @@ private async Task AnalyzeAffectedEntriesAsync(Stopwatch stopWatch) { await ace.WaitAsync(_analyzerCancellationToken); lock (_syncObj) { - isCanceled = _isCanceled; - } - - if (_walker.MissingKeys.Count == 0 || _walker.MissingKeys.All(k => k.IsTypeshed)) { - Interlocked.Exchange(ref _runningTasks, 0); - } else if (!isCanceled && _log != null && _log.LogLevel >= TraceEventType.Verbose) { - _log?.Log(TraceEventType.Verbose, $"Missing keys: {string.Join(", ", _walker.MissingKeys)}"); + if (_walker.MissingKeys.Count == 0 || _walker.MissingKeys.All(k => k.IsTypeshed)) { + Debug.Assert(_runningTasks == 0); + } else if (!_isCanceled && _log != null && _log.LogLevel >= TraceEventType.Verbose) { + _log?.Log(TraceEventType.Verbose, $"Missing keys: {string.Join(", ", _walker.MissingKeys)}"); + } } return remaining; @@ -265,19 +269,13 @@ private void Analyze(IDependencyChainNode node, AsyncCountd } finally { node.MoveNext(); - bool isCanceled; - int remaining; lock (_syncObj) { - isCanceled = _isCanceled; - remaining = _walker.Remaining; - } - - if (!isCanceled) { - _progress.ReportRemaining(remaining); + if (!_isCanceled) { + _progress.ReportRemaining(_walker.Remaining); + } + _runningTasks--; + ace?.Signal(); } - - Interlocked.Decrement(ref _runningTasks); - ace?.Signal(); } } @@ -313,8 +311,8 @@ private bool CanUpdateAnalysis( if (!entry.CanUpdateAnalysis(version, out module, out ast, out currentAnalysis)) { if (IsAnalyzedLibraryInLoop(node, currentAnalysis)) { // Library analysis exists, don't analyze again - return false; - } + return false; + } if (ast == default) { if (currentAnalysis == default) { // Entry doesn't have ast yet. There should be at least one more session. @@ -353,31 +351,46 @@ private void AnalyzeEntry(IDependencyChainNode node, Python } private IDocumentAnalysis DoAnalyzeEntry(IDependencyChainNode node, IPythonModule module, PythonAst ast, int version) { - var moduleType = module.ModuleType; - IDocumentAnalysis analysis = null; + var analysis = TryRestoreCachedAnalysis(node, module); + if (analysis != null) { + return analysis; + } + + var walker = new ModuleWalker(_services, module, ast, _analyzerCancellationToken); + ast.Walk(walker); + walker.Complete(); + return CreateAnalysis(node, (IDocument)module, ast, version, walker); + } + + private bool MarkNodeWalked(IDependencyChainNode node) { + bool isCanceled; + lock (_syncObj) { + isCanceled = _isCanceled; + } + if (!isCanceled) { + node?.MarkWalked(); + } + return isCanceled; + } + private IDocumentAnalysis TryRestoreCachedAnalysis(IDependencyChainNode node, IPythonModule module) { + var moduleType = module.ModuleType; if (moduleType.CanBeCached() && _moduleDatabaseService?.ModuleExistsInStorage(module.Name, module.FilePath) == true) { if (_moduleDatabaseService.TryRestoreGlobalScope(module, out var gs)) { if (_log != null) { _log.Log(TraceEventType.Verbose, "Restored from database: ", module.Name); } - analysis = new DocumentAnalysis((IDocument)module, 1, gs, new ExpressionEval(_services, module, module.GetAst()), Array.Empty()); + var analysis = new DocumentAnalysis((IDocument)module, 1, gs, new ExpressionEval(_services, module, module.GetAst()), Array.Empty()); gs.ReconstructVariables(); + MarkNodeWalked(node); + return analysis; } else { if (_log != null) { _log.Log(TraceEventType.Verbose, "Restore from database failed for module ", module.Name); } } } - - if (analysis == null) { - var walker = new ModuleWalker(_services, module, ast, _analyzerCancellationToken); - ast.Walk(walker); - walker.Complete(); - analysis = CreateAnalysis(node, (IDocument)module, ast, version, walker); - } - - return analysis; + return null; } private IDocumentAnalysis CreateAnalysis(IDependencyChainNode node, IDocument document, PythonAst ast, int version, ModuleWalker walker) { @@ -393,22 +406,17 @@ private IDocumentAnalysis CreateAnalysis(IDependencyChainNode x is ImportStatement || x is FromImportStatement); diff --git a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs index 15eb36cbb..326ffe586 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs @@ -15,6 +15,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions; @@ -122,7 +123,10 @@ public void HaveSameMembersAs(IMember other) { var missingNames = otherMemberNames.Except(subjectMemberNames).ToArray(); var extraNames = subjectMemberNames.Except(otherMemberNames).ToArray(); + Debug.Assert(missingNames.Length == 0); missingNames.Should().BeEmpty("Subject has missing names: ", missingNames); + + Debug.Assert(extraNames.Length == 0); extraNames.Should().BeEmpty("Subject has extra names: ", extraNames); foreach (var n in subjectMemberNames.Except(Enumerable.Repeat("__base__", 1))) { diff --git a/src/Caching/Impl/Extensions/DependencyCollectorExtensions.cs b/src/Caching/Impl/Extensions/DependencyCollectorExtensions.cs index 0c216a256..b200daf5c 100644 --- a/src/Caching/Impl/Extensions/DependencyCollectorExtensions.cs +++ b/src/Caching/Impl/Extensions/DependencyCollectorExtensions.cs @@ -16,14 +16,22 @@ using System.Collections.Generic; using Microsoft.Python.Analysis.Caching.Models; using Microsoft.Python.Analysis.Dependencies; +using Microsoft.Python.Core.Collections; namespace Microsoft.Python.Analysis.Caching { internal static class DependencyCollectorExtensions { public static void AddImports(this DependencyCollector dc, IEnumerable imports) { foreach (var imp in imports) { - dc.AddImport(imp.ModuleNames, imp.ForceAbsolute); + foreach (var dottedName in imp.ModuleNames) { + var importNames = ImmutableArray.Empty; + foreach (var part in dottedName.NameParts) { + importNames = importNames.Add(part); + dc.AddImport(importNames, imp.ForceAbsolute); + } + } } } + public static void AddFromImports(this DependencyCollector dc, IEnumerable imports) { foreach (var imp in imports) { dc.AddFromImport(imp.RootNames, imp.MemberNames, imp.DotCount, imp.ForceAbsolute); diff --git a/src/Caching/Impl/Models/DottedNameModel.cs b/src/Caching/Impl/Models/DottedNameModel.cs new file mode 100644 index 000000000..1bbc05822 --- /dev/null +++ b/src/Caching/Impl/Models/DottedNameModel.cs @@ -0,0 +1,23 @@ +// Copyright(c) Microsoft Corporation +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the License); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY +// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +// MERCHANTABILITY OR NON-INFRINGEMENT. +// +// See the Apache Version 2.0 License for specific language governing +// permissions and limitations under the License. + +using System; + +namespace Microsoft.Python.Analysis.Caching.Models { + [Serializable] + internal sealed class DottedNameModel { + public string[] NameParts { get; set; } + } +} diff --git a/src/Caching/Impl/Models/ImportModel.cs b/src/Caching/Impl/Models/ImportModel.cs index e99b58fcf..42d479291 100644 --- a/src/Caching/Impl/Models/ImportModel.cs +++ b/src/Caching/Impl/Models/ImportModel.cs @@ -18,7 +18,7 @@ namespace Microsoft.Python.Analysis.Caching.Models { /// Represents import statement for dependency resolution. /// internal sealed class ImportModel { - public string[] ModuleNames { get; set; } + public DottedNameModel[] ModuleNames { get; set; } public bool ForceAbsolute { get; set; } } } diff --git a/src/Caching/Impl/Models/ModuleModel.cs b/src/Caching/Impl/Models/ModuleModel.cs index 2459b121a..fbca1705f 100644 --- a/src/Caching/Impl/Models/ModuleModel.cs +++ b/src/Caching/Impl/Models/ModuleModel.cs @@ -195,7 +195,9 @@ public DependencyWalker(PythonAst ast) { public override bool Walk(ImportStatement import) { var model = new ImportModel { ForceAbsolute = import.ForceAbsolute, - ModuleNames = import.Names.SelectMany(mn => mn.Names).Select(n => n.Name).ToArray() + ModuleNames = import.Names.Select(mn => new DottedNameModel { + NameParts = mn.Names.Select(nex => nex.Name).ToArray() + }).ToArray() }; Imports.Add(model); return false; diff --git a/src/Caching/Impl/ModuleDatabase.cs b/src/Caching/Impl/ModuleDatabase.cs index 8e9dd1f88..53e6ab04b 100644 --- a/src/Caching/Impl/ModuleDatabase.cs +++ b/src/Caching/Impl/ModuleDatabase.cs @@ -26,6 +26,7 @@ using Microsoft.Python.Analysis.Modules; using Microsoft.Python.Analysis.Types; using Microsoft.Python.Core; +using Microsoft.Python.Core.Collections; using Microsoft.Python.Core.IO; using Microsoft.Python.Core.Logging; using Microsoft.Python.Parsing.Ast; @@ -244,12 +245,8 @@ private sealed class DependencyProvider : IDependencyProvider { public DependencyProvider(IPythonModule module, ModuleModel model) { var dc = new DependencyCollector(module); - foreach (var imp in model.Imports) { - dc.AddImport(imp.ModuleNames, imp.ForceAbsolute); - } - foreach (var fi in model.FromImports) { - dc.AddFromImport(fi.RootNames, fi.MemberNames, fi.DotCount, fi.ForceAbsolute); - } + dc.AddImports(model.Imports); + dc.AddFromImports(model.FromImports); _dependencies = dc.Dependencies; } diff --git a/src/LanguageServer/Impl/Implementation/Server.cs b/src/LanguageServer/Impl/Implementation/Server.cs index 693b348ef..a7262d9d6 100644 --- a/src/LanguageServer/Impl/Implementation/Server.cs +++ b/src/LanguageServer/Impl/Implementation/Server.cs @@ -148,7 +148,7 @@ public async Task InitializedAsync(InitializedParams @params, CancellationToken var typeshedPath = initializationOptions?.typeStubSearchPaths.FirstOrDefault(); userConfiguredPaths = userConfiguredPaths ?? initializationOptions?.searchPaths; - _interpreter = await PythonInterpreter.CreateAsync(configuration, _rootDir, _services, typeshedPath, userConfiguredPaths.ToImmutableArray(), cancellationToken); + _interpreter = await PythonInterpreter.CreateAsync(configuration, Root, _services, typeshedPath, userConfiguredPaths.ToImmutableArray(), cancellationToken); _log?.Log(TraceEventType.Information, string.IsNullOrEmpty(_interpreter.Configuration.InterpreterPath) From 3ee351cfc149d6524fae66fab879d52300d0a1e6 Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Fri, 13 Sep 2019 14:47:29 -0700 Subject: [PATCH 57/60] Add hard assert --- src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs index 326ffe586..871e0a37a 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/MemberAssertions.cs @@ -160,7 +160,7 @@ public void HaveSameMembersAs(IMember other) { if (string.IsNullOrEmpty(subjectMemberType.Documentation)) { otherMemberType.Documentation.Should().BeNullOrEmpty($"Type name: {subjectMemberType.Name}."); } else { - //Debug.Assert(subjectMemberType.Documentation == otherMemberType.Documentation); + Debug.Assert(subjectMemberType.Documentation == otherMemberType.Documentation); subjectMemberType.Documentation.Should().Be(otherMemberType.Documentation, $"Type name: {subjectMemberType.Name}."); } From 55b85e4dcd7560a31f5327618e130f9fc75027cb Mon Sep 17 00:00:00 2001 From: Mikhail Arkhipov Date: Fri, 13 Sep 2019 17:17:15 -0700 Subject: [PATCH 58/60] Fix exception --- .../Analyzer/Handlers/FromImportHandler.cs | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs b/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs index 36efdf2a7..3374d04b2 100644 --- a/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs +++ b/src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs @@ -68,11 +68,13 @@ private void AssignVariables(FromImportStatement node, IImportSearchResult impor if (!string.IsNullOrEmpty(memberName)) { var nameExpression = asNames[i] ?? names[i]; var variableName = nameExpression?.Name ?? memberName; - var variable = variableModule.Analysis?.GlobalScope?.Variables[memberName]; - var exported = variable ?? variableModule.GetMember(memberName); - var value = exported ?? GetValueFromImports(variableModule, imports as IImportChildrenSource, memberName); - // Do not allow imported variables to override local declarations - Eval.DeclareVariable(variableName, value, VariableSource.Import, nameExpression, CanOverwriteVariable(variableName, node.StartIndex)); + if (!string.IsNullOrEmpty(variableName)) { + var variable = variableModule.Analysis?.GlobalScope?.Variables[memberName]; + var exported = variable ?? variableModule.GetMember(memberName); + var value = exported ?? GetValueFromImports(variableModule, imports as IImportChildrenSource, memberName); + // Do not allow imported variables to override local declarations + Eval.DeclareVariable(variableName, value, VariableSource.Import, nameExpression, CanOverwriteVariable(variableName, node.StartIndex)); + } } } } @@ -84,7 +86,7 @@ private void HandleModuleImportStar(PythonVariableModule variableModule, bool is } // If __all__ is present, take it, otherwise declare all members from the module that do not begin with an underscore. - var memberNames = isImplicitPackage + var memberNames = isImplicitPackage ? variableModule.GetMemberNames() : variableModule.Analysis.StarImportMemberNames ?? variableModule.GetMemberNames().Where(s => !s.StartsWithOrdinal("_")); @@ -109,7 +111,7 @@ private void HandleModuleImportStar(PythonVariableModule variableModule, bool is private bool CanOverwriteVariable(string name, int importPosition) { var v = Eval.CurrentScope.Variables[name]; - if(v == null) { + if (v == null) { return true; // Variable does not exist } // Allow overwrite if import is below the variable. Consider @@ -118,10 +120,10 @@ private bool CanOverwriteVariable(string name, int importPosition) { // from A import * # brings another x // x = 3 var references = v.References.Where(r => r.DocumentUri == Module.Uri).ToArray(); - if(references.Length == 0) { + if (references.Length == 0) { // No references to the variable in this file - the variable // is imported from another module. OK to overwrite. - return true; + return true; } var firstAssignmentPosition = references.Min(r => r.Span.ToIndexSpan(Ast).Start); return firstAssignmentPosition < importPosition; From 41089482243efa73a6ffadd168e61109007bd2aa Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Mon, 16 Sep 2019 11:48:23 -0700 Subject: [PATCH 59/60] Fix typo --- src/Analysis/Ast/Impl/Documents/DocumentBuffer.cs | 4 ++-- src/Analysis/Ast/Test/DocumentBufferTests.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Analysis/Ast/Impl/Documents/DocumentBuffer.cs b/src/Analysis/Ast/Impl/Documents/DocumentBuffer.cs index dcbbc12bb..39e6b03d2 100644 --- a/src/Analysis/Ast/Impl/Documents/DocumentBuffer.cs +++ b/src/Analysis/Ast/Impl/Documents/DocumentBuffer.cs @@ -50,7 +50,7 @@ public void Update(IEnumerable changes) { // Every change may change where the lines end so in order // to correctly determine line/offsets we must re-split buffer // into lines after each change. - var lineLoc = GetNewLineLications().ToArray(); + var lineLoc = GetNewLineLocations().ToArray(); if (change.ReplaceAllText) { _sb = new StringBuilder(change.InsertedText); @@ -72,7 +72,7 @@ public void Update(IEnumerable changes) { } } - public IEnumerable GetNewLineLications() { + public IEnumerable GetNewLineLocations() { _sb = _sb ?? new StringBuilder(_content); // for tests if (_sb.Length == 0) { diff --git a/src/Analysis/Ast/Test/DocumentBufferTests.cs b/src/Analysis/Ast/Test/DocumentBufferTests.cs index 80b8d2b50..c0230ac18 100644 --- a/src/Analysis/Ast/Test/DocumentBufferTests.cs +++ b/src/Analysis/Ast/Test/DocumentBufferTests.cs @@ -234,7 +234,7 @@ public void InsertTopToBottom() { public void NewLines(string s, NewLineLocation[] expected) { var doc = new DocumentBuffer(); doc.Reset(0, s); - var nls = doc.GetNewLineLications().ToArray(); + var nls = doc.GetNewLineLocations().ToArray(); for (var i = 0; i < nls.Length; i++) { Assert.AreEqual(nls[i].Kind, expected[i].Kind); Assert.AreEqual(nls[i].EndIndex, expected[i].EndIndex); From d6260fe59deec0e8a40768cd67b6b55e9d868c28 Mon Sep 17 00:00:00 2001 From: MikhailArkhipov Date: Mon, 16 Sep 2019 11:49:04 -0700 Subject: [PATCH 60/60] Add lock --- .../Ast/Impl/Documents/DocumentBuffer.cs | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/src/Analysis/Ast/Impl/Documents/DocumentBuffer.cs b/src/Analysis/Ast/Impl/Documents/DocumentBuffer.cs index 39e6b03d2..21a2bdfb8 100644 --- a/src/Analysis/Ast/Impl/Documents/DocumentBuffer.cs +++ b/src/Analysis/Ast/Impl/Documents/DocumentBuffer.cs @@ -73,31 +73,34 @@ public void Update(IEnumerable changes) { } public IEnumerable GetNewLineLocations() { - _sb = _sb ?? new StringBuilder(_content); // for tests + lock (_lock) { + _sb = _sb ?? new StringBuilder(_content); // for tests - if (_sb.Length == 0) { - yield return new NewLineLocation(0, NewLineKind.None); - } + if (_sb.Length == 0) { + yield return new NewLineLocation(0, NewLineKind.None); + } - for (var i = 0; i < _sb.Length; i++) { - var ch = _sb[i]; - var nextCh = i < _sb.Length - 1 ? _sb[i + 1] : '\0'; - switch (ch) { - case '\r' when nextCh == '\n': - i++; - yield return new NewLineLocation(i + 1, NewLineKind.CarriageReturnLineFeed); - break; - case '\n': - yield return new NewLineLocation(i + 1, NewLineKind.LineFeed); - break; - case '\r': - yield return new NewLineLocation(i + 1, NewLineKind.CarriageReturn); - break; - default: - if (i == _sb.Length - 1) { - yield return new NewLineLocation(i + 1, NewLineKind.None); - } - break; + for (var i = 0; i < _sb.Length; i++) { + var ch = _sb[i]; + var nextCh = i < _sb.Length - 1 ? _sb[i + 1] : '\0'; + switch (ch) { + case '\r' when nextCh == '\n': + i++; + yield return new NewLineLocation(i + 1, NewLineKind.CarriageReturnLineFeed); + break; + case '\n': + yield return new NewLineLocation(i + 1, NewLineKind.LineFeed); + break; + case '\r': + yield return new NewLineLocation(i + 1, NewLineKind.CarriageReturn); + break; + default: + if (i == _sb.Length - 1) { + yield return new NewLineLocation(i + 1, NewLineKind.None); + } + + break; + } } } }