code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.apphook_pool import apphook_pool
from cms.appresolver import get_app_urls
from cms.models import Title
from cms.utils import get_template_from_request, get_language_from_request
from cms.utils.i18n import get_fallback_languages, force_language, get_... | aladdinwang/django-cms | cms/views.py | Python | bsd-3-clause | 6,877 |
from tsdesktop import config, config_test
from tsdesktop.testing import TSDesktopTest
from .siteman import rmSite, siteAdd, siteOpen
from bottle import HTTPResponse
class Views(TSDesktopTest):
def setUp(self):
config_test.mock()
def test_siteRemove404(self):
r = rmSite('fake.none')
se... | tsadm/desktop | lib/tsdesktop/bottman/views/siteman_test.py | Python | bsd-3-clause | 1,398 |
# Copyright (c) Byron Galbraith and Unlock contributors.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this... | NeuralProsthesisLab/unlock | unlock/state/diagnostic_state.py | Python | bsd-3-clause | 9,523 |
from .css import *
from .parser import *
| systori/bericht | bericht/html/__init__.py | Python | bsd-3-clause | 41 |
def extractErynaluWordpressCom(item):
'''
Parser for 'erynalu.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractErynaluWordpressCom.py | Python | bsd-3-clause | 554 |
"""
This template engine (tmpl) is based on Tomas Styblo's htmltmpl version
1.22 (http://htmltmpl.sourceforge.net/). The templating language was
borrowed from Perl package HTML::Template. The language detail can be
found at http://sam.tregar.com/html_template.html.
"""
__version__='$Revision: 3193 $'[11:-2]
# importe... | mattduan/template | TMPLTemplate.py | Python | bsd-3-clause | 6,361 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy.tests.helper import catch_warnings
from astropy.table import Table, QTable, NdarrayMixin, Column
from astropy.table.table_helpers import simple_table
from astropy import units as u
from astropy.coordinates... | bsipocz/astropy | astropy/io/misc/tests/test_hdf5.py | Python | bsd-3-clause | 27,889 |
import datetime
class Level:
def __init__(self, value, name):
self.value = value
self.name = name
def __str__(self):
return self.name
def __repr__(self):
return "Level({self.value}, '{self.name}')".format(self=self)
def __lt__(self, other):
return self.value... | rikpg/logflow | logflow/base.py | Python | bsd-3-clause | 2,138 |
import os
import shutil
from textwrap import dedent
from traitlets import List, Bool
from .baseapp import BaseNbConvertApp, nbconvert_aliases, nbconvert_flags
from ..preprocessors import (
ClearOutput, DeduplicateIds, OverwriteCells, SaveAutoGrades, Execute, LimitOutput)
from ..api import Gradebook, MissingEntry
... | minrk/nbgrader | nbgrader/apps/autogradeapp.py | Python | bsd-3-clause | 6,597 |
from .__about__ import __version__
from .aws_pricing import AwsPricingCheck
__all__ = ['__version__', 'AwsPricingCheck']
| DataDog/integrations-extras | aws_pricing/datadog_checks/aws_pricing/__init__.py | Python | bsd-3-clause | 122 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2017-02-08 13:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('devilry_group', '0027_auto_20170207_1951'),
]
operations = [
migrations.AlterField(
model_name='feedbac... | devilry/devilry-django | devilry/devilry_group/migrations/0028_auto_20170208_1344.py | Python | bsd-3-clause | 442 |
from __future__ import with_statement
import sys
from datetime import datetime
from optparse import make_option
from django.test.client import Client
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sitemaps import Sitemap
from debug_logging.settings import LOGGING_CONFIG
from de... | lincolnloop/django-debug-logging | debug_logging/management/commands/log_urls.py | Python | bsd-3-clause | 7,688 |
# -*- coding: utf-8 -*-
# Copyright 2010-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... | kbc-developers/Mozc | src/data/images/android/template/transform.py | Python | bsd-3-clause | 28,370 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# JupyterLab Tutorial documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 21 16:30:09 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present ... | TypeFox/jupyterlab | tutorial/conf.py | Python | bsd-3-clause | 9,982 |
import WebMirror.rules
import WebMirror.SpecialCase
import common.LogBase as LogBase
import runStatus
import queue
import cachetools
import time
import os.path
import os
import sys
import sqlalchemy.exc
from sqlalchemy import inspect
import random
import settings
import pprint
# import tqdm
from sqlalchemy import des... | fake-name/ReadableWebProxy | WebMirror/Engine.py | Python | bsd-3-clause | 41,174 |
"""
modules
~~~~~~~
Modules/plugins + extras for the waltz framework
"""
from waltz import web, db
from datetime import datetime
from lazydb import Db
class Analytics:
def GET(self):
web.header('Content-Type', 'application/json')
return db().get('analytics')
def rss(items_func, temp... | mekarpeles/waltz | waltz/modules.py | Python | bsd-3-clause | 2,662 |
import unittest
from functools import reduce
nums = list(range(1, 10))
states = ['Ohio', 'Alaska', 'California', 'Oklahoma']
class TestReduceFunctions(unittest.TestCase):
def test_add_numbers(self):
self.assertEqual(add_nums, sum(nums))
def test_multiply_numbers(self):
self.assertEqual(mult... | talapus/Ophidian | Academia/Functional_Programming_Kenneth_Love/test_reduce.py | Python | bsd-3-clause | 696 |
# GUI Application automation and testing library
# Copyright (C) 2006-2017 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... | MagazinnikIvan/pywinauto | pywinauto/unittests/test_win32functions.py | Python | bsd-3-clause | 4,188 |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import, unicode_literals, print_function
import os
import re
import pytest
import inspect
import json
import ... | DBuildService/osbs-client | tests/fake_api.py | Python | bsd-3-clause | 24,658 |
# -----------------------------------------------------------------------------
# Copyright (c) 2016--, The Plate Mapper Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------... | squirrelo/plate-mapper | platemap/lib/tests/test_environment.py | Python | bsd-3-clause | 1,935 |
import pysal
from pysal.cg.standalone import get_shared_segments
import numpy as np
from collections import defaultdict
from itertools import combinations
import multiprocessing as mp
# delta to get buckets right
DELTA = 0.000001
QUEEN = 1
ROOK = 2
# constants for bucket sizes
BUCK_SM = 8
BUCK_LG = 80
SHP_SMALL = ... | pysal/pPysal | weights/_contW_binning_par.py | Python | bsd-3-clause | 10,921 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... | vlegoff/tsunami | src/secondaires/tags/fonctions/a_tag.py | Python | bsd-3-clause | 4,370 |
""" Defines the ScatterPlot class, and associated Traits UI view and helper
function.
"""
# Standard library imports
import itertools
# Major library imports
from numpy import abs, argmin, around, array, asarray, compress, invert, \
isnan, sqrt, sum, transpose, where, ndarray
# Enthought library imports
from... | burnpanck/chaco | chaco/scatterplot.py | Python | bsd-3-clause | 20,135 |
from decimal import Decimal
from django.test import TestCase
from ccgallery.models import Item, Category
class ManagerTestCases(TestCase):
def test_item_for_category(self):
"""the for item manager method"""
c1 = Category()
c1.slug = '1'
c1.title = '1'
c1.description = '1'
... | designcc/django-ccgallery | ccgallery/tests/test_managers.py | Python | bsd-3-clause | 3,771 |
# -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module used for run-time determination of toplogy information.
By Toplogy, we mean a specification of which external server de... | endlessm/chromium-browser | third_party/chromite/cbuildbot/topology.py | Python | bsd-3-clause | 2,084 |
from pandarus import Map
from pandarus.intersections import (
chunker,
get_jobs,
intersection_worker,
intersection_dispatcher,
logger_init,
worker_init,
)
import os
import numpy as np
import pytest
import tempfile
dirpath = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))
grid =... | cmutel/pandarus | tests/test_intersections.py | Python | bsd-3-clause | 2,133 |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import range
from builtins import *
import unittest
import logging
... | sunil07t/e-mission-server | emission/tests/netTests/TestHabiticaRegister.py | Python | bsd-3-clause | 5,778 |
from django.test import TestCase
from oscar.apps.offer import models
from oscar.apps.basket.models import Basket
class OfferTest(TestCase):
def setUp(self):
self.range = models.Range.objects.create(
name="All products range", includes_all_products=True)
self.basket = Basket.objects.cr... | michaelBenin/django-oscar | tests/unit/offer/__init__.py | Python | bsd-3-clause | 327 |
'''
MAVUE v0.1 (beta)
Graphical inspector for MAVLink enabled embedded systems.
Copyright (c) 2009-2014, Felix Schill
All rights reserved.
Refer to the file LICENSE.TXT which should be included in all distributions of this project.
'''
from PyQt4.QtCore import *
from PyQt4 import QtGui, QtCore
from threading impor... | fschill/mavue | gui_elements.py | Python | bsd-3-clause | 15,364 |
# @ImageJ ij
# @Dataset ds
# @OpService ops
# @UIService ui
# @DatasetService datasetService
# @OUTPUT Dataset final_dataset
import math
from net.imglib2.util import Intervals
from net.imagej.axis import Axes
from net.imglib2.view import Views
from ij.plugin.frame import RoiManager
ij.ui().showDialog("This script o... | hadim/fiji_scripts | src/main/resources/script_templates/Hadim_Scripts/Preprocessing/DriftCorrector.py | Python | bsd-3-clause | 2,461 |
from project.settings import *
LAYERS['layers'] = ('basic',)
SITE_ID = 2
try:
import local_settings
from local_settings import *
except ImportError:
pass
else:
if hasattr(local_settings, 'configure'):
lcl = locals()
di = local_settings.configure(**locals())
lcl.update(**di)
| praekelt/jmbo-skeleton | project/settings_dev_basic_site.py | Python | bsd-3-clause | 318 |
# -*- coding: utf-8 -*-
import os
os_env = os.environ
class Config(object):
SECRET_KEY = os_env["SOLARPI_SECRET"]
APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir))
BCRYPT_LOG_ROUNDS = 13
ASSETS_DEBUG = False
... | Tafkas/solarpi | solarpi/settings.py | Python | bsd-3-clause | 1,458 |
import sys
import pytest
asyncio = pytest.importorskip("asyncio") # noqa
aiohttp = pytest.importorskip("aiohttp") # noqa
import logging
from pomp.core.base import (
BaseHttpRequest,
BaseHttpResponse,
BaseDownloader,
BaseMiddleware,
BasePipeline,
BaseCrawlException,
)
from pomp.contrib.asynci... | estin/pomp | tests/test_contrib_asynciotools.py | Python | bsd-3-clause | 8,180 |
from piliko import *
# small experiment with Wildberger's Omega Triangles
# take the omega of the omega of the omega of the omega... weird stuff
print
p1,p2,p3=point(0,0),point(12,2),point(4,6)
t = triangle(p1,p2,p3)
tris = [t]
for i in range(0,8):
ot = omega_triangle( t )
tris += [ot]
t = ot
... | donbright/piliko | experiment/omega_triangles/omegatri1.py | Python | bsd-3-clause | 645 |
from django.conf.urls.defaults import *
urlpatterns = patterns('category.views',
url(r'^(?P<category_slug>[-\w]+)/$', 'get_category', {}, 'scofield_category'),
)
| howiworkdaily/scofield-project | scofield/category/urls.py | Python | bsd-3-clause | 169 |
# django imports
from django import forms
from django.db import models
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
# portlets imports
from portlets.models import Portlet
# lfs imports
from lfs.catalog.models imp... | lichong012245/django-lfs-0.7.8 | lfs/portlet/models/featured.py | Python | bsd-3-clause | 2,160 |
from sfepy.base.base import *
from sfepy.base.ioutils import get_print_info
from sfepy.fem import extend_cell_data
from sfepy.homogenization.utils import coor_to_sym
from sfepy.base.conf import get_standard_keywords, ProblemConf
from sfepy.fem import ProblemDefinition
from sfepy.homogenization.coefficients import Coeff... | olivierverdier/sfepy | sfepy/homogenization/recovery.py | Python | bsd-3-clause | 17,380 |
# sql/sqltypes.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""SQL specific types.
"""
import datetime as dt
import codecs
from .type_api impor... | alex/sqlalchemy | lib/sqlalchemy/sql/sqltypes.py | Python | mit | 51,062 |
#Alex Holcombe alex.holcombe@sydney.edu.au
#See the github repository for more information: https://github.com/alexholcombe/twoWords
from __future__ import print_function
from psychopy import monitors, visual, event, data, logging, core, sound, gui
import psychopy.info
import numpy as np
from math import atan, log, cei... | alexholcombe/twoWords | specialFieldsStudentCode/twoWordsExperimentInvertedbackMay2AlexContinue3.py | Python | mit | 53,504 |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test behavior of headers messages to announce blocks.
Setup:
- Two nodes:
- node0 is the node-und... | nlgcoin/guldencoin-official | test/functional/p2p_sendheaders.py | Python | mit | 26,654 |
# URLify: Write a method to replace all spaces in string with '%20'. You may
# asssume that string has sufficient space at the end to hold the additional
# characters, and that you are given the "true" length of the string.
import copy
def URLify(string, length):
space_count = 0
for i in range(length):
... | jigarkb/Programming | CTCI/chapter_1/1.3.py | Python | mit | 939 |
import os
import sys
import math
from operator import itemgetter
def remove_hyphen(g):
if g.count("-")>0:
temp=g.split("-")
l=len(temp)
word=""
for i in range(l):
word+=temp[i]+" "
g=word.rstrip(" ")
return g
def remove_special_case(g):
token=g.split()
... | ramaganapathy1/AMuDA-Ir-back-end | production/keyphrase/video_features/max_height.py | Python | mit | 4,825 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from shorturl.index import app
app_wsgi = app.wsgifunc()
| mozillazg/ShortURL | deploy.py | Python | mit | 105 |
import os, os.path
import shutil
import urllib, urllib2
import subprocess
import simplejson as json
from play.utils import *
COMMANDS = ['dependencies','deps']
HELP = {
'dependencies': 'Resolve and retrieve project dependencies'
}
def execute(**kargs):
command = kargs.get("command")
app = kargs.get("app... | chvrga/outdoor-explorer | java/play-1.4.4/framework/pym/play/commands/deps.py | Python | mit | 2,480 |
# -*- coding: utf-8 -*-
import os
import execjs
from django.core.management.base import CommandError
from ._base import BaseCommand
from . import NODEBOW_ROOT
class Bower(object):
# compiled_js = execjs.compile("""
# var bower = require('bower'),
# inquirer = require('inquirer');
# function instal... | jrief/django-nodebow | nodebow/management/commands/bower.py | Python | mit | 2,332 |
#!/usr/bin/env python
from iris_sdk.models.maps.base_map import BaseMap
class InServiceNumbersMap(BaseMap):
links = None
telephone_numbers = None
total_count = None | scottbarstow/iris-python | iris_sdk/models/maps/in_service_numbers.py | Python | mit | 179 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0004_socialnetworkapp_last_real_time_update_sig'),
]
operations = [
migrations.AddField(
model_name='init... | rebearteta/social-ideation | app/migrations/0005_auto_20150819_1054.py | Python | mit | 869 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/gloves/shared_gloves_tusken_raider.iff"
result.attribute_... | obi-two/Rebelion | data/scripts/templates/object/tangible/wearables/gloves/shared_gloves_tusken_raider.py | Python | mit | 476 |
#!/usr/bin/env python
'''This program splits BAM files processed by suspenders: reads are written into different output alignment files (.bam) depending on their genomic origin (which is noted in the po:i tag).
If a third output file is indicated, reads which map equally well __at the same position_ in both genomes wi... | friedue/AlleleSpecific | individualScripts/allelicFilterOct2014.py | Python | mit | 9,255 |
from rpython.annotator.model import SomeChar, SomeUnicodeCodePoint
from rpython.rlib.rstring import INIT_SIZE
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.rmodel import Repr
class AbstractStringBuilderRepr(Repr):
def rtyper_new(self, hop):
if len(hop.args_v) == 0:
v_arg =... | jptomo/rpython-lang-scheme | rpython/rtyper/rbuilder.py | Python | mit | 2,371 |
# Copyright (c) 2020. Ruud de Jong
# This file is part of the SlipLib project which is released under the MIT license.
# See https://github.com/rhjdjong/SlipLib for details.
"""
Echoserver
----------
This directory contains an example server and client application
that demonstrate a basic use-case for Slip-encoded... | rhjdjong/SlipLib | examples/echoserver/__init__.py | Python | mit | 2,360 |
"""
# PiPy
Install or upload your Python packages from/to the PyPI package index website.
Easy to use, IDLE/shell access, and no dependencies.
PiPy (the PyPI acronym in reverse) is a one-stop tool for all your package needs,
including both downloading and uploading. It is meant to be dead-set
simple, easy for beginne... | karimbahgat/PyPi | pipy/__init__.py | Python | mit | 12,260 |
from .models import Event, TicketType, TicketOrder, Ticket
from rest_framework import serializers
from happening.serializers import Serializer
class TicketTypeSerializer(Serializer):
"""Ticket Type Serializer."""
class Meta:
model = TicketType
fields = ('url', 'name', 'number')
class Ticket... | jscott1989/happening | src/events/serializers.py | Python | mit | 1,259 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/vehicle/shared_speederbike_base.iff"
result.attribute_template_id = 9... | anhstudios/swganh | data/scripts/templates/object/mobile/vehicle/shared_speederbike_base.py | Python | mit | 447 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pkl_xmatch.py - Waqas Bhatti (wbhatti@astro.princeton.edu) - Feb 2019
# License: MIT.
'''
This contains utility functions that support the checkplot.pkl xmatch
functionality.
'''
#############
## LOGGING ##
#############
import logging
from astrobase import log_sub, ... | lgbouma/astrobase | astrobase/checkplot/pkl_xmatch.py | Python | mit | 15,851 |
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
import MatrixOperations as MO
import numpy as np
class Matrix(object):
def __init__(self):
pass
def create(self, mat):
pass
def destroy(self, mat):
pass
class P(Matrix):
def __init__(self, Fspace,P,M... | wathen/PhD | MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/SplitMatrix/bubble/MHDmulti.py | Python | mit | 5,828 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-20 05:10
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('nomi', '0146_auto_20170819_1041'),
]
operations = [
... | SummerCamp17/Gymkhana-Nominations | nomi/migrations/0147_auto_20170820_0510.py | Python | mit | 523 |
"""Convert a word from Latin orthography into its hypothesized
pronunciation in the International Phonetic Alphabet (IPA).
https://raw.githubusercontent.com/j-duff/cltk/ipa/
cltk/phonology/latin/transcription.py
"""
from cltk.utils.cltk_logger import logger
from cltk.prosody.latin import macronizer as m
from nltk.t... | TylerKirby/cltk | cltk/phonology/latin/transcription.py | Python | mit | 23,230 |
from unittest import TestCase
from similarityPy.algorithms.find_nearest import FindNearest
from similarityPy.measure.string_data.edit_distance import EditDistance
from tests import test_logger
__author__ = 'cenk'
class FindNearestTest(TestCase):
def setUp(self):
pass
def test_edit_distance(self):
... | pombredanne/similarityPy | tests/algorihtm_tests/find_nearest_tests/string_data/edit_distance_test.py | Python | mit | 2,816 |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import textwrap
from sqlalchemy import DDL
from indico.core imp... | mvidalgarcia/indico | indico/modules/events/models/__init__.py | Python | mit | 5,168 |
# -*- encoding: utf-8 -*-
from . import FixtureTest
class ParkTest(FixtureTest):
def test_adirondack(self):
import dsl
z, x, y = (8, 75, 93)
self.generate_fixtures(
# https://www.openstreetmap.org/relation/1695394
dsl.way(1695394, dsl.box_area(z, x, y, 4550693369... | mapzen/vector-datasource | integration-test/1609-too-many-small-parks.py | Python | mit | 8,742 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Ship()
result.template = "object/ship/shared_hutt_heavy_s02_tier1.iff"
result.attribute_template_id = -1
result.... | anhstudios/swganh | data/scripts/templates/object/ship/shared_hutt_heavy_s02_tier1.py | Python | mit | 417 |
#!/usr/bin/env python
import tba_config
import webapp2
from controllers.apiv3 import api_status_controller as asc
from controllers.apiv3 import api_district_controller as adc
from controllers.apiv3 import api_event_controller as aec
from controllers.apiv3 import api_match_controller as amc
from controllers.apiv3 impor... | nwalters512/the-blue-alliance | apiv3_main.py | Python | mit | 6,543 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-machinelearningcompute/azure/mgmt/machinelearningcompute/models/available_operations.py | Python | mit | 943 |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import unicode_literals
from rest_framework import serializers
from django.contrib.auth.models import User
class UserSerializer(serializers.ModelSerializer):
""" Standard `rest_framework` ModelSerializer """
class Meta:
model = User
fiel... | RyanNoelk/OpenEats | api/v1/accounts/serializers.py | Python | mit | 335 |
# -*- coding: UTF-8 -*-
#
# The MIT License
#
# Copyright (c) 2010 Felix Schwarz <felix.schwarz@oss.schwarz.eu>
#
# 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, includ... | r-kitaev/lucid-python-cerberus | tests/emailaddress_validator_test.py | Python | mit | 2,944 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/destructible/shared_destructible_tato_drum_storage1.iff"
result.attribu... | anhstudios/swganh | data/scripts/templates/object/static/destructible/shared_destructible_tato_drum_storage1.py | Python | mit | 465 |
import csv
import sys
from etc.furrypoll2016 import models
fields = [
'male',
'female',
'male_quantized',
'female_quantized',
]
expression = []
identity = []
in_furry = []
responses = models.Response.objects
while True:
try:
response = responses.next()
if response.overview is No... | adjspecies/furrypoll-munger | bin/other/gender-graph-data-2016.py | Python | mit | 1,832 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/general/shared_bunker_imperial_01.iff"
result.attribute_template_id... | anhstudios/swganh | data/scripts/templates/object/building/general/shared_bunker_imperial_01.py | Python | mit | 459 |
# Creates config file for webserver based on create_conf.yaml and data downloaded based on that file.
from __future__ import print_function
import os
import sys
import re
import requests
import yaml
from collections import OrderedDict
# Hack to make yaml print out somewhat in order
class UnsortableList(list):
d... | Duke-GCB/TF-DNA-PredictionsDB | util/create_conf.py | Python | mit | 10,628 |
from contentbase.auditor import (
AuditFailure,
audit_checker,
)
from .conditions import rfa
targetBasedAssayList = [
'ChIP-seq',
'RNA Bind-n-Seq',
'ChIA-PET',
'RIP Array',
'RIP-seq',
'MeDIP-seq',
'iCLIP',
'shRNA knockdown followed by RNA-seq',
]
controlRequiredAssayList = ... | ClinGen/clincoded | src/clincoded/audit/experiment.py | Python | mit | 19,489 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import logging
import os
import unittest
from pymatgen import Molecule
from pymatgen.util.testing import PymatgenTest
from collections import OrderedDict
from ... | czhengsci/pymatgen | pymatgen/io/qchem_io/tests/test_inputs.py | Python | mit | 16,019 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Ship()
result.template = "object/ship/shared_tie_light_duty.iff"
result.attribute_template_id = -1
result.stfNam... | obi-two/Rebelion | data/scripts/templates/object/ship/shared_tie_light_duty.py | Python | mit | 425 |
"""
Script that trains Tensorflow Singletask models on KINASE dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import numpy as np
import tempfile
import shutil
import deepchem as dc
from KINASE_datasets import load_kinase
###Load data... | joegomes/deepchem | examples/kinase/KINASE_tf_singletask.py | Python | mit | 3,405 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# ltihooks.py: python import hooks that understand libtool libraries.
# Copyright (C) 2000 James Henstridge.
#
# 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 Softw... | flyapen/UgFlu | flumotion/extern/pytrayicon/ltihooks.py | Python | gpl-2.0 | 2,765 |
# templatekw.py - common changeset template keywords
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from node import hex
import patch, util, error
import hbisect
# This help... | hekra01/mercurial | mercurial/templatekw.py | Python | gpl-2.0 | 16,005 |
import pygame, sys, time, random, os, pickle
from pygame.locals import *
# -------------- Functions and Classes --------------
def distance(speed, time):
distance = time * speed
return distance
class GameObject(object):
def __init__(self, position, image, rect): #self, list, pygame loaded image, pygame ... | Pietdagamer/NO7 | Old versions/NO7_2.3 [Overheat Overlay].py | Python | gpl-2.0 | 7,807 |
#!/usr/bin/env python
import re
from runtest import TestBase
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'sleep', result="""
# DURATION TID FUNCTION
[18224] | main() {
2.083 ms [18224] | foo();
2.085 ms [18224] | } /* main */
""")
def runcmd(self):... | andrewjss/uftrace | tests/t055_filter_time_N.py | Python | gpl-2.0 | 396 |
# Twisted, the Framework of Your Internet
# Copyright (C) 2003 Matthew W. Lefkowitz
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General
# Public License as published by the Free Software Foundation.
#
# This library is distributed in the... | fxia22/ASM_xf | PythonD/site_python/twisted/flow/threads.py | Python | gpl-2.0 | 4,952 |
import os
from unittest import TestCase, skipIf
from time import time as now
from zabbix.sender import ZabbixMetric, ZabbixSender
from pyzabbix import ZabbixResponse
@skipIf('TRAVIS' not in os.environ.keys(), "Travis CI test")
class FunctionalSender(TestCase):
def test_FunctionalSenderOld(self):
cur_dat... | adubkov/py-zabbix | tests/test_Functional_Sender_Old.py | Python | gpl-2.0 | 750 |
# This file is part of pybliographer
#
# Copyright (C) 1998-2004 Frederic GOBRY
# Email : gobry@pybliographer.org
#
# 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 ... | matthew-brett/pyblio | Pyblio/Config.py | Python | gpl-2.0 | 8,863 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Founda... | dpwrussell/openmicroscopy | components/tools/OmeroWeb/test/integration/test_links.py | Python | gpl-2.0 | 9,784 |
# Embedded file name: /usr/lib/enigma2/python/Components/Renderer/RollerCharLCDLong.py
from Components.config import config
from Renderer import Renderer
from enigma import eLabel, eTimer
from Components.VariableText import VariableText
class RollerCharLCDLong(VariableText, Renderer):
def __init__(self):
... | kingvuplus/boom | lib/python/Components/Renderer/RollerCharLCDLong.py | Python | gpl-2.0 | 2,250 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from django.forms.widgets import flatatt
from django.template import Variable, VariableDoesNotExist
from django.template.base import FilterExpression, kwarg_re, TemplateSyntaxError
from .text import text_value
# RegEx for quoted string
QUOTE... | roberzguerra/scout_mez | bootstrap3/utils.py | Python | gpl-2.0 | 3,299 |
#!/usr/bin/env python
#
# Last modified: Time-stamp: <2017-08-24 19:23:55 codar>
""" CODAR Utilities
"""
import sys
import os
import re
import fnmatch
import datetime
import geopy
import geopy.distance
import numpy
numpy.set_printoptions(suppress=True)
from StringIO import StringIO
debug = 1
def load_data(inFile... | nccoos/qc-codar-radialmetric | src/qccodar/codarutils.py | Python | gpl-2.0 | 18,527 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This example shows webhook echo bot with Tornado web framework
# Documenation to Tornado: http://tornadoweb.org
import telebot
import tornado.web
import tornado.ioloop
import tornado.httpserver
import tornado.options
import signal
API_TOKEN = '<api_token>'
WEBHOOK_CERT... | tr00m1k/zagruzki | examples/webhook_examples/webhook_tornado_echo_bot.py | Python | gpl-2.0 | 2,982 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from urbansim.datasets.dataset import Dataset as UrbansimDataset
from opus_core.misc import unique
from numpy import array, zeros, int16, int8, ones, take, arange
from opus_core.resources import... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/urbansim/datasets/county_dataset.py | Python | gpl-2.0 | 2,467 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gstmanager.event import EventListener
class Test(EventListener):
def __init__(self):
EventListener.__init__(self)
self.registerEvent("drop_value_change")
def evt_drop_value_change(self, event):
data = event.content["value"]
sr... | lucasa/landell_gst-gengui | sltv/gstmanager/tests/test_polling.py | Python | gpl-2.0 | 1,191 |
import numpy as np
import tensorflow as tf
import classification.svm.svm
import preprocessing.data_set
import preprocessing.ttree
import ROOT
# Generates two 2D normal distributions in two TTrees.
signal = ROOT.TNtuple("ntuple", "ntuple", "x:y:signal")
background = ROOT.TNtuple("ntuple", "ntuple", "x:y:signal")
for i... | AidanGG/tensorflow_tmva | examples/svm_test.py | Python | gpl-2.0 | 2,202 |
# Copyright (c) 2008 Agostino Russo
#
# Written by Agostino Russo <agostino.russo@gmail.com>
#
# This file is part of Wubi the Win32 Ubuntu Installer.
#
# Wubi is free software; you can redistribute it and/or modify
# it under 5the terms of the GNU Lesser General Public License as
# published by the Free Software Found... | hechaoyuyu/swinst | src/wubi/frontends/win32/page.py | Python | gpl-2.0 | 5,840 |
'''
Created on 14 Dec 2009
This contains a list of all the js files needed on each of the templates. The
advantage of listing it here instead of on the template is that here it can be
used by the script that runs jslint + compresses all the javascript.
All file paths are given relative to the 'js' folder in the pub... | NERC-CEH/jules-jasmin | majic/joj/lib/js_files_list.py | Python | gpl-2.0 | 1,227 |
#!/usr/bin/pythonTest
# -*- coding: utf-8 -*-
#
# exec for python 3, solve incompatibility with version 2
#
# 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
# ... | netvigator/myPyPacks | pyPacks/Utils/Exec2.py | Python | gpl-2.0 | 1,284 |
# #
# Copyright 2009-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... | hpcleuven/easybuild-easyblocks | easybuild/easyblocks/i/impi.py | Python | gpl-2.0 | 9,325 |
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
import os, commands
from gettext import gettext as _
from sugar3.graphics.palette import Palette, WidgetInvoker
from sugar3.graphics.radiotoolbutton import RadioToolButton
from sugar3.graphics.toolbutton import ToolButton
f... | godiard/tamtam | Jam/Toolbars.py | Python | gpl-2.0 | 23,163 |
import pytest
class TestNtpdate:
@pytest.mark.complete("ntpdate -", require_cmd=True)
def test_1(self, completion):
assert completion
| algorythmic/bash-completion | test/t/test_ntpdate.py | Python | gpl-2.0 | 152 |
from __future__ import absolute_import
from Components.GUIComponent import GUIComponent
from skin import parseFont
from Tools.FuzzyDate import FuzzyTime
from enigma import eListboxPythonMultiContent, eListbox, gFont, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_VALIGN_CENTER, RT_VALIGN_TOP, RT_VALIGN_BOTTOM
from Tools.Alterna... | openatv/enigma2 | lib/python/Components/TimerList.py | Python | gpl-2.0 | 8,387 |
"""
Test lldb exception breakpoint command for CPP.
"""
import os, time
import unittest2
import lldb
import lldbutil
from lldbtest import *
class CPPBreakpointTestCase(TestBase):
mydir = os.path.join("lang", "cpp", "exceptions")
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
... | s20121035/rk3288_android5.1_repo | external/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py | Python | gpl-3.0 | 3,353 |
# -*- coding: UTF-8 -*-
# Copyright (C) 2006-2007 Hervé Cauwelier <herve@oursours.net>
# Copyright (C) 2006-2011 J. David Ibáñez <jdavid.ibp@gmail.com>
# Copyright (C) 2007 Sylvain Taverne <taverne.sylvain@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | bepatient-fr/itools | itools/handlers/archive.py | Python | gpl-3.0 | 4,580 |
# -*- encoding: utf-8 -*-
from abjad.tools import scoretools
from abjad.tools.handlertools.Handler import Handler
class TimewisePitchClassHandler(Handler):
r'''Timewise pitch-class handler.
'''
### CLASS ATTRIBUTES ###
__slots__ = (
'_pitch_class_server',
)
### INITIALIZER ###
... | mscuthbert/abjad | abjad/tools/handlertools/TimewisePitchClassHandler.py | Python | gpl-3.0 | 1,457 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.forms.models import ModelForm
from ajax_select import make_ajax_field
from example.models import Release
class ReleaseForm(ModelForm):
class Meta:
model = Release
exclude = []
# args: this model, fieldnam... | ramusus/django-ajax-selects | example/example/forms.py | Python | gpl-3.0 | 1,020 |