code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# Copyright (C) 2010 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it w... | virtuald/exaile | xlgui/playlist_container.py | Python | gpl-2.0 | 23,768 |
#!/usr/bin/env python
''' A package containing all of the main Computer Algebra System
functionality. '''
__author__ = 'Tom Wright <tom.tdw@gmail.com>'
# Copyright 2012 Thomas Wright <tom.tdw@gmail.com>
# This file is part of C1000 Intelligent Calculator.
#
# C1000 Intelligent Calculator is free software: you can redis... | twright/C1000-Intelligent-Calculator | cas/__init__.py | Python | gpl-3.0 | 939 |
# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | GoogleCloudPlatform/training-data-analyst | courses/developingapps/v1.3/python/firebase/start/quiz/webapp/routes.py | Python | apache-2.0 | 2,000 |
# This is the tutorial script.
# Most icons used in this script are from the Tango icon library (http://tango.freedesktop.org/)
# Created by Toni Sagrista
from __future__ import division
from time import sleep
from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface
headerSize = 25
textSize = 13
twdelay =... | vga101/gaiasky | assets/scripts/tutorial/tutorial-pointer.py | Python | mpl-2.0 | 2,078 |
import pygame
class Spaceship(object):
def __init__(self):
self.x = 50
self.y = 200
self.direction_angle = 270
self.spaceship_image_up = pygame.transform.rotate(pygame.image.load("images/spaceship_up_full.png"), self.direction_angle)
self.spaceship_image_normal = pygame.tran... | Pfeter/SpaceShooter | spaceship.py | Python | mit | 2,713 |
# coding: utf-8
# Copyright (C) 2017 Jaime Bemarás
# See LICENSE.txt
from IPy import IP
import re
ASN = re.compile(r'AS\d+', re.IGNORECASE)
def validate(resources):
outcome = True
for resource in resources:
if ASN.match(resource):
continue
else:
try:
... | synte/ec-ripe-api | resource_validator/validator.py | Python | agpl-3.0 | 479 |
from content import Text, Image, Embed, Container
from cgi import escape
import urlparse
default_base_class_names = {
Text.type : 'TextBlock',
Image.type : 'ImageBlock',
Embed.type : 'EmbedBlock',
}
# Override base_class_name to use different selectors
def renderBlock(block, classes=None, attrs=None,... | marquee/composer | composer/__init__.py | Python | unlicense | 4,135 |
class NumArray(object):
def __init__(self, nums):
"""
initialize your data structure here.
:type nums: List[int]
"""
self.table=[0]
sum = 0
for num in nums:
sum += num
self.table.append(sum)
def sumRange(self, i, j):
"""
... | haonancool/OnlineJudge | leetcode/python/range_sum_query.py | Python | apache-2.0 | 632 |
from ctypes import *
import Calibration as C
import os
import unittest
class Singleton(object):
"""Ensures only one instance of subtypes exist at a time."""
_instance = None
def __new__(class_, *args, **kwargs):
if not isinstance(class_._instance, class_):
class_._instance = object.__new__(class_, *args, **kw... | MontyThibault/Force-Sensor-Integration | MayaIntegration/LabPro.py | Python | mit | 3,308 |
"""Tests cyclical mapper relationships.
We might want to try an automated generate of much of this, all combos of
T1<->T2, with o2m or m2o between them, and a third T3 with o2m/m2o to one/both
T1/T2.
"""
from itertools import count
from sqlalchemy import bindparam
from sqlalchemy import event
from sqlalchemy import ... | monetate/sqlalchemy | test/orm/test_cycles.py | Python | mit | 58,509 |
# Copyright 2015 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | mitchellrj/touchdown | touchdown/aws/kms/key.py | Python | apache-2.0 | 2,410 |
import re
from bender.signals import event_received, message_received
@event_received.connect
def echo(sender, **kwargs):
print(kwargs['event']._raw)
return True
@message_received.connect
def hey(sender, **kwargs):
event = kwargs['event']
if re.search('hi dave', event.text, re.IGNORECASE):
... | seancron/bender | bender/plugins/demo.py | Python | mit | 1,142 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import numpy as np
from scipy.spatial.distance import cdist
import matplotlib.pyplot as plt
from math import sqrt
import matplotlib.animation as animation
from dana import *
''' Spikes model in computational neuroscience with Brian library. '''
# -------------... | Aurelien1609/Computational-model | frequency_model.py | Python | bsd-3-clause | 13,265 |
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(name = "python-linkedin",
version = "0.1",
description = "Python Interface for the LinkedIn API",
author = "Pedro Araujo",
license = open("LICENSE").read(),
long_description = open("README").read(),
author_email = "pedro... | pedroma/python-linkedin | setup.py | Python | mit | 460 |
from django.db.models import Q, Sum
from django.db.models.deletion import ProtectedError
from django.db.utils import IntegrityError
from django.forms.models import modelform_factory
from django.test import TestCase, skipIfDBFeature
from .models import (
A, Address, B, Board, C, CharLink, Company, Contact, Content,... | edmorley/django | tests/generic_relations_regress/tests.py | Python | bsd-3-clause | 10,914 |
from builtins import str
from zope.interface import implementer
from plone.portlets.interfaces import IPortletDataProvider
from plone.app.portlets.portlets import base
from Products.CMFCore.utils import getToolByName
from zope import schema
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from... | potzenheimer/meetshaus | src/meetshaus.blog/meetshaus/blog/portlets/archive.py | Python | mit | 4,854 |
from hashlib import sha256
from decimal import Decimal
from binascii import unhexlify, hexlify
import pprint
import unittest
from electrum_ltc.lnaddr import shorten_amount, unshorten_amount, LnAddr, lnencode, lndecode, u5_to_bitarray, bitarray_to_u5
from electrum_ltc.segwit_addr import bech32_encode, bech32_decode
fro... | pooler/electrum-ltc | electrum_ltc/tests/test_bolt11.py | Python | mit | 14,265 |
from distutils.core import setup
setup(name='MysqlRoles',
version='1.2.8',
description='Role Based Access Control (RBAC) for mysql',
author='Ryan Birmingham',
author_email='birm@rbirm.us',
url='http://rbirm.us',
classifiers=['Development Status :: 5 - Production/Stable',
... | birm/MysqlRoles | setup.py | Python | gpl-3.0 | 806 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | snnn/tensorflow | tensorflow/python/keras/layers/cudnn_recurrent_test.py | Python | apache-2.0 | 18,942 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', models.IntegerField(se... | tjm-1990/blueking | home_application/migrations/0001_initial.py | Python | gpl-3.0 | 1,874 |
"""Copyright (c) 2017 abhishek-sehgal954
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This prog... | abhishek-sehgal954/Inkscape_extensions_for_halftone_filters | SVG_to_SVG/svg_to_svg_ordered_dithering.py | Python | gpl-2.0 | 7,450 |
# pisces package
| danieljohnlewis/pisces | pisces/__init__.py | Python | mit | 18 |
"""
Downloads the following:
- Korean Wikipedia texts
- Korean
"""
from sqlparse import parsestream
from sqlparse.sql import Parenthesis
for statement in parsestream(open('data/test.sql')):
texts = [str(token.tokens[1].tokens[-1]).decode('string_escape') for token in statement.tokens if isinstance(token, Parent... | carpedm20/Bias | scripts/download.py | Python | bsd-3-clause | 449 |
import fnmatch
import logging
import os
from urlparse import urlparse
from distlib.version import UnsupportedVersionError
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
from django.template.defaultfilters import slu... | 1suming/readthedocs.org | readthedocs/projects/models.py | Python | mit | 31,719 |
#
# Copyright (c) 2015 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
'''author@esilgard'''
'''
test 3 - make sure that the path to the JSON output file is valid
'''
test_num='3'
test_desc='make sure that the JSON output file n... | esilgard/argos_nlp_tests | Tests/test3.py | Python | apache-2.0 | 516 |
from toontown.coghq.CashbotCogHQLoader import CashbotCogHQLoader
from toontown.toonbase import ToontownGlobals, TTLocalizer
from toontown.hood.CogHood import CogHood
from toontown.hood import ZoneUtil
class CashbotHQ(CogHood):
notify = directNotify.newCategory('CashbotHQ')
ID = ToontownGlobals.CashbotHQ
... | ToontownUprising/src | toontown/hood/CashbotHQ.py | Python | mit | 981 |
'''
Copyright (c) 2013, Agora Games, LLC All rights reserved.
https://github.com/agoragames/torus/blob/master/LICENSE.txt
'''
from chai import Chai
from torus.configuration import Configuration
from torus.schema import Schema
from torus.aggregates import Aggregates
class ConfiguratonTest(Chai):
def test_process_... | agoragames/torus | test/unit/configuration_test.py | Python | bsd-3-clause | 671 |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | azverkan/scons | test/Libs/SharedLibrary.py | Python | mit | 6,303 |
import os
import glob
SOURCE_FILES = glob.glob(os.path.dirname(__file__) + "/*.py")
__all__ = [os.path.basename(f)[: -3] for f in SOURCE_FILES]
_ROOT = os.path.abspath(os.path.dirname(__file__))
from .ixo import * | Repythory/Libraries | amolf/__init__.py | Python | bsd-2-clause | 216 |
#run mosaicMOD09GA_for_valid.py
#python mosaicMOD09GA.py
import sys,pipes,struct,os,glob,fnmatch,pickle
from mpl_toolkits.basemap import NetCDFFile
from sattools import *
from scipy.ndimage import *
from gmttools import *
from pylab import *
####---snow1:
year='2008'
workfolder='/scratch/clisap/seaice/OWN_PRODU... | mitkin/modis-mpf | modismpf/mosaicMOD09GA_for_valid.py | Python | gpl-3.0 | 2,484 |
#!/usr/bin/env python2
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
import sys
import os
import argparse
import logging
import PIL.Image
# Add path for DIGITS package
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import digits.config
digits.config.load_config... | batra-mlp-lab/DIGITS | tools/resize_image.py | Python | bsd-3-clause | 3,785 |
import jinja2
bgp_cisco_template = """
router bgp 10
neighbor {{ peer_ip }} remote-as {{ remote_as }}
address-family ipv4 unicast
"""
bgp_juniper_template = """
protocols {
bgp {
group EBGP {
type external;
peer-as {{ remote_as }};
neighbor {{ peer_ip }};
... | wjohnston888/pynet_test- | jinja2_bgp.py | Python | apache-2.0 | 514 |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
import tweepy
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
def tdata():
userid = st... | zhangyubaka/tweepy_favbot | bot.py | Python | mit | 923 |
# /**
# * Licensed to the Apache Software Foundation (ASF) under one
# * or more contributor license agreements. See the NOTICE file
# * distributed with this work for additional information
# * regarding copyright ownership. The ASF licenses this file
# * to you under the Apache License, Version 2.0 (the
# * "... | 1ambda/zeppelin | scripts/mahout/add_mahout_interpreters.py | Python | apache-2.0 | 12,747 |
class ClientPackets:
CGetClasses, \
CNewAccount, \
CDelAccount, \
CLogin, \
CAddChar, \
CDelChar, \
CUseChar, \
CSayMsg, \
CEmoteMsg, \
CBroadcastMsg, \
CGlobalMsg, \
CAdminMsg, \
CPlayerMsg, \
CPlayerMove, \
CPlayerDir, \
CUseItem, ... | marcusmoller/pyorpg-client | src/network/packettypes.py | Python | mit | 2,090 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | Stargrazer82301/CAAPR | CAAPR/CAAPR_AstroMagic/PTS/pts/modeling/maps/dust/blackbody.py | Python | mit | 10,331 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from functools import partial
from django.test import TestCase
from janyson.validators import validators
class ValidatorsTestCase(TestCase):
TEST_VALUES = {
'str': 'string',
'unicode': 'über',
'pos_int': 123,
... | un-def/django-janyson | tests/tests_validators.py | Python | bsd-2-clause | 2,338 |
# Copyright 2014, 2018 IBM Corp.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | powervm/pypowervm | pypowervm/tests/wrappers/test_managed_system.py | Python | apache-2.0 | 16,283 |
# Volatility
# Copyright (C) 2010 Brendan Dolan-Gavitt
# Copyright (c) 2011 Michael Cohen <scudette@gmail.com>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software ... | thaskell1/volatility | volatility/plugins/overlays/linux/linux.py | Python | gpl-2.0 | 77,727 |
# -*- coding: utf-8 -*-
"""
pyfire.stream.stanzas
~~~~~~~~~~~~~~~~~~~~~~
Process stream events and redirect to tag handlers
:copyright: 2011 by the pyfire Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import cPickle
import uuid
from thread import allocate_lo... | IgnitedAndExploded/pyfire | pyfire/stream/stanzas/__init__.py | Python | bsd-3-clause | 10,001 |
# Challenge: guess-number game infinite number of guesses
# The game: Guess the number game.
# In this game we will try to guess a random number between 0 and 100 generated
# by the computer. Depending on our guess, the computer will give us hints,
# whether we guessed too high, too low or if we guessed correctly.
#
# ... | vinaymayar/python-game-workshop | lesson4/guess_game.py | Python | mit | 1,288 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AccountType'
db.create_table('accounts_accounttype', (
('id', self.gf('django.db.model... | machtfit/django-oscar-accounts | accounts/migrations/0001_initial.py | Python | bsd-3-clause | 27,400 |
# Copyright (C) 2017 Intel Corporation
# Released under the MIT license (see COPYING.MIT)
import os
import sys
import glob
import re
from oeqa.core.context import OETestContext
class CompatLayerTestContext(OETestContext):
def __init__(self, td=None, logger=None, layer=None):
super(CompatLayerTestContext,... | schleichdi2/OPENNFR-6.1-CORE | opennfr-openembedded-core/scripts/lib/compatlayer/context.py | Python | gpl-2.0 | 375 |
from datetime import timedelta
from flask import Flask, json, helpers, request
from flask.views import MethodView
from wordpress_xmlrpc import Client
from wordpress_xmlrpc import methods as wp_methods
from wordpress_xmlrpc.methods import taxonomies as wp_taxonomies
app = Flask(__name__)
wp = Client('http://localhos... | maxcutler/wp-xmlrpc-rest-wrapper | wp-rest.py | Python | mit | 13,839 |
# Job: Information about a Unit's job.
# DO NOT MODIFY THIS FILE
# Never try to directly create an instance of this class, or modify its member variables.
# Instead, you should only be reading its variables and calling its functions.
from games.catastrophe.game_object import GameObject
# <<-- Creer-Merge: imports --... | siggame/Joueur.py | games/catastrophe/job.py | Python | mit | 2,433 |
# ---------------------------------------------------------------------------
# SpatialNotifierSample1.py
#
# SAMPLE #1:
# This file shows how you would use the Spatial Notification GP tools to
# create a basic spatial notification for every feature class in a
# data workspace.
# ---------------------------------------... | Esri/workflowmanager-admin-tools | Documentation/SpatialNotifierSample1.py | Python | apache-2.0 | 5,096 |
# -*- encoding: utf-8 -*-
'''
Created on: 2015
Author: Mizael Martinez
'''
from pyfann import libfann
from login import Login
from escribirArchivo import EscribirArchivo
import inspect, sys, os
sys.path.append("../model")
from baseDatos import BaseDatos
class CtrlEntrenarRNANormalizado:
def __init__(self):
... | martinezmizael/Escribir-con-la-mente | object/entrenarFannNormalizado.py | Python | mit | 5,218 |
"""
Scenario control for Marquee, load once at the beginning then keep shifting
"""
from Marquee import Load, Shift
initial = 0
accepting = (0,1)
graph = ((0, (Load, (), None), 1), # empty args here, match any pattern
(1, (Shift, (), None), 1))
| jon-jacky/PyModel | samples/Marquee/LoadFirst.py | Python | bsd-3-clause | 260 |
from datetime import datetime
from ansible.plugins.callback import CallbackBase
from some_project.storage import Logs # A custom object to store to the database
class PlayLogger:
"""Store log output in a single object.
We create a new object per Ansible run
"""
def __init__(self):
self.log = ... | boehlke/openslides-multiinstance-backend | python/logger.py | Python | mit | 7,173 |
# flake8: noqa
"""
Tune's Scikit Learn Adapters
============================
Scikit-Learn is one of the most widely used tools in the ML community for working with data, offering dozens of easy-to-use machine learning algorithms. However, to achieve high performance for these algorithms, you often need to perform **mo... | richardliaw/ray | doc/source/tune/_tutorials/tune-sklearn.py | Python | apache-2.0 | 7,634 |
"""Utilities for constructing tests."""
# Copyright (c) 2012-2016 Andrew Dawson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | ajdawson/windspharm | windspharm/tests/utils.py | Python | mit | 2,492 |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 25 17:44:16 2016
@author: Morran or Lumi
"""
#import numpy as np
from time import time, sleep
from parsers import copy_file
from SRsim import instrument as sim900c
from Sim928 import instrument as sim928c
sim900 = sim900c('GPIB0::12::INSTR')
D1 = sim928c(sim900, name='... | benschneider/Generic-Sweepscript | SRS_bat_read.py | Python | gpl-2.0 | 796 |
#!/usr/bin/env ambari-python-wrap
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the... | alexryndin/ambari | ambari-server/src/main/resources/stacks/ADH/1.5/services/stack_advisor.py | Python | apache-2.0 | 139,091 |
from __future__ import unicode_literals
from django.utils.functional import cached_property
from django.contrib.contenttypes.models import ContentType
from wagtail.wagtailcore.blocks import ChooserBlock
class SnippetChooserBlock(ChooserBlock):
def __init__(self, target_model, **kwargs):
super(SnippetChoo... | iho/wagtail | wagtail/wagtailsnippets/blocks.py | Python | bsd-3-clause | 637 |
from __future__ import absolute_import
from django.db import IntegrityError, transaction
from django.db.models.signals import post_delete, post_save
from sentry.models import Email, UserEmail
def create_email(instance, created, **kwargs):
if created:
try:
with transaction.atomic():
... | ifduyue/sentry | src/sentry/receivers/email.py | Python | bsd-3-clause | 788 |
"""todoLists 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... | williamHuang5468/LearningDjango | todoLists/todoLists/urls.py | Python | mit | 792 |
import os
from flask_appbuilder.security.manager import AUTH_OID, AUTH_REMOTE_USER, AUTH_DB, AUTH_LDAP, AUTH_OAUTH
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h'
OPENID_PROVIDERS = [
{'name': 'Yahoo', 'url': 'https://me.yahoo.com'},
{'... | rpiotti/Flask-AppBuilder | examples/issue_169/config.py | Python | bsd-3-clause | 1,899 |
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create reader and warp data with vectors
reader = vtk.vtkDataSetReader()
reader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/blow.vtk")
reader.SetScalarsName("thickness9")
reader.Se... | HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Filters/Extraction/Testing/Python/extractUGrid.py | Python | gpl-3.0 | 2,642 |
#!/usr/bin/env python
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
parent = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)
)))
sys.path.insert(0, parent)
from django.conf import settings
settings.CRISPY_TEMPLATE_PACK = 'bootstrap'
def runtests():
... | uranusjr/django-crispy-forms-ng | crispy_forms/tests/runtests_bootstrap.py | Python | mit | 961 |
P = []
[1] if True else P
print [1] == P
P2 = [[1],P]
S = [None]
S2 = [['s'],S]
def woef():
P = []
return [1.0]
return P
woef()
wa = [1]
x = [1.0]
x = [1]
x = wa
r = [[1]]
c = [[1.0]]
c = [[1]]
c = r
bp = [True]
print [1] == bp
#*WARNING* 11.py:3: incompatible types
#*WARNING* 11.py:4: incompatible ... | RobertoMalatesta/shedskin | tests/errs/11.py | Python | gpl-3.0 | 525 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 5 10:39:04 2017
@author: BallBlueMeercat
"""
# zombie apocalypse modeling
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
plt.ion()
P = 0 # birth rate
d = 0.0001 # natural death percent (per day)
B = 0.... | lefthandedroo/Cosmo-models | History/zombieapocalypse.py | Python | mit | 2,168 |
import sys
import re
import os.path
# @formatter:off
COMMUNITY_TEST_ROOT = os.path.expandvars('${DEV_IDEA_HOME}/community/python/testSrc')
ULTIMATE_TEST_ROOT = os.path.expandvars('${DEV_IDEA_HOME}/python/testSrc')
ALL_TEST_SUITE_CLASS = os.path.expandvars('${DEV_IDEA_HOME}/python/testSrc/com/jetbrains/python/PythonAll... | asedunov/intellij-community | python/helpers/check_all_test_suite.py | Python | apache-2.0 | 2,526 |
"""empty message
Revision ID: 4da5ae2d09f5
Revises: None
Create Date: 2013-12-07 00:36:44.507321
"""
# revision identifiers, used by Alembic.
revision = '4da5ae2d09f5'
down_revision = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade():
### commands auto gene... | abak-press/kozmic-ci | migrations/versions/4da5ae2d09f5_.py | Python | bsd-3-clause | 6,222 |
# Authors: Jaakko Leppakangas <jaeilepp@student.jyu.fi>
#
# License: BSD (3-clause)
from datetime import datetime
import time
import numpy as np
from .externals.six import string_types
class Annotations(object):
"""Annotation object for annotating segments of raw data.
Parameters
----------
onset ... | wronk/mne-python | mne/annotations.py | Python | bsd-3-clause | 4,328 |
import click
from arrow.cli import pass_context, json_loads
from arrow.decorators import custom_exception, dict_output
@click.command('delete_organism')
@click.argument("organism_id", type=str)
@pass_context
@custom_exception
@dict_output
def cli(ctx, organism_id):
"""Remove an organism completely.
Output:
... | galaxy-genome-annotation/python-apollo | arrow/commands/remote/delete_organism.py | Python | mit | 439 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | averrin/qutebrowser | tests/unit/commands/test_runners.py | Python | gpl-3.0 | 1,488 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from integration_tests import chrome_proxy_measurements as measurements
from integration_tests import chrome_proxy_pagesets as pagesets
from telemetry import... | CTSRD-SOAAP/chromium-42.0.2311.135 | tools/chrome_proxy/integration_tests/chrome_proxy_benchmark.py | Python | bsd-3-clause | 5,926 |
#coding=utf-8
import jieba
from read_conf import config
import codecs
import os
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
#python str default is ascii decode, is conflict with unicode
t_path = config("../conf/dp.conf")
ws_path = t_path["gb_path"]
lex_path = t_path["lex_path"]
text_path = t_path["text_pat... | CharLLCH/work-for-py | nlp-train/old/old_getgram.py | Python | gpl-2.0 | 4,275 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2016 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | vicnet/weboob | weboob/capabilities/bank.py | Python | lgpl-3.0 | 28,402 |
__author__ = 'LiGuangyu'
basicConfig={
'db': {
'host': 'liguangyumysql.cf8iw2auduon.ap-southeast-1.rds.amazonaws.com',
'port': 3306,
'user': 'gyli',
'password': 'gyligyli',
'db': 'CUPS_QR',
'charset':'utf8'
},
'redis':{
'addr':'127.0.0.1',
'po... | liguangyulgy/cupQrSys | common/config.py | Python | gpl-3.0 | 833 |
import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="tickfont", parent_name="carpet.aaxis", **kwargs):
super(TickfontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/carpet/aaxis/_tickfont.py | Python | mit | 1,527 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | airbnb/caravel | superset/models/__init__.py | Python | apache-2.0 | 911 |
#
# Copyright IBM Corp. 2016 All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | corecode/fabric | bddtests/steps/peer_basic_impl.py | Python | apache-2.0 | 39,034 |
"""
optparse -- forward-compatibility wrapper for use with Python 2.2.x and
earlier. If you import from 'optparse' rather than 'optik', your code
will work on base Python 2.3 (and later), or on earlier Pythons with
Optik 1.4.1 or later installed.
"""
from pyi_optik import __version__, __all__
from pyi_optik import *
| pdubroy/kurt | build/MacOS/PyInstaller/pyinstaller-svn-r812/pyi_optparse.py | Python | gpl-2.0 | 320 |
#!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Parameters
#
import os
import s... | gvlproject/bioconda-recipes | recipes/pathwaymatcher/pathwaymatcher.py | Python | mit | 3,231 |
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_group_page(self):
wd = self.app.wd
if wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0:
return
wd.find_element_by_link_text("groups"... | isakhanian/python_training | fixture/group.py | Python | apache-2.0 | 3,779 |
import psiturk.experiment_server as exp
exp.launch()
| NYUCCL/psiTurk | psiturk/heroku_files/herokuapp.py | Python | mit | 53 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
import matplotlib
from matplotlib.testing.decorators import image_comparison, knownfailureif, cleanup
import matplotlib.pyplot as plt
from matplotlib import patches, path, transf... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/matplotlib/tests/test_simplification.py | Python | bsd-2-clause | 7,701 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.website.website_generator import WebsiteGenerator
from frappe import _
from frappe.utils.file_manager import save_file, remove_f... | gangadharkadam/vlinkfrappe | frappe/website/doctype/web_form/web_form.py | Python | mit | 4,058 |
"""
Scheduler Partner interface (v2 extension).
"""
from novaclient import base
# from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import utils
class SchedulerPartner(base.Resource):
def __repr__(self):
return self.scheduler_partner
class SchedulerPartn... | daitr-gu/scheduler-api-client | scheduler_partner.py | Python | mit | 485 |
# -*- coding: utf-8 -*-
import random
import time
import threading
from module.plugins.Plugin import SkipDownload as Skip
from module.plugins.internal.Plugin import Plugin
from module.utils import compare_time, lock, parseFileSize as parse_size
class Account(Plugin):
__name__ = "Account"
__type__ = "a... | ace02000/pyload | module/plugins/internal/Account.py | Python | gpl-3.0 | 11,106 |
#!/usr/bin/env python
# Script to analyze code and arrange ld sections.
#
# Copyright (C) 2008-2010 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import sys
# LD script headers/trailers
COMMONHEADER = """
/* DO NOT EDIT! This is an autogenerated file.... | SSLab-NTHU/qemu-guest-armvisor | roms/seabios/tools/layoutrom.py | Python | gpl-2.0 | 21,418 |
"""Test class for Puppet Environment UI
:Requirement: Environment
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Puppet
:Assignee: vsedmik
:TestType: Functional
:CaseImportance: Low
:Upstream: No
"""
import pytest
from nailgun import entities
from robottelo.constants import DEFAULT_CV
from r... | lpramuk/robottelo | tests/foreman/ui/test_puppetenvironment.py | Python | gpl-3.0 | 5,351 |
import parsenvy
def test_list_several(monkeypatch):
monkeypatch.setenv("foo", "bar,baz,barf")
assert parsenvy.list("foo") == ["bar", "baz", "barf"]
def test_list_one(monkeypatch):
monkeypatch.setenv("foo", "bar")
assert parsenvy.list("foo") == ["bar"]
def test_list_one_comma(monkeypatch):
monk... | nkantar/Parsenvy | tests/test_list.py | Python | bsd-3-clause | 648 |
'''
Created on Mar 16, 2013
@author: Decker
'''
import unittest
import datetime
from XMLParser import XMLParser
from store.ChapterRepository import ChapterRepositoryInMemory
from store.FeedRepository import FeedRepositoryInMemory
import pytz
class Test(unittest.TestCase):
testUrl = r'test-resources/testrss.xml'
... | Decker108/MangaFeedr | test/XMLParserTest.py | Python | gpl-3.0 | 3,140 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pclock.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| NicsTr/pclock | website/manage.py | Python | gpl-3.0 | 249 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
from mox import IsA # noqa
from django.core.urlresolvers import reverse # noqa
from django.core.urlresolvers import reverse_lazy # noqa
from django import http
from horizon.workflows import views
from openstack_dashboard import api
from openstack_dashboard.api import l... | openstack-ja/horizon | openstack_dashboard/dashboards/project/loadbalancers/tests.py | Python | apache-2.0 | 29,753 |
#! /usr/bin/python3
"""
offer_hash is the hash of either a bet or an order.
"""
import binascii
import struct
from . import (util, config, exceptions, bitcoin, util)
from . import (order, bet, rps)
FORMAT = '>32s'
LENGTH = 32
ID = 70
def validate (db, source, offer_hash):
problems = []
# TODO: make query ... | Ziftr/counterpartyd | lib/cancel.py | Python | mit | 3,225 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def grab(Parser):
# init parser
parser = Parser(group=u"Политика",
name=u"ГОРДОН",
link=u"http://gordonua.com",
parser=u"gordonua_com",
charset="utf-8")
try:
link = "http:/... | cuteredcat/gator | parsers/gordonua_com.py | Python | mit | 753 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | var/spack/repos/builtin/packages/py-dateutil/package.py | Python | lgpl-2.1 | 1,826 |
# -*- coding: utf8 -*-
"""
Burp-UI is a web-ui for burp backup written in python with Flask and
jQuery/Bootstrap
.. module:: burpui.logging
:platform: Unix
:synopsis: Burp-UI logging module.
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
"""
import logging
def convert_level(verbose):
# This is already... | ziirish/burp-ui | burpui/tools/logging.py | Python | bsd-3-clause | 3,289 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from . import multilingual_translation_latent_depth # noqa
from .loss import latent_depth # noqa
from .models import latent_multilingual_tra... | pytorch/fairseq | examples/latent_depth/latent_depth_src/__init__.py | Python | mit | 380 |
#!/usr/bin/env python
#-*-Mode:python;coding:utf-8;tab-width:4;c-basic-offset:4;indent-tabs-mode:()-*-
# ex: set ft=python fenc=utf-8 sts=4 ts=4 sw=4 et nomod:
#
# MIT License
#
# Copyright (c) 2013-2021 Michael Truog <mjtruog at protonmail dot com>
#
# Permission is hereby granted, free of charge, to any person obtain... | CloudI/CloudI | src/tests/environment/environment.py | Python | mit | 3,395 |
#!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test decoding scripts via decodescript RPC comma... | digibyte/digibyte | test/functional/rpc_decodescript.py | Python | mit | 16,811 |
# vim:ts=4:sw=4:et:
# Copyright 2012-present Facebook, Inc.
# Licensed under the Apache License, Version 2.0
# no unicode literals
from __future__ import absolute_import, division, print_function
import errno
import functools
import inspect
import os
import os.path
import tempfile
import time
import Interrupt
import... | wez/watchman | tests/integration/WatchmanTestCase.py | Python | apache-2.0 | 16,976 |
# (C) 2016, Markus Wildi, wildi.markus@bluewin.ch
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distr... | RTS2/rts2 | scripts/u_point/u_point/httpd_connection.py | Python | lgpl-3.0 | 3,250 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, absolute_import
import unittest
from ..morf import analyze, disambiguate
# EINO SANTANEN. Muodon vanhimmat
# http://luulet6lgendus.blogspot.com/
sentences = '''KÕIGE VANEM MUDEL
Pimedas luusivad robotid,
originaalsed tšehhi robotid kahe... | estnltk/estnltk | estnltk/vabamorf/tests/test_disambiguate.py | Python | gpl-2.0 | 1,255 |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | kou/arrow | cpp/src/arrow/util/bpacking_simd_codegen.py | Python | apache-2.0 | 6,630 |
'''Method collection to make calculation for optical systems
'''
from calc import *
__all__=["chief_ray_search",
"find_apperture",
"find_ppp",
"find_reference_sphere_radius",
"get_optical_path_ep",
"intersection",
"nearest_points",
"parallel_propagate",
... | andykee/pyoptools | pyoptools/raytrace/calc/__init__.py | Python | bsd-3-clause | 422 |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.module_utils.facts.network import fc_wwn
from units.compat.mock i... | thaim/ansible | test/units/module_utils/facts/network/test_fc_wwn.py | Python | mit | 2,910 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.