id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28,200 | __init__.py | DamnWidget_anaconda/anaconda_lib/__init__.py |
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
| 128 | Python | .py | 2 | 62.5 | 65 | 0.776 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,201 | aenum.py | DamnWidget_anaconda/anaconda_lib/aenum.py | """Python Enumerations"""
import sys as _sys
__all__ = ['Enum', 'IntEnum', 'unique']
version = 1, 1, 6
pyver = float('%s.%s' % _sys.version_info[:2])
try:
any
except NameError:
def any(iterable):
for element in iterable:
if element:
return True
return False
try:... | 31,054 | Python | .py | 702 | 33.713675 | 113 | 0.55525 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,202 | vagrant.py | DamnWidget_anaconda/anaconda_lib/vagrant.py |
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import os
import threading
import subprocess
from .logger import Log
from .contexts import vagrant_root
from .helpers import create_subprocess
PIPE = subprocess.PIPE
class VagrantBase(thr... | 6,824 | Python | .py | 174 | 29.689655 | 76 | 0.581942 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,203 | logger.py | DamnWidget_anaconda/anaconda_lib/logger.py |
# Copyright (C) 2013 - 2016 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import sys
import logging
import functools
import sublime
from .helpers import get_settings, active_view
def prevent_spam(func):
"""Prevent spamming in the logger
"""
... | 2,150 | Python | .py | 57 | 29.929825 | 76 | 0.6 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,204 | jsonclient.py | DamnWidget_anaconda/anaconda_lib/jsonclient.py | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""Minimalist standard library Asynchronous JSON Client
"""
import sys
import uuid
import socket
import logging
import traceback
try:
import sublime
except Import... | 3,640 | Python | .py | 98 | 29.010204 | 78 | 0.616064 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,205 | contexts.py | DamnWidget_anaconda/anaconda_lib/contexts.py | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
Anaconda contexts
"""
import os
from contextlib import contextmanager
@contextmanager
def vagrant_root(directory):
current_dir = os.getcwd()
os.chdir(os.... | 384 | Python | .py | 14 | 24.928571 | 65 | 0.750685 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,206 | helpers.py | DamnWidget_anaconda/anaconda_lib/helpers.py | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
Anaconda helpers
"""
import os
import json
import logging
import functools
import traceback
import subprocess
from collections import defaultdict
import sublime
... | 12,480 | Python | .py | 333 | 28.165165 | 95 | 0.59302 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,207 | progress_bar.py | DamnWidget_anaconda/anaconda_lib/progress_bar.py |
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""Package Control progress bar like
"""
import threading
import sublime
class ProgressBar(threading.Thread):
"""A progress bar animation that runs in other thread
"""
class ... | 1,534 | Python | .py | 47 | 24.680851 | 89 | 0.579019 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,208 | unix_socket.py | DamnWidget_anaconda/anaconda_lib/unix_socket.py |
# Copyright (C) 2013 ~ 2016 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software se LICENSE file for details
import os
import platform
import tempfile
class UnixSocketPath(object):
"""Encapsulate logic to handle with paths to UNIX domain sockets
"""
socketpath = {
'linux... | 1,527 | Python | .py | 44 | 26.25 | 75 | 0.590075 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,209 | decorators.py | DamnWidget_anaconda/anaconda_lib/decorators.py | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
Anaconda decorators
"""
import os
import sys
import time
import pstats
import logging
import functools
try:
import cProfile
CPROFILE_AVAILABLE = True
exce... | 3,981 | Python | .py | 109 | 27.293578 | 79 | 0.601825 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,210 | six.py | DamnWidget_anaconda/anaconda_lib/six.py | # Copyright (c) 2010-2017 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... | 30,698 | Python | .py | 717 | 35.990237 | 98 | 0.648497 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,211 | info.py | DamnWidget_anaconda/anaconda_lib/info.py |
# Copyright (C) 2013 - 2016 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
class Repr(type):
"""Metaclass to define __repr__ for class instead of instance
"""
def __repr__(cls):
if hasattr(cls, '_repr'):
return getattr(cls, '... | 374 | Python | .py | 9 | 35.555556 | 72 | 0.633333 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,212 | import_validator.py | DamnWidget_anaconda/anaconda_lib/import_validator.py | # -*- coding: utf8 -*-
# Copyright (C) 2014 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
Anaconda imports validator
"""
from jedi import Script, get_default_project
class Validator:
"""Try to import whatever import that is in the given source
... | 3,247 | Python | .py | 85 | 25.8 | 88 | 0.513531 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,213 | autopep_wrapper.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep_wrapper.py | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
This file is a wrapper for autopep8 library.
"""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../linting'))
import threading
f... | 1,459 | Python | .py | 36 | 33.555556 | 76 | 0.620739 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,214 | __init__.py | DamnWidget_anaconda/anaconda_lib/autopep/__init__.py |
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
from .autopep_wrapper import AnacondaAutopep8
__all__ = ['AnacondaAutopep8']
| 208 | Python | .py | 4 | 50 | 65 | 0.78 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,215 | autopep8.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/autopep8.py | #!/usr/bin/env python
# Copyright (C) 2010-2011 Hideo Hattori
# Copyright (C) 2011-2013 Hideo Hattori, Steven Myint
# Copyright (C) 2013-2016 Hideo Hattori, Steven Myint, Bill Wendling
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files... | 130,342 | Python | .py | 3,083 | 30.650016 | 79 | 0.552821 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,216 | btm_utils.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/btm_utils.py | "Utility functions used by the btm_matcher module"
from . import pytree
from .pgen2 import grammar, token
from .pygram import pattern_symbols, python_symbols
syms = pattern_symbols
pysyms = python_symbols
tokens = grammar.opmap
token_labels = token
TYPE_ANY = -1
TYPE_ALTERNATIVES = -2
TYPE_GROUP = -3
class MinNode(... | 10,011 | Python | .py | 249 | 28.62249 | 83 | 0.567229 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,217 | fixer_base.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixer_base.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Base class for fixers (optional, but recommended)."""
# Python imports
import logging
import itertools
# Local imports
from .patcomp import PatternCompiler
from . import pygram
from .fixer_util import does_tree_imp... | 6,839 | Python | .py | 151 | 36.417219 | 87 | 0.638647 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,218 | btm_matcher.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/btm_matcher.py | """A bottom-up tree matching algorithm implementation meant to speed
up 2to3's matching process. After the tree patterns are reduced to
their rarest linear path, a linear Aho-Corasick automaton is
created. The linear automaton traverses the linear paths from the
leaves to the root of the AST and returns a set of nodes ... | 6,833 | Python | .py | 150 | 33.046667 | 89 | 0.581395 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,219 | fixer_util.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixer_util.py | """Utility functions, node construction macros, etc."""
# Author: Collin Winter
from itertools import islice
# Local imports
from .pgen2 import token
from .pytree import Leaf, Node
from .pygram import python_symbols as syms
from . import patcomp
###########################################################
### Common... | 14,552 | Python | .py | 373 | 31.147453 | 88 | 0.574646 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,220 | pytree.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/pytree.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""
Python parse tree definitions.
This is a very concrete parse tree; we need to keep every token and
even the comments and whitespace between tokens.
There's also a pattern matching implementation here.
"""
__autho... | 29,039 | Python | .py | 732 | 29.064208 | 88 | 0.572535 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,221 | refactor.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/refactor.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Refactoring framework.
Used as a main program, this can refactor any number of files and/or
recursively descend down directories. Imported as a module, this
provides infrastructure to write your own refactoring too... | 28,024 | Python | .py | 642 | 31.140187 | 81 | 0.558639 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,222 | patcomp.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/patcomp.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Pattern compiler.
The grammer is taken from PatternGrammar.txt.
The compiler compiles a pattern to a pytree.*Pattern instance.
"""
__author__ = "Guido van Rossum <guido@python.org>"
# Python imports
import io
imp... | 7,075 | Python | .py | 168 | 31.630952 | 79 | 0.589229 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,223 | pygram.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/pygram.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Export the Python grammar and symbols."""
# Python imports
import os
# Local imports
from .pgen2 import token
from .pgen2 import driver
from . import pytree
# The grammar file
_GRAMMAR_FILE = os.path.join(os.path.... | 1,114 | Python | .py | 27 | 36.333333 | 70 | 0.711359 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,224 | main.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/main.py | """
Main program for 2to3.
"""
from __future__ import with_statement
import sys
import os
import difflib
import logging
import shutil
import optparse
from . import refactor
def diff_texts(a, b, filename):
"""Return a unified diff of two strings."""
a = a.splitlines()
b = b.splitlines()
return diffl... | 11,624 | Python | .py | 245 | 35.840816 | 83 | 0.591758 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,225 | conv.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/pgen2/conv.py | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Convert graminit.[ch] spit out by pgen to Python code.
Pgen is the Python parser generator. It is useful to quickly create a
parser from a grammar file in Python's grammar notation. But I don't
wa... | 9,642 | Python | .py | 227 | 31.555066 | 78 | 0.537453 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,226 | token.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/pgen2/token.py | #! /usr/bin/env python3
"""Token constants (from "token.h")."""
# Taken from Python (r53757) and modified to include some tokens
# originally monkeypatched in by pgen2.tokenize
#--start constants--
ENDMARKER = 0
NAME = 1
NUMBER = 2
STRING = 3
NEWLINE = 4
INDENT = 5
DEDENT = 6
LPAR = 7
RPAR = 8
LSQB = 9
RSQB = 10
... | 1,251 | Python | .py | 74 | 15.472973 | 65 | 0.723695 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,227 | __init__.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/pgen2/__init__.py | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""The pgen2 package."""
| 143 | Python | .py | 3 | 46.333333 | 67 | 0.776978 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,228 | pgen.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/pgen2/pgen.py | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Pgen imports
from . import grammar, token, tokenize
class PgenGrammar(grammar.Grammar):
pass
class ParserGenerator(object):
def __init__(self, filename, stream=None):
close_stream =... | 13,780 | Python | .py | 354 | 26.053672 | 78 | 0.508885 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,229 | grammar.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/pgen2/grammar.py | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... | 5,369 | Python | .py | 155 | 27.767742 | 79 | 0.627965 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,230 | literals.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/pgen2/literals.py | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Safely evaluate Python string literals without using eval()."""
import re
simple_escapes = {"a": "\a",
"b": "\b",
"f": "\f",
"n": "\n",
... | 1,615 | Python | .py | 52 | 22.326923 | 75 | 0.464309 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,231 | parse.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/pgen2/parse.py | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser engine for the grammar tables generated by pgen.
The grammar table must be loaded first.
See Parser/parser.c in the Python distribution for additional info on
how this parsing engine works.
... | 8,053 | Python | .py | 169 | 36.094675 | 78 | 0.590168 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,232 | driver.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/pgen2/driver.py | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Modifications:
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser driver.
This provides a high-level interface to parse a file into a synta... | 5,153 | Python | .py | 133 | 28.857143 | 76 | 0.570056 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,233 | tokenize.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/pgen2/tokenize.py | # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
# All rights reserved.
"""Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line o... | 19,169 | Python | .py | 436 | 33.919725 | 87 | 0.536772 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,234 | fix_getcwdu.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_getcwdu.py | """
Fixer that changes os.getcwdu() to os.getcwd().
"""
# Author: Victor Stinner
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixGetcwdu(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power< 'os' trailer< dot='.' name='getcwdu' > any* >
""... | 451 | Python | .py | 15 | 25.066667 | 66 | 0.62963 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,235 | fix_urllib.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_urllib.py | """Fix changes imports of urllib which are now incompatible.
This is rather similar to fix_imports, but because of the more
complex nature of the fixing for urllib, it has its own fixer.
"""
# Author: Nick Edds
# Local imports
from lib2to3.fixes.fix_imports import alternates, FixImports
from lib2to3 import fixer... | 8,384 | Python | .py | 180 | 31.911111 | 79 | 0.528887 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,236 | fix_sys_exc.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_sys_exc.py | """Fixer for sys.exc_{type, value, traceback}
sys.exc_type -> sys.exc_info()[0]
sys.exc_value -> sys.exc_info()[1]
sys.exc_traceback -> sys.exc_info()[2]
"""
# By Jeff Balogh and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms
clas... | 1,034 | Python | .py | 24 | 37.5 | 72 | 0.633466 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,237 | fix_has_key.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_has_key.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for has_key().
Calls to .has_key() methods are expressed in terms of the 'in'
operator:
d.has_key(k) -> k in d
CAVEATS:
1) While the primary target of this fixer is dict.has_key(), the
fixer will chan... | 3,222 | Python | .py | 96 | 24.260417 | 78 | 0.541774 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,238 | fix_reduce.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_reduce.py | # Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for reduce().
Makes sure reduce() is imported from the functools module if reduce is
used in that module.
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import touch_import
class FixReduce(fixer_base.BaseFix):
... | 837 | Python | .py | 26 | 24.730769 | 70 | 0.571072 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,239 | fix_raise.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_raise.py | """Fixer for 'raise E, V, T'
raise -> raise
raise E -> raise E
raise E, V -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)
raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T -> warns about string exceptions
CAVEATS:... | 2,926 | Python | .py | 74 | 30.459459 | 80 | 0.55677 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,240 | fix_dict.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_dict.py | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for dict methods.
d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())
d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())
d.v... | 3,816 | Python | .py | 91 | 33.406593 | 78 | 0.578862 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,241 | fix_filter.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_filter.py | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes filter(F, X) into list(filter(F, X)).
We avoid the transformation if the filter() call is directly contained
in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or
for V in <>:.
NOTE: This... | 2,102 | Python | .py | 65 | 22.630769 | 73 | 0.508391 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,242 | fix_methodattrs.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_methodattrs.py | """Fix bound method attributes (method.im_? -> method.__?__).
"""
# Author: Christian Heimes
# Local imports
from .. import fixer_base
from ..fixer_util import Name
MAP = {
"im_func" : "__func__",
"im_self" : "__self__",
"im_class" : "__self__.__class__"
}
class FixMethodattrs(fixer_base.BaseFix):
... | 606 | Python | .py | 20 | 26.1 | 79 | 0.589347 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,243 | fix_next.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_next.py | """Fixer for it.next() -> next(it), per PEP 3114."""
# Author: Collin Winter
# Things that currently aren't covered:
# - listcomp "next" names aren't warned
# - "with" statement targets aren't checked
# Local imports
from ..pgen2 import token
from ..pygram import python_symbols as syms
from .. import fixer_base
f... | 3,174 | Python | .py | 86 | 27.895349 | 77 | 0.566916 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,244 | fix_xreadlines.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_xreadlines.py | """Fix "for x in f.xreadlines()" -> "for x in f".
This fixer will also convert g(f.xreadlines) into g(f.__iter__)."""
# Author: Collin Winter
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixXreadlines(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power< call=an... | 689 | Python | .py | 19 | 30.947368 | 69 | 0.606928 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,245 | fix_set_literal.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_set_literal.py | """
Optional fixer to transform set() calls to set literals.
"""
# Author: Benjamin Peterson
from lib2to3 import fixer_base, pytree
from lib2to3.fixer_util import token, syms
class FixSetLiteral(fixer_base.BaseFix):
BM_compatible = True
explicit = True
PATTERN = """power< 'set' trailer< '('
... | 1,697 | Python | .py | 42 | 29.261905 | 82 | 0.536496 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,246 | fix_raw_input.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_raw_input.py | """Fixer that changes raw_input(...) into input(...)."""
# Author: Andre Roberge
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixRawInput(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power< name='raw_input' trailer< '(' [any] ')' > any* >
... | 454 | Python | .py | 13 | 29.307692 | 69 | 0.613272 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,247 | fix_execfile.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_execfile.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for execfile.
This converts usages of the execfile function into calls to the built-in
exec() function.
"""
from .. import fixer_base
from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node,
... | 1,990 | Python | .py | 44 | 37.545455 | 103 | 0.612487 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,248 | fix_isinstance.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_isinstance.py | # Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that cleans up a tuple argument to isinstance after the tokens
in it were fixed. This is mainly used to remove double occurrences of
tokens as a leftover of the long -> int / unicode -> str conversion.
eg. isinstance(x, (int,... | 1,608 | Python | .py | 45 | 26.866667 | 77 | 0.565553 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,249 | fix_exitfunc.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_exitfunc.py | """
Convert use of sys.exitfunc to use the atexit module.
"""
# Author: Benjamin Peterson
from lib2to3 import pytree, fixer_base
from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms
class FixExitfunc(fixer_base.BaseFix):
keep_line_order = True
BM_compatible = True
PATTERN = """
... | 2,497 | Python | .py | 61 | 28 | 77 | 0.519175 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,250 | fix_exec.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_exec.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for exec.
This converts usages of the exec statement into calls to a built-in
exec() function.
exec code in ns1, ns2 -> exec(code, ns1, ns2)
"""
# Local imports
from .. import pytree
from .. import fixer_bas... | 1,001 | Python | .py | 31 | 26.741935 | 67 | 0.602497 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,251 | fix_operator.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_operator.py | """Fixer for operator functions.
operator.isCallable(obj) -> hasattr(obj, '__call__')
operator.sequenceIncludes(obj) -> operator.contains(obj)
operator.isSequenceType(obj) -> isinstance(obj, collections.Sequence)
operator.isMappingType(obj) -> isinstance(obj, collections.Mapping)
operator.isNumberType(obj) ... | 3,471 | Python | .py | 79 | 36.037975 | 80 | 0.616958 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,252 | fix_itertools_imports.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_itertools_imports.py | """ Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) """
# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import BlankLine, syms, token
class FixItertoolsImports(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
import_from< 'from' 'itertools' 'import'... | 2,086 | Python | .py | 50 | 29.64 | 76 | 0.553475 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,253 | fix_basestring.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_basestring.py | """Fixer for basestring -> str."""
# Author: Christian Heimes
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixBasestring(fixer_base.BaseFix):
BM_compatible = True
PATTERN = "'basestring'"
def transform(self, node, results):
return Name("str", prefix=node.prefix)
| 320 | Python | .py | 10 | 28.6 | 46 | 0.715686 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,254 | fix_tuple_params.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_tuple_params.py | """Fixer for function definitions with tuple parameters.
def func(((a, b), c), d):
...
->
def func(x, d):
((a, b), c) = x
...
It will also support lambdas:
lambda (x, y): x + y -> lambda t: t[0] + t[1]
# The parens are a syntax error in Python 3
lambda (x): x + y -> lambda x: x + y
"""... | 5,565 | Python | .py | 147 | 27.918367 | 79 | 0.548237 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,255 | fix_renames.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_renames.py | """Fix incompatible renames
Fixes:
* sys.maxint -> sys.maxsize
"""
# Author: Christian Heimes
# based on Collin Winter's fix_import
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {"sys": {"maxint" : "maxsize"},
}
LOOKUP = {}
def alternates(members):
re... | 2,221 | Python | .py | 57 | 30.54386 | 81 | 0.562994 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,256 | fix_import.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_import.py | """Fixer for import statements.
If spam is being imported from the local directory, this import:
from spam import eggs
Becomes:
from .spam import eggs
And this import:
import spam
Becomes:
from . import spam
"""
# Local imports
from .. import fixer_base
from os.path import dirname, join, exists, sep
f... | 3,255 | Python | .py | 87 | 27.724138 | 78 | 0.568441 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,257 | fix_future.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_future.py | """Remove __future__ imports
from __future__ import foo is replaced with an empty line.
"""
# Author: Christian Heimes
# Local imports
from .. import fixer_base
from ..fixer_util import BlankLine
class FixFuture(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """import_from< 'from' module_name="__future... | 547 | Python | .py | 16 | 30.0625 | 79 | 0.681905 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,258 | fix_nonzero.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_nonzero.py | """Fixer for __nonzero__ -> __bool__ methods."""
# Author: Collin Winter
# Local imports
from .. import fixer_base
from ..fixer_util import Name, syms
class FixNonzero(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
classdef< 'class' any+ ':'
suite< any*
funcdef<... | 597 | Python | .py | 18 | 24.777778 | 63 | 0.527778 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,259 | fix_except.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_except.py | """Fixer for except statements with named exceptions.
The following cases will be converted:
- "except E, T:" where T is a name:
except E as T:
- "except E, T:" where T is not a name, tuple or list:
except E as t:
T = t
This is done because the target of an "except" clause must be a
... | 3,344 | Python | .py | 73 | 32.315068 | 78 | 0.519225 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,260 | fix_paren.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_paren.py | """Fixer that addes parentheses where they are required
This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``."""
# By Taek Joo Kim and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import LParen, RParen
# XXX This doesn't support nested for loops like [x for x in 1, 2 for x... | 1,227 | Python | .py | 37 | 22.081081 | 80 | 0.471682 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,261 | fix_zip.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_zip.py | """
Fixer that changes zip(seq0, seq1, ...) into list(zip(seq0, seq1, ...)
unless there exists a 'from future_builtins import zip' statement in the
top-level namespace.
We avoid the transformation if the zip() call is directly contained in
iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:.
"""
#... | 902 | Python | .py | 27 | 28.111111 | 72 | 0.620531 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,262 | fix_throw.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_throw.py | """Fixer for generator.throw(E, V, T).
g.throw(E) -> g.throw(E)
g.throw(E, V) -> g.throw(E(V))
g.throw(E, V, T) -> g.throw(E(V).with_traceback(T))
g.throw("foo"[, V[, T]]) will warn about string exceptions."""
# Author: Collin Winter
# Local imports
from .. import pytree
from ..pgen2 import token
from .. im... | 1,582 | Python | .py | 45 | 27.622222 | 84 | 0.549803 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,263 | fix_funcattrs.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_funcattrs.py | """Fix function attribute names (f.func_x -> f.__x__)."""
# Author: Collin Winter
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixFuncattrs(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_globals'... | 644 | Python | .py | 16 | 30.8125 | 79 | 0.53451 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,264 | fix_repr.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_repr.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that transforms `xyzzy` into repr(xyzzy)."""
# Local imports
from .. import fixer_base
from ..fixer_util import Call, Name, parenthesize
class FixRepr(fixer_base.BaseFix):
BM_compatible = True
PATTE... | 613 | Python | .py | 16 | 32.125 | 61 | 0.642373 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,265 | fix_ws_comma.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_ws_comma.py | """Fixer that changes 'a ,b' into 'a, b'.
This also changes '{a :b}' into '{a: b}', but does not touch other
uses of colons. It does not touch other uses of whitespace.
"""
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
class FixWsComma(fixer_base.BaseFix):
explicit = True # The use... | 1,090 | Python | .py | 31 | 25.774194 | 66 | 0.527117 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,266 | fix_itertools.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_itertools.py | """ Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and
itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363)
imports from itertools are fixed in fix_itertools_import.py
If itertools is imported as something else (ie: import itertools as it;
it.izip(spam, eggs)) method calls w... | 1,547 | Python | .py | 36 | 33.805556 | 77 | 0.583112 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,267 | fix_map.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_map.py | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes map(F, ...) into list(map(F, ...)) unless there
exists a 'from future_builtins import map' statement in the top-level
namespace.
As a special case, map(None, X) is changed into list(X). (This is
... | 3,058 | Python | .py | 81 | 27.358025 | 78 | 0.53185 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,268 | fix_metaclass.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_metaclass.py | """Fixer for __metaclass__ = X -> (metaclass=X) methods.
The various forms of classef (inherits nothing, inherits once, inherints
many) don't parse the same in the CST so we look at ALL classes for
a __metaclass__ and if we find one normalize the inherits to all be
an arglist.
For one-liner classes ('c... | 8,201 | Python | .py | 190 | 33.768421 | 80 | 0.583971 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,269 | fix_xrange.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_xrange.py | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes xrange(...) into range(...)."""
# Local imports
from .. import fixer_base
from ..fixer_util import Name, Call, consuming_calls
from .. import patcomp
class FixXrange(fixer_base.BaseFix):
BM_... | 2,694 | Python | .py | 61 | 34.655738 | 78 | 0.58718 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,270 | fix_imports2.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_imports2.py | """Fix incompatible imports and module references that must be fixed after
fix_imports."""
from . import fix_imports
MAPPING = {
'whichdb': 'dbm',
'anydbm': 'dbm',
}
class FixImports2(fix_imports.FixImports):
run_order = 7
mapping = MAPPING
| 289 | Python | .py | 10 | 23.1 | 74 | 0.644689 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,271 | fix_buffer.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_buffer.py | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes buffer(...) into memoryview(...)."""
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixBuffer(fixer_base.BaseFix):
BM_compatible = True
explicit = True # ... | 590 | Python | .py | 15 | 33.866667 | 66 | 0.651408 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,272 | fix_apply.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_apply.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for apply().
This converts apply(func, v, k) into (func)(*v, **k)."""
# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Call, Comma, parenthesi... | 1,901 | Python | .py | 53 | 26.509434 | 71 | 0.531488 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,273 | fix_idioms.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_idioms.py | """Adjust some old Python 2 idioms to their modern counterparts.
* Change some type comparisons to isinstance() calls:
type(x) == T -> isinstance(x, T)
type(x) is T -> isinstance(x, T)
type(x) != T -> not isinstance(x, T)
type(x) is not T -> not isinstance(x, T)
* Change "while 1:" into "while True:".... | 4,876 | Python | .py | 133 | 26.270677 | 88 | 0.527731 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,274 | fix_standarderror.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_standarderror.py | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for StandardError -> Exception."""
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixStandarderror(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
... | 449 | Python | .py | 13 | 29.461538 | 52 | 0.689095 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,275 | fix_callable.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_callable.py | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for callable().
This converts callable(obj) into isinstance(obj, collections.Callable), adding a
collections import if needed."""
# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import ... | 1,151 | Python | .py | 28 | 34.071429 | 80 | 0.633752 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,276 | fix_ne.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_ne.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that turns <> into !=."""
# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
class FixNe(fixer_base.BaseFix):
# This is so simple that we don't need the pattern com... | 571 | Python | .py | 16 | 31.25 | 67 | 0.684307 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,277 | fix_unicode.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_unicode.py | """Fixer that changes unicode to str, unichr to chr, and u"..." into "...".
"""
import re
from ..pgen2 import token
from .. import fixer_base
_mapping = {"unichr" : "chr", "unicode" : "str"}
_literal_re = re.compile(r"[uU][rR]?[\'\"]")
class FixUnicode(fixer_base.BaseFix):
BM_compatible = True
PATTERN = "ST... | 715 | Python | .py | 20 | 28.3 | 75 | 0.569565 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,278 | fix_imports.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_imports.py | """Fix incompatible imports and module references."""
# Authors: Collin Winter, Nick Edds
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {'StringIO': 'io',
'cStringIO': 'io',
'cPickle': 'pickle',
'__builtin__' : 'builtins',
'c... | 5,684 | Python | .py | 128 | 33.789063 | 80 | 0.567431 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,279 | fix_types.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_types.py | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for removing uses of the types module.
These work for only the known names in the types module. The forms above
can include types. or not. ie, It is assumed the module is imported either as:
import type... | 1,797 | Python | .py | 50 | 29.8 | 80 | 0.61268 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,280 | fix_long.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_long.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that turns 'long' into 'int' everywhere.
"""
# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import is_probably_builtin
class FixLong(fixer_base.BaseFix):
BM_compatible = True
... | 476 | Python | .py | 14 | 29.5 | 50 | 0.704595 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,281 | fix_print.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_print.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for print.
Change:
'print' into 'print()'
'print ...' into 'print(...)'
'print ... ,' into 'print(..., end=" ")'
'print >>x, ...' into 'print(..., file=x)'
No changes are appl... | 2,854 | Python | .py | 71 | 29.957746 | 78 | 0.536321 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,282 | fix_numliterals.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_numliterals.py | """Fixer that turns 1L into 1, 0755 into 0o755.
"""
# Copyright 2007 Georg Brandl.
# Licensed to PSF under a Contributor Agreement.
# Local imports
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Number
class FixNumliterals(fixer_base.BaseFix):
# This is so simple that we don't need ... | 768 | Python | .py | 21 | 31.047619 | 73 | 0.65 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,283 | fix_input.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_input.py | """Fixer that changes input(...) into eval(input(...))."""
# Author: Andre Roberge
# Local imports
from .. import fixer_base
from ..fixer_util import Call, Name
from .. import patcomp
context = patcomp.compile_pattern("power< 'eval' trailer< '(' any ')' > >")
class FixInput(fixer_base.BaseFix):
BM_compatible =... | 707 | Python | .py | 19 | 31 | 75 | 0.602056 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,284 | fix_intern.py | DamnWidget_anaconda/anaconda_lib/autopep/autopep8_lib/lib2to3/fixes/fix_intern.py | # Copyright 2006 Georg Brandl.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for intern().
intern(s) -> sys.intern(s)"""
# Local imports
from .. import pytree
from .. import fixer_base
from ..fixer_util import Name, Attr, touch_import
class FixIntern(fixer_base.BaseFix):
BM_compatible = True
or... | 1,402 | Python | .py | 39 | 24.538462 | 75 | 0.500737 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,285 | anaconda_pep257.py | DamnWidget_anaconda/anaconda_lib/linting/anaconda_pep257.py | # -*- coding: utf8 -*-
# Copyright (C) 2014 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
Anaconda PyDocStyle wrapper
"""
try:
import pydocstyle
class PEP257(object):
"""PEP-257 class for Anaconda
"""
def __init__(self... | 1,974 | Python | .py | 56 | 23.357143 | 88 | 0.503151 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,286 | anaconda_mccabe.py | DamnWidget_anaconda/anaconda_lib/linting/anaconda_mccabe.py | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
Anaconda McCabe
"""
import ast
from .mccabe import McCabeChecker
class AnacondaMcCabe(object):
"""Wrapper object around McCabe python script
"""
ch... | 1,577 | Python | .py | 45 | 26.666667 | 75 | 0.597625 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,287 | pycodestyle.py | DamnWidget_anaconda/anaconda_lib/linting/pycodestyle.py | #!/usr/bin/env python
# pycodestyle.py - Check Python source code formatting, according to
# PEP 8
#
# Copyright (C) 2006-2009 Johann C. Rocholl <johann@rocholl.net>
# Copyright (C) 2009-2014 Florent Xicluna <florent.xicluna@gmail.com>
# Copyright (C) 2014-2016 Ian Lee <ianlee1521@gmail.com>
#
# Permission is hereby gr... | 102,878 | Python | .py | 2,405 | 32.980873 | 89 | 0.57025 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,288 | anaconda_pep8.py | DamnWidget_anaconda/anaconda_lib/linting/anaconda_pep8.py | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import os
import pycodestyle as pep8
from linting import linter
class Pep8Error(linter.LintError):
"""PEP-8 linting error class
"""
def __init__(self, f... | 4,366 | Python | .py | 110 | 26.727273 | 77 | 0.509479 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,289 | anaconda_pylint.py | DamnWidget_anaconda/anaconda_lib/linting/anaconda_pylint.py | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
Anaconda PyLint wrapper
"""
import os
import sys
import logging
import subprocess
if sys.version_info >= (3, 0):
from io import StringIO
else:
try:
... | 4,202 | Python | .py | 108 | 25.453704 | 79 | 0.468143 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,290 | __init__.py | DamnWidget_anaconda/anaconda_lib/linting/__init__.py |
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
| 128 | Python | .py | 2 | 62.5 | 65 | 0.776 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,291 | anaconda_mypy.py | DamnWidget_anaconda/anaconda_lib/linting/anaconda_mypy.py |
# Copyright (C) 2013 - 2016 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
Anaconda MyPy wrapper
"""
import os
import sys
import shlex
import logging
import subprocess
from subprocess import PIPE, Popen
def parse_mypy_version():
try:
from m... | 3,974 | Python | .py | 109 | 26.440367 | 79 | 0.54247 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,292 | sublime.py | DamnWidget_anaconda/anaconda_lib/linting/sublime.py |
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import os
import re
import time
from functools import partial
import sublime
from . import pycodestyle as pep8
from ..worker import Worker
from ..callback import Callback
from ..persistent_... | 15,673 | Python | .py | 374 | 32.259358 | 123 | 0.570124 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,293 | linter.py | DamnWidget_anaconda/anaconda_lib/linting/linter.py | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
The majority of this code is based/inspired or directly taken from
SublimeLinter plugin. Because that, SublimeLinter license file has
been added to this package.
T... | 12,920 | Python | .py | 305 | 29.829508 | 79 | 0.537761 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,294 | mccabe.py | DamnWidget_anaconda/anaconda_lib/linting/mccabe.py | """ Meager code path measurement tool.
Ned Batchelder
http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html
MIT License.
"""
from __future__ import with_statement
import optparse
import sys
import tokenize
from collections import defaultdict
try:
import ast
from ast import ite... | 10,654 | Python | .py | 284 | 28.577465 | 78 | 0.590027 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,295 | anaconda_pyflakes.py | DamnWidget_anaconda/anaconda_lib/linting/anaconda_pyflakes.py | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import re
import _ast
from linting import linter
import pyflakes.checker as pyflakes
pyflakes.messages.Message.__str__ = (
lambda self: self.message % self.messa... | 5,741 | Python | .py | 129 | 31.232558 | 79 | 0.538765 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,296 | __main__.py | DamnWidget_anaconda/anaconda_lib/linting/pydocstyle/__main__.py | #! /usr/bin/env python
"""Static analysis tool for checking docstring conventions and style.
The repository is located at:
http://github.com/PyCQA/pydocstyle
"""
__all__ = ()
def main():
from pydocstyle import cli
cli.main()
if __name__ == '__main__':
main()
| 279 | Python | .py | 11 | 22.545455 | 69 | 0.684615 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,297 | checker.py | DamnWidget_anaconda/anaconda_lib/linting/pydocstyle/checker.py | """Parsed source code checkers for docstring violations."""
import ast
import string
import sys
import tokenize as tk
from itertools import takewhile
from re import compile as re
from collections import namedtuple
from . import violations
from .config import IllegalConfiguration
from .parser import (Package, Module, ... | 28,751 | Python | .py | 587 | 35.574106 | 79 | 0.570042 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,298 | config.py | DamnWidget_anaconda/anaconda_lib/linting/pydocstyle/config.py | """Configuration file parsing and utilities."""
import copy
import itertools
import os
from re import compile as re
try:
from collections import Set, namedtuple
except ImportError:
# this will fail in Pyton >= 3.10
from collections.abc import Set
from collections import namedtuple
try: # Python 3.x
... | 24,331 | Python | .py | 493 | 37.750507 | 79 | 0.599232 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |
28,299 | violations.py | DamnWidget_anaconda/anaconda_lib/linting/pydocstyle/violations.py | """Docstring violation definition."""
from itertools import dropwhile
from functools import partial
from collections import namedtuple
from .utils import is_blank
__all__ = ('Error', 'ErrorRegistry')
ErrorParams = namedtuple('ErrorParams', ['code', 'short_desc', 'context'])
class Error(object):
"""Error in d... | 10,359 | Python | .py | 206 | 39.165049 | 79 | 0.572177 | DamnWidget/anaconda | 2,213 | 260 | 184 | GPL-3.0 | 9/5/2024, 5:14:06 PM (Europe/Amsterdam) |