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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
26,300 | backend_pdf.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_pdf.py | # -*- coding: iso-8859-1 -*-
"""
A PDF matplotlib backend (not yet complete)
Author: Jouni K Seppänen <jks@iki.fi>
"""
from __future__ import division
import os
import re
import sys
import time
import warnings
import zlib
import numpy as npy
from cStringIO import StringIO
from datetime import datetime
from math impo... | 71,773 | Python | .py | 1,642 | 31.643727 | 96 | 0.547361 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,301 | backend_macosx.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_macosx.py | from __future__ import division
import os
import numpy
from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
FigureManagerBase, FigureCanvasBase, NavigationToolbar2
from matplotlib.cbook import maxdict
from matplotlib.figure import Figure
from matplotl... | 15,397 | Python | .py | 360 | 33.963889 | 93 | 0.614381 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,302 | backend_wx.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_wx.py | from __future__ import division
"""
backend_wx.py
A wxPython backend for matplotlib, based (very heavily) on
backend_template.py and backend_gtk.py
Author: Jeremy O'Donoghue (jeremy@o-donoghue.com)
Derived from original copyright work by John Hunter
(jdhunter@ace.bsd.uchicago.edu)
Copyright (C) Jeremy O'Don... | 77,038 | Python | .py | 1,793 | 34.006135 | 174 | 0.585817 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,303 | backend_cocoaagg.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_cocoaagg.py | from __future__ import division
"""
backend_cocoaagg.py
A native Cocoa backend via PyObjC in OSX.
Author: Charles Moad (cmoad@users.sourceforge.net)
Notes:
- Requires PyObjC (currently testing v1.3.7)
- The Tk backend works nicely on OSX. This code
primarily serves as an example of embedding a
matpl... | 8,970 | Python | .py | 222 | 33.238739 | 176 | 0.669962 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,304 | backend_tkagg.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py | # Todd Miller jmiller@stsci.edu
from __future__ import division
import os, sys, math
import Tkinter as Tk, FileDialog
import tkagg # Paint image to Tk photo blitter extension
from backend_agg import FigureCanvasAgg
import os.path
import matplotlib
from matplotlib.cbook import is_string_like
from ... | 24,593 | Python | .py | 608 | 30.379934 | 166 | 0.582998 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,305 | tkagg.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/tkagg.py | import _tkagg
import Tkinter as Tk
def blit(photoimage, aggimage, bbox=None, colormode=1):
tk = photoimage.tk
if bbox is not None:
bbox_array = bbox.__array__()
else:
bbox_array = None
try:
tk.call("PyAggImagePhoto", photoimage, id(aggimage), colormode, id(bbox_array))
exce... | 1,003 | Python | .py | 29 | 27.37931 | 91 | 0.635052 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,306 | backend_agg.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_agg.py | """
An agg http://antigrain.com/ backend
Features that are implemented
* capstyles and join styles
* dashes
* linewidth
* lines, rectangles, ellipses
* clipping to a rectangle
* output to RGBA and PNG
* alpha blending
* DPI scaling properly - everything scales properly (dashes, linewidths, etc)
* draw polygo... | 11,729 | Python | .py | 274 | 33.058394 | 114 | 0.60279 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,307 | backend_qtagg.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qtagg.py | """
Render to qt from agg
"""
from __future__ import division
import os, sys
import matplotlib
from matplotlib import verbose
from matplotlib.figure import Figure
from backend_agg import FigureCanvasAgg
from backend_qt import qt, FigureManagerQT, FigureCanvasQT,\
show, draw_if_interactive, backend_version, \
... | 4,972 | Python | .py | 121 | 31.636364 | 87 | 0.612401 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,308 | backend_gdk.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_gdk.py | from __future__ import division
import math
import os
import sys
import warnings
def fn_name(): return sys._getframe(1).f_code.co_name
import gobject
import gtk; gdk = gtk.gdk
import pango
pygtk_version_required = (2,2,0)
if gtk.pygtk_version < pygtk_version_required:
raise ImportError ("PyGTK %d.%d.%d is install... | 15,968 | Python | .py | 360 | 34.216667 | 80 | 0.582183 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,309 | backend_gtkagg.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_gtkagg.py | """
Render to gtk from agg
"""
from __future__ import division
import os
import matplotlib
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\
show, draw_if_interactive,\
error_ms... | 4,184 | Python | .py | 94 | 37.170213 | 126 | 0.680914 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,310 | backend_wxagg.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_wxagg.py | from __future__ import division
"""
backend_wxagg.py
A wxPython backend for Agg. This uses the GUI widgets written by
Jeremy O'Donoghue (jeremy@o-donoghue.com) and the Agg backend by John
Hunter (jdhunter@ace.bsd.uchicago.edu)
Copyright (C) 2003-5 Jeremy O'Donoghue, John Hunter, Illinois Institute of
Technolo... | 9,051 | Python | .py | 233 | 32.527897 | 78 | 0.663621 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,311 | backend_template.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_template.py | """
This is a fully functional do nothing backend to provide a template to
backend writers. It is fully functional in that you can select it as
a backend with
import matplotlib
matplotlib.use('Template')
and your matplotlib scripts will (should!) run without error, though
no output is produced. This provides a ... | 8,806 | Python | .py | 199 | 39.748744 | 87 | 0.691426 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,312 | backend_qt4agg.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qt4agg.py | """
Render to qt from agg
"""
from __future__ import division
import os, sys
import matplotlib
from matplotlib.figure import Figure
from backend_agg import FigureCanvasAgg
from backend_qt4 import QtCore, QtGui, FigureManagerQT, FigureCanvasQT,\
show, draw_if_interactive, backend_version, \
NavigationToolba... | 4,985 | Python | .py | 124 | 31.008065 | 84 | 0.615305 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,313 | __init__.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/__init__.py |
import matplotlib
import inspect
import warnings
# ipython relies on interactive_bk being defined here
from matplotlib.rcsetup import interactive_bk
__all__ = ['backend','show','draw_if_interactive',
'new_figure_manager', 'backend_version']
backend = matplotlib.get_backend() # validates, to match all_bac... | 2,225 | Python | .py | 44 | 44.045455 | 82 | 0.684502 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,314 | backend_ps.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_ps.py | """
A PostScript backend, which can produce both PostScript .ps and .eps
"""
from __future__ import division
import glob, math, os, shutil, sys, time
def _fn_name(): return sys._getframe(1).f_code.co_name
try:
from hashlib import md5
except ImportError:
from md5 import md5 #Deprecated in 2.5
from tempfile im... | 50,262 | Python | .py | 1,260 | 30.537302 | 168 | 0.573844 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,315 | backend_mixed.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_mixed.py | from matplotlib._image import frombuffer
from matplotlib.backends.backend_agg import RendererAgg
class MixedModeRenderer(object):
"""
A helper class to implement a renderer that switches between
vector and raster drawing. An example may be a PDF writer, where
most things are drawn with PDF vector comm... | 3,776 | Python | .py | 80 | 37.75 | 88 | 0.651902 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,316 | backend_emf.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_emf.py | """
Enhanced Metafile backend. See http://pyemf.sourceforge.net for the EMF
driver library.
"""
from __future__ import division
try:
import pyemf
except ImportError:
raise ImportError('You must first install pyemf from http://pyemf.sf.net')
import os,sys,math,re
from matplotlib import verbose, __version__,... | 22,336 | Python | .py | 506 | 35.379447 | 285 | 0.610825 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,317 | backend_svg.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_svg.py | from __future__ import division
import os, codecs, base64, tempfile, urllib, gzip, cStringIO
try:
from hashlib import md5
except ImportError:
from md5 import md5 #Deprecated in 2.5
from matplotlib import verbose, __version__, rcParams
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
... | 23,593 | Python | .py | 539 | 31.729128 | 136 | 0.523057 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,318 | backend_fltkagg.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_fltkagg.py | """
A backend for FLTK
Copyright: Gregory Lielens, Free Field Technologies SA and
John D. Hunter 2004
This code is released under the matplotlib license
"""
from __future__ import division
import os, sys, math
import fltk as Fltk
from backend_agg import FigureCanvasAgg
import os.path
import matplotli... | 20,839 | Python | .py | 551 | 29.076225 | 166 | 0.604381 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,319 | backend_qt.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qt.py | from __future__ import division
import math
import os
import sys
import matplotlib
from matplotlib import verbose
from matplotlib.cbook import is_string_like, onetrue
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
from mat... | 16,846 | Python | .py | 392 | 34.408163 | 90 | 0.619956 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,320 | backend_gtk.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py | from __future__ import division
import os, sys
def fn_name(): return sys._getframe(1).f_code.co_name
try:
import gobject
import gtk; gdk = gtk.gdk
import pango
except ImportError:
raise ImportError("Gtk* backend requires pygtk to be installed.")
pygtk_version_required = (2,2,0)
if gtk.pygtk_version <... | 43,991 | Python | .py | 1,045 | 31.34067 | 166 | 0.575965 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,321 | backend_cairo.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_cairo.py | """
A Cairo backend for matplotlib
Author: Steve Chaplin
Cairo is a vector graphics library with cross-device output support.
Features of Cairo:
* anti-aliasing
* alpha channel
* saves image files as PNG, PostScript, PDF
http://cairographics.org
Requires (in order, all available from Cairo website):
cairo, pyc... | 16,706 | Python | .py | 391 | 32.754476 | 94 | 0.574954 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,322 | backend_gtkcairo.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_gtkcairo.py | """
GTK+ Matplotlib interface using cairo (not GDK) drawing operations.
Author: Steve Chaplin
"""
import gtk
if gtk.pygtk_version < (2,7,0):
import cairo.gtk
from matplotlib.backends import backend_cairo
from matplotlib.backends.backend_gtk import *
backend_version = 'PyGTK(%d.%d.%d) ' % gtk.pygtk_version + \
... | 2,207 | Python | .py | 52 | 36.115385 | 77 | 0.678037 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,323 | backend_qt4.py | numenta_nupic-legacy/external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qt4.py | from __future__ import division
import math
import os
import sys
import matplotlib
from matplotlib import verbose
from matplotlib.cbook import is_string_like, onetrue
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, IdleEvent, curso... | 20,664 | Python | .py | 459 | 35.115468 | 90 | 0.621144 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,324 | run_experiment_classifier_diff.py | numenta_nupic-legacy/scripts/run_experiment_classifier_diff.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 1,933 | Python | .py | 44 | 40.795455 | 77 | 0.702184 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,325 | run_opf_experiment.py | numenta_nupic-legacy/scripts/run_opf_experiment.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 1,188 | Python | .py | 26 | 44.423077 | 77 | 0.678479 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,326 | run_nupic_tests.py | numenta_nupic-legacy/scripts/run_nupic_tests.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 6,601 | Python | .py | 213 | 27.089202 | 90 | 0.672245 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,327 | temporal_memory_performance_benchmark.py | numenta_nupic-legacy/scripts/temporal_memory_performance_benchmark.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014-2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... | 11,951 | Python | .py | 313 | 31.329073 | 83 | 0.655149 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,328 | run_swarm.py | numenta_nupic-legacy/scripts/run_swarm.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 7,908 | Python | .py | 154 | 46.201299 | 96 | 0.694689 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,329 | enc_profile.py | numenta_nupic-legacy/scripts/profiling/enc_profile.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 1,881 | Python | .py | 46 | 38.630435 | 100 | 0.705431 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,330 | sp_profile.py | numenta_nupic-legacy/scripts/profiling/sp_profile.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 2,972 | Python | .py | 75 | 35.64 | 98 | 0.693162 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,331 | tm_profile.py | numenta_nupic-legacy/scripts/profiling/tm_profile.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 2,253 | Python | .py | 52 | 40.826923 | 98 | 0.706447 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,332 | profile_opf_memory.py | numenta_nupic-legacy/scripts/profiling/profile_opf_memory.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 2,054 | Python | .py | 52 | 35.711538 | 72 | 0.645258 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,333 | install_python_pip.ps1 | numenta_nupic-legacy/ci/appveyor/install_python_pip.ps1 | # Sample script to install Python and pip under Windows
# Authors: Olivier Grisel and Kyle Kastner
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
$BASE_URL = "https://www.python.org/ftp/python/"
$GET_PIP_URL = "http://releases.numenta.org/pip/1ebd3cb7a5a3073058d0c9552ab074bd/get-pip.p... | 3,596 | Python | .pyt | 85 | 36.976471 | 123 | 0.668958 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,334 | data_generator.pyw | numenta_nupic-legacy/examples/opf/tools/data_generator.pyw | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 13,486 | Python | .pyw | 292 | 39.609589 | 117 | 0.645181 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,335 | syntactic_sugar_test.py | numenta_nupic-legacy/tests/unit/nupic/engine/syntactic_sugar_test.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 4,744 | Python | .tac | 127 | 32.228346 | 72 | 0.64412 | numenta/nupic-legacy | 6,330 | 1,556 | 464 | AGPL-3.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,336 | setup.py | mhagger_git-imerge/setup.py | import errno
import subprocess
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
data_files = []
try:
completionsdir = subprocess.check_output(
["pkg-config", "--variable=completionsdir", "bash-completion"]
)
except OSError as e:
if e.errno != errno.... | 1,944 | Python | .py | 52 | 31.75 | 85 | 0.643879 | mhagger/git-imerge | 2,695 | 126 | 76 | GPL-2.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,337 | gitimerge.py | mhagger_git-imerge/gitimerge.py | # -*- coding: utf-8 -*-
# Copyright 2012-2013 Michael Haggerty <mhagger@alum.mit.edu>
#
# This file is part of git-imerge.
#
# git-imerge is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of th... | 145,733 | Python | .py | 3,587 | 30.036242 | 95 | 0.565752 | mhagger/git-imerge | 2,695 | 126 | 76 | GPL-2.0 | 9/5/2024, 5:13:42 PM (Europe/Amsterdam) |
26,338 | setup.py | kovidgoyal_calibre/setup.py | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import re
import sys
src_base = os.path.dirname(os.path.abspath(__file__))
def check_version_info():
with o... | 3,559 | Python | .py | 102 | 27.696078 | 117 | 0.58185 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,339 | publish.py | kovidgoyal_calibre/setup/publish.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import filecmp
import json
import os
import shutil
import subprocess
import sys
import tempfile
import time
from setup import Command, __version__, installer_names, require_c... | 11,875 | Python | .py | 281 | 31.800712 | 126 | 0.56547 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,340 | piper.py | kovidgoyal_calibre/setup/piper.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
import json
import os
import re
from contextlib import suppress
from setup.revendor import ReVendor
class PiperVoices(ReVendor):
description = 'Download the list of Piper voices'
NAME = 'piper_voices'
TAR_NAME... | 2,908 | Python | .py | 64 | 32.625 | 107 | 0.531382 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,341 | hosting.py | kovidgoyal_calibre/setup/hosting.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import json
import mimetypes
import os
import shutil
import sys
import time
from argparse import ArgumentParser, FileType
from collections import OrderedDict
from pprint import... | 19,191 | Python | .py | 483 | 28.424431 | 300 | 0.503916 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,342 | resources.py | kovidgoyal_calibre/setup/resources.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import errno
import glob
import json
import os
import re
import shutil
import zipfile
from zlib import compress
from polyglot.builtins import codepoint_to_chr, iteritems, i... | 13,044 | Python | .py | 292 | 33.496575 | 117 | 0.569426 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,343 | file-hosting-bw.py | kovidgoyal_calibre/setup/file-hosting-bw.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import os
import socket
import subprocess
BASE = '/srv/download/bw'
def main():
if not os.path.exists(BASE):
os.makedirs(BASE)
os.chdir(BASE)
for name in 'hours days months top10 summary'... | 1,274 | Python | .py | 47 | 22.425532 | 115 | 0.582923 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,344 | linux-installer.py | kovidgoyal_calibre/setup/linux-installer.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2009, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import absolute_import, division, print_function, unicode_literals
import errno
import hashlib
import os
import platform
import re
import shutil
import signal
import socket
import ssl
... | 33,426 | Python | .py | 773 | 35.010349 | 155 | 0.627198 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,345 | iso_codes.py | kovidgoyal_calibre/setup/iso_codes.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2023, Kovid Goyal <kovid at kovidgoyal.net>
import fnmatch
import optparse
import os
import shutil
import time
import zipfile
from contextlib import suppress
from functools import lru_cache
from io import BytesIO
from setup import Command, download_securely
@lru_cac... | 2,162 | Python | .py | 50 | 35.42 | 108 | 0.631729 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,346 | revendor.py | kovidgoyal_calibre/setup/revendor.py | #!/usr/bin/env python
# License: GPL v3 Copyright: 2019, Eli Schwartz <eschwartz@archlinux.org>
import os
import shutil
import tarfile
import time
from io import BytesIO
from setup import Command, download_securely, is_ci
class ReVendor(Command):
# NAME = TAR_NAME = VERSION = DOWNLOAD_URL = ''
CAN_USE_SYST... | 2,725 | Python | .py | 65 | 31.861538 | 109 | 0.581791 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,347 | browser_data.py | kovidgoyal_calibre/setup/browser_data.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
import bz2
import os
import ssl
import sys
from datetime import datetime, timezone
from urllib.request import urlopen
def download_from_calibre_server(url):
ca = os.path.join(sys.resources_location, 'calibre-ebook-root... | 1,762 | Python | .py | 45 | 33.177778 | 98 | 0.643988 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,348 | unix-ci.py | kovidgoyal_calibre/setup/unix-ci.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
import glob
import io
import os
import shlex
import subprocess
import sys
import tarfile
import time
from tempfile import NamedTemporaryFile
from urllib.request import urlopen
_plat = sys.platform.lower()
ismacos = 'darwin'... | 5,794 | Python | .py | 153 | 31 | 148 | 0.600678 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,349 | test.py | kovidgoyal_calibre/setup/test.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import os
import subprocess
import sys
from setup import Command, is_ci, ismacos, iswindows
TEST_MODULES = frozenset('srv db polish opf css docx cfi matcher icu smartypants build misc dbcli ebooks'.split())
class BaseTes... | 4,604 | Python | .py | 70 | 54.357143 | 158 | 0.637935 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,350 | upload.py | kovidgoyal_calibre/setup/upload.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import glob
import hashlib
import json
import os
import shutil
import stat
import subprocess
import sys
import time
from subprocess import check_call
from tempfile import Na... | 12,941 | Python | .py | 336 | 29.27381 | 135 | 0.555174 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,351 | plugins_mirror.py | kovidgoyal_calibre/setup/plugins_mirror.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2013, Kovid Goyal <kovid at kovidgoyal.net>
# Imports {{{
import argparse
import ast
import atexit
import bz2
import errno
import glob
import gzip
import io
import json
import os
import random
import re
import socket
import stat
import subprocess
import sys
import tem... | 26,900 | Python | .py | 658 | 33.545593 | 148 | 0.600658 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,352 | gui.py | kovidgoyal_calibre/setup/gui.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from contextlib import suppress
from setup import Command, __appname__
class GUI(Command):
description = 'Compile all GUI forms'
PATH = os.path.join(Co... | 3,160 | Python | .py | 72 | 32.652778 | 109 | 0.570081 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,353 | polib.py | kovidgoyal_calibre/setup/polib.py | # -* coding: utf-8 -*-
#
# License: MIT (see LICENSE file provided)
# vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
"""
**polib** allows you to manipulate, create, modify gettext files (pot, po and
mo files). You can load existing files, iterate through it's entries, add,
modify entries, comments or metada... | 61,901 | Python | .py | 1,579 | 28.028499 | 79 | 0.531541 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,354 | lc_data.py | kovidgoyal_calibre/setup/lc_data.py | #!/usr/bin/env python3
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
# A database of locale data for all the languages known to glibc
# To regenerate run:
# sudo locale-gen -A && python3 lc_time.py
import locale
import os
import pprint
import sys
def generate_data():
def... | 203,563 | Python | .py | 3,892 | 40.984841 | 157 | 0.428652 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,355 | check.py | kovidgoyal_calibre/setup/check.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import errno
import hashlib
import json
import os
import subprocess
from setup import Command, build_cache_dir, dump_json, edit_file
class Message:
def __init__(self... | 4,596 | Python | .py | 115 | 29.243478 | 95 | 0.537857 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,356 | win-ci.py | kovidgoyal_calibre/setup/win-ci.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import io
import os
import subprocess
import sys
import tarfile
import time
def printf(*args, **kw):
print(*args, **kw)
sys.stdout.flush()
def download_file(url):
from urllib.request import urlopen
count ... | 2,783 | Python | .py | 85 | 26.447059 | 138 | 0.599028 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,357 | installers.py | kovidgoyal_calibre/setup/installers.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import binascii
import json
import os
import subprocess
import sys
from setup import Command
d = os.path.dirname
def get_paths():
base = d(d(os.path.abspath(__file__)))
bypy = os.path.join(d(base), 'bypy')
by... | 9,917 | Python | .py | 241 | 32.224066 | 141 | 0.585221 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,358 | translations.py | kovidgoyal_calibre/setup/translations.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import errno
import glob
import hashlib
import json
import os
import re
import shlex
import shutil
import subprocess
import sys
import tempfile
import textwrap
import time
f... | 34,515 | Python | .py | 758 | 33.234828 | 150 | 0.535653 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,359 | git_pre_commit_hook.py | kovidgoyal_calibre/setup/git_pre_commit_hook.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2008, Kovid Goyal <kovid at kovidgoyal.net>
import json
import os
import re
import socket
import subprocess
import sys
import urllib.error
import urllib.parse
import urllib.request
from lxml import html
'''
Hook to make the commit command automatically close bugs wh... | 2,649 | Python | .py | 70 | 30.357143 | 114 | 0.598204 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,360 | hyphenation.py | kovidgoyal_calibre/setup/hyphenation.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
import glob
import hashlib
import json
import os
import shutil
import tarfile
from io import BytesIO
from setup.revendor import ReVendor
def locales_from_dicts(dicts):
ans = {}
for path in dicts:
name = bna... | 4,128 | Python | .py | 101 | 31.29703 | 120 | 0.5846 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,361 | __init__.py | kovidgoyal_calibre/setup/__init__.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import errno
import hashlib
import os
import re
import shutil
import subprocess
import sys
import tempfile
import time
from contextlib import contextmanager
from functools i... | 9,584 | Python | .py | 240 | 33.108333 | 131 | 0.613827 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,362 | git_version.py | kovidgoyal_calibre/setup/git_version.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2019, Eli Schwartz <eschwartz@archlinux.org>
import re
import subprocess
from setup import Command
class GitVersion(Command):
description = 'Update the version from git metadata'
def run(self, opts):
constants_file = self.j(self.SRC, 'calibre', 'c... | 934 | Python | .py | 21 | 36.52381 | 85 | 0.598007 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,363 | parallel_build.py | kovidgoyal_calibre/setup/parallel_build.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import itertools
import json
import os
import shlex
import subprocess
import sys
from collections import namedtuple
from contextlib import closing
from functools import partial
from multiprocessing.pool import ... | 3,652 | Python | .py | 111 | 25.63964 | 113 | 0.609846 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,364 | build_environment.py | kovidgoyal_calibre/setup/build_environment.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
import re
import shutil
import subprocess
from functools import lru_cache
from setup import isfreebsd, ishaiku, islinux, ismacos, iswindows
NMAKE = RC = msvc = M... | 8,573 | Python | .py | 190 | 39.915789 | 151 | 0.639755 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,365 | liberation.py | kovidgoyal_calibre/setup/liberation.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
import glob
import os
from setup.revendor import ReVendor
class LiberationFonts(ReVendor):
description = 'Download the Liberation fonts'
NAME = 'liberation_fonts'
TAR_NAME = 'liberation-fonts'
VERSION = '2... | 1,698 | Python | .py | 38 | 36.368421 | 120 | 0.655758 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,366 | wincross.py | kovidgoyal_calibre/setup/wincross.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2023, Kovid Goyal <kovid at kovidgoyal.net>
# See https://github.com/mstorsjo/msvc-wine/blob/master/vsdownload.py and
# https://github.com/Jake-Shadle/xwin/blob/main/src/lib.rs for the basic logic
# used to download and install the needed VisualStudio packages
import ... | 18,285 | Python | .py | 406 | 35.571429 | 148 | 0.590891 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,367 | git_post_checkout_hook.py | kovidgoyal_calibre/setup/git_post_checkout_hook.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import os
import subprocess
import sys
prev_rev, current_rev, flags = sys.argv[1:]
def get_branch_name(rev):
return subprocess.check_output(['git', 'name-rev', '--name-only', '--refs=refs/heads/*', rev]).... | 1,002 | Python | .py | 21 | 42.809524 | 122 | 0.662204 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,368 | changelog.py | kovidgoyal_calibre/setup/changelog.py | #!/usr/bin/env python
# License: GPL v3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
from datetime import date
def parse(raw, parse_dates=True):
entries = []
current_entry = None
current_section = 'new features'
def normal(linenum, line, stripped_line):
nonlocal current_entry, curr... | 6,448 | Python | .py | 158 | 28.626582 | 139 | 0.510438 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,369 | git_post_rewrite_hook.py | kovidgoyal_calibre/setup/git_post_rewrite_hook.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import os
import subprocess
import sys
base = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
os.chdir(base)
action = [x.decode('utf-8') if isinstance(x, bytes) else x for x in sys.argv[1:]][0]
i... | 404 | Python | .py | 11 | 34.909091 | 84 | 0.688144 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,370 | mathjax.py | kovidgoyal_calibre/setup/mathjax.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import json
import os
from hashlib import sha1
from setup.revendor import ReVendor
class MathJax(ReVendor):
description = 'Create the MathJax bundle'
NAME = '... | 2,043 | Python | .py | 44 | 37.75 | 131 | 0.617396 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,371 | vcvars.py | kovidgoyal_calibre/setup/vcvars.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import ctypes.wintypes
import os
import re
import subprocess
import sys
from functools import lru_cache
from glob import glob
CSIDL_PROGRAM_FILES = 38
CSIDL_PROGRAM_FILESX86 = 42
@lru_cache
def get_program_files_location(w... | 4,259 | Python | .py | 125 | 25.864 | 76 | 0.600195 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,372 | xwin.py | kovidgoyal_calibre/setup/xwin.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2023, Kovid Goyal <kovid at kovidgoyal.net>
import os
import runpy
import shutil
from setup import Command
class XWin(Command):
description = 'Install the Windows headers for cross compilation'
def run(self, opts):
if not shutil.which('msiextract')... | 863 | Python | .py | 21 | 33.904762 | 92 | 0.643541 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,373 | run-calibre-worker.py | kovidgoyal_calibre/setup/run-calibre-worker.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import os
import sys
sys.setup_dir = os.path.dirname(os.path.abspath(__file__))
SRC = os.path.abspath(os.path.join(os.path.dirname(sys.setup_dir), 'src'))
sys.path.insert(0, SRC)
sys.resources_location = os.path.join(os.pat... | 506 | Python | .py | 12 | 40.75 | 74 | 0.756646 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,374 | csslint.py | kovidgoyal_calibre/setup/csslint.py | #!/usr/bin/env python
# License: GPL v3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
import os
import shutil
import subprocess
from setup import Command
class CSSLint(Command):
description = 'Update the bundled copy of stylelint'
NAME = 'stylelint-bundle.min.js'
DOWNLOAD_URL = 'https://github.... | 1,015 | Python | .py | 24 | 35.458333 | 95 | 0.657172 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,375 | build.py | kovidgoyal_calibre/setup/build.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import errno
import glob
import json
import os
import shlex
import shutil
import subprocess
import sys
import sysconfig
import textwrap
from functools import partial
from typ... | 29,738 | Python | .py | 672 | 34.4375 | 146 | 0.580121 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,376 | install.py | kovidgoyal_calibre/setup/install.py | #!/usr/bin/env python
# License: GPLv3 Copyright: 2009, Kovid Goyal <kovid at kovidgoyal.net>
import atexit
import glob
import os
import shutil
import subprocess
import sys
import tempfile
import textwrap
import time
from setup import Command, __appname__, __version__, basenames, functions, isbsd, ishaiku, islinux, ... | 16,611 | Python | .py | 342 | 38.070175 | 157 | 0.607698 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,377 | commands.py | kovidgoyal_calibre/setup/commands.py | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
__all__ = [
'pot', 'translations', 'get_translations', 'iso_data', 'iso639', 'iso3166',
'build', 'mathjax', 'man_pages',
'gui',
'git_version',
'develop',... | 3,248 | Python | .py | 92 | 33.173913 | 133 | 0.742619 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,378 | init_env.py | kovidgoyal_calibre/bypy/init_env.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
import json
import os
import re
import subprocess
import sys
from bypy.constants import LIBDIR, PREFIX, PYTHON, build_dir, islinux, ismacos, worker_env
from bypy.constants import SRC as CALIBRE_DIR
... | 5,246 | Python | .py | 169 | 25.526627 | 124 | 0.600673 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,379 | run-python.h | kovidgoyal_calibre/bypy/run-python.h | /*
* Copyright (C) 2019 Kovid Goyal <kovid at kovidgoyal.net>
*
* Distributed under terms of the GPL3 license.
*/
#pragma once
#define PY_SSIZE_T_CLEAN
#include <stdio.h>
#include <stdbool.h>
#include <time.h>
#include <stdlib.h>
#include <stdarg.h>
#ifdef _WIN32
#include <string.h>
#define PATH_MAX MAX_PATH
#else... | 2,641 | Python | .py | 81 | 29.962963 | 116 | 0.717366 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,380 | sign.py | kovidgoyal_calibre/bypy/macos/sign.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import os
import plistlib
from glob import glob
from bypy.macos_sign import codesign, create_entitlements_file, make_certificate_useable, notarize_app, verify_signature
from bypy.utils import current... | 3,291 | Python | .py | 81 | 33.901235 | 120 | 0.662272 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,381 | __main__.py | kovidgoyal_calibre/bypy/macos/__main__.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import errno
import glob
import json
import operator
import os
import plistlib
import runpy
import shutil
import stat
import subprocess
import sys
import tempfile
import time
import zipfile
from funct... | 35,114 | Python | .py | 769 | 35.275683 | 150 | 0.579838 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,382 | site.py | kovidgoyal_calibre/bypy/macos/site.py | import builtins
import os
import sys
import _sitebuiltins
USER_SITE = None
def nuke_stdout():
# Redirect stdout, stdin and stderr to /dev/null
from calibre_extensions.speedup import detach
detach(os.devnull)
def set_helper():
builtins.help = _sitebuiltins._Helper()
def set_quit():
eof = 'Ctr... | 934 | Python | .py | 30 | 26.533333 | 72 | 0.670404 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,383 | __main__.py | kovidgoyal_calibre/bypy/windows/__main__.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import contextlib
import errno
import glob
import os
import re
import runpy
import shutil
import stat
import subprocess
import sys
import zipfile
from bypy.constants import CL, LINK, MT, PREFIX, RC,... | 24,040 | Python | .py | 535 | 37.564486 | 157 | 0.607018 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,384 | site.py | kovidgoyal_calibre/bypy/windows/site.py | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
# License: GPLv3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
import builtins
import os
import sys
from importlib import import_module
from importlib.machinery import EXTENSION_SUFFIXES
from importlib.util import spec_from_file_location... | 2,455 | Python | .py | 67 | 29.835821 | 103 | 0.651291 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,385 | wix.py | kovidgoyal_calibre/bypy/windows/wix.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import os
import shutil
from itertools import count
from bypy.constants import is64bit
from bypy.utils import run
WIX = os.path.expanduser('~/.dotnet/tools/wix.exe')
if is64bit:
UPGRADE_CODE = '... | 5,418 | Python | .py | 115 | 36.947826 | 117 | 0.563399 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,386 | __main__.py | kovidgoyal_calibre/bypy/linux/__main__.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import errno
import glob
import os
import shutil
import stat
import subprocess
import tarfile
import time
from functools import partial
from bypy.constants import LIBDIR, OUTPUT_DIR, PREFIX, python_m... | 13,337 | Python | .py | 278 | 40.363309 | 149 | 0.60518 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,387 | site.py | kovidgoyal_calibre/bypy/linux/site.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
import builtins
import os
import sys
import _sitebuiltins
USER_SITE = None
def set_quit():
eof = 'Ctrl-D (i.e. EOF)'
builtins.quit = _sitebuiltins.Quitter('quit', eof)
builtins.exit = ... | 1,362 | Python | .py | 34 | 35.5 | 81 | 0.686692 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,388 | make_ico_files.py | kovidgoyal_calibre/icons/make_ico_files.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import os
import shutil
import subprocess
import sys
d, j, a = (getattr(os.path, x) for x in ('dirname', 'join', 'abspath'))
base = d(a(__file__))
os.chdir(base)
imgsrc = j(d(base), '... | 1,318 | Python | .py | 31 | 36.419355 | 153 | 0.581577 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,389 | make_iconsets.py | kovidgoyal_calibre/icons/icns/make_iconsets.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import os
import shutil
import subprocess
import sys
d, j, a = (getattr(os.path, x) for x in ('dirname', 'join', 'abspath'))
base = d(a(__file__))
os.chdir(base)
imgsrc = j(d(d(base))... | 1,638 | Python | .py | 42 | 30.52381 | 153 | 0.544025 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,390 | template_ref_generate.py | kovidgoyal_calibre/manual/template_ref_generate.py | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import re
from collections import defaultdict
PREAMBLE = '''\
.. _templaterefcalibre-{}:
Reference for all built-in template language functions
===========... | 2,539 | Python | .py | 69 | 32.130435 | 78 | 0.65383 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,391 | conf.py | kovidgoyal_calibre/manual/conf.py | # -*- coding: utf-8 -*-
#
# calibre documentation build configuration file, created by
# sphinx-quickstart.py on Sun Mar 23 01:23:55 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pick... | 8,063 | Python | .py | 204 | 37.220588 | 111 | 0.716592 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,392 | sidebar_toc.py | kovidgoyal_calibre/manual/sidebar_toc.py | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from itertools import count
from docutils import nodes
from sphinx.environment.adapters.toctree import TocTree
id_counter = count()
ID = 'sidebar-collapsible-toc'
CSS = r'''
ID li {
list-style: none;
margin-left: 0;
padding-left: 0... | 2,365 | Python | .py | 73 | 27.39726 | 90 | 0.638167 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,393 | custom.py | kovidgoyal_calibre/manual/custom.py | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
# License: GPLv3 Copyright: 2008, Kovid Goyal <kovid at kovidgoyal.net>
import os
import re
from functools import partial
from calibre.linux import cli_index_strings, entry_points
from epub import EPUBHelpBuilder
from sphinx.util.console import ... | 13,611 | Python | .py | 289 | 40.33564 | 148 | 0.616441 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,394 | epub.py | kovidgoyal_calibre/manual/epub.py | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from calibre.ebooks.oeb.base import OPF
from calibre.ebooks.oeb.polish.check.links import UnreferencedResource,... | 4,196 | Python | .py | 82 | 41.426829 | 121 | 0.631926 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,395 | build.py | kovidgoyal_calibre/manual/build.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import os
import shutil
import subprocess
import sys
import tempfile
from functools import partial
j, d, a = os.path.join, os.path.dirname, os.path.abspath
BASE = d(a(__file__))
SPHINX... | 4,459 | Python | .py | 109 | 33.825688 | 110 | 0.607019 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,396 | __init__.py | kovidgoyal_calibre/manual/plugin_examples/helloworld/__init__.py | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize import FileTypePlugin
class HelloWorld(FileTypePlugin):
name = 'He... | 1,267 | Python | .py | 24 | 46.958333 | 95 | 0.639676 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,397 | __init__.py | kovidgoyal_calibre/manual/plugin_examples/editor_demo/__init__.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
from calibre.customize import EditBookToolPlugin
class DemoPlugin(EditBookToolPlugin):
name = 'Edit Book plugin demo'
version = (1, 0, 0)
author = 'Kovid Goyal'
suppo... | 487 | Python | .py | 12 | 37.083333 | 80 | 0.712154 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,398 | main.py | kovidgoyal_calibre/manual/plugin_examples/editor_demo/main.py | #!/usr/bin/env python
# vim:fileencoding=utf-8
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import re
from calibre import force_unicode
from calibre.ebooks.oeb.polish.container import OEB_DOCS, OEB_STYLES, serialize
from calibre.gui2 import error_dialog
# The base class that... | 5,704 | Python | .py | 105 | 42.714286 | 128 | 0.625515 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |
26,399 | ui.py | kovidgoyal_calibre/manual/plugin_examples/interface_demo/ui.py | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
if False:
# This is here to keep my python error checker from complaining about
# the builtin functions that will ... | 2,980 | Python | .py | 56 | 46.25 | 79 | 0.701718 | kovidgoyal/calibre | 19,243 | 2,250 | 4 | GPL-3.0 | 9/5/2024, 5:13:50 PM (Europe/Amsterdam) |