text stringlengths 0 1.05M | meta dict |
|---|---|
""" Aviation Product Parser! """
# 3rd Party
from twisted.internet import reactor
from pyiem.util import LOG
from pyiem.nws.products.sigmet import parser
# Local
from pywwa import common, get_table_file
from pywwa.ldm import bridge
from pywwa.database import get_database
DBPOOL = get_database("postgis")
# Load LOCS ... | {
"repo_name": "akrherz/pyWWA",
"path": "parsers/pywwa/workflows/aviation.py",
"copies": "1",
"size": "2304",
"license": "mit",
"hash": -7879455517224431000,
"line_mean": 24.6,
"line_max": 78,
"alpha_frac": 0.6080729167,
"autogenerated": false,
"ratio": 3.18232044198895,
"config_test": false,
... |
"""A video decoder processor that uses OpenCV to decode video into frames.
A wrapper around the OpenCV VideoCapture class to provide video frames to
downstream processors.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy
from video_process... | {
"repo_name": "learningequality/video-vectorization",
"path": "video_processing/processors/opencv_video_decoder.py",
"copies": "1",
"size": "2241",
"license": "mit",
"hash": 6181472595940272000,
"line_mean": 36.35,
"line_max": 80,
"alpha_frac": 0.6675591254,
"autogenerated": false,
"ratio": 3.824... |
"""A video encoder processor that uses OpenCV to write video frames to a file.
A wrapper around the OpenCV VideoWriter class.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from video_processing import stream_processor
import cv2
class OpenCVVideoEn... | {
"repo_name": "learningequality/video-vectorization",
"path": "video_processing/processors/opencv_video_encoder.py",
"copies": "1",
"size": "1460",
"license": "mit",
"hash": -5255766905365025000,
"line_mean": 33.7619047619,
"line_max": 78,
"alpha_frac": 0.6520547945,
"autogenerated": false,
"rati... |
""" A view containing a colored panel! """
# Enthought library imports.
from enthought.etsconfig.api import ETSConfig
from enthought.pyface.workbench.api import View
class ColorView(View):
""" A view containing a colored panel! """
#### 'IView' interface ####################################################... | {
"repo_name": "enthought/traitsgui",
"path": "examples/workbench/color_view.py",
"copies": "1",
"size": "2432",
"license": "bsd-3-clause",
"hash": -1024678082722899300,
"line_mean": 30.5844155844,
"line_max": 79,
"alpha_frac": 0.4876644737,
"autogenerated": false,
"ratio": 5.207708779443255,
"c... |
""" A view containing a colored panel! """
# Enthought library imports.
from traits.etsconfig.api import ETSConfig
from pyface.workbench.api import View
class ColorView(View):
""" A view containing a colored panel! """
#### 'IView' interface ####################################################
# The c... | {
"repo_name": "geggo/pyface",
"path": "examples/workbench/color_view.py",
"copies": "5",
"size": "2416",
"license": "bsd-3-clause",
"hash": 8181422930938750000,
"line_mean": 30.3766233766,
"line_max": 79,
"alpha_frac": 0.4846854305,
"autogenerated": false,
"ratio": 5.252173913043478,
"config_te... |
""" A view containing a main walter canvas. """
# Enthought library imports.
from enthought.pyface.workbench.api import View, WorkbenchWindow
from enthought.traits.api import HasTraits, Instance, Str, on_trait_change
from enthought.traits.ui.api import View as TraitsView
class DebugViewModel(HasTraits):
""" The... | {
"repo_name": "enthought/traitsgui",
"path": "enthought/pyface/workbench/debug/debug_view.py",
"copies": "1",
"size": "2717",
"license": "bsd-3-clause",
"hash": -3004754681845981700,
"line_mean": 27.9042553191,
"line_max": 79,
"alpha_frac": 0.4486566066,
"autogenerated": false,
"ratio": 4.9489981... |
""" A view containing a main walter canvas. """
# Enthought library imports.
from pyface.workbench.api import View, WorkbenchWindow
from traits.api import HasTraits, Instance, Str, on_trait_change
from traitsui.api import View as TraitsView
class DebugViewModel(HasTraits):
""" The model for the debug view! """
... | {
"repo_name": "pankajp/pyface",
"path": "pyface/workbench/debug/debug_view.py",
"copies": "5",
"size": "2686",
"license": "bsd-3-clause",
"hash": -8200709382859515000,
"line_mean": 27.5744680851,
"line_max": 79,
"alpha_frac": 0.4437825763,
"autogenerated": false,
"ratio": 5.0111940298507465,
"c... |
""" A viewer for mlab scene. Adds a button to open up the engine.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2008, Enthought, Inc.
# License: BSD Style.
# Standard library imports
from os.path import join
# Enthought library imports
from tvtk.tools.ivtk import IVTK
from t... | {
"repo_name": "alexandreleroux/mayavi",
"path": "mayavi/core/ui/mayavi_scene.py",
"copies": "5",
"size": "3226",
"license": "bsd-3-clause",
"hash": -6716757691279744000,
"line_mean": 32.6041666667,
"line_max": 79,
"alpha_frac": 0.5167389957,
"autogenerated": false,
"ratio": 4.751104565537555,
"... |
"""A view of the pipeline with a panel to edit objects.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009, Enthought, Inc.
# License: BSD Style.
# Enthought library imports.
from traitsui.api import Item, View, HSplit, InstanceEditor
from traitsui.menu import Action, Separat... | {
"repo_name": "alexandreleroux/mayavi",
"path": "mayavi/core/ui/engine_rich_view.py",
"copies": "3",
"size": "6543",
"license": "bsd-3-clause",
"hash": 1955023967444021800,
"line_mean": 38.1796407186,
"line_max": 79,
"alpha_frac": 0.5121503897,
"autogenerated": false,
"ratio": 4.968109339407745,
... |
''' A view that tabulates AWS reserved instances against the inventory of
running instances.
'''
import collections
import json
import locale
import logging
import re
from datetime import datetime, timedelta
from decimal import Decimal, getcontext
import botocore.exceptions
import boto3
from pyramid.response im... | {
"repo_name": "blentz/cloud-costs",
"path": "budget/views/reservation.py",
"copies": "1",
"size": "37779",
"license": "apache-2.0",
"hash": -310309750644900740,
"line_mean": 36.9307228916,
"line_max": 102,
"alpha_frac": 0.5329415813,
"autogenerated": false,
"ratio": 4.4041734670086266,
"config_... |
""" A View to inform user that shutdown is in progress.
"""
from ubuntui.utils import Padding
from urwid import Columns, LineBox, Pile, Text, WidgetWrap
from conjureup import events
from conjureup.app_config import app
from conjureup.ui.widgets.buttons import SubmitButton
class ShutdownView(WidgetWrap):
def __... | {
"repo_name": "ubuntu/conjure-up",
"path": "conjureup/ui/views/shutdown.py",
"copies": "3",
"size": "1640",
"license": "mit",
"hash": 2730371458560925700,
"line_mean": 29.9433962264,
"line_max": 74,
"alpha_frac": 0.5396341463,
"autogenerated": false,
"ratio": 4.039408866995074,
"config_test": f... |
""" A view whose content is provided by a traits UI. """
# Standard library imports.
import logging
# Enthought library imports.
from enthought.traits.api import Any, Instance, Str
from enthought.traits.ui.api import UI
# Local imports.
from view import View
# Logging.
logger = logging.getLogger(__name__)
class... | {
"repo_name": "enthought/traitsgui",
"path": "enthought/pyface/workbench/traits_ui_view.py",
"copies": "1",
"size": "3122",
"license": "bsd-3-clause",
"hash": 8619045688183192000,
"line_mean": 27.9074074074,
"line_max": 79,
"alpha_frac": 0.4833440102,
"autogenerated": false,
"ratio": 5.1013071895... |
""" A view whose content is provided by a traits UI. """
# Standard library imports.
import logging
# Enthought library imports.
from traits.api import Any, Instance, Str
from traitsui.api import UI
# Local imports.
from view import View
# Logging.
logger = logging.getLogger(__name__)
class TraitsUIView(View):
... | {
"repo_name": "brett-patterson/pyface",
"path": "pyface/workbench/traits_ui_view.py",
"copies": "2",
"size": "3101",
"license": "bsd-3-clause",
"hash": -4567894407342951400,
"line_mean": 27.712962963,
"line_max": 79,
"alpha_frac": 0.4808126411,
"autogenerated": false,
"ratio": 5.1426202321724706,... |
"""A virtual serial port data source."""
import logging
from .base import BytestreamDataSource, DataSourceError
LOG = logging.getLogger(__name__)
try:
import serial
except ImportError:
LOG.debug("serial library not installed, can't use serial interface")
serial = None
class SerialDataSource(Bytestrea... | {
"repo_name": "openxc/openxc-python",
"path": "openxc/sources/serial.py",
"copies": "1",
"size": "1523",
"license": "bsd-3-clause",
"hash": 134740442930511890,
"line_mean": 29.46,
"line_max": 75,
"alpha_frac": 0.6401838477,
"autogenerated": false,
"ratio": 4.414492753623189,
"config_test": fals... |
"""A "virtual transformer" that scatters one input (list or dict)
and gathers the result. Much like a scattered_value CommandLineTool in CWL.
- language: transformer language
- code: transformer source code
- result: output cell to connect to
- scatter: name of the inputpin to scatter
- celltypes: dict of all celltype... | {
"repo_name": "sjdv1982/seamless",
"path": "seamless/stdlib/scatter_transformer/scatter_transformer.py",
"copies": "1",
"size": "9507",
"license": "mit",
"hash": 3633895444331547600,
"line_mean": 31.5582191781,
"line_max": 131,
"alpha_frac": 0.5967182076,
"autogenerated": false,
"ratio": 3.329947... |
"""A visual illustration of the various signal extension modes supported in
PyWavelets. For efficiency, in the C routines the array is not actually
extended as is done here. This is just a demo for easier visual explanation of
the behavior of the various boundary modes.
In practice, which signal extension mode is bene... | {
"repo_name": "PyWavelets/pywt",
"path": "doc/source/pyplots/plot_boundary_modes.py",
"copies": "3",
"size": "1472",
"license": "mit",
"hash": -2060075890601101600,
"line_mean": 45,
"line_max": 78,
"alpha_frac": 0.7601902174,
"autogenerated": false,
"ratio": 3.3378684807256236,
"config_test": f... |
"""AVL Binary Search Tree module."""
import math
import shutil
class BinaryTree(object):
"""
AVL Binary search tree.
"""
def __init__(self, iterable=None, autobalance=True):
"""Initialize bst with root and size."""
self.root = None
self._size = 0
self.autobalance = au... | {
"repo_name": "fordf/data-structures",
"path": "data_structures/bst.py",
"copies": "1",
"size": "17303",
"license": "mit",
"hash": -8521373907342196000,
"line_mean": 30.9243542435,
"line_max": 103,
"alpha_frac": 0.4910131191,
"autogenerated": false,
"ratio": 4.057926829268292,
"config_test": fa... |
""" avltree_eaf3d.py
The following script was developed for the eaf3D.py script, using
avltree.py as a model. The algorithm for the 3D empirical attainment
function requires the use of 2n data structures based on height-balanced
binary search trees. The incoming data (i.e. item) are ApproxPoint objects
where... | {
"repo_name": "kyspencer/3D_Empirical_Attainment_Function",
"path": "avltree_eaf3d.py",
"copies": "1",
"size": "25300",
"license": "mit",
"hash": 872578725642136000,
"line_mean": 39.5448717949,
"line_max": 85,
"alpha_frac": 0.5671541502,
"autogenerated": false,
"ratio": 4.186662253847427,
"conf... |
""" avltree.py
The following script was copied and extended from Kent D. Lee and Steve
Hubbard, Data Structures and Algorithms with Python, Chapter 10. This
algorithm creates a height-balanced binary search tree.
"""
from stack import Stack
class AVLNode:
def __init__(self, item, balance=0, left=None, ri... | {
"repo_name": "kyspencer/3D_Empirical_Attainment_Function",
"path": "avltree.py",
"copies": "1",
"size": "13621",
"license": "mit",
"hash": -48986176531004820,
"line_mean": 36.2158469945,
"line_max": 84,
"alpha_frac": 0.5600176199,
"autogenerated": false,
"ratio": 4.1200846944948575,
"config_te... |
# AVL Trees, by Elizabeth Feicke
# Was unable to complete this file.
from BST import BSTNode, BinarySearchTree
class AVLNode(BSTNode):
def __init__(self, key, left=None, right=None, parent=None):
BSTNode.__init__(self, key, left, right, parent)
self.height = self.node_height()
def node_heigh... | {
"repo_name": "zmarvel/playground",
"path": "project3/avl.py",
"copies": "1",
"size": "9834",
"license": "mit",
"hash": -7171373361338504000,
"line_mean": 33.3846153846,
"line_max": 105,
"alpha_frac": 0.5324384787,
"autogenerated": false,
"ratio": 3.3609022556390977,
"config_test": true,
"has... |
"""AVM FRITZ!Box binary sensors."""
from __future__ import annotations
import datetime
import logging
from typing import Callable, TypedDict
from fritzconnection.core.exceptions import FritzConnectionException
from fritzconnection.lib.fritzstatus import FritzStatus
from homeassistant.components.sensor import SensorE... | {
"repo_name": "home-assistant/home-assistant",
"path": "homeassistant/components/fritz/sensor.py",
"copies": "2",
"size": "4490",
"license": "apache-2.0",
"hash": 940890527817589200,
"line_mean": 28.7350993377,
"line_max": 88,
"alpha_frac": 0.6516703786,
"autogenerated": false,
"ratio": 3.9213973... |
"""AVM FRITZ!Box connectivitiy sensor."""
import logging
from fritzconnection.core.exceptions import FritzConnectionException
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core impor... | {
"repo_name": "home-assistant/home-assistant",
"path": "homeassistant/components/fritz/binary_sensor.py",
"copies": "2",
"size": "2813",
"license": "apache-2.0",
"hash": -4527545535666597400,
"line_mean": 30.606741573,
"line_max": 87,
"alpha_frac": 0.638464273,
"autogenerated": false,
"ratio": 3.... |
"""avocado URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | {
"repo_name": "trdwll/avocado",
"path": "avocado/urls.py",
"copies": "1",
"size": "1627",
"license": "mit",
"hash": 5361556356645537000,
"line_mean": 40.7179487179,
"line_max": 106,
"alpha_frac": 0.7123540258,
"autogenerated": false,
"ratio": 3.454352441613588,
"config_test": false,
"has_no_k... |
# avoid be throttled when running on test server
SHOULD_BE_THROTTLED = False
import djcelery
djcelery.setup_loader()
BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_USER = "tests"
BROKER_PASSWORD = "tests"
BROKER_BACKEND="memory"
CELERY_ALWAYS_EAGER = True
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('V... | {
"repo_name": "victorpoluceno/shortener_frontend",
"path": "settings.py",
"copies": "1",
"size": "4855",
"license": "bsd-2-clause",
"hash": 164049765338953250,
"line_mean": 27.7278106509,
"line_max": 95,
"alpha_frac": 0.6558187436,
"autogenerated": false,
"ratio": 3.5567765567765566,
"config_te... |
"""Avoid duplications in suggestions
Revision ID: dfc939482d8d
Revises: d3f9c4829e4a
Create Date: 2017-10-14 22:31:37.153990
"""
# revision identifiers, used by Alembic.
revision = 'dfc939482d8d'
down_revision = 'd3f9c4829e4a'
from collections import defaultdict
from alembic import op
import sqlalchemy as sa
from... | {
"repo_name": "morelab/appcomposer",
"path": "alembic/versions/dfc939482d8d_avoid_duplications_in_suggestions.py",
"copies": "3",
"size": "2717",
"license": "bsd-2-clause",
"hash": 6211506719431289000,
"line_mean": 42.8225806452,
"line_max": 389,
"alpha_frac": 0.7412587413,
"autogenerated": false,
... |
# Avoider: the first NodeBox game!
# The purpose of the game is pretty simple:
# try to avoid the red blobs for as long as possible.
# This example is a bit longer than the others, and features some geometry,
# object-oriented programming, and interactivity.
# You can change the size of the canvas to get a bigger or... | {
"repo_name": "karstenw/nodebox-pyobjc",
"path": "examples/Interactivity/Avoider.py",
"copies": "1",
"size": "7096",
"license": "mit",
"hash": 9118757886481871000,
"line_mean": 36.9518716578,
"line_max": 96,
"alpha_frac": 0.6133032694,
"autogenerated": false,
"ratio": 3.5444555444555443,
"confi... |
# Avoid importing `importlib` from this package.
from __future__ import absolute_import
from importlib import import_module
from django.utils.version import get_docs_version
def deconstructible(*args, **kwargs):
"""
Class decorator that allow the decorated class to be serialized
by the migrations subsys... | {
"repo_name": "h4r5h1t/django-hauthy",
"path": "django/utils/deconstruct.py",
"copies": "83",
"size": "2136",
"license": "bsd-3-clause",
"hash": 1740801130133189000,
"line_mean": 34.6,
"line_max": 96,
"alpha_frac": 0.5472846442,
"autogenerated": false,
"ratio": 4.8108108108108105,
"config_test"... |
# Avoid importing `importlib` from this package.
from __future__ import absolute_import
import copy
import os
import sys
from importlib import import_module
from django.utils import six
def import_string(dotted_path):
"""
Import a dotted module path and return the attribute/class designated by the
last ... | {
"repo_name": "devops2014/djangosite",
"path": "django/utils/module_loading.py",
"copies": "1",
"size": "5893",
"license": "bsd-3-clause",
"hash": -1708365037938868700,
"line_mean": 37.5163398693,
"line_max": 82,
"alpha_frac": 0.5319871033,
"autogenerated": false,
"ratio": 4.906744379683597,
"c... |
# Avoid importing `importlib` from this package.
from __future__ import absolute_import
import copy
import os
import sys
import warnings
from importlib import import_module
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils.deprecation import RemovedInDjango19Warnin... | {
"repo_name": "abomyi/django",
"path": "django/utils/module_loading.py",
"copies": "36",
"size": "6700",
"license": "bsd-3-clause",
"hash": -2350965012852541000,
"line_mean": 37.5057471264,
"line_max": 82,
"alpha_frac": 0.5501492537,
"autogenerated": false,
"ratio": 4.85859318346628,
"config_te... |
# Avoid importing `importlib` from this package.
from __future__ import absolute_import
import datetime
import decimal
import unicodedata
from importlib import import_module
from django.conf import settings
from django.utils import dateformat, datetime_safe, numberformat, six
from django.utils.encoding import force_s... | {
"repo_name": "devops2014/djangosite",
"path": "django/utils/formats.py",
"copies": "1",
"size": "8468",
"license": "bsd-3-clause",
"hash": 1241909868963939000,
"line_mean": 35.0340425532,
"line_max": 114,
"alpha_frac": 0.6320264525,
"autogenerated": false,
"ratio": 3.835144927536232,
"config_t... |
# Avoid importing `importlib` from this package.
from __future__ import absolute_import
from importlib import import_module
from django.utils.version import get_docs_version
def deconstructible(*args, **kwargs):
"""
Class decorator that allow the decorated class to be serialized
by the migrat... | {
"repo_name": "diego-d5000/MisValesMd",
"path": "env/lib/python2.7/site-packages/django/utils/deconstruct.py",
"copies": "1",
"size": "2196",
"license": "mit",
"hash": 1748957438625675500,
"line_mean": 34.6,
"line_max": 96,
"alpha_frac": 0.5323315118,
"autogenerated": false,
"ratio": 4.9348314606... |
# Avoid importing `importlib` from this package.
from __future__ import absolute_import
import datetime
import decimal
import unicodedata
from importlib import import_module
from django.conf import settings
from django.utils import dateformat, datetime_safe, numberformat, six
from django.utils.encoding impo... | {
"repo_name": "diego-d5000/MisValesMd",
"path": "env/lib/python2.7/site-packages/django/utils/formats.py",
"copies": "1",
"size": "8704",
"license": "mit",
"hash": 5235775734347710000,
"line_mean": 35.0382978723,
"line_max": 114,
"alpha_frac": 0.6148897059,
"autogenerated": false,
"ratio": 3.9154... |
# Avoid shadowing the standard library json module
from __future__ import absolute_import
from enum import Enum
from simplejson import JSONEncoder, _default_decoder
import datetime
import uuid
import six
import decimal
from bitfield.types import BitHandler
from django.utils.timezone import is_aware
from django.utils.... | {
"repo_name": "mvaled/sentry",
"path": "src/sentry/utils/json.py",
"copies": "1",
"size": "3797",
"license": "bsd-3-clause",
"hash": -2461985064913140700,
"line_mean": 29.6209677419,
"line_max": 95,
"alpha_frac": 0.6536739531,
"autogenerated": false,
"ratio": 3.7668650793650795,
"config_test": ... |
# Avoid shadowing the standard library json module
from __future__ import absolute_import
# XXX(epurkhiser): We import JSONDecodeError just to have it be exported as
# part of this module. We don't use it directly within the module, but modules
# that import it from here will. Do not remove.
from simplejson import JSO... | {
"repo_name": "beeftornado/sentry",
"path": "src/sentry/utils/json.py",
"copies": "1",
"size": "4342",
"license": "bsd-3-clause",
"hash": -5363308768180445000,
"line_mean": 30.9264705882,
"line_max": 111,
"alpha_frac": 0.6653615845,
"autogenerated": false,
"ratio": 3.7690972222222223,
"config_t... |
# Avoid shadowing the standard library json module
from __future__ import absolute_import, unicode_literals
import datetime
import decimal
import json
import uuid
from django.utils import six
from django.utils.functional import Promise
from django.utils.timezone import is_aware
class DjangoJSONEncoder(json.JSONEnco... | {
"repo_name": "ssteinerx/django-react-templatetags",
"path": "django_react_templatetags/serializers.py",
"copies": "1",
"size": "1445",
"license": "mit",
"hash": -9079235428920518000,
"line_mean": 29.7446808511,
"line_max": 78,
"alpha_frac": 0.5923875433,
"autogenerated": false,
"ratio": 4.313432... |
""" Avoid using C++'s std::next_permutation or similar features in other languages to solve this challenge.
Implement the algorithm yourself, since this is what you would be asked to do during a real interview.
Given a string s, find all its potential permutations. The output should be sorted in lexicographical o... | {
"repo_name": "ntthuy11/CodeFights",
"path": "InterviewPractices/11_Counting/stringPermutations.py",
"copies": "1",
"size": "1461",
"license": "mit",
"hash": 5313824735907050000,
"line_mean": 34.6341463415,
"line_max": 110,
"alpha_frac": 0.5900068446,
"autogenerated": false,
"ratio": 3.6708542713... |
#AVOID USING PRINTS!!!!!, slows me down!
#TRY Using "C++", then "C", MAIN: **"AWK"**, "Ruby", ***"JULIA"***
"""
Mega = []
for i in range(42000000):
Mega.append("")
print "Mega Complete"
"""
import time
import random
from Queue import Queue
from sets import Set
import sys
import os
def writeStuff():
i = 1
j = 0
b... | {
"repo_name": "pdsteele/socialNetworksProject",
"path": "paper/proj-convert_Twitter.py",
"copies": "2",
"size": "14813",
"license": "mit",
"hash": -3591292624680729000,
"line_mean": 17.9679897567,
"line_max": 247,
"alpha_frac": 0.5480321339,
"autogenerated": false,
"ratio": 2.3580070041388095,
... |
"""A Volume file reader"""
# Author: Suyog Dutt Jain <suyog.jain@aero.iitb.ac.in>
# Copyright (c) 2009, Enthought, Inc.
# License: BSD Style.
# Enthought library imports.
from traits.api import Instance, Str
from traitsui.api import View, Group, Item
from tvtk.api import tvtk
# Local imports.
from mayavi.core.source ... | {
"repo_name": "alexandreleroux/mayavi",
"path": "mayavi/sources/volume_reader.py",
"copies": "3",
"size": "2665",
"license": "bsd-3-clause",
"hash": -6242175832270193000,
"line_mean": 30.7261904762,
"line_max": 74,
"alpha_frac": 0.4975609756,
"autogenerated": false,
"ratio": 4.626736111111111,
... |
""" AVR architecture.
See for good documentation about AVR ABI:
- https://gcc.gnu.org/wiki/avr-gcc
The stack grows downwards in AVR. The stack pointer points to the current
empty stack slot. This is somewhat confusing, because on other machines
the stack pointer points to the latests pushed byte.
The stack frame is... | {
"repo_name": "windelbouwman/ppci-mirror",
"path": "ppci/arch/avr/arch.py",
"copies": "1",
"size": "11632",
"license": "bsd-2-clause",
"hash": 374502628830998500,
"line_mean": 28.5228426396,
"line_max": 78,
"alpha_frac": 0.5238995873,
"autogenerated": false,
"ratio": 3.803793328973185,
"config_... |
"""A vroom test execution environment.
This is an object with all of the vroom verifiers asked. Good for one file.
"""
import vroom.buffer
import vroom.messages
import vroom.output
import vroom.shell
import vroom.vim
class Environment(object):
"""The environment object.
Sets up all the verifiers and managers an... | {
"repo_name": "martindemello/vroom",
"path": "vroom/environment.py",
"copies": "3",
"size": "1035",
"license": "apache-2.0",
"hash": -6245404286652339000,
"line_mean": 32.3870967742,
"line_max": 77,
"alpha_frac": 0.7236714976,
"autogenerated": false,
"ratio": 3.4385382059800667,
"config_test": ... |
# ./_avs.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:7160bdf2eec8b2464ee2e1193e7abcc5a3221f95
# Generated 2015-07-06 15:58:03.784491 by PyXB version 1.2.4 using Python 2.7.6.final.0
# Namespace http://ddex.net/xml/avs/avs [xmlns:avs]
from __future__ import unicode_literals
import pyxb
import pyxb.binding
import ... | {
"repo_name": "Trax-air/ddexreader",
"path": "ddexreader/ern36/_avs.py",
"copies": "1",
"size": "485591",
"license": "mit",
"hash": 1523580477444562400,
"line_mean": 88.4274401473,
"line_max": 283,
"alpha_frac": 0.7653828016,
"autogenerated": false,
"ratio": 3.5637613938264177,
"config_test": f... |
"""A VTK file reader object.
"""
# Author: Prabhu Ramachandran <prabhu_r@users.sf.net>
# Copyright (c) 2005-2008, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
from os.path import basename
# Enthought library imports.
from traits.api import Instance
from tvtk.api import tvtk
# Local imports.
fro... | {
"repo_name": "liulion/mayavi",
"path": "mayavi/sources/vtk_file_reader.py",
"copies": "2",
"size": "3665",
"license": "bsd-3-clause",
"hash": -198301476050129700,
"line_mean": 32.3181818182,
"line_max": 75,
"alpha_frac": 0.4974079127,
"autogenerated": false,
"ratio": 4.639240506329114,
"config... |
"""A VTK file reader object.
"""
# Author: Prabhu Ramachandran <prabhu_r@users.sf.net>
# Copyright (c) 2005-2015, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
from os.path import basename
# Enthought library imports.
from traits.api import Instance
from tvtk.api import tvtk
# Local imports.
fro... | {
"repo_name": "dmsurti/mayavi",
"path": "mayavi/sources/vtk_file_reader.py",
"copies": "1",
"size": "3661",
"license": "bsd-3-clause",
"hash": -5397118340398530000,
"line_mean": 32.5871559633,
"line_max": 75,
"alpha_frac": 0.4979513794,
"autogenerated": false,
"ratio": 4.628318584070796,
"confi... |
"""A VTK interactor scene which provides a convenient toolbar that
allows the user to set the camera view, turn on the axes indicator
etc.
"""
# Authors: Prabhu Ramachandran <prabhu_r@users.sf.net>,
# Dave Peterson <dpeterson@enthought.com>
# Copyright (c) 2006, Enthought, Inc.
# License: BSD Style.
# System ... | {
"repo_name": "liulion/mayavi",
"path": "tvtk/pyface/ui/qt4/decorated_scene.py",
"copies": "2",
"size": "11285",
"license": "bsd-3-clause",
"hash": 916632665258275000,
"line_mean": 36.7424749164,
"line_max": 89,
"alpha_frac": 0.468409393,
"autogenerated": false,
"ratio": 4.7197825177749895,
"co... |
"""A VTK XML file reader object.
"""
# Author: Prabhu Ramachandran <prabhu_r@users.sf.net>
# Copyright (c) 2005, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
from os.path import basename
# Enthought library imports.
from traits.api import Instance, List, Str, Bool
from traitsui.api import View, G... | {
"repo_name": "dmsurti/mayavi",
"path": "mayavi/sources/vtk_xml_file_reader.py",
"copies": "1",
"size": "14036",
"license": "bsd-3-clause",
"hash": -5128964537707219000,
"line_mean": 36.0343007916,
"line_max": 75,
"alpha_frac": 0.5262895412,
"autogenerated": false,
"ratio": 4.300245098039215,
"... |
"""aw2_raw_table
Revision ID: 0119966d8b50
Revises: ce0d4837ba00
Create Date: 2021-02-16 15:49:37.008608
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0119966d8b50'
down_revision = 'ce0d4837ba00'
branch_labels = None
depends_on = None
def upgrade(engine_nam... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/0119966d8b50_aw2_raw_table.py",
"copies": "1",
"size": "2767",
"license": "bsd-3-clause",
"hash": -944515129904253600,
"line_mean": 36.3918918919,
"line_max": 105,
"alpha_frac": 0.6783520058,
"autogenerated": false... |
"""A wait callback to allow psycopg2 cooperation with eventlet.
Use `make_psycopg_green()` to enable eventlet support in Psycopg.
"""
# Copyright (C) 2010 Daniele Varrazzo <daniele.varrazzo@gmail.com>
# and licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining a cop... | {
"repo_name": "cloudera/hue",
"path": "desktop/core/ext-py/eventlet-0.24.1/eventlet/support/psycopg2_patcher.py",
"copies": "6",
"size": "2272",
"license": "apache-2.0",
"hash": -2663557137140765000,
"line_mean": 40.3090909091,
"line_max": 79,
"alpha_frac": 0.7178697183,
"autogenerated": false,
"... |
"""A wait callback to allow psycopg2 cooperation with gevent.
Use `make_psycopg_green()` to enable gevent support in Psycopg.
"""
# Copyright (C) 2010 Daniele Varrazzo <daniele.varrazzo@gmail.com>
# and licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# ... | {
"repo_name": "fvbock/gDBPool",
"path": "gdbpool/psyco_ge.py",
"copies": "1",
"size": "2269",
"license": "mit",
"hash": 4596454833806764000,
"line_mean": 41.8113207547,
"line_max": 79,
"alpha_frac": 0.7170559718,
"autogenerated": false,
"ratio": 4.233208955223881,
"config_test": false,
"has_n... |
"""A wait callback to allow psycopg2 cooperation with gevent.
Use `make_psycopg_green()` to enable gevent support in Psycopg.
"""
# This script was origionaly called 'psyco_gevent.py' and written by Daniele
# Varrazzo, it is avlible from: https://bitbucket.org/dvarrazzo/psycogreen/
# Copyright (C) 2010 Daniele Va... | {
"repo_name": "samwillis/django-gevent",
"path": "django_gevent/make_green/psycopg.py",
"copies": "1",
"size": "2428",
"license": "bsd-3-clause",
"hash": 7340853824147727000,
"line_mean": 40.8793103448,
"line_max": 79,
"alpha_frac": 0.7195222405,
"autogenerated": false,
"ratio": 4.087542087542087... |
"""A wait callback to allow psycopg2 cooperation with guv
Use :func:`make_psycopg_green()` to enable guv support in psycopg2.
"""
import psycopg2
from psycopg2 import extensions
from ..hubs import trampoline
from ..const import READ, WRITE
def psycopg2_wait_cb(conn, timeout=-1):
"""A wait callback to trigger a... | {
"repo_name": "veegee/guv",
"path": "guv/support/psycopg2_patcher.py",
"copies": "1",
"size": "1102",
"license": "mit",
"hash": 3077722226737148000,
"line_mean": 29.6111111111,
"line_max": 93,
"alpha_frac": 0.6497277677,
"autogenerated": false,
"ratio": 4.142857142857143,
"config_test": false,
... |
"""A walker method tells walk_object how to walk into other objects.
It should be a callable, which when called on an object returns either
an iterator over (name, value) pairs of its 'contents', or None if it
is not applicable.
There is a fallback list of walkers which is used if nothing else is
provided, and a list... | {
"repo_name": "cley-limited/python-walker",
"path": "pythonwalker/walker.py",
"copies": "1",
"size": "4231",
"license": "isc",
"hash": 2777103792404469000,
"line_mean": 32.3149606299,
"line_max": 74,
"alpha_frac": 0.6870716143,
"autogenerated": false,
"ratio": 3.7878245299910476,
"config_test":... |
#a walk in the woods
#by Coleman Moore
#an interactive game
import random
import sys
#the begging / finding things out
begin = input('hello young adventurer shall we begin your adventure')
#making up #'s
numb1 = random.randint(1,3)
numb2 = random.randint(1,3)
#tutorial
print('OK lets go over a co... | {
"repo_name": "Concatrious/AdventureLand",
"path": "Walkinthewoods.py",
"copies": "1",
"size": "2856",
"license": "mit",
"hash": -5851799079971755000,
"line_mean": 24.2018348624,
"line_max": 81,
"alpha_frac": 0.6029411765,
"autogenerated": false,
"ratio": 3.2752293577981653,
"config_test": fals... |
"""award_details JSON blob and awarded_at date stamp on BriefResponse
Constraint on Brief to allow only one BriefResponse with non-null 'awarded_at'
Revision ID: 960
Revises: 950
Create Date: 2017-08-07 15:22:43.619680
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# r... | {
"repo_name": "alphagov/digitalmarketplace-api",
"path": "migrations/versions/960_brief_response_award_details.py",
"copies": "1",
"size": "1115",
"license": "mit",
"hash": 9174058404966089000,
"line_mean": 29.1351351351,
"line_max": 110,
"alpha_frac": 0.6887892377,
"autogenerated": false,
"ratio... |
a = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u</warning>"String"
# python 3.3
a = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u</warning>""
a = r""
a = <warning descr="Python version 2.4, 2.5 do not support a 'B' prefix">b</warning>""
a = <error descr="Py... | {
"repo_name": "consulo/consulo-python",
"path": "plugin/src/test/resources/inspections/PyCompatibilityInspection/stringLiteralExpression.py",
"copies": "3",
"size": "2299",
"license": "apache-2.0",
"hash": 4557637904862139400,
"line_mean": 53.7619047619,
"line_max": 191,
"alpha_frac": 0.6463679861,
... |
'''A way to freeze time'''
class HammerTime(object):
'''A way to freeze time'''
def __init__(self):
import time
self._timef = time.time
self._time = time
self._frozen = False
self._when = None
def __enter__(self):
'''Freeze time for the duration of this con... | {
"repo_name": "seomoz/qsome-py",
"path": "test/hammertime.py",
"copies": "1",
"size": "1529",
"license": "mit",
"hash": -3394554549683869000,
"line_mean": 24.4833333333,
"line_max": 79,
"alpha_frac": 0.5454545455,
"autogenerated": false,
"ratio": 4.077333333333334,
"config_test": false,
"has_... |
"""A way to read and write structs to a binary file, with fast access
Licensed under the 3-clause BSD License:
Copyright (c) 2011-2014, Neeraj Kumar (neerajkumar.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following condit... | {
"repo_name": "neeraj-kumar/nkpylib",
"path": "nkstructfile.py",
"copies": "1",
"size": "4103",
"license": "bsd-3-clause",
"hash": 9089351686383366000,
"line_mean": 36.3,
"line_max": 79,
"alpha_frac": 0.6458688764,
"autogenerated": false,
"ratio": 4.282881002087683,
"config_test": false,
"has... |
"""A way to serialize data in the same format as the 'marshal' module
but accessible to RPython programs.
"""
from rpython.annotator import model as annmodel
from rpython.annotator.signature import annotation
from rpython.annotator.listdef import ListDef, TooLateForChange
from rpython.tool.pairtype import pair, pairty... | {
"repo_name": "jptomo/rpython-lang-scheme",
"path": "rpython/rlib/rmarshal.py",
"copies": "1",
"size": "16124",
"license": "mit",
"hash": 7549652176345315000,
"line_mean": 32.1769547325,
"line_max": 79,
"alpha_frac": 0.6182088812,
"autogenerated": false,
"ratio": 3.472754684471247,
"config_test... |
"""A way to store large json-like object graphs"""
import bsddb
import collections
import json
import logging
import types
from .rollback import RollbackDict
from . import flatdict
from . import treeutils
LOGGER = logging.getLogger('jsdb')
class Jsdb(collections.MutableMapping):
"""A file-backed, persisted-obje... | {
"repo_name": "talwrii/jsdb",
"path": "jsdb/jsdb.py",
"copies": "1",
"size": "3050",
"license": "bsd-2-clause",
"hash": 998482861757946200,
"line_mean": 25.5217391304,
"line_max": 114,
"alpha_frac": 0.6039344262,
"autogenerated": false,
"ratio": 3.8903061224489797,
"config_test": false,
"has_... |
# AWBL - Automatic Wordpress Build Log
# Created by Ryan McCartney
# ryanmccart.me
# MIT LICENCE
from wordpress_xmlrpc import Client, WordPressPost
from wordpress_xmlrpc.methods.posts import GetPosts, NewPost
from wordpress_xmlrpc.methods.users import GetUserInfo
from datetime import datetime
import time, subprocess... | {
"repo_name": "ryan-mccartney/AWBL",
"path": "autoPostWordpress.py",
"copies": "1",
"size": "1487",
"license": "mit",
"hash": -6575007443488959000,
"line_mean": 21.8769230769,
"line_max": 78,
"alpha_frac": 0.6328177539,
"autogenerated": false,
"ratio": 3.394977168949772,
"config_test": false,
... |
""" A ``WeatherRegion`` object is is generated per
weather station and regional load profile and technology
stocks are assigned."""
import uuid
import numpy as np
from energy_demand.technologies import technological_stock
from energy_demand.profiles import load_profile
from energy_demand.profiles import hdd_cdd
from e... | {
"repo_name": "nismod/energy_demand",
"path": "energy_demand/geography/weather_region.py",
"copies": "1",
"size": "26150",
"license": "mit",
"hash": 6607474832617201000,
"line_mean": 37.7982195846,
"line_max": 112,
"alpha_frac": 0.5704015296,
"autogenerated": false,
"ratio": 3.586121777290181,
... |
"""A web application that dynamically generates pydoctor documentation."""
import parser
import urllib
import time
from twisted.python.urlpath import URLPath
from twisted.web.static import File
from twisted.web import resource
from twisted.web.template import Element, renderElement, renderer, XMLFile, XMLString, tags... | {
"repo_name": "chevah/pydoctor",
"path": "pydoctor/server.py",
"copies": "3",
"size": "23855",
"license": "isc",
"hash": -4741076783582968000,
"line_mean": 32.1780250348,
"line_max": 110,
"alpha_frac": 0.5572835883,
"autogenerated": false,
"ratio": 3.8333601156998234,
"config_test": false,
"h... |
"""A web application to translate color schemes between dark- and light-background."""
from functools import partial
import flask
import numpy as np
from werkzeug.exceptions import (HTTP_STATUS_CODES,
HTTPException, InternalServerError, TooManyRequests)
import cam
from color_io impor... | {
"repo_name": "crowsonkb/color_schemer",
"path": "app.py",
"copies": "1",
"size": "3116",
"license": "mit",
"hash": 4995764441525826000,
"line_mean": 35.6588235294,
"line_max": 99,
"alpha_frac": 0.6094351733,
"autogenerated": false,
"ratio": 3.512965050732807,
"config_test": false,
"has_no_ke... |
"""A web app to test multi-threading."""
import logging
import sys
import threading
import time
from google.appengine.api import memcache
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
import ndb
@ndb.tasklet
def fibonacci(n):
"""A recursive Fibonacci to exercise task switch... | {
"repo_name": "bslatkin/8-bits",
"path": "appengine-ndb/demo/fibo.py",
"copies": "1",
"size": "2098",
"license": "apache-2.0",
"hash": -350505220653058000,
"line_mean": 22.5730337079,
"line_max": 74,
"alpha_frac": 0.6410867493,
"autogenerated": false,
"ratio": 2.9017980636237897,
"config_test":... |
# a web crawler for meizitu
import sys
import os
from pprint import pprint
import requests
from bs4 import BeautifulSoup
IMAGE_DOWNLOAD_BASE_DIR = "D:/"
def get_all_topics():
"""
get all topics
:return:
"""
headers = {
'referer': 'https://www.mzitu.com/best/',
'upgrade-insecure-r... | {
"repo_name": "EclipseXuLu/DataHouse",
"path": "DataHouse/crawler/meizitu_crawler.py",
"copies": "1",
"size": "2571",
"license": "mit",
"hash": -5225376200794607000,
"line_mean": 28.1704545455,
"line_max": 105,
"alpha_frac": 0.5886248539,
"autogenerated": false,
"ratio": 3.3165374677002584,
"co... |
"""A web front end for the Lytspel converter."""
from collections import OrderedDict
from glob import glob
import os
from os import path
import logging
import re
import string
from time import time
from typing import Match, NamedTuple, Optional, Sequence, Tuple
# The following import is for mypy only
from typing impo... | {
"repo_name": "ChristianSi/phoneng",
"path": "lytspel/web.py",
"copies": "2",
"size": "18048",
"license": "bsd-3-clause",
"hash": -1679635265673489700,
"line_mean": 35.096,
"line_max": 98,
"alpha_frac": 0.6407912234,
"autogenerated": false,
"ratio": 3.6712774613506918,
"config_test": false,
"... |
# A web scraping script to get the product info for
# an item based on UPC.
import sys
import urllib2
from bs4 import BeautifulSoup
def locate_item_url(upc):
"""
Query the Walmart.com search URL based on the UPC code. Grab the first item
listed since we expect a UPC search to only ever return a single ite... | {
"repo_name": "codefellows/sea-b27-python",
"path": "LectureSupplements/WebScraping/price_full.py",
"copies": "1",
"size": "1878",
"license": "mit",
"hash": 2142045956535730400,
"line_mean": 32.5357142857,
"line_max": 82,
"alpha_frac": 0.6608093717,
"autogenerated": false,
"ratio": 3.329787234042... |
"""A web server that accepts HTTP requests from a client, verifies that each
request contains some expected values, and returns canned responses for the
requests. The expected values in the requests and the canned responses are
specified by a script that is provided when the web server is run.
For requests, the script... | {
"repo_name": "mgp/canned-http",
"path": "canned_http.py",
"copies": "1",
"size": "24578",
"license": "mit",
"hash": 6205746626529491000,
"line_mean": 36.1830559758,
"line_max": 89,
"alpha_frac": 0.6680364554,
"autogenerated": false,
"ratio": 4.077305905773059,
"config_test": false,
"has_no_k... |
# A web server that can run various web frameworks thanks to WSGI
import socket
import StringIO
import sys
class WSGIServer(object):
address_family = socket.AF_INET
socket_type = socket.SOCK_STREAM
request_queue_size = 1
def __init__(self, server_address):
# Create a listening socket
self.listen_so... | {
"repo_name": "RagBillySandstone/google-python-exercises",
"path": "my_own_exercises/web_server/webserver2.py",
"copies": "1",
"size": "4513",
"license": "apache-2.0",
"hash": 3583632487694678000,
"line_mean": 31.2357142857,
"line_max": 78,
"alpha_frac": 0.645247064,
"autogenerated": false,
"rati... |
# A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the
# next level, we have "leetcode.com", and at the lowest level, "discuss.leetcode.com". When we visit a domain like
# "discuss.leetcode.com", we will also visit the parent domains "leetcode.com" and "co... | {
"repo_name": "jigarkb/Programming",
"path": "LeetCode/811-E-SubdomainVisitCount.py",
"copies": "2",
"size": "2546",
"license": "mit",
"hash": 873298739753547400,
"line_mean": 42.1694915254,
"line_max": 118,
"alpha_frac": 0.6598586017,
"autogenerated": false,
"ratio": 3.345597897503285,
"config... |
# A website domain like "discuss.leetcode.com" consists of various subdomains.
# At the top level, we have "com", at the next level, we have "leetcode.com",
# and at the lowest level, "discuss.leetcode.com". When we visit a domain like
# "discuss.leetcode.com", we will also visit the parent domains "leetcode.com"
# and... | {
"repo_name": "feigaochn/leetcode",
"path": "p811-subdomain-visit-count.py",
"copies": "2",
"size": "1439",
"license": "mit",
"hash": 62981388135496240,
"line_mean": 37.8918918919,
"line_max": 85,
"alpha_frac": 0.6532314107,
"autogenerated": false,
"ratio": 3.475845410628019,
"config_test": fal... |
"""A WebSocket handler for Treadmill app_groups
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
from treadmill import schema
from treadmill import yamlwrapper as yaml
_LOGGER = logging.g... | {
"repo_name": "Morgan-Stanley/treadmill",
"path": "lib/python/treadmill/websocket/api/app_group.py",
"copies": "2",
"size": "1782",
"license": "apache-2.0",
"hash": 1541260735181602600,
"line_mean": 23.0810810811,
"line_max": 69,
"alpha_frac": 0.5190796857,
"autogenerated": false,
"ratio": 4.1830... |
"""A WebSocket handler for Treadmill state.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
from treadmill import schema
from treadmill.websocket import _utils
from treadmill import yamlw... | {
"repo_name": "ceache/treadmill",
"path": "lib/python/treadmill/websocket/api/state.py",
"copies": "2",
"size": "2291",
"license": "apache-2.0",
"hash": -55519858651844180,
"line_mean": 24.7415730337,
"line_max": 74,
"alpha_frac": 0.5412483632,
"autogenerated": false,
"ratio": 4.6282828282828286,... |
"""A WebSocket handler for Treadmill state.
"""
import os
import logging
import yaml
from treadmill import schema
_LOGGER = logging.getLogger(__name__)
class IdentityGroupAPI(object):
"""Handler for /identity-groups topic."""
def __init__(self):
"""init"""
@schema.schema({'$ref': 'websoc... | {
"repo_name": "keithhendry/treadmill",
"path": "treadmill/websocket/api/identity_group.py",
"copies": "3",
"size": "1461",
"license": "apache-2.0",
"hash": -5882515329234583000,
"line_mean": 25.5636363636,
"line_max": 76,
"alpha_frac": 0.5393566051,
"autogenerated": false,
"ratio": 4.551401869158... |
"""A WebSocket handler for Treadmill trace.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from treadmill import apptrace
from treadmill import schema
from treadmill.websocket import _utils
from t... | {
"repo_name": "bretttegart/treadmill",
"path": "lib/python/treadmill/websocket/api/trace.py",
"copies": "2",
"size": "2190",
"license": "apache-2.0",
"hash": -6404763367747385000,
"line_mean": 27.8157894737,
"line_max": 75,
"alpha_frac": 0.5502283105,
"autogenerated": false,
"ratio": 4.3280632411... |
"""A WebSocket handler for Treadmill trace.
"""
import logging
from treadmill import apptrace
from treadmill import schema
from treadmill.websocket import utils
from treadmill.apptrace import events as traceevents
_LOGGER = logging.getLogger(__name__)
class TraceAPI(object):
"""Handler for /trace topic."""
... | {
"repo_name": "ThoughtWorksInc/treadmill",
"path": "treadmill/websocket/api/trace.py",
"copies": "3",
"size": "1874",
"license": "apache-2.0",
"hash": -5940922184473888000,
"line_mean": 27.8307692308,
"line_max": 75,
"alpha_frac": 0.5405549626,
"autogenerated": false,
"ratio": 4.308045977011494,
... |
"""A WebSocket protocol implementation for diesel.
Implements much of RFC 6455 (http://tools.ietf.org/html/rfc6455) and enough
of hybi-00 to support Safari 5.0.1+.
Not implemented:
* PING/PONG.
* Extension support.
"""
from .http import HttpServer, Response
from diesel.util.queue import Queue
from diesel imp... | {
"repo_name": "dieseldev/diesel",
"path": "diesel/protocols/websockets.py",
"copies": "1",
"size": "8920",
"license": "bsd-3-clause",
"hash": 7304504352612318000,
"line_mean": 36.0124481328,
"line_max": 105,
"alpha_frac": 0.5239910314,
"autogenerated": false,
"ratio": 4.431197218082464,
"config... |
"""A websockets-based MUD client for connecting to the game."""
import logging
from twisted.internet import reactor
from autobahn.twisted.websocket import WebSocketServerFactory, \
WebSocketServerProtocol
from gsb import Caller
from server import server
class WSProtocol(WebSocketServerProtocol):
... | {
"repo_name": "chrisnorman7/game",
"path": "web/client.py",
"copies": "1",
"size": "2345",
"license": "mpl-2.0",
"hash": -7198537188277168000,
"line_mean": 29.2666666667,
"line_max": 66,
"alpha_frac": 0.607249467,
"autogenerated": false,
"ratio": 4.150442477876106,
"config_test": false,
"has_... |
'''A weighted directed graph class.'''
import pprint
class WeightedDigraph(object):
def __init__(self):
'''Initalize an empty graph.'''
self.clear()
def clear(self):
'''Re-initialize to an empty graph.'''
self._edges = {}
def add_edge(self, source, dest, weight):
... | {
"repo_name": "bdusell/pycfg",
"path": "src/util/weighted_digraph.py",
"copies": "1",
"size": "1477",
"license": "mit",
"hash": -8582655522039279000,
"line_mean": 31.1086956522,
"line_max": 81,
"alpha_frac": 0.5876777251,
"autogenerated": false,
"ratio": 4.102777777777778,
"config_test": false,... |
"""A Werkzeug-based picoframework.
Web apps are wholly contained in a class, meaning that multiple instances of the same app can be created in the same process.
"""
from copy import copy
from inspect import getmembers
from functools import wraps
from werkzeug.wrappers import Request, Response
from werkzeug.routing i... | {
"repo_name": "adambrenecki/giki",
"path": "giki/web_framework.py",
"copies": "1",
"size": "4409",
"license": "bsd-2-clause",
"hash": 682488725241365600,
"line_mean": 30.2695035461,
"line_max": 125,
"alpha_frac": 0.5828986165,
"autogenerated": false,
"ratio": 4.1321462043111525,
"config_test": ... |
# awesome-app documentation build configuration file, created by
# sphinx-quickstart.
#
# 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 file.
#
# All configuration values have a default; values that ... | {
"repo_name": "Ilyes-Hammadi/awesome-app",
"path": "docs/conf.py",
"copies": "1",
"size": "7787",
"license": "mit",
"hash": 4895382612356549000,
"line_mean": 31.0452674897,
"line_max": 80,
"alpha_frac": 0.6946192372,
"autogenerated": false,
"ratio": 3.813418217433888,
"config_test": true,
"ha... |
"""Awesome auto cucumber."""
import os
import copy
import aiohttp
import async_timeout
from discord.ext import commands
from util.perms import echeck_perms
from .cog import Cog
class AutoCucumber(Cog):
"""Spelling corrector :)"""
special_chars = list('~`!@#$%^&*()-_=+[{]}\\|:;<,>.?/\'"')
punctuation_chars ... | {
"repo_name": "Armored-Dragon/goldmine",
"path": "default_cogs/autocucumber.py",
"copies": "1",
"size": "2842",
"license": "mit",
"hash": -7217663642786415000,
"line_mean": 36.3947368421,
"line_max": 84,
"alpha_frac": 0.509148487,
"autogenerated": false,
"ratio": 4.002816901408451,
"config_test... |
"""awesomepose URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | {
"repo_name": "manducku/awesomepose",
"path": "awesomepose/awesomepose/urls.py",
"copies": "1",
"size": "2233",
"license": "mit",
"hash": 3057112277466040000,
"line_mean": 41.1320754717,
"line_max": 99,
"alpha_frac": 0.6686072548,
"autogenerated": false,
"ratio": 3.308148148148148,
"config_test... |
'''Awesome python client for Vindinium.
Vindinium is an online and continuous competition where you control a bot in a
turn-based game, consult `the site <http://vindinium.org>`_ to know more.
Note: this client is based on the `ornicar's client
<https://github.com/ornicar/vindinium-starter-python>`_.
This library p... | {
"repo_name": "renatopp/vindinium-python",
"path": "vindinium/__init__.py",
"copies": "1",
"size": "1793",
"license": "mit",
"hash": -5875107396738818000,
"line_mean": 27.9193548387,
"line_max": 80,
"alpha_frac": 0.7032905745,
"autogenerated": false,
"ratio": 3.1346153846153846,
"config_test": ... |
#a whole bunch of i/o functions
#jared@well.ox.ac.uk
import csv, sys,copy,gzip,numpy as np,os,math,time,cStringIO,io,itertools
import numpy as np
import subprocess,string
import string,random#,pysam
csv.field_size_limit(1000000000)
def read_genetic_map(fname):
return np.genfromtxt(ropen(fname),dtype=np.dtype([('p... | {
"repo_name": "jaredo/gwas",
"path": "iolib.py",
"copies": "1",
"size": "46973",
"license": "mit",
"hash": -3674611209708207000,
"line_mean": 35.2725868726,
"line_max": 197,
"alpha_frac": 0.5374576885,
"autogenerated": false,
"ratio": 3.366033679684701,
"config_test": false,
"has_no_keywords"... |
"""A whole file full of Easter eggs? Neat!"""
# Copied without permission from https://gist.github.com/xero/3555086.
LOGO = """\
..:77I777777777777777777777I. .
..?77777777777777777777777777777$+..
. ~7777777I7777777777777777777777777$~..
... | {
"repo_name": "sredmond/acmpy",
"path": "campy/misc/easter.py",
"copies": "1",
"size": "4701",
"license": "mit",
"hash": 1658312052407112700,
"line_mean": 60.0519480519,
"line_max": 213,
"alpha_frac": 0.2822803659,
"autogenerated": false,
"ratio": 3.797253634894992,
"config_test": false,
"has... |
"""A widget for surface-warped neuroimaging data."""
from __future__ import print_function
import nibabel as nb
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import display
from ipywidgets import interact, fixed, IntSlider
# from ipyvolume import gcf
import ipyvolume.pylab as p3
import os
# im... | {
"repo_name": "janfreyberg/niwidgets",
"path": "niwidgets/niwidget_surface.py",
"copies": "1",
"size": "11057",
"license": "cc0-1.0",
"hash": -8222050561908026000,
"line_mean": 37.7964912281,
"line_max": 79,
"alpha_frac": 0.5359500769,
"autogenerated": false,
"ratio": 4.290648040357004,
"config... |
"""A widget to select a file path.
The widget stores previously selected paths in QSettings
Example
-------
def func(t):
print(t)
from cmt.widgets.filepathwidget import FilePathWidget
widget = FilePathWidget(label='My File',
file_mode=FilePathWidget.existing_file,
... | {
"repo_name": "chadmv/cmt",
"path": "scripts/cmt/ui/widgets/filepathwidget.py",
"copies": "1",
"size": "4659",
"license": "mit",
"hash": -3860833571037851600,
"line_mean": 30.06,
"line_max": 86,
"alpha_frac": 0.6054947414,
"autogenerated": false,
"ratio": 4.0477845351867945,
"config_test": fals... |
"""A Willie module to allow Hithub webhooks"""
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from multiprocessing import Process, Queue
import willie.module
import json
message_queue = Queue()
class GithubEventParser(object):
def __init__(self, secret):
self.secret = secret
def cr... | {
"repo_name": "theonion/willie-modules",
"path": "webhook.py",
"copies": "1",
"size": "2462",
"license": "mit",
"hash": -2274352805493441500,
"line_mean": 23.3762376238,
"line_max": 85,
"alpha_frac": 0.5942323314,
"autogenerated": false,
"ratio": 3.901743264659271,
"config_test": false,
"has_... |
""" A windows service that receives commands via tcp and executes them.
Install this service inside the VM::
$ vmserve install
$ vmserve start
The tcp sockets *must* not be exposed to loopback on the host or the
internet. Forward them to UNIX domain sockets on the host with
`vmcall.VMBuilder.add_command_sock... | {
"repo_name": "qbicsoftware/vmcall",
"path": "vmcall/vmserve.py",
"copies": "1",
"size": "8067",
"license": "mit",
"hash": -7583663541142117000,
"line_mean": 31.7926829268,
"line_max": 79,
"alpha_frac": 0.5748109582,
"autogenerated": false,
"ratio": 4.203751954142783,
"config_test": false,
"h... |
"""A window that can be used for tools that handle the referene workflow."""
from PySide import QtGui
from PySide import QtCore
from jukeboxcore import reftrack
from jukeboxcore import djadapter
from jukeboxcore.gui.main import JB_MainWindow, get_icon
from jukeboxcore.gui import treemodel
from jukeboxcore.gui import ... | {
"repo_name": "JukeboxPipeline/jukebox-core",
"path": "src/jukeboxcore/gui/widgets/reftrackwin.py",
"copies": "1",
"size": "13340",
"license": "bsd-3-clause",
"hash": -8222749066655887000,
"line_mean": 35.8508287293,
"line_max": 107,
"alpha_frac": 0.6263868066,
"autogenerated": false,
"ratio": 3.... |
"""A window that can float or dock"""
from PyQt4 import QtGui, QtCore
class Dockable(QtGui.QDockWidget):
def __init__(self, title = QtCore.QString(), parent = None):
"""
Create a dockable window.
"""
QtGui.QDockWidget.__init__(self, title, parent)
self.location = ... | {
"repo_name": "muadibbm/gini",
"path": "frontend/src/gbuilder/UI/Dockable.py",
"copies": "11",
"size": "1524",
"license": "mit",
"hash": -3733154676429409000,
"line_mean": 26.7547169811,
"line_max": 106,
"alpha_frac": 0.5511811024,
"autogenerated": false,
"ratio": 4.36676217765043,
"config_test... |
"""A window where you can load all examples.
An example module only needs to be imported for it to be included
in all the selectable examples (If it properly inherits from the ExampleBase)"""
import os
import sys
import types
import traceback
from pythonicqt.Qt import QtGui
from pythonicqt.fileio import load_ui_file
fr... | {
"repo_name": "Digirolamo/pythonicqt",
"path": "pythonicqt/examples/example_selector.py",
"copies": "1",
"size": "4087",
"license": "mit",
"hash": -6306183389215423000,
"line_mean": 45.9885057471,
"line_max": 100,
"alpha_frac": 0.6694396868,
"autogenerated": false,
"ratio": 4.132457027300303,
"... |
# awl.admintools.py
from django.contrib.admin import ModelAdmin
from django.contrib.admin.utils import lookup_field
from django.template import Context, Template
from django.urls import reverse
from django.utils.html import format_html
from awl.utils import get_obj_attr
# =============================================... | {
"repo_name": "cltrudeau/django-awl",
"path": "awl/admintools.py",
"copies": "1",
"size": "22356",
"license": "mit",
"hash": 3267149571520456000,
"line_mean": 33.93125,
"line_max": 79,
"alpha_frac": 0.5770710324,
"autogenerated": false,
"ratio": 4.472989195678271,
"config_test": false,
"has_n... |
# awl.decorators.py
import logging, json
from functools import wraps
from django.http import Http404
logger = logging.getLogger(__name__)
# ============================================================================
# View Decorators
# ============================================================================
de... | {
"repo_name": "cltrudeau/django-awl",
"path": "awl/decorators.py",
"copies": "1",
"size": "4036",
"license": "mit",
"hash": 3273701076344992300,
"line_mean": 33.4957264957,
"line_max": 78,
"alpha_frac": 0.5847373637,
"autogenerated": false,
"ratio": 4.886198547215496,
"config_test": false,
"h... |
# awl.managment.commands.create_cmd.py
#
import os
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
# ===========================================================================
def _create_module(path):
"""Creates module directory if it doesn't exist and its con... | {
"repo_name": "cltrudeau/django-awl",
"path": "awl/management/commands/create_cmd.py",
"copies": "1",
"size": "2816",
"license": "mit",
"hash": 8168055914573728,
"line_mean": 31,
"line_max": 77,
"alpha_frac": 0.5546875,
"autogenerated": false,
"ratio": 4.075253256150506,
"config_test": false,
... |
# awl.managment.commands.wipe_migrations.py
#
import os
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Searches through the INSTALLED_APP listing looking for any apps that
are in the same base directory structure as the command and removes ... | {
"repo_name": "cltrudeau/django-awl",
"path": "awl/management/commands/wipe_migrations.py",
"copies": "1",
"size": "1228",
"license": "mit",
"hash": 6017650447980213000,
"line_mean": 35.1176470588,
"line_max": 75,
"alpha_frac": 0.6042345277,
"autogenerated": false,
"ratio": 4.385714285714286,
"... |
# awl.rankedmodel.admin.py
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
from django.utils.html import format_html
from django.utils.safestring import mark_safe
# =============================================================================
# RankedModel Helper Methods
# =... | {
"repo_name": "cltrudeau/django-awl",
"path": "awl/rankedmodel/admintools.py",
"copies": "1",
"size": "2944",
"license": "mit",
"hash": -8111488184693596000,
"line_mean": 30.4838709677,
"line_max": 79,
"alpha_frac": 0.5730874317,
"autogenerated": false,
"ratio": 3.605911330049261,
"config_test"... |
# awl.rankedmodel.models.py
from django.db import models, transaction
# ============================================================================
class RankedModel(models.Model):
"""Abstract model used to have all the inheritors ordered in the database
by this model's ``rank`` field. Ranks can either be ... | {
"repo_name": "cltrudeau/django-awl",
"path": "awl/rankedmodel/models.py",
"copies": "1",
"size": "5592",
"license": "mit",
"hash": 2931501599241147000,
"line_mean": 34.6178343949,
"line_max": 78,
"alpha_frac": 0.5658082976,
"autogenerated": false,
"ratio": 4.246013667425968,
"config_test": fal... |
# awl.rankedmodel.views.py
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin.views.decorators import staff_member_required
from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect
# ==================================================================... | {
"repo_name": "cltrudeau/django-awl",
"path": "awl/rankedmodel/views.py",
"copies": "1",
"size": "1133",
"license": "mit",
"hash": 8652150347487434000,
"line_mean": 35.5483870968,
"line_max": 78,
"alpha_frac": 0.6690203001,
"autogenerated": false,
"ratio": 3.9204152249134947,
"config_test": fal... |
# awl.tests.test_colours.py
from django.test import TestCase
from awl.css_colours import (is_colour, colour_to_rgb, colour_to_rgb_string,
LOWER_WEB_COLOUR_MAP)
COLOUR_NAMES = [key.lower() for key in LOWER_WEB_COLOUR_MAP.keys()]
# ============================================================================
clas... | {
"repo_name": "cltrudeau/django-awl",
"path": "awl/tests/test_colours.py",
"copies": "1",
"size": "2633",
"license": "mit",
"hash": 7653531109960584000,
"line_mean": 33.1948051948,
"line_max": 78,
"alpha_frac": 0.4265096848,
"autogenerated": false,
"ratio": 3.002280501710376,
"config_test": tru... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.