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
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # 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.apach...
sacharya/nova
nova/api/openstack/compute/plugins/v3/simple_tenant_usage.py
Python
apache-2.0
11,969
"""Implementation of odin_data Meta Writer This module is passed meta data messages for a single acquisition which it writes to disk. Will need to be subclassed by detector specific implementation. Matt Taylor, Diamond Light Source """ import os from time import time import logging import h5py from odin_data import...
percival-detector/odin-data
tools/python/odin_data/meta_writer/meta_writer.py
Python
apache-2.0
18,528
from app import app from flaskext.mysql import MySQL from flask_jwt_extended import JWTManager mysql = MySQL() # MySQL configurations app.config['MYSQL_DATABASE_USER'] = 'dev' app.config['MYSQL_DATABASE_PASSWORD'] = '123456' app.config['MYSQL_DATABASE_DB'] = 'MoviesDB' app.config['MYSQL_DATABASE_HOST'] = '172.19.0.2'...
CALlanoR/virtual_environments
web/python/flask_api_mysql_pagination/movies_api/db_config.py
Python
apache-2.0
577
# -*- coding: utf-8 -*- import ads from jinja2 import Environment, FileSystemLoader env = Environment(loader=FileSystemLoader('')) ads.config.token = '7scWI1Z2A8kPAukKoYUPKyzlQqn3eSY1m4r0QCTo' all_query = 'author:"duncan, k" year:2013-2020 database:astronomy property:refereed' first_author = 'author:"^duncan, k" yea...
dunkenj/dunkenj.github.io
old/process_ads.py
Python
apache-2.0
647
class SensorType(): TEMPERATURE = "TEMPERATURE" # Celsius degree (C) HUMIDITY = "HUMIDITY" # percent (%) TEMP_HUM = "TEMP_HUM" LUX = "LUX" # lux MOTION = "MOTION" # boolean DISTANCE = "DISTANCE" # centimeter (cm) POWER = "POWER" # Watt (W) CURRENT = "CURRENT" # Amper...
egottcha/AHEaD
node/sensor/sensor_type.py
Python
apache-2.0
326
import copy import logging from great_expectations.datasource.data_connector.configured_asset_sql_data_connector import ( ConfiguredAssetSqlDataConnector, ) from great_expectations.datasource.new_datasource import BaseDatasource logger = logging.getLogger(__name__) class SimpleSqlalchemyDatasource(BaseDatasourc...
great-expectations/great_expectations
great_expectations/datasource/simple_sqlalchemy_datasource.py
Python
apache-2.0
3,666
# -*- coding: utf-8 -*- """Composing task work-flows. .. seealso: You should import these from :mod:`celery` and not this module. """ from __future__ import absolute_import, unicode_literals import itertools import operator from collections import deque from copy import deepcopy from functools import partial as ...
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/celery/canvas.py
Python
apache-2.0
55,734
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
crashlytics/aurora
src/main/python/apache/aurora/client/cli/jobs.py
Python
apache-2.0
27,008
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
polyaxon/polyaxon
traceml/traceml/artifacts/__init__.py
Python
apache-2.0
727
import time from network.cluster_managers import google_compute_cluster_manager as gccm cm = gccm.GoogleComputeClusterManager() cm.Initialize('bats','12345','32123') cm.Heartbeat() cm.ListInstanceNames() last = '' print 'NumInstances: %i' % cm.NumInstances() for instance in cm.ListInstanceNames(): print ' > %s' ...
timblakely/bigbrain
bigbrain/test.py
Python
apache-2.0
1,684
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
GoogleCloudPlatform/cloud-opensource-python
badge_server/test_badge_server.py
Python
apache-2.0
18,516
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
google-research/google-research
simulation_research/traffic/random_traffic_generator_test.py
Python
apache-2.0
13,728
""" Django settings for sampleapp project. Generated by 'django-admin startproject' using Django 1.8.1. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pa...
catalyzeio/python-sample-app
sampleapp/settings.py
Python
apache-2.0
2,799
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
bolkedebruin/airflow
airflow/jobs/scheduler_job.py
Python
apache-2.0
57,604
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
naturali/tensorflow
tensorflow/contrib/framework/python/ops/variables.py
Python
apache-2.0
22,660
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
skuda/client-python
kubernetes/test/test_v2alpha1_horizontal_pod_autoscaler_spec.py
Python
apache-2.0
1,023
# Copyright 2012-2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
NeCTAR-RC/ceilometer
ceilometer/openstack/common/rpc/proxy.py
Python
apache-2.0
9,459
import pickle import pandas as pd import numpy as np import random import cv2 import glob import tensorflow as tf from tensorflow.contrib.layers import flatten from tensorflow.contrib.layers import flatten from sklearn.utils import shuffle def grayscale(input_image): output = [] for i in range(l...
tranlyvu/autonomous-vehicle-projects
Traffic Sign Classifier/src/second_attempt.py
Python
apache-2.0
8,997
# -*- encoding: utf-8 -*- from dateutil.relativedelta import relativedelta from django.core.exceptions import ValidationError from django.db import models from django.db.models import Q from django.utils import timezone from reversion import revisions as reversion from base.model_utils import TimeStampedModel from bas...
pkimber/booking
booking/models.py
Python
apache-2.0
10,565
import couchdb import matplotlib.pyplot as plt from matplotlib.path import Path import matplotlib.patches as patches import json import matplotlib.path as mplPath import numpy as np import requests from textblob import TextBlob import Queue import time, socket, threading import re from pycorenlp import StanfordCoreNLP ...
COMP90024CloudComputing/Submit_Cloud_Computing
analysis.py
Python
apache-2.0
8,425
import base64 import json import os import re from moto.core import ACCOUNT_ID from moto.core.responses import BaseResponse from moto.kms.utils import RESERVED_ALIASES from .models import kms_backends from .exceptions import ( NotFoundException, ValidationException, AlreadyExistsException, NotAuthorize...
spulec/moto
moto/kms/responses.py
Python
apache-2.0
19,277
# Copyright (c) 2014 Rackspace US, 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 req...
openstack/octavia
octavia/certificates/common/local.py
Python
apache-2.0
3,779
from __future__ import unicode_literals import datetime import django from django.test import TestCase from django.utils.timezone import utc from mock import MagicMock, patch import job.clock as clock import job.test.utils as job_test_utils from job.clock import ClockEventError, ClockEventProcessor from trigger.model...
ngageoint/scale
scale/job/test/test_clock.py
Python
apache-2.0
11,453
# Copyright 2016 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 agre...
jettisonjoe/openhtf
test/output/callbacks/callbacks_test.py
Python
apache-2.0
6,095
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of ...
jcfr/girder
plugins/jobs/server/__init__.py
Python
apache-2.0
871
import importlib import os import sys here = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def get_version() -> str: """ Return version. """ sys.path.insert(0, here) return importlib.import_module("a2wsgi").__version__ os.chdir(here) os.system(f"poetry version {get_version()}") os...
abersheeran/a2wsgi
script/version.py
Python
apache-2.0
509
""" .. module: lemur.models :platform: Unix :synopsis: This module contains all of the associative tables that help define the many to many relationships established in Lemur :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor::...
kevgliss/lemur
lemur/models.py
Python
apache-2.0
8,273
#!/usr/bin/env python # created by Glenn P. Edwards Jr. # http://hiddenillusion.blogspot.com # @hiddenillusion # Version 0.1 # Date: 07-23-2013 # (while at FireEye) from __future__ import print_function from __future__ import unicode_literals import os import re import sys import time try: from Registry ...
williballenthin/python-registry
samples/forensicating.py
Python
apache-2.0
11,552
#!/usr/bin/env python # # Copyright 2015 Netherlands eScience Center <info@esciencecenter.nl> # # 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....
nlesc-sherlock/analyzing-corpora
scripts/corpus_to_sparse.py
Python
apache-2.0
1,290
# Copyright 2009-2010 by Ka-Ping Yee # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
Princessgladys/googleresourcefinder
lib/feedlib/geo.py
Python
apache-2.0
2,777
""" genomescan module """ import os, sys import time import fasta, genscan, sequence from useful import smartopen from useful import multipart def genomescan(dna, protein, description='', email='', oFileHandle=None, proxy='wehiproxy.alpha.wehi.edu.au', proxyPort=3128, debug=False): """ @param dna: DN...
PapenfussLab/Mungo
mungo/genomescan.py
Python
artistic-2.0
6,090
"""assist version version_info conforms to PEP 386 (major, minor, micro, alpha/beta/rc/final, #) (1, 1, 2, 'alpha', 0) => "1.1.2.dev" (1, 2, 0, 'beta', 2) => "1.2b2" """ VERSION_INFO = (0, 0, 1, 'beta', 5) def get_version(): """Return a PEP-386 compliant version number from version_info.""" assert len(VER...
jmlopez-rod/assist
assist/__version__.py
Python
bsd-2-clause
815
import numpy import cache import open3dhub def sirikata_bounds(boundsInfo): minpt, maxpt = boundsInfo['bounds'] minpt, maxpt = numpy.copy(minpt), numpy.copy(maxpt) center = boundsInfo['center'] center_distance = boundsInfo['center_farthest_distance'] # center the bounding box minpt -...
sirikata/scene-generator
scene.py
Python
bsd-2-clause
4,096
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('views', url(r'^admin/', include(admin.site.urls)), url(r'^invite/', include('inviteme.urls')), url(r'^$', 'homepage_v', name='homepage'), )
danirus/django-inviteme
demo/urls.py
Python
bsd-2-clause
299
# generator functions def f1(): l = [] for i in range(1000): l.append(i) return l def f2(): for i in range(1000): yield i # yield ulatama # for i in f1(): # print i # # to iterate = # for i in f2(): # print i print f1() print f2()
khchine5/book
docs/dev/newbies/4.py
Python
bsd-2-clause
280
import logging from itertools import groupby from sqlalchemy import sql from sqlalchemy import orm from sqlalchemy.types import Integer from amnesia.modules.folder import Folder log = logging.getLogger(__name__) __all__ = ['get_lineage', 'get_children_containers'] class FolderHierarchy: def __init__(self, ...
silenius/amnesia
amnesia/modules/folder/services.py
Python
bsd-2-clause
3,159
# -*- coding: utf-8 -*- import sys from sklearn.decomposition import PCA import numpy as np from parse_tree import Node def create_leaf2vect(root, k): leaf2vect = {} stack = [root] size = -1 while len(stack) > 0: node = stack.pop(0) vect = np.array(map(lambda x: int(x), node.annotation...
murawaki/lexwave
cossim.py
Python
bsd-2-clause
1,265
import asyncio import click import logging import sys import time from os.path import expanduser from . import config as peerme_config from . import peeringdb_mysql from . import peeringdb_api from . import euroix_json from .commands.generate import GenerateConfigCli from .commands.discover import DiscoverCli from .co...
cooperlees/peerme
peerme/main.py
Python
bsd-2-clause
3,155
import subprocess import math def launch(script_name, num_partitions, num_machines, pos, coordinator, machine_name, debug=False): if num_machines > num_partitions: raise RuntimeError("Need more partitions than machine") machine_size = int(math.ceil(float(num_partitions) / float(num_machines))) sta...
kaimast/inanutshell
linear/common/launch.py
Python
bsd-2-clause
842
# Copyright (c) 2013, Bob Van Zant <bob@veznat.com> # All rights reserved. # # See LICENSE file for full license. import warnings from . import AWSHelperFn, AWSObject, AWSProperty, Tags from .validators import boolean, positive_integer, s3_bucket_name from .validators import s3_transfer_acceleration_status try: f...
pas256/troposphere
troposphere/s3.py
Python
bsd-2-clause
11,735
import re import logging from django.template.loader import get_template from django.core.cache import cache from django.core.mail import mail_admins from django.contrib.auth import get_user_model from django.views.decorators.debug import sensitive_variables MAX_LOGIN_ATTEMPTS = 5 MAX_LOGIN_ATTEMPTS_KEY = '%s_%s_logi...
chop-dbhi/biorepo-portal
accounts/utils.py
Python
bsd-2-clause
4,673
from flask import render_template, jsonify, url_for, abort, request, redirect, current_app from flask_wtf import Form from flask_user import current_user from silverflask import db from silverflask.models import User from silverflask.fields import GridField from silverflask.core import Controller from silverflask.cont...
wolfv/SilverFlask
silverflask/controllers/security_controller.py
Python
bsd-2-clause
1,824
""" ====================== Create a static viewer ====================== A static viewer is a brain viewer that exists permanently on a filesystem The viewer is stored in a directory that stores html, javascript, data, etc The viewer directory must be hosted by a server such as nginx """ import cortex import numpy...
gallantlab/pycortex
examples/webgl/static.py
Python
bsd-2-clause
675
""" flexx.ui GUI toolkit based on web technology with a Pythonic API. """ # We follow the convention of having one module per widget class (or a # small set of closely related classes). In order not to pollute this # namespace, we prefix the module names with an underscrore. from ._widget import Widget from ._layou...
almarklein/flexx
flexx/ui/__init__.py
Python
bsd-2-clause
725
#!/usr/bin/python import os import sys import cmd import boto from utils import info, error, prompt from utils import green _context_cache = {} class AWSAdmin(object, cmd.Cmd): def __init__(self): cmd.Cmd.__init__(self) self.context = None @property def _ready(self): return os.e...
lonetwin/botosh
botosh/aws_admin.py
Python
bsd-2-clause
3,229
from django.contrib import admin from StackSmash.apps.blog.models import Post, Comment class PostAdmin(admin.ModelAdmin): list_display = ['title'] list_filter = ['listed', 'pub_date'] search_fields = ['title', 'content'] date_heirachy = 'pub_date' save_on_top = True prepopulated_fields = {"slu...
Justasic/StackSmash
StackSmash/apps/blog/admin.py
Python
bsd-2-clause
509
""" Concurrent queries ++++++++++++++++++ Send multiple SNMP GET requests at once using the following options: * with SNMPv2c, community 'public' * over IPv4/UDP * to multiple Agents at demo.snmplabs.com * for instance of SNMPv2-MIB::sysDescr.0 MIB object * based on asyncio I/O framework Functionally similar to: | ...
etingof/pysnmp
examples/hlapi/v1arch/asyncio/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py
Python
bsd-2-clause
1,582
import datetime import re import binascii import random import string import logging from django import forms from django.db import models from django.forms import fields from django.utils.encoding import force_text, smart_bytes import sys from core.encryption.Factories import FactoryEncryptionServices as efac from c...
chop-dbhi/ehb-service
ehb_service/apps/core/encryption/encryptionFields.py
Python
bsd-2-clause
8,789
from __future__ import unicode_literals import os import sys from warnings import warn from django import VERSION from django.conf import global_settings as defaults from django.template.base import add_to_builtins from mezzanine.utils.importing import path_for_import from mezzanine.utils.timezone import get_best_lo...
Kniyl/mezzanine
mezzanine/utils/conf.py
Python
bsd-2-clause
11,932
import spyder import movingpanda_datamodel import Spyder pandadict = {} # First panda class a = Spyder.AxisSystem() a *= 0.005 data = "models/panda-model", "egg", [("walk", "models/panda-walk4", "egg")], a box = Spyder.Box2D(50, 470, 96, 96) image = "pandaicon.png", True hivemap = "pandawalk.web" pandadict["pandaclas...
agoose77/hivesystem
manual/movingpanda/panda-finalweb.py
Python
bsd-2-clause
1,591
import hashlib import apysigner import re from generic_request_signer import constants def generate_hash_for_binary(binary_data): return {'binary_data': hashlib.md5(str.encode(binary_data)).hexdigest()} def check_signature_for_binary(signature, private_key, full_path, binary): binary_hash = generate_hash_f...
imtapps/generic-request-signer
generic_request_signer/check_signature.py
Python
bsd-2-clause
2,169
API_XML_NSMAP = { "csw": "http://www.opengis.net/cat/csw/2.0.2", "dc": "http://purl.org/dc/elements/1.1/", "dct": "http://purl.org/dc/terms/", "geonet": "http://www.fao.org/geonetwork", "xsi": "http://www.w3.org/2001/XMLSchema-instance", } LINKED_XML_NSMAP = { "csw": "http://www.opengis.net/cat...
opendatatrentino/opendata-harvester
harvester_odt/pat_geocatalogo/constants.py
Python
bsd-2-clause
669
from setuptools import find_packages from distutils.core import setup from pretty_times import VERSION REQUIREMENTS = [] TEST_REQUIREMENTS = [ 'coverage', 'pep8', 'pyflakes', 'nose', 'nosexcover', ] def do_setup(): setup( name="pretty-times", version=VERSION, author...
nixon/pretty
setup.py
Python
bsd-2-clause
725
#!/usr/bin/env python # -*- coding: utf-8 -*- import csv import sys from apiclient.http import MediaFileUpload import apiclient.errors import urllib import requests import json import pprint import logging logger = logging.getLogger("gdput") #logger.setLevel(logging.ERROR) import random import os import json from ...
commonssibi/gdcmdtools
gdcmdtools/put.py
Python
bsd-2-clause
15,440
# -*- coding: UTF-8 -*- # Copyright 2016-2020 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) """ The default :attr:`workflows_module <lino.core.site.Site.workflows_module>` for :ref:`tera` applications. This workflow requires that both :mod:`lino_xl.lib.cal` and :mod:`lin...
lino-framework/tera
lino_tera/lib/tera/workflows.py
Python
bsd-2-clause
1,350
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Anima Istanbul # # This module is part of anima-tools and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause import logging from anima import logger from anima.env.mayaEnv import Maya from anima.utils import do_db_setup def set_qt_...
sergeneren/anima
anima/ui/scripts/maya.py
Python
bsd-2-clause
1,800
""" C parsing logic. The C parsing is implemented in a recursive descent parser. The following parts can be distinguished: - Declaration parsing: parsing types and declarations - Statement parsing: dealing with the C statements, like for, if, etc.. - Expression parsing: parsing the C expressions. Sources of inspirat...
windelbouwman/ppci-mirror
ppci/lang/c/parser.py
Python
bsd-2-clause
44,157
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright (c) 2016 ASMlover. 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 copyrig...
ASMlover/study
python/proto/pyRpc/logger.py
Python
bsd-2-clause
1,837
#!/usr/bin/python #-*- coding: utf-8 -*- from django.core.management.base import BaseCommand from django.apps import apps class Command(BaseCommand): def handle(self, *args, **options): app_models = apps.get_app_config('presentation').get_models() for model in app_models: model.objects...
Zalewa/doomstats
presentation/management/commands/destroy_presentation.py
Python
bsd-2-clause
336
# -*- coding: utf-8 -*- # # pysdn documentation build configuration file, created by # sphinx-quickstart on Wed Aug 5 08:56:12 2015. # # 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 # autogenerated file. # # All...
brocade/pysdn
docs/source/conf.py
Python
bsd-3-clause
9,179
from __future__ import print_function import Tkinter as tk import ttk import tkMessageBox import tkFileDialog import os.path DEFAULT_COLUMNS = 3 class SectionLabel(object): def __init__(self, text): self.text = text def body(self, master, row, columns=DEFAULT_COLUMNS, **kwargs): label = ttk....
FowlerLab/Enrich2
enrich2/gui/dialog_elements.py
Python
bsd-3-clause
10,805
import copy import json import re from crispy_forms.bootstrap import InlineField from crispy_forms.helper import FormHelper from crispy_forms import layout as crispy from crispy_forms import bootstrap as twbscrispy from corehq.apps.style import crispy as hqcrispy from django.core.urlresolvers import reverse from django...
qedsoftware/commcare-hq
corehq/apps/reminders/forms.py
Python
bsd-3-clause
100,432
#!/usr/bin/python # # Copyright 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. # """Decoder Generator script. Usage: generate-decoder.py <table-file> <output-cc-file> <decoder-name> \ <options> Options...
nacl-webkit/native_client
src/trusted/validator_arm/generate_decoder.py
Python
bsd-3-clause
7,502
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig from erasmus.db import db from botus_receptus.config import load from pathlib import Path # this is the Alembic Config object, which provides # access to the values w...
bryanforbes/Erasmus
alembic/env.py
Python
bsd-3-clause
2,487
from decimal import Decimal from livesettings import config_value from tax.modules.base.processor import BaseProcessor class Processor(BaseProcessor): method="percent" #def __init__(self, order=None, user=None): # """ # Any preprocessing steps should go here # For instance, copyi...
ringemup/satchmo
satchmo/apps/tax/modules/percent/processor.py
Python
bsd-3-clause
2,581
#!/usr/bin/env python __author__ = 'Jamie Diprose' import rospy from sensor_msgs.msg import JointState from ros_pololu_servo.msg import servo_pololu import math class EinsteinController(): def __init__(self): rospy.init_node('einstein_controller') rospy.Subscriber("joint_angles", JointState, self...
jdddog/einstein_robot
einstein_driver/src/einstein_controller.py
Python
bsd-3-clause
1,255
# -*- coding: utf-8 -*- # Scrapy settings for bigghosthead project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/l...
baijiege9/BigGhostHead
www/bigghosthead/bigghosthead/settings.py
Python
bsd-3-clause
4,986
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('contacts', '0020_unset_suspend_from_dynamic'), ] operations = [ migrations.AddField( model_name='contact', ...
xkmato/casepro
casepro/contacts/migrations/0021_contact_is_stopped_pt1.py
Python
bsd-3-clause
745
from settings import * PROJECT = 'drawquest' CANVAS_SUB_SITE = '/admin/' if PRODUCTION: DOMAIN = "example.com" SELF_PORT = 9000 SELF = 'localhost:9000' UGC_HOST = 'i.canvasugc.com' FACEBOOK_APP_ACCESS_TOKEN = "REDACTED" FACEBOOK_APP_ID = "REDACTED" FACEBOOK_APP_SECRET = "REDACTED" FAC...
canvasnetworks/canvas
website/settings_drawquest.py
Python
bsd-3-clause
8,754
import unittest import scipy from SloppyCell.ReactionNetworks import * lorenz = Network('lorenz') lorenz.add_compartment('basic') lorenz.add_species('x', 'basic', 0.5) lorenz.add_species('y', 'basic', 0.5) lorenz.add_species('z', 'basic', 0.5) lorenz.add_parameter('sigma', 1.0) lorenz.add_parameter('r', 2.0) lorenz....
GutenkunstLab/SloppyCell
test/test_FixedPoints.py
Python
bsd-3-clause
3,610
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from corehq.doctypemigrations.djangomigrations import assert_initial_complete from corehq.doctypemigrations.migrator_instances import users_migration from corehq.sql_db.operations import HqRunPython class Migration(migra...
qedsoftware/commcare-hq
corehq/doctypemigrations/migrations/0004_auto_20151001_1809.py
Python
bsd-3-clause
527
""" Invoke - Tasks ============== """ from __future__ import annotations from invoke import Context, task __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ =...
colour-science/colour-science.org
tasks.py
Python
bsd-3-clause
2,657
from __future__ import absolute_import,unicode_literals import datetime from operator import attrgetter import pickle import sys from django.conf import settings from django.core.exceptions import FieldError from django.db import DatabaseError, connection, connections, DEFAULT_DB_ALIAS from django.db.models import Co...
vsajip/django
tests/regressiontests/queries/tests.py
Python
bsd-3-clause
87,329
#-------------------------------------------------------------------------- # NAME : spiketrains_utils.py: # DESCRIPTION : routines for generating and binning time series, extracting # information and generating surrogates # AUTHOR : Emiliano Torre # CREATED : September 12, 2012 #----...
SPP1665DataAnalysisCourse/elephant
elephant/surrogates.py
Python
bsd-3-clause
15,562
import graphene from .account.schema import AccountMutations, AccountQueries from .checkout.schema import CheckoutMutations, CheckoutQueries from .core.schema import CoreMutations from .discount.schema import DiscountMutations, DiscountQueries from .menu.schema import MenuMutations, MenuQueries from .order.schema impo...
UITools/saleor
saleor/graphql/api.py
Python
bsd-3-clause
1,246
""" Timer inspired by http://stackoverflow.com/questions/5849800/tic-toc-functions-analog-in-python Usage : with Timer('foo_stuff'): # do some foo # do some stuff """ import time from constant import * class Timer(object): def __init__(self, name=None): self.name = name def __ent...
cyrobin/patrolling
timer.py
Python
bsd-3-clause
580
# -*- coding: utf-8 -*- """ Plugin that logs the current optimum to standard output. """ # Future from __future__ import absolute_import, division, print_function, \ unicode_literals, with_statement # First Party from metaopt.plugin.plugin import Plugin class OptimumPrintPlugin(Plugin): """ Logs new opti...
cigroup-ol/metaopt
metaopt/plugin/print/optimum.py
Python
bsd-3-clause
1,486
from google.appengine.ext import db import models import forms from crud_handler import CRUDHandler class CurrentUserTelescopes(CRUDHandler): model = models.Telescope form = forms.TelescopeForm
mhrivnak/ObservingReports
ajax/current_user_telescopes.py
Python
bsd-3-clause
204
import logging from enum import Enum from django.contrib.auth.models import Group from django.contrib.auth.models import User from django.contrib.gis.db import models from django.core.exceptions import PermissionDenied from django.core.validators import MinValueValidator from django.template.defaulttags import registe...
EMSTrack/WebServerAndClient
login/models.py
Python
bsd-3-clause
17,047
#! /usr/bin/env python # from distutils.core import setup from ginga.version import version import os def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "ginga", version = version, author = "Eric Jeschke", author_email = "eric@naoj.org", descripti...
astrofrog/ginga
setup.py
Python
bsd-3-clause
1,354
import math import numpy import statsmodels.api as sm lowess= sm.nonparametric.lowess import esutil from galpy.util import bovy_coords, bovy_plot from scipy.interpolate import interp1d,UnivariateSpline import apogee.tools.read as apread import isodist import numpy as np import matplotlib.pyplot as plt import os import ...
jobovy/apogee-maps
py/define_rgbsample.py
Python
bsd-3-clause
20,638
#!/usr/bin/env python # -*- coding: utf-8 -*- """Pyle makes it easy to use Python as a replacement for command line tools such as `sed` or `perl`. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from future impor...
aljungberg/pyle
pyle.py
Python
bsd-3-clause
5,025
# Copyright 2013 University of Maryland. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE.TXT file. import sys import os import time import selenium.common.exceptions from selenium.common.exceptions import NoAlertPresentException import framework...
UMD-SEAM/bugbox
framework/Exploits/Bugtraq_54330.py
Python
bsd-3-clause
1,719
from __future__ import with_statement import os from django.core import mail from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm from django.test import TestCase class UserCreati...
mixman/djangodev
django/contrib/auth/tests/forms.py
Python
bsd-3-clause
10,655
import os import urllib2 import json import re ##### Convert a name to a variable name def cleanName(name): return re.sub('[\W_]+', '', name.replace('&','And')) ##### Load the categories endpoint file = urllib2.urlopen('http://api.simplegeo.com/1.0/features/categories.json') contents = json.loads(file.read()) ...
simplegeo/SimpleGeo.framework
scripts/update-sg-categories.py
Python
bsd-3-clause
4,093
# coding: utf-8 testinfo = "s, t 4, s, t 8, s, t 10.1, s, q" tags = "Accelerate" from summa.layer import Layer from summa.director import director from summa.actions import Accelerate, Rotate from summa.sprite import Sprite import customstuff import pyglet import os pyglet.resource.path.append( os.path.join(os.pa...
shackra/thomas-aquinas
tests/test_accelerate.py
Python
bsd-3-clause
833
from typing import Dict, Set from django.db import transaction from django.db import models from django.utils import timezone from data_refinery_common.models.models import Sample, Experiment, OriginalFile class SurveyJob(models.Model): """Records information about a Surveyor Job.""" class Meta: db...
data-refinery/data_refinery
common/data_refinery_common/models/jobs.py
Python
bsd-3-clause
8,068
import unittest from Src.BioAnalyzer.GenePrioritization.Steps.DifferentialAnalysis.Measurers.GlobaBetaValueMeasurer import \ GlobalBetaValueMeasurer from Src.BioDataManagement.CrossCutting.DTOs.DnaMethylationLevelStatusDto import DnaMethylationLevelStatusDto class GlobalBetaValueMeasurerTest(unittest.TestCase): ...
cemarchi/biosphere
Tests/BioAnalyzer/Analysis/GenePrioritization/Steps/DifferentialAnalysis/Measurers/GlobalBetaValueMeasurerTest.py
Python
bsd-3-clause
4,050
#!/usr/bin/env python #coding=utf8 import datetime import logging from handler import UserBaseHandler from lib.route import route from lib.util import vmobile @route(r'/user', name='user') #用户后台首页 class UserHandler(UserBaseHandler): def get(self): user = self.get_current_user() try: ...
ptphp/PtPy
pttornado/src/handler/user.py
Python
bsd-3-clause
712
#!/usr/bin/env python try: from setuptools import setup except ImportError: from distutils.core import setup packages = [ 'django_atomic_dispatch', ] requires = [ ] tests_require = [ 'flake8', 'django-nose', 'rednose', ] with open('README.rst') as readme_file: readme = readme_file.read(...
adamchainz/django_atomic_dispatch
setup.py
Python
bsd-3-clause
1,291
# This file is part of the bapsflib package, a Python toolkit for the # BaPSF group at UCLA. # # http://plasma.physics.ucla.edu/ # # Copyright 2017-2018 Erik T. Everson and contributors # # License: Standard 3-clause BSD; see "LICENSES/LICENSE.txt" for full # license terms and contributor agreement. # """ Module for ...
rocco8773/bapsflib
bapsflib/_hdf/maps/controls/sixk.py
Python
bsd-3-clause
16,445
""" Common type operations. """ from __future__ import annotations from typing import ( Any, Callable, ) import warnings import numpy as np from pandas._libs import ( Interval, Period, algos, ) from pandas._libs.tslibs import conversion from pandas._typing import ( ArrayLike, DtypeObj, ...
gfyoung/pandas
pandas/core/dtypes/common.py
Python
bsd-3-clause
47,282
#!flask/bin/python import sys import os.path import logging os.environ['NDSCHEDULER_SETTINGS_MODULE'] = 'settings_sched' addpath = os.path.abspath("./ndscheduler") if addpath not in sys.path: sys.path.append(os.path.abspath("./ndscheduler")) import traceback import datetime import threading import time import apsch...
fake-name/ReadableWebProxy
runScheduler.py
Python
bsd-3-clause
5,913
# # Collective Knowledge (individual environment - setup) # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net # import os extra_dirs=['C:\\msys64', 'C:\\tools\\msys2', 'D:\\msys64', 'D:\\tools\\msys2'] ...
ctuning/ck-env
soft/env.msys2/customize.py
Python
bsd-3-clause
1,741
""" Test functions for stats module """ import warnings import re import sys import pickle import os from numpy.testing import (assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_allclose, assert_, assert_warns, ...
person142/scipy
scipy/stats/tests/test_distributions.py
Python
bsd-3-clause
168,993
############################################################################### ## ## Copyright (C) 2014-2016, 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. ## ## ...
minesense/VisTrails
vistrails/core/interpreter/base.py
Python
bsd-3-clause
5,884
from zen import * import unittest import os import os.path as path import tempfile class GMLTokenizerCase(unittest.TestCase): tok = gml_tokenizer.GMLTokenizer() codec = gml_codec.BasicGMLCodec() interp = gml_interpreter.GMLInterpreter(codec, tok) def test_basic_correct(self): tokens = [ ('keyOne', 0, 1),...
networkdynamics/zenlib
src/zen/tests/gml_interpreter.py
Python
bsd-3-clause
2,727
import tests.periodicities.period_test as per per.buildModel((120 , 'SM' , 100));
antoinecarme/pyaf
tests/periodicities/Semi_Month/Cycle_Semi_Month_100_SM_120.py
Python
bsd-3-clause
84
import sys import numpy as np #from OpenGL.GL import * #from OpenGL.GLU import * try: import wx from wx import glcanvas from wx.glcanvas import GLCanvas except ImportError: raise ImportError, "Required dependency wx.glcanvas not present" try: from OpenGL.GL import * from OpenGL.GLU import glu...
fboers/jumegX
tsvgl/old/jumeg_tsv_wx02.py
Python
bsd-3-clause
11,636
#!/usr/bin/env python "Load data, create the validation split, optionally scale data, train a linear model, evaluate" import pandas as pd from sklearn.pipeline import Pipeline from sklearn.preprocessing import Normalizer, PolynomialFeatures from sklearn.preprocessing import MaxAbsScaler, MinMaxScaler, StandardScaler...
zygmuntz/numer.ai
validate_lr.py
Python
bsd-3-clause
3,382