100+ results results for 'namedtuple _source' (40 ms)
11 12GeneratedField = collections.namedtuple('GeneratedField', [ 13 'value', 344 def __init__(self, context): 345 self._source_path_set_generator = SourcePathSetGenerator(context) 346 self._flag_generator = StringGenerator() 358 flag_lists.append([]) 359 self._source_path_set_generator.add_sample(base_path, source_paths) 360 for flags in flag_lists: 365 def generate(self, base_path): 366 source_paths = self._source_path_set_generator.generate(base_path) 367 output = [self._generate_source_with_flags(base_path, sp) 370 371 def _generate_source_with_flags(self, base_path, source_path): 372 flag_count = weighted_choice(self._flag_counts)transformer_monotonic_attention.py https://gitlab.com/lwd17/enhanced_examplar_ae | Python | 302 lines
5 6from typing import Dict, List, NamedTuple, Optional 7 28 29DEFAULT_MAX_SOURCE_POSITIONS = 1024 30DEFAULT_MAX_TARGET_POSITIONS = 1024 33 34TransformerMonotonicDecoderOut = NamedTuple( 35 "TransformerMonotonicDecoderOut",test_shim.py https://gitlab.com/unofficial-mirrors/edx-platform | Python | 320 lines
2 3from collections import namedtuple 4 68 'username': sentinel.username, 69 'event_source': 'server', 70 'time': FROZEN_TIME, 91 'username': '', 92 'event_source': 'server', 93 'time': FROZEN_TIME, 225 226SequenceDDT = namedtuple('SequenceDDT', ['action', 'tab_count', 'current_tab', 'legacy_event_type']) 227__init__.py https://github.com/phw/picard.git | Python | 300 lines
27 deque, 28 namedtuple, 29) 66 67AcoustIDTask = namedtuple('AcoustIDTask', ('file', 'next_func')) 68 108 recordings = result.get('recordings') or [] 109 max_sources = max([r.get('sources', 1) for r in recordings] + [1]) 110 result_score = get_score(result) 115 # recording relative to other recordings in this result 116 score = recording.get('sources', 1) / max_sources * 100 117 parsed_recording['score'] = score * result_scorescript_helper.py https://github.com/albertz/CPython.git | Python | 268 lines
55 56class _PythonRunResult(collections.namedtuple("_PythonRunResult", 57 ("rc", "out", "err"))): 234 235def make_pkg(pkg_dir, init_source=''): 236 os.mkdir(pkg_dir) 236 os.mkdir(pkg_dir) 237 make_script(pkg_dir, '__init__', init_source) 238sources.py https://github.com/briot/geneapro.git | Python | 158 lines
12 13CitationDetails = collections.namedtuple( 14 'CitationDetails', 'name value fromHigh') 43 44 def fetch_higher_sources(self): 45 """ 50 51 logger.debug('SourceSet.fetch_higher_sources') 52 with django.db.connection.cursor() as cur: 55 "WITH RECURSIVE higher(source_id, parent) AS (" 56 "SELECT id, higher_source_id FROM source " 57 "WHERE higher_source_id IS NOT NULL " 58 "UNION " 59 "SELECT higher.source_id, source.higher_source_id " 60 "FROM source, higher "makedeps.py https://github.com/shkolnik/HandBrake.git | Python | 116 lines
5 6DepEntry = collections.namedtuple('DepEntry', 'widget dep enable die hide') 7dep_map = ( 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
18import unittest 19from collections import namedtuple 20from mock import patch, MagicMock 68 toolchain.config_file = "junk" 69 toolchain.compile_sources(res) 70 83 app_config = "app_config" 84 mock_target = namedtuple("Target", 85 "init_hooks name features core")(lambda _, __ : None, 86 "Junk", [], "Cortex-M3") 87 mock_config_init.return_value = namedtuple( 88 "Config", "target has_regions name")(mock_target, False, None) 103 """ 104 mock_target = namedtuple("Target", 105 "init_hooks name features core")(lambda _, __ : None,__init__.py https://github.com/SavinaRoja/OpenAccess_EPUB.git | Python | 349 lines
16#Standard Library modules 17from collections import namedtuple 18import logging 30 31navpoint = namedtuple('navpoint', 'id, label, playOrder, source, children') 32 96 title_label = self.article.publisher.nav_title() 97 title_source = 'main.{0}.xhtml#title'.format(self.article_doi) 98 title_navpoint = navpoint(title_id, title_label, self.play_order, 98 title_navpoint = navpoint(title_id, title_label, self.play_order, 99 title_source, []) 100 self.nav.append(title_navpoint) 117 ref_label = 'References' 118 ref_source = 'biblio.{0}.xhtml#references'.format(self.article_doi) 119 ref_navpoint = navpoint(ref_id, ref_label, self.play_order,io.py https://gitlab.com/alvinahmadov2/mxnet | Python | 410 lines
5from __future__ import absolute_import 6from collections import namedtuple, OrderedDict 7 95 96DataBatch = namedtuple('DataBatch', ['data', 'label', 'pad', 'index']) 97 163 self.data_list = [x[1] for x in self.data] + [x[1] for x in self.label] 164 self.num_source = len(self.data_list) 165 214 215 def _getdata(self, data_source): 216 """Load data from underlying arrays, internal use only""" 218 if self.cursor + self.batch_size <= self.num_data: 219 return [array(x[1][self.cursor:self.cursor+self.batch_size]) for x in data_source] 220 else:api.py https://gitlab.com/pierreEffiScience/TwitterClustering | Python | 321 lines
12import subprocess 13from collections import namedtuple 14 91 for w in self._words: 92 s += '"%s_source" [label="%s"] \n' % (w, w) 93 98 for u,v in self._alignment: 99 s += '"%s_source" -- "%s_target" \n' % (self._words[u] , self._mots[v] ) 100 102 for i in range(len(self._words)-1) : 103 s += '"%s_source" -- "%s_source" [style=invis]\n' % (self._words[i] , self._words[i+1]) 104 109 # Put it in the same rank 110 s += '{rank = same; %s}\n' % (' '.join('"%s_source"' % w for w in self._words)) 111 s += '{rank = same; %s}\n' % (' '.join('"%s_target"' % w for w in self._mots))engine_initializer.py https://gitlab.com/Ivy001/pants | Python | 136 lines
8import logging 9from collections import namedtuple 10 53 aliases['jvm_app'] = JvmAppAdaptor 54 aliases['remote_sources'] = RemoteSourcesAdaptor 55 for alias in ('python_library', 'python_tests', 'python_binary'): 60 61class LegacyGraphHelper(namedtuple('LegacyGraphHelper', ['scheduler', 'engine', 'symbol_table_cls'])): 62 """A container for the components necessary to construct a legacy BuildGraph facade."""pkgutil.py https://github.com/albertz/CPython.git | Python | 637 lines
2 3from collections import namedtuple 4from functools import singledispatch as simplegeneric 21 22ModuleInfo = namedtuple('ModuleInfo', 'module_finder name ispkg') 23ModuleInfo.__doc__ = 'A namedtuple with minimal info about a module.' 299 mod_type = self.etc[2] 300 if mod_type==imp.PY_SOURCE: 301 self.file = open(self.filename, 'r') 320 mod_type = self.etc[2] 321 if mod_type==imp.PY_SOURCE: 322 source = self.get_source(fullname) 333 334 def get_source(self, fullname=None): 335 fullname = self._fix_name(fullname)dis.py https://github.com/albertz/CPython.git | Python | 535 lines
183 184_Instruction = collections.namedtuple("_Instruction", 185 "opname opcode arg argval argrepr offset starts_line is_jump_target") 304 305 Generates a sequence of Instruction namedtuples giving the details of each 306 opcode. Additional information about the code's runtime environment 390 line_offset=line_offset): 391 new_source_line = (show_lineno and 392 instr.starts_line is not None andpants_run_integration_test.py https://gitlab.com/Ivy001/pants | Python | 333 lines
11import unittest 12from collections import namedtuple 13from contextlib import contextmanager 25 26PantsResult = namedtuple( 27 'PantsResult', 106 107 def temporary_sourcedir(self): 108 return temporary_dir(root_dir=get_buildroot()) 111 def source_clone(self, source_dir): 112 with self.temporary_sourcedir() as clone_dir: 113 target_spec_dir = os.path.relpath(clone_dir)source_root.py https://gitlab.com/Ivy001/pants | Python | 356 lines
17 18SourceRoot = namedtuple('_SourceRoot', ['path', 'langs']) 19 53 54 Non-test code should not instantiate directly. See SourceRootConfig.get_source_roots(). 55 """ 56 self._trie = source_root_config.create_trie() 57 self._source_root_factory = source_root_config.source_root_factory 58 self._options = source_root_config.get_options() 59 60 def add_source_root(self, path, langs=tuple()): 61 """Add the specified fixed source root, which must be relative to the buildroot. 165 166 _DEFAULT_SOURCE_ROOT_PATTERNS = [ 167 '3rdparty/*',pyproject.py https://gitlab.com/phongphans61/machine-learning-tictactoe | Python | 183 lines
1import os 2from collections import namedtuple 3from typing import Any, List, Optional 18 19def make_pyproject_path(unpacked_source_directory): 20 # type: (str) -> str 20 # type: (str) -> str 21 return os.path.join(unpacked_source_directory, 'pyproject.toml') 22 23 24BuildSystemDetails = namedtuple('BuildSystemDetails', [ 25 'requires', 'backend', 'check', 'backend_path'sync.py https://gitlab.com/JigmeDatse/synapse | Python | 1131 lines
32 33SyncConfig = collections.namedtuple("SyncConfig", [ 34 "user", 40 41class TimelineBatch(collections.namedtuple("TimelineBatch", [ 42 "prev_batch", 138 self.presence_handler = hs.get_presence_handler() 139 self.event_sources = hs.get_event_sources() 140 self.clock = hs.get_clock() 224 225 typing_source = self.event_sources.sources["typing"] 226 typing, typing_key = yield typing_source.get_new_events( 247 248 receipt_source = self.event_sources.sources["receipt"] 249 receipts, receipt_key = yield receipt_source.get_new_events(notifier.py https://gitlab.com/JigmeDatse/synapse | Python | 533 lines
26 27from collections import namedtuple 28 127 128class EventStreamResult(namedtuple("EventStreamResult", ("events", "tokens"))): 129 def __nonzero__(self): 146 147 self.event_sources = hs.get_event_sources() 148 self.store = hs.get_datastore() 297 appservice = yield self.store.get_app_service_by_user_id(user_id) 298 current_token = yield self.event_sources.get_current_token() 299 if room_ids is None: 365 if not from_token: 366 from_token = yield self.event_sources.get_current_token() 367poolmanager.py https://github.com/shazow/urllib3.git | Python | 623 lines
10 Mapping, 11 NamedTuple, 12 Optional, 66 67class PoolKey(NamedTuple): 68 """ 80 key_block: Optional[bool] 81 key_source_address: Optional[Tuple[str, int]] 82 key_key_file: Optional[str] 116 :param key_class: 117 The class to use when constructing the key. This should be a namedtuple 118 with the ``scheme`` and ``host`` keys at a minimum. 118 with the ``scheme`` and ``host`` keys at a minimum. 119 :type key_class: namedtuple 120 :param request_context:ipython_widget.py https://gitlab.com/pooja043/Globus_Docker_4 | Python | 603 lines
10# Standard library imports 11from collections import namedtuple 12import os.path 41# Base path for most payload sources. 42zmq_shell_source = 'IPython.kernel.zmq.zmqshell.ZMQInteractiveShell' 43 107 # IPythonWidget protected class variables. 108 _PromptBlock = namedtuple('_PromptBlock', ['block', 'length', 'number']) 109 _payload_source_edit = 'edit_magic' 109 _payload_source_edit = 'edit_magic' 110 _payload_source_exit = 'ask_exit' 111 _payload_source_next_input = 'set_next_input' 111 _payload_source_next_input = 'set_next_input' 112 _payload_source_page = 'page' 113 _retrying_history_request = Falsepoolmanager.py https://gitlab.com/abhi1tb/build | Python | 470 lines
42 "key_block", # bool 43 "key_source_address", # str 44 "key_key_file", # str 62 63#: The namedtuple class used to construct keys for the connection pool. 64#: All custom key schemes should include the fields in this key at a minimum. 64#: All custom key schemes should include the fields in this key at a minimum. 65PoolKey = collections.namedtuple("PoolKey", _key_fields) 66 77 :param key_class: 78 The class to use when constructing the key. This should be a namedtuple 79 with the ``scheme`` and ``host`` keys at a minimum. 79 with the ``scheme`` and ``host`` keys at a minimum. 80 :type key_class: namedtuple 81 :param request_context:s3handler.py https://gitlab.com/github-cloud-corp/aws-cli | Python | 535 lines
12# language governing permissions and limitations under the License. 13from collections import namedtuple 14import logging 30 31CommandResult = namedtuple('CommandResult', 32 ['num_tasks_failed', 'num_tasks_warned']) 57 'dryrun': False, 'quiet': False, 'acl': None, 58 'guess_mime_type': True, 'sse_c_copy_source': None, 59 'sse_c_copy_source_key': None, 'sse': None,tasks.py https://github.com/dimagi/commcare-hq.git | Python | 387 lines
1from collections import namedtuple 2from typing import Generator, List 29 30ParentInfo = namedtuple( 31 'ParentInfo', 272 } 273 for value_source in resource_type.iter_case_property_value_sources(): 274 value = value_source.get_import_value(resource) 275 if value is not None: 276 if value_source.case_property in name_properties: 277 kwargs['case_name'] = value 278 else: 279 kwargs['update'][value_source.case_property] = value 280 return kwargskunit_kernel.py https://github.com/kvaneesh/linux.git | Python | 342 lines
18 19from collections import namedtuple 20 198 199def get_source_tree_ops(arch: str, cross_compile: Optional[str]) -> LinuxSourceTreeOperations: 200 config_path = os.path.join(QEMU_CONFIGS_DIR, arch + '.py') 203 elif os.path.isfile(config_path): 204 return get_source_tree_ops_from_qemu_config(config_path, cross_compile)[1] 205 else: 207 208def get_source_tree_ops_from_qemu_config(config_path: str, 209 cross_compile: Optional[str]) -> Tuple[ 241 if qemu_config_path: 242 self._arch, self._ops = get_source_tree_ops_from_qemu_config( 243 qemu_config_path, cross_compile)ipython_widget.py https://github.com/tinyclues/ipython.git | Python | 549 lines
9# Standard library imports 10from collections import namedtuple 11import os.path 40# Base path for most payload sources. 41zmq_shell_source = 'IPython.zmq.zmqshell.ZMQInteractiveShell' 42 103 _PromptBlock = namedtuple('_PromptBlock', ['block', 'length', 'number']) 104 _payload_source_edit = zmq_shell_source + '.edit_magic' 105 _payload_source_exit = zmq_shell_source + '.ask_exit' 105 _payload_source_exit = zmq_shell_source + '.ask_exit' 106 _payload_source_next_input = zmq_shell_source + '.set_next_input' 107 _payload_source_page = 'IPython.zmq.page.page' 118 self._payload_handlers = { 119 self._payload_source_edit : self._handle_payload_edit, 120 self._payload_source_exit : self._handle_payload_exit,tableview.py https://github.com/kazcw/miro.git | Python | 1223 lines
38import gtk 39from collections import namedtuple 40 61 62PathInfo = namedtuple('PathInfo', 'path column x y') 63Rect = namedtuple('Rect', 'x y width height') 325 cr = expose_event.window.cairo_create() 326 cr.set_source_rgb(*self.group_line_color) 327 first_column = self.get_columns()[0]layers.py https://gitlab.com/lwd17/enhanced_examplar_ae | Python | 600 lines
6import math 7from collections import namedtuple 8 20 21EncoderOut = namedtuple( 22 "TransformerEncoderOut", 37 self.dropout = args.dropout 38 self.max_source_positions = args.max_source_positions 39 self.embed_tokens = embed_tokens 48 PositionalEmbedding( 49 args.max_source_positions, 50 embed_dim,get_bitext.py https://gitlab.com/lwd17/enhanced_examplar_ae | Python | 254 lines
9import os.path as op 10from collections import namedtuple 11from multiprocessing import cpu_count 58def pretokenize(in_path: str, out_path: str, src: str, tgt: str): 59 Args = namedtuple( 60 "Args", 61 [ 62 "moses_source_lang", 63 "moses_target_lang", 68 args = Args( 69 moses_source_lang=src, 70 moses_target_lang=tgt, 101def _apply_bbpe(model_path: str, in_path: str, out_path: str): 102 Args = namedtuple("Args", ["sentencepiece_model_path"]) 103 args = Args(sentencepiece_model_path=model_path)ipython_widget.py https://github.com/cboos/ipython.git | Python | 563 lines
9# Standard library imports 10from collections import namedtuple 11import os.path 40# Base path for most payload sources. 41zmq_shell_source = 'IPython.zmq.zmqshell.ZMQInteractiveShell' 42 103 _PromptBlock = namedtuple('_PromptBlock', ['block', 'length', 'number']) 104 _payload_source_edit = zmq_shell_source + '.edit_magic' 105 _payload_source_exit = zmq_shell_source + '.ask_exit' 105 _payload_source_exit = zmq_shell_source + '.ask_exit' 106 _payload_source_next_input = zmq_shell_source + '.set_next_input' 107 _payload_source_page = 'IPython.zmq.page.page' 118 self._payload_handlers = { 119 self._payload_source_edit : self._handle_payload_edit, 120 self._payload_source_exit : self._handle_payload_exit,wrappers.html https://bitbucket.org/aguang/biolite.git | HTML | 441 lines
21 FILE_SUFFIX: '.html', 22 HAS_SOURCE: true 23 }; 80 81<span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">namedtuple</span> 82workflows.html https://bitbucket.org/aguang/biolite.git | HTML | 399 lines
21 FILE_SUFFIX: '.html', 22 HAS_SOURCE: true 23 }; 90<span class="kn">from</span> <span class="nn">Bio</span> <span class="kn">import</span> <span class="n">SeqIO</span> 91<span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">namedtuple</span><span class="p">,</span> <span class="n">OrderedDict</span> 92 100 101<span class="n">ContigHeader</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s">'ContigHeader'</span><span class="p">,</span> <span class="s">"locus transcript confidence length"</span><span class="p">)</span> 102<span class="sd">"""</span> 102<span class="sd">"""</span> 103<span class="sd">A namedtuple for storing the information from a transcript header.</span> 104<span class="sd">"""</span>__init__.py https://gitlab.com/jonnialva90/iridium-browser | Python | 288 lines
21 22DIR_SOURCE_ROOT = os.environ.get('CHECKOUT_SOURCE_ROOT', 23 os.path.abspath(os.path.join(os.path.dirname(__file__), 25 26PackageInfo = collections.namedtuple('PackageInfo', 27 ['package', 'activity', 'cmdline_file', 'devtools_socket', 150 151PERF_OUTPUT_DIR = os.path.join(DIR_SOURCE_ROOT, 'out', 'step_results') 152# The directory on the device where perf test output gets saved to. 155 156SCREENSHOTS_DIR = os.path.join(DIR_SOURCE_ROOT, 'out_screenshots') 157 159ANDROID_SDK_BUILD_TOOLS_VERSION = '23.0.0' 160ANDROID_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 161 'third_party/android_tools/sdk')http_api.md https://gitlab.com/hrishikeshvganu/tensorflow | Markdown | 344 lines
137 138CompressedHistogramValues is a list of namedtuples with each tuple specifying 139a basis point (bps) as well as an interpolated value of the histogram value 309 node_stats { 310 node_name: "_SOURCE" 311 all_start_micros: 1458337695775395 317 } 318 timeline_label: "_SOURCE = NoOp()" 319 scheduled_micros: 1458337695775363recessive.py https://bitbucket.org/marcelm/exomate.git | Python | 180 lines
10from exomate.variants import VARIANT_OUT_NAMES, EXON_VARIANTS 11from collections import defaultdict, namedtuple 12from sqlalchemy import not_ , or_ 23 warning = get_incomplete_annotation_warning() 24 known_sources = session.query(KnownSource).all() 25 return render_template('recessive-query.html', 26 samples=samples, 27 known_sources=known_sources, 28 warning=warning, 32 q = parse_mutation_query_parameters(request.form) 33 q.known_sources = session.query(KnownSource).filter(KnownSource.id.in_(q.ks)).all() if q.ks else [] 34 61 # grouping (call/annotation)s 62 CallAnnotation = namedtuple("CallAnnotation", "call annotation bed") 63 for call, annotation in mutations:_import.py https://gitlab.com/freesoftware/rethinkdb | Python | 1155 lines
29 30Error = collections.namedtuple("Error", ["message", "traceback", "file"]) 31 48 49 _source = None # open filehandle for the source 50 80 # Python2.x or binary file, assume utf-8 encoding 81 self._source = codecs.getreader("utf-8")(source) 82 else: 90 91 if hasattr(self._source, 'name') and self._source.name and os.path.isfile(self._source.name): 92 self._bytes_size.value = os.path.getsize(source) 106 # name 107 if hasattr(self._source, 'name') and self._source.name: 108 self.name = os.path.basename(self._source.name)analyze.py https://gitlab.com/williamwp/riscv-rv32x-llvm | Python | 780 lines
33from libscanbuild.report import document 34from libscanbuild.compilation import split_command, classify_source, \ 35 compiler_language 127 ctu_config = json.loads(ctu_conf_json) 128 # Recover namedtuple from json when coming from analyze-cc or analyze-c++ 129 return CtuConfig(collect=ctu_config[0],poolmanager.py https://gitlab.com/phongphans61/machine-learning-tictactoe | Python | 536 lines
48 "key_block", # bool 49 "key_source_address", # str 50 "key_key_file", # str 69 70#: The namedtuple class used to construct keys for the connection pool. 71#: All custom key schemes should include the fields in this key at a minimum. 71#: All custom key schemes should include the fields in this key at a minimum. 72PoolKey = collections.namedtuple("PoolKey", _key_fields) 73 74_proxy_config_fields = ("ssl_context", "use_forwarding_for_https") 75ProxyConfig = collections.namedtuple("ProxyConfig", _proxy_config_fields) 76 87 :param key_class: 88 The class to use when constructing the key. This should be a namedtuple 89 with the ``scheme`` and ``host`` keys at a minimum.collector.py https://gitlab.com/phongphans61/machine-learning-tictactoe | Python | 556 lines
1""" 2The main purpose of this module is to expose LinkCollector.collect_sources(). 3""" 21 MutableMapping, 22 NamedTuple, 23 Optional, 40 41from .sources import CandidatesFromPage, LinkSource, build_source 42 451 452class CollectedSources(NamedTuple): 453 find_links: Sequence[Optional[LinkSource]]scrooge_gen.py https://gitlab.com/Ivy001/pants | Python | 267 lines
10import tempfile 11from collections import defaultdict, namedtuple 12 23 24from pants.contrib.scrooge.tasks.thrift_util import calculate_compile_sources 25 31 32 DepInfo = namedtuple('DepInfo', ['service', 'structs']) 33 PartialCmd = namedtuple('PartialCmd', ['language', 'rpc_style', 'namespace_map']) 127 self._validate_compiler_configs([target]) 128 self._must_have_sources(target) 129 137 def gen(self, partial_cmd, target, target_workdir): 138 import_paths, _ = calculate_compile_sources([target], self.is_gentarget) 139api.py https://github.com/nltk/nltk.git | Python | 334 lines
11import subprocess 12from collections import namedtuple 13 92 for w in self._words: 93 s += f'"{w}_source" [label="{w}"] \n' 94 99 for u, v in self._alignment: 100 s += f'"{self._words[u]}_source" -- "{self._mots[v]}_target" \n' 101 103 for i in range(len(self._words) - 1): 104 s += '"{}_source" -- "{}_source" [style=invis]\n'.format( 105 self._words[i], 116 # Put it in the same rank 117 s += "{rank = same; %s}\n" % (" ".join('"%s_source"' % w for w in self._words)) 118 s += "{rank = same; %s}\n" % (" ".join('"%s_target"' % w for w in self._mots))test_security_group.py https://gitlab.com/syjulian/poc-heat-mversion | Python | 1144 lines
36 37NovaSG = collections.namedtuple('NovaSG', 38 ' '.join([ 69 70 test_template_nova_bad_source_group = ''' 71HeatTemplateFormatVersion: '2012-12-12'checker.py https://gitlab.com/Ivy001/pants | Python | 191 lines
8import re 9from collections import namedtuple 10 25 26class LintPlugin(namedtuple('_LintPlugin', ['name', 'subsystem'])): 27 def skip(self): 42class PythonCheckStyleTask(PythonTask): 43 _PYTHON_SOURCE_EXTENSION = '.py' 44 _plugins = [] 76 def _is_checked(self, target): 77 return isinstance(target, PythonTarget) and target.has_sources(self._PYTHON_SOURCE_EXTENSION) 78 175 with self.invalidated(self.context.targets(self._is_checked)) as invalidation_check: 176 sources = self.calculate_sources([vt.target for vt in invalidation_check.invalid_vts]) 177 if sources:dvr_local_router.py https://github.com/openstack/neutron.git | Python | 924 lines
35# Tracks the arp entry cache 36Arp_entry = collections.namedtuple( 37 'Arp_entry', 'ip mac subnet_id operation') 134 floating_ip, rtr_2_fip_name, fixed_ip)) 135 to_source = '-s %s/32 -j SNAT --to-source %s' % (fixed_ip, floating_ip) 136 if self.iptables_manager.random_fully: 136 if self.iptables_manager.random_fully: 137 to_source += ' --random-fully' 138 snat_from_fixedip_to_floatingip = ('float-snat', to_source)committees.py https://github.com/mattgrayson/openstates.git | Python | 147 lines
6 7Member = collections.namedtuple("Member", "name role chamber") 8 134 committee.add_member(member.name, member.role) 135 committee.add_source(committee_url) 136 if not committee._related:diff.py https://gitlab.com/kholdfuzion/goldeneye_src | Python | 1507 lines
9 Match, 10 NamedTuple, 11 NoReturn, 395 396def maybe_get_objdump_source_flags() -> List[str]: 397 if not args.source: 494 (objdump_flags + flags1, baseimg, None), 495 (objdump_flags + flags2 + maybe_get_objdump_source_flags(), myimg, None), 496 ) 524 (objdump_flags, refobjfile, args.start), 525 (objdump_flags + maybe_get_objdump_source_flags(), objfile, args.start), 526 )jvm_dependency_usage.py https://gitlab.com/Ivy001/pants | Python | 435 lines
10import sys 11from collections import defaultdict, namedtuple 12 70 if not options.use_cached: 71 round_manager.require_data('classes_by_source') 72 round_manager.require_data('runtime_classpath') 77 round_manager.require_data('scala') 78 round_manager.require_data('deferred_sources') 79 143 node_creator = self.calculating_node_creator( 144 self.context.products.get_data('classes_by_source'), 145 self.context.products.get_data('runtime_classpath'), 153 154 def calculating_node_creator(self, classes_by_source, runtime_classpath, product_deps_by_src, 155 target_to_vts):go_buildgen.py https://gitlab.com/Ivy001/pants | Python | 459 lines
8import os 9from collections import defaultdict, namedtuple 10from textwrap import dedent 23from pants.contrib.go.targets.go_library import GoLibrary 24from pants.contrib.go.targets.go_local_source import GoLocalSource 25from pants.contrib.go.targets.go_remote_library import GoRemoteLibrary 47 self._build_graph = build_graph 48 self._local_source_root = local_root 49 self._fetcher_factory = fetcher_factory 50 self._generate_remotes = generate_remotes 51 self._remote_source_root = remote_root 52 81 name = remote_pkg_path or os.path.basename(import_path) 82 address = Address(os.path.join(self._remote_source_root, remote_root), name) 83 try:helper_functions.py https://gitlab.com/BudzikFUW/budzik_analiza | Python | 1226 lines
28from obci.analysis.obci_signal_processing import read_manager 29from obci.analysis.obci_signal_processing.signal import read_info_source, read_data_source 30from obci.analysis.obci_signal_processing.tags import read_tags_source 39 40from collections import namedtuple 41 41 42Pos = namedtuple('Pos', ['x', 'y']) 43map1020 = {'eog': Pos(0, 0), 'Fp1': Pos(1, 0), 'Fpz': Pos(2, 0), 'Fp2': Pos(3, 0), 'Null': Pos(4, 0), 362 raw2 = mne.io.RawArray(data2, raw.info) 363 scores = ica.score_sources(raw2, target = eog_chnl, l_freq = 1, h_freq = 9) 364 385 ica.plot_components(res = 128, show = False, title = title, colorbar = True) 386 ica.plot_sources(raw, show = True) 387__init__.py https://github.com/adamgreen/gcc4mbed.git | Python | 194 lines
2from os.path import sep, join, exists 3from collections import namedtuple 4from subprocess import Popen, PIPE 43 def iar_groups(self, grouped_src): 44 """Return a namedtuple of group info 45 Positional Arguments: 59 """ 60 IARgroup = namedtuple('IARgroup', ['name','files']) 61 groups = [] 87 iar_defaults.update(device_info) 88 IARdevice = namedtuple('IARdevice', iar_defaults.keys()) 89 return IARdevice(**iar_defaults) 106 srcs = self.resources.headers + self.resources.s_sources + \ 107 self.resources.c_sources + self.resources.cpp_sources + \ 108 self.resources.objects + self.resources.librariesiter_worksheet.py https://github.com/timClicks/tablib.git | Python | 348 lines
73try: 74 from collections import namedtuple 75 BaseRawCell = namedtuple('RawCell', RAW_ATTRIBUTES) 77 78 # warnings.warn("""Unable to import 'namedtuple' module, this may cause memory issues when using optimized reader. Please upgrade your Python installation to 2.6+""") 79 124 125def iter_rows(workbook_name, sheet_name, xml_source, range_string = '', row_offset = 0, column_offset = 0): 126 271 self._sheet_codename = sheet_codename 272 self._xml_source = xml_source 273 292 sheet_name = self._sheet_codename, 293 xml_source = self._xml_source, 294 range_string = range_string,decorator.py https://github.com/wxgeo/geophar.git | Python | 455 lines
51else: 52 FullArgSpec = collections.namedtuple( 53 'FullArgSpec', 'args varargs varkw defaults ' 192 if addsource: 193 attrs['__source__'] = src 194 self.update(func, **attrs) 202 evaldict is the evaluation dictionary. If addsource is true an 203 attribute __source__ is added to the result. The attributes attrs 204 are added, if any.joinmarket-qt.py https://gitlab.com/yenny.prathivi/joinmarket | Python | 1226 lines
27from functools import partial 28from collections import namedtuple 29 82 'privacy_warning': None} 83config_tips = {'blockchain_source': 84 'options: blockr, bitcoin-rpc', 87 'rpc_host': 88 'the host for bitcoind; only used if blockchain_source is bitcoin-rpc', 89 'rpc_port':test_collections.py https://gitlab.com/unofficial-mirrors/cpython | Python | 1243 lines
17 18from collections import namedtuple, Counter, OrderedDict, _count_elements 19from collections import UserDict, UserString, UserList 186 187TestNT = namedtuple('TestNT', 'x y z') # type used for pickle tests 188 188 189class TestNamedTuple(unittest.TestCase): 190 191 def test_factory(self): 192 Point = namedtuple('Point', 'x y') 193 self.assertEqual(Point.__name__, 'Point') 197 self.assertEqual(Point._fields, ('x', 'y')) 198 self.assertIn('class Point(tuple)', Point._source) 199dis.py https://gitlab.com/unofficial-mirrors/cpython | Python | 490 lines
165 166_Instruction = collections.namedtuple("_Instruction", 167 "opname opcode arg argval argrepr offset starts_line is_jump_target") 282 283 Generates a sequence of Instruction namedtuples giving the details of each 284 opcode. Additional information about the code's runtime environment 346 line_offset=line_offset): 347 new_source_line = (show_lineno and 348 instr.starts_line is not None and 349 instr.offset > 0) 350 if new_source_line: 351 print(file=file)script_helper.py https://gitlab.com/takluyver/zipfile36 | Python | 248 lines
53 54_PythonRunResult = collections.namedtuple("_PythonRunResult", 55 ("rc", "out", "err")) 214 215def make_pkg(pkg_dir, init_source=''): 216 os.mkdir(pkg_dir) 216 os.mkdir(pkg_dir) 217 make_script(pkg_dir, '__init__', init_source) 218image_process.py https://gitlab.com/janninematt/janninematt | Python | 510 lines
22 23Path = collections.namedtuple( 24 'Path', ['base_url', 'source', 'base_path', 'filename', 'process_dir'] 321 if default is not None: 322 default_source_name = default[0] 323 323 324 default_source = None 325 for s in sources: 325 for s in sources: 326 if s['name'] == default_source_name: 327 default_source = s 329 330 if default_source is None: 331 raise RuntimeError(armarx_version.py https://gitlab.com/mkroehnert/ArmarXCore | Python | 283 lines
7 8from collections import namedtuple 9 15 16Version = namedtuple('Version', ['major', 'minor', 'patch']) 17 73 for line in open(os.path.join(lines[0][:-1], 'CMakeCache.txt')): 74 if line.startswith('Project_SOURCE_DIR'): 75 return line.split('=')[-1][:-1]pelican_bibtex.py https://bitbucket.org/joshua.adelman/pelican_bibtex.git | Python | 166 lines
15 16from collections import namedtuple 17import itertools 27class BibtexParser(): 28 '''Parses a BibTeX file and populates a list of namedtuples with fields and data. 29 Each namedtuple corresponds to a publication in BibTeX file. The fields of the 29 Each namedtuple corresponds to a publication in BibTeX file. The fields of the 30 namedtuple can be set in the pelican config file, but by default all available tags 31 in the BibTeX file are made available. Additionally the namedtuple will contain a 37 ---------- 38 BIBTEX_SOURCE : str, Required 39 Path to .bib file to be parsed 40 BIBTEX_TAGS : list 41 A list of the tags that will be used to create the namedtuple. If not specified 42 all tags present in the BIBTEX_SOURCE are used.__init__.py https://gitlab.com/0072016/Facebook-SDK- | Python | 288 lines
24 25DIR_SOURCE_ROOT = os.environ.get('CHECKOUT_SOURCE_ROOT', 26 os.path.abspath(os.path.join(os.path.dirname(__file__), 28 29PackageInfo = collections.namedtuple('PackageInfo', 30 ['package', 'activity', 'cmdline_file', 'devtools_socket', 153 154PERF_OUTPUT_DIR = os.path.join(DIR_SOURCE_ROOT, 'out', 'step_results') 155# The directory on the device where perf test output gets saved to. 158 159SCREENSHOTS_DIR = os.path.join(DIR_SOURCE_ROOT, 'out_screenshots') 160 162ANDROID_SDK_BUILD_TOOLS_VERSION = '23.0.1' 163ANDROID_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 164 'third_party', 'android_tools', 'sdk')testrunner.py https://github.com/chromium/chromium.git | Python | 946 lines
5from queue import Empty 6from collections import namedtuple 7 247class _RunnerManagerState: 248 before_init = namedtuple("before_init", []) 249 initializing = namedtuple("initializing", 250 ["test", "test_group", "group_metadata", "failure_count"]) 251 running = namedtuple("running", ["test", "test_group", "group_metadata"]) 252 restarting = namedtuple("restarting", ["test", "test_group", "group_metadata", "force_stop"]) 252 restarting = namedtuple("restarting", ["test", "test_group", "group_metadata", "force_stop"]) 253 error = namedtuple("error", []) 254 stop = namedtuple("stop", ["force_stop"]) 281 282 self.test_source = test_source_cls(test_queue) 283generate_policy_source_test.py https://github.com/chromium/chromium.git | Python | 473 lines
8from unittest.mock import patch, mock_open, call 9from typing import NamedTuple 10 10 11import generate_policy_source 12import generate_policy_source_test_data as test_data 13 14from generate_policy_source import PolicyDetails 15 16 17class PolicyData(NamedTuple): 18 policy_id: int 169 self.all_target_platforms = ['win', 'mac', 'linux', 'chromeos', 'fuchsia'] 170 self.risk_tags = generate_policy_source.RiskTags(self.TEMPLATES_JSON) 171 self.policies = [analytics.py https://bitbucket.org/fernandoamat/catmaid_5d_visualization_annotation.git | Python | 265 lines
4from catmaid.models import UserRole 5from collections import namedtuple, defaultdict 6from itertools import chain, islice 7from functools import partial 8from networkx import Graph, single_source_shortest_path 9import json 130 131 Treenode = namedtuple('Treenode', ['id', 'skeleton_id']) 132 212 213 Connector = namedtuple("Connector", ['id', 'treenode_id', 'treenodes', 'skeletons']) 214 219 treenode_id = iter(c[PRE]).next().id 220 pre_treenodes = set(chain.from_iterable(single_source_shortest_path(graph, treenode_id, adjacents).values())) 221 post_skeletons = set(t.skeleton_id for t in c[POST])annotatevep.py https://bitbucket.org/marcelm/exomate.git | Python | 330 lines
17from exomate.commandline import HelpfulArgumentParser 18from collections import namedtuple, defaultdict 19from time import gmtime, strftime 30 31CSQ = namedtuple("CSQ", "allele gene feature feature_type consequence cdna_position cds_position protein_position amino_acids codons existing_variation aa_maf ea_maf exon intron motif_name motif_pos high_inf_pos motif_score_change distance clin_sig canonical symbol symbol_source sift polyphen gmaf biotype ensp domains ccds hgvsc hgvsp afr_maf amr_maf asn_maf eur_maf pubmed ") 32 32 33keys2 = ["gene", "feature", "feature_type", "consequence", "cdna_position_start", "cdna_position_stop", "cds_position_start", "cds_position_stop", "protein_position_start", "protein_position_stop", "ref_amino_acid", "alt_amino_acid", "ref_codon", "alt_codon", "existing_variation", "aa_maf", "ea_maf", "exon_number", "exon_count", "intron_number", "intron_count", "motif_score_change", "distance", "canonical", "symbol", "symbol_source", "sift_prediction_term", "sift_score", "polyphen_prediction_term", "polyphen_score", "biotype", "ensp", "domains", "ccds", "hgvsc", "hgvsp", "afr_maf", "amr_maf", "asn_maf", "eur_maf"] 34emma_coverage_stats.py https://gitlab.com/jonnialva90/iridium-browser | Python | 477 lines
34# Coverage information about a single line of code. 35LineCoverage = collections.namedtuple( 36 'LineCoverage', 100 # Child 1 contains the original line of source code. 101 _ELEMENT_CONTAINING_SOURCE_CODE = 1 102 152 # Get the original line of Java source code. 153 raw_source = tr[self._ELEMENT_CONTAINING_SOURCE_CODE].text 154 utf8_source = raw_source.encode('UTF-8') 154 utf8_source = raw_source.encode('UTF-8') 155 source = utf8_source.replace(self._NO_BREAK_SPACE, ' ') 156 237 self._emma_parser = _EmmaHtmlParser(emma_file_base_dir) 238 self._source_to_emma = self._GetSourceFileToEmmaFileDict(files_for_coverage) 239addons.py https://gitlab.com/zaverichintan/orange3 | Python | 793 lines
13from glob import iglob 14from collections import namedtuple, deque 15from xml.sax.saxutils import escape 50 51Installable = namedtuple( 52 "Installable", 60 61ReleaseUrl = namedtuple( 62 "ReleaseUrl", 70 71Available = namedtuple( 72 "Available", 75 76Installed = namedtuple( 77 "Installed",iter_worksheet.py https://github.com/DanLipsitt/tablib.git | Python | 343 lines
68try: 69 from collections import namedtuple 70 BaseRawCell = namedtuple('RawCell', RAW_ATTRIBUTES) 72 73 warnings.warn("""Unable to import 'namedtuple' module, this may cause memory issues when using optimized reader. Please upgrade your Python installation to 2.6+""") 74 119 120def iter_rows(workbook_name, sheet_name, xml_source, range_string = '', row_offset = 0, column_offset = 0): 121 266 self._sheet_codename = sheet_codename 267 self._xml_source = xml_source 268 287 sheet_name = self._sheet_codename, 288 xml_source = self._xml_source, 289 range_string = range_string,__init__.py https://bitbucket.org/sp4ke/cc-node.git | Python | 412 lines
22from xml.etree import cElementTree as et 23from collections import namedtuple 24 38 39NetworkInterface = namedtuple('NetworkInterface', ('source', 'mac', 'model')) 40 83 Tag('nic%s_mac' % i, nic.mac, 10), 84 Tag('nic%s_source' % i, nic.source, 10), 85 Tag('nic%s_model' % i, nic.model, 10),test_traceback.py https://github.com/dpritsos/WEGA.git | Python | 899 lines
2 3from collections import namedtuple 4import doctest 48 self._lines = lines 49 def get_source(self, name): 50 return self._lines 56 57test_code = namedtuple('code', ['co_filename', 'co_name']) 58test_frame = namedtuple('frame', ['f_code', 'f_globals', 'f_locals']) 58test_frame = namedtuple('frame', ['f_code', 'f_globals', 'f_locals']) 59test_tb = namedtuple('tb', ['tb_frame', 'tb_lineno', 'tb_next']) 60poolmanager.py https://github.com/dpritsos/WEGA.git | Python | 449 lines
33 'key_block', # bool 34 'key_source_address', # str 35 'key_key_file', # str 51 52#: The namedtuple class used to construct keys for the connection pool. 53#: All custom key schemes should include the fields in this key at a minimum. 53#: All custom key schemes should include the fields in this key at a minimum. 54PoolKey = collections.namedtuple('PoolKey', _key_fields) 55 66 :param key_class: 67 The class to use when constructing the key. This should be a namedtuple 68 with the ``scheme`` and ``host`` keys at a minimum. 68 with the ``scheme`` and ``host`` keys at a minimum. 69 :type key_class: namedtuple 70 :param request_context:members.py https://gitlab.com/made-financial/made-financial-scripts | Python | 189 lines
10import sys 11from collections import namedtuple 12import pandas as pd 21Payment = namedtuple('Payment', 'month payee amount source id') 22Summary = namedtuple('Summary', 'payments total by_source by_level') 23 133 summary = Summary( 134 by_source = items.groupby('source')['source'].count().items(), 135 by_level = items.groupby('amount')['amount'].count().items(), 147 out = [] 148 for source, value in summary.by_source: 149 out.append("{} by {}".format(value, sources[source]))collector.py https://gitlab.com/Eightdays/backend | Python | 610 lines
1""" 2The main purpose of this module is to expose LinkCollector.collect_sources(). 3""" 23 MutableMapping, 24 NamedTuple, 25 Optional, 43 44from .sources import CandidatesFromPage, LinkSource, build_source 45instrumentation_test_instance.py https://gitlab.com/0072016/Facebook-SDK- | Python | 644 lines
162 """ 163 ParamsTuple = collections.namedtuple('ParamsTuple', ['add', 'remove']) 164 parameterized_tests = [] 297 self._isolate_abs_path = os.path.join( 298 constants.DIR_SOURCE_ROOT, args.isolate_file_path) 299 self._isolate_delegate = isolate_delegateconnect_distributed_test.py https://gitlab.com/JHUDevOpsFall2016/kafka-alex | Python | 481 lines
25import subprocess, itertools, time 26from collections import Counter, namedtuple 27import operator 34 35 FILE_SOURCE_CONNECTOR = 'org.apache.kafka.connect.file.FileStreamSourceConnector' 36 FILE_SINK_CONNECTOR = 'org.apache.kafka.connect.file.FileStreamSinkConnector' 170 171 connector = namedtuple('BadConnector', ['name', 'tasks'])(connector_name, 1) 172 config = { 218 219 def test_pause_and_resume_source(self): 220 """ 324 @matrix(security_protocol=[SecurityConfig.PLAINTEXT, SecurityConfig.SASL_SSL]) 325 def test_file_source_and_sink(self, security_protocol): 326 """tldextract.py https://bitbucket.org/pombredanne/unstructured-data-extractor.git | Python | 232 lines
12 13`ExtractResult` is a namedtuple, so it's simple to access the parts you want. 14 166 tld_sources = (_PublicSuffixListSource,) 167 tlds = frozenset(tld for tld_source in tld_sources for tld in tld_source()) 168go_task.py https://gitlab.com/Ivy001/pants | Python | 168 lines
10import subprocess 11from collections import namedtuple 12 20from pants.contrib.go.targets.go_library import GoLibrary 21from pants.contrib.go.targets.go_local_source import GoLocalSource 22from pants.contrib.go.targets.go_remote_library import GoRemoteLibrary 119 120 class ImportListing(namedtuple('ImportListing', ['pkg_name', 121 'imports',genindex.html https://github.com/hhru/lucid-python-psycopg2.git | HTML | 948 lines
18 FILE_SUFFIX: '.html', 19 HAS_SOURCE: true 20 }; 74 <dt><a href="extras.html#index-4">dict</a></dt> 75 <dt><a href="extras.html#index-5">namedtuple</a></dt> 76 <dt><a href="usage.html#index-5">numbers</a></dt> 227 <dt><a href="advanced.html#index-0">Subclassing</a></dt> 228 <dt><a href="extras.html#index-1">namedtuple</a></dt> 229 </dl></dd>cursor.html https://github.com/hhru/lucid-python-psycopg2.git | HTML | 637 lines
18 FILE_SUFFIX: '.html', 19 HAS_SOURCE: true 20 }; 75<p>Each of these sequences is a named tuple (a regular tuple if 76<a class="reference external" href="http://docs.python.org/3.2/library/collections.html#collections.namedtuple" title="(in Python v3.2)"><tt class="xref py py-func docutils literal"><span class="pre">collections.namedtuple()</span></tt></a> is not available) containing information 77describing one result column:</p>wmi_check.py https://gitlab.com/meetly/dd-agent | Python | 285 lines
1# stdlib 2from collections import namedtuple 3 7 8WMIMetric = namedtuple('WMIMetric', ['name', 'value', 'tags']) 9 84 try: 85 link_source_property = int(wmi_obj[tag_query[0]]) 86 target_class = tag_query[1] 103 104 return target_class, target_property, [{link_target_class_property: link_source_property}] 105mutations.py https://bitbucket.org/marcelm/exomate.git | Python | 288 lines
5import os 6from collections import defaultdict, namedtuple, Counter 7from flask import request, render_template 25 sample_groups = session.query(SampleGroup).all() 26 known_sources = session.query(KnownSource).all() 27 bedfiles = [x for (x,) in session.query(distinct(BedAnnotation.accession)).all()] 30 samples=samples, 31 known_sources=known_sources, 32 warning=warning, 125 query.consequences_bits, 126 query.known_sources, 127 query.splice_dist, 143 # grouping (call/annotation)s without bedannoation 144 CallAnnotation = namedtuple("CallAnnotation", "call annotation bed") 145 for call, annotation, bed in mutations:developing_api.rst https://gitlab.com/0072016/Facebook-SDK-json- | ReStructuredText | 194 lines
42 import json 43 from collections import namedtuple 44 from ansible.parsing.dataloader import DataLoader 65 66 Options = namedtuple('Options', ['connection', 'module_path', 'forks', 'become', 'become_method', 'become_user', 'check']) 67 # initialize needed objects 80 # create play with tasks 81 play_source = dict( 82 name = "Ansible Play", 89 ) 90 play = Play().load(play_source, variable_manager=variable_manager, loader=loader) 91run_comparison.py https://gitlab.com/0072016/fbphp- | Python | 308 lines
47 48from collections import namedtuple 49from subprocess import check_call, PIPE, Popen 62 63TEST_SOURCES = ( 64 'network', 80""" Named tuple containing relevant numbers reported by a test """ 81Stats = namedtuple('Stats', [ 82 'success_wait_times', 93 parser.add_argument('-s', '--scenarios', choices=TESTS, nargs='+') 94 parser.add_argument('-d', '--sources', choices=TEST_SOURCES, nargs='+') 95 parser.add_argument('-c', '--cpu', choices=ABIS, required=True) 288 else: 289 sources = TEST_SOURCES 290__init__.py https://gitlab.com/imxiangpeng/gn-standalone | Python | 271 lines
24 25DIR_SOURCE_ROOT = os.environ.get('CHECKOUT_SOURCE_ROOT', 26 os.path.abspath(os.path.join(os.path.dirname(__file__), 28 29PackageInfo = collections.namedtuple('PackageInfo', 30 ['package', 'activity', 'cmdline_file', 'devtools_socket']) 136 137PERF_OUTPUT_DIR = os.path.join(DIR_SOURCE_ROOT, 'out', 'step_results') 138# The directory on the device where perf test output gets saved to. 141 142SCREENSHOTS_DIR = os.path.join(DIR_SOURCE_ROOT, 'out_screenshots') 143 145ANDROID_SDK_BUILD_TOOLS_VERSION = '23.0.1' 146ANDROID_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 147 'third_party', 'android_tools', 'sdk')evangelist.py https://gitlab.com/made-financial/made-financial-scripts | Python | 114 lines
9import sys 10from collections import namedtuple 11import pandas as pd 20Payment = namedtuple('Payment', 'month payee amount source id') 21Summary = namedtuple('Summary', 'payments total by_source by_level') 22gen_cmake.py https://github.com/isaacs/node.git | Python | 518 lines
10from contextlib import suppress 11from collections import namedtuple 12from datetime import datetime 69 'v8_component', 70 'v8_source_set', 71 'v8_executable', 217 'cppgc_standalone': 'sample', 218 'cppgc_unittests_sources': 'tests', 219 'cppgc_unittests': 'tests', 306 FetchContent_Populate(googletest) 307 message("Fetched googletest into ${{googletest_SOURCE_DIR}}") 308 add_subdirectory(${{googletest_SOURCE_DIR}} ${{googletest_BINARY_DIR}} EXCLUDE_FROM_ALL) 327 self.source_sets.setdefault( 328 TARGETS[target], []).append('${' + self._SourceVar(target) + '}') 329v8_foozzie.py https://github.com/isaacs/node.git | Python | 508 lines
22 23from collections import namedtuple 24 148# Keep the number small to avoid duplicate explosion. 149ORIGINAL_SOURCE_HASH_LENGTH = 3 150 151# Placeholder string if no original source file could be determined. 152ORIGINAL_SOURCE_DEFAULT = 'none' 153 155# this signature, the matching sources should be moved to the mapping below. 156ORIGINAL_SOURCE_CRASHTESTS = 'placeholder for CrashTests' 157 227 228 RunOptions = namedtuple('RunOptions', ['arch', 'config', 'd8', 'flags']) 229 return RunOptions(infer_arch(d8), config, d8, flags)flowers.py https://gitlab.com/ll14ec/Portfolio | Python | 98 lines
55 Returns: 56 A `Dataset` namedtuple. 57 91 return slim.dataset.Dataset( 92 data_sources=file_pattern, 93 reader=reader,pyproject.py https://gitlab.com/abhi1tb/build | Python | 196 lines
5import sys 6from collections import namedtuple 7 25 26def make_pyproject_path(unpacked_source_directory): 27 # type: (str) -> str 27 # type: (str) -> str 28 path = os.path.join(unpacked_source_directory, 'pyproject.toml') 29 36 37BuildSystemDetails = namedtuple('BuildSystemDetails', [ 38 'requires', 'backend', 'check', 'backend_path'finders.py https://github.com/dimagi/commcare-hq.git | Python | 232 lines
8import logging 9from collections import namedtuple 10from functools import partial 24from corehq.motech.openmrs.const import OPENMRS_DATA_TYPE_BOOLEAN 25from corehq.motech.value_source import ( 26 deserialize, 106 107PatientScore = namedtuple('PatientScore', ['patient', 'score']) 108 167 prop = property_weight['case_property'] 168 jsonpath, value_source_dict = self._property_map[prop] 169 weight = property_weight['weight'] 177 match_function = partial(MATCH_FUNCTIONS[match_type], *match_params) 178 is_equivalent = match_function(deserialize(value_source_dict, patient_value), case_value) 179 yield weight if is_equivalent else 0engine.py https://gitlab.com/oryx/openembedded-core | Python | 583 lines
36 37from collections import namedtuple, OrderedDict 38from distutils.spawn import find_executable 144 145def list_source_plugins(): 146 """ 218 elif args.list_type == "source-plugins": 219 list_source_plugins() 220 return True 266 out = exec_cmd("%s -sm %s unit B print" % (self.parted, self.imagepath)) 267 parttype = namedtuple("Part", "pnum start end size fstype") 268 splitted = out.splitlines()table.py http://svn-cassiopeia.googlecode.com/svn/trunk/ | Python | 182 lines
4import os 5from collections import namedtuple 6#_make(iterable), _asdict(), _replace(kwargs), _fields http://www.python.jp/doc/nightly/library/collections.html 7""" 8EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title, department, paygrade') 9for emp in map(EmployeeRecord._make, csv.reader(open("employees.csv", "rb"))): 28 @staticmethod 29 def load_source_from_sheet(connector): 30 return ItemFactory.load_source_from_sheet(connector) 36 @staticmethod 37 def load_source_from_sheet(connector): 38 return TableItemPriority.load_source_from_sheet(connector) 73class TableItemFactory(object): 74 RawItem = namedtuple('RawItem', 'value col_order row_order') 75 @staticmethodedl.py https://github.com/emolch/pyrocko.git | Python | 642 lines
152 fmt_len = struct.calcsize(fmt) 153 Block = collections.namedtuple('Block'+k[:3], block_def[k][::2]) 154 Blocks[k] = (fmt, fmt_len, Block) 201 gps_utc_time_offset 2 int 202 current_fix_source 1 int 203 number_usable_svs 2 int 244 self.items = items 245 self.Message = collections.namedtuple('GPSMessage'+k, names) 246tests.py https://github.com/GeoNode/geonode.git | Python | 1121 lines
28from unittest.mock import MagicMock, patch 29from collections import namedtuple 30from pinax.ratings.models import OverallRating 75 get_valid_dataset_name, 76 surrogate_escape_string, validate_input_source) 77 120 create_dataset_data(Dataset.objects.first().resourcebase_ptr_id) 121 self.r = namedtuple('GSCatalogRes', ['resource']) 122 136 137 def test_default_sourcetype(self): 138 obj = Dataset.objects.first()__init__.py https://github.com/SavinaRoja/OpenAccess_EPUB.git | Python | 337 lines
21 22Identifier = collections.namedtuple('Identifer', 'id, type') 23 140 try: 141 config = imp.load_source('config', config_path) 142 except IOError: 196 try: 197 config = imp.load_source('config', config_path) 198 except IOError:suppress.py https://gitlab.com/jonnialva90/iridium-browser | Python | 117 lines
38 ' build process by running:\n\n' 39 ' ' + os.path.relpath(_THIS_FILE, constants.DIR_SOURCE_ROOT) + '\n\n' 40 ' which will generate this file (Comments are not preserved).\n' 45 46_Issue = collections.namedtuple('Issue', ['severity', 'paths']) 47forms.py https://github.com/dimagi/commcare-hq.git | Python | 1226 lines
3from abc import ABCMeta, abstractmethod 4from collections import OrderedDict, namedtuple 5 28from corehq.apps.userreports.app_manager.data_source_meta import ( 29 APP_DATA_SOURCE_TYPE_VALUES, 30 DATA_SOURCE_TYPE_RAW, 31 REPORT_BUILDER_DATA_SOURCE_TYPE_VALUES, 32 DATA_SOURCE_TYPE_CASE, DATA_SOURCE_TYPE_FORM, 33 make_case_data_source_filter, make_form_data_source_filter, 35from corehq.apps.userreports.app_manager.helpers import clean_table_name 36from corehq.apps.userreports.const import DATA_SOURCE_MISSING_APP_ERROR_MESSAGE, LENIENT_MAXIMUM_EXPANSION 37from corehq.apps.userreports.exceptions import BadBuilderConfigError 171 172 def get_source(self): 173 return self._source 387 def report_config_class(self): 388 return RegistryReportConfiguration if self.uses_registry_data_source else ReportConfigurspecs.py https://github.com/dimagi/commcare-hq.git | Python | 607 lines
100 101 def get_fields(self, data_source_config=None, lang=None): 102 """ 188 189 def get_fields(self, data_source_config=None, lang=None): 190 return [self.field] 191 192 def _data_source_col_config(self, data_source_config): 193 return filter( 197 def _column_data_type(self, data_source_config): 198 return self._data_source_col_config(data_source_config).get('datatype') 199 202 self.aggregation in ['max', 'min'] and 203 self._column_data_type(data_source_config) and 204 self._column_data_type(data_source_config) not in ['integer', 'decimal']views.py https://github.com/dimagi/commcare-hq.git | Python | 1285 lines
6import tempfile 7from collections import OrderedDict, namedtuple 8 54from corehq.apps.app_manager.util import purge_report_from_mobile_ucr 55from corehq.apps.change_feed.data_sources import ( 56 get_document_store_for_doc_type, 81from corehq.apps.settings.views import BaseProjectDataView 82from corehq.apps.userreports.app_manager.data_source_meta import ( 83 DATA_SOURCE_TYPE_CASE, 83 DATA_SOURCE_TYPE_CASE, 84 DATA_SOURCE_TYPE_RAW, 85) 86from corehq.apps.userreports.app_manager.helpers import ( 87 get_case_data_source, 88 get_form_data_source,models.py https://github.com/dimagi/commcare-hq.git | Python | 1361 lines
4import re 5from collections import namedtuple 6from copy import copy, deepcopy 51from corehq.apps.registry.helper import DataRegistryHelper 52from corehq.apps.userreports.app_manager.data_source_meta import ( 53 REPORT_BUILDER_DATA_SOURCE_TYPE_VALUES, 57 ALL_EXPRESSION_TYPES, 58 DATA_SOURCE_TYPE_AGGREGATE, 59 DATA_SOURCE_TYPE_STANDARD, 66from corehq.apps.userreports.dbaccessors import ( 67 get_all_registry_data_source_ids, 68 get_datasources_for_domain, 68 get_datasources_for_domain, 69 get_number_of_registry_report_configs_by_data_source, 70 get_number_of_report_configs_by_data_source,aggregations.py https://github.com/dimagi/commcare-hq.git | Python | 630 lines
23 24The ``res`` object has a ``aggregations`` property, which returns a namedtuple 25pointing to the wrapped aggregation results. The name provided at instantiation is 38import re 39from collections import defaultdict, namedtuple 40from copy import deepcopy 98 n_buckets = self.normalized_buckets 99 buckets = namedtuple('buckets', [b['key'] for b in n_buckets]) 100 return buckets(**{b['key']: Bucket(b, self._aggregations) for b in n_buckets}) 142 """Return the docs from the response.""" 143 return [r['_source'] for r in self.raw_hits] 144 373 if include: 374 self.body["_source"] = {"include": include} 375util.py https://github.com/dimagi/commcare-hq.git | Python | 731 lines
5import uuid 6from collections import OrderedDict, namedtuple 7from copy import deepcopy 442 443def update_form_unique_ids(app_source, ids_map, update_all=True): 444 """ 444 """ 445 Accepts an ids_map translating IDs in app_source to the desired replacement 446 ID. Form IDs not present in ids_map will be given new random UUIDs. 449 450 app_source = deepcopy(app_source) 451 attachments = app_source['_attachments'] 459 # we can remove this 460 if 'user_registration' in app_source: 461 del app_fields.py https://github.com/dimagi/commcare-hq.git | Python | 684 lines
109 def bootstrap(self, domain): 110 self.all_sources = get_app_sources(domain) 111 self.application_field.choices = sorted( 117 self.all_sources.update({'': {"name": '', "case": [], "form": []}}) 118 self.app_and_registry_sources = get_dropdown_options(domain, self.all_sources, 119 self.registry_permission_checker) 119 self.registry_permission_checker) 120 self.all_sources.update(get_registry_case_sources(domain)) 121 141 self.source_field, 142 [(ds.data_source_id, ds.display_name) for ds in available_data_sources] 143 ) 147 for app_data in self.all_sources.values(): 148 app_data['data_source'] = [{"text": ds.display_name, "value": ds.data_source_id} 149 for ds in available_data_sources]compilation.py https://gitlab.com/williamwp/riscv-rv32x-llvm | Python | 140 lines
10 11__all__ = ['split_command', 'classify_source', 'compiler_language'] 12 68 # the result of this method 69 result = collections.namedtuple('Compilation', 70 ['compiler', 'flags', 'files']) 93 # parameter which looks source file is taken... 94 elif re.match(r'^[^-].+', arg) and classify_source(arg): 95 result.files.append(arg) 102 103def classify_source(filename, c_compiler=True): 104 """ Return the language from file name extension. """compat.py https://bitbucket.org/zzzeek/mako.git | Python | 177 lines
17 18ArgSpec = collections.namedtuple( 19 "ArgSpec", ["args", "varargs", "keywords", "defaults"] 122 try: 123 module = imp.load_source(module_id, path, fp) 124 del sys.modules[module_id]