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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
"""Python Web DLMON Daemon
This is the twisted.web application.
"""
# Std lib
import sys
# Twisted
from twisted.python import log
from twisted.internet import reactor
from twisted.web.server import Site
# This project
from pywebdlmon import config
from pywebdlmon.controller import get_dispatch... | n1ywb/webdlmon-backend | pywebdlmon/main.py | Python | bsd-2-clause | 1,207 |
import os
import glob
import subprocess
from time import sleep
from sunpy.time import parse_time as parse
wlens = ['94', '131', '171', '193', '211', '335']
def download(date):
date = parse(date)
# Loop through wavelengths
for w, wlen in enumerate(wlens):
data_dir = '/whatever/'
fits_dir = ... | drewleonard42/CoronaTemps | parallel.py | Python | bsd-2-clause | 1,013 |
# coding=utf-8
from django.contrib.gis.db import models
__author__ = 'Rizky Maulana Nugraha "lucernae" <lana.pcfre@gmail.com>'
__date__ = '23/04/15'
class NationalQualificationsFramework(models.Model):
"""Model for National Qualifications Framework (NQF)"""
level = models.IntegerField(primary_key=True)
d... | lucernae/feti | django_project/feti/models/national_qualifications_framework.py | Python | bsd-2-clause | 613 |
import string
import random
from django import forms
from django.contrib import admin
from django.contrib.admin.options import csrf_protect_m
from django.core.urlresolvers import reverse
from django.core.exceptions import PermissionDenied
from django.http import HttpResponseRedirect
from django.utils.translation impor... | incuna/django-extensible-profiles | profiles/modules/codes/admin.py | Python | bsd-2-clause | 2,852 |
"""
views resource define
@author xu_fanghui
@date 2014-09-03
@version demo 0.1
"""
from rest_framework import viewsets
from demo.models import Company,Sector,Staff
from demo.serializers import CompanySerializer,SectorSerializer,StaffSerializer
class CompanyViewSet(viewsets.ModelViewSe... | xufanghui/djg-rest-demo | demo/views.py | Python | bsd-2-clause | 638 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-17 11:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0038_sitesettings_global_ga_tag_manager'),
]
operations = [
migratio... | praekelt/molo | molo/core/migrations/0039_add_content_rotation_to_SectionPage.py | Python | bsd-2-clause | 1,584 |
__author__ = 'vivitsu'
| vivitsu/dbxuploader | __init__.py | Python | bsd-2-clause | 23 |
__all__ = ["fix_message_encoding"]
def fix_message_encoding(message):
fixed = dict(map(lambda v: (v[0].encode("UTF-8"), v[1]), message.items()))
if "channels" in fixed:
fixed["channels"] = map(lambda x: x.encode("UTF-8"), fixed["channels"])
if "users" in fixed:
fixed["users"] = map(lambda... | jianingy/sabo | sabo/util.py | Python | bsd-2-clause | 404 |
import click
import functools
from ..adb import Adb
from ..config import Config
def __get_id(option_id, section, key):
if option_id is None:
return Config.read_value(section, key)
else:
return option_id
def __determine_device_id(ctx_params):
# All attached devices
devices = Adb.get_... | dbaelz/adbons | src/commands/adb_commands.py | Python | bsd-2-clause | 6,525 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
class BsbHeader():
def __init__(self, kapPath):
self.kapPath = kapPath
self.updated = None
self.name = None
self.lines = []
self.poly = []
self.scale = None
self.projection = None
... | manimaul/MX-Cart | BsbHeader.py | Python | bsd-2-clause | 3,590 |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import unicode_literals
import datetime
import logging
import requests
import requests_cache
import socket
import time
import urlparse
from contextlib import contextmanager
from cStringIO import StringIO
from nose.tools import assert_equal, assert_raises
from ... | paulfurley/data-services-helpers | dshelpers.py | Python | bsd-2-clause | 11,634 |
if __name__ == '__main__':
from MSdata import *
import numpy as N
import sys
data = []
#ID
datar = N.loadtxt("EllipticalsT4.out", comments = "#", usecols=(0,1,9), dtype=long)
#lets get rid off the subhaloes
indices = N.where(datar[:,2] == 0)
idlist = datar[indices]
study =... | sniemi/SamPy | sandbox/src2/src/identitytime.py | Python | bsd-2-clause | 3,541 |
# Copyright (c) 2017, Matt Layman
import datetime
import os
import mock
from handroll import signals
from handroll.exceptions import AbortError
from handroll.extensions.blog import (
BlogExtension, BlogBuilder, FeedBuilder, ListPageBuilder)
from handroll.resolver import FileResolver
from handroll.tests import Te... | handroll/handroll | handroll/tests/test_blog_extension.py | Python | bsd-2-clause | 19,667 |
timezone = 0
tzname = ("str", "str")
def clock():
return 1.0
def sleep(s):
pass
def time():
return 1.0
class struct_time:
def __init__(self, tuple):
self.tm_year = 0
self.tm_mon = 0
self.tm_mday = 0
self.tm_hour = 0
self.tm_min = 0
self.tm_sec = 0
... | jplevyak/pyc | lib/time.py | Python | bsd-3-clause | 837 |
#!/usr/bin/env python
# Copyright (c) 2012 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.
''' Runs various chrome tests through valgrind_test.py.'''
import glob
import logging
import multiprocessing
import optparse
impor... | highweb-project/highweb-webcl-html5spec | tools/valgrind/chrome_tests.py | Python | bsd-3-clause | 33,219 |
#!/usr/bin/env python
"""Display a cartoon of the focal plane showing:
* Instrument nominal center and x and y axes
* Boresight position
* Object orientation
* Spider orientation
To do:
- modify to use preferences for colors (need 3 colors for 3 axes,
also colors for current, target and ?potential? position).
- impl... | r-owen/TUI | TUI/TCC/FocalPlaneWindow.py | Python | bsd-3-clause | 17,426 |
"""
A helper function to access EEX metadata easier
"""
from .atom_metadata import atom_metadata
from .two_body_terms import two_body_metadata
from .three_body_terms import three_body_metadata
from .four_body_terms import four_body_metadata
from .nb_terms import nb_metadata
def sanitize_term_order_name(order):
i... | dgasmith/EEX_scratch | eex/metadata/md_helper.py | Python | bsd-3-clause | 1,752 |
#! /usr/bin/env python
from core.deptools import *
from breakfast import *
# Pure python defined item test code
#
# Tests that we can define items in pure python code and have the marshallers
# convert it back and forth several times to simple dicts and JSON without
# any loss of information
#
# THIS IS NOT AN EXAMPLE... | anchor/make-magic | tests/junktest.py | Python | bsd-3-clause | 1,597 |
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from stix import report
from stix.test import EntityTestCase, data_marking_test
from stix.test.common import (kill_chains_test, information_source_test,
structured_text_tests, related_test)
c... | chriskiehl/python-stix | stix/test/report_test.py | Python | bsd-3-clause | 3,307 |
"""Our app specific CEF loggers."""
from django.conf import settings
from django.http import HttpRequest
from cef import log_cef as _log_cef
metlog = settings.METLOG
class CEFLogger:
"""Abstract base CEF logger.
Class attributes to set in a concrete class:
**sig_prefix**
Prefix to the CEF signat... | Joergen/zamboni | lib/cef_loggers.py | Python | bsd-3-clause | 3,385 |
# Copyright 2015 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 recipe_engine import recipe_test_api
class CIPDTestApi(recipe_test_api.RecipeTestApi):
def make_resolved_version(self, v):
if not v:
retur... | endlessm/chromium-browser | third_party/depot_tools/recipes/recipe_modules/cipd/test_api.py | Python | bsd-3-clause | 3,279 |
# -*- coding: UTF-8 -*-
"""
fbchat
~~~~~~
Facebook Chat (Messenger) for Python
:copyright: (c) 2015 by Taehoon Kim.
:license: BSD, see LICENSE for more details.
"""
from .client import *
__copyright__ = 'Copyright 2015 by Taehoon Kim'
__version__ = '0.0.2'
__license__ = 'BSD'
__author__ = 'Ta... | XCage15/fbchat | fbchat/__init__.py | Python | bsd-3-clause | 446 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#--------------------------------------------------------------... | ericmjl/bokeh | bokeh/themes/_light_minimal.py | Python | bsd-3-clause | 2,024 |
"""Test that image mouse cursor can be set.
Expected behaviour:
One window will be opened. The mouse cursor in the window will be
a custom cursor.
Close the window or press ESC to end the test.
"""
import unittest
from pyglet.gl import *
from pyglet import image
from pyglet import window
from os.path... | bitcraft/pyglet | tests/interactive/window/window_set_mouse_cursor.py | Python | bsd-3-clause | 1,039 |
from django.db import models
from django import forms
class Member(models.Model):
GENDER_CHOICE = (
('M', 'Male'),
('F', 'Female'),
)
GRADE_CHOICE = (
('1', '1st'),
('2', '2nd'),
('3', '3rd'),
('4', '4th'),
('5', '5th... | ymcagodme/Norwalk-Judo | members/models.py | Python | bsd-3-clause | 10,179 |
###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | hjanime/VisTrails | vistrails/db/versions/v0_9_0/persistence/xml/auto_gen.py | Python | bsd-3-clause | 58,836 |
#
# AstroImage.py -- Abstraction of an astronomical data image.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import sys, os
import re
import math
import logging
imp... | eteq/ginga | ginga/AstroImage.py | Python | bsd-3-clause | 25,997 |
# -*- coding: utf-8 -*-
"""
Unit tests for reverse URL lookups.
"""
from __future__ import unicode_literals
import sys
import threading
import unittest
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.conf.urls import include, url
from django.contrib.auth.models import... | sarthakmeh03/django | tests/urlpatterns_reverse/tests.py | Python | bsd-3-clause | 50,655 |
"""
byceps.config
~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from enum import Enum
from typing import Any, Optional
from flask import current_app, Flask
from .services.site.transfer.models import SiteID
EXTENSION_KEY = 'byceps_config'
KEY_AP... | homeworkprod/byceps | byceps/config.py | Python | bsd-3-clause | 2,536 |
from django.conf import settings
def is_auth0_configured():
return (
settings.AUTH0_CLIENT_ID and
settings.AUTH0_CLIENT_SECRET and
settings.AUTH0_DOMAIN and
settings.AUTH0_CALLBACK_URL
)
| willkg/standup | standup/auth0/utils.py | Python | bsd-3-clause | 229 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 5, transform = "RelativeDifference", sigma = 0.0, exog_count = 0, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_RelativeDifference/trend_Lag1Trend/cycle_5/ar_12/test_artificial_32_RelativeDifference_Lag1Trend_5_12_0.py | Python | bsd-3-clause | 272 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import unittest
from exhibitionist.decorators import MIN_OBJID_LEN
from exhibitionist.objectRegistry import ObjectRegistry
class TestRegistry(unittest.TestCase):
def setUp(self):
self.registry = ObjectRegistry()
def tearDown(self):
... | kentfrazier/Exhibitionist | exhibitionist/tests/test_registry.py | Python | bsd-3-clause | 6,600 |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('jasmine',
url(r'^$', 'views.run_tests', name='run_tests')
);
| Harvard-ATG/HarmonyLab | jasmine/urls.py | Python | bsd-3-clause | 143 |
# -*- coding: utf-8 -*-
"""
sqlp unit tests
~~~~~~~~~~~~~~~
Usage::
python run.py [testfile ...]
:copyright: Copyright 2014 by the sqlp team, see AUTHORS.
:license: BSD, see COPYING for details.
"""
from __future__ import print_function
import sys, os
# only find tests in this directo... | balena/sqlp | tests/run.py | Python | bsd-3-clause | 1,061 |
from scvelo.tools import * # noqa
| theislab/scvelo | scvelo/tl.py | Python | bsd-3-clause | 35 |
#!/usr/bin/python
"""
Jutda Helpdesk - A Django powered ticket tracker for small enterprise.
(c) Copyright 2008 Jutda. All Rights Reserved. See LICENSE for details.
scripts/escalate_tickets.py - Easy way to escalate tickets based on their age,
designed to be run from Cron or similar.
"""... | justquick/jutdahelpdesk | management/commands/escalate_tickets.py | Python | bsd-3-clause | 5,746 |
from __future__ import print_function
from IPython.core.magic import (Magics, magics_class, line_magic,
cell_magic, line_cell_magic)
from xvfbwrapper import Xvfb
@magics_class
class XvfbMagics(Magics):
def __init__(self, shell, **xvfb_kwargs):
"""
Initialize the Xv... | arokem/xvfbmagic | xvfbmagic.py | Python | bsd-3-clause | 1,282 |
##########################################################################
#
# Copyright (c) 2015, Image Engine Design 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:
#
# * Redistrib... | goddardl/gaffer | python/GafferSceneUI/TextUI.py | Python | bsd-3-clause | 2,943 |
# -*- coding: utf-8 -*-
from factory import Sequence, PostGenerationMethodCall
from factory.alchemy import SQLAlchemyModelFactory
from data-wrangler.models.user import User
from data-wrangler.database import db
class BaseFactory(SQLAlchemyModelFactory):
class Meta:
abstract = True
sqlalchemy_ses... | Eleonore9/data-wrangler | tests/factories.py | Python | bsd-3-clause | 614 |
import logging
from collections import OrderedDict
from django.conf import settings
from django.core.cache import cache
from django.shortcuts import render
from apiclient.errors import Error as GoogleAPIError
from oauth2client.client import Error as Oauth2Error
from OpenSSL.crypto import Error as OpenSSLError
from k... | mozilla/kitsune | kitsune/dashboards/utils.py | Python | bsd-3-clause | 4,262 |
"""
Waive MIB lookup
++++++++++++++++
Perform SNMP GETNEXT operation with the following options:
* with SNMPv2c, community 'public'
* over IPv4/UDP
* to an Agent at demo.snmplabs.com:161
* for an OID in string form
* do not resolve response OIDs and values into human-freidly form
False lookupMib keyword arguments co... | filippog/pysnmp | examples/hlapi/asyncore/sync/manager/cmdgen/waive-mib-lookup.py | Python | bsd-3-clause | 1,301 |
import simplejson as json
def dict_to_bytes(the_dict):
return json.dumps(the_dict).encode()
| bboortz/cryptobox | lib/jsonhelper.py | Python | bsd-3-clause | 97 |
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
import sys, copy, inspect, types
from Operation import Operation
from Service import Service
from Remote import Remote
from Task import T... | aerialhedgehog/VyPy | trunk/VyPy/parallel/Object.py | Python | bsd-3-clause | 7,709 |
from django import template
from django.template.defaultfilters import stringfilter
from tidylib import tidy_fragment
from django.conf import settings
from copy import copy
from datetime import datetime
from ummeli.base.models import Banner
from django.db.models import Q, F
register = template.Library()
@register.fil... | praekelt/ummeli | ummeli/vlive/templatetags/vlive_tags.py | Python | bsd-3-clause | 4,059 |
"""
setup.py - Pyappi setup file
"""
from __future__ import print_function
from setuptools import Command, setup
setup(
name='Pyappi',
version='0.1-dev',
url='http://github.com/yyyar/pyappi',
license='BSD',
author='Yaroslav Pogrebnyak',
author_email='yyyaroslav@gmail.com',
description=... | yyyar/pyappi | setup.py | Python | bsd-3-clause | 985 |
import math
import random
import unittest
from copy import deepcopy
import torch
import torch.legacy.nn as nn
from common_nn import NNTestCase, ModuleTest, CriterionTest, iter_tensors, \
module_tests, criterion_tests, TEST_CUDA, PRECISION
from common import to_gpu, freeze_rng_state, run_tests
class OldModuleTest... | RPGOne/Skynet | pytorch-master/test/test_legacy_nn.py | Python | bsd-3-clause | 48,235 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import select
#import signal
import time
import copy
#tcp option
SO_REUSEADDR = 1
SO_KEEPALIVE = 1
TCP_NODELAY = 1
SO_SNDBUF = 10240
SO_RCVBUF = 10240
SOCKET_TIMEOUT = 120
#socket list
server_list = []
client_list = []
class ServerSocket:
def __init__(self,... | pyzzz/mysocket | mysocet.py | Python | bsd-3-clause | 5,744 |
from __future__ import absolute_import, division, print_function
from itertools import count
from operator import getitem
from .compatibility import zip_longest
from .core import (istask, get_dependencies, subs, toposort, flatten,
reverse_dict, add, inc, ishashable, preorder_traversal)
from .rewrit... | mikegraham/dask | dask/optimize.py | Python | bsd-3-clause | 17,922 |
from setuptools import setup
from setupbase import create_cmdclass, install_npm
cmdclass = create_cmdclass(['labextension', 'nbextension'])
cmdclass['labextension'] = install_npm('labextension')
cmdclass['nbextension'] = install_npm('nbextension')
setup_args = dict(
name = '{{cookiecutter.extensio... | gnestor/mimerender-cookiecutter | {{cookiecutter.extension_name}}/setup.py | Python | bsd-3-clause | 1,465 |
# coding=utf-8
# ######################################################################
# Developed at the NSLS-II, Brookhaven National Laboratory #
# Developed by Sameera K. Abeykoon, February 2014 #
# #
# Copyright (... | danielballan/scikit-xray | skbeam/core/correlation.py | Python | bsd-3-clause | 42,977 |
# Copyright (c) 2012 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.
"""Examine success/fail history for Chrome/ium OS builds.
Used to check in a LKGM version for Chrome OS for other consumers.
"""
from __future__ imp... | guorendong/iridium-browser-ubuntu | third_party/chromite/scripts/cros_best_revision.py | Python | bsd-3-clause | 8,260 |
import sys
sys.path.append('..')
from helpers import render_frames
from graphs.BSDFViewer import BSDFViewer as g
from falcor import *
m.addGraph(g)
m.loadScene('Arcade/Arcade.pyscene')
# default
render_frames(m, 'default', frames=[64])
exit()
| NVIDIAGameWorks/Falcor | Tests/image_tests/renderpasses/test_BSDFViewer.py | Python | bsd-3-clause | 246 |
from types import ModuleType
def import_any(path, name=None):
module = ModuleType(name or "dummy")
execfile(path, globals(), module.__dict__)
return module
| tebeka/pythonwise | import_any.py | Python | bsd-3-clause | 170 |
# -*- coding: utf-8 -*-
from nose.tools import *
import pygraphviz as pgv
def test_readwrite():
A = pgv.AGraph(name='test graph')
A.add_path([1,2,3,4,5,6,7,8,9,10])
#FIXME
# >>> (fd,fname)=tempfile.mkstemp()
# A.write(fname)
# A.read(fname)
# assert_equal(B, AGraph(fname))
# assert_true(B == A... | mmarkov/pygraphviz | pygraphviz/tests/test_readwrite.py | Python | bsd-3-clause | 391 |
"""Simple example using pycrawl to crawl GitHub.
"""
from pycrawl.spiders.route import RouteSpider
spider = RouteSpider(__name__)
spider.config.update({
'URLS': ['https://github.com'],
'DOMAINS': ['github.com', 'www.github.com'],
})
@spider.route('github.com/\w+/?$')
def parse_user(spider, response):
p... | jmcarp/pycrawl | examples/github_spider.py | Python | bsd-3-clause | 515 |
from django.utils.translation import ugettext_lazy
from corehq.apps.reports.filters.base import BaseReportFilter
from corehq.apps.reports.models import HQToggle
class SubmitToggle(HQToggle):
def __init__(self, type, show, name, doc_type):
super(SubmitToggle, self).__init__(type, show, name)
... | dimagi/commcare-hq | corehq/apps/reports/standard/forms/filters.py | Python | bsd-3-clause | 1,606 |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
import logging
import emission.core.wrapper.wrapperbase as ecwb
class LocalD... | sunil07t/e-mission-server | emission/core/wrapper/localdate.py | Python | bsd-3-clause | 1,283 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Scripts that insert static (file-based) data.
"""
__author__ = 'Daniel Zhang (張道博)'
__copyright__ = 'Copyright (c) 2013, University of Hawaii Smart Energy Project'
__license__ = 'https://raw.github' \
'.com/Hawaii-Smart-Energy-Project/Maui-Smart-Grid/mas... | Hawaii-Smart-Energy-Project/Maui-Smart-Grid | src/static-data-insert/__init__.py | Python | bsd-3-clause | 366 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Andrew Hill'
__email__ = 'andrewhill157@gmail.com'
__version__ = '0.1.0' | macarthur-lab/leiden_sc | leiden_sc/__init__.py | Python | bsd-3-clause | 133 |
import numpy as np
import pandas as pd
import yaml
from hydromet.disaggregate import monthly_to_daily
def load_model_config(filename):
with open(filename) as yml_file:
config = yaml.load(yml_file)
return config
def get_idx(config, typ):
if typ is None:
idx = slice(None)
else:
... | amacd31/hydromet-toolkit | hydromet/io.py | Python | bsd-3-clause | 2,136 |
from unittest import skipIf
from django.test import TestCase, override_settings
from django.db import connection
from django.db.migrations.loader import MigrationLoader, AmbiguityError
from django.db.migrations.recorder import MigrationRecorder
from django.utils import six
class RecorderTests(TestCase):
"""
... | Beeblio/django | tests/migrations/test_loader.py | Python | bsd-3-clause | 4,205 |
#!/usr/bin/env python2.7
# Copyright 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 lis... | ppietrasa/grpc | tools/run_tests/run_performance_tests.py | Python | bsd-3-clause | 24,334 |
#!/usr/bin/env python
# encoding: utf-8
"""
dotfiles commandline interface (CLI)
"""
from __future__ import print_function
import sys
def get_pkg_resource_filename(path=''):
"""
This package generates a MANIFEST.in file from version control (hg)
in order to include files outside of the package source di... | westurner/dotfiles | src/dotfiles/cli/cli.py | Python | bsd-3-clause | 2,921 |
# Copyright 2015 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.
"""URL endpoint to allow Buildbot slaves to post data to the dashboard."""
import copy
import json
import logging
import math
import re
from google.appengi... | SummerLW/Perf-Insight-Report | dashboard/dashboard/add_point.py | Python | bsd-3-clause | 27,077 |
from django.contrib.gis import admin
from faadata.fixes.models import *
class FixAdmin(admin.OSMGeoAdmin):
list_display = ('id', 'artcc', 'fix_type', 'state_post_office_code')
list_filter = ('fix_type', 'artcc')
search_fields = ('id',)
admin.site.register(Fix, FixAdmin)
| adamfast/faadata | faadata/fixes/admin.py | Python | bsd-3-clause | 285 |
import os.path
def get_asset_path(name):
return os.path.abspath(
os.path.join(os.path.dirname(__file__), 'assets', name)
)
| herczy/pydepend | pydepend/tests/__init__.py | Python | bsd-3-clause | 141 |
username = 'user'
password = 'pass'
servername = 'securitycenter'
smtpserver = 'smtp@domain.com'
emailfrom = 'SecurityCenter@domain.com'
scriptadmin = 'Admin@domain.com'
| SteveMcGrath/pySecurityCenter | examples/sc5/ticket_notifications/config.py | Python | bsd-3-clause | 170 |
import numpy as np
import menpo
from nose.tools import raises
from numpy.testing import assert_allclose, assert_almost_equal
from menpo.image import BooleanImage, Image, MaskedImage, OutOfMaskSampleError
from menpo.shape import PointCloud, bounding_box
from menpo.transform import Affine, UniformScale, Rotation
import m... | yuxiang-zhou/menpo | menpo/image/test/image_warp_test.py | Python | bsd-3-clause | 13,616 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# fanstat documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | koodaamo/fanstat | docs/conf.py | Python | bsd-3-clause | 8,403 |
import os
import os.path as op
DEBUG = False
DAEMON = False
BOT_NAME = "pyper"
SLACK_TOKEN = os.environ['PYPER_KEY']
ROOT_DIR = op.join(op.dirname(op.abspath(__file__)), '..')
CONFIG_DIR = ROOT_DIR
LOGFILE = op.join(CONFIG_DIR, 'pyper_the_bot.log')
IMPLANTS_DIR = op.join(ROOT_DIR, 'implants')
GOOGLE_API_KEY_FI... | PythonSanSebastian/pyper_the_bot | configs/pyper_cloud.py | Python | bsd-3-clause | 2,606 |
# encoding: utf-8
"""
Encoding and decoding function
release |release|, version |version|
.. versionadded:: 1.0
Initial
Contents
--------
Classes:
Functions:
Variables:
Members
-------
"""
from leetehao import base
from leetehao import global_constants as constants
class MorseDecodeError(Exception):
... | myyang/leetehao | leetehao/morse/encoding.py | Python | bsd-3-clause | 2,677 |
# -*- coding: utf8 -*-
import os
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY = 'you-will-never-guess'
OPENID_PROVIDERS = [
{'name': 'Google', 'url': 'https://www.google.com/accounts/o8/id'},
{'name': 'Yahoo', 'url': 'https://me.yahoo.com'},
{'name': 'AOL', 'url': 'h... | technopoetic/flask-mega-tut | config.py | Python | bsd-3-clause | 1,242 |
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('client.views',
url(r'^$', 'index'),
(r'^login$', 'places_signin'),
(r'^logout$', 'places_signout'),
(r'^return$', 'places_return'),
)
urlpatterns += patterns('',
(r'^places', incl... | wooster/django-topsoil | tests/test_consumer/urls.py | Python | bsd-3-clause | 343 |
#encoding:utf-8
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth import authenticate
from userena import settings as userena_settings
from userena.compat import sha_constructor
from userena.models import UserenaSignup
fro... | botify-labs/django-userena | userena/forms.py | Python | bsd-3-clause | 10,268 |
import numpy as np
from numpy.testing import assert_allclose
import matplotlib.pyplot as plt
from ..bbox import BBox
class TestBBoxTransform(object):
def setup_method(self, method):
self.bbox = BBox(center=(300, 200), width=200, height=50, theta=0)
self.tr = self.bbox.transform
def test_raw... | glue-viz/bermuda | bermuda/tests/test_transforms.py | Python | bsd-3-clause | 1,674 |
try:
# 2.5 built-in
import xml.etree.ElementTree as et
except ImportError:
# External library
import elementtree.ElementTree as et
def export(graph, filename, progresscallback):
root = et.Element('svg', {
'xmlns': 'http://www.w3.org/2000/svg',
'width': str(graph.width), 'height': s... | fengb/pyggdrasil | pyggdrasil/export/svg.py | Python | bsd-3-clause | 2,049 |
"""
Copyright (c) 2020 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 unicode_literals, absolute_import
from atomic_reactor.constants import (PLUGIN_CHECK_USER_SETTINGS, CONTAINER_DOCKERP... | projectatomic/atomic-reactor | atomic_reactor/plugins/pre_check_user_settings.py | Python | bsd-3-clause | 3,507 |
"""Array printing function
$Id: arrayprint.py,v 1.9 2005/09/13 13:58:44 teoliphant Exp $
"""
from __future__ import division, absolute_import, print_function
__all__ = ["array2string", "set_printoptions", "get_printoptions"]
__docformat__ = 'restructuredtext'
#
# Written by Konrad Hinsen <hinsenk@ere.umontreal.ca>
... | NextThought/pypy-numpy | numpy/core/arrayprint.py | Python | bsd-3-clause | 25,925 |
# 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.
import operator
import functools
import torch
import torch.nn.functional as F
from fairseq.modules.quant_noise import quant_noise
from fairse... | hfp/libxsmm | samples/deeplearning/sparse_training/fairseq/fairseq/modules/adaptive_softmax.py | Python | bsd-3-clause | 7,931 |
if false
var = 3
| citrix-openstack-build/pecan | pecan/tests/config_fixtures/bad/syntaxerror.py | Python | bsd-3-clause | 17 |
# How many races have multiple candidates raising big sums of money?
import sys, os
from django.core.management import setup_environ
sys.path.append('../fecreader/')
sys.path.append('../')
import settings
setup_environ(settings)
from summary_data.models import District, Candidate_Overlay
fundraising_threshold = 500... | sunlightlabs/read_FEC | fecreader/data_scripts/get_competitive_ratings.py | Python | bsd-3-clause | 1,115 |
import datetime
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.db.models import signals
from django.db.models.query import QuerySet
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from hashlib impo... | adriaant/django-datatrans | datatrans/models.py | Python | bsd-3-clause | 6,736 |
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | liesbethvanherpe/NeuroM | neurom/fst/tests/test_neuronfunc.py | Python | bsd-3-clause | 6,299 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('billing', '0006_auto_20150401_2006'),
]
operations = [
migrations.AlterField(
model_name='rfidcard',
... | Inter-Actief/alexia | alexia/apps/billing/migrations/0007_auto_20150402_0047.py | Python | bsd-3-clause | 483 |
#!/usr/bin/env python
from distutils.core import setup
from Kirss.kirss import VERSION
setup(name="kirss",
version=VERSION,
license="BSD",
description="A simple RSS aggregator.",
long_description="A simple RSS aggregator that outputs a HTML file.",
author="Nathan Jones",
... | nathanj/kirss | setup.py | Python | bsd-3-clause | 676 |
from widgetbase import WidgetBase
from geoprisma.models import WidgetType
class MapPanel(WidgetBase):
"""
MapPanel
"""
def __init__(self, widgetModel):
self.id = widgetModel.name
self.name = widgetModel.name
self.type = WidgetType(name="mappanel")
self.actio... | groupe-conseil-nutshimit-nippour/django-geoprisma | geoprisma/core/widgets/mappanel.py | Python | bsd-3-clause | 412 |
from zope.interface import implements
from twisted.internet import reactor
from twisted.internet.defer import (
inlineCallbacks, returnValue, maybeDeferred, gatherResults)
from vumi import log
from vumi.message import TransportUserMessage
from vumi.worker import BaseWorker
from vumi.application import ApplicationW... | praekelt/vumi-go | go/vumitools/app_worker.py | Python | bsd-3-clause | 23,902 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: robot_data.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... | PeteE/roro | python/robot_data_pb2.py | Python | bsd-3-clause | 4,149 |
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('', # NOQA
url(r'^$', TemplateView.as_view(
template_name='app/home.html'), name='home'),
url(r'^pizzagigi/', include('pizzag... | kelvinwong-ca/django-select-multiple-field | test_projects/django14/django14/urls.py | Python | bsd-3-clause | 579 |
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages.storage import default_storage as default_messages_storage
from django.db import connection
from django.test import RequestFactory
from django.test.utils import CaptureQuer... | wagnerand/addons-server | src/olympia/users/tests/test_admin.py | Python | bsd-3-clause | 39,010 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 DAVY Guillaume
# 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
# li... | stormi/tsunami | test/main.py | Python | bsd-3-clause | 4,867 |
from django.test import TestCase
from systems.models import System
from mozdns.address_record.models import AddressRecord
from core.interface.static_intr.models import StaticInterface
from mozdns.cname.models import CNAME
from mozdns.txt.models import TXT
from mozdns.mx.models import MX
from mozdns.srv.models import S... | rtucker-mozilla/mozilla_inventory | mozdns/domain/tests/auto_delete.py | Python | bsd-3-clause | 7,282 |
from Bio.Blast.Applications import NcbiblastnCommandline
from Bio import SeqIO
import StringIO
import os.path
import glob
import re
fasta_in_dir = '' # directory of fasta files to check
fasta_out_dir = '' # directory to save hits fasta too
blast_db = '' # repbase local blast db
file_hits_file = 'te_file_hits.csv' # ... | lcoghill/transeeker | transeeker.py | Python | bsd-3-clause | 3,382 |
#!/usr/bin/env python3
# Copyright (c) 2020, The OTNS Authors.
# 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... | openthread/ot-ns | pylibs/unittests/OTNSTestCase.py | Python | bsd-3-clause | 2,626 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from setuptools import setup
setup(
name='django-scheduler',
version='10.7.15',
description='A calendaring app for Django.',
author='Leonardo Lazzaro',
author_email='lazzaroleonardo@gmail.com',
url='https://g... | AltSchool/django-scheduler | setup.py | Python | bsd-3-clause | 1,523 |
#!/usr/bin/python
'''
This program is basically the hello world in SimpleCV
all it does is grab an image from the camera and display it
'''
from __future__ import print_function
print(__doc__)
from SimpleCV import *
cam = Camera()
while True:
img = cam.getImage()
img.show()
| tpltnt/SimpleCV | SimpleCV/examples/display/simplecam.py | Python | bsd-3-clause | 285 |
# 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.
# pylint: disable=W0401,W0614
from telemetry.page.actions.all_page_actions import *
from telemetry.page import page as page_module
from telemetry.page import ... | chromium2014/src | tools/perf/page_sets/intl_es_fr_pt-BR.py | Python | bsd-3-clause | 1,890 |
#!/usr/bin/env python
"""Every 15 minutes, this script will check for new FT1 files from Fermi (mdcget)
run search on farm for 12 hour intervals if new data in an interval is either > 1.2 * old
or if it is the last interval of the day
then send email to ltf-t for detections from ltf-b"""
import argparse
f... | k340/SULI | SULI/Realtime_BB_Search.py | Python | bsd-3-clause | 1,724 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | stonebig/bokeh | tests/integration/widgets/test_spinner.py | Python | bsd-3-clause | 5,886 |
#!/usr/bin/env aarxpy
import aminopy as aa
import CL
s = aa.scene(
aa.load_scene( 'package://baxter_description/urdf/baxter.urdf' ),
aa.frame_fixed( "", "block", aa.tf2(1, [1,0,0]) )
)
s = s.add_geom("block",
aa.geom_box({'color': [1,0,0]},
[.25, .25, .25]))
aa.win... | golems/amino | demo/python/baxter-view.py | Python | bsd-3-clause | 376 |