text stringlengths 0 1.05M | meta dict |
|---|---|
"""An example term implementation. This implements terms used for dask"""
from __future__ import absolute_import, division, print_function
from itertools import count
from pinyon.core import Context
def istask(x):
""" Is x a runnable task?
A task is a tuple with a callable first argument
Example
-... | {
"repo_name": "jcrist/pinyon",
"path": "pinyon/term/sexpr.py",
"copies": "1",
"size": "2472",
"license": "bsd-3-clause",
"hash": -611100087342270800,
"line_mean": 21.2702702703,
"line_max": 78,
"alpha_frac": 0.5934466019,
"autogenerated": false,
"ratio": 3.4915254237288136,
"config_test": false... |
""" An example that defines two apps, one with a single hbox and
one with hboxes in vboxes in hboxes. For performance testing
"""
import time
import flexx
from flexx import ui
class MyApp1(ui.App):
def init(self):
with ui.VBox() as self.l1:
ui.Button(text='Box A', flex=0)
... | {
"repo_name": "hungle90/flexx",
"path": "examples/ui-tests/box_performance.py",
"copies": "21",
"size": "4634",
"license": "bsd-2-clause",
"hash": -9032786051202666000,
"line_mean": 36.674796748,
"line_max": 82,
"alpha_frac": 0.4721622788,
"autogenerated": false,
"ratio": 3.5701078582434516,
"c... |
""" An example that defines two apps, one with a single hbox and
one with hboxes in vboxes in hboxes. For performance testing
"""
import time
import zoof
from zoof import ui
class MyApp1(ui.App):
def init(self):
with ui.HBox(self):
ui.Button(text='Box A', flex=0)
ui.... | {
"repo_name": "almarklein/zoof",
"path": "examples/ui/box_performance.py",
"copies": "1",
"size": "2492",
"license": "bsd-2-clause",
"hash": 6770527543598483000,
"line_mean": 35.115942029,
"line_max": 86,
"alpha_frac": 0.4739165329,
"autogenerated": false,
"ratio": 3.5804597701149423,
"config_t... |
# An example to get a tile source, save a thumbnail, and iterate through the
# tiles at a specific magnification, reporting the average color of each tile.
import argparse
import numpy
import large_image
# Explicitly set the caching method before we request any data
large_image.config.setConfig('cache_backend', 'pyt... | {
"repo_name": "DigitalSlideArchive/large_image",
"path": "examples/average_color.py",
"copies": "1",
"size": "2357",
"license": "apache-2.0",
"hash": 6705809868174848000,
"line_mean": 39.6379310345,
"line_max": 78,
"alpha_frac": 0.6359779381,
"autogenerated": false,
"ratio": 3.8513071895424837,
... |
"""An example to run minitaur gym environment with randomized terrain.
"""
import math
import numpy as np
import tensorflow as tf
#from google3.pyglib import app
#from google3.pyglib import flags
from pybullet_envs.minitaur.envs import minitaur_randomize_terrain_gym_env
FLAGS = flags.FLAGS
flags.DEFINE_enum("examp... | {
"repo_name": "MadManRises/Madgine",
"path": "shared/bullet3-2.89/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_randomize_terrain_gym_env_example.py",
"copies": "2",
"size": "2206",
"license": "mit",
"hash": -7039910983589351000,
"line_mean": 27.6493506494,
"line_max": 97,
"alpha_frac": ... |
"""An example to run of the minitaur gym environment with sine gaits.
"""
import csv
import math
import os
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(os.path.dirname(currentdir)))
print("parentdir=", parentdir)
os.s... | {
"repo_name": "MTASZTAKI/ApertusVR",
"path": "plugins/physics/bulletPhysics/3rdParty/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_gym_env_example.py",
"copies": "2",
"size": "7020",
"license": "mit",
"hash": -4702521174686219000,
"line_mean": 29.6550218341,
"line_max": 103,
"alp... |
"""An example to run the minitaur environment of alternating legs.
"""
import time
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
os.sys.path.insert(0, parentdir)
import os
import numpy as np
import te... | {
"repo_name": "MadManRises/Madgine",
"path": "shared/bullet3-2.89/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_alternating_legs_env_example.py",
"copies": "2",
"size": "3761",
"license": "mit",
"hash": 7913803194884294000,
"line_mean": 32.8828828829,
"line_max": 114,
"alpha_frac": 0.712... |
"""An example to run the minitaur environment of standing with four legs.
"""
import numpy as np
import tensorflow as tf
from pybullet_envs.minitaur.envs import minitaur_four_leg_stand_env
FLAGS = tf.flags.FLAGS
tf.flags.DEFINE_string("log_path", None, "The directory to write the log file.")
NUM_LEGS = 4
kroll = 3.0
... | {
"repo_name": "MTASZTAKI/ApertusVR",
"path": "plugins/physics/bulletPhysics/3rdParty/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_four_leg_stand_env_example.py",
"copies": "2",
"size": "1917",
"license": "mit",
"hash": -9022565774189264000,
"line_mean": 27.1911764706,
"line_max": ... |
# An example use of the /delta API call. Maintains a local cache of
# the App Folder's contents. Use the 'update' sub-command to update
# the local cache. Use the 'find' sub-command to search the local
# cache.
#
# Example usage:
#
# 1. Link to your Dropbox account
# > python search_cache.py link
#
# 2. Go to Dro... | {
"repo_name": "calvdee/dropbox_python_sdk",
"path": "example/search_cache.py",
"copies": "1",
"size": "9122",
"license": "mit",
"hash": 3756008433887201300,
"line_mean": 31.8129496403,
"line_max": 116,
"alpha_frac": 0.5879193159,
"autogenerated": false,
"ratio": 3.5998421468034727,
"config_test... |
# an example user tag, using RiotTag
from riot_tag import RiotTag
class P(RiotTag):
debug = 1
# never do mutables on class level. this is just to check if transpiler
# creates the same behaviour - and it does, a second tag instance gets
# the same lv object:
lv = [{'name': 'n0'}]
# i... | {
"repo_name": "QQuick/Transcrypt",
"path": "transcrypt/demos/riot_demo/riot_demo.py",
"copies": "1",
"size": "1646",
"license": "apache-2.0",
"hash": -5501191482737263000,
"line_mean": 30.92,
"line_max": 84,
"alpha_frac": 0.567436209,
"autogenerated": false,
"ratio": 3.6017505470459517,
"config... |
"""An example using as many different features of rueckenwind as possible
"""
__author__ = """Florian Ludwig"""
__email__ = 'f.ludwig@greyrook.com'
__version__ = '0.0.2'
import tornado.web
import perm
import rw.testing
import rw.http
import rw.httpbase
import rw.scope
from rw import gen
from . import model
root = ... | {
"repo_name": "FlorianLudwig/rwuser",
"path": "rwuser/__init__.py",
"copies": "1",
"size": "2360",
"license": "apache-2.0",
"hash": -4040383193965596700,
"line_mean": 25.2222222222,
"line_max": 87,
"alpha_frac": 0.6406779661,
"autogenerated": false,
"ratio": 3.5866261398176293,
"config_test": f... |
"""An example using as many different features of rueckenwind as possible
"""
import time
import tornado.web
import tornado.ioloop
import rw.testing
import rw.http
import rw.httpbase
from rw import gen
# every rueckenwind projects needs at least one rw.http.Module
root = rw.http.Module('test.example')
@root.init
d... | {
"repo_name": "FlorianLudwig/rueckenwind",
"path": "test/example/__init__.py",
"copies": "1",
"size": "2388",
"license": "apache-2.0",
"hash": -3313034623288294400,
"line_mean": 20.9082568807,
"line_max": 76,
"alpha_frac": 0.6930485762,
"autogenerated": false,
"ratio": 3.52212389380531,
"config... |
"""An example using WAV audio."""
import io
import math
import wave
import binobj
from binobj import fields
class WAVFileHeader(binobj.Struct):
riff_header = fields.Bytes(const=b"RIFF")
size = fields.UInt32(endian="little")
file_format = fields.Bytes(const=b"WAVE")
# Format and data chunks follow
... | {
"repo_name": "dargueta/binobj",
"path": "tests/full_examples/wav_test.py",
"copies": "1",
"size": "3970",
"license": "bsd-3-clause",
"hash": -8689727697808208000,
"line_mean": 30.76,
"line_max": 82,
"alpha_frac": 0.637279597,
"autogenerated": false,
"ratio": 3.3473861720067455,
"config_test": ... |
# An exception that any methods in exchange may raise.
class ExchangeException(Exception):
def __init__(self, exception):
message = '[%s] %s' % (type(exception).__name__, exception)
Exception.__init__(self, message)
# An order.
class Order(object):
def __init__(self, market, order_id, bid_orde... | {
"repo_name": "dtbartle/altcoin-autosell",
"path": "exchange_api.py",
"copies": "1",
"size": "2212",
"license": "apache-2.0",
"hash": 5423754842314280000,
"line_mean": 25.6506024096,
"line_max": 83,
"alpha_frac": 0.6365280289,
"autogenerated": false,
"ratio": 4.0962962962962965,
"config_test": ... |
""" An exception View equipped with traceback,
log output, and where to file a bug.
"""
from urwid import (Pile, Text, Filler, WidgetWrap, Divider)
from ubuntui.widgets.buttons import cancel_btn
from ubuntui.utils import Color, Padding
class ErrorViewException(Exception):
"Problem in Error View"
class ErrorVi... | {
"repo_name": "battlemidget/conjure-up",
"path": "ubuntui/views/error.py",
"copies": "1",
"size": "1366",
"license": "mit",
"hash": -116990739683668160,
"line_mean": 31.5238095238,
"line_max": 68,
"alpha_frac": 0.5805270864,
"autogenerated": false,
"ratio": 4.041420118343195,
"config_test": fal... |
"""An execution engine for Python processes."""
import copy
import inspect
import json
import os
import shlex
import shutil
from resolwe.flow.execution_engines.base import BaseExecutionEngine
from resolwe.flow.execution_engines.exceptions import ExecutionError
from resolwe.flow.models.utils import hydrate_input_refere... | {
"repo_name": "jberci/resolwe",
"path": "resolwe/flow/execution_engines/python/__init__.py",
"copies": "1",
"size": "3704",
"license": "apache-2.0",
"hash": -1939259999420230400,
"line_mean": 37.5833333333,
"line_max": 116,
"alpha_frac": 0.6695464363,
"autogenerated": false,
"ratio": 4.0525164113... |
"""An execution engine for Python processes."""
import os
from resolwe.flow.execution_engines.base import BaseExecutionEngine
from resolwe.process.parser import SafeParser
PYTHON_RUNTIME_DIRNAME = "python_runtime"
PYTHON_RUNTIME_ROOT = "/"
PYTHON_RUNTIME_VOLUME = os.path.join(PYTHON_RUNTIME_ROOT, PYTHON_RUNTIME_DIRNA... | {
"repo_name": "genialis/resolwe",
"path": "resolwe/flow/execution_engines/python/__init__.py",
"copies": "1",
"size": "1284",
"license": "apache-2.0",
"hash": -7637847016620552000,
"line_mean": 32.7894736842,
"line_max": 81,
"alpha_frac": 0.6760124611,
"autogenerated": false,
"ratio": 4.367346938... |
"""An execution engine that outputs bash programs."""
import copy
import shellescape
import yaml
from django.conf import settings
from resolwe.flow.execution_engines.base import BaseExecutionEngine
from resolwe.flow.execution_engines.exceptions import ExecutionError
from resolwe.flow.expression_engines import Evalua... | {
"repo_name": "jberci/resolwe",
"path": "resolwe/flow/execution_engines/bash/__init__.py",
"copies": "1",
"size": "3260",
"license": "apache-2.0",
"hash": -4836073617358197000,
"line_mean": 32.9583333333,
"line_max": 88,
"alpha_frac": 0.6171779141,
"autogenerated": false,
"ratio": 4.7521865889212... |
"""An execution engine that outputs bash programs."""
import copy
import shellescape
import yaml
from resolwe.flow.execution_engines.base import BaseExecutionEngine
from resolwe.flow.execution_engines.exceptions import ExecutionError
from resolwe.flow.expression_engines import EvaluationError
from resolwe.flow.models... | {
"repo_name": "genialis/resolwe",
"path": "resolwe/flow/execution_engines/bash/__init__.py",
"copies": "1",
"size": "3130",
"license": "apache-2.0",
"hash": 7020067260480734000,
"line_mean": 34.1685393258,
"line_max": 88,
"alpha_frac": 0.6249201278,
"autogenerated": false,
"ratio": 4.742424242424... |
"""An execution engine that supports workflow specifications."""
import collections
import yaml
from django.db import transaction
from resolwe.flow.execution_engines.base import BaseExecutionEngine
from resolwe.flow.execution_engines.exceptions import ExecutionError
from resolwe.flow.expression_engines import Evalua... | {
"repo_name": "jberci/resolwe",
"path": "resolwe/flow/execution_engines/workflow/__init__.py",
"copies": "1",
"size": "5636",
"license": "apache-2.0",
"hash": -4730300465726501000,
"line_mean": 35.1282051282,
"line_max": 109,
"alpha_frac": 0.5688431512,
"autogenerated": false,
"ratio": 5.03214285... |
# an exhaustive research on moving average strategy
import sys
import os
this_dir=os.path.dirname(__file__)
sys.path.append(this_dir+"\..\\")
from Back_Test import *
from Ticker_API import *
from Data_API import *
from Util import *
import Single_Algos
test_start = -2500
test_end = -1
Pricing_Database... | {
"repo_name": "geome-mitbbs/QTS_Research",
"path": "Algo_Research/Moving_Average.py",
"copies": "1",
"size": "10491",
"license": "mit",
"hash": -4207640791727655000,
"line_mean": 38.98046875,
"line_max": 205,
"alpha_frac": 0.634925174,
"autogenerated": false,
"ratio": 3.1504504504504505,
"confi... |
"""An EXIF library, written by Gene Cash.
Original file was available at Gene Cash's web site::
http://home.cfl.rr.com/genecash/
"""
# Library to extract EXIF information in digital camera image files
#
# To use this library call with:
# f=open(path_name, 'rb')
# tags=EXIF.process_file(f)
# tags will now b... | {
"repo_name": "dbaty/Lasco",
"path": "lasco/ext/exif.py",
"copies": "1",
"size": "42067",
"license": "bsd-3-clause",
"hash": -7022373962422283000,
"line_mean": 34.0558333333,
"line_max": 85,
"alpha_frac": 0.5145601065,
"autogenerated": false,
"ratio": 3.496259973404255,
"config_test": false,
... |
"""An experimental library for combining (g)VCFS into sparse matrix tables"""
# these are necessary for the diver script included at the end of this file
import math
import uuid
from typing import Optional, List, Tuple, Dict
import hail as hl
from hail import MatrixTable, Table
from hail.expr import StructExpression
f... | {
"repo_name": "hail-is/hail",
"path": "hail/python/hail/experimental/vcf_combiner/vcf_combiner.py",
"copies": "1",
"size": "26027",
"license": "mit",
"hash": -1509807225512726000,
"line_mean": 40.8440514469,
"line_max": 176,
"alpha_frac": 0.5374418873,
"autogenerated": false,
"ratio": 3.737363584... |
"""An experimental SVG renderer for the ReportLab graphics framework.
This will create SVG code from the ReportLab Graphics API (RLG).
To read existing SVG code and convert it into ReportLab graphics
objects download the svglib module here:
http://python.net/~gherman/#svglib
"""
import math, string, types, sys, os... | {
"repo_name": "alexissmirnov/donomo",
"path": "donomo_archive/lib/reportlab/graphics/renderSVG.py",
"copies": "2",
"size": "26974",
"license": "bsd-3-clause",
"hash": 3255077663741253600,
"line_mean": 31.577294686,
"line_max": 145,
"alpha_frac": 0.5615407429,
"autogenerated": false,
"ratio": 3.53... |
"""An experimental XPath-based streaming filter for ElementTree's iterparse
For details see:
http://dalkescientific.com/writings/diary/archive/2006/11/06/iterparse_filter.html
"""
# I have got to rearrange my site to use shorter URLs.
__version__ = "0.9-experimental"
import re
dtd_validation = False
try:
from lx... | {
"repo_name": "jerrylei98/graphene",
"path": "curation/dblp/iterparse_filter.py",
"copies": "1",
"size": "23248",
"license": "apache-2.0",
"hash": -1222795375246253000,
"line_mean": 34.9319938176,
"line_max": 84,
"alpha_frac": 0.5136355816,
"autogenerated": false,
"ratio": 3.831877369375309,
"c... |
# An expert who knows about how file names are structured on a number of
# platforms... this handles them mostly as strings, which of course they
# are...
import os
def windows_environment_vars_to_unix(token):
"""Transmogrify windows environment tokens (e.g. %WINDIR%) to
the UNIX form ($WINDIR) for python e... | {
"repo_name": "xia2/xia2",
"path": "src/xia2/Experts/Filenames.py",
"copies": "1",
"size": "1070",
"license": "bsd-3-clause",
"hash": 7933161707017330000,
"line_mean": 24.4761904762,
"line_max": 72,
"alpha_frac": 0.608411215,
"autogenerated": false,
"ratio": 3.9051094890510947,
"config_test": f... |
"""An exporter that converts scenes / animations to shareable HTML files.
"""
from klampt import *
from klampt.model import trajectory
from klampt import robotsim
import json
import pkg_resources
_title_id = '__TITLE__'
_scene_id = '__SCENE_JSON__'
_path_id = '__PATH_JSON__'
_rpc_id = '__RPC_JSON__'
_compressed_id = ... | {
"repo_name": "krishauser/Klampt",
"path": "Python/klampt/io/html.py",
"copies": "1",
"size": "7673",
"license": "bsd-3-clause",
"hash": -4166459910219164700,
"line_mean": 37.1741293532,
"line_max": 127,
"alpha_frac": 0.5581910596,
"autogenerated": false,
"ratio": 3.8654911838790933,
"config_te... |
"""An exposure time calculator for LSST. Uses GalSim to draw a galaxy with specified magnitude,
shape, etc, and then uses the same image as the optimal weight function. Derived from D. Kirkby's
notes on deblending.
"""
import numpy as np
import galsim
# Some constants
# --------------
#
# LSST effective area in me... | {
"repo_name": "DarkEnergyScienceCollaboration/BremertonRoundTrip",
"path": "galsim/lsstetc.py",
"copies": "1",
"size": "6774",
"license": "mit",
"hash": 2269566649429024000,
"line_mean": 35.6162162162,
"line_max": 98,
"alpha_frac": 0.5922645409,
"autogenerated": false,
"ratio": 3.3092330239374697... |
"""an extended chroot equivalent"""
from __future__ import absolute_import, unicode_literals
import argparse
import errno
from functools import partial
import os
import sys
from pychroot.base import Chroot
from pychroot.exceptions import ChrootError
from snakeoil.cli import arghparse
def bindmount(s, recursive=Fa... | {
"repo_name": "radhermit/pychroot",
"path": "pychroot/scripts/pychroot.py",
"copies": "1",
"size": "4248",
"license": "bsd-3-clause",
"hash": 4580546519955035000,
"line_mean": 32.7142857143,
"line_max": 80,
"alpha_frac": 0.6560734463,
"autogenerated": false,
"ratio": 4.0534351145038165,
"config... |
""" An extended complex number library, with a richer API and compatible with Python numeric types.
It includes functions that are equivalent to the ones found in the cmath module. It also includes an
AlComplex object, which wraps a complex number, with a better API.
Every function and mathematical operation availabl... | {
"repo_name": "Jexan/AlComplex",
"path": "AlComplex/__init__.py",
"copies": "1",
"size": "20277",
"license": "mit",
"hash": -587384492263944800,
"line_mean": 21.6569832402,
"line_max": 124,
"alpha_frac": 0.5603886176,
"autogenerated": false,
"ratio": 4.258979206049149,
"config_test": false,
"... |
"""An extended version of the log_settings module from zamboni:
https://github.com/jbalogh/zamboni/blob/master/log_settings.py
"""
from __future__ import absolute_import
from tornado.log import LogFormatter as TornadoLogFormatter
import logging, logging.handlers
import os.path
import types
from logconfig import dictc... | {
"repo_name": "shizhz/tutu",
"path": "logconfig/logconfig.py",
"copies": "1",
"size": "2974",
"license": "mit",
"hash": -6657438961477350000,
"line_mean": 30.9784946237,
"line_max": 79,
"alpha_frac": 0.5558170814,
"autogenerated": false,
"ratio": 4.008086253369272,
"config_test": false,
"has_... |
"""An extended version of the log_settings module from zamboni:
https://github.com/jbalogh/zamboni/blob/master/log_settings.py
"""
from __future__ import absolute_import
import logging
import logging.handlers
import os.path
import types
from tornado.log import LogFormatter as TornadoLogFormatter
from logconfig impor... | {
"repo_name": "LetSpotify/letspotify-server",
"path": "logconfig/logconfig.py",
"copies": "1",
"size": "3364",
"license": "mit",
"hash": -2570820611584533500,
"line_mean": 29.5818181818,
"line_max": 79,
"alpha_frac": 0.5460760999,
"autogenerated": false,
"ratio": 4.02874251497006,
"config_test"... |
"""An extended version of the log_settings module from zamboni:
https://github.com/jbalogh/zamboni/blob/master/log_settings.py
"""
from tornado.log import LogFormatter as TornadoLogFormatter
import logging, logging.handlers
import os.path
import types
import dictconfig
# Pulled from commonware.log we don't have to im... | {
"repo_name": "tijmenNL/iptv-grabber",
"path": "logconfig/logconfig.py",
"copies": "2",
"size": "3294",
"license": "mit",
"hash": -7171974828646311000,
"line_mean": 31.2941176471,
"line_max": 79,
"alpha_frac": 0.5428051002,
"autogenerated": false,
"ratio": 4.021978021978022,
"config_test": fals... |
"""An extended version of the log_settings module from zamboni:
https://github.com/jbalogh/zamboni/blob/master/log_settings.py
"""
from tornado.options import _LogFormatter as TornadoLogFormatter
import logging, logging.handlers
import os.path
import types
import dictconfig
# Pulled from commonware.log we don't have ... | {
"repo_name": "scrbrd/scoreboard",
"path": "logconfig/logconfig.py",
"copies": "1",
"size": "3500",
"license": "mit",
"hash": 2281988867910946300,
"line_mean": 32.0188679245,
"line_max": 79,
"alpha_frac": 0.554,
"autogenerated": false,
"ratio": 4.041570438799076,
"config_test": false,
"has_no... |
"""An extensible dictionary."""
from contextlib import contextmanager
def extend_as_list(original_dict, **kwargs):
new_dict = original_dict
for k, v in kwargs.items():
if k in original_dict:
oldv = new_dict[k]
if not hasattr(oldv, 'extend'):
oldv = [oldv]
... | {
"repo_name": "PolyJIT/benchbuild",
"path": "benchbuild/utils/dict.py",
"copies": "1",
"size": "3054",
"license": "mit",
"hash": -7912648611071020000,
"line_mean": 25.7894736842,
"line_max": 79,
"alpha_frac": 0.564178127,
"autogenerated": false,
"ratio": 4.1214574898785425,
"config_test": false... |
"""An extensible library for opening URLs using a variety of protocols
The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below). It opens the URL and returns the results as file-like
object; the returned object has some extra me... | {
"repo_name": "MalloyPower/parsing-python",
"path": "front-end/testsuite-python-lib/Python-2.3/Lib/urllib2.py",
"copies": "1",
"size": "38857",
"license": "mit",
"hash": -371795576136770940,
"line_mean": 32.3823024055,
"line_max": 102,
"alpha_frac": 0.5736675502,
"autogenerated": false,
"ratio": ... |
"""An extensible library for opening URLs using a variety of protocols
The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below). It opens the URL and returns the results as file-like
object; the returned object has some ext... | {
"repo_name": "ericlink/adms-server",
"path": "playframework-dist/1.1-src/python/Lib/urllib2.py",
"copies": "2",
"size": "48945",
"license": "mit",
"hash": -2031839721669424600,
"line_mean": 33.9889705882,
"line_max": 82,
"alpha_frac": 0.5733169885,
"autogenerated": false,
"ratio": 4.174057649667... |
""" An extension of optparse.OptionParser that has custom error and exit handling
Classes:
:py:class:`OptionParser`
the extension class of :py:class:`optparse.OptionParser`
"""
import optparse
class OptionParser(optparse.OptionParser):
""" Overrides the error() and exit() methods to allow prevention... | {
"repo_name": "gsmcwhirter/simulations",
"path": "src/simulations/utils/optionparser.py",
"copies": "1",
"size": "2161",
"license": "mit",
"hash": -6333160788913152000,
"line_mean": 21.9893617021,
"line_max": 81,
"alpha_frac": 0.578898658,
"autogenerated": false,
"ratio": 4.812917594654788,
"co... |
"""An extension to the basic_association.py example, which illustrates
the usage of sqlalchemy.ext.associationproxy.
"""
from datetime import datetime
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer,
String, DateTime, Float, ForeignKey, and_)
from sqlalchemy.orm import mapper, relationshi... | {
"repo_name": "rclmenezes/sqlalchemy",
"path": "examples/association/proxied_association.py",
"copies": "1",
"size": "3262",
"license": "mit",
"hash": -4647414569573261000,
"line_mean": 31.297029703,
"line_max": 78,
"alpha_frac": 0.6440833844,
"autogenerated": false,
"ratio": 3.824150058616647,
... |
""" An extractor is a callable that returns or yields data. For example:
.. code-block:: python
def extract(response):
return "something"
The ``response`` parameter here is an instance of
:class:`wex.response.Response`.
Extractors can be combined in various ways.
"""
from __future__ import absolute_imp... | {
"repo_name": "eBay/wextracto",
"path": "wex/extractor.py",
"copies": "3",
"size": "7029",
"license": "bsd-3-clause",
"hash": -8664217992233106000,
"line_mean": 23.9255319149,
"line_max": 82,
"alpha_frac": 0.5837245696,
"autogenerated": false,
"ratio": 4.211503894547634,
"config_test": false,
... |
"""An extractor of boolean trigram queries from a regex, such that a superset
of the docs matching the regex are returned. You can then run the actual regex
over just the returned docs, saving a lot of computation and IO.
We support a subset of the PCRE regex language at the moment, lacking
lookarounds and noncapturin... | {
"repo_name": "jbradberry/dxr",
"path": "dxr/trigrammer.py",
"copies": "4",
"size": "23461",
"license": "mit",
"hash": 2493588180821778400,
"line_mean": 38.563237774,
"line_max": 270,
"alpha_frac": 0.6259323984,
"autogenerated": false,
"ratio": 4.0554883318928265,
"config_test": false,
"has_n... |
"""An extremely asynch approach to unzipping files. This allows you
to unzip a little bit of a file at a time, which means it can
integrate nicely with a reactor.
"""
from __future__ import generators
import zipfile
import os.path
import binascii
import zlib
import struct
class ChunkingZipFile(zipfile.ZipFile):
... | {
"repo_name": "santisiri/popego",
"path": "envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/python/zipstream.py",
"copies": "1",
"size": "8977",
"license": "bsd-3-clause",
"hash": 1152075640708284500,
"line_mean": 33.3946360153,
"line_max": 93,
"alpha_frac": 0.5756934388,
"autogenerated": fals... |
""" An extremely hack script that was used to render the dock guide icons.
"""
from enaml.qt.QtCore import *
from enaml.qt.QtGui import *
class GuidePad(object):
LeftPosition = 0
TopPosition = 1
RightPosition = 2
BottomPosition = 3
CenterTop = 4
SplitLeft = 5
SplitTop = 6
Spli... | {
"repo_name": "ContinuumIO/ashiba",
"path": "enaml/enaml/qt/docking/dock_images/guide_render.py",
"copies": "1",
"size": "14712",
"license": "bsd-3-clause",
"hash": -1723708703575212500,
"line_mean": 33.1345707657,
"line_max": 86,
"alpha_frac": 0.5685834693,
"autogenerated": false,
"ratio": 3.042... |
"""An extremely simple interface to the signing/verifying capabilities
of gnupg.
You must already have the key in the keyring.
"""
from subprocess import PIPE, Popen
from xmlrpc.client import dumps, loads
# see also myplc/plc.d/gpg
import os.path
GPG = '/usr/bin/gpg1' if os.path.exists("/usr/bin/gpg1") else "/usr/bi... | {
"repo_name": "dreibh/planetlab-lxc-nodemanager",
"path": "ticket.py",
"copies": "1",
"size": "1355",
"license": "bsd-3-clause",
"hash": -3717718730675223600,
"line_mean": 30.511627907,
"line_max": 106,
"alpha_frac": 0.6302583026,
"autogenerated": false,
"ratio": 3.2729468599033815,
"config_tes... |
"""An extremely simple interface to the signing/verifying capabilities
of gnupg.
You must already have the key in the keyring.
"""
from subprocess import PIPE, Popen
from xmlrpclib import dumps, loads
GPG = '/usr/bin/gpg'
def _popen_gpg(*args):
"""Return a Popen object to GPG."""
return Popen((GPG, '--batch... | {
"repo_name": "wangyang2013/NodeManager",
"path": "ticket.py",
"copies": "2",
"size": "1253",
"license": "apache-2.0",
"hash": -6229091246316007000,
"line_mean": 29.5609756098,
"line_max": 106,
"alpha_frac": 0.6241021548,
"autogenerated": false,
"ratio": 3.3864864864864863,
"config_test": false... |
"""A nfqueu that listen for CPS/CPA messages"""
from copy import deepcopy
import sys
from NDprotector.Log import warn
from NDprotector.CertCache import CertCache
from NDprotector.NeighCache import NeighCache
from scapy6send.scapy6 import *
import NDprotector
if "lib" not in sys.path:
sys.path.append("lib")
impor... | {
"repo_name": "daveti/NDprotector",
"path": "NDprotector/CertPath.py",
"copies": "2",
"size": "5378",
"license": "bsd-3-clause",
"hash": -3444410381783469600,
"line_mean": 29.5568181818,
"line_max": 89,
"alpha_frac": 0.5585719598,
"autogenerated": false,
"ratio": 4.004467609828741,
"config_test... |
"""An FTP client class and some helper functions.
Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
Example:
>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest login ok, ac... | {
"repo_name": "IronLanguages/ironpython3",
"path": "Src/StdLib/Lib/ftplib.py",
"copies": "2",
"size": "38532",
"license": "apache-2.0",
"hash": -5585125010265389000,
"line_mean": 34.2534309241,
"line_max": 98,
"alpha_frac": 0.5352693865,
"autogenerated": false,
"ratio": 4.1330043977260535,
"con... |
"""An FTP client class and some helper functions.
Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
Example:
>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest log... | {
"repo_name": "hexlism/xx_net",
"path": "python27/1.0/lib/ftplib.py",
"copies": "3",
"size": "38027",
"license": "bsd-2-clause",
"hash": -5930315979643732000,
"line_mean": 33.8407163054,
"line_max": 98,
"alpha_frac": 0.5174744261,
"autogenerated": false,
"ratio": 4.174204171240395,
"config_test... |
#AngeCryption: getting valid files after encryption
#takes any file as input, and a standard PDF/PNG/JPG as target
#will create a result_file that is source_file with appended 'garbage'
#and once ENcrypted with the chosen algorithm with the supplied script, it will show target_file
#any block cipher is supporte... | {
"repo_name": "kanpol/angeak",
"path": "polyglot/angecrypt.py",
"copies": "3",
"size": "4404",
"license": "mit",
"hash": 4755520906795119000,
"line_mean": 28.7972027972,
"line_max": 112,
"alpha_frac": 0.6153496821,
"autogenerated": false,
"ratio": 3.062586926286509,
"config_test": false,
"has... |
"""Angelina URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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-b... | {
"repo_name": "anshengme/Angelina",
"path": "Angelina/urls.py",
"copies": "1",
"size": "2096",
"license": "mit",
"hash": 7916763786252801000,
"line_mean": 44.7674418605,
"line_max": 94,
"alpha_frac": 0.6600609756,
"autogenerated": false,
"ratio": 2.8114285714285714,
"config_test": false,
"has... |
import math
import pygame, sys, colorsys
from pygame.locals import *
pygame.init()
WIDTH, HEIGHT = 700, 700 #alter the screen dimensions here
screen = pygame.display.set_mode((WIDTH, HEIGHT))
position = [0, 0]
def degrees_to_radians(angle):
return angle * math.pi / 180 % (2 * math.pi)
def angle_to_point(start... | {
"repo_name": "MiniGirlGeek/Spirograph",
"path": "angle.py",
"copies": "1",
"size": "2281",
"license": "mit",
"hash": -7730023757864572000,
"line_mean": 40.4727272727,
"line_max": 146,
"alpha_frac": 0.6733888645,
"autogenerated": false,
"ratio": 3.263233190271817,
"config_test": false,
"has_n... |
angle = radians(10.)
patches = radians(360.)/angle
theta = np.arange(0,radians(360.),angle)
count = [0]*patches
for i, item in enumerate(some_array_of_azimuth_directions):
temp = int((item - item%angle)/angle)
count[temp] += 1
width = angle * np.ones(patches)
# force square figure and square axes looks better ... | {
"repo_name": "Leviyu/Maligaro",
"path": "cpp_lib/backup/10_plotly/rose.py",
"copies": "1",
"size": "1966",
"license": "mit",
"hash": -7444637095276663000,
"line_mean": 32.8965517241,
"line_max": 89,
"alpha_frac": 0.5696846389,
"autogenerated": false,
"ratio": 3.320945945945946,
"config_test": ... |
"""Angles and anomalies.
"""
from astropy import units as u
from poliastro.core.angles import (D_to_nu as D_to_nu_fast, nu_to_D as nu_to_D_fast,
E_to_nu as E_to_nu_fast, nu_to_E as nu_to_E_fast,
F_to_nu as F_to_nu_fast, nu_to_F as nu_to_F_fast,
... | {
"repo_name": "newlawrence/poliastro",
"path": "src/poliastro/twobody/angles.py",
"copies": "1",
"size": "8044",
"license": "mit",
"hash": 256057497540889380,
"line_mean": 22.4402332362,
"line_max": 84,
"alpha_frac": 0.5722636816,
"autogenerated": false,
"ratio": 2.9667896678966788,
"config_tes... |
"""Angles and anomalies.
"""
import numpy as np
from astropy import coordinates, units as u
from poliastro import constants
from poliastro.core.angles import (
D_to_M as D_to_M_fast,
D_to_nu as D_to_nu_fast,
E_to_M as E_to_M_fast,
E_to_nu as E_to_nu_fast,
F_to_M as F_to_M_fast,
F_to_nu as F_to... | {
"repo_name": "poliastro/poliastro",
"path": "src/poliastro/twobody/angles.py",
"copies": "1",
"size": "8269",
"license": "mit",
"hash": -6682440819581601000,
"line_mean": 22.0222841226,
"line_max": 101,
"alpha_frac": 0.5962492438,
"autogenerated": false,
"ratio": 2.939189189189189,
"config_tes... |
"""Angles and anomalies.
"""
import numpy as np
from astropy import units as u
from scipy import optimize
def _kepler_equation(E, M, ecc):
return E - ecc * np.sin(E) - M
def _kepler_equation_prime(E, M, ecc):
return 1 - ecc * np.cos(E)
def _kepler_equation_hyper(F, M, ecc):
return -F + ecc * np.sin... | {
"repo_name": "anhiga/poliastro",
"path": "src/poliastro/twobody/angles.py",
"copies": "1",
"size": "5312",
"license": "mit",
"hash": -945965548803119500,
"line_mean": 17.6385964912,
"line_max": 84,
"alpha_frac": 0.5124246988,
"autogenerated": false,
"ratio": 3.1581450653983354,
"config_test": ... |
"""Anglit distribution."""
import numpy
from ..baseclass import SimpleDistribution, ShiftScaleDistribution
class anglit(SimpleDistribution):
"""Anglit distribution."""
def __init__(self):
super(anglit, self).__init__()
def _pdf(self, x):
return numpy.cos(2*x)
def _cdf(self, x):
... | {
"repo_name": "jonathf/chaospy",
"path": "chaospy/distributions/collection/anglit.py",
"copies": "1",
"size": "1484",
"license": "mit",
"hash": 5427485560274517000,
"line_mean": 24.1525423729,
"line_max": 77,
"alpha_frac": 0.5444743935,
"autogenerated": false,
"ratio": 3.2472647702407,
"config_... |
"""AnGroDeto URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/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-b... | {
"repo_name": "SHARPRISE/AnGroDeto",
"path": "AnGroDeto/urls.py",
"copies": "1",
"size": "1105",
"license": "apache-2.0",
"hash": -2290727541376042500,
"line_mean": 35.8333333333,
"line_max": 80,
"alpha_frac": 0.7140271493,
"autogenerated": false,
"ratio": 3.4968354430379747,
"config_test": fal... |
#AngryBirds
#The original code was modified into an object-oriented setting, creating the class AngryBirdsGame. We define the basic methods that
# will let us extract all game features and manipulate the underlying game mechanics- we will now be able to set levels, get scores,
# extract pig positions, perform an action... | {
"repo_name": "imanolarrieta/angrybirds",
"path": "src/AngryBirds.py",
"copies": "1",
"size": "27868",
"license": "mit",
"hash": -1910434652767243300,
"line_mean": 39.5647743814,
"line_max": 145,
"alpha_frac": 0.5213506531,
"autogenerated": false,
"ratio": 3.6505108724128896,
"config_test": fal... |
""" Angular momentum module. """
from __future__ import division
from scipy import floor, sqrt
from scipy.special import factorial
from numpy import arange
def calc_clebsch_hf(J_a, I_a, F_a, mF_a, J_b, I_b, F_b, mF_b, q):
""" Clebsch-Gordan coefficient for the hyperfine transition dipole matrix
element.
... | {
"repo_name": "tommyogden/maxwellbloch",
"path": "maxwellbloch/angmom.py",
"copies": "1",
"size": "5766",
"license": "mit",
"hash": 3415979549837137400,
"line_mean": 29.3473684211,
"line_max": 79,
"alpha_frac": 0.4915019077,
"autogenerated": false,
"ratio": 2.678123548536925,
"config_test": fal... |
#An HDF5 file is a container for two kinds of objects:
# * datasets (array-like collections of data)
# * groups (folder-like containers that hold datasets).
# Groups work like dictionaries, and datasets work like NumPy arrays
from __future__ import division
import numpy as np
def read_rst_h5py (filename=None):
... | {
"repo_name": "gkc1000/pyscf",
"path": "pyscf/nao/m_restart.py",
"copies": "1",
"size": "2079",
"license": "apache-2.0",
"hash": 6185923045166163000,
"line_mean": 32,
"line_max": 114,
"alpha_frac": 0.6301106301,
"autogenerated": false,
"ratio": 3.5660377358490565,
"config_test": false,
"has_n... |
'''An helper file for the pydev debugger (REPL) console
'''
from code import InteractiveConsole
import sys
import traceback
from _pydev_bundle import _pydev_completer
from _pydevd_bundle.pydevd_tracing import get_exception_traceback_str
from _pydevd_bundle.pydevd_vars import make_valid_xml_value
from _pydev_bundle.pyd... | {
"repo_name": "mrknow/filmkodi",
"path": "plugin.video.mrknow/mylib/_pydevd_bundle/pydevd_console.py",
"copies": "9",
"size": "8356",
"license": "apache-2.0",
"hash": -1376898324150235400,
"line_mean": 35.3304347826,
"line_max": 120,
"alpha_frac": 0.5762326472,
"autogenerated": false,
"ratio": 4.... |
'''An helper file for the pydev debugger (REPL) console
'''
from code import InteractiveConsole
import sys
import traceback
import _pydev_completer
from pydevd_tracing import GetExceptionTracebackStr
from pydevd_vars import makeValidXmlValue
from pydev_imports import Exec
from pydevd_io import IOBuf
from pydev_console... | {
"repo_name": "SylvainCorlay/PyDev.Debugger",
"path": "pydevd_console.py",
"copies": "11",
"size": "8205",
"license": "epl-1.0",
"hash": -2551930944242683400,
"line_mean": 34.6739130435,
"line_max": 120,
"alpha_frac": 0.5746496039,
"autogenerated": false,
"ratio": 4.815140845070423,
"config_tes... |
'''An helper file for the pydev debugger (REPL) console
'''
import sys
import traceback
from code import InteractiveConsole
from _pydev_bundle import _pydev_completer
from _pydev_bundle.pydev_code_executor import BaseCodeExecutor
from _pydev_bundle.pydev_imports import Exec
from _pydev_bundle.pydev_override import ove... | {
"repo_name": "paplorinc/intellij-community",
"path": "python/helpers/pydev/_pydevd_bundle/pydevd_console.py",
"copies": "4",
"size": "8987",
"license": "apache-2.0",
"hash": 6408743953949661000,
"line_mean": 35.2379032258,
"line_max": 120,
"alpha_frac": 0.5835095137,
"autogenerated": false,
"rat... |
'''An helper file for the pydev debugger (REPL) console
'''
import sys
import traceback
from code import InteractiveConsole
from _pydev_bundle import _pydev_completer
from _pydev_bundle.pydev_console_utils import BaseInterpreterInterface, BaseStdIn
from _pydev_bundle.pydev_imports import Exec
from _pydev_bundle.pydev_... | {
"repo_name": "ThiagoGarciaAlves/intellij-community",
"path": "python/helpers/pydev/_pydevd_bundle/pydevd_console.py",
"copies": "16",
"size": "8982",
"license": "apache-2.0",
"hash": 3262138753901514000,
"line_mean": 35.3643724696,
"line_max": 120,
"alpha_frac": 0.5839456691,
"autogenerated": fals... |
'''An helper file for the pydev debugger (REPL) console
'''
import sys
import traceback
from code import InteractiveConsole
from _pydev_bundle import _pydev_completer
from _pydev_bundle.pydev_console_utils import BaseInterpreterInterface, BaseStdIn
from _pydev_bundle.pydev_imports import Exec
from _pydev_bund... | {
"repo_name": "glenngillen/dotfiles",
"path": ".vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_console.py",
"copies": "1",
"size": "9545",
"license": "mit",
"hash": -245404088064549760,
"line_mean": 36.4879032258,
"line_max": 12... |
"""An HTML5 Canvas backend for matplotlib.
Simon Ratcliffe (sratcliffe@ska.ac.za)
Ludwig Schwardt (ludwig@ska.ac.za)
Copyright (c) 2010-2013, SKA South Africa
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are... | {
"repo_name": "HoverHell/mplh5canvas",
"path": "mplh5canvas/backend_h5canvas.py",
"copies": "1",
"size": "36543",
"license": "bsd-3-clause",
"hash": -4258252920205791700,
"line_mean": 41.4425087108,
"line_max": 755,
"alpha_frac": 0.5934105027,
"autogenerated": false,
"ratio": 3.617044442244878,
... |
'''An HTML conversion action for the Coda Plugin Skeleton'''
import cp_actions as cp
from markdown import markdown
from textile import textile
from html2text import html2text
from html2textile import html2textile
from rest2html import rest2html
from html2rest_wrapper import html2rest
def act(controller, bundle, opti... | {
"repo_name": "bobthecow/ManipulateCoda",
"path": "src/Support/Scripts/HTMLConvert.py",
"copies": "1",
"size": "1423",
"license": "mit",
"hash": -7521880641688528000,
"line_mean": 25.8679245283,
"line_max": 66,
"alpha_frac": 0.6317638791,
"autogenerated": false,
"ratio": 3.696103896103896,
"con... |
""" An HTTP proxy that routes requests through a number of Tor circuits. """
import logging
import sys
from argparse import ArgumentParser
from shutil import rmtree
from tempfile import mkdtemp
from time import sleep
from miproxy.proxy import AsyncMitmProxy
from proctor.vendor.exit import handle_exit
LOG_FORMAT = '... | {
"repo_name": "ncadou/proctor",
"path": "proctor/scripts.py",
"copies": "1",
"size": "3739",
"license": "bsd-3-clause",
"hash": 3191877486931096000,
"line_mean": 37.1530612245,
"line_max": 79,
"alpha_frac": 0.5982883124,
"autogenerated": false,
"ratio": 4.05971769815418,
"config_test": false,
... |
"""An HTTP proxy that supports IPv6 as well as the HTTP CONNECT method, among
other things."""
# Standard libary imports
import socket
import thread
import select
__version__ = '0.1.0 Draft 1'
BUFFER_LENGTH = 8192
VERSION = 'Python Proxy/{}'.format(__version__)
HTTP_VERSION = 'HTTP/1.1'
class ConnectionHandler(obje... | {
"repo_name": "jeffknupp/kickstarter_video_two",
"path": "proxy.py",
"copies": "1",
"size": "3925",
"license": "apache-2.0",
"hash": 1161910399718794800,
"line_mean": 31.7083333333,
"line_max": 78,
"alpha_frac": 0.5299363057,
"autogenerated": false,
"ratio": 4.046391752577319,
"config_test": fa... |
# ANI2102A16_Tripod.py | Programmation Python avec Maya | coding=utf-8
# Exemple de génération de la structure hiérarchique du squelette d'un personnage composé de plusieurs joints d'animation.
# Le personnage est un 'tripod', une créature dont le squelette a une tête et trois jambes.
# paramètres du programme
offset ... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module09/EXE03/ANI2012A17_Tripod.py",
"copies": "1",
"size": "3705",
"license": "mit",
"hash": 8816204246977481000,
"line_mean": 44.3209876543,
"line_max": 122,
"alpha_frac": 0.7676382457,
"autogenerated": false,
"ratio": 2.795887281035796,
"config... |
# ANI2102A17_Attribute.py | Programmation Python avec Maya | coding=utf-8
# Exemples de manipulations d'attributs d'animation assignés à des noeuds dans une scène Maya.
def attribute_has(nodeName, attributeName):
"""fonction qui valide l'existence d'un attribut sur un noeud"""
# valider si l'attribut existe déjà ... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module08/EXE05/ANI2012A17_Attribute.py",
"copies": "1",
"size": "5920",
"license": "mit",
"hash": -3631828363795796000,
"line_mean": 40.8714285714,
"line_max": 130,
"alpha_frac": 0.7386557489,
"autogenerated": false,
"ratio": 2.8511673151750974,
"c... |
# ANI2102A17_Collection.py | Programmation Python avec Maya | coding=utf-8
# Exemples de manipulations de différents types de collection (tuple, liste et dictionnaire).
import sys
print "\n<début de l'exécution>\n"
def enumerate(sequence):
"""fonction qui affiche dans la console une énumération de tous les élément... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module08/EXE02/ANI2012A17_Collection.py",
"copies": "1",
"size": "3814",
"license": "mit",
"hash": 3924258987913293300,
"line_mean": 25.780141844,
"line_max": 120,
"alpha_frac": 0.7208686441,
"autogenerated": false,
"ratio": 2.7263537906137185,
"co... |
# ANI2102A17_Lambda.py | Programmation Python avec Maya | coding=utf-8
# Exemples de manipulations de listes avec fonctions lambda, map, reduce, filter et leurs équivalents avec la technique de compréhension de liste.
print "\n<début de l'exécution>\n"
# définition de quelques listes de valeurs numériques
listA = [1... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module08/EXE03/ANI2012A17_Lambda.py",
"copies": "1",
"size": "3074",
"license": "mit",
"hash": -1336408682116153600,
"line_mean": 25.3739130435,
"line_max": 146,
"alpha_frac": 0.6884272997,
"autogenerated": false,
"ratio": 2.4420289855072466,
"conf... |
# ANI2102A17_Oscillator.py | Programmation Python avec Maya | coding=utf-8
# Création d'une séquence d'animation par oscillation de différents attributs.
import math
# paramètres l'animation
frameFirst = 1
frameLast = 240
frequency = 0.1
amplitude = 10
# liste d'attributs d'animation
keyframeAttributes = [
'trans... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module08/EXE07/ANI2012A17_Oscillator.py",
"copies": "1",
"size": "1544",
"license": "mit",
"hash": 4926521807189459000,
"line_mean": 32.152173913,
"line_max": 106,
"alpha_frac": 0.7298360656,
"autogenerated": false,
"ratio": 2.893738140417457,
"con... |
# ANI2102A17_Pythonic_Iteration.py | Programmation Python avec Maya | coding=utf-8
# Exemples de structures de contrôle itératives en Python.
print "\n<début de l'exécution>"
#
# exemples d'itérations avec boucle 'for'
#
# 1. exemple de boucle 'for'
print "\n<boucle 'for' de 1 à 5 avec séquence explicite... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module07/EXE06/ANI2012A17_Pythonic_Iteration.py",
"copies": "1",
"size": "4723",
"license": "mit",
"hash": 2045251210773427500,
"line_mean": 19.301369863,
"line_max": 98,
"alpha_frac": 0.6184351554,
"autogenerated": false,
"ratio": 2.5,
"config_tes... |
# ANI2102A17_Selection.py | Programmation Python avec Maya | coding=utf-8#
# Exemples en lien avec l'énumération et la sélection d'éléments présents dans une scène Maya.
def enumerate(sequence):
"""fonction qui affiche dans la console une énumération de tous les éléments d'une séquence"""
print "%s" % str(sequenc... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module08/EXE04/ANI2012A17_Selection.py",
"copies": "1",
"size": "4983",
"license": "mit",
"hash": 5544459855380067000,
"line_mean": 21.4398148148,
"line_max": 101,
"alpha_frac": 0.7066226532,
"autogenerated": false,
"ratio": 2.575451647183847,
"con... |
# ANI2102A17_Skeleton.py | Programmation Python avec Maya | coding=utf-8
# Exemple de manipulations de listes contentant les noms de différents joints d'animation d'un biped.
def enumerate(sequence):
"""fonction qui affiche dans la console une énumération de tous les éléments d'une séquence"""
print "%s" % str(se... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module09/EXE02/ANI2012A17_Skeleton.py",
"copies": "1",
"size": "2508",
"license": "mit",
"hash": 8906514391757763000,
"line_mean": 26.0108695652,
"line_max": 123,
"alpha_frac": 0.7448692153,
"autogenerated": false,
"ratio": 2.792134831460674,
"conf... |
# ANI2102A17_System.py | Programmation Python avec Maya | coding=utf-8
# Exemples de scripts qui permettent d'extraire de l'information sur le système hôte.
import os
import sys
import platform
import maya.cmds
import maya.utils
print "\n<début de l'exécution>\n"
# 1. système d'exploitation
print "\n<déterminer qu... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module08/EXE01/ANI2012A17_System.py",
"copies": "1",
"size": "3568",
"license": "mit",
"hash": 6501109126017649000,
"line_mean": 25.328358209,
"line_max": 121,
"alpha_frac": 0.6887755102,
"autogenerated": false,
"ratio": 2.8246597277822256,
"config... |
# ANI2102A17_Timeline.py | Programmation Python avec Maya | coding=utf-8
# Exemple de programme qui fait la création d'une animation constituée de deux lignes de temps qui contiennent des ensembles de poses clés.
import random
# paramètres du programme
count = 10
speed = 1
theta = 45
ratio = 0.5
# classe de type Key... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module08/EXE10/maya/ANI2012A17_Timeline.py",
"copies": "1",
"size": "5955",
"license": "mit",
"hash": -7314184533377667000,
"line_mean": 27.1626794258,
"line_max": 139,
"alpha_frac": 0.6980971797,
"autogenerated": false,
"ratio": 2.908102766798419,
... |
# ANI2102A17_Tool.py | Programmation Python avec Maya | coding=utf-8
# Exemple d'un outil avec interface graphique qui est directement intégré dans Maya.
# Fonctionnalités :
# + Assignation de transformations géométriques
# + Assignation d'une couleur de sommet
# + Validation ajout et retrait d'un attribut
# + Diverses... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module09/EXE05/ANI2012A17_Tool.py",
"copies": "1",
"size": "24325",
"license": "mit",
"hash": -2442210005626527000,
"line_mean": 32.4355062413,
"line_max": 139,
"alpha_frac": 0.6887626001,
"autogenerated": false,
"ratio": 3.2354046436719903,
"confi... |
# ANI2102A17_Tween.py | Programmation Python avec Maya | coding=utf-8
# Exemples d'interpolations de valeurs numériques (interpolation linéaire et smoothstep).
# paramètres du programme
size = 10
# valeurs minimum et maximum de la transition
positionFrom = -20
positionTo = 20
# durée de l'interpolation
duration = 1... | {
"repo_name": "philvoyer/ANI2012A17",
"path": "Module08/EXE09/ANI2012A17_Tween.py",
"copies": "1",
"size": "3984",
"license": "mit",
"hash": -3825321818809536500,
"line_mean": 32.2966101695,
"line_max": 144,
"alpha_frac": 0.7284296259,
"autogenerated": false,
"ratio": 3.003822629969419,
"config... |
"""aniauth accounts app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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='ho... | {
"repo_name": "randomic/aniauth-tdd",
"path": "logintokens/urls.py",
"copies": "1",
"size": "1131",
"license": "mit",
"hash": -7763168502605513000,
"line_mean": 35.4838709677,
"line_max": 79,
"alpha_frac": 0.6790450928,
"autogenerated": false,
"ratio": 3.448170731707317,
"config_test": false,
... |
from anibots import *
import breve
class AnibotPhysicsSim( breve.PhysicalControl ):
def __init__( self ):
breve.Control.__init__( self )
self.bots = breve.objectList()
self.actionDuration = 45
self.iterCount=self.actionDuration
self.videoLog = breve.Movie()
self.block = None
#configure the anibots
... | {
"repo_name": "SynapticNulship/Anibots",
"path": "sim_py/anibots_breve_exp0-single.py",
"copies": "1",
"size": "5739",
"license": "mit",
"hash": -574097927540259200,
"line_mean": 32.3662790698,
"line_max": 147,
"alpha_frac": 0.6820003485,
"autogenerated": false,
"ratio": 2.624142661179698,
"con... |
# Requires Python >= 2.4
import os
import filecmp
import difflib
import subprocess
print("Anibots Regression Test\n")
def runFileRegression( expectedFile, testFile):
expected = os.path.normpath(expectedFile)
test = os.path.normpath(testFile)
coarse_test = filecmp.cmp(expected, test, False)
if coarse_test == Tru... | {
"repo_name": "SynapticNulship/Anibots",
"path": "regression/regtest.py",
"copies": "1",
"size": "1440",
"license": "mit",
"hash": -3461717275489422000,
"line_mean": 29.0208333333,
"line_max": 170,
"alpha_frac": 0.7347222222,
"autogenerated": false,
"ratio": 2.9508196721311477,
"config_test": t... |
""" An ice cream stand is a specific kind of restaurant. Write a class called IceCreamStand that inherits from the Restaurant class you wrote
in Exercise 9-1 (page 166) or Exercise 9-4 (page 171). Either version of the class will work; just pick the one you like better.
Add an attribute called flavors that stores a lis... | {
"repo_name": "AnhellO/DAS_Sistemas",
"path": "Ene-Jun-2019/Karla Berlanga/Practica 1/restaurant.py",
"copies": "1",
"size": "1918",
"license": "mit",
"hash": 1637752311033574100,
"line_mean": 39.7872340426,
"line_max": 141,
"alpha_frac": 0.6922274387,
"autogenerated": false,
"ratio": 3.491803278... |
#An ice cream stand is a specific kind of restaurant. Write
#a class called IceCreamStand that inherits from the Restaurant class you wrote
#in Exercise 9-1 (page 166) or Exercise 9-4 (page 171). Either version of
#the class will work; just pick the one you like better. Add an attribute called
#flavors that stores a li... | {
"repo_name": "AnhellO/DAS_Sistemas",
"path": "Ene-Jun-2019/NoemiFlores/PrimerParcial/PrimeraPractica/IceCream.py",
"copies": "1",
"size": "1803",
"license": "mit",
"hash": -3328454368342488600,
"line_mean": 34.3529411765,
"line_max": 80,
"alpha_frac": 0.6553829079,
"autogenerated": false,
"ratio... |
# A nicer way to build up index tuples for arrays.
#
# You can do all this with slice() plus a few special objects,
# but there's a lot to remember. This version is simpler because
# it uses the standard array indexing syntax.
#
# Written by Konrad Hinsen <hinsen@cnrs-orleans.fr>
# last revision: 1999-7-23
#
"""This m... | {
"repo_name": "OS2World/DEV-PYTHON-UTIL-ScientificPython",
"path": "src/Lib/site-packages/Scientific/indexing.py",
"copies": "1",
"size": "1338",
"license": "isc",
"hash": -4005946570136556000,
"line_mean": 29.4090909091,
"line_max": 68,
"alpha_frac": 0.6890881913,
"autogenerated": false,
"ratio"... |
"""An IDLE extension to avoid having very long texts printed in the shell.
A common problem in IDLE's interactive shell is printing of large amounts of
text into the shell. This makes looking at the previous history difficult.
Worse, this can cause IDLE to become very slow, even to the point of being
completely unusab... | {
"repo_name": "batermj/algorithm-challenger",
"path": "code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/idlelib/squeezer.py",
"copies": "2",
"size": "12840",
"license": "apache-2.0",
"hash": 1343460937836105500,
"line_mean": 36.2173913043,
"line_max": 80,
"alpha_frac... |
"""An Image file reader object.
"""
# Author: KK Rai (kk.rai [at] iitb.ac.in)
# R. Ambareesha (ambareesha [at] iitb.ac.in)
# Chandrashekhar Kaushik
# Suyog Dutt Jain <suyog.jain [at] aero.iitb.ac.in>
# Prabhu Ramachandran <prabhu [at] aero.iitb.ac.in>
# Copyright (c) 2007-2015, Ent... | {
"repo_name": "dmsurti/mayavi",
"path": "mayavi/sources/image_reader.py",
"copies": "1",
"size": "4929",
"license": "bsd-3-clause",
"hash": 6654195044652316000,
"line_mean": 33.7112676056,
"line_max": 74,
"alpha_frac": 0.5017244877,
"autogenerated": false,
"ratio": 4.209222886421862,
"config_te... |
animal_adjectives = [
'agile',
'bashful',
'clever',
'clumsy',
'drowsy',
'fearful',
'graceful',
'hungry',
'lonely',
'morose',
'placid',
'ruthless',
'silent',
'thoughtful',
'vapid',
'weary'
]
animal_colours = [
'beige',
'black',
'blue',
'bri... | {
"repo_name": "Drakekin/hipku",
"path": "hipku/dictionaries.py",
"copies": "1",
"size": "12392",
"license": "mit",
"hash": -145063107033376900,
"line_mean": 12.0168067227,
"line_max": 71,
"alpha_frac": 0.3933989671,
"autogenerated": false,
"ratio": 2.6405284466226293,
"config_test": false,
"h... |
## Animal is-a object.
class Animal(object):
pass
## Dog is-a Animal.
class Dog(Animal):
## Dog has-a name.
def __init__(self, name):
self.name = name
## Cat is-a Animal.
class Cat(Animal):
## Cat has-a name.
def __init__(self, name):
self.name = name
## Person is-a object.
class Pe... | {
"repo_name": "nchristiny/python",
"path": "ex42.py",
"copies": "1",
"size": "1374",
"license": "mit",
"hash": 6051829211600861000,
"line_mean": 18.3521126761,
"line_max": 74,
"alpha_frac": 0.6128093159,
"autogenerated": false,
"ratio": 2.8155737704918034,
"config_test": false,
"has_no_keywor... |
## Animal is-a object
class Animal(object):
pass
## Dog is-a Animal
class Dog(Animal):
def __init__(self, name):
## Dog has-a name
self.name = name
## Cat is-a Animal
class Cat(Animal):
def __init__(self, name):
## Cat has-a name
self.name = name
## Person is-a object
cl... | {
"repo_name": "SunWalter/Hard",
"path": "ex42.py",
"copies": "1",
"size": "1330",
"license": "apache-2.0",
"hash": -3863981951236563500,
"line_mean": 16.5,
"line_max": 58,
"alpha_frac": 0.6060150376,
"autogenerated": false,
"ratio": 2.788259958071279,
"config_test": false,
"has_no_keywords": ... |
# Animal is-a object
class Animal(object):
pass
# Dog is-a Animal
class Dog(Animal):
def __init__(self, name):
# Dog has-a name
self.name = name
# Cat is-a Animal
class Cat(Animal):
def __init__(self, name):
# Cat has-a name
self.name = name
# Person is-a object
cl... | {
"repo_name": "githubfun/lphw",
"path": "ex42.py",
"copies": "1",
"size": "1178",
"license": "mit",
"hash": 7128417490403029000,
"line_mean": 12.6976744186,
"line_max": 44,
"alpha_frac": 0.6018675722,
"autogenerated": false,
"ratio": 2.758782201405152,
"config_test": false,
"has_no_keywords":... |
# Animal is-a object
class Animal(object):
@staticmethod
def latin_name():
return "Animal"
# Dog is-a Animal
class Dog(Animal):
# Dog has-a name
def __init__(self, name):
self.name = name
def eater(self):
return "Carnivore", Animal.latin_name(), self.name
# Cat is-a Ani... | {
"repo_name": "aurelo/lphw",
"path": "source/ex42.py",
"copies": "1",
"size": "1389",
"license": "mit",
"hash": -643607310038790900,
"line_mean": 15.1511627907,
"line_max": 58,
"alpha_frac": 0.6126709863,
"autogenerated": false,
"ratio": 2.8877338877338876,
"config_test": false,
"has_no_keywo... |
## Animal is-a object
class Animal(object):
pass
## Dog is-a Animal
class Dog(Animal):
def __init__(self, name):
## A self has-a name? What?
self.name = name
## Cat is-a Animal
class Cat(Animal):
def __init__(self, name):
## Self has-a name? I don't understand what is supposed to go here
self.name = nam... | {
"repo_name": "kaitlinahrens/learn-python-the-hard-way",
"path": "ex42.py",
"copies": "1",
"size": "1299",
"license": "apache-2.0",
"hash": -8546893483490669000,
"line_mean": 10.9174311927,
"line_max": 69,
"alpha_frac": 0.6343341032,
"autogenerated": false,
"ratio": 2.587649402390438,
"config_t... |
# Animal is-a object
class Animal(object):
pass
# Dog is-a Animal
class Dog(Animal):
def __init__(self, name):
# Dog has-a name
self.name = name
# Cat is-a Animal
class Cat(Animal):
def __init__(self, name):
# Cat has-a name
self.name = name
# Person is-a object
class Person(object):
def __init__(sel... | {
"repo_name": "michsien/Learning_python",
"path": "exercises _1-44/ex42.py",
"copies": "1",
"size": "1165",
"license": "mit",
"hash": 7075806384504754000,
"line_mean": 16.1323529412,
"line_max": 67,
"alpha_frac": 0.6686695279,
"autogenerated": false,
"ratio": 2.549234135667396,
"config_test": f... |
# Animal "IS-A" object
class Animal(object):
pass
# Dog "IS-A" Animal
class Dog(Animal):
def __init__(self, name):
# Dog "has-a" name
self.name = name
# Cat 'is-a' Animal
class Cat(Animal):
def __init__(self, name):
# Cat 'has-a' name
self.name = name
#... | {
"repo_name": "Chris-Wales/LearnPython",
"path": "ex42.py",
"copies": "1",
"size": "1445",
"license": "mit",
"hash": -5510732723873922000,
"line_mean": 17.527027027,
"line_max": 66,
"alpha_frac": 0.5653979239,
"autogenerated": false,
"ratio": 2.6709796672828094,
"config_test": false,
"has_no_... |
## Animal is-a object (yes, sort of confusing) look at the extra credit
class Animal(object):
# a __str__ method is called when the string representation of the object
# is called for. Doing `print("Hello, %s", rover)` would print the return
# from this method.
def __str__(self):
return "I am ... | {
"repo_name": "Paul-Haley/LPTHW_python3",
"path": "ex42_printing.py",
"copies": "1",
"size": "2712",
"license": "mit",
"hash": -3065945102559683000,
"line_mean": 22.7894736842,
"line_max": 79,
"alpha_frac": 0.5884955752,
"autogenerated": false,
"ratio": 3.095890410958904,
"config_test": false,
... |
## Animal is-a object (yes, sort of confusing) look at the extra credit
class Animal(object):
pass
## Dog is-a Animal
class Dog(Animal):
def __init__(self, name):
## Dog has-a name
self.name = name
## Cat is-a Animal
class Cat(Animal):
def __init__(self, name):
## Cat has-a name... | {
"repo_name": "udoyen/pythonlearning",
"path": "chp42/ex42.py",
"copies": "1",
"size": "1350",
"license": "mit",
"hash": -1187606278516857000,
"line_mean": 17.75,
"line_max": 71,
"alpha_frac": 0.6059259259,
"autogenerated": false,
"ratio": 2.800829875518672,
"config_test": false,
"has_no_keyw... |
## Animal is-a object (yes, sort of confusing) look at the extra credit
class Animal(object):
pass
## Dog is-a Animal
class Dog(Animal):
def __init__(self, name):
## Dog has-a name
self.name = name
## Cat is-a Animal
class Cat(Animal):
def __init__(self, name):
## Cat has-a name
... | {
"repo_name": "alexliew/learn_python_the_hard_way",
"path": "ex42.py",
"copies": "1",
"size": "1322",
"license": "mit",
"hash": -5335614642775248000,
"line_mean": 17.6197183099,
"line_max": 71,
"alpha_frac": 0.6096822995,
"autogenerated": false,
"ratio": 2.8552915766738662,
"config_test": false... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.