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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
700 | displayable.py | ranger_ranger/ranger/gui/displayable.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
import curses
from ranger.core.shared import FileManagerAware
from ranger.gui.curses_shortcuts import CursesShortcuts
try:
... | 10,580 | Python | .py | 268 | 28.970149 | 84 | 0.571875 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
701 | colorscheme.py | ranger_ranger/ranger/gui/colorscheme.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""Colorschemes define colors for specific contexts.
Generally, this works by passing a set of keywords (strings) to
the colorscheme.get() method to receive the tuple (fg, bg, attr).
fg, bg are t... | 5,717 | Python | .py | 130 | 36.569231 | 95 | 0.669307 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
702 | color.py | ranger_ranger/ranger/gui/color.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""Contains abbreviations to curses color/attribute constants.
Multiple attributes can be combined with the | (or) operator, toggled
with ^ (xor) and checked for with & (and). Examples:
attr = b... | 2,683 | Python | .py | 69 | 33.072464 | 79 | 0.672055 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
703 | curses_shortcuts.py | ranger_ranger/ranger/gui/curses_shortcuts.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
import sys
import curses
from ranger.gui.color import get_color
from ranger.core.shared import SettingsAware
REVERSE_ADDCH_ARG... | 2,974 | Python | .py | 74 | 30.635135 | 75 | 0.593956 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
704 | titlebar.py | ranger_ranger/ranger/gui/widgets/titlebar.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""The titlebar is the widget at the top, giving you broad overview.
It displays the current path among other things.
"""
from __future__ import (absolute_import, division, print_function)
from... | 6,051 | Python | .py | 143 | 30.643357 | 92 | 0.552023 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
705 | console.py | ranger_ranger/ranger/gui/widgets/console.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""The Console widget implements a vim-like console"""
from __future__ import (absolute_import, division, print_function)
import curses
import os
import re
from collections import deque
from io ... | 22,229 | Python | .py | 544 | 28.705882 | 94 | 0.5368 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
706 | browsercolumn.py | ranger_ranger/ranger/gui/widgets/browsercolumn.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""The BrowserColumn widget displays the contents of a directory or file."""
from __future__ import (absolute_import, division, print_function)
import curses
import stat
from time import time
fr... | 21,365 | Python | .py | 471 | 31.951168 | 97 | 0.557271 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
707 | taskview.py | ranger_ranger/ranger/gui/widgets/taskview.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""The TaskView allows you to modify what the loader is doing."""
from __future__ import (absolute_import, division, print_function)
from ranger.ext.accumulator import Accumulator
from . import... | 2,876 | Python | .py | 69 | 28.376812 | 93 | 0.507908 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
708 | statusbar.py | ranger_ranger/ranger/gui/widgets/statusbar.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""The statusbar displays information about the current file and directory.
On the left side, there is a display similar to what "ls -l" would
print for the current file. The right side shows di... | 11,934 | Python | .py | 300 | 28.136667 | 97 | 0.54873 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
709 | view_base.py | ranger_ranger/ranger/gui/widgets/view_base.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""The base GUI element for views on the directory"""
from __future__ import (absolute_import, division, print_function)
import curses
from ranger.ext.keybinding_parser import key_to_string
from... | 6,679 | Python | .py | 166 | 28.283133 | 93 | 0.546998 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
710 | __init__.py | ranger_ranger/ranger/gui/widgets/__init__.py | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from ranger.gui.displayable import Displayable
class Widget(Displayable):
"""A class for classification of widgets."""
vcsstatus_symb = {
'conflict': (
'X', ['vcsconflict']),
'untracked': ... | 1,123 | Python | .py | 40 | 18.625 | 66 | 0.403181 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
711 | view_multipane.py | ranger_ranger/ranger/gui/widgets/view_multipane.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
import curses
from ranger.gui.widgets.view_base import ViewBase
from ranger.gui.widgets.browsercolumn import BrowserColumn
cla... | 5,858 | Python | .py | 131 | 32.816794 | 85 | 0.570928 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
712 | pager.py | ranger_ranger/ranger/gui/widgets/pager.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""The pager displays text and allows you to scroll inside it."""
from __future__ import (absolute_import, division, print_function)
import curses
import logging
from ranger.gui import ansi
fro... | 8,886 | Python | .py | 227 | 26.321586 | 81 | 0.529807 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
713 | view_miller.py | ranger_ranger/ranger/gui/widgets/view_miller.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""ViewMiller arranges the view in miller columns"""
from __future__ import (absolute_import, division, print_function)
import curses
from ranger.container import settings
from ranger.gui.widget... | 10,550 | Python | .py | 242 | 31.132231 | 99 | 0.559606 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
714 | spawn.py | ranger_ranger/ranger/ext/spawn.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from io import open
from os import devnull
from subprocess import PIPE, CalledProcessError
from ranger.ext.popen23 import Popen... | 2,357 | Python | .py | 52 | 39.346154 | 84 | 0.708151 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
715 | signals.py | ranger_ranger/ranger/ext/signals.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""An efficient and minimalistic signaling/hook module.
To use this in a class, subclass SignalDispatcher and call
SignalDispatcher.__init__(self) in the __init__ function. Now you can bind
func... | 10,188 | Python | .py | 238 | 34.142857 | 92 | 0.62982 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
716 | direction.py | ranger_ranger/ranger/ext/direction.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""This class provides convenient methods for movement operations.
Direction objects are handled just like dicts but provide
methods like up() and down() which give you the correct value
for the ... | 5,186 | Python | .py | 144 | 26.875 | 93 | 0.564896 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
717 | popen23.py | ranger_ranger/ranger/ext/popen23.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import absolute_import
from contextlib import contextmanager
from subprocess import Popen
try:
from ranger import PY3
except ImportError:
from sys import version_info
... | 1,545 | Python | .py | 43 | 30.209302 | 78 | 0.664883 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
718 | shutil_generatorized.py | ranger_ranger/ranger/ext/shutil_generatorized.py | # This file was taken from the python 2.7.13 standard library and has been
# slightly modified to do a "yield" after every 16KB of copying
from __future__ import (absolute_import, division, print_function)
import os
import stat
import sys
from shutil import (_samefile, rmtree, _basename, _destinsrc, Error, SpecialFil... | 10,991 | Python | .py | 269 | 30.501859 | 93 | 0.583466 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
719 | popen_forked.py | ranger_ranger/ranger/ext/popen_forked.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
import os
from io import open
from subprocess import Popen
def Popen_forked(*args, **kwargs): # pylint: disable=invalid-name
... | 969 | Python | .py | 26 | 30.846154 | 73 | 0.635394 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
720 | hash.py | ranger_ranger/ranger/ext/hash.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from os import listdir
from os.path import getsize, isdir
from hashlib import sha256
# pylint: disable=invalid-name
def hash_... | 965 | Python | .py | 25 | 31 | 72 | 0.632086 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
721 | curses_interrupt_handler.py | ranger_ranger/ranger/ext/curses_interrupt_handler.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""Interrupt Signal handler for curses
This module can catch interrupt signals which would otherwise
rise a KeyboardInterrupt exception and handle it by pushing
a Ctrl+C (ASCII value 3) to the cu... | 1,407 | Python | .py | 32 | 40.03125 | 79 | 0.743571 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
722 | which.py | ranger_ranger/ranger/ext/which.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
import shutil
from subprocess import check_output, CalledProcessError
from ranger import PY3
def which(cmd):
if PY3:
... | 461 | Python | .py | 13 | 31.307692 | 66 | 0.72912 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
723 | mount_path.py | ranger_ranger/ranger/ext/mount_path.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from os.path import realpath, abspath, dirname, ismount
def mount_path(path):
"""Get the mount root of a directory"""
... | 468 | Python | .py | 12 | 34 | 66 | 0.676991 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
724 | keybinding_parser.py | ranger_ranger/ranger/ext/keybinding_parser.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
import sys
import copy
import curses.ascii
from ranger import PY3
digits = set(range(ord('0'), ord('9') + 1)) # pylint: disab... | 9,091 | Python | .py | 246 | 26.943089 | 85 | 0.558018 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
725 | abc.py | ranger_ranger/ranger/ext/abc.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import absolute_import
from abc import ABCMeta
# A compat wrapper for the older Python versions.
try:
from abc import ABC # pylint: disable=ungrouped-imports,unused-im... | 448 | Python | .py | 10 | 41.8 | 79 | 0.735023 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
726 | widestring.py | ranger_ranger/ranger/ext/widestring.py | # -*- encoding: utf-8 -*-
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
import sys
from unicodedata import east_asian_width
from ranger import PY3
ASCIIONLY = set(chr(c) fo... | 5,303 | Python | .py | 146 | 27.171233 | 85 | 0.543818 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
727 | accumulator.py | ranger_ranger/ranger/ext/accumulator.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from abc import abstractmethod
from ranger.ext.direction import Direction
class Accumulator(object):
def __init__(self):... | 2,538 | Python | .py | 79 | 21.607595 | 75 | 0.533881 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
728 | safe_path.py | ranger_ranger/ranger/ext/safe_path.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import absolute_import
import os
SUFFIX = '_'
def get_safe_path(dst):
if not os.path.exists(dst):
return dst
if not dst.endswith(SUFFIX):
dst += SUFFIX
... | 520 | Python | .py | 18 | 23.388889 | 65 | 0.623742 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
729 | get_executables.py | ranger_ranger/ranger/ext/get_executables.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from os import listdir, environ, stat
import platform
import shlex
from stat import S_IXOTH, S_IFREG
from ranger.ext.iter_tools... | 2,185 | Python | .py | 58 | 30.603448 | 79 | 0.64756 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
730 | cached_function.py | ranger_ranger/ranger/ext/cached_function.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
# Similar to functools.lru_cache of python3
def cached_function(fnc):
cache = {}
def inner_cached_function(*args):
... | 584 | Python | .py | 15 | 32.333333 | 76 | 0.670796 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
731 | img_display.py | ranger_ranger/ranger/ext/img_display.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
# Author: Emanuel Guevel, 2013
# Author: Delisa Mason, 2015
"""Interface for drawing images into the console
This module provides functions to draw images in the terminal using supported
implemen... | 35,422 | Python | .py | 800 | 33.885 | 99 | 0.591569 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
732 | openstruct.py | ranger_ranger/ranger/ext/openstruct.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
import collections
class OpenStruct(dict):
"""The fusion of dict and struct"""
def __init__(self, *args, **keywords):... | 786 | Python | .py | 18 | 37.722222 | 71 | 0.648221 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
733 | rifle.py | ranger_ranger/ranger/ext/rifle.py | #!/usr/bin/python
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""rifle, the file executor/opener of ranger
This can be used as a standalone program or can be embedded in python code.
When used together with ranger, it doesn't have to be in... | 24,789 | Python | .py | 558 | 31.311828 | 112 | 0.540595 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
734 | shell_escape.py | ranger_ranger/ranger/ext/shell_escape.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""Functions to escape metacharacters of arguments for shell commands."""
from __future__ import (absolute_import, division, print_function)
META_CHARS = (' ', "'", '"', '`', '&', '|', ';', '#'... | 1,067 | Python | .py | 22 | 44.318182 | 89 | 0.611379 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
735 | macrodict.py | ranger_ranger/ranger/ext/macrodict.py | from __future__ import absolute_import
import sys
MACRO_FAIL = "<\x01\x01MACRO_HAS_NO_VALUE\x01\01>"
def macro_val(thunk, fallback=MACRO_FAIL):
try:
return thunk()
except AttributeError:
return fallback
try:
from collections.abc import MutableMapping # pylint: disable=no-name-in-modul... | 2,153 | Python | .py | 60 | 29.45 | 83 | 0.615645 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
736 | lazy_property.py | ranger_ranger/ranger/ext/lazy_property.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
# Based on http://blog.pythonisito.com/2008/08/lazy-descriptors.html
from __future__ import (absolute_import, division, print_function)
class lazy_property(object): # pylint: disable=invalid-na... | 1,666 | Python | .py | 50 | 26.86 | 83 | 0.571429 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
737 | human_readable.py | ranger_ranger/ranger/ext/human_readable.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from datetime import datetime
from ranger.core.shared import SettingsAware
def human_readable(byte_count, separator=' ', use_... | 2,764 | Python | .py | 66 | 36.090909 | 98 | 0.646532 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
738 | iter_tools.py | ranger_ranger/ranger/ext/iter_tools.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from collections import deque
def flatten(lst):
"""Flatten an iterable.
All contained tuples, lists, deques and sets ... | 1,352 | Python | .py | 39 | 28.846154 | 71 | 0.596464 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
739 | logutils.py | ranger_ranger/ranger/ext/logutils.py | from __future__ import (absolute_import, division, print_function)
import logging
from collections import deque
class QueueHandler(logging.Handler):
"""
This handler store logs events into a queue.
"""
def __init__(self, queue):
"""
Initialize an instance, using the passed queue.
... | 2,091 | Python | .py | 58 | 29.137931 | 93 | 0.652282 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
740 | relative_symlink.py | ranger_ranger/ranger/ext/relative_symlink.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from os import symlink, sep
def relative_symlink(src, dst):
common_base = get_common_base(src, dst)
symlink(get_relati... | 868 | Python | .py | 23 | 31.869565 | 76 | 0.630824 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
741 | hg.py | ranger_ranger/ranger/ext/vcs/hg.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""Mercurial module"""
from __future__ import (absolute_import, division, print_function)
from datetime import datetime
import json
import os
from .vcs import Vcs, VcsError
class Hg(Vcs):
... | 3,731 | Python | .py | 108 | 24.907407 | 95 | 0.535337 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
742 | vcs.py | ranger_ranger/ranger/ext/vcs/vcs.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""VCS module"""
from __future__ import (absolute_import, division, print_function)
import os
import subprocess
import threading
import time
from io import open
from ranger.ext import spawn
# ... | 18,054 | Python | .py | 447 | 28.416107 | 99 | 0.558829 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
743 | git.py | ranger_ranger/ranger/ext/vcs/git.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""Git module"""
from __future__ import (absolute_import, division, print_function)
from datetime import datetime
import os
import re
import unicodedata
from .vcs import Vcs, VcsError
def str... | 5,980 | Python | .py | 160 | 27.375 | 97 | 0.533368 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
744 | __init__.py | ranger_ranger/ranger/ext/vcs/__init__.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""VCS Extension"""
from __future__ import (absolute_import, division, print_function)
from .vcs import Vcs, VcsError, VcsThread
__all__ = ['Vcs', 'VcsError', 'VcsThread']
| 299 | Python | .py | 6 | 48.166667 | 66 | 0.726644 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
745 | svn.py | ranger_ranger/ranger/ext/vcs/svn.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""Subversion module"""
from __future__ import (absolute_import, division, print_function)
from datetime import datetime
import os
from xml.etree import ElementTree as etree
from .vcs import Vc... | 4,228 | Python | .py | 124 | 24.330645 | 84 | 0.529311 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
746 | bzr.py | ranger_ranger/ranger/ext/vcs/bzr.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""GNU Bazaar module"""
from __future__ import (absolute_import, division, print_function)
from datetime import datetime
import os
import re
from .vcs import Vcs, VcsError
class Bzr(Vcs):
... | 4,320 | Python | .py | 116 | 27.336207 | 95 | 0.529581 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
747 | __init__.py | ranger_ranger/ranger/api/__init__.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""Files in this module contain helper functions used in configuration files."""
from __future__ import (absolute_import, division, print_function)
import ranger
from ranger.core.linemode import... | 1,467 | Python | .py | 32 | 41.5 | 84 | 0.738028 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
748 | commands.py | ranger_ranger/ranger/api/commands.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
# TODO: Add an optional "!" to all commands and set a flag if it's there
from __future__ import (absolute_import, division, print_function)
import os
import re
import ranger
from ranger import ... | 15,567 | Python | .py | 377 | 29.381963 | 99 | 0.537718 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
749 | default.py | ranger_ranger/ranger/colorschemes/default.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from ranger.gui.colorscheme import ColorScheme
from ranger.gui.color import (
black, blue, cyan, green, magenta, red, white,... | 5,864 | Python | .py | 169 | 19.674556 | 84 | 0.457908 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
750 | jungle.py | ranger_ranger/ranger/colorschemes/jungle.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from ranger.colorschemes.default import Default
from ranger.gui.color import green, red, blue, bold
class Scheme(Default):
... | 845 | Python | .py | 18 | 39.222222 | 74 | 0.679707 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
751 | __init__.py | ranger_ranger/ranger/colorschemes/__init__.py | """Colorschemes are required to be located here or in confdir/colorschemes/"""
| 79 | Python | .py | 1 | 78 | 78 | 0.782051 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
752 | solarized.py | ranger_ranger/ranger/colorschemes/solarized.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
# Author: Joseph Tannhuber <sepp.tannhuber@yahoo.de>, 2013
# Solarized like colorscheme, similar to solarized-dircolors
# from https://github.com/seebi/dircolors-solarized.
# This is a modification... | 4,361 | Python | .py | 128 | 19.601563 | 84 | 0.462304 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
753 | snow.py | ranger_ranger/ranger/colorschemes/snow.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
from ranger.gui.colorscheme import ColorScheme
from ranger.gui.color import default_colors, reverse, bold, BRIGHT
class Snow(C... | 1,290 | Python | .py | 35 | 25.571429 | 66 | 0.570394 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
754 | loader.py | ranger_ranger/ranger/core/loader.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
import errno
import math
import os.path
import select
from collections import deque
from io import open
from subprocess import P... | 15,792 | Python | .py | 407 | 25.609337 | 93 | 0.525307 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
755 | runner.py | ranger_ranger/ranger/core/runner.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""This module is an abstract layer over subprocess.Popen
It gives you highlevel control about how processes are run.
Example:
run = Runner(logfunc=print)
run('sleep 2', wait=True) # wai... | 9,641 | Python | .py | 230 | 31.182609 | 89 | 0.574082 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
756 | fm.py | ranger_ranger/ranger/core/fm.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""The File Manager, putting the pieces together"""
from __future__ import (absolute_import, division, print_function)
import mimetypes
import os.path
import pwd
import socket
import stat
import... | 17,742 | Python | .py | 390 | 33.215385 | 96 | 0.577428 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
757 | metadata.py | ranger_ranger/ranger/core/metadata.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""
A Metadata Manager that reads information about files from a json database.
The database is contained in a local .metadata.json file.
"""
# TODO: Better error handling if a json file can't b... | 5,407 | Python | .py | 123 | 33.609756 | 79 | 0.62 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
758 | linemode.py | ranger_ranger/ranger/core/linemode.py | # -*- coding: utf-8 -*-
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
# Author: Wojciech Siewierski <wojciech.siewierski@onet.pl>, 2015
from __future__ import (absolute_import, division, print_function)
from abc import abstractproperty, abst... | 5,148 | Python | .py | 126 | 32.547619 | 96 | 0.656683 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
759 | shared.py | ranger_ranger/ranger/core/shared.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""Shared objects contain singletons for shared use."""
from __future__ import (absolute_import, division, print_function)
class FileManagerAware(object): # pylint: disable=too-few-public-meth... | 703 | Python | .py | 14 | 45.928571 | 76 | 0.733529 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
760 | main.py | ranger_ranger/ranger/core/main.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""The main function responsible to initialize the FM object and stuff."""
from __future__ import (absolute_import, division, print_function)
import atexit
import locale
import os.path
import sh... | 21,163 | Python | .py | 461 | 33.663774 | 98 | 0.574468 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
761 | filter_stack.py | ranger_ranger/ranger/core/filter_stack.py | # -*- coding: utf-8 -*-
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
# Author: Wojciech Siewierski <wojciech.siewierski@onet.pl>, 2018
from __future__ import (absolute_import, division, print_function)
import re
# pylint: disable=invalid-na... | 7,391 | Python | .py | 211 | 26.862559 | 77 | 0.604864 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
762 | tab.py | ranger_ranger/ranger/core/tab.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
from __future__ import (absolute_import, division, print_function)
import os
from os.path import abspath, normpath, join, expanduser, isdir, dirname
from ranger import PY3
from ranger.container ... | 6,924 | Python | .py | 165 | 31.169697 | 91 | 0.599584 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
763 | actions.py | ranger_ranger/ranger/core/actions.py | # This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
# pylint: disable=too-many-lines,attribute-defined-outside-init
from __future__ import (absolute_import, division, print_function)
import codecs
import os
import re
import shlex
import shutil
im... | 59,975 | Python | .py | 1,443 | 29.147609 | 99 | 0.541056 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
764 | filter_stack.py | ranger_ranger/ranger/core/filter_stack.py | # -*- coding: utf-8 -*-
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
# Author: Wojciech Siewierski <wojciech.siewierski@onet.pl>, 2018
from __future__ import (absolute_import, division, print_function)
import re
# pylint: disable=invalid-na... | 7,391 | Python | .tac | 211 | 26.862559 | 77 | 0.604864 | ranger/ranger | 15,344 | 881 | 907 | GPL-3.0 | 9/5/2024, 5:08:02 PM (Europe/Amsterdam) |
765 | setup.py | gak_pycallgraph/setup.py | #!/usr/bin/env python
from os import path
from setuptools import setup
import sys
from setuptools.command.test import test as TestCommand
import pycallgraph
# Only install the man page if the correct directory exists
# XXX: Commented because easy_install doesn't like it
#man_path = '/usr/share/man/man1/'
#if path.e... | 2,062 | Python | .py | 58 | 30.189655 | 78 | 0.657961 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
766 | conftest.py | gak_pycallgraph/test/conftest.py | import tempfile
from helpers import *
@pytest.fixture(scope='module')
def pycg():
return PyCallGraph()
@pytest.fixture(scope='module')
def config():
return Config()
@pytest.fixture(scope='module')
def temp():
return tempfile.mkstemp()[1]
| 257 | Python | .py | 11 | 20.636364 | 32 | 0.740586 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
767 | test_script.py | gak_pycallgraph/test/test_script.py | import subprocess
from helpers import *
def execute(arguments):
command = 'PYTHONPATH=. scripts/pycallgraph ' + arguments
return subprocess.check_output(command, shell=True).decode('utf-8')
def test_help():
assert 'Python Call Graph' in execute('--help')
def test_graphviz_help():
assert '--font-n... | 365 | Python | .py | 9 | 37 | 71 | 0.733524 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
768 | fix_path.py | gak_pycallgraph/test/fix_path.py | from os import path
import sys
ROOT = path.join(path.abspath(path.dirname(__file__)), '..')
sys.path.insert(0, ROOT)
| 118 | Python | .py | 4 | 28.25 | 60 | 0.716814 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
769 | test_pycallgraph.py | gak_pycallgraph/test/test_pycallgraph.py | from helpers import *
def test_start_no_outputs(pycg):
with pytest.raises(PyCallGraphException):
pycg.start()
def test_with_block_no_outputs(pycg):
with pytest.raises(PyCallGraphException):
with pycg:
pass
def test_get_tracer_class(pycg):
pycg.config.threaded = True
ass... | 458 | Python | .py | 13 | 29.692308 | 55 | 0.719178 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
770 | test_color.py | gak_pycallgraph/test/test_color.py | from helpers import *
def test_bad_range():
with pytest.raises(ColorException):
Color(0, 5, 0, 0)
with pytest.raises(ColorException):
Color(0, 0, -1, 0)
def test_hsv():
c = Color.hsv(0.1, 0.5, 0.75, 0.25)
assert c.r is 0.75
assert abs(c.g - 0.6) < 0.1 # Floating point comparison... | 565 | Python | .py | 16 | 30.5625 | 72 | 0.608133 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
771 | test_graphviz.py | gak_pycallgraph/test/test_graphviz.py | from helpers import *
from calls import *
@pytest.fixture
def graphviz(temp):
g = GraphvizOutput()
g.output_file = temp
g.output_type = 'dot'
return g
def test_simple(graphviz):
with PyCallGraph(output=graphviz):
one_nop()
dot = open(graphviz.output_file).read()
os.unlink(graphvi... | 414 | Python | .py | 15 | 23.333333 | 47 | 0.677665 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
772 | test_output.py | gak_pycallgraph/test/test_output.py | from helpers import *
def test_set_config():
'''Should not raise!'''
Output().set_config(Config())
| 109 | Python | .py | 4 | 23.75 | 33 | 0.660194 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
773 | test_gephi.py | gak_pycallgraph/test/test_gephi.py | from helpers import *
from calls import *
@pytest.fixture
def gephi(temp):
g = GephiOutput()
g.output_file = temp
return g
def test_simple(gephi):
with PyCallGraph(output=gephi):
one_nop()
generated = open(gephi.output_file).read()
os.unlink(gephi.output_file)
assert 'nodedef> n... | 524 | Python | .py | 16 | 28.4375 | 63 | 0.717694 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
774 | test_util.py | gak_pycallgraph/test/test_util.py | from helpers import *
def test_human_readable_biyte():
hrb = Util.human_readable_bibyte
assert hrb(0) == '0.0B'
assert hrb(1024) == '1.0KiB'
assert hrb(1024 * 5.2) == '5.2KiB'
assert hrb(1024 * 1024 * 5.2) == '5.2MiB'
assert hrb(1024 * 1024 * 1024 * 5.2) == '5.2GiB'
assert hrb(1024 * 1024 ... | 513 | Python | .py | 12 | 38.25 | 69 | 0.577154 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
775 | test_config.py | gak_pycallgraph/test/test_config.py | from helpers import *
def test_init():
assert Config().groups
assert Config(groups=False).groups is False
| 116 | Python | .py | 4 | 25.5 | 47 | 0.745455 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
776 | helpers.py | gak_pycallgraph/test/helpers.py | # flake8: noqa
import time
import pytest
import fix_path
from pycallgraph import *
from pycallgraph.tracer import *
from pycallgraph.output import *
def wait_100ms():
time.sleep(0.1)
def wait_200ms():
time.sleep(0.2)
| 231 | Python | .py | 11 | 18.727273 | 32 | 0.775701 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
777 | test_decorators.py | gak_pycallgraph/test/test_decorators.py | import pytest
import pycallgraph
from pycallgraph import PyCallGraphException
from pycallgraph.output import GephiOutput, GraphvizOutput
@pycallgraph.decorators.trace(output=GraphvizOutput())
def print_something():
print("hello")
@pycallgraph.decorators.trace(output=GephiOutput())
def print_foo():
print("f... | 775 | Python | .py | 24 | 28.833333 | 58 | 0.764946 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
778 | test_trace_processor.py | gak_pycallgraph/test/test_trace_processor.py | import re
import sys
from helpers import *
import calls
from pycallgraph.tracer import TraceProcessor
@pytest.fixture
def trace_processor(config):
return TraceProcessor([], config)
def test_empty(trace_processor):
sys.settrace(trace_processor.process)
sys.settrace(None)
assert trace_processor.call... | 1,287 | Python | .py | 40 | 27.425 | 66 | 0.702197 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
779 | colors.py | gak_pycallgraph/examples/graphviz/colors.py | #!/usr/bin/env python
'''
This example demonstrates several different methods on colouring your graph.
See U{http://www.graphviz.org/doc/info/attrs.html#k:color} for details on
how to return colour formats to Graphviz.
'''
import random
from pycallgraph import PyCallGraph
from pycallgraph import Config
from pycallgra... | 2,037 | Python | .py | 60 | 29 | 77 | 0.678937 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
780 | filter.py | gak_pycallgraph/examples/graphviz/filter.py | #!/usr/bin/env python
'''
This example demonstrates the use of filtering.
'''
import time
from pycallgraph import PyCallGraph
from pycallgraph import Config
from pycallgraph import GlobbingFilter
from pycallgraph.output import GraphvizOutput
class Banana:
def __init__(self):
pass
def eat(self):
... | 2,083 | Python | .py | 82 | 19.439024 | 61 | 0.628934 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
781 | large.py | gak_pycallgraph/examples/graphviz/large.py | #!/usr/bin/env python
'''
This example is trying to make a large graph. You'll need some internet access
for this to work.
'''
from pycallgraph import PyCallGraph
from pycallgraph import Config
from pycallgraph.output import GraphvizOutput
def main():
graphviz = GraphvizOutput()
graphviz.output_file = 'large... | 600 | Python | .py | 18 | 29.555556 | 78 | 0.727431 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
782 | regexp.py | gak_pycallgraph/examples/graphviz/regexp.py | #!/usr/bin/env python
'''
This example demonstrates the internal workings of a regular expression lookup.
'''
import re
from pycallgraph import PyCallGraph
from pycallgraph import Config
from pycallgraph.output import GraphvizOutput
def main():
graphviz = GraphvizOutput()
graphviz.output_file = 'regexp.png'
... | 851 | Python | .py | 34 | 19.823529 | 79 | 0.640199 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
783 | basic.py | gak_pycallgraph/examples/graphviz/basic.py | #!/usr/bin/env python
'''
This example demonstrates a simple use of pycallgraph.
'''
from pycallgraph import PyCallGraph
from pycallgraph.output import GraphvizOutput
class Banana:
def eat(self):
pass
class Person:
def __init__(self):
self.no_bananas()
def no_bananas(self):
se... | 800 | Python | .py | 29 | 21.965517 | 54 | 0.64465 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
784 | all.py | gak_pycallgraph/examples/graphviz/all.py | #!/usr/bin/env python
'''
Execute all pycallgraph examples in this directory.
'''
from glob import glob
examples = glob('*.py')
examples.remove('all.py')
for example in examples:
print(example)
execfile(example)
| 222 | Python | .py | 10 | 20.2 | 51 | 0.747619 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
785 | grouper.py | gak_pycallgraph/examples/graphviz/grouper.py | #!/usr/bin/env python
'''
This example demonstrates the use of grouping.
'''
from pycallgraph import PyCallGraph
from pycallgraph import Config
from pycallgraph import GlobbingFilter
from pycallgraph import Grouper
from pycallgraph.output import GraphvizOutput
import example_with_submodules
def run(name, trace_groupe... | 1,579 | Python | .py | 53 | 24.377358 | 63 | 0.674403 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
786 | import.py | gak_pycallgraph/examples/graphviz/import.py | #!/usr/bin/env python
'''
This example shows the interals of certain Python modules when they are being
imported.
'''
from pycallgraph import PyCallGraph
from pycallgraph import Config
from pycallgraph.output import GraphvizOutput
def main():
import_list = (
'pickle',
'htmllib',
'urllib2',... | 623 | Python | .py | 22 | 23.636364 | 77 | 0.676174 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
787 | recursive.py | gak_pycallgraph/examples/graphviz/recursive.py | #!/usr/bin/env python
'''
This example demonstrates a simple recursive call.
'''
from pycallgraph import PyCallGraph
from pycallgraph.output import GraphvizOutput
def factorial(n):
if n == 1:
return 1
return n * factorial(n - 1)
def main():
graphviz = GraphvizOutput()
graphviz.output_file = ... | 472 | Python | .py | 18 | 22 | 50 | 0.669643 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
788 | submodule_two.py | gak_pycallgraph/examples/graphviz/example_with_submodules/submodule_two.py | from helpers import helper
class SubmoduleTwo(object):
def __init__(self):
self.two = 2
def report(self):
return helper(self.two)
| 157 | Python | .py | 6 | 20.666667 | 31 | 0.655405 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
789 | example_with_submodules.py | gak_pycallgraph/examples/graphviz/example_with_submodules/example_with_submodules.py | from submodule_one import SubmoduleOne
from submodule_two import SubmoduleTwo
def main():
s1 = SubmoduleOne()
s1.report()
s2 = SubmoduleTwo()
s2.report()
if __name__ == "__main__":
main()
| 212 | Python | .py | 9 | 19.888889 | 38 | 0.668342 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
790 | submodule_one.py | gak_pycallgraph/examples/graphviz/example_with_submodules/submodule_one.py | class SubmoduleOne(object):
def __init__(self):
self.one = 1
def report(self):
return self.one
| 120 | Python | .py | 5 | 18 | 27 | 0.596491 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
791 | large.py | gak_pycallgraph/examples/gephi/large.py | #!/usr/bin/env python
'''
This example is trying to make a large graph. You'll need some internet access
for this to work.
'''
from pycallgraph import PyCallGraph
from pycallgraph.output import GephiOutput
def main():
gephi = GephiOutput()
gephi.output_file = 'large.gdf'
with PyCallGraph(output=gephi):
... | 498 | Python | .py | 16 | 27.25 | 78 | 0.705882 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
792 | basic.py | gak_pycallgraph/examples/gephi/basic.py | #!/usr/bin/env python
'''
This example demonstrates a simple use of pycallgraph.
'''
from pycallgraph import PyCallGraph
from pycallgraph.output import GephiOutput
class Banana:
def eat(self):
pass
class Person:
def __init__(self):
self.no_bananas()
def no_bananas(self):
self.... | 785 | Python | .py | 29 | 21.448276 | 54 | 0.637466 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
793 | all.py | gak_pycallgraph/examples/gephi/all.py | #!/usr/bin/env python
'''
Execute all pycallgraph examples in this directory.
'''
from glob import glob
examples = glob('*.py')
examples.remove('all.py')
for example in examples:
print(example)
execfile(example)
| 222 | Python | .py | 10 | 20.2 | 51 | 0.747619 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
794 | update_readme.py | gak_pycallgraph/docs/update_readme.py | #!/usr/bin/env python
'''
This script copies the index.rst page from the Sphinx documentation, modifies
it slightly so refs point to the correct place.
'''
import re
import os
import sys
import shutil
class GithubReadmeMaker(object):
def __init__(self):
self.root = os.path.abspath(os.path.dirname(__file_... | 1,666 | Python | .py | 51 | 24.745098 | 77 | 0.563046 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
795 | conf.py | gak_pycallgraph/docs/conf.py | # -*- coding: utf-8 -*-
#
# Python Call Graph documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 24 17:23:48 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated fil... | 8,350 | Python | .py | 185 | 43.643243 | 114 | 0.731349 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
796 | generate.py | gak_pycallgraph/docs/examples/generate.py | #!/usr/bin/env python
import hashlib
import subprocess
import yaml
INDEX_TEMPLATE = '''
Examples
========
.. toctree::
:maxdepth: 3
{}
'''
IMAGE_TEMPLATE = '''
.. _{0[name]}_example:
{0[title]}
===================
{0[description]}
Source Code
-----------
.. literalinclude:: {0[script]}
Generated Image... | 1,501 | Python | .py | 48 | 27.270833 | 153 | 0.628953 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
797 | regexp.py | gak_pycallgraph/docs/examples/regexp.py | #!/usr/bin/env python
'''
Runs a regular expression over the first few hundred words in a dictionary to
find if any words start and end with the same letter, and having two of the
same letters in a row.
'''
import argparse
import re
from pycallgraph import PyCallGraph
from pycallgraph import Config
from pycallgraph.ou... | 1,449 | Python | .py | 43 | 26.348837 | 77 | 0.623833 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
798 | basic.py | gak_pycallgraph/docs/examples/basic.py | #!/usr/bin/env python
'''
This example demonstrates a simple use of pycallgraph.
'''
from pycallgraph import PyCallGraph
from pycallgraph.output import GraphvizOutput
class Banana:
def eat(self):
pass
class Person:
def __init__(self):
self.no_bananas()
def no_bananas(self):
se... | 800 | Python | .py | 29 | 21.965517 | 54 | 0.64465 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |
799 | generate.py | gak_pycallgraph/docs/guide/filtering/generate.py | #!/usr/bin/env python
import hashlib
import subprocess
import yaml
items = yaml.load(open('examples.yml'))
print(items)
changed = False
for script, save_md5 in items.iteritems():
new_md5 = hashlib.md5(open(script).read()).hexdigest()
if new_md5 == save_md5:
continue
changed = True
items[sc... | 458 | Python | .py | 16 | 25.1875 | 58 | 0.698851 | gak/pycallgraph | 1,816 | 335 | 61 | GPL-2.0 | 9/5/2024, 5:08:15 PM (Europe/Amsterdam) |