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 |
|---|---|---|---|---|---|
# -*- encoding: utf-8 -*-
# Cheqlist v0.3.2
# A simple Qt checklist.
# Copyright © 2015-2021, Chris Warrick.
# See /LICENSE for licensing information.
"""
Undo commands for Cheqlist.
:Copyright: © 2015-2021, Chris Warrick.
:License: BSD (see /LICENSE).
"""
try:
from PySide2.QtWidgets import QUndoCommand
from... | Kwpolska/cheqlist | cheqlist/undocommands.py | Python | bsd-3-clause | 7,538 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
TAP plus
=============
@author: Juan Carlos Segovia
@contact: juan.carlos.segovia@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 30 jun. 2016
"""
from astroquery.utils.tap... | ceb8/astroquery | astroquery/utils/tap/core.py | Python | bsd-3-clause | 81,834 |
from clusto.schema import *
from clusto.exceptions import *
from clusto.drivers import DRIVERLIST, TYPELIST, Driver, ClustoMeta, IPManager
from sqlalchemy.exceptions import InvalidRequestError
from sqlalchemy import create_engine
from clusto import drivers
import threading
import logging
import time
import re
driv... | rongoro/clusto | src/clusto/__init__.py | Python | bsd-3-clause | 10,998 |
#! /usr/bin/env python
#
# example2_mpl.py -- Simple, configurable FITS viewer using a matplotlib
# QtAgg backend for Ginga and embedded in a Qt program.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
Usage:
example2_mpl.py [fi... | pllim/ginga | ginga/examples/matplotlib/example2_mpl.py | Python | bsd-3-clause | 10,002 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def row(p, n):
return [x+p for x in range(n)]
ret=[row(x,20) for x in range(15)]
print ret
ret=[ [x+y for x in range(20)] for y in range(15) ]
print ret
| RyodoTanaka/Coding_The_Matrix | python/chap_0/0.8.3.py | Python | bsd-3-clause | 206 |
from ..Module import Module
from ..TagData import TagData
class keysys(Module):
opmap = {
'resData': 'descend',
'infData': 'descend',
'creData': 'descend',
'renDate': 'set',
'punDate': 'set',
'domain-roid': 'set',
'renewalmode': 's... | hiqdev/reppy | heppy/modules/keysys.py | Python | bsd-3-clause | 3,022 |
'''
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that "all houses in this place forms a binary tree". It will automatically contact the po... | shub0/algorithm-data-structure | python/house_rob3.py | Python | bsd-3-clause | 1,270 |
from django.conf.urls import url
from apps.api.models import Artist
from apps.api.serializers.artist import ArtistSerializer, ArtistListSerializer
from apps.api.views.helpers import BaseDetailView, BaseExpansionsView, BaseGameView, BaseListView
class ArtistListView(BaseListView):
"""
Get list of artists
... | MihaZelnik/meepleAPI | meeple/apps/api/views/artist.py | Python | bsd-3-clause | 1,371 |
# -*- coding: utf-8 -*-
import re
import base64
import os.path
import logging
from datetime import datetime
import unidecode
from pyramid.settings import asbool
from pyramid.httpexceptions import HTTPFound
from pyramid.url import route_url
from .base import View, CreateView, EditView, DeleteView
from pyvac.models im... | sayoun/pyvac | pyvac/views/account.py | Python | bsd-3-clause | 23,518 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import os
import datetime
import logging
import re
import requests
import time
import types
import ast
try:
# Prefer lxml, if installed.
from lxml import etree as ET
exc... | shasha79/pysolr | pysolr.py | Python | bsd-3-clause | 34,312 |
import copy
import inspect
from django import forms
from django.forms.formsets import all_valid, DELETION_FIELD_NAME
from django.forms.models import inlineformset_factory, BaseInlineFormSet, modelform_defines_fields
from django.contrib.contenttypes.forms import BaseGenericInlineFormSet, generic_inlineformset_factory
fr... | f1aky/xadmin | xadmin/plugins/inline.py | Python | bsd-3-clause | 18,239 |
import datetime
from django_yadt import YADTImageField
from django.db import models
from musicdb.db.mixins import NextPreviousMixin
from musicdb.db.fields import MySlugField, FirstLetterField
from musicdb.common.models import MusicFile
from .managers import ArtistManager, TrackManager
class Artist(models.Model, N... | lamby/musicdb | musicdb/albums/models.py | Python | bsd-3-clause | 4,283 |
#!/usr/bin/env python
"""
Python source code - replace this with a description of the code and write the code below this text.
"""
import random
import os.path as osp
def load_test_data(path):
sents = []
with open(path) as reader:
for line in reader:
fields = line.strip().split('\t')
... | raingo/TGIF-Release | code/crowdflower/front-end/data/shuffle-test.py | Python | bsd-3-clause | 840 |
#!/usr/bin/env python
"""celeryd
.. program:: celeryd
.. cmdoption:: -c, --concurrency
Number of child processes processing the queue. The default
is the number of CPUs available on your system.
.. cmdoption:: -f, --logfile
Path to log file. If no logfile is specified, `stderr` is used.
.. cmdoption::... | WoLpH/celery | celery/bin/celeryd.py | Python | bsd-3-clause | 7,732 |
"""Word completion for IPython.
This module is a fork of the rlcompleter module in the Python standard
library. The original enhancements made to rlcompleter have been sent
upstream and were accepted as of Python 2.3, but we need a lot more
functionality specific to IPython, so this module will continue to live as an... | santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/ipython-0.8.2-py2.5.egg/IPython/completer.py | Python | bsd-3-clause | 23,921 |
import json
from dajax.core import Dajax
from dajaxice.decorators import dajaxice_register
import datetime
from windberg_register.models import Start, Club
@dajaxice_register
def lookup_starts(request, birth, gender):
dajax = Dajax()
birth_date = datetime.datetime.strptime(birth, "%d.%M.%Y")
starts = Sta... | janLo/Windberg-web | windberg_register/ajax.py | Python | bsd-3-clause | 711 |
# proxy module
from traitsui.extras.saving import *
| enthought/etsproxy | enthought/traits/ui/extras/saving.py | Python | bsd-3-clause | 52 |
"""
Arithmetic operations for PandasObjects
This is not a public API.
"""
# necessary to enforce truediv in Python 2.X
from __future__ import division
import operator
import warnings
import numpy as np
import pandas as pd
import datetime
from pandas._libs import (lib, index as libindex,
tsli... | nmartensen/pandas | pandas/core/ops.py | Python | bsd-3-clause | 54,852 |
# coding=UTF-8
import pytest
import psycopg2
from pgspecial.main import PGSpecial
from pgcli.packages.function_metadata import FunctionMetadata
from textwrap import dedent
from utils import run, dbtest, requires_json, requires_jsonb
from pgcli.pgexecute import (ON_ERROR_STOP, ON_ERROR_RAISE, ON_ERROR_RESUME)
@dbtest... | d33tah/pgcli | tests/test_pgexecute.py | Python | bsd-3-clause | 7,953 |
"""Utilities to evaluate the clustering performance of models
Functions named as *_score return a scalar value to maximize: the higher the
better
"""
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD Style.
from math import log
import numpy as np
def homogeneity_completeness_v_measure(labels_true... | joshbohde/scikit-learn | sklearn/metrics/cluster.py | Python | bsd-3-clause | 10,686 |
from __future__ import print_function
import sys
import tables
from numpy.testing import assert_raises
from metatlas.mzml_loader import mzml_to_hdf, get_test_data, main
from metatlas.h5_query import get_info
def test_loader():
paths = get_test_data()
out_file = 'test_loader.h5'
mzml_to_hdf(paths['basi... | aitatanit/metatlas | metatlas/tests/test_loader.py | Python | bsd-3-clause | 1,679 |
# -*- coding: utf-8 -*-
# Standard library imports
from __future__ import unicode_literals
import shutil
# Third party imports
from django.conf import settings
from django.core.files import File
import pytest
# Local application / specific library imports
from precise_bbcode import get_parser
from precise_bbcode.bbc... | slasyz/django-precise-bbcode | tests/unit/test_smilies.py | Python | bsd-3-clause | 1,920 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | flgiordano/netcash | +/google-cloud-sdk/lib/googlecloudsdk/core/resource/resource_property.py | Python | bsd-3-clause | 5,733 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 7, transform = "Logit", sigma = 0.0, exog_count = 0, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_Logit/trend_MovingAverage/cycle_7/ar_/test_artificial_128_Logit_MovingAverage_7__0.py | Python | bsd-3-clause | 263 |
import sys
import uuid
from django.test import TestCase, override_settings
from django.contrib.auth.models import User
from django.db import connection, migrations, models
from django.db.migrations.state import ProjectState
from django.utils import six
from boardinghouse.contrib.template.apps import check_template_pr... | schinckel/django-boardinghouse | tests/tests/test_contrib_template.py | Python | bsd-3-clause | 5,733 |
#!F:\microblog\flask\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==0.6c11','console_scripts','easy_install'
__requires__ = 'setuptools==0.6c11'
import sys
from pkg_resources import load_entry_point
sys.exit(
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
)
| pitch-sands/i-MPI | flask/Scripts/easy_install-script.py | Python | bsd-3-clause | 305 |
import urllib
from django import template
from django.utils.translation import ugettext as _
from django.utils.hashcompat import md5_constructor
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from avatar.settings import (AVATAR_GRAVATAR_BACKUP, AVATAR_GRAVATAR_DEFAULT,
... | bobkarreman/django-avatar | avatar/templatetags/avatar_tags.py | Python | bsd-3-clause | 3,060 |
"""Tests for cement.core.controller."""
from cement.core import exc, controller, handler
from cement.utils import test
from cement.utils.misc import rando, init_defaults
APP = "app-%s" % rando()[:12]
class TestController(controller.CementBaseController):
class Meta:
label = 'base'
arguments = [... | rjdp/cement | tests/core/controller_tests.py | Python | bsd-3-clause | 7,830 |
from fabric.api import local
def build():
local("nosetests")
local("cd bslint && pylint bslint -r n")
local("cd tests && pylint tests -r n")
| sky-uk/bslint | fabfile.py | Python | bsd-3-clause | 155 |
from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str,
super, zip)
from ..._utils import send_session_request
from ._ItemBase import ItemBase
class... | DavidWhittingham/agsadmin | agsadmin/sharing_admin/content/Item.py | Python | bsd-3-clause | 1,013 |
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.forms.models import ModelForm
from django.contrib.contenttypes.forms import BaseGenericInlineFormSet as OriginBaseGenericInlineFormSet
from is_core.forms.models import smartmodelformset_factory
from is_core.forms.formse... | matllubos/django-is-core | is_core/forms/generic.py | Python | bsd-3-clause | 2,883 |
import numpy as np
from Layers.layers import *
from utils import *
from cost_functions import *
from collections import defaultdict
from neuralnetwork.Optimizers.optimizers import *
from neuralnetwork.metrics import *
_optimizers = {'SGD':SGD, 'Nesterov':Nesterov, 'Adagrad':Adagrad, 'Adam':Adam, 'RMSProp':RMSProp}
_Cr... | prateekbhat91/Neural-Network | neuralnetwork/NeuralNetwork.py | Python | bsd-3-clause | 5,356 |
"""
modules collects tests for Styler methods which have been deprecated
"""
import numpy as np
import pytest
jinja2 = pytest.importorskip("jinja2")
from pandas import (
DataFrame,
IndexSlice,
NaT,
Timestamp,
)
import pandas._testing as tm
@pytest.fixture
def df():
return DataFrame({"A": [0, 1],... | jorisvandenbossche/pandas | pandas/tests/io/formats/style/test_deprecated.py | Python | bsd-3-clause | 4,300 |
#!/usr/bin/env python3
import sys, os
import argparse
#===============================================================================
# Process a directory.
#===============================================================================
def processDir(resultList, topDir, fileName, options):
sys.stderr.write("Sc... | Parrot-Developers/alchemy | scripts/findfiles.py | Python | bsd-3-clause | 3,887 |
"""
Topographica specific analysis commands, typically for measuring model
activity or weights.
It implements several Topographica specific measurement commands,
including weight matrix visualizations (e.g. update_projection).
"""
import numpy as np
import param
from param import ParameterizedFunction, ParamOverride... | Tasignotas/topographica_mirror | topo/analysis/command.py | Python | bsd-3-clause | 9,162 |
import gzip
import pandas as pd
import numpy as np
import pandas.util.testing as tm
import os
import dask
import pytest
from threading import Lock
import shutil
from time import sleep
import threading
import dask.array as da
import dask.dataframe as dd
from dask.dataframe.io import (from_array, from_bcolz, from_dask_a... | mikegraham/dask | dask/dataframe/tests/test_io.py | Python | bsd-3-clause | 34,901 |
#!/usr/bin/env python
from __future__ import absolute_import
from SuchTree.SuchTree import SuchTree, SuchLinkedTrees
| ryneches/SuchTree | SuchTree/__init__.py | Python | bsd-3-clause | 117 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hendrix.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| pablorecio/hendrix | hendrix/manage.py | Python | bsd-3-clause | 250 |
import datetime
import hashlib
import random
import re
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db import transaction
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
try:
from d... | jnns/django-registration | registration/models.py | Python | bsd-3-clause | 10,094 |
from flask import Blueprint
campaign_manager = Blueprint(
'campaign_manager',
__name__,
template_folder='templates',
static_folder='static',
static_url_path='/static'
)
from campaign_manager import api
from campaign_manager import views
| meomancer/field-campaigner | flask_project/campaign_manager/__init__.py | Python | bsd-3-clause | 259 |
from unittest import TestCase, main
from uritemplate import URITemplate, expand, partial
from uritemplate import variable
def merge_dicts(*args):
d = {}
for arg in args:
d.update(arg)
return d
class RFCTemplateExamples(type):
var = {'var': 'value'}
hello = {'hello': 'Hello World!'}
p... | pombredanne/uritemplate | tests/test_uritemplate.py | Python | bsd-3-clause | 16,567 |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | flgiordano/netcash | +/google-cloud-sdk/lib/surface/preview/app/gen_repo_info_file.py | Python | bsd-3-clause | 4,633 |
"""
.. _plot_stc:
=================
04. Plot contrast
=================
Group average of dSPM solutions obtained by :ref:`plot_events_inverse` for the
contrast between both types of faces together and scrambled at 170 ms
poststimulus. The image was produced by subtracting normalized solutions of
faces to the ones of ... | neuropycon/ephypype | doc/workshop/meg/04-plot_stc.py | Python | bsd-3-clause | 2,920 |
# you should change this
SECRET_KEY = 'pleasechangeme'
DATABASE_CONFIG = {
'host': '',
'database': "",
'user': "",
'password': ""
}
# maximum number of supporters being displayed
SUPPORTER_COUNT = 10000
# cache backend, comment out to disable
#CACHE_TYPE = 'memcached'
#CACHE_KEY_PREFIX = 'wwds_'
# number of se... | Netzfreiheit/wirwollendatenschutz.at | webapp/settings_sample.py | Python | bsd-3-clause | 391 |
# coding: utf-8
import datetime, hashlib, decimal
from sqlalchemy import sql, Column, String, Integer, Boolean, DateTime, Float, ForeignKey
from sqlalchemy.orm import relation, backref, column_property, synonym
from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
from tornado.options import options
fr... | cloudorz/apple | apps/models.py | Python | bsd-3-clause | 8,073 |
"""
byceps.services.shop.order.actions.revoke_tickets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Sequence
from .....typing import UserID
from ....ticketing.dbmodels.ticket import Ticket
fr... | homeworkprod/byceps | byceps/services/shop/order/actions/revoke_tickets.py | Python | bsd-3-clause | 1,398 |
""" Query modules mapping functions to their query strings
structured:
module_name { query_string: function_for_query }
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
# Standard imports
from future import standar... | sunil07t/e-mission-server | emission/core/wrapper/filter_modules.py | Python | bsd-3-clause | 7,125 |
import django
__doc__ = """Minimal django settings to run manage.py test command"""
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': __name__,
}
}
BROKER_BACKEND = 'memory'
ROOT_URLCONF = 'tests.urls'
from celery import current_app
CELERY_ALWAYS_EAGER = True
CELER... | makingspace/umeboshi | tests/settings.py | Python | bsd-3-clause | 960 |
Estatus = (
('Nueva', 'Nueva'),
('Alerta', 'Alerta'),
('Espera de refacciones', 'Espera de refacciones'),
('Terminada', 'Terminada'),
('Cancelada', 'Cancelada'),
('Especial', 'Especial'),
)
Servicio = (
('Icon', 'Icon'),
('Tecnoservicio', 'Tecnoservicio'),
)
Zonas = (
('Local', 'Local'),
('Foraneo', 'Forane... | zaresdelweb/tecnoservicio | tecnoservicio/ordenes/choices.py | Python | bsd-3-clause | 489 |
import sys
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
import argparse
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import SafeConfigParser as ConfigParser
import plac
if sys.version >= '3':
fro... | fprimex/plac_ini | plac_ini.py | Python | bsd-3-clause | 4,843 |
"""
BSD 3-Clause License
Copyright (c) 2017, Mairie de Paris
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
list of cond... | LouisTrezzini/projet-mairie | api/cli.py | Python | bsd-3-clause | 7,799 |
"""generalsolution.py - Holds the general solution base class
"""
#Author: Ian Huston
#For license and copyright information see LICENSE.txt which was distributed with this file.
import numpy as np
class GeneralSolution(object):
"""General solution base class."""
def __init__(self, fixture, srcclass)... | ihuston/pyflation | pyflation/solutions/generalsolution.py | Python | bsd-3-clause | 487 |
from django.core.urlresolvers import reverse
from django.shortcuts import redirect, get_object_or_404
from django.contrib.auth import authenticate, login, logout, REDIRECT_FIELD_NAME
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.decorators import login_required
from django.contrib.au... | matachi/django-userena | userena/views.py | Python | bsd-3-clause | 31,322 |
import mimpy.mesh.hexmesh as hexmesh
import mimpy.mfd.mfd as mfd
import numpy as np
res_mfd = mfd.MFD()
res_mfd.set_compute_diagonality(True)
res_mfd.set_m_e_construction_method(0)
#Define the permeability function
def K(p, i, j, k):
return np.eye(3)
#The exact solution.
def u(p):
return p[0]**2 + p[1]**2 +... | ohinai/mimpy | examples/hexmesh/example1/hexmesh_example_1.py | Python | bsd-3-clause | 1,798 |
#!/usr/bin/env python
import statsd
import os
import sys
import time
import math
import random
c=statsd.client.StatsClient(host='metric.server.com',port=8125)
#c=statsd.client.StatsClient(host='192.168.64.5',port=8125)
i = 0
while i < 10:
# time.sleep(1)
c.incr("dev.pandora.x1", random.choice(range(100)))
... | cychenyin/postmill | tests/teststatsd.py | Python | bsd-3-clause | 358 |
from __future__ import absolute_import, division, print_function
from .core import *
from .graph import *
from .sources import *
from .plugins import load_plugins
load_plugins(Stream)
try:
from .dask import DaskStream, scatter
except ImportError:
pass
__version__ = '0.6.1'
| mrocklin/streams | streamz/__init__.py | Python | bsd-3-clause | 286 |
# A sample test for the wc2 module.
import io
import unittest
from wc2 import count_lines_and_words
class CountLinesAndWordsTests(unittest.TestCase):
def test_returns_correct_lines_and_words_for_empty_file(self):
file = io.StringIO('')
lines, words = count_lines_and_words(file)
self.ass... | s3rvac/talks | 2017-03-07-Introduction-to-Python/demos/wc2_tests.py | Python | bsd-3-clause | 850 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import deviceusestatement
from .fhirdate import FHIRDate
class DeviceUseStatementTests(unittest.TestCase):
def instantiate_from(... | all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_4_0_0/models/deviceusestatement_tests.py | Python | bsd-3-clause | 1,718 |
from django.db import models
from djcat.attrs import djcat_attr
from .attrs import PriceAttribute
@djcat_attr()
class PriceField(models.IntegerField, PriceAttribute):
pass
| avigmati/djcat | tests/catalog/fields.py | Python | bsd-3-clause | 180 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 5, transform = "RelativeDifference", sigma = 0.0, exog_count = 100, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_RelativeDifference/trend_PolyTrend/cycle_5/ar_/test_artificial_128_RelativeDifference_PolyTrend_5__100.py | Python | bsd-3-clause | 274 |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | flgiordano/netcash | +/google-cloud-sdk/lib/surface/deployment_manager/deployments/describe.py | Python | bsd-3-clause | 3,853 |
# encoding: utf-8
"""
command.py
Created by Thomas Mangin on 2015-12-15.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
from exabgp.version import version as _version
def _extract_neighbors (command):
"""return a list of neighbor definition : the neighbor definition is a list of string which are in... | fugitifduck/exabgp | lib/exabgp/reactor/api/command.py | Python | bsd-3-clause | 15,510 |
"""
File: /src/SubversionDumpWriter.py
Project: Subversion Dump Editor
By: Tim Oram [t.oram@mitmaro.ca]
Website: http://www.mitmaro.ca/projects/svneditor/
http://code.google.com/p/svndumpeditor/
Email: svndump@mitmaro.ca
Created: June 26, 2009; Updated October 13, 2009
Purpose: The Su... | MitMaro/svndumpeditor | src/SubversionDumpWriter.py | Python | bsd-3-clause | 4,249 |
from django.conf import settings
from django.test import TestCase
from nose.util import resolve_name
__all__ = ('IP', 'PORT', 'SITE', 'DjangoTestCase')
IP = getattr(settings, 'TDDSPRY_IP', '127.0.0.1')
PORT = getattr(settings, 'TDDSPRY_PORT', 8088)
SITE = 'http://%s:%s/' % (IP, PORT)
DjangoTestCase = getattr(sett... | playpauseandstop/tddspry | tddspry/django/settings.py | Python | bsd-3-clause | 451 |
# -*- 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.
"""cros shell: Open a remote shell on the target device."""
from __future__ import print_function
import argparse
import sys
fr... | endlessm/chromium-browser | third_party/chromite/cli/cros/cros_shell.py | Python | bsd-3-clause | 7,169 |
# testing features, to be called by nosetests
import logging
import os
import shutil
import sys
import tempfile
import unittest
from fiona import collection
from fiona.collection import Collection
from fiona.ogrext import featureRT
#logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
class PointRoundTripTes... | johanvdw/Fiona | tests/test_feature.py | Python | bsd-3-clause | 4,428 |
import logging
import numpy as np
import os
import urllib
from scvi._utils import track
logger = logging.getLogger(__name__)
def _download(url: str, save_path: str, filename: str):
"""Writes data from url to file."""
if os.path.exists(os.path.join(save_path, filename)):
logger.info("File %s already ... | YosefLab/scVI | scvi/data/_built_in_data/_download.py | Python | bsd-3-clause | 1,426 |
"""
home.ts.graph
=============
A set of graph aggregation functions that are used to process the results so
we can display them in different ways. For example, rather than showing an
increasing total watts we can show how much was used in the hour.
"""
from datetime import timedelta, datetime
from decimal import Dec... | d0ugal-archive/home | home/ts/graph.py | Python | bsd-3-clause | 1,694 |
# project
from checks import AgentCheck
from util import headers
# 3rd party
import requests
class Etcd(AgentCheck):
DEFAULT_TIMEOUT = 5
SERVICE_CHECK_NAME = 'etcd.can_connect'
STORE_RATES = {
'getsSuccess': 'etcd.store.gets.success',
'getsFail': 'etcd.store.gets.fail',
'setsSuc... | JohnLZeller/dd-agent | checks.d/etcd.py | Python | bsd-3-clause | 4,656 |
# -*- coding: utf-8 -*-
import json
from django.http import HttpResponse
import mock
import pytest
import requests
import settings
from olympia import amo
from olympia.amo.tests import addon_factory
from olympia.discovery.models import DiscoveryItem
from olympia.discovery.utils import (
call_recommendation_serve... | atiqueahmedziad/addons-server | src/olympia/discovery/tests/test_utils.py | Python | bsd-3-clause | 5,920 |
from django.conf.urls.defaults import patterns, url
import django.views.generic as gen_views
from main.models import *
urlpatterns = patterns('',
url(r'^submit/$', 'valuate.views.submit', name = 'valuate-submit'),
)
| crodjer/django-valuate | valuate/urls.py | Python | bsd-3-clause | 225 |
from django.core.management.base import BaseCommand, CommandError
from cablegate.cable.models import Cable, CableMetadata
class Command(BaseCommand):
#args = '<poll_id poll_id ...>'
#help = 'Closes the specified poll for voting'
def handle(self, *args, **options):
for cable in Cable.objects.filter... | h3/django-cablegate | cablegate/cable/management/commands/cable_sync_metadata.py | Python | bsd-3-clause | 575 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import struct
TYPE_BYTE = "\x00" #unsigned byte
TYPE_BYTE_MINUS = "\x01" #unsigned byte
TYPE_SHORT = "\x10" #unsigned short
TYPE_SHORT_MINUS = "\x11" #unsigned short
TYPE_INT = "\x20" #unsigned int
TYPE_INT_MINUS = "\x21" #unsigned int
TYPE_LONG = "\x30" #signed ... | pyzzz/packobj | packobj.py | Python | bsd-3-clause | 4,657 |
from unittest import SkipTest
from django.contrib.auth import get_user_model
from django.core import mail
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
from django.utils import timezone
from django.utils.six import with_metaclass
from ..forms import P... | brutasse/django-password-reset | password_reset/tests/tests.py | Python | bsd-3-clause | 13,996 |
from __future__ import absolute_import, print_function
import base64
import logging
import six
import traceback
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.http import HttpResponse, H... | zenefits/sentry | src/sentry/web/api.py | Python | bsd-3-clause | 20,701 |
#!/usr/bin/python
import sys
import subprocess
import os
import re
import platform
import argparse
from subprocess import call
g_engine_dir_name="dava.framework"
g_framework_path = ""
g_toolchains_full_path = ""
g_toolchains_relative_framework_path = "Sources/CMake/Toolchains/"
g_ios_toolchain = "ios.toolchain.cmake"
... | dava/dava.engine | RepoTools/Scripts/dava_gen.py | Python | bsd-3-clause | 6,766 |
import datetime
import sys
from django.core.mail import send_mail
from django.core.management.base import BaseCommand
from pytz import timezone
from dojo.models import ScanSettings, Product
from django.conf import settings
from dojo.utils import get_system_setting
locale = timezone(get_system_setting('time_zone'))
... | OWASP/django-DefectDojo | dojo/management/commands/notify_isoc.py | Python | bsd-3-clause | 2,456 |
import os
class Corpus(object):
def __init__(self):
current_directory = os.path.dirname(__file__)
self.data_directory = os.path.join(current_directory, 'data')
def get_file_path(self, dotted_path, extension='json'):
"""
Reads a dotted file path and returns the file path.
... | maclogan/VirtualPenPal | chatterbot/corpus/corpus.py | Python | bsd-3-clause | 2,215 |
"""Common code/data-structures used throughout the program.
"""
| pradyunsg/Py2C | py2c/common/__init__.py | Python | bsd-3-clause | 64 |
import errno
import logging
import os
from six.moves import reload_module as reload
import sys
import warnings
import numpy
import theano
from theano import config
from theano.compat import reload
from theano.gof.compilelock import get_lock, release_lock
from theano.gof import cmodule
_logger = logging.getLogger('t... | cmdunkers/DeeperMind | PythonEnv/lib/python2.7/site-packages/theano/scan_module/scan_perform_ext.py | Python | bsd-3-clause | 5,781 |
# -*-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/reseau/connexions/__init__.py | Python | bsd-3-clause | 1,986 |
#!/usr/bin/env python
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] tags will be kept. ... | team-vigir/vigir_behaviors | behaviors/vigir_behavior_steering_calibration/src/vigir_behavior_steering_calibration/steering_calibration_sm_tmp.py | Python | bsd-3-clause | 4,279 |
"""Python multiprocessing fork with improvements and bugfixes"""
#
# Package analogous to 'threading.py' but using processes
#
# multiprocessing/__init__.py
#
# This package is intended to duplicate the functionality (and much of
# the API) of threading.py but uses processes instead of threads. A
# subpackage 'multipr... | mozilla/firefox-flicks | vendor-local/lib/python/billiard/__init__.py | Python | bsd-3-clause | 7,879 |
#!/usr/bin/python
import os
import plistlib
import re
import subprocess
import sys
if os.geteuid() != 0:
os.execvp("sudo", ["sudo"] + sys.argv)
interfacelist = subprocess.Popen(["/usr/sbin/networksetup","-listallhardwareports"], stdout=subprocess.PIPE).communicate()[0]
try:
interface = re.search('Wi-Fi\nDevice:... | mubix/osx-wificleaner | osx_wificleaner.py | Python | bsd-3-clause | 1,304 |
"""Adding DB functions for code_id lookup and determining participant ethnicity
Revision ID: 335d191204c1
Revises: 1e944af3ad04
Create Date: 2019-01-10 13:05:48.899901
"""
from alembic import op
from rdr_service.dao.alembic_utils import ReplaceableObject
# revision identifiers, used by Alembic.
revision = "335d1912... | all-of-us/raw-data-repository | rdr_service/alembic/versions/335d191204c1_adding_db_functions_for_code_id_lookup_.py | Python | bsd-3-clause | 2,941 |
# 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 auto_nag.bzcleaner import BzCleaner
class FeatureRegression(BzCleaner):
def __init__(self):
super(Fea... | mozilla/bztools | auto_nag/scripts/feature_regression.py | Python | bsd-3-clause | 746 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import os
import pexpect
import db_utils as dbutils
def before_all(context):
"""
Set env parameters.
"""
os.environ['LINES'] = "50"
os.environ['COLUMNS'] = "120"
context.exit_sent = False
... | j-bennet/pgcli | features/environment.py | Python | bsd-3-clause | 2,076 |
import os
import sys
import pygame
import copy
from pygame.locals import *
import drawable
import util
import energybar
import mapitem
from common.constants import *
from client.constants import *
from common import boundint
from common.util.rect import Rect
class MapStructure(mapitem.MapItem):
def __init__(s... | Wopple/fimbulvetr | src/client/mapstructure.py | Python | bsd-3-clause | 5,607 |
"""Autogenerated file - DO NOT EDIT
If you spot a bug, please report it on the mailing list and/or change the generator."""
from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath
import os
from nipype.interfaces.slicer.base... | christianbrodbeck/nipype | nipype/interfaces/slicer/segmentation/confidenceconnected.py | Python | bsd-3-clause | 2,752 |
from gopigo import *
import urllib
import urllib2
import json
import time
import logging
def main():
status = getStatus()
if status == 'gopi':
# Execute robot command
print("execute robot")
skynet()
normal() #return back to waiting
main() #recursive meth... | ksuscella/GoKirkGo | droid.py | Python | bsd-3-clause | 2,214 |
from django.template.loaders.app_directories import Loader as DjangoLoader
from djinja2.loaders import Jinja2Loader
class Loader(Jinja2Loader, DjangoLoader):
pass
| comoga/django-djinja2 | djinja2/loaders/app_directories.py | Python | bsd-3-clause | 170 |
#!/usr/bin/env python
#
# Copyright (c) 2014, Cloud Academy, Inc.
# Author: Giacomo Marinangeli <giacomo@cloudacademy.com>
# 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 ... | cloudacademy/python-api-client | cloudacademy/exceptions.py | Python | bsd-3-clause | 1,711 |
# Shift all data uniformly (it is a rolling shift).
#
# Developed as part of the tomviz project (www.tomviz.com).
def transform(dataset, shift=[0, 0, 0]):
import numpy as np
data_py = dataset.active_scalars # Get data as numpy array.
if data_py is None: #Check if data exists
raise RuntimeError("... | OpenChemistry/tomviz | tomviz/python/Shift_Stack_Uniformly.py | Python | bsd-3-clause | 580 |
# -*- coding: utf-8 -*-
"""
happycube.services
~~~~~~~~~~~~~
core module
"""
from happycube.database import db
class BaseService(object):
"""A :class:`Service` instance encapsulates common SQLAlchemy model
operations in the context of a :class:`Flask` application.
"""
__model__ = None
... | happycube-timer/happycube-backend | happycube/service.py | Python | bsd-3-clause | 3,781 |
#!/usr/bin/env python
'''
Python functions to create ImageJ macro that opens files and aligns them based on specified ROI coordinate-based lines
# (1) Open imagej, record macro and draw ROI lines on each image - store the position of the roi line in a file called homepath + 'Positions/'+ layer + prefix + 'positions.tx... | MattNolanLab/Ramsden_MEC | ABAFunctions/ABA_Alignment.py | Python | bsd-3-clause | 4,921 |
from setuptools import setup, find_packages
setup(
name="django-preferences",
version="1.0.0",
description="Django app allowing users to set app specific preferences through the admin interface.",
long_description=open("README.rst", "r").read() + open("AUTHORS.rst", "r").read() + open("CHANGELOG.rst", ... | praekelt/django-preferences | setup.py | Python | bsd-3-clause | 1,412 |
#-*- coding: utf-8 -*-
"""
Cache config
"""
from __future__ import absolute_import, division, print_function, unicode_literals
class CacheDev(object):
"""
Defines list of caches for development purposes:
- default: ``DummyCache``
- locmem: ``LocMemCache``
- dummy: ``DummyCache``
... | nigma/django-common-configs | common_configs/services/cache.py | Python | bsd-3-clause | 650 |
# -*- coding: utf-8 -*-
"""
Created on Thu May 19 08:50:37 2016
@author: Stella Psomadaki
"""
import pointcloud.reader as reader
from pointcloud.test.Validator import Validate
from pointcloud.general import getFiles, SRID
import numpy as np
import sys
import time
def load(ini):
initialise = Valida... | stpsomad/DynamicPCDMS | pointcloud/test/las2txyz.py | Python | isc | 2,142 |
"""
Logics applies to multiple models can be put here
"""
from sqlalchemy import event
from datetime import datetime
import re
from psi.app.models import Customer, Supplier, Product
@event.listens_for(Customer, 'before_insert')
@event.listens_for(Customer, 'before_update')
@event.listens_for(Supplier, 'before_inser... | betterlife/psi | psi/app/models/aspects.py | Python | mit | 1,399 |
#!/usr/bin/python
#The file accepts new job and create new VM with the job configuration based on the availability of hardware
#This is the part of VM placement and scaling
#This takes the VM guest configuration file from the local disk and create a new VM in current node or in a different one
import sys, getopt, sub... | OnePaaS/virtdc | framework/VM_submitJob.py | Python | mit | 8,022 |