100+ results for 'namedtuple _source'

Not the results you expected?

expectations.py (https://github.com/chromium/chromium.git) Python · 127 lines

99

100

101 ExpectationsInfo = collections.namedtuple('ExpectationsInfo', 'tag')

102

103 for t_name, t_tag in [

PredictingPlayer.py (https://github.com/submitteddenied/planetwars.git) Python · 251 lines

5 '''

6 from BasePlayer import BasePlayer

7 from collections import namedtuple, deque

8

9 class PredictingPlayer(BasePlayer):

141 continue

142 strength = 0

143 best_source = self.best_source(planet, pw)

144 if best_source is None:

151 target_strength = strength

152 if strength == target_strength:

153 other_source = self.best_source(target, pw)

154 if other_source is None or best_source is None:

155 continue

156 if other_source.DistanceTo(target) < best_source.DistanceTo(planet):

157 target = planet

158 target_strength = strength

__init__.py (https://gitlab.com/dialogue/wsgiauth0) Python · 252 lines

8 import logging

9 import sys

10 from collections import namedtuple

11

12 from jose import jws, jwt

20 log = logging.getLogger(__name__)

21

22 Client = namedtuple('Client', 'label id audience secret')

23 Secret = namedtuple('Secret', 'type value')

rttddft.py (https://gitlab.com/5rXUTAIYJSBcdxFmjqpuwaPo71b283/gpaw) Python · 138 lines

1 from __future__ import annotations

2

3 from typing import Generator, NamedTuple

4

5 import numpy as np

60

61

62 class RTTDDFTResult(NamedTuple):

63

64 """ Results are stored in atomic units, but displayed to the user in

ConstraintLocator.cpp (https://gitlab.com/dwiktor/swift) C++ · 240 lines

72 case GenericArgument:

73 case InterpolationArgument:

74 case NamedTupleElement:

75 case TupleElement:

76 case ApplyArgToParam:

181 break;

182

183 case NamedTupleElement:

184 out << "named tuple element #" << llvm::utostr(elt.getValue());

185 break;

mouse.rst (https://github.com/smathot/psychopy.git) ReStructuredText · 59 lines

27

28 .. autoclass:: psychopy.iohub.devices.mouse.MouseInputEvent

29 :exclude-members: DEVICE_ID_INDEX, filter_id, device_id, NUMPY_DTYPE, BASE_EVENT_MAX_ATTRIBUTE_INDEX, CLASS_ATTRIBUTE_NAMES, EVENT_CONFIDENCE_INTERVAL_INDEX, EVENT_DELAY_INDEX, EVENT_DEVICE_TIME_INDEX, EVENT_EXPERIMENT_ID_INDEX, EVENT_FILTER_ID_INDEX, EVENT_HUB_TIME_INDEX, EVENT_ID_INDEX, EVENT_LOGGED_TIME_INDEX, EVENT_SESSION_ID_INDEX, EVENT_TYPE_ID, EVENT_TYPE_ID_INDEX, EVENT_TYPE_STRING, IOHUB_DATA_TABLE, PARENT_DEVICE, createEventAsClass, createEventAsDict, createEventAsNamedTuple, e, namedTupleClass

30 :member-order: bysource

31

32 .. autoclass:: psychopy.iohub.devices.mouse.MouseMoveEvent

33 :exclude-members: DEVICE_ID_INDEX, filter_id, device_id, NUMPY_DTYPE, BASE_EVENT_MAX_ATTRIBUTE_INDEX, CLASS_ATTRIBUTE_NAMES, EVENT_CONFIDENCE_INTERVAL_INDEX, EVENT_DELAY_INDEX, EVENT_DEVICE_TIME_INDEX, EVENT_EXPERIMENT_ID_INDEX, EVENT_FILTER_ID_INDEX, EVENT_HUB_TIME_INDEX, EVENT_ID_INDEX, EVENT_LOGGED_TIME_INDEX, EVENT_SESSION_ID_INDEX, EVENT_TYPE_ID, EVENT_TYPE_ID_INDEX, EVENT_TYPE_STRING, IOHUB_DATA_TABLE, PARENT_DEVICE, createEventAsClass, createEventAsDict, createEventAsNamedTuple, e, namedTupleClass

34 :member-order: bysource

35

36 .. autoclass:: psychopy.iohub.devices.mouse.MouseDragEvent

37 :exclude-members: DEVICE_ID_INDEX, filter_id, device_id, NUMPY_DTYPE, BASE_EVENT_MAX_ATTRIBUTE_INDEX, CLASS_ATTRIBUTE_NAMES, EVENT_CONFIDENCE_INTERVAL_INDEX, EVENT_DELAY_INDEX, EVENT_DEVICE_TIME_INDEX, EVENT_EXPERIMENT_ID_INDEX, EVENT_FILTER_ID_INDEX, EVENT_HUB_TIME_INDEX, EVENT_ID_INDEX, EVENT_LOGGED_TIME_INDEX, EVENT_SESSION_ID_INDEX, EVENT_TYPE_ID, EVENT_TYPE_ID_INDEX, EVENT_TYPE_STRING, IOHUB_DATA_TABLE, PARENT_DEVICE, createEventAsClass, createEventAsDict, createEventAsNamedTuple, e, namedTupleClass

38 :member-order: bysource

39

tagger.py (https://github.com/tomob/hyde.git) Python · 183 lines

11 from hyde.util import add_method, add_property, pairwalk

12

13 from collections import namedtuple

14 from datetime import datetime

15 from functools import partial

parserll.py (https://github.com/tfviv79/junk.git) Python · 272 lines

2 ## encoding: utf-8

3 import collections

4 Result = collections.namedtuple("Result", ["flg", "ok", "err"])

5 Result_ok = lambda x: Result(True, x, None)

6 Result_err = lambda x, *args: Result(False, None, x%args)

sources.py (https://github.com/briot/geneapro.git) Python · 158 lines

11

12

13 CitationDetails = collections.namedtuple(

14 'CitationDetails', 'name value fromHigh')

15

42 sources=self.sources.values()) # Do not fetch them again

43

44 def fetch_higher_sources(self):

45 """

46 Fetch the 'higher' source relationships. This only gets the ids

49 return # already computed

50

51 logger.debug('SourceSet.fetch_higher_sources')

52 with django.db.connection.cursor() as cur:

53 ids = ", ".join(str(k) for k in self.sources.keys())

datatraces.py (https://gitlab.com/admin-github-cloud/jalangi2) Python · 177 lines

1 import collections

2 import csv, json

3 from collections import namedtuple

4

5

21 handle_row(row)

22

23 Mem = namedtuple('Mem', ['oid', 'offset'])

24 Loc = namedtuple('Loc', ['sid', 'iid'])

25 Val = namedtuple('Val', ['type', 'value'])

26

27 def string(idx):

save_workspace.py (https://github.com/mantidproject/mantid.git) Python · 125 lines

5 # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS

6 # SPDX - License - Identifier: GPL - 3.0 +

7 from collections import namedtuple

8 from mantid.api import MatrixWorkspace

9 from mantid.dataobjects import EventWorkspace

15 ZERO_ERROR_DEFAULT = 1e6

16

17 file_format_with_append = namedtuple('file_format_with_append', 'file_format, append_file_format_name')

18

19

mouse.rst (https://gitlab.com/braintech/psychopy-brain) ReStructuredText · 348 lines

15

16 The Mouse device supports the following event types. Device events returned by

17 getEvents() are automatically converted to either namedtuple or dictionary

18 objects with the same attributes / keys as the associated event class

19 attributes.

kpointsdata.py (https://github.com/mantidproject/mantid.git) Python · 163 lines

6 # SPDX - License - Identifier: GPL - 3.0 +

7 import collections.abc

8 from typing import List, NamedTuple, overload

9 from math import isclose

10

15

16

17 class KpointData(NamedTuple):

18 """Vibrational frequency / displacement data at a particular k-point"""

19 k: np.ndarray

makedeps.py (https://github.com/shkolnik/HandBrake.git) Python · 116 lines

4 import plistlib

5

6 DepEntry = collections.namedtuple('DepEntry', 'widget dep enable die hide')

7 dep_map = (

8 DepEntry("title", "queue_add", "none", True, False),

68 DepEntry("x264_subme", "x264_psy_trell", "<6", True, False),

69 DepEntry("x264_trellis", "x264_psy_trell", "0", True, False),

70 DepEntry("use_source_name", "chapters_in_destination", "TRUE", False, False),

71 DepEntry("use_source_name", "title_no_in_destination", "TRUE", False, False),

build_api_test.py (https://github.com/adamgreen/gcc4mbed.git) Python · 225 lines

17

18 import unittest

19 from collections import namedtuple

20 from mock import patch, MagicMock

21 from tools.build_api import prepare_toolchain, build_project, build_library,\

67 toolchain.config_processed = True

68 toolchain.config_file = "junk"

69 toolchain.compile_sources(res)

70

71 assert any('percent' in msg[0] and msg[0]['percent'] == 100.0

82 """

83 app_config = "app_config"

84 mock_target = namedtuple("Target",

85 "init_hooks name features core")(lambda _, __ : None,

86 "Junk", [], "Cortex-M3")

subprocess.py (https://gitlab.com/frabad/garden) Python · 167 lines

27 class Pipeline(object):

28

29 Step = collections.namedtuple("Step","name source exe description")

30

31 class Process(object):

_compat.py (https://github.com/rillian/firefox.git) Python · 189 lines

53 from dummy_threading import RLock

54

55 _CacheInfo = collections.namedtuple(

56 "CacheInfo", ["hits", "misses", "maxsize", "currsize"])

57

TypeVisitor.js (https://gitlab.com/nguyenthehiep3232/marius) JavaScript · 222 lines

161 this.visitFunctionType(node);

162 }

163 TSNamedTupleMember(node) {

164 this.visit(node.elementType);

165 // we don't visit the label as the label only exists for the purposes of documentation

deprecated.py (https://github.com/shoaibkamil/kdt-specializer.git) Python · 144 lines

135 """

136 Class to represent the data associated with an operator.

137 Used a class because empty fields are nicer than with NamedTuple.

138 """

139 def __init__(self, name, assoc=None, comm=None, src=None, ast=None):

apply_fixits.py (https://github.com/chromium/chromium.git) Python · 87 lines

35 r'"(?P<text>.*?)"$')

36

37 FixIt = collections.namedtuple(

38 'FixIt', ('start_line', 'start_col', 'end_line', 'end_col', 'text'))

39

kinds.d.ts (https://gitlab.com/varunsonavne/node-hello) TypeScript Typings · 264 lines

1 import { namedTypes } from "./namedTypes";

2 export declare type PrintableKind = namedTypes.File | namedTypes.Program | namedTypes.Identifier | namedTypes.BlockStatement | namedTypes.EmptyStatement | namedTypes.ExpressionStatement | namedTypes.IfStatement | namedTypes.LabeledStatement | namedTypes.BreakStatement | namedTypes.ContinueStatement | namedTypes.WithStatement | namedTypes.SwitchStatement | namedTypes.SwitchCase | namedTypes.ReturnStatement | namedTypes.ThrowStatement | namedTypes.TryStatement | namedTypes.CatchClause | namedTypes.WhileStatement | namedTypes.DoWhileStatement | namedTypes.ForStatement | namedTypes.VariableDeclaration | namedTypes.ForInStatement | namedTypes.DebuggerStatement | namedTypes.FunctionDeclaration | namedTypes.FunctionExpression | namedTypes.VariableDeclarator | namedTypes.ThisExpression | namedTypes.ArrayExpression | namedTypes.ObjectExpression | namedTypes.Property | namedTypes.Literal | namedTypes.SequenceExpression | namedTypes.UnaryExpression | namedTypes.BinaryExpression | namedTypes.AssignmentExpression | namedTypes.MemberExpression | namedTypes.UpdateExpression | namedTypes.LogicalExpression | namedTypes.ConditionalExpression | namedTypes.NewExpression | namedTypes.CallExpression | namedTypes.RestElement | namedTypes.TypeAnnotation | namedTypes.TSTypeAnnotation | namedTypes.SpreadElementPattern | namedTypes.ArrowFunctionExpression | namedTypes.ForOfStatement | namedTypes.YieldExpression | namedTypes.GeneratorExpression | namedTypes.ComprehensionBlock | namedTypes.ComprehensionExpression | namedTypes.ObjectProperty | namedTypes.PropertyPattern | namedTypes.ObjectPattern | namedTypes.ArrayPattern | namedTypes.MethodDefinition | namedTypes.SpreadElement | namedTypes.AssignmentPattern | namedTypes.ClassPropertyDefinition | namedTypes.ClassProperty | namedTypes.ClassBody | namedTypes.ClassDeclaration | namedTypes.ClassExpression | namedTypes.ImportSpecifier | namedTypes.ImportNamespaceSpecifier | namedTypes.ImportDefaultSpecifier | namedTypes.ImportDeclaration | namedTypes.TaggedTemplateExpression | namedTypes.TemplateLiteral | namedTypes.TemplateElement | namedTypes.SpreadProperty | namedTypes.SpreadPropertyPattern | namedTypes.AwaitExpression | namedTypes.ImportExpression | namedTypes.JSXAttribute | namedTypes.JSXIdentifier | namedTypes.JSXNamespacedName | namedTypes.JSXExpressionContainer | namedTypes.JSXMemberExpression | namedTypes.JSXSpreadAttribute | namedTypes.JSXElement | namedTypes.JSXOpeningElement | namedTypes.JSXClosingElement | namedTypes.JSXFragment | namedTypes.JSXText | namedTypes.JSXOpeningFragment | namedTypes.JSXClosingFragment | namedTypes.JSXEmptyExpression | namedTypes.JSXSpreadChild | namedTypes.TypeParameterDeclaration | namedTypes.TSTypeParameterDeclaration | namedTypes.TypeParameterInstantiation | namedTypes.TSTypeParameterInstantiation | namedTypes.ClassImplements | namedTypes.TSExpressionWithTypeArguments | namedTypes.AnyTypeAnnotation | namedTypes.EmptyTypeAnnotation | namedTypes.MixedTypeAnnotation | namedTypes.VoidTypeAnnotation | namedTypes.NumberTypeAnnotation | namedTypes.NumberLiteralTypeAnnotation | namedTypes.NumericLiteralTypeAnnotation | namedTypes.StringTypeAnnotation | namedTypes.StringLiteralTypeAnnotation | namedTypes.BooleanTypeAnnotation | namedTypes.BooleanLiteralTypeAnnotation | namedTypes.NullableTypeAnnotation | namedTypes.NullLiteralTypeAnnotation | namedTypes.NullTypeAnnotation | namedTypes.ThisTypeAnnotation | namedTypes.ExistsTypeAnnotation | namedTypes.ExistentialTypeParam | namedTypes.FunctionTypeAnnotation | namedTypes.FunctionTypeParam | namedTypes.ArrayTypeAnnotation | namedTypes.ObjectTypeAnnotation | namedTypes.ObjectTypeProperty | namedTypes.ObjectTypeSpreadProperty | namedTypes.ObjectTypeIndexer | namedTypes.ObjectTypeCallProperty | namedTypes.ObjectTypeInternalSlot | namedTypes.Variance | namedTypes.QualifiedTypeIdentifier | namedTypes.GenericTypeAnnotation | namedTypes.MemberTypeAnnotation | namedTypes.UnionTypeAnnotation | namedTypes.IntersectionTypeAnnotation | namedTypes.TypeofTypeAnnotation | namedTypes.TypeParameter | namedTypes.InterfaceTypeAnnotation | namedTypes.InterfaceExtends | namedTypes.InterfaceDeclaration | namedTypes.DeclareInterface | namedTypes.TypeAlias | namedTypes.OpaqueType | namedTypes.DeclareTypeAlias | namedTypes.DeclareOpaqueType | namedTypes.TypeCastExpression | namedTypes.TupleTypeAnnotation | namedTypes.DeclareVariable | namedTypes.DeclareFunction | namedTypes.DeclareClass | namedTypes.DeclareModule | namedTypes.DeclareModuleExports | namedTypes.DeclareExportDeclaration | namedTypes.ExportSpecifier | namedTypes.ExportBatchSpecifier | namedTypes.DeclareExportAllDeclaration | namedTypes.InferredPredicate | namedTypes.DeclaredPredicate | namedTypes.ExportDeclaration | namedTypes.Block | namedTypes.Line | namedTypes.Noop | namedTypes.DoExpression | namedTypes.Super | namedTypes.BindExpression | namedTypes.Decorator | namedTypes.MetaProperty | namedTypes.ParenthesizedExpression | namedTypes.ExportDefaultDeclaration | namedTypes.ExportNamedDeclaration | namedTypes.ExportNamespaceSpecifier | namedTypes.ExportDefaultSpecifier | namedTypes.ExportAllDeclaration | namedTypes.CommentBlock | namedTypes.CommentLine | namedTypes.Directive | namedTypes.DirectiveLiteral | namedTypes.InterpreterDirective | namedTypes.StringLiteral | namedTypes.NumericLiteral | namedTypes.BigIntLiteral | namedTypes.NullLiteral | namedTypes.BooleanLiteral | namedTypes.RegExpLiteral | namedTypes.ObjectMethod | namedTypes.ClassPrivateProperty | namedTypes.ClassMethod | namedTypes.ClassPrivateMethod | namedTypes.PrivateName | namedTypes.RestProperty | namedTypes.ForAwaitStatement | namedTypes.Import | namedTypes.TSQualifiedName | namedTypes.TSTypeReference | namedTypes.TSAsExpression | namedTypes.TSNonNullExpression | namedTypes.TSAnyKeyword | namedTypes.TSBigIntKeyword | namedTypes.TSBooleanKeyword | namedTypes.TSNeverKeyword | namedTypes.TSNullKeyword | namedTypes.TSNumberKeyword | namedTypes.TSObjectKeyword | namedTypes.TSStringKeyword | namedTypes.TSSymbolKeyword | namedTypes.TSUndefinedKeyword | namedTypes.TSUnknownKeyword | namedTypes.TSVoidKeyword | namedTypes.TSThisType | namedTypes.TSArrayType | namedTypes.TSLiteralType | namedTypes.TSUnionType | namedTypes.TSIntersectionType | namedTypes.TSConditionalType | namedTypes.TSInferType | namedTypes.TSTypeParameter | namedTypes.TSParenthesizedType | namedTypes.TSFunctionType | namedTypes.TSConstructorType | namedTypes.TSDeclareFunction | namedTypes.TSDeclareMethod | namedTypes.TSMappedType | namedTypes.TSTupleType | namedTypes.TSNamedTupleMember | namedTypes.TSRestType | namedTypes.TSOptionalType | namedTypes.TSIndexedAccessType | namedTypes.TSTypeOperator | namedTypes.TSIndexSignature | namedTypes.TSPropertySignature | namedTypes.TSMethodSignature | namedTypes.TSTypePredicate | namedTypes.TSCallSignatureDeclaration | namedTypes.TSConstructSignatureDeclaration | namedTypes.TSEnumMember | namedTypes.TSTypeQuery | namedTypes.TSImportType | namedTypes.TSTypeLiteral | namedTypes.TSTypeAssertion | namedTypes.TSEnumDeclaration | namedTypes.TSTypeAliasDeclaration | namedTypes.TSModuleBlock | namedTypes.TSModuleDeclaration | namedTypes.TSImportEqualsDeclaration | namedTypes.TSExternalModuleReference | namedTypes.TSExportAssignment | namedTypes.TSNamespaceExportDeclaration | namedTypes.TSInterfaceBody | namedTypes.TSInterfaceDeclaration | namedTypes.TSParameterProperty | namedTypes.OptionalMemberExpression | namedTypes.OptionalCallExpression;

3 export declare type SourceLocationKind = namedTypes.SourceLocation;

4 export declare type NodeKind = namedTypes.File | namedTypes.Program | namedTypes.Identifier | namedTypes.BlockStatement | namedTypes.EmptyStatement | namedTypes.ExpressionStatement | namedTypes.IfStatement | namedTypes.LabeledStatement | namedTypes.BreakStatement | namedTypes.ContinueStatement | namedTypes.WithStatement | namedTypes.SwitchStatement | namedTypes.SwitchCase | namedTypes.ReturnStatement | namedTypes.ThrowStatement | namedTypes.TryStatement | namedTypes.CatchClause | namedTypes.WhileStatement | namedTypes.DoWhileStatement | namedTypes.ForStatement | namedTypes.VariableDeclaration | namedTypes.ForInStatement | namedTypes.DebuggerStatement | namedTypes.FunctionDeclaration | namedTypes.FunctionExpression | namedTypes.VariableDeclarator | namedTypes.ThisExpression | namedTypes.ArrayExpression | namedTypes.ObjectExpression | namedTypes.Property | namedTypes.Literal | namedTypes.SequenceExpression | namedTypes.UnaryExpression | namedTypes.BinaryExpression | namedTypes.AssignmentExpression | namedTypes.MemberExpression | namedTypes.UpdateExpression | namedTypes.LogicalExpression | namedTypes.ConditionalExpression | namedTypes.NewExpression | namedTypes.CallExpression | namedTypes.RestElement | namedTypes.TypeAnnotation | namedTypes.TSTypeAnnotation | namedTypes.SpreadElementPattern | namedTypes.ArrowFunctionExpression | namedTypes.ForOfStatement | namedTypes.YieldExpression | namedTypes.GeneratorExpression | namedTypes.ComprehensionBlock | namedTypes.ComprehensionExpression | namedTypes.ObjectProperty | namedTypes.PropertyPattern | namedTypes.ObjectPattern | namedTypes.ArrayPattern | namedTypes.MethodDefinition | namedTypes.SpreadElement | namedTypes.AssignmentPattern | namedTypes.ClassPropertyDefinition | namedTypes.ClassProperty | namedTypes.ClassBody | namedTypes.ClassDeclaration | namedTypes.ClassExpression | namedTypes.ImportSpecifier | namedTypes.ImportNamespaceSpecifier | namedTypes.ImportDefaultSpecifier | namedTypes.ImportDeclaration | namedTypes.TaggedTemplateExpression | namedTypes.TemplateLiteral | namedTypes.TemplateElement | namedTypes.SpreadProperty | namedTypes.SpreadPropertyPattern | namedTypes.AwaitExpression | namedTypes.ImportExpression | namedTypes.JSXAttribute | namedTypes.JSXIdentifier | namedTypes.JSXNamespacedName | namedTypes.JSXExpressionContainer | namedTypes.JSXMemberExpression | namedTypes.JSXSpreadAttribute | namedTypes.JSXElement | namedTypes.JSXOpeningElement | namedTypes.JSXClosingElement | namedTypes.JSXFragment | namedTypes.JSXText | namedTypes.JSXOpeningFragment | namedTypes.JSXClosingFragment | namedTypes.JSXEmptyExpression | namedTypes.JSXSpreadChild | namedTypes.TypeParameterDeclaration | namedTypes.TSTypeParameterDeclaration | namedTypes.TypeParameterInstantiation | namedTypes.TSTypeParameterInstantiation | namedTypes.ClassImplements | namedTypes.TSExpressionWithTypeArguments | namedTypes.AnyTypeAnnotation | namedTypes.EmptyTypeAnnotation | namedTypes.MixedTypeAnnotation | namedTypes.VoidTypeAnnotation | namedTypes.NumberTypeAnnotation | namedTypes.NumberLiteralTypeAnnotation | namedTypes.NumericLiteralTypeAnnotation | namedTypes.StringTypeAnnotation | namedTypes.StringLiteralTypeAnnotation | namedTypes.BooleanTypeAnnotation | namedTypes.BooleanLiteralTypeAnnotation | namedTypes.NullableTypeAnnotation | namedTypes.NullLiteralTypeAnnotation | namedTypes.NullTypeAnnotation | namedTypes.ThisTypeAnnotation | namedTypes.ExistsTypeAnnotation | namedTypes.ExistentialTypeParam | namedTypes.FunctionTypeAnnotation | namedTypes.FunctionTypeParam | namedTypes.ArrayTypeAnnotation | namedTypes.ObjectTypeAnnotation | namedTypes.ObjectTypeProperty | namedTypes.ObjectTypeSpreadProperty | namedTypes.ObjectTypeIndexer | namedTypes.ObjectTypeCallProperty | namedTypes.ObjectTypeInternalSlot | namedTypes.Variance | namedTypes.QualifiedTypeIdentifier | namedTypes.GenericTypeAnnotation | namedTypes.MemberTypeAnnotation | namedTypes.UnionTypeAnnotation | namedTypes.IntersectionTypeAnnotation | namedTypes.TypeofTypeAnnotation | namedTypes.TypeParameter | namedTypes.InterfaceTypeAnnotation | namedTypes.InterfaceExtends | namedTypes.InterfaceDeclaration | namedTypes.DeclareInterface | namedTypes.TypeAlias | namedTypes.OpaqueType | namedTypes.DeclareTypeAlias | namedTypes.DeclareOpaqueType | namedTypes.TypeCastExpression | namedTypes.TupleTypeAnnotation | namedTypes.DeclareVariable | namedTypes.DeclareFunction | namedTypes.DeclareClass | namedTypes.DeclareModule | namedTypes.DeclareModuleExports | namedTypes.DeclareExportDeclaration | namedTypes.ExportSpecifier | namedTypes.ExportBatchSpecifier | namedTypes.DeclareExportAllDeclaration | namedTypes.InferredPredicate | namedTypes.DeclaredPredicate | namedTypes.ExportDeclaration | namedTypes.Noop | namedTypes.DoExpression | namedTypes.Super | namedTypes.BindExpression | namedTypes.Decorator | namedTypes.MetaProperty | namedTypes.ParenthesizedExpression | namedTypes.ExportDefaultDeclaration | namedTypes.ExportNamedDeclaration | namedTypes.ExportNamespaceSpecifier | namedTypes.ExportDefaultSpecifier | namedTypes.ExportAllDeclaration | namedTypes.Directive | namedTypes.DirectiveLiteral | namedTypes.InterpreterDirective | namedTypes.StringLiteral | namedTypes.NumericLiteral | namedTypes.BigIntLiteral | namedTypes.NullLiteral | namedTypes.BooleanLiteral | namedTypes.RegExpLiteral | namedTypes.ObjectMethod | namedTypes.ClassPrivateProperty | namedTypes.ClassMethod | namedTypes.ClassPrivateMethod | namedTypes.PrivateName | namedTypes.RestProperty | namedTypes.ForAwaitStatement | namedTypes.Import | namedTypes.TSQualifiedName | namedTypes.TSTypeReference | namedTypes.TSAsExpression | namedTypes.TSNonNullExpression | namedTypes.TSAnyKeyword | namedTypes.TSBigIntKeyword | namedTypes.TSBooleanKeyword | namedTypes.TSNeverKeyword | namedTypes.TSNullKeyword | namedTypes.TSNumberKeyword | namedTypes.TSObjectKeyword | namedTypes.TSStringKeyword | namedTypes.TSSymbolKeyword | namedTypes.TSUndefinedKeyword | namedTypes.TSUnknownKeyword | namedTypes.TSVoidKeyword | namedTypes.TSThisType | namedTypes.TSArrayType | namedTypes.TSLiteralType | namedTypes.TSUnionType | namedTypes.TSIntersectionType | namedTypes.TSConditionalType | namedTypes.TSInferType | namedTypes.TSTypeParameter | namedTypes.TSParenthesizedType | namedTypes.TSFunctionType | namedTypes.TSConstructorType | namedTypes.TSDeclareFunction | namedTypes.TSDeclareMethod | namedTypes.TSMappedType | namedTypes.TSTupleType | namedTypes.TSNamedTupleMember | namedTypes.TSRestType | namedTypes.TSOptionalType | namedTypes.TSIndexedAccessType | namedTypes.TSTypeOperator | namedTypes.TSIndexSignature | namedTypes.TSPropertySignature | namedTypes.TSMethodSignature | namedTypes.TSTypePredicate | namedTypes.TSCallSignatureDeclaration | namedTypes.TSConstructSignatureDeclaration | namedTypes.TSEnumMember | namedTypes.TSTypeQuery | namedTypes.TSImportType | namedTypes.TSTypeLiteral | namedTypes.TSTypeAssertion | namedTypes.TSEnumDeclaration | namedTypes.TSTypeAliasDeclaration | namedTypes.TSModuleBlock | namedTypes.TSModuleDeclaration | namedTypes.TSImportEqualsDeclaration | namedTypes.TSExternalModuleReference | namedTypes.TSExportAssignment | namedTypes.TSNamespaceExportDeclaration | namedTypes.TSInterfaceBody | namedTypes.TSInterfaceDeclaration | namedTypes.TSParameterProperty | namedTypes.OptionalMemberExpression | namedTypes.OptionalCallExpression;

106 export declare type TSTypeParameterInstantiationKind = namedTypes.TSTypeParameterInstantiation;

107 export declare type ClassImplementsKind = namedTypes.ClassImplements;

108 export declare type TSTypeKind = namedTypes.TSExpressionWithTypeArguments | namedTypes.TSTypeReference | namedTypes.TSAnyKeyword | namedTypes.TSBigIntKeyword | namedTypes.TSBooleanKeyword | namedTypes.TSNeverKeyword | namedTypes.TSNullKeyword | namedTypes.TSNumberKeyword | namedTypes.TSObjectKeyword | namedTypes.TSStringKeyword | namedTypes.TSSymbolKeyword | namedTypes.TSUndefinedKeyword | namedTypes.TSUnknownKeyword | namedTypes.TSVoidKeyword | namedTypes.TSThisType | namedTypes.TSArrayType | namedTypes.TSLiteralType | namedTypes.TSUnionType | namedTypes.TSIntersectionType | namedTypes.TSConditionalType | namedTypes.TSInferType | namedTypes.TSParenthesizedType | namedTypes.TSFunctionType | namedTypes.TSConstructorType | namedTypes.TSMappedType | namedTypes.TSTupleType | namedTypes.TSNamedTupleMember | namedTypes.TSRestType | namedTypes.TSOptionalType | namedTypes.TSIndexedAccessType | namedTypes.TSTypeOperator | namedTypes.TSTypePredicate | namedTypes.TSTypeQuery | namedTypes.TSImportType | namedTypes.TSTypeLiteral;

109 export declare type TSHasOptionalTypeParameterInstantiationKind = namedTypes.TSExpressionWithTypeArguments | namedTypes.TSTypeReference | namedTypes.TSImportType;

110 export declare type TSExpressionWithTypeArgumentsKind = namedTypes.TSExpressionWithTypeArguments;

234 export declare type TSMappedTypeKind = namedTypes.TSMappedType;

235 export declare type TSTupleTypeKind = namedTypes.TSTupleType;

236 export declare type TSNamedTupleMemberKind = namedTypes.TSNamedTupleMember;

237 export declare type TSRestTypeKind = namedTypes.TSRestType;

238 export declare type TSOptionalTypeKind = namedTypes.TSOptionalType;

test_convert.py (https://github.com/witten/borgmatic.git) Python · 120 lines

1 import os

2 from collections import OrderedDict, defaultdict, namedtuple

3

4 import pytest

7 from borgmatic.config import convert as module

8

9 Parsed_config = namedtuple('Parsed_config', ('location', 'storage', 'retention', 'consistency'))

10

11

20

21

22 def test_convert_legacy_parsed_config_transforms_source_config_to_mapping():

23 flexmock(module.yaml.comments).should_receive('CommentedMap').replace_with(OrderedDict)

24 flexmock(module.generate).should_receive('add_comments_to_configuration_map')

88

89

90 def test_guard_configuration_upgraded_raises_when_only_source_config_present():

91 flexmock(os.path).should_receive('exists').with_args('config').and_return(True)

92 flexmock(os.path).should_receive('exists').with_args('config.yaml').and_return(False)

__init__.py (https://gitlab.com/abhi1tb/build) Python · 153 lines

60 from .compat import itertools_filterfalse # noqa

61 from .compat import jython # noqa

62 from .compat import namedtuple # noqa

63 from .compat import nested # noqa

64 from .compat import next # noqa

committees.py (https://github.com/mattgrayson/openstates.git) Python · 147 lines

5 base_url = "http://www.nmlegis.gov/Committee/"

6

7 Member = collections.namedtuple("Member", "name role chamber")

8

9

133 for member in members:

134 committee.add_member(member.name, member.role)

135 committee.add_source(committee_url)

136 if not committee._related:

137 self.warning(

pycompat.py (https://gitlab.com/padjis/mapan) Python · 115 lines

12 PY2 = sys.version_info[0] == 2

13

14 _Writer = collections.namedtuple('_Writer', 'writerow writerows')

15 if PY2:

16 # pylint: disable=long-builtin,unichr-builtin,unicode-builtin,undefined-variable

PiecewiseLinear.py (https://github.com/SPFlow/SPFlow.git) Python · 136 lines

5 @author: Antonio Vergari

6 """

7 from collections import namedtuple

8

9 import numpy as np

20 class PiecewiseLinear(Leaf):

21 type = Type.REAL

22 property_type = namedtuple("PiecewiseLinear", "x_range y_range bin_repr_points")

23

24 def __init__(self, x_range, y_range, bin_repr_points, scope=None):

86 meta_type = ds_context.meta_types[idx]

87

88 hist = create_histogram_leaf(data, ds_context, scope, alpha=False, hist_source=hist_source)

89 densities = hist.densities

90 bins = hist.breaks

__init__.py (https://github.com/veekun/spline.git) Python · 97 lines

1 from collections import defaultdict, namedtuple

2 from pkg_resources import resource_filename

3 import re

17 map.connect('/', controller='frontpage', action='index')

18

19 def load_sources_hook(config, *args, **kwargs):

20 """Hook to load all the known sources and stuff them in config. Run once,

21 on server startup.

91 return [

92 ('routes_mapping', Priority.NORMAL, add_routes_hook),

93 ('after_setup', Priority.NORMAL, load_sources_hook),

94 ('cron', Priority.NORMAL, source_cron_hook),

95 ('frontpage_updates_rss', Priority.NORMAL, FeedSource),

cn.py (https://bitbucket.org/peixuan/chromium_r197479_base.git) Python · 123 lines

20 _DEFAULT_LOG_LEVEL = logging.ERROR

21

22 Dispatcher = collections.namedtuple('Dispatcher', ['dispatch', 'requires_ports',

23 'desc'])

24

InferMachineCreates.cs (https://github.com/p-org/P.git) C# · 194 lines

162 .Union(InferCreatesForExpr(mapAccessExpr.IndexExpr, handler));

163

164 case NamedTupleAccessExpr namedTupleAccessExpr:

165 return InferCreatesForExpr(namedTupleAccessExpr.SubExpr, handler);

166

167 case NamedTupleExpr namedTupleExpr:

168 return namedTupleExpr.TupleFields.SelectMany(expr1 => InferCreatesForExpr(expr1, handler));

181 return InferCreatesForExpr(unaryOpExpr.SubExpr, handler);

182

183 case UnnamedTupleExpr unnamedTupleExpr:

184 return unnamedTupleExpr.TupleFields.SelectMany(expr1 => InferCreatesForExpr(expr1, handler));

gevent_executor.py (https://gitlab.com/AntBar/pytango) Python · 182 lines

17 import six

18 import functools

19 from collections import namedtuple

20

21 # Gevent imports

59

60

61 ExceptionInfo = namedtuple('ExceptionInfo', 'type value traceback')

62

63

validations.py (https://github.com/feist/pcs.git) Python · 306 lines

1 from collections import namedtuple

2 from typing import (

3 List,

257

258 class _MoveBanClearAnalysis(

259 namedtuple(

260 "_MoveBanClearAnalysis",

261 [

common.py (https://github.com/autozimu/LanguageClient-neovim.git) Python · 159 lines

3 from urllib import request, parse

4 import sys

5 from collections import namedtuple

6

7 from denite.source.base import Base

14 MAX_FNAME_LEN = 30

15

16 _HighlightDefinition = namedtuple("HighlightDefinition", (

17 "name",

18 're',

resource_options.py (https://github.com/aio-libs/aiohttp-cors.git) Python · 153 lines

29

30

31 class ResourceOptions(collections.namedtuple(

32 "Base",

33 ("allow_credentials", "expose_headers", "allow_headers", "max_age",

80 def __new__(cls, *, allow_credentials=False, expose_headers=(),

81 allow_headers=(), max_age=None, allow_methods=None):

82 """Normalize source parameters and store them in namedtuple."""

83

84 if not isinstance(allow_credentials, bool):

preset.py (https://github.com/dagster-io/dagster.git) Python · 214 lines

1 from collections import namedtuple

2

3 import pkg_resources

16

17 class PresetDefinition(

18 namedtuple("_PresetDefinition", "name run_config solid_selection mode tags")

19 ):

20 """Defines a preset configuration in which a pipeline can execute.

test_prototype.py (https://gitlab.com/Haritiana/server-tools) Python · 113 lines

63 details = self.prototype.generate_files()

64 self.assertIsInstance(details, list)

65 # namedtuples in tuple

66 for file_details in details:

67 self.assertIsInstance(file_details, tuple)

PyNamedTupleInspection.kt (https://github.com/JetBrains/intellij-community.git) Kotlin · 169 lines

9 import com.intellij.psi.ResolveState

10 import com.intellij.psi.scope.PsiScopeProcessor

11 import com.jetbrains.python.codeInsight.stdlib.PyNamedTupleTypeProvider

12 import com.jetbrains.python.psi.LanguageLevel

13 import com.jetbrains.python.psi.PyClass

16 import java.util.*

17

18 class PyNamedTupleInspection : PyInspection() {

19

20 companion object {

121

122 if (LanguageLevel.forElement(node).isAtLeast(LanguageLevel.PYTHON36) &&

123 PyNamedTupleTypeProvider.isTypingNamedTupleDirectInheritor(node, myTypeEvalContext)) {

124 inspectFieldsOrder(node, { it == node }, false,

125 myTypeEvalContext,

list_command_test.py (https://github.com/Yelp/data_pipeline.git) Python · 238 lines

47 )

48

49 TopicsArgs = namedtuple(

50 "Namespace", [

51 "source_id",

117 @pytest.fixture(

118 params=[True, False],

119 ids=['with_active_sources', 'without_active_sources']

120 )

121 def good_source_args(self, request, namespace_one):

124 sort_by="name",

125 descending_order=False,

126 active_sources=request.param,

127 verbosity=0

128 )

system.py (https://github.com/dagster-io/dagster.git) Python · 359 lines

6 """

7

8 from collections import namedtuple

9

10 from dagster import check

24

25 class SystemExecutionContextData(

26 namedtuple(

27 "_SystemExecutionContextData",

28 (

svhn.py (https://github.com/jerryli27/TwinGAN.git) Python · 114 lines

56

57 Returns:

58 A `Dataset` namedtuple.

59

60 Raises:

103

104 return slim.dataset.Dataset(

105 data_sources=file_pattern,

106 reader=reader,

107 decoder=decoder,

112 items_used=['image', 'label', 'source', 'target', 'conditional_labels'],

113 items_need_preprocessing=['image', 'label', 'source', 'target', 'conditional_labels'],

114 has_source=True,)

115

magic.py (https://bitbucket.org/freebsd/freebsd-base.git) Python · 288 lines

7 import ctypes

8

9 from collections import namedtuple

10

11 from ctypes import *

51 MAGIC_NO_CHECK_BUILTIN = NO_CHECK_BUILTIN = 4173824

52

53 FileMagic = namedtuple('FileMagic', ('mime_type', 'encoding', 'name'))

54

55

261 '''Detect mime type, encoding and file type from a filename

262

263 Returns a `FileMagic` namedtuple.

264 '''

265

api.py (https://github.com/ROCmSoftwarePlatform/pytorch.git) Python · 206 lines

10 import time

11 import warnings

12 from collections import namedtuple

13 from functools import wraps

14 from typing import Dict, Optional

15

16 MetricData = namedtuple("MetricData", ["timestamp", "group_name", "name", "value"])

17

18

sellgains.py (https://github.com/beancount/beancount.git) Python · 156 lines

74

75

76 SellGainsError = collections.namedtuple('SellGainsError', 'source message entry')

77

78

xinput_gamepad.rst (https://github.com/smathot/psychopy.git) ReStructuredText · 73 lines

19

20 .. autoclass:: psychopy.iohub.devices.xinput.GamepadStateChangeEvent

21 :exclude-members: DEVICE_ID_INDEX, filter_id, device_id, NUMPY_DTYPE, BASE_EVENT_MAX_ATTRIBUTE_INDEX, CLASS_ATTRIBUTE_NAMES, EVENT_CONFIDENCE_INTERVAL_INDEX, EVENT_DELAY_INDEX, EVENT_DEVICE_TIME_INDEX, EVENT_EXPERIMENT_ID_INDEX, EVENT_FILTER_ID_INDEX, EVENT_HUB_TIME_INDEX, EVENT_ID_INDEX, EVENT_LOGGED_TIME_INDEX, EVENT_SESSION_ID_INDEX, EVENT_TYPE_ID, EVENT_TYPE_ID_INDEX, EVENT_TYPE_STRING, IOHUB_DATA_TABLE, PARENT_DEVICE, createEventAsClass, createEventAsDict, createEventAsNamedTuple, e, namedTupleClass

22 :member-order: bysource

23

changeset.py (https://github.com/sphinx-doc/sphinx.git) Python · 155 lines

9 """

10

11 from collections import namedtuple

12 from typing import Any, Dict, List

13 from typing import cast

41

42

43 # TODO: move to typing.NamedTuple after dropping py35 support (see #5958)

44 ChangeSet = namedtuple('ChangeSet',

59 node = addnodes.versionmodified()

60 node.document = self.state.document

61 self.set_source_info(node)

62 node['type'] = self.name

63 node['version'] = self.arguments[0]

67 self.lineno + 1)

68 para = nodes.paragraph(self.arguments[1], '', *inodes, translatable=False)

69 self.set_source_info(para)

70 node.append(para)

71 else:

type_test.cpp (https://github.com/ROCmSoftwarePlatform/pytorch.git) C++ · 209 lines

4 #include <ATen/core/jit_type.h>

5 #include <torch/csrc/jit/frontend/resolver.h>

6 #include <torch/csrc/jit/serialization/import_source.h>

7

8 namespace c10 {

52 }

53

54 TEST(TypeCustomPrinter, NamedTuples) {

55 TypePrinter printer =

56 [](const ConstTypePtr& t) -> c10::optional<std::string> {

57 if (auto tupleType = t->cast<TupleType>()) {

58 // Rewrite only NamedTuples

59 if (tupleType->name()) {

60 return "Rewritten";

devices.rst (https://github.com/jeremygray/psychopy.git) ReStructuredText · 96 lines

61

62 .. autoclass:: psychopy.iohub.devices.DeviceEvent

63 :exclude-members: filter_id, device_id, NUMPY_DTYPE, DEVICE_ID_INDEX, BASE_EVENT_MAX_ATTRIBUTE_INDEX, CLASS_ATTRIBUTE_NAMES, EVENT_CONFIDENCE_INTERVAL_INDEX, EVENT_DELAY_INDEX, EVENT_DEVICE_TIME_INDEX, EVENT_EXPERIMENT_ID_INDEX, EVENT_FILTER_ID_INDEX, EVENT_HUB_TIME_INDEX, EVENT_ID_INDEX, EVENT_LOGGED_TIME_INDEX, EVENT_SESSION_ID_INDEX, EVENT_TYPE_ID, EVENT_TYPE_ID_INDEX, EVENT_TYPE_STRING, IOHUB_DATA_TABLE, PARENT_DEVICE, createEventAsClass, createEventAsDict, createEventAsNamedTuple, e, namedTupleClass

64 :member-order: bysource

65

file.py (https://github.com/wamdam/backy2.git) Python · 232 lines

4 from backy2.logging import logger

5 from backy2.io import IO as _IO

6 from collections import namedtuple

7 import os

8 import queue

__init__.py (https://bitbucket.org/macdylan/py-vendors.git) Python · 34 lines

10 parse_qsl

11

12 from _collections import NamedTuple, ImmutableContainer, immutabledict, \

13 Properties, OrderedProperties, ImmutableProperties, OrderedDict, \

14 OrderedSet, IdentitySet, OrderedIdentitySet, column_set, \

l2dist_regs.py (https://github.com/neka-nat/probreg.git) Python · 195 lines

1 from __future__ import print_function

2 from __future__ import division

3 from collections import namedtuple

4 import logging

5 import numpy as np

28 sigma=1.0, delta=0.9,

29 use_estimated_sigma=True):

30 self._source = source

31 self._feature_gen = feature_gen

32 self._cost_fn = cost_fn

65 for _ in range(maxiter):

66 self._feature_gen.init()

67 mu_source, phi_source = self._feature_gen.compute(self._source)

68 mu_target, phi_target = self._feature_gen.compute(target)

69 args = (mu_source, phi_source,

bh_plugin.py (https://bitbucket.org/thomazrb/sublime-text-2.git) Python · 142 lines

2 from os.path import normpath, join

3 import imp

4 from collections import namedtuple

5 import sys

6 import traceback

8

9

10 class BracketRegion (namedtuple('BracketRegion', ['begin', 'end'], verbose=False)):

11 """

12 Bracket Regions for plugins

shader.py (https://gitlab.com/depp/gamedev) Python · 127 lines

13 from . import build

14

15 Shader = collections.namedtuple('Shader', 'text attributes uniforms')

16

17 DECL = re.compile(

bots_test.py (https://github.com/google/clusterfuzz.git) Python · 121 lines

38 ])

39 self.mock.prepare_blob_upload.return_value = (

40 collections.namedtuple('GcsUpload', [])())

41 flaskapp = flask.Flask('testflask')

42 flaskapp.add_url_rule('/', view_func=bots.JsonHandler.as_view('/'))

PyGotoTypeDeclarationTest.kt (https://github.com/JetBrains/intellij-community.git) Kotlin · 134 lines

79

80 // PY-41452

81 fun testNamedTupleClass() {

82 val type = findSymbolType(

83 "from typing import NamedTuple\n" +

84 "class MyNT(NamedTuple):\n" +

85 " field_1: int\n" +

86 " field_2: str\n" +

92

93 // PY-41452

94 fun testNamedTupleTarget() {

95 val type = findSymbolType(

96 "from typing import NamedTuple\n" +

97 "Employee = NamedTuple('Employee', [('name', str), ('id', int)])\n" +

98 "my_n<caret>t: Employee = undefined"

99 )

flowers.py (https://gitlab.com/ll14ec/Portfolio) Python · 98 lines

54

55 Returns:

56 A `Dataset` namedtuple.

57

58 Raises:

90

91 return slim.dataset.Dataset(

92 data_sources=file_pattern,

93 reader=reader,

94 decoder=decoder,

__init__.py (https://github.com/learnables/learn2learn.git) Python · 128 lines

12 import learn2learn as l2l

13

14 from collections import namedtuple

15 from .omniglot_benchmark import omniglot_tasksets

16 from .mini_imagenet_benchmark import mini_imagenet_tasksets

23

24

25 BenchmarkTasksets = namedtuple('BenchmarkTasksets', ('train', 'validation', 'test'))

26

27 _TASKSETS = {

70 Returns the tasksets for a particular benchmark, using literature standard data and task transformations.

71

72 The returned object is a namedtuple with attributes `train`, `validation`, `test` which

73 correspond to their respective TaskDatasets.

74 See `examples/vision/maml_miniimagenet.py` for an example.

__init__.py (https://github.com/geo-data/medin-rdbms-tool.git) Python · 34 lines

10 parse_qsl, any

11

12 from _collections import NamedTuple, ImmutableContainer, immutabledict, \

13 Properties, OrderedProperties, ImmutableProperties, OrderedDict, \

14 OrderedSet, IdentitySet, OrderedIdentitySet, column_set, \

evangelist.py (https://gitlab.com/made-financial/made-financial-scripts) Python · 114 lines

8

9 import sys

10 from collections import namedtuple

11 import pandas as pd

12 from .common import get_refunded

20 Payment = namedtuple('Payment', 'month payee amount source id')

21 Summary = namedtuple('Summary', 'payments total by_source by_level')

22

23 def evangelist(movements, options, format):

_registry.py (https://github.com/Ciphey/Ciphey.git) Python · 172 lines

8 Optional,

9 List,

10 NamedTuple,

11 TypeVar,

12 Type,

grouper.py (https://github.com/spidaboy7/hyde.git) Python · 217 lines

10 from hyde.util import add_method, add_property, pairwalk

11

12 from collections import namedtuple

13 from functools import partial

14 from itertools import ifilter, izip, tee, product

16

17

18 Grouper = namedtuple('Grouper', 'group resources')

19

20 class Group(Expando):

search.py (https://gitlab.com/iceman201/COSC_Algorithm.git) Python · 180 lines

10

11 from abc import ABCMeta, abstractmethod

12 from collections import namedtuple

13

14 def generic_search(graph, frontier):

38

39

40 class Arc(namedtuple('Arc', 'tail, head, label, cost')):

41 """Represents an arc in a graph.

42

storage_utils.py (https://github.com/capitalone/cloud-custodian.git) Python · 161 lines

2 # Copyright The Cloud Custodian Authors.

3 # SPDX-License-Identifier: Apache-2.0

4 from collections import namedtuple

5 from functools import wraps

6 from urllib.parse import urlparse

153 token = StorageUtilities.get_storage_token(session)

154

155 Storage = namedtuple('Storage', 'container_name, storage_name, token, file_prefix')

156

157 return Storage(

ConstraintLocatorPathElts.def (https://github.com/apple/swift.git) Module-Definition · 201 lines

166

167 /// A tuple element referenced by name.

168 CUSTOM_LOCATOR_PATH_ELT(NamedTupleElement)

169

170 /// An unresolved member.

remove_transfer_account.py (https://github.com/jbms/beancount-import.git) Python · 208 lines

1 """Interactive tool for removing an account that was used for pending transfers."""

2

3 from typing import List, Set, Tuple, NamedTuple, Union, Dict

4 import argparse

5 import datetime

14 from .posting_date import get_posting_date

15

16 PendingEntry = NamedTuple('PendingEntry', [

17 ('date', datetime.date),

18 ('transaction', Transaction),

extractors.py (https://github.com/Microsoft/Recognizers-Text.git) Python · 245 lines

1 import regex

2 from typing import Pattern, List, NamedTuple

3

4 from recognizers_text.utilities import RegExpUtility

80 class PortugueseIntegerExtractor(BaseNumberExtractor):

81 @property

82 def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]:

83 return self.__regexes

84

131

132 @property

133 def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]:

134 return self.__regexes

135

180 class PortugueseFractionExtractor(BaseNumberExtractor):

181 @property

182 def regexes(self) -> List[NamedTuple('re_val', [('re', Pattern), ('val', str)])]:

183 return self.__regexes

184

mysql_metadata_extractor.py (https://github.com/lyft/amundsendatabuilder.git) Python · 139 lines

3

4 import logging

5 from collections import namedtuple

6 from itertools import groupby

7 from typing import (

16 from databuilder.models.table_metadata import ColumnMetadata, TableMetadata

17

18 TableKey = namedtuple('TableKey', ['schema', 'table_name'])

19

20 LOGGER = logging.getLogger(__name__)

73 self.sql_stmt = MysqlMetadataExtractor.SQL_STATEMENT.format(

74 where_clause_suffix=conf.get_string(MysqlMetadataExtractor.WHERE_CLAUSE_SUFFIX_KEY),

75 cluster_source=cluster_source

76 )

77

core.py (https://github.com/blaze/odo.git) Python · 200 lines

1 from __future__ import absolute_import, division, print_function

2

3 from collections import namedtuple, Iterator

4 from contextlib import contextmanager

5 from warnings import warn

145

146

147 PathPart = namedtuple('PathPart', 'convert_from convert_to func cost')

148 _virtual_superclasses = (Iterator,)

149

processes.py (https://gitlab.com/meetly/dd-agent) Python · 95 lines

1 # stdlib

2 from collections import namedtuple

3

4 # project

70 return (command.split()[0]).split('/')[-1]

71

72 PSLine = namedtuple("PSLine", "user,pid,pct_cpu,pct_mem,vsz,rss,tty,stat,started,time,command")

73

74 self.start_snapshot()

commando.py (https://github.com/bewest/commando.git) Python · 200 lines

4 """

5 from argparse import ArgumentParser

6 from collections import namedtuple

7

8 # pylint: disable-msg=R0903,C0103,C0301

66 return instance

67

68 values = namedtuple('__meta_values', 'args, kwargs')

69

70

wallet_util.py (https://github.com/soitun/bitcoin.git) Python · 121 lines

4 # file COPYING or http://www.opensource.org/licenses/mit-license.php.

5 """Useful util functions for testing the wallet"""

6 from collections import namedtuple

7

8 from test_framework.address import (

24 )

25

26 Key = namedtuple('Key', ['privkey',

27 'pubkey',

28 'p2pkh_script',

34 'p2sh_p2wpkh_addr'])

35

36 Multisig = namedtuple('Multisig', ['privkeys',

37 'pubkeys',

38 'p2sh_script',

disgen.py (https://gitlab.com/0072016/coveragepy) Python · 206 lines

67 return disassemble(tb.tb_frame.f_code, tb.tb_lasti)

68

69 DisLine = collections.namedtuple(

70 'DisLine',

71 "lineno first target offset opcode oparg argstr"

journal.py (https://github.com/pombredanne/md.git) Python · 211 lines

41 ### Journals

42

43 class change(namedtuple('changes', 'cursor orig state'), Change):

44 pass

45

test_import_order.py (https://gitlab.com/Ivy001/pants) Python · 152 lines

19 ImportType.STDLIB: """

20 import ast

21 from collections import namedtuple

22 import io

23 """,

grouped_parameter.py (https://github.com/QCoDeS/Qcodes.git) Python · 234 lines

1 from collections import OrderedDict, namedtuple

2 from typing import (

3 TYPE_CHECKING,

69 The value returned by the get method is passed through a formatter.

70 By default, the formatter returns the :class:`.DelegateParameter`

71 values in a namedtuple, where the keys are the names of the

72 :class:`.DelegateParameter` s. In the special case where the

73 :class:`.DelegateGroup` only contains one :class:`.DelegateParameter`,

90 parameter.

91 formatter: Optional formatter for value returned by get_parameters(),

92 defaults to a namedtuple with the parameter names as keys.

93 """

94 def __init__(

120 self._formatter = lambda result: result

121 elif formatter is None:

122 self._formatter = self._namedtuple

123 else:

124 self._formatter = formatter

iterator.py (https://github.com/VectorFist/RNN-NMT.git) Python · 92 lines

3

4

5 BatchedInput = collections.namedtuple('BatchedInput', ['initializer', 'source', 'target_input',

6 'target_output', 'source_sequence_length',

7 'target_sequence_length'])

input_producer.py (https://github.com/qjadud1994/Text_Detector.git) Python · 116 lines

46 reader: The TensorFlow reader type.

47 Returns:

48 A `Dataset` namedtuple.

49 Raises:

50 ValueError: if `split_name` is not a valid train/test split.

105

106 return slim.dataset.Dataset(

107 data_sources=file_pattern,

108 reader=reader,

109 decoder=decoder,

mkflags.py (https://github.com/nyetwurk/mumble.git) Python · 111 lines

28

29 # Container for an on-disk flag SVG. Contains size and filename.

30 OnDiskFlag = collections.namedtuple('OnDiskFlag', ['size', 'filename'])

31

32 # Once a .qrc file's content exceeds this size, the

gen_nearest_neighbor_ops_pywrapper.py (https://github.com/ryfeus/lambda-packs.git) Python · 130 lines

22

23 _hyperplane_lsh_probes_outputs = ["probes", "table_ids"]

24 _HyperplaneLSHProbesOutput = _collections.namedtuple(

25 "HyperplaneLSHProbes", _hyperplane_lsh_probes_outputs)

26

__init__.py (https://github.com/Infinidat/infi.dtypes.hctl.git) Python · 64 lines

2

3 import sys

4 from collections import namedtuple

5

6 PY2 = sys.version_info[0] == 2

7 string_type = basestring if PY2 else str

8

9 class NamedTupleAddress(object):

10 _TUPLE = None

11 def __init__(self, *args, **kwargs):

12 super(NamedTupleAddress, self).__init__()

13 self._value = self._TUPLE(*args, **kwargs) #pylint: disable-msg=E1102

14 def __eq__(self, other):

test_ops.py (https://github.com/ryfeus/lambda-packs.git) Python · 266 lines

147

148

149 _TestStringOutputOutput = _collections.namedtuple("TestStringOutput",

150 _test_string_output_outputs)

151

gsr_processor.py (https://bitbucket.org/sathappanspm/embers.git) Python · 96 lines

11

12 from etool import args, queue

13 from collections import namedtuple

14 import xlrd

15 from datetime import datetime

16 import re

17

18 GSR_TITLES = namedtuple('GSR_Warning', 'eventId, eventSubId, EntryRevisionDate, recordStatus, country, state, city, eventCode, population, date, earliestReportedDate, source, headline, eventDescription, firstRepLink, otherLinks_gss, otherLinks1, otherLinks2, encodingComment')

19

20

50 title_deDup.append(k)

51 title_str = ','.join([re.sub('[^a-z0-9]', '', k.lower()) for k in title_deDup])

52 return namedtuple('GSR_Warning', title_str)

53

54

compat.py (https://bitbucket.org/zzzeek/mako.git) Python · 177 lines

16 pypy = hasattr(sys, "pypy_version_info")

17

18 ArgSpec = collections.namedtuple(

19 "ArgSpec", ["args", "varargs", "keywords", "defaults"]

20 )

121 fp = open(path, "rb")

122 try:

123 module = imp.load_source(module_id, path, fp)

124 del sys.modules[module_id]

125 return module

battery.py (https://github.com/Nemo157/.configs.git) Python · 126 lines

18 from powerline.lib.humanize_bytes import humanize_bytes

19 from powerline.theme import requires_segment_info

20 from collections import namedtuple

21

22

41 def _get_battery_info():

42 raw = _run_cmd(['/usr/bin/pmset', '-g', 'batt'])

43 current_source = _current_source_regex.search(raw)

44 if current_source is not None:

45 current_source = current_source.group(2)

46 current_percent = _current_percent_regex.search(raw)

47 if current_percent is not None:

59 time_remaining = ''

60 return {

61 "current_source": current_source,

62 "current_percent": current_percent,

63 "charging": charging,

types.py (https://gitlab.com/wilane/compose) Python · 198 lines

6

7 import os

8 from collections import namedtuple

9

10 import six

15

16

17 class VolumeFromSpec(namedtuple('_VolumeFromSpec', 'source mode type')):

18

19 # TODO: drop service_names arg when v1 is removed

133

134

135 class VolumeSpec(namedtuple('_VolumeSpec', 'external internal mode')):

136

137 @classmethod

generate_sql.py (https://github.com/osm2vectortiles/osm2vectortiles.git) Python · 128 lines

10 --version Show version.

11 """

12 from collections import namedtuple

13 from docopt import docopt

14 import yaml

16

17 SQL_INDENT = 8 * " "

18 Class = namedtuple('Class', ['name', 'values'])

19

20

48

49

50 Table = namedtuple('Table', ['name', 'buffer', 'min_zoom', 'max_zoom'])

51

52

device_stats_monitor.py (https://bitbucket.org/peixuan/chromium_r197479_base.git) Python · 116 lines

103 """Parses a line of cpu stats into a CpuStats named tuple."""

104 # Field definitions: http://www.linuxhowtos.org/System/procstat.htm

105 cpu_stats = collections.namedtuple('CpuStats',

106 ['device',

107 'user',

__init__.py (https://gitlab.com/pooja043/Globus_Docker_3) Python · 47 lines

8 from .compat import callable, cmp, reduce, \

9 threading, py3k, py33, py2k, jython, pypy, cpython, win32, \

10 pickle, dottedgetter, parse_qsl, namedtuple, next, reraise, \

11 raise_from_cause, text_type, safe_kwarg, string_types, int_types, \

12 binary_type, \

subgraph.py (https://github.com/common-workflow-language/cwltool.git) Python · 146 lines

1 import urllib

2 from collections import namedtuple

3 from typing import Dict, MutableMapping, MutableSequence, Optional, Set, Tuple, cast

4

8 from .workflow import Workflow

9

10 Node = namedtuple("Node", ("up", "down", "type"))

11 UP = "up"

12 DOWN = "down"

base.py (https://gitlab.com/hrishikeshvganu/tensorflow) Python · 101 lines

28 from tensorflow.python.platform import gfile

29

30 Dataset = collections.namedtuple('Dataset', ['data', 'target'])

31 Datasets = collections.namedtuple('Datasets', ['train', 'validation', 'test'])

dedup_data.py (https://gitlab.com/lwd17/enhanced_examplar_ae) Python · 91 lines

1 import argparse

2 from collections import namedtuple

3 import os

4

22

23

24 LanguagePair = namedtuple("LanguagePair", ["src", "tgt"])

25

26

59 if os.path.exists(train_filenames.src) and os.path.exists(train_filenames.tgt):

60 with open(train_filenames.src) as f:

61 train_source = f.readlines()

62

63 with open(train_filenames.tgt) as f:

75 assert len(new_train_source) == len(new_train_target)

76 assert len(new_train_source) <= len(train_source)

77

78 with open(output_filenames.src, "w") as o:

kube.py (https://github.com/miracle2k/k8s-snapshots.git) Python · 181 lines

2 import threading

3 from typing import (Optional, Iterable, AsyncGenerator, TypeVar, Type,

4 NamedTuple, Callable)

5

6 import pykube

19 ClientFactory = Callable[[], pykube.HTTPClient]

20

21 # Copy of a locally-defined namedtuple in

22 # pykube.query.WatchQuery.object_stream()

23 _WatchEvent = NamedTuple('_WatchEvent', [

compilation.py (https://gitlab.com/Alioth-Project/clang-r445002) Python · 140 lines

9 import collections

10

11 __all__ = ['split_command', 'classify_source', 'compiler_language']

12

13 # Ignored compiler options map for compilation database creation.

67

68 # the result of this method

69 result = collections.namedtuple('Compilation',

70 ['compiler', 'flags', 'files'])

71 result.compiler = compiler_language(command)

92 result.flags.extend([arg, next(args)])

93 # parameter which looks source file is taken...

94 elif re.match(r'^[^-].+', arg) and classify_source(arg):

95 result.files.append(arg)

96 # and consider everything else as compile option.

content.py (https://gitlab.com/taler/merchant-frontends) Python · 131 lines

22 from bs4 import BeautifulSoup

23 from pkg_resources import resource_stream, resource_filename

24 from collections import namedtuple

25 import logging

26 import os

29 logger = logging.getLogger(__name__)

30

31 Article = namedtuple("Article", "slug title teaser main_file extra_files")

32

33 articles = OrderedDict()

execution.py (https://github.com/isaacs/node.git) Python · 95 lines

20

21

22 JobResult = collections.namedtuple('JobResult', ['id', 'result'])

23 ProcessContext = collections.namedtuple('ProcessContext', ['result_reduction'])

__init__.py (https://github.com/sqlalchemy/sqlalchemy.git) Python · 162 lines

63 from .compat import itertools_filter # noqa

64 from .compat import itertools_filterfalse # noqa

65 from .compat import namedtuple # noqa

66 from .compat import next # noqa

67 from .compat import osx # noqa

td1.py (https://github.com/Arg0s1080/mrz.git) Python · 140 lines

15

16 from ..base.countries_ops import *

17 from ..base.functions import hash_is_ok, namedtuple_maker, anset

18 from ._hash_fields import _HashChecker

19 from ._fields import _FieldsChecker

117

118 def fields(self, zeroes_fill=False):

119 """Returns a namedtuple with all fields strings

120

121 Available strings for ID Cards and others TD1's:

131 extra_fields = anset(self._optional_data_2, zeroes_fill), self._final_hash

132 extra_names = "optional_data_2 final_hash"

133 return namedtuple_maker(self._str_common_fields(zeroes_fill), self._str_common_hashes(),

134 extra_fields, extra_names)

135

keyboard.rst (https://github.com/smathot/psychopy.git) ReStructuredText · 49 lines

23 :members:

24 :inherited-members:

25 :exclude-members: DEVICE_ID_INDEX, filter_id, device_id, NUMPY_DTYPE, BASE_EVENT_MAX_ATTRIBUTE_INDEX, CLASS_ATTRIBUTE_NAMES, EVENT_CONFIDENCE_INTERVAL_INDEX, EVENT_DELAY_INDEX, EVENT_DEVICE_TIME_INDEX, EVENT_EXPERIMENT_ID_INDEX, EVENT_FILTER_ID_INDEX, EVENT_HUB_TIME_INDEX, EVENT_ID_INDEX, EVENT_LOGGED_TIME_INDEX, EVENT_SESSION_ID_INDEX, EVENT_TYPE_ID, EVENT_TYPE_ID_INDEX, EVENT_TYPE_STRING, IOHUB_DATA_TABLE, PARENT_DEVICE, createEventAsClass, createEventAsDict, createEventAsNamedTuple, e, namedTupleClass

26 :member-order: bysource

27

29 :members:

30 :inherited-members:

31 :exclude-members: DEVICE_ID_INDEX, filter_id, device_id, NUMPY_DTYPE, BASE_EVENT_MAX_ATTRIBUTE_INDEX, CLASS_ATTRIBUTE_NAMES, EVENT_CONFIDENCE_INTERVAL_INDEX, EVENT_DELAY_INDEX, EVENT_DEVICE_TIME_INDEX, EVENT_EXPERIMENT_ID_INDEX, EVENT_FILTER_ID_INDEX, EVENT_HUB_TIME_INDEX, EVENT_ID_INDEX, EVENT_LOGGED_TIME_INDEX, EVENT_SESSION_ID_INDEX, EVENT_TYPE_ID, EVENT_TYPE_ID_INDEX, EVENT_TYPE_STRING, IOHUB_DATA_TABLE, PARENT_DEVICE, createEventAsClass, createEventAsDict, createEventAsNamedTuple, e, namedTupleClass

32 :member-order: bysource

33

35 :members:

36 :inherited-members:

37 :exclude-members: DEVICE_ID_INDEX, filter_id, device_id, NUMPY_DTYPE, BASE_EVENT_MAX_ATTRIBUTE_INDEX, CLASS_ATTRIBUTE_NAMES, EVENT_CONFIDENCE_INTERVAL_INDEX, EVENT_DELAY_INDEX, EVENT_DEVICE_TIME_INDEX, EVENT_EXPERIMENT_ID_INDEX, EVENT_FILTER_ID_INDEX, EVENT_HUB_TIME_INDEX, EVENT_ID_INDEX, EVENT_LOGGED_TIME_INDEX, EVENT_SESSION_ID_INDEX, EVENT_TYPE_ID, EVENT_TYPE_ID_INDEX, EVENT_TYPE_STRING, IOHUB_DATA_TABLE, PARENT_DEVICE, createEventAsClass, createEventAsDict, createEventAsNamedTuple, e, namedTupleClass

38 :member-order: bysource

39

pad.py (https://github.com/beancount/beancount.git) Python · 171 lines

19

20

21 PadError = collections.namedtuple('PadError', 'source message entry')

22

23

resource_policies.py (https://github.com/awslabs/serverless-application-model.git) Python · 200 lines

1 from enum import Enum

2 from collections import namedtuple

3

4 from six import string_types

7 from samtranslator.model.exceptions import InvalidTemplateException

8

9 PolicyEntry = namedtuple("PolicyEntry", "data type")

10

11

45 Iterator method that "yields" the next policy entry on subsequent calls to this method.

46

47 :yields namedtuple("data", "type"): Yields a named tuple containing the policy data and its type

48 """

49

bh_plugin.py (https://github.com/facelessuser/BracketHighlighter.git) Python · 198 lines

9 from os.path import normpath, join

10 import imp

11 from collections import namedtuple

12 import sys

13 import traceback

32

33

34 class BracketRegion (namedtuple('BracketRegion', ['begin', 'end'], verbose=False)):

35 """Bracket regions for plugins."""

36

test_hg_access.py (https://gitlab.com/b_perraudin_catie/yotta) Python · 72 lines

9 import unittest

10 import os

11 from collections import namedtuple

12

13 # hgapi, pip install hgapi, python api to hg command, "Do whatever you want,

55

56 def test_installDeps(self):

57 Args = namedtuple('Args', ['component', 'target', 'act_globally', 'install_linked', 'install_test_deps', 'config'])

58 install.installComponent(Args(Test_Deps_Name, Test_Deps_Target, False, False, 'own', {}))

59

isolated.py (https://github.com/tox-dev/tox.git) Python · 149 lines

3 import json

4 import os

5 from collections import namedtuple

6

7 import six

13 from tox.constants import BUILD_ISOLATED, BUILD_REQUIRE_SCRIPT

14

15 BuildInfo = namedtuple(

16 "BuildInfo",

17 ["requires", "backend_module", "backend_object", "backend_paths"],

intellisense_registry.py (https://github.com/ninja-ide/ninja-ide.git) Python · 168 lines

18 import time

19 import abc

20 from collections import namedtuple

21 from collections import Callable

22

30 logger = NinjaLogger(__name__)

31

32 CodeInfo = namedtuple("CodeInfo", "pservice source line col path")

33

34

extractors.py (https://github.com/Microsoft/Recognizers-Text.git) Python · 224 lines

1 from typing import Pattern, List, NamedTuple

2

3 from recognizers_text.utilities import RegExpUtility

74 @property

75 def regexes(self) -> List[

76 NamedTuple('re_val', [('re', Pattern), ('val', str)])]:

77 return self.__regexes

78

119 @property

120 def regexes(self) -> List[

121 NamedTuple('re_val', [('re', Pattern), ('val', str)])]:

122 return self.__regexes

123

164 @property

165 def regexes(self) -> List[

166 NamedTuple('re_val', [('re', Pattern), ('val', str)])]:

167 return self.__regexes

168

__init__.py (https://github.com/mantidproject/mantid.git) Python · 127 lines

18 """

19 # std imports

20 from collections import namedtuple

21 import os

22 import sys

29

30 # Type to hold properties for additional QMainWindow instances

31 WindowConfig = namedtuple("WindowConfig", ("parent", "flags"))

32

33 # -----------------------------------------------------------------------------

frontpage_sources.py (https://github.com/veekun/spline.git) Python · 101 lines

1 from collections import namedtuple

2 import datetime

3

11 from splinext.frontpage.sources import Source

12

13 FrontPageThread = namedtuple('FrontPageThread', ['source', 'time', 'post'])

14 class ForumSource(Source):

15 """Represents a forum whose threads are put on the front page.

71 return updates

72

73 FrontPageActivity = namedtuple('FrontPageActivity', ['template', 'threads'])

74 def forum_activity(*args, **kwargs):

75 """Show recently-active threads on the front page.

get_configuration_files.py (https://github.com/duckietown/Software.git) Python · 159 lines

1 from collections import namedtuple

2 import os

3

11 SUFFIX = '.config.yaml'

12

13 ConfigInfo = namedtuple('ConfigInfo',

14 'filename package_name node_name config_name date_effective description extends values '

15 'valid error_if_invalid ')

util.cr (https://github.com/veelenga/ameba.git) Crystal · 154 lines

21 when Crystal::HashLiteral

22 node.entries.all? { |entry| literal?(entry.key) && literal?(entry.value) }

23 when Crystal::NamedTupleLiteral

24 node.entries.all? { |entry| literal?(entry.value) }

25 else

31 # This method uses `node.location` and `node.end_location`

32 # to determine and cut a piece of source of the node.

33 def node_source(node, code_lines)

34 loc, end_loc = node.location, node.end_location

35

testable.py (https://github.com/hyperledger/indy-plenum.git) Python · 158 lines

2 import time

3 from functools import wraps

4 from typing import Any, List, NamedTuple, Tuple, Optional, Iterable, Union, \

5 Callable

6 from typing import Dict

17 logger = getlogger()

18

19 Entry = NamedTuple('Entry', [('starttime', float),

20 ('endtime', float),

21 ('method', str),

gen_model_ops.py (https://github.com/nimeshabuddhika/Tensorflow-Chatbot.git) Python · 333 lines

160

161 _tree_ensemble_serialize_outputs = ["stamp_token", "tree_ensemble_config"]

162 _TreeEnsembleSerializeOutput = _collections.namedtuple(

163 "TreeEnsembleSerialize", _tree_ensemble_serialize_outputs)

164

resources.py (https://github.com/dagster-io/dagster.git) Python · 140 lines

1 from collections import namedtuple

2

3 import sqlalchemy

5 from dagster import Field, IntSource, StringSource, resource

6

7 DbInfo = namedtuple("DbInfo", "engine url jdbc_url dialect load_table host db_name")

8

9

finders.py (https://github.com/dimagi/commcare-hq.git) Python · 128 lines

1 from collections import namedtuple

2 from functools import partial

3

8

9 from corehq.motech.finders import MATCH_FUNCTIONS, MATCH_TYPE_EXACT

10 from corehq.motech.value_source import deserialize, get_value

11

12 CandidateScore = namedtuple('CandidateScore', 'candidate score')

30 def attr_type_id_value_source_by_case_property(self):

31 return {

32 value_source["case_property"]: (attr_type_id, value_source)

33 for attr_type_id, value_source in self.case_config.attributes.items()

95 for property_weight in self.property_weights:

96 case_property = property_weight['case_property']

97 (attr_type_id, value_source_config) = self.attr_type_id_value_source_by_case_property[case_property]

98

99 candidate_value = get_tei_attr(candidate, attr_type_id)

extract_gpl5175_info.py (https://gitlab.com/kmeyer/cns-count-analyses) Python · 70 lines

5 """

6 import re

7 from collections import namedtuple

8

9 MAssignment = namedtuple("MAssignment",

generate_tfrecord.py (https://github.com/Microsoft/AdaptiveCards.git) Python · 134 lines

19 import io

20 import os

21 from collections import namedtuple

22

23 import pandas as pd

118 path = os.path.join(FLAGS.image_dir)

119 examples = pd.read_csv(FLAGS.csv_input)

120 data = namedtuple("data", ["filename", "object"])

121 gb = examples.groupby("filename")

122 grouped = [data(filename, gb.get_group(x))

expressions.py (https://github.com/ramalho/kaminpy.git) Python · 189 lines

105

106

107 Operator = collections.namedtuple("Operator", "symbol function")

108

109 OPERATORS = [

make_css_property_instances.py (https://github.com/chromium/chromium.git) Python · 93 lines

7 import template_expander

8

9 from collections import namedtuple

10 from core.css import css_properties

11

12

13 class PropertyClassData(

14 namedtuple(

15 'PropertyClassData',

16 'enum_key,enum_value,property_id,classname,namespace_group,filename'

gen_resampler_ops.py (https://github.com/ryfeus/lambda-packs.git) Python · 167 lines

56

57 _resampler_grad_outputs = ["grad_data", "grad_warp"]

58 _ResamplerGradOutput = _collections.namedtuple(

59 "ResamplerGrad", _resampler_grad_outputs)

60

EXAC1.jl (https://github.com/NREL/PowerSystems.jl.git) Julia · 220 lines

9 Ka::Float64

10 Ta::Float64

11 Vr_lim::NamedTuple{(:min, :max), Tuple{Float64, Float64}}

12 Te::Float64

13 Kf::Float64

37 - `Ka::Float64`: Regulator output gain, validation range: `(0, 1000)`

38 - `Ta::Float64`: Regulator output time constant in s, validation range: `(0, 10)`, action if invalid: `warn`

39 - `Vr_lim::NamedTuple{(:min, :max), Tuple{Float64, Float64}}`: Limits for regulator output `(Vr_min, Vr_max)`

40 - `Te::Float64`: Exciter field time constant in s, validation range: `(eps(), 2)`, action if invalid: `error`

41 - `Kf::Float64`: Rate feedback excitation system stabilizer gain, validation range: `(0, 0.3)`, action if invalid: `warn`

71 Ta::Float64

72 "Limits for regulator output `(Vr_min, Vr_max)`"

73 Vr_lim::NamedTuple{(:min, :max), Tuple{Float64, Float64}}

74 "Exciter field time constant in s"

75 Te::Float64

monsoon_profiler.py (https://gitlab.com/jonnialva90/iridium-browser) Python · 97 lines

6

7 http://msoon.com/LabEquipment/PowerMonitor/

8 Data collected is a namedtuple of (amps, volts), at 5000 samples/second.

9 Output graph plots power in watts over time in seconds.

10 """

cfml_view.py (https://github.com/jcberquist/sublimetext-cfml.git) Python · 267 lines

2 import sublime

3 from collections import defaultdict

4 from collections import namedtuple

5 from . import utils

6 from . import buffer_metadata

7

8 CompletionList = namedtuple(

9 "CompletionList", "completions priority exclude_lower_priority"

10 )

11 Documentation = namedtuple(

12 "Documentation", "doc_regions doc_html_variables on_navigate priority"

13 )

__init__.py (https://gitlab.com/ztane/sqlalchemy) Python · 45 lines

7 from .compat import callable, cmp, reduce, \

8 threading, py3k, py33, py2k, jython, pypy, cpython, win32, \

9 pickle, dottedgetter, parse_qsl, namedtuple, next, reraise, \

10 raise_from_cause, text_type, string_types, int_types, binary_type, \

11 quote_plus, with_metaclass, print_, itertools_filterfalse, u, ue, b,\

descriptorTest.ml (https://github.com/facebook/pyre-check.git) OCaml · 650 lines

483 assert_type_errors

484 {|

485 from typing import NamedTuple

486

487 class Descriptor:

489 return 1

490

491 class N(NamedTuple):

492 value: Descriptor = Descriptor()

493