code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Copyright (C) 2016-2017 by Brendt Wohlberg <brendt@ieee.org>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""Classes for ADMM algorithm... | alphacsc/alphacsc | alphacsc/other/sporco/sporco/admm/cbpdntv.py | Python | bsd-3-clause | 43,694 |
#!/usr/bin/env python
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, 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 co... | tu-darmstadt-ros-pkg/hector_diagnostics | hector_computer_monitor/scripts/cpu_monitor.py | Python | bsd-3-clause | 31,998 |
"""
Muddery text game creation system
This is the main top-level API for Muddery. You can also explore the
muddery library by accessing muddery.<subpackage> directly.
For full functionality you need to explore this module via a django-
aware shell. Go to your game directory and use the command 'muddery.py shell'
to l... | MarsZone/DreamLand | muddery/__init__.py | Python | bsd-3-clause | 1,208 |
import datetime
from django.conf import settings
from django.db import models
from django.template.defaultfilters import slugify
from django.utils import timezone
from blogtools.utils.embargo import EmbargoedContent, EmbargoedContentPublicManager, EmbargoedContentPrivateManager
#TODO, put this in glamkit somewhere.
... | ixc/glamkit-blogtools | blogtools/models.py | Python | bsd-3-clause | 3,335 |
# encoding: UTF-8
"""
Utility for generating a FLAME lattice from accelerator layout.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import logging
import os.path
from collections import OrderedDict
i... | archman/phantasy | phantasy/library/lattice/flame.py | Python | bsd-3-clause | 43,973 |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | AdrianGaudebert/configman | configman/tests/test_option.py | Python | bsd-3-clause | 12,635 |
"""rename a3 manifest
Revision ID: bb8c39173631
Revises: 98595efd597e
Create Date: 2020-04-07 08:44:55.893170
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'bb8c39173631'
down_revision = '98595efd597e'
branch_labels = None... | all-of-us/raw-data-repository | rdr_service/alembic/versions/bb8c39173631_rename_a3_manifest.py | Python | bsd-3-clause | 2,033 |
"""
The API for interacting with arena-related data in the DB.
"""
import datetime
from psycopg2.extras import Json
from twisted.internet.defer import inlineCallbacks, returnValue
from battlesnake.outbound_commands.think_fn_wrappers import btunitpartslist, \
btunitpartslist_ref
from battlesnake.plugins.contrib.ar... | gtaylor/btmux_battlesnake | battlesnake/plugins/contrib/arena_master/db_api.py | Python | bsd-3-clause | 11,199 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# complexity 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
# ... | westurner/pkgsetcomp | docs/conf.py | Python | bsd-3-clause | 8,492 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site domain and name."""
Site = apps.get_model("sites", "Site")
Site.objects.update_or_create(
id=settings.SITE_ID... | LABETE/TestYourProject | TestYourProject/contrib/sites/migrations/0002_set_site_domain_and_name.py | Python | bsd-3-clause | 955 |
# -*- coding: utf-8 -*-
import os
import os.path
import tempfile
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.dispatch import receiver
from registration.signals import user_activated
from imagekit.models import ImageSpecField
from imagekit.proces... | ugoertz/igelgrafik | igelmain/models.py | Python | bsd-3-clause | 6,801 |
#!/usr/bin/env python
# -*- encoding: utf-8
from __future__ import division, print_function
from tagassess.dao.helpers import FilteredUserItemAnnotations
from tagassess.dao.pytables.annotations import AnnotReader
from tagassess.index_creator import create_occurrence_index
from tagassess.probability_estimates.precomput... | flaviovdf/tag_assess | src/scripts/PrecisionRecall.py | Python | bsd-3-clause | 4,909 |
"""Settings for testing emoticons"""
DATABASES = {
'default': {'NAME': 'emoticons.db',
'ENGINE': 'django.db.backends.sqlite3'}
}
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
}
]
INSTALLED_APPS = [
'emoticons',
'dja... | Fantomas42/django-emoticons | emoticons/tests/settings.py | Python | bsd-3-clause | 392 |
import numpy as np
def point_in_hull(point, hull, tolerance=1e-12):
return all((np.dot(eq[:-1], point) + eq[-1] <= tolerance) for eq in hull.equations)
def n_points_in_hull(points, hull):
n_points = 0
for i in range(points.shape[0]):
if point_in_hull(points[i, :], hull):
n_points = n... | ethz-asl/segmatch | segmappy/segmappy/tools/hull.py | Python | bsd-3-clause | 583 |
#!/usr/bin/env python
'''Test framework for pyglet. Reads details of components and capabilities
from a requirements document, runs the appropriate unit tests.
Overview
--------
First, some definitions:
Test case:
A single test, implemented by a Python module in the tests/ directory.
Tests can be interacti... | seeminglee/pyglet64 | tests/test.py | Python | bsd-3-clause | 18,095 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 0.6.8 (standalone edition) on Tue Jan 14 10:41:03 2014
#
import wx
import wx.grid
# begin wxGlade: dependencies
# end wxGlade
# begin wxGlade: extracode
# end wxGlade
class MyFrame(wx.Frame):
def __init__(self, *args, **kwd... | gamesun/MyTerm-for-WangH | GUI.py | Python | bsd-3-clause | 16,544 |
import pytest
from saleor.graphql.core.utils.reordering import perform_reordering
from saleor.product import models
SortedModel = models.AttributeValue
def _sorted_by_order(items):
return sorted(items, key=lambda o: o[1])
def _get_sorted_map():
return list(
SortedModel.objects.values_list("pk", "s... | maferelo/saleor | tests/api/test_core_reordering.py | Python | bsd-3-clause | 8,739 |
from django.conf.urls.defaults import *
urlpatterns = patterns('populous.blogs.views',
url(r'^collections/$', 'collection_index', name="blogs-collection_index"),
url(r'^collections/(?P<slug>[-\w]+)/$', ... | caiges/populous | populous/blogs/urls.py | Python | bsd-3-clause | 1,526 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['MovingMedian'] , ['Seasonal_MonthOfYear'] , ['LSTM'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_MovingMedian_Seasonal_MonthOfYear_LSTM.py | Python | bsd-3-clause | 169 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyright © 2014 German Neuroinformatics Node (G-Node)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted under the terms of the BSD License. See
LICENSE file in the root of the Project.
Author: Ja... | stoewer/nixpy | docs/source/examples/multipleROIs.py | Python | bsd-3-clause | 4,189 |
import unittest
from flask import Flask, views
from flask.signals import got_request_exception, signals_available
try:
from mock import Mock, patch
except:
# python3
from unittest.mock import Mock, patch
import flask
import werkzeug
from flask.ext.restful.utils import http_status_message, challenge, unautho... | CanalTP/flask-restful | tests/test_api.py | Python | bsd-3-clause | 27,561 |
# encoding=utf-8
# Generated by cpy
# 2015-04-15 20:07:01.541685
import os, sys
from sys import stdin, stdout
import socket
class SSDB_Response(object):
pass
def __init__(this, code='', data_or_message=None):
pass
this.code = code
this.data = None
this.message = None
if code=='ok':
pass
this.data ... | qwang2505/ssdb-source-comments | api/python/SSDB.py | Python | bsd-3-clause | 10,178 |
#!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 1997-2015 California Institute of Technology.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.edu/project/pathos/browser/pathos/LICENSE
# pickle fails for nested fu... | mathieudesro/pathos | examples/test_mpmap3.py | Python | bsd-3-clause | 1,292 |
import os
import sys
import time
import signal
import subprocess
import warnings
import platform
def time_to_hms(delta):
''' Convert some time in seconds to a tuple of (hours, minutes, seconds).
'''
m, s = divmod(delta, 60)
h, m = divmod(m, 60)
return (h, m, s)
def check_foregro... | bluegenes/MakeMyTranscriptome | scripts/tasks_v2.py | Python | bsd-3-clause | 26,656 |
# -*- coding: iso-8859-1 -*-
"""MoinMoin Desktop Edition (MMDE) - Configuration
ONLY to be used for MMDE - if you run a personal wiki on your notebook or PC.
This is NOT intended for internet or server or multiuser use due to relaxed security settings!
"""
import sys, os
from MoinMoin.config import multiconfig, url... | mgaitan/moin2git | wikiconfig.py | Python | bsd-3-clause | 2,368 |
# -*- coding: utf-8 -*-
from django.utils import translation
from django.core.cache import cache
from olympia.lib.cache import memoize, memoize_key, make_key
def test_make_key():
with translation.override('en-US'):
assert make_key('é@øel') == 'é@øel:en-us'
with translation.override('de'):
as... | bqbn/addons-server | src/olympia/lib/tests/test_cache.py | Python | bsd-3-clause | 1,418 |
import numpy as np
from scipy.sparse import csr_matrix
from .symbolic import Operator
SPARSITY_N_CUTOFF = 600 # TODO lower after fixing sparse matrices
def sparsify(mat):
assert SPARSITY_N_CUTOFF > 5, 'The SPARSITY_N_CUTOFF is set to a very low number.'
if min(mat.shape) > SPARSITY_N_CUTOFF:
return cs... | Krastanov/cutiepy | cutiepy/operators.py | Python | bsd-3-clause | 1,593 |
def extractChuunihimeWordpressCom(item):
'''
Parser for 'chuunihime.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'),
('Loi... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractChuunihimeWordpressCom.py | Python | bsd-3-clause | 560 |
# -*- coding: utf-8 -*-
"""
Django Basic Extras
A very small collection of some things I find myself frequently using in Django
projects. Hopefully you find it useful. At the moment it only includes an
abstract model for collecting object metadata, and some context processors.
More will likely be added with time, but... | benspaulding/django-basic-extras | basic_extras/__init__.py | Python | bsd-3-clause | 762 |
# Django settings for example project.
import sys
from os.path import abspath, dirname, join
PROJECT_DIR = abspath(dirname(__file__))
grandparent = abspath(join(PROJECT_DIR, '..'))
for path in (grandparent, PROJECT_DIR):
if path not in sys.path:
sys.path.insert(0, path)
DEBUG = True
ADMINS = (
# ('Y... | madisona/django-pseudo-cms | example/settings.py | Python | bsd-3-clause | 3,794 |
import contextlib
import logging
import math
import shutil
import tempfile
import uuid
import numpy as np
import pandas as pd
import tlz as toolz
from .. import base, config
from ..base import compute, compute_as_if_collection, is_dask_collection, tokenize
from ..highlevelgraph import HighLevelGraph
from ..layers imp... | blaze/dask | dask/dataframe/shuffle.py | Python | bsd-3-clause | 33,181 |
###############################################################################
# PowerSphericalPotentialwCutoff.py: spherical power-law potential w/ cutoff
#
# amp
# rho(r)= --------- e^{-(r/rc)^2}
# r^\alpha
###########... | followthesheep/galpy | galpy/potential_src/PowerSphericalPotentialwCutoff.py | Python | bsd-3-clause | 6,813 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-13 18:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('experiments', '0002_auto_20161013_1140'),
]
operations = [
migrations.AddFi... | beakman/droidlab | droidlab/experiments/migrations/0003_auto_20161013_2021.py | Python | bsd-3-clause | 625 |
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Arnaud Joly <a.joly@ulg.ac.be>
# Maheshakya Wijewardena<maheshakya.10@cse.mrt.ac.lk>
# License: BSD 3 clause
from __future__ import division
import numpy as np
from .base import BaseEstimator, ClassifierMixin, RegressorMixin
from .externals.six.moves ... | eickenberg/scikit-learn | sklearn/dummy.py | Python | bsd-3-clause | 14,149 |
"""
Signals for user profiles
"""
from django.conf import settings
from django.db import transaction
from django.db.models.signals import post_delete, post_save
from django.dispatch import receiver
from discussions import tasks
from profiles.models import Profile
from roles.models import Role
from roles.roles import P... | mitodl/micromasters | discussions/signals.py | Python | bsd-3-clause | 2,043 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 30 20:51:31 2017
@author: mje
"""
import numpy as np
import mne
import matplotlib.pyplot as plt
from mne.stats import permutation_cluster_test
from my_settings import (subjects_select, tf_folder, epochs_folder)
d_ali_ent_right = []
for subject i... | MadsJensen/CAA | calc_itc_ali.py | Python | bsd-3-clause | 2,791 |
import logging
import requests
import xml.etree.ElementTree as ET
from django.utils.translation import gettext_lazy as _
from churchill.apps.currencies.models import CurrencyValue, Currency, CurrencyValueType
logger = logging.getLogger()
def get_default_currency_id() -> int:
currency, _ = Currency.objects.get_... | manti-by/Churchill | churchill/apps/currencies/services.py | Python | bsd-3-clause | 2,372 |
'''Experimental!
This is an experimental module for converting ColumnTS into
dynts.timeseries. It requires dynts_.
.. _dynts: https://github.com/quantmind/dynts
'''
from collections import Mapping
from . import models as columnts
import numpy as ny
from dynts import timeseries, tsname
class ColumnT... | jbking/python-stdnet | stdnet/apps/columnts/npts.py | Python | bsd-3-clause | 1,723 |
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.NetworkMethods import NetworkMethod, NetworkMethods
from PLC.Auth import Auth
class AddNetworkMethod(Method):
"""
Adds a new network method.
Returns 1 if successful, faults otherwise.
"""
ro... | dreibh/planetlab-lxc-plcapi | PLC/Methods/AddNetworkMethod.py | Python | bsd-3-clause | 651 |
#!/usr/bin/env python
"""This module contains a set of default tools that are
deployed with jip
"""
import jip
@jip.tool("cleanup")
class cleanup(object):
"""\
The cleanup tool removes ALL the defined output
files of its dependencies. If you have a set of intermediate jobs,
you can put this as a final... | thasso/pyjip | jip/scripts/__init__.py | Python | bsd-3-clause | 1,603 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent 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
# no... | little-dude/monolithe | monolithe/generators/lang/java/writers/apiversionwriter.py | Python | bsd-3-clause | 13,351 |
import os
import numpy as np
from csv import reader
from collections import defaultdict
from common import Plate
from pprint import pprint
def hung_ji_adapter():
folder_ = 'C:/Users/ank/Desktop'
file_ = 'HJT_fittness.csv'
dose_curves = {}
with open(os.path.join(folder_, file_)) as source_file:
... | chiffa/TcanAnalyzer | src/adapters.py | Python | bsd-3-clause | 1,131 |
# -*- coding: utf-8 -*-
import commands
import os
from django.core.management.base import NoArgsCommand
from videostream.utils import encode_video_set
class Command(NoArgsCommand):
def handle_noargs(self, **options):
""" Encode all pending streams """
encode_video_set()
| andrewebdev/django-video | src/videostream/management/commands/encode.py | Python | bsd-3-clause | 301 |
# small script for
from optparse import OptionParser
import sqlite3
import time
import string
import arnovich.core as core
def parse_command_args():
parser = OptionParser()
parser.add_option("-t", "--ticker", action="append", type="string", dest="tickers")
parser.add_option("--from", action="store", type="string... | arnovich/core | test/yahoo/py/extract_to_srv.py | Python | bsd-3-clause | 2,381 |
"""
WSGI config for {{ project_name }} project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APP... | sivaprakashniet/push_pull | push_and_pull/wsgi.py | Python | bsd-3-clause | 2,240 |
# Copyright 2006-2014 Mark Diekhans
# required enum34: https://pypi.python.org/pypi/enum34
from enum import Enum,EnumMeta
SymEnum = None # class defined after use
class SymEnumValue(object):
"Class used to define SymEnum member that have additional attributes."
def __init__(self, value, externalName=None):
... | ifiddes/pycbio | pycbio/sys/symEnum.py | Python | bsd-3-clause | 4,432 |
#!/bin/env python
import os
from distutils.core import setup
name = 'django_sphinx_db'
version = '0.1'
release = '3'
versrel = version + '-' + release
readme = os.path.join(os.path.dirname(__file__), 'README.rst')
download_url = 'https://github.com/downloads/smartfile/django-sphinx-db' \
'/... | petekalo/django-sphinx-db | setup.py | Python | bsd-3-clause | 1,297 |
from .PBXResolver import *
from .PBX_Constants import *
class PBX_Base(object):
def __init__(self, lookup_func, dictionary, project, identifier):
# default 'name' property of a PBX object is the type
self.name = self.__class__.__name__;
# this is the identifier for this object
... | samdmarshall/xcparse | xcparse/Xcode/PBX/PBX_Base.py | Python | bsd-3-clause | 2,017 |
from django.conf.urls.defaults import patterns, url
from . import views
urlpatterns = patterns(
'',
url(r'^$', views.home, name='home'),
#url(r'^2$', views.home2, name='home2'),
#url(r'^3$', views.home3, name='home3'),
)
| skorokithakis/django-fancy-cache | fancy_tests/tests/urls.py | Python | bsd-3-clause | 239 |
import hashlib
import hmac
import re
import time
from urllib import urlencode
from django.conf import settings
from django.contrib.auth.middleware import (AuthenticationMiddleware as
BaseAuthenticationMiddleware)
from django.contrib.auth.models import AnonymousUser
from djan... | washort/zamboni | mkt/api/middleware.py | Python | bsd-3-clause | 15,987 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, division, absolute_import
from bgfiles.http import create_content_disposition
from django.test import SimpleTestCase
class CreateContentDispositionTest(SimpleTestCase):
def test(self):
header = create_content_disposition('Fu... | climapulse/dj-bgfiles | tests/test_http.py | Python | bsd-3-clause | 1,483 |
import unittest
from gi.repository import GElektra as kdb
TEST_NS = "user/tests/gi_py3"
class Constants(unittest.TestCase):
def setUp(self):
pass
def test_kdbconfig_h(self):
self.assertIsInstance(kdb.DB_SYSTEM, str)
self.assertIsInstance(kdb.DB_USER, str)
self.assertIsInstance(kdb.DB_HOME, str)
self.... | e1528532/libelektra | src/bindings/gi/python/testgi_kdb.py | Python | bsd-3-clause | 1,632 |
# Copyright (c) 2006-2009 The Trustees of Indiana University.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without ... | matthiaskramm/corepy | corepy/arch/spu/platform/linux_spufs/spre_linux_spu.py | Python | bsd-3-clause | 33,201 |
import base64
import collections
import hashlib
from datetime import datetime, timedelta
from operator import attrgetter
import time
import uuid
from django.core.cache import cache
from django.conf import settings
from django.db.models import Q, signals as db_signals
from django.shortcuts import get_object_or_404
from... | jbalogh/zamboni | apps/blocklist/views.py | Python | bsd-3-clause | 5,542 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.core.serializers.json import DjangoJSONEncoder
from django.http import HttpResponse
class JsonResponse(HttpResponse):
def __init__(self, data, encoder=DjangoJSONEncoder, safe=True, **kwargs):
if safe and not isinst... | mishbahr/djangocms-forms | djangocms_forms/compat.py | Python | bsd-3-clause | 658 |
#!/usr/bin/env python3
"""
Generate a set of agent demonstrations.
The agent can either be a trained model or the heuristic expert (bot).
Demonstration generation can take a long time, but it can be parallelized
if you have a cluster at your disposal. Provide a script that launches
make_agent_demos.py at your cluste... | mila-iqia/babyai | scripts/make_agent_demos.py | Python | bsd-3-clause | 8,078 |
from decimal import Decimal
class Integer:
def __init__(self, val=None):
self.val = int(val)
def __repr__(self):
return self.val
class Text:
def __init__(self, val=None):
self.val = str(val)
def __repr__(self):
return self.val
class Bool:
def __init__(self, val=Non... | shabinesh/Tabject | tabject/types.py | Python | bsd-3-clause | 550 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-05 05:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('topics', '0010_auto_20170531_1439'),
]
operations ... | GeorgiaTechDHLab/TOME | topics/migrations/0011_auto_20170605_0507.py | Python | bsd-3-clause | 1,022 |
# coding=utf-8
import os
import csv
import datetime
import re
home = os.path.expanduser('~')
mainfolder = home + '/scrapecollect/'
nysefile = mainfolder + 'healthcare-NYSE_filings_sorted_final.csv'
nyselinks = mainfolder + 'healthcare-NYSE_links.csv'
nyseview = mainfolder + 'healthcare-NYSE-view.csv'
nysefinal = main... | jwang-net/sector-scraper | sectorscraper/linkstocsv_nyse.py | Python | bsd-3-clause | 1,727 |
# -*- coding: utf-8 -*-
# Copyright (c) 2010 People Power Co.
# All rights reserved.
#
# This open source code was developed with funding from People Power Company
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# ... | umeckel/FS_coapy | coapy/connection.py | Python | bsd-3-clause | 41,116 |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import unittest
from pykit.parsing import cirparser
from pykit.ir import verify, interp
source = """
#include <pykit_ir.h>
Int32 myglobal = 10;
float simple(float x) {
return x * x;
}
Int32 loop() {
Int32 i, sum = 0;
... | flypy/pykit | pykit/ir/tests/test_interp.py | Python | bsd-3-clause | 1,210 |
"""
WSGI config for demo project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` set... | Alem/django-jfu | demo/demo/wsgi.py | Python | bsd-3-clause | 1,208 |
import os
from math import ceil
from operator import getitem
from threading import Lock
import numpy as np
import pandas as pd
from tlz import merge
from ... import array as da
from ...base import tokenize
from ...dataframe.core import new_dd_object
from ...delayed import delayed
from ...highlevelgraph import HighLev... | blaze/dask | dask/dataframe/io/io.py | Python | bsd-3-clause | 22,680 |
from inspect import isclass
from django.conf import settings
from django.core.files.storage import get_storage_class
from celery.datastructures import AttributeDict
from tower import ugettext_lazy as _
__all__ = ('LOG', 'LOG_BY_ID', 'LOG_KEEP',)
class _LOG(object):
action_class = None
class CREATE_ADDON(_LOG... | clouserw/zamboni | mkt/site/log.py | Python | bsd-3-clause | 18,674 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = "1.5.2"
if sys.argv[-1] == 'publish':
try:
import wheel # noqa
except ImportError:
raise ImportError("Fix: pip install ... | yigor/stupid | setup.py | Python | bsd-3-clause | 2,103 |
"""
This is your project's main settings file that can be committed to your
repo. If you need to override a setting locally, use local.py
"""
import os
import logging
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.excepti... | puittenbroek/slimmermeten | slimmermeten/settings/base.py | Python | bsd-3-clause | 9,633 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import AnonymousUser
from django.template import Engine, RequestContext
from django.test import RequestFactory
from django.utils.text import smart_split
from cms.toolbar.toolbar import CMSToolbar
from .conf import setting... | aldryn/aldryn-search | aldryn_search/helpers.py | Python | bsd-3-clause | 3,579 |
import errno
import glob
import platform
import re
import sys
import tempfile
import zipfile
from contextlib import contextmanager
from distutils.version import StrictVersion
import os
import requests
from xml.etree import ElementTree
IS_64_BIT = sys.maxsize > 2**32
IS_LINUX = platform.system().lower() == 'linux'
I... | kevbradwick/rockyroad | rockyroad/driver.py | Python | bsd-3-clause | 7,103 |
from __future__ import absolute_import
from xml.etree import ElementTree as ET
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from comments.models import Comment
from . import CommentTestCase
from ..models import Article
cla... | radiantflow/django-comments | tests/testapp/tests/feed_tests.py | Python | bsd-3-clause | 1,879 |
from django.db import models
from django.utils.translation import ugettext, ugettext_lazy as _
from django.forms import widgets
from django.core.mail import send_mail
from django.conf import settings
from form_designer import app_settings
import re
from form_designer.pickled_object_field import PickledObjectField
from ... | praekelt/django-form-designer | form_designer/models.py | Python | bsd-3-clause | 20,394 |
##########################################################################
#
# Copyright (c) 2011-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:
#
# * Redi... | chippey/gaffer | python/GafferCortexUI/PresetsOnlyParameterValueWidget.py | Python | bsd-3-clause | 3,961 |
# -*- coding: utf-8 -*-
"""
werkzeug.exceptions
~~~~~~~~~~~~~~~~~~~
This module implements a number of Python exceptions you can raise from
within your views to trigger a standard non-200 response.
Usage Example
-------------
::
from werkzeug.wrappers import BaseRequest
... | Chitrank-Dixit/werkzeug | werkzeug/exceptions.py | Python | bsd-3-clause | 18,531 |
# $Id$
#
# Copyright (C) 2003 Rational Discovery LLC
# All Rights Reserved
#
from rdkit import RDConfig
from rdkit import six
import sys, os
from rdkit import Chem
from rdkit.VLib.Filter import FilterNode
class DupeFilter(FilterNode):
""" canonical-smiles based duplicate filter
Assumptions:
- inputs a... | jandom/rdkit | rdkit/VLib/NodeLib/SmilesDupeFilter.py | Python | bsd-3-clause | 1,442 |
# pylint: disable=E1101,E1103,W0232
from collections import OrderedDict
import datetime
from sys import getsizeof
import warnings
import numpy as np
from pandas._libs import (
Timestamp, algos as libalgos, index as libindex, lib, tslibs)
import pandas.compat as compat
from pandas.compat import lrange, lzip, map, ... | GuessWhoSamFoo/pandas | pandas/core/indexes/multi.py | Python | bsd-3-clause | 113,443 |
import os
from pathlib import Path
import shutil
import joblib
import hvc
from config import rewrite_config
HERE = Path(__file__).parent
DATA_FOR_TESTS = HERE / ".." / "data_for_tests"
TEST_CONFIGS = DATA_FOR_TESTS.joinpath("config.yml").resolve()
FEATURE_FILES_DST = DATA_FOR_TESTS.joinpath("feature_files").resolv... | NickleDave/hybrid-vocal-classifier | tests/scripts/remake_model_files.py | Python | bsd-3-clause | 3,608 |
import sys
import subprocess
import textwrap
import decimal
from . import constants
from . import utils
from . import argparse_utils
def zpool_command(args):
context = vars(args)
effective_image_count = constants.ZPOOL_TYPES[args.type](args.count)
context['image_size'] = args.size / effective_image_count
... | WoLpH/zfs-utils-osx | zfs_utils_osx/zpool.py | Python | bsd-3-clause | 3,142 |
#!/usr/bin/env python3
import helloworld
print(helloworld.hello());
print(helloworld.heyman(5, "StarNight"));
help(helloworld);
| starnight/python-c-extension | 01-HeyMan/test.py | Python | bsd-3-clause | 130 |
# -*- coding: utf-8 -*-
from django import forms
from .models import User
class UserForm(forms.ModelForm):
class Meta:
model = User
# Constrain the UserForm to just these fields.
fields = ("first_name", "last_name") | chhantyal/referly | referly/users/forms.py | Python | bsd-3-clause | 248 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^static/(?P<path>.*)$', 'django.views.static.serve',{ 'document_root': settings.STATIC_ROOT}),
... | sv1jsb/pCMS | pCMS/urls.py | Python | bsd-3-clause | 702 |
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from astropy import units
from .. import LombScargle
from ..implementations import lombscargle_slow, lombscargle
METHOD_NAMES = ['auto', 'fast', 'slow', 'scipy', 'chi2', 'fastchi2']
@pytest.fixture
def data(N=100, period=1, th... | jakevdp/lombscargle | lombscargle/tests/test_lombscargle.py | Python | bsd-3-clause | 5,888 |
from setuptools import setup, find_packages
CLASSIFIERS = (
('Development Status :: 4 - Beta'),
('Environment :: Console'),
('Environment :: Web Environment'),
('Framework :: Django'),
('Intended Audience :: Developers'),
('Intended Audience :: Science/Research'),
('Intended Audience :: Sys... | justquick/google-chartwrapper | setup.py | Python | bsd-3-clause | 1,680 |
import random
from diesel import quickstart, first, sleep, fork
from diesel.util.queue import Queue
def fire_random(queues):
while True:
sleep(1)
random.choice(queues).put(None)
def make_and_wait():
q1 = Queue()
q2 = Queue()
both = [q1, q2]
fork(fire_random, both)
while True... | dieseldev/diesel | examples/newwait.py | Python | bsd-3-clause | 530 |
import sys
def check_args(argv):
if len(argv) != 2:
print ("Help:\n"
"%s filename.log\n"
"filename.log = name of logfile") % argv[0]
sys.exit(1)
| hinnerk/py-djbdnslog | src/djbdnslog/scripts/__init__.py | Python | bsd-3-clause | 197 |
# Copyright 2018 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.
DEPS = [
'target',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/step',
]
def RunSteps(api):
target = api.target('... | ric2b/Vivaldi-browser | thirdparty/gn/infra/recipe_modules/target/examples/full.py | Python | bsd-3-clause | 981 |
"""
Calculation thread for modeling
"""
import time
import numpy as np
import math
from sas.sascalc.data_util.calcthread import CalcThread
from sas.sascalc.fit.MultiplicationModel import MultiplicationModel
class Calc2D(CalcThread):
"""
Compute 2D model
This calculation assumes a 2-fold symmetry of th... | lewisodriscoll/sasview | src/sas/sasgui/perspectives/fitting/model_thread.py | Python | bsd-3-clause | 10,347 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('polls', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='poll',
name='extraordin... | jomauricio/abgthe | abgthe/apps/polls/migrations/0002_auto_20150422_0036.py | Python | bsd-3-clause | 464 |
from django.conf import settings as dj_settings
from django.db import models, transaction
from django.core.signals import got_request_exception
from django.http import Http404
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from djangodblog import settings
from d... | alvinkatojr/django-db-log | djangodblog/models.py | Python | bsd-3-clause | 5,442 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Alex J. Champandard
# Copyright (c) 2015, Vispy Development Team.
# Copyright (c) 2015, Rob Clark
#
# Distributed under the (new) BSD License.
from __future__ import (unicode_literals, print_function)
import sys
import argparse
import datetime
impor... | robclark/shadertoy-render | shadertoy-render.py | Python | bsd-3-clause | 7,005 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import BaseCommand
from django.utils.translation import ugettext_lazy as _
class Command(BaseCommand):
help = _("Collect information about all customers which accessed this shop.")
... | rfleschenberg/django-shop | shop/management/commands/shopcustomers.py | Python | bsd-3-clause | 1,580 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template import RequestContext
from rest_framework import renderers
class CMSPageRenderer(renderers.TemplateHTMLRenderer):
"""
Modified TemplateHTMLRenderer, which is able to render CMS pages containing the templatetag
`{% render_... | rfleschenberg/django-shop | shop/rest/renderers.py | Python | bsd-3-clause | 1,657 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Movie.studio'
db.alter_column(u'movie_library_movie', ... | atimothee/django-playground | django_playground/movie_library/migrations/0006_auto__chg_field_movie_studio.py | Python | bsd-3-clause | 4,380 |
# # -*- coding: utf-8“ -*-
# from datetime import date, time, datetime, timedelta
# from dateutil.relativedelta import relativedelta
#
# from django.conf import settings
# from django.core.urlresolvers import reverse
# from django.test import TestCase
#
# from eventtools.utils import datetimeify
# from eventtools_tes... | ixc/glamkit-eventtools | eventtools/tests/views.py | Python | bsd-3-clause | 9,613 |
from django.db import transaction
from rest_framework import serializers
from rest_framework.fields import URLField
from container.models import ContainerFamily, Container, ContainerApp, ContainerRun, Batch, ContainerDataset, \
ContainerArgument, ContainerLog
from kive.serializers import AccessControlSerializer
fr... | cfe-lab/Kive | kive/container/serializers.py | Python | bsd-3-clause | 14,645 |
#! /usr/bin/env python3
# Invoke http.server to host a basic webserver on localhost /without/ caching.
# Files served by http.server are usually cached by browsers, which makes testing and debugging
# buggy.
import http.server
import os
from functools import partial
class NoCacheRequestHandler(http.server.SimpleHT... | endlessm/chromium-browser | third_party/webgl/src/serve_localhost.py | Python | bsd-3-clause | 1,473 |
"""Generic set theory interfaces."""
import itertools
from mpmath import mpf, mpi
from ..core import Basic, Eq, Expr, Mul, S, nan, oo, sympify, zoo
from ..core.compatibility import iterable, ordered
from ..core.decorators import _sympifyit
from ..core.evalf import EvalfMixin
from ..core.evaluate import global_evalua... | skirpichev/omg | diofant/sets/sets.py | Python | bsd-3-clause | 53,814 |
"""Video Analyzer"""
| peragro/peragro-at | src/damn_at/analyzers/video/__init__.py | Python | bsd-3-clause | 21 |
import os
import datetime as dt
try:
from importlib import reload
except ImportError:
try:
from imp import reload
except ImportError:
pass
import numpy as np
from numpy.testing import assert_almost_equal
import pandas as pd
import unittest
import pytest
from pvlib.location import Locatio... | uvchik/pvlib-python | pvlib/test/test_spa.py | Python | bsd-3-clause | 16,534 |
# -* encoding: utf-8 *-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from unittest.case import TestCase
from typing import Any
import requests_mock
from aptly_api.... | gopythongo/aptly-api-client | aptly_api/tests/publish.py | Python | bsd-3-clause | 16,063 |
from django.core.exceptions import ValidationError
from django.db import models
class ActionLog(models.Model):
ACTIONS_TYPES = (
# A translation has been created.
("translation:created", "Translation created"),
# A translation has been deleted.
("translation:deleted", "Translation ... | jotes/pontoon | pontoon/actionlog/models.py | Python | bsd-3-clause | 3,117 |
# -*- coding: utf-8 -*-
"""
Kay authentication backend using google account.
:Copyright: (c) 2009 Accense Technology, Inc.
Takashi Matsuo <tmatsuo@candit.jp>,
All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from google.appengine.ext import db
from goog... | calvinchengx/O-Kay-Blog-wih-Kay-0.10.0 | kay/auth/backends/googleaccount.py | Python | bsd-3-clause | 2,423 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.