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 |
|---|---|---|---|---|---|
# Copyright 2015 Tzanetos Balitsaris
#
# 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 wri... | tzabal/cpm | cpm/cpm.py | Python | apache-2.0 | 14,011 |
"""Tasks to manipulate the db."""
from invoke import task
from pynsot.client import get_api_client
from pynsot.vendor.slumber.exceptions import HttpClientError
import helpers
import sys
@task
def reset(ctx, debug=False):
"""Resets the database. All sites and their related data are wiped out."""
global log... | dravetech/network-tutorials | tutorial-6-abstractions/tasks/tasks_db.py | Python | apache-2.0 | 1,277 |
"""
============================
``ctypes`` Utility Functions
============================
See Also
---------
load_library : Load a C library.
ndpointer : Array restype/argtype with verification.
as_ctypes : Create a ctypes array from an ndarray.
as_array : Create an ndarray from a ctypes array.
References
----------... | kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/numpy/ctypeslib.py | Python | apache-2.0 | 17,445 |
# Import third party libs
import urwid
# Import sconsole libs
import sconsole.cmdbar
import sconsole.static
import sconsole.jobtree
FOOTER = [
('title', 'Salt Console'), ' ',
('key', 'UP'), ' ',
('key', 'DOWN'), ' ']
class Manager(object):
def __init__(self, opts):
self.opts =... | saltstack/salt-console | sconsole/manager.py | Python | apache-2.0 | 1,784 |
# Copyright 2014-2017 by Akira Yoshiyama <akirayoshiyama@gmail.com>.
# 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... | yosshy/osclient2 | osclient2/nova/v2/volume_attachment.py | Python | apache-2.0 | 2,064 |
# Copyright DataStax, 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 agreed to in writing, softwa... | datastax/python-driver | tests/unit/test_parameter_binding.py | Python | apache-2.0 | 8,929 |
# Copyright 2019 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, so... | googleapis/python-automl | samples/snippets/undeploy_model.py | Python | apache-2.0 | 1,165 |
# Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... | deepmind/open_spiel | open_spiel/python/algorithms/nfsp_test.py | Python | apache-2.0 | 3,182 |
#!/usr/bin/python
import os
import sys
import getopt
import logging
from SPARQLWrapper import SPARQLWrapper, JSON
from NagiosCheck import NagiosCheck, NagiosTimeout
class NagiosCheckVirtuoso(NagiosCheck):
def __init__(self, wT, cT, oF, q, e, lL=logging.DEBUG):
NagiosCheck.__init__(self, wT, cT, oF, lL)
... | csgf/sgmon | AppChecks/NagiosCheckVirtuoso.py | Python | apache-2.0 | 4,350 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | MobinRanjbar/hue | desktop/libs/notebook/src/notebook/connectors/base.py | Python | apache-2.0 | 4,408 |
# Copyright 2021 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, ... | GoogleCloudPlatform/python-docs-samples | monitoring/prometheus/main_test.py | Python | apache-2.0 | 1,289 |
import random
print "hello there!"
| kiba09/unicostfortraveling | main.py | Python | apache-2.0 | 39 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | google-research/language | language/labs/consistent_zero_shot_nmt/modules/language_models.py | Python | apache-2.0 | 2,915 |
#!/usr/bin/env python
import os,sys,json,re,datetime,collections
env_props_file = dict(drm_tierId=70144,
drms_chipIdToStbIdConversionFactor=0x0,
sgp_SdllgFacade='SdllgFacade',
sgp_tcpClienthost=['10.0.0.1','10.0.0.2', '10.0.0.3'],
drms_cmcmProxy='drmsDkmAdaptor',
... | deromka/exif-date | test.py | Python | apache-2.0 | 3,407 |
#!/usr/bin/python
import smtplib
from email.mime.text import MIMEText
class Gmailer(object):
def __init__(self, user, password):
self._gmail_user = user
self._gmail_password = password
def SendEmail(self, to, subject, msg_body):
msg = MIMEText(msg_body)
msg['From'] = self._gmail_user
msg['To'... | srcLurker/elk_alarm | gmailer.py | Python | apache-2.0 | 692 |
from bioutils.sequences import translate_cds
from hgvs.exceptions import HGVSDataNotAvailableError
class RefTranscriptData(object):
def __init__(self, hdp, tx_ac, pro_ac):
"""helper for generating RefTranscriptData from for c_to_p"""
tx_info = hdp.get_tx_identity_info(tx_ac)
tx_seq = hdp.... | biocommons/hgvs | hgvs/utils/reftranscriptdata.py | Python | apache-2.0 | 1,584 |
# Copyright (c) 2013 Mirantis 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 agreed to in writ... | tellesnobrega/storm_plugin | sahara/utils/openstack/base.py | Python | apache-2.0 | 2,622 |
#!/usr/bin/python
with open('gluster_hosts') as h:
hosts = h.read().splitlines()
with open('gluster_hosts.last') as l:
last = l.read().splitlines()
hosts_set = set(hosts)
last_set = set(last)
diff_set = hosts_set - last_set
side_a = []
side_b = []
for new_host in diff_set:
host, side = new_host.split(','... | jason-callaway/gluster-ansible | gluster_diff.py | Python | apache-2.0 | 497 |
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | gkc1000/pyscf | pyscf/fciqmcscf/test/test_fciqmcci_n2.py | Python | apache-2.0 | 2,678 |
from django.utils.translation import ugettext_lazy as _
from rdmo.core.validators import LockedValidator, UniqueURIValidator
from .models import View
class ViewUniqueURIValidator(UniqueURIValidator):
model = View
def get_uri(self, data):
if data.get('key') is None:
self.raise_validatio... | DMPwerkzeug/DMPwerkzeug | rdmo/views/validators.py | Python | apache-2.0 | 540 |
# Copyright 2014-2017 Spectra Logic Corporation. 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. A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" ... | SpectraLogic/ds3_python3_sdk | samples/puttingData.py | Python | apache-2.0 | 4,311 |
# cython: auto_cpdef=True, infer_types=True, language_level=3, py2_import=True
#
# Parser
#
from __future__ import absolute_import
# This should be done automatically
import cython
cython.declare(Nodes=object, ExprNodes=object, EncodedString=object,
BytesLiteral=object, StringEncoding=object,
... | thedrow/cython | Cython/Compiler/Parsing.py | Python | apache-2.0 | 108,467 |
from world import func1
from world import MyClass, MyChildClass
from simple import func2
from whatever import func3
__all__ = ('func1', 'func2', 'func3', 'MyClass', 'MyChildClass')
| earslan74/pynet_class | mytest/__init__.py | Python | apache-2.0 | 182 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | iwm911/plaso | plaso/parsers/plist_plugins/default_test.py | Python | apache-2.0 | 4,120 |
from ichnaea.api.locate.internal import InternalRegionSource
from ichnaea.api.locate.score import area_score, station_score
from ichnaea.api.locate.tests.base import BaseSourceTest
from ichnaea.geocode import GEOCODER
from ichnaea.tests.factories import BlueShardFactory, CellAreaFactory, WifiShardFactory
from ichnaea i... | mozilla/ichnaea | ichnaea/api/locate/tests/test_internal.py | Python | apache-2.0 | 5,457 |
import smtplib
from glob import Glob
import smtplib
def ezs_email(msg_type, sender, event_type, params):
cfg = Glob.config.notification()
fromaddr = cfg['from_email']
toaddr = cfg['alarm_notify_emails']
message = """\
From: %s
To: %s
Subject: %s %s %s %s
...
""" % (fromaddr, fromaddr, msg_type, s... | janredl/turhouse | event/notification.py | Python | apache-2.0 | 720 |
import json
import pytest
from indy import ledger, error
@pytest.mark.asyncio
async def test_build_node_request_works_for_missed_fields_in_data_json(did_trustee):
destination = "destination"
data = { }
with pytest.raises(error.CommonInvalidStructure):
await ledger.build_node_request(did_trustee,... | Artemkaaas/indy-sdk | wrappers/python/tests/ledger/test_build_node_request.py | Python | apache-2.0 | 1,085 |
"""Version of open_fortran_parser package."""
from version_query import predict_version_str
VERSION = predict_version_str()
| mbdevpl/open-fortran-parser-xml | open_fortran_parser/_version.py | Python | apache-2.0 | 126 |
import sys
import os
from datetime import datetime
if len(sys.argv) != 4:
sys.stderr.write("Invalid command\n")
sys.exit(1)
data_filename = sys.argv[1]
dept_id = sys.argv[2]
attr_name = sys.argv[3]
print "department id is: %s" % dept_id
print "attribute name is: %s" % attr_name
report_filename = 'data/repor... | ArthurZhong/SparkStormKafkaTest | src/main/java/com/walmart/labs/pcs/normalize/SizeCount.py | Python | apache-2.0 | 1,227 |
import os
import time, hashlib
import pickle, json
from datetime import datetime
from dateutil.parser import parse as dtparse
from pprint import pformat
import asyncio
from functools import partial
import glob, random
from biothings.utils.common import timesofar, iter_n, get_timestamp, \
... | SuLab/biothings.api | biothings/databuild/differ.py | Python | apache-2.0 | 36,718 |
# coding: utf-8
"""
Aprendendo Kivy
Seguindo o tutorial de Alexander Taylor no YouTube:
https://www.youtube.com/watch?v=F7UKmK9eQLY
"""
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.scatter import Scatter
from kivy.uix.floatlayout import FloatLayout
class OiApp(App):
def build(self):
... | pythonprobr/kivy | lab/oi/oi.py | Python | apache-2.0 | 542 |
# 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 t... | nuxeh/keystone | keystone/token/providers/fernet/core.py | Python | apache-2.0 | 11,008 |
'''
DO NOT REMOVE THIS HEADER
CODE AUTHOR: BIKRAM KAUSHIK BORA
'''
'''
THIS FILE CONTAINS PYTHON CODE FOR A DANCE FOR THE NAO ROBOT
MANUFACTURED BY ALDEBARAN ROBOTICS
https://www.aldebaran.com/en/humanoid-robot/nao-robot
___________________________________________________________________________________________... | bikrambora/projects2 | NAOdance.py | Python | apache-2.0 | 9,465 |
import os
from mfr.extensions.tabular.libs import xlrd_tools
BASE = os.path.dirname(os.path.abspath(__file__))
class TestTabularPandaTools:
def test_xlsx_xlrd(self):
with open(os.path.join(BASE, 'files', 'test.xlsx')) as fp:
headers, data = xlrd_tools.xlsx_xlrd(fp)
assert headers[0... | haoyuchen1992/modular-file-renderer | tests/extensions/tabular/test_xlsx_tools.py | Python | apache-2.0 | 799 |
#
# This file is part of looping. Looping is free software available under the
# terms of the Apache 2.0 license. See the file "LICENSE" that was provided
# together with this source file for the licensing terms.
#
# Copyright (c) 2012-2013 the authors. See the file "AUTHORS" for a complete
# list.
# This file was tak... | geertj/looping | lib/looping/test/test_events.py | Python | apache-2.0 | 19,332 |
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import time
import pytest
from twitter.common.contextutil import temporary_dir
from pex.common import safe_copy
from pex.crawler import Crawler
from pex.fetcher import Fetcher
... | snyaggarwal/pex | tests/test_resolver.py | Python | apache-2.0 | 11,110 |
# -*- coding: utf-8 -*-
#
# Tux Eat Pi documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 1 16:39:54 2016.
#
# 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.
#
... | TuxEatPi/tuxeatpi | doc/source/conf.py | Python | apache-2.0 | 12,631 |
import unittest, time, sys, random, copy
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_cmd, h2o_import as h2i, h2o_jobs, h2o_glm, h2o_util
from h2o_test import verboseprint, dump_json, OutputObj
# Dataset created from this:
# Elements of Statistical Learning 2nd Ed.; Hastie, Tibshirani, Friedm... | bikash/h2o-dev | py2/testdir_single_jvm/test_GLM_hastie_shuffle.py | Python | apache-2.0 | 6,052 |
lm_default_config = {
# GENERAL
"seed": None,
"verbose": True,
"show_plots": True,
# Device (default GPU)
"device": "cpu",
# TRAIN
"train_config": {
# Dataloader
"data_loader_config": {"batch_size": 1000, "num_workers": 1},
# Classifier
# Class balance (if... | HazyResearch/metal | metal/label_model/lm_defaults.py | Python | apache-2.0 | 1,522 |
import urllib
f = urllib.urlopen('http://www.ithacaweb.org/')
conta = dict()
for line in f:
parole = line.split()
for parola in parole:
conta[parola] = conta.get(parola, 0) + 1
print conta
| CoSandu/PythonCourses | Python/Week3/dataWithURL.py | Python | apache-2.0 | 207 |
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | fzhaw/python-monascaclient | monascaclient/tests/test_shell.py | Python | apache-2.0 | 9,489 |
# 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 the Li... | pypa/warehouse | tests/unit/macaroons/test_auth_policy.py | Python | apache-2.0 | 11,300 |
# -*- coding: utf-8 -*-
try:
import numpy as np
except ImportError:
np = None
if np:
try:
import pandas as pd
except ImportError:
pd = None
from . import Converter, Options
class NumpyArrayConverter(Converter):
writes_types = np.ndarray
@classmethod
... | Juanlu001/xlwings | xlwings/conversion/numpy_conv.py | Python | apache-2.0 | 1,615 |
# Copyright (C) 2014 Universidad Politecnica de Madrid
# 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... | ging/horizon | openstack_dashboard/fiware_oauth2/forms.py | Python | apache-2.0 | 757 |
#!/usr/bin/python2.7
"""
For every column that occurs in a multiple alignment print the column
and the number of times it occurs (one column/count per line, tab
separated), sorted by count descending.
Note: all blocks must have exactly the same number of species.
usage: %prog < maf > column_counts
"""
import bx.ali... | poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/bx_python-0.7.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/maf_col_counts.py | Python | apache-2.0 | 965 |
#!/usr/bin/env python
import requests
import os
UUID = os.environ['UUID']
TOKEN = os.environ['TOKEN']
def main():
print "sending..."
req = requests.patch('https://meshblu.octoblu.com/v2/devices/'+UUID,
headers={
"meshblu_auth_uuid":UUID,
"meshblu_auth_token":TOKEN
... | sillyfrog/OctobluESP | research/update-ui-johnny.py | Python | apache-2.0 | 24,890 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012, Nachi Ueno, NTT MCL, 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://ww... | beagles/neutron_hacking | neutron/agent/securitygroups_rpc.py | Python | apache-2.0 | 11,112 |
import json
import hashlib
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.msgpack as s_msgpack
import synapse.tools.feed as s_feed
import synapse.tests.utils as s_t_utils
class FeedTest(s_t_utils.SynTest):
async def test_synsplice_remote(self):
async with self.getTes... | vertexproject/synapse | synapse/tests/test_tools_feed.py | Python | apache-2.0 | 5,608 |
# Copyright 2018 Google 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 agreed to in writing, s... | google/sling | python/wikibot/en_wp_dates.py | Python | apache-2.0 | 6,622 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | mbohlool/client-python | kubernetes/test/test_v1beta1_replica_set_condition.py | Python | apache-2.0 | 1,043 |
# coding: utf-8 -*-
import os
import tempfile
import shutil
import yaml
import os
import types
import sys
import fnmatch
import salt.cli.caller
from salt.exceptions import (
SaltClientError,
CommandNotFoundError,
CommandExecutionError,
SaltInvocationError,
)
import ebi.config
class EbiCaller(salt.cl... | zombiemonkey/ebi | ebi/cli/caller.py | Python | apache-2.0 | 5,039 |
# coding=utf-8
import os
import secrets
import shutil
import tempfile
from nose.tools import assert_equal, assert_true
from unittest import TestCase
from ultros.core.storage.config.python import PythonConfig
from ultros.core.storage.manager import StorageManager
__author__ = "Gareth Coles"
class TestPython(TestCa... | UltrosBot/Ultros3K | tests/storage/config/test_python.py | Python | artistic-2.0 | 3,599 |
#!/opt/local/bin/python
# Program to find all numbers which are equal to
# the sum of each of their digits raised to the fifth power
# and report the sum of all such numbers
import timeit
import time
import sys
import math
Powers = {}
sum_of_numbers = 0
for i in range(0,10):
Powers[i] = i ** 5
start_time = timei... | perlygatekeeper/glowing-robot | Project_Euler/30_digit_fifth_powers/find_fifth_powers_digits.py | Python | artistic-2.0 | 1,208 |
# django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2007 Simon Willison
# Copyright (C) 2008-2013 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions o... | edx/django-openid-auth | django_openid_auth/models.py | Python | bsd-2-clause | 2,795 |
from mihome import get_key, send_command
from utils import get_store
def get_base_command():
store = get_store()
gateway_sid = store.get('gateway_sid')
return {
'cmd': 'write',
'model': 'gateway',
'sid': gateway_sid.decode() if gateway_sid else '',
'short_id': 0,
'd... | aluminiumgeek/goodbye-mihome | plugins/gateway_speaker.py | Python | bsd-2-clause | 1,068 |
from .blendercommandhive import blendercommandhive, blendercommandapp
| agoose77/hivesystem | dragonfly/blendercommandhive/__init__.py | Python | bsd-2-clause | 70 |
# -*- coding: utf-8 -*-
#
# Hipikat.org documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 23 20:51:03 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
# autogenerated file.
#
#... | hipikat/hipikat.org | docs/conf.py | Python | bsd-2-clause | 8,436 |
import numpy as np
from numpy.testing import assert_allclose
from astroML.correlation import uniform_sphere, ra_dec_to_xyz, angular_dist_to_euclidean_dist
def test_uniform_sphere():
np.random.seed(42)
# check number of points in 3 axis-aligned cones is approximately the same
ra, dec = uniform_sphere((-18... | astroML/astroML | astroML/tests/test_correlation.py | Python | bsd-2-clause | 1,044 |
"""
Filter all objects with a coastline tag.
This example shows how to write objects to a file.
We need to go twice over the file. First read the ways, filter the ones
we are interested in and remember the nodes required. Then, in a second
run all the relevant nodes and ways are written out.
"""
import osmium as o
i... | osmcode/pyosmium | examples/filter_coastlines.py | Python | bsd-2-clause | 1,463 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Video.channel'
db.delete_column('portal_video', 'channel_id')
def backwards(self, or... | LambdaCast/LambdaCast | portal/migrations/0005_auto__del_field_video_channel.py | Python | bsd-2-clause | 9,292 |
#!/usr/bin/env python
from tHome import acurite
sensorMap = {}
for l in open( "/home/ted/weather.log", "r" ):
p = acurite.decode( l, sensorMap )
if p:
print p
| TD22057/T-Home | python/tHome/acurite/test/parse.py | Python | bsd-2-clause | 181 |
#!/usr/bin/env python
# This script simply downloads waf to the current directory
from __future__ import print_function
import os, sys, stat, hashlib, subprocess
WAFRELEASE = "waf-1.8.6"
WAFURL = "http://ftp.waf.io/pub/release/" + WAFRELEASE
SHA256HASH = "81c4e6a3144c7b2021a839e7277bdaf1cedbbc87302186897b4ae03f4... | gdm85/pflask | bootstrap.py | Python | bsd-2-clause | 1,166 |
from twisted.internet import defer
from pysnmp.entity.rfc3413 import ntforg
from pyasn1.compat.octets import null
def __cbFun(snmpEngine, sendRequestHandle, errorIndication,
errorStatus, errorIndex, varBinds, cbCtx):
cbCtx.callback(
(snmpEngine, errorIndication, errorStatus, errorIndex, varBinds... | ww9rivers/pysnmp | pysnmp/entity/rfc3413/twisted/ntforg.py | Python | bsd-2-clause | 2,453 |
# -*- 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
from django.conf import settings
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'InfrastructureType'
db.... | camillemonchicourt/Geotrek | geotrek/infrastructure/migrations/0001_initial.py | Python | bsd-2-clause | 14,528 |
import sys
import psycopg2
from PyQt4 import QtGui
from PyQt4.QtCore import Qt
from PyQt4.QtGui import QApplication, QCursor, QMessageBox
from Orange.data import Table
from Orange.data.sql.table import SqlTable, LARGE_TABLE
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting
class OWS... | qusp/orange3 | Orange/widgets/data/owsql.py | Python | bsd-2-clause | 8,820 |
# API-like access to St Andrews MMS.
# Useful for things like grade scrapers and so on.
# I realised my old code was dated, unpythonic, and according to Lenary "horrible",
# so it was probably best to start again.
# Also, interesting to get my head out of functional-land every once in a while :)
from bs4 import Beautif... | SimonJF/mmslib | src/mmslib.py | Python | bsd-2-clause | 17,093 |
#!/usr/bin/python
import cgi
import cgitb; cgitb.enable()
import sys
import time
import pages
sys.stderr = sys.stdout
response = cgi.FieldStorage()
print "Content-type: text/html\n\n"
output = 'Model'
camera = 'UVIS1'
year = time.ctime()[-4:] # Default to current year
pages.page1(output, camera, year, response)
if 'Ye... | sniemi/SamPy | sandbox/webserver/cgi-bin/control.py | Python | bsd-2-clause | 825 |
import mock
class TestSessionStore(dict):
"""
This will allow attributes to be set; e.g. .modified
"""
def create_request(method, *a, **b):
""" setup a request with an anonymous user """
from django.contrib.auth.models import AnonymousUser
from django.test.client import RequestFactory
... | iivvoo/twotest | twotest/util.py | Python | bsd-2-clause | 816 |
# -*- coding: utf-8 -*-
import datetime
from pyramid.renderers import JSON
def datetime_adapter(obj, request):
return obj.isoformat()
def includeme(config):
''' Pyramid includeme '''
json_renderer = JSON(indent=4)
json_renderer.add_adapter(datetime.datetime, datetime_adapter)
json_renderer.ad... | silenius/amnesia | amnesia/renderers/json.py | Python | bsd-2-clause | 411 |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | jmcnamara/XlsxWriter | xlsxwriter/test/comparison/test_chart_data_labels13.py | Python | bsd-2-clause | 1,286 |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
class UplusTransaction(models.Model):
'''
#index - status, timestamp, buyer_name, phone_no
'''
PAY_STATE = (
('N', "New"), #구매시작
('A', "Auth"), #payment... | MyMusicTaste/django-oscar-uplus | uplus/models.py | Python | bsd-2-clause | 2,128 |
# templates for spreadsheet rows and columns
import itertools,datetime
class LinesData:
def __init__(self,levelOrders,amountsKey):
self.levelOrders=levelOrders
self.amountsKey=amountsKey
self.lineList=[] # [(level,values,comments),...]
self.amountMap={} # {amountsKey:lineNumber,...}
def addLine(self,level,k... | AntonKhorev/spb-budget-db | 4-xlsx/lines.py | Python | bsd-2-clause | 12,103 |
##-*************************
##-* This software can be used, redistributed and/or modified under
##-* the terms of the BSD 2-clause license as found in the file
##-* 'License.txt' in this distribution.
##-* This source code is (C)copyright Geoffrey French 1999-2014.
##-*************************
import unittest
... | Britefury/mipy | run_tests.py | Python | bsd-2-clause | 1,521 |
# -*- coding: utf-8 -*-
"""
GRequests allows you to use Requests with Gevent to make asynchronous HTTP
Requests easily.
Usage
-----
Usage is simple::
import grequests
urls = [
'http://www.heroku.com',
'http://tablib.org',
'http://httpbin.org',
'http://python-requests.org',
... | DigitalInnovation/mns-grequests | setup.py | Python | bsd-2-clause | 1,449 |
import time
from floyd.util.dateformat import DateFormat, TimeFormat, datetime_to_timestamp, utc_mktime
from floyd.util.timesince import timesince as ts, timeuntil as tu
__all__ = ['date_format', 'time_format', 'short_date', 'iso_date',
'rfc2822_date', 'datetimeformat', 'timesince', 'timeuntil', 'utc_tim... | nikcub/floyd | floyd/helpers/dateformat.py | Python | bsd-2-clause | 1,320 |
# coding: UTF-8
"""
Copyright (c) 2009 Marian Tietz
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions a... | sushi-irc/tekka | tekka/dialogs/advancedPreferences.py | Python | bsd-2-clause | 3,459 |
# -*- coding: UTF-8 -*-
# Copyright 2017-2020 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
from collections import OrderedDict
from django.utils.translation import pgettext_lazy as pgettext
from django.db import models
from etgen.html import E, tostring
from lino.ap... | lino-framework/tera | lino_tera/lib/courses/models.py | Python | bsd-2-clause | 26,534 |
# -*- coding: utf-8 -*-
import datetime
from itertools import islice
from operator import itemgetter
import string
from fs.opener import fsopendir
import pytest
from six import u
from ambry_sources import get_source
from ambry_sources.hdf_partitions import HDFPartition
from ambry_sources.intuit import TypeIntuiter,... | CivicKnowledge/ambry_sources | tests/test_hdf_partitions/functional/test_hdf.py | Python | bsd-2-clause | 10,455 |
#!/usr/bin/env python
'''
@package ion.services.dm.utility.granule.taxonomy
@file ion/services/dm/utility/granule/taxonomy.py
@author David Stuebe
@author Don Brittain
@author Tim Giguere
@brief https://confluence.oceanobservatories.org/display/CIDev/R2+Construction+Data+Model
'''
import yaml
from pyon.core.object i... | ooici/coi-services | ion/services/dm/utility/granule/taxonomy.py | Python | bsd-2-clause | 7,972 |
from __future__ import print_function, division, absolute_import
from collections import namedtuple
from numba import types
from numba.typing.templates import (AttributeTemplate, AbstractTemplate,
builtin, builtin_attr, signature,
bound_function)... | pombredanne/numba | numba/typing/arraydecl.py | Python | bsd-2-clause | 14,869 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Finishing pipeline, starting with a phase1/2 BAC. The pipeline ideally should
include the following components
+ BLAST against the Illumina contigs to fish out additional seqs
+ Use minimus2 to combine the contigs through overlaps
+ Map the mates to the contigs and pe... | tanghaibao/jcvi | jcvi/assembly/postprocess.py | Python | bsd-2-clause | 15,782 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('simsoexp', '0022_auto_20150806_1451'),
]
operations = [
migrations.AddField(
model_name='usersettings',
... | Scriptopathe/simso-exp | simsoexp/migrations/0023_usersettings_unread_only.py | Python | bsd-2-clause | 415 |
#!/usr/bin/env python3
## Fishbowl startup script
## As a distributed program, the startup phase of
## Fishbowl/IPython is non-trivial, and requires access to
## the filesystem. Since Python (3.x) is a requirement
## for Fishbowl, the startup script is also written in
## Python
import subprocess
import sys
import ... | nilqed/fishbowl-repl | run-fishbowl.py | Python | bsd-2-clause | 12,462 |
"""Test the loading of the optional GO term fields."""
__copyright__ = "Copyright (C) 2010-2020, DV Klopfenstein, H Tang, All rights reserved."
__author__ = "DV Klopfenstein"
import sys
from goatools.godag.prttime import prt_hms as moved_prt_hms
from goatools.godag.prttime import GoDagTimed as moved_GoDagTimed
# py... | tanghaibao/goatools | goatools/test_data/godag_timed.py | Python | bsd-2-clause | 1,478 |
# -*- coding: utf-8 -*-
"""
Module for parsing data about Google Search results.
"""
import requests
from modules import DatasourceBase
from modules import ModuleError
################################################################################
class GooglePageRank(DatasourceBase):
"""
This Module gets... | andreas-kowasch/DomainSearch | DomainSearchScanner/modules/GooglePageRank.py | Python | bsd-2-clause | 2,074 |
import os
from setuptools import setup
from pycsse import VERSION
f = open(os.path.join(os.path.dirname(__file__), 'README.rst'))
readme = f.read()
f.close()
setup(
name='pycsse',
version=".".join(map(str, VERSION)),
description='CSSe to CSS export tool.',
long_description=readme,
author="Igor 'id... | idlesign/pyCSSe | setup.py | Python | bsd-3-clause | 833 |
from django.test import TestCase
from django.template.defaultfilters import slugify
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from competition.exceptions import TeamException
from competition.tests.utils import FancyTestCase
from competition.models.team_model import Team
f... | michaelwisely/django-competition | src/competition/tests/team_tests/team_model_tests.py | Python | bsd-3-clause | 3,977 |
#! /usr/bin/env python
# $Id: test_topics.py 4667 2006-07-12 21:40:56Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for the "topic" directive.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupport.Pars... | spreeker/democracygame | external_apps/docutils-snapshot/test/test_parsers/test_rst/test_directives/test_topics.py | Python | bsd-3-clause | 4,797 |
import os
import sys
import struct
# Find the path of the ARSDK
# We need this to get the ARCommandsParser module, which is located
# in the ARSDKBuildUtils repo, and the ARCommands XML files.
# User code can export the name before importing this module:
# import os
# os.environ['ARSDK_PATH'] = '/path/to/the/SDK'... | Parrot-Developers/bybop | src/Bybop_Commands.py | Python | bsd-3-clause | 7,640 |
import sys
from collections import defaultdict
from logging import Filter
import traceback
from datetime import timedelta, datetime
from celery._state import get_current_task
from dimagi.utils.django.email import send_HTML_email as _send_HTML_email
from django.core import mail
from django.http import HttpRequest
from... | dimagi/commcare-hq | corehq/util/log.py | Python | bsd-3-clause | 11,835 |
from __future__ import absolute_import
from linode.objects import Base, DerivedBase, Property, Region
class Backup(DerivedBase):
api_endpoint = '/linode/instances/{linode_id}/backups/{id}'
derived_url_path = 'backups'
parent_id_name='linode_id'
properties = {
'id': Property(identifier=True),... | jo-tez/python-linode-api | linode/objects/linode/backup.py | Python | bsd-3-clause | 1,091 |
"""
Static constants that are faction-related.
"""
from battlesnake.plugins.contrib.factions.faction_obj import Faction
ATTACKER_FACTION_DBREF = '#94'
DEFENDER_FACTION_DBREF = '#91'
FACTIONS = {
DEFENDER_FACTION_DBREF: Faction(DEFENDER_FACTION_DBREF, 'Defenders'),
ATTACKER_FACTION_DBREF: Faction(ATTACKER_FAC... | gtaylor/btmux_battlesnake | battlesnake/plugins/contrib/factions/defines.py | Python | bsd-3-clause | 348 |
"""Defines the unit tests for the :mod:`colour.temperature.ohno2013` module."""
import numpy as np
import unittest
from itertools import permutations
from colour.colorimetry import MSDS_CMFS
from colour.temperature import CCT_to_uv_Ohno2013, uv_to_CCT_Ohno2013
from colour.temperature.ohno2013 import planckian_table
f... | colour-science/colour | colour/temperature/tests/test_ohno2013.py | Python | bsd-3-clause | 7,442 |
###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | hjanime/VisTrails | vistrails/core/system/unix.py | Python | bsd-3-clause | 4,481 |
"""Classical Policy Iteration.
Performs Bellman Backup on a given s,a pair given a fixed policy by sweeping through the
state space. Once the errors are bounded, the policy is changed.
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ impor... | rlpy/rlpy | rlpy/MDPSolvers/PolicyIteration.py | Python | bsd-3-clause | 8,635 |
# -*- coding: utf-8 -*-
#
# WTForms-Test documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 12 18:26:58 2012.
#
# 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.
#
... | kvesteri/wtforms-test | docs/conf.py | Python | bsd-3-clause | 8,085 |
import pprint
from googlevoice import Voice
def run():
voice = Voice()
voice.login()
pprint.pprint(voice.phones)
__name__ == '__main__' and run()
| pettazz/pygooglevoice | examples/phones.py | Python | bsd-3-clause | 164 |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
from os.path import abspath, dirname, join
import six
import pytest
import shutil
from asv import config
from... | qwhelan/asv | test/test_compare.py | Python | bsd-3-clause | 10,673 |
# -*-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/primaires/affection/defaut/__init__.py | Python | bsd-3-clause | 1,668 |
from elements2 import Element, DateElement, DateTimeElement
from datetime import datetime
import dateutil.tz
xml_string = """
<message>
<date>2003-12-13T18:30:02Z</date>
</message>
"""
class Message(Element):
_tag = 'message'
date = DateTimeElement(tag="date")#, format='%Y-%m-%dT%H:%M:%S.000%Z')
def tes... | dbrattli/python-elements | tests/test_date.py | Python | bsd-3-clause | 817 |