code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014,2015 Fumihiko Kakuma <kakuma at valinux co jp>
# Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
# All Rights Reserved.
#
# Based on test for openvswitch agent(test_ovs_neutron_agent.py).
#
# Copyright (c) 2012 OpenStack Foundati... | budnyjj/ofagent | networking_ofagent/tests/unit/ofagent/test_ofa_neutron_agent.py | Python | apache-2.0 | 42,289 |
import logging
import ast
import re
import requests
from cStringIO import StringIO
from .config import config
log = logging.getLogger(__name__)
'''
Map 'generic' package name to 'flavor-specific' package name.
If entry is None, either the package isn't known here, or
it's known but should not be installed on remote... | michaelsevilla/teuthology | teuthology/packaging.py | Python | mit | 22,261 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: zengchunyun
"""
import pika
import subprocess
import threading
import time
import sys
class RabbitMQClient(object):
def __init__(self, host="localhost", port=5672, timeout=15, host_id=None, binding_keys=None):
"""
:param host: rabbitmq服务器... | zengchunyun/s12 | day10/homework/rabbitmq_management/modules/rabbitmq_client.py | Python | gpl-2.0 | 5,848 |
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 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 r... | phoenixsbk/kvmmgr | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-common/provisioning/__init__.py | Python | apache-2.0 | 829 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | numenta/nupic.research | tests/unit/frameworks/vernon/noise_robustness_mixin_test.py | Python | agpl-3.0 | 3,343 |
#@+leo-ver=5-thin
#@+node:2015.20140902161836.3840: * @file pybean.py
#coding: utf-8
#@@language python
#@@tabwidth -4
#@+<<declarations>>
#@+node:2015.20140902161836.3841: ** <<declarations>> (pybean)
import sqlite3
from pkg_resources import parse_version
__version__ = "0.2.1"
__author__ = "Mickael Desfrenes"
__em... | chiamingyen/pygroup_sqlite | wsgi/pybean.py | Python | gpl-2.0 | 10,436 |
import pytz
from datetime import datetime
from decimal import Decimal
from furs_fiscal.api import FURSInvoiceAPI
# Path to our .p12 cert file
P12_CERT_PATH = 'demo_podjetje.p12'
# Password for out .p12 cert file
P12_CERT_PASS = 'Geslo123#'
class InvoiceDemo():
def demo_zoi(self):
"""
Obtainin... | boris-savic/python-furs-fiscal | demos/invoice_demo.py | Python | mit | 1,878 |
""" Tests for the authorization resource. """
import json
try:
from urlparse import urlparse, parse_qs
except ImportError:
# noinspection PyUnresolvedReferences
from urllib.parse import urlparse, parse_qs
from twisted.web.server import NOT_DONE_YET
from txoauth2 import GrantTypes
from txoauth2.clients im... | Abestanis/TwistedOAuth2 | tests/unit/testOAuth2Resource.py | Python | mit | 50,119 |
import sys, os, traceback, optparse
import time
import re
import requests
from bs4 import BeautifulSoup
import csv
#filename = os.path.join( "D:", "Web_Crawler")
#if os.path.exists(r'D:\Web_Crawler\stationIDs') = False:
f = open(r'D:\Web_Crawler\RawStationIDs.txt', 'w')
All_Stations = ["http://www.ontariogaspric... | tvanos/tvanos.github.io | Portfolio/Python/Web_Scraper/DEMO7.py | Python | apache-2.0 | 973 |
#!/usr/bin/env python
# Install.py tool to build the GPU library
# used to automate the steps described in the README file in this dir
from __future__ import print_function
import sys,os,subprocess
# help message
help = """
Syntax from src dir: make lib-gpu args="-m machine -h hdir -a arch -p precision -e esuffix -... | jag1g13/lammps | lib/gpu/Install.py | Python | gpl-2.0 | 5,201 |
import translate_tasks
| cogitoweb/project_task_projectref_cogitoweb | wizard/__init__.py | Python | apache-2.0 | 23 |
from twisted.internet.defer import Deferred
from twisted.python.failure import Failure
class PendingEvent(object):
def __init__(self):
self.listeners = []
def deferred(self):
d = Deferred()
self.listeners.append(d)
return d
def callback(self, result):
l = self.lis... | twisted/epsilon | epsilon/pending.py | Python | mit | 606 |
# Copyright 2018 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... | alsrgv/tensorflow | tensorflow/python/keras/engine/sequential_test.py | Python | apache-2.0 | 16,219 |
"""
gargoyle.templatetags.gargoyle_helpers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
from django import template
register = template.Library()
def raw(parser, token):
# Whatever is between {% raw %} and {% endraw %} will ... | zapier/gargoyle | gargoyle/templatetags/gargoyle_helpers.py | Python | apache-2.0 | 1,915 |
# coding=utf-8
from django.db import models
class Garage(models.Model):
number = models.PositiveIntegerField(verbose_name=u'Номер', max_length=5)
first_name = models.CharField(verbose_name=u'Имя', max_length=50)
second_name = models.CharField(verbose_name=u'Фамилия', max_length=50)
last_name = models... | dmitry-sobolev/gsk | gsk/models.py | Python | mit | 1,812 |
#!/usr/bin/env python
import dateutil.parser
import json
import pymongo
import os
import proj_constants as const
from bson.objectid import ObjectId
from datetime import datetime
def main():
fp = open(os.path.join(os.path.dirname(__file__), 'fixture.json'))
fixture = json.load(fp)
mongo_port = os.environ... | andre487/news487 | api/.testing/load-fixture.py | Python | mit | 1,299 |
# Copyright (C) 2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2015 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | frt-arch/taiga-back | taiga/projects/validators.py | Python | agpl-3.0 | 1,886 |
"""
$Id: Base.py,v 1.12.2.10 2008/08/01 03:58:03 customdesigned Exp $
This file is part of the pydns project.
Homepage: http://pydns.sourceforge.net
This code is covered by the standard Python License.
Base functionality. Request and Response classes, that sort of thing.
"""
import socket, string, types, time, sel... | disabler/isida3 | lib/DNS/Base.py | Python | gpl-3.0 | 12,716 |
#
# 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... | wooga/airflow | airflow/cli/commands/role_command.py | Python | apache-2.0 | 1,539 |
from rambutan3.check_args.set.RRangeSizeSetMatcher import RRangeSizeSetMatcher
from rambutan3.check_args.set.RSetEnum import RSetEnum
NON_EMPTY_BUILTIN_FROZENSET = RRangeSizeSetMatcher(RSetEnum.BUILTIN_FROZENSET, min_size=1)
| kevinarpe/kevinarpe-rambutan3 | rambutan3/check_args/annotation/NON_EMPTY_BUILTIN_FROZENSET.py | Python | gpl-3.0 | 227 |
from rdflib.parser import Parser
from rdflib.plugins.parsers.ntriples import NTriplesParser
class NTSink(object):
def __init__(self, graph):
self.graph = graph
def triple(self, s, p, o):
self.graph.add((s, p, o))
class NTParser(Parser):
"""parser for the ntriples format, often stored wi... | softak/webfaction_demo | vendor-local/lib/python/rdflib/plugins/parsers/nt.py | Python | bsd-3-clause | 666 |
'''
Created on 4 juin 2013
@author: Aristote Diasonama
'''
from google.appengine.ext import ndb
class Activity(ndb.Model):
"""
Class which models an activity a user has done.
:param type:
an integer representing the type of the activity and tells what the activity is about
We can hav... | EventBuck/EventBuck | shop/models/activity.py | Python | mit | 1,968 |
import numpy as np
def delta_temperature(wavelength, length, dn=1.87e-4):
"""Return the delta temperature for a pi phase shift on a MZI interferometer"""
return wavelength / 2 / length / dn
def test_delta_temperature():
dt = delta_temperature(1.55, 100)
np.isclose(dt, 41.44385026737968)
dt = del... | gdsfactory/gdsfactory | gdsfactory/simulation/simphony/components/mzi_thermal.py | Python | mit | 442 |
""" Track relationships between compiled extension functions & code fragments
catalog keeps track of which compiled(or even standard) functions are
related to which code fragments. It also stores these relationships
to disk so they are remembered between Python sessions. When
a = 1
compi... | kmspriyatham/symath | scipy/scipy/weave/catalog.py | Python | apache-2.0 | 34,341 |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Philippe Biondi <phil@secdev.org>
# This program is published under a GPLv2 license
"""
SuperSocket.
"""
from __future__ import absolute_import
from select import select, error as select_error
import errno
imp... | mtury/scapy | scapy/supersocket.py | Python | gpl-2.0 | 11,654 |
import numpy as np
from cryspy import const
from cryspy import geo
from cryspy import crystal
from cryspy.fromstr import fromstr as fs
from cryspy import tables
def make_blender_script(atomset, metric, structurename, outfilename):
assert isinstance(atomset, crystal.Atomset), \
"atomset must be of type cry... | tobias-froehlich/cryspy | cryspy/blender.py | Python | gpl-3.0 | 20,177 |
#!/usr/bin/env python
#
# test_codecmaps_cn.py
# Codec mapping tests for PRC encodings
#
# $CJKCodecs: test_codecmaps_cn.py,v 1.3 2004/06/19 06:09:55 perky Exp $
from test import test_support
from test import test_multibytecodec_support
import unittest
class TestGB2312Map(test_multibytecodec_support.TestBase_Mappin... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/test/test_codecmaps_cn.py | Python | gpl-2.0 | 1,062 |
# -*- test-case-name: twisted.conch.test.test_keys -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Data used by test_keys as well as others.
"""
from __future__ import absolute_import, division
from twisted.python.compat import long, _b64decodebytes as decodebytes
RSAData = {
'n'... | EricMuller/mynotes-backend | requirements/twisted/Twisted-17.1.0/src/twisted/conch/test/keydata.py | Python | mit | 17,471 |
# Copyright 2014 Sardar Yumatov
#
# 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,... | baverman/apns-client | apnsclient/transport.py | Python | apache-2.0 | 27,323 |
#! /usr/bin/env python
import sys, argparse
def print_help():
print "usage: cluster_te.py [-i INFILE] \
\n\noptional arguments: \
\n -h help \
\n -o OUTFILE out file [optiional] \
\n -w WINDOW window size [3000] \
\n -s STEP window step size [500] \
\n -p PIRNA minimum numebr of piRNA p... | mike2vandy/Python-scripts | pirnaClusterFinder.py | Python | mit | 5,448 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "food.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| JOUR491-NewsApplications/JOUR491-FoodOnCampus | food/manage.py | Python | mit | 247 |
# -*- coding: utf-8 -*-
{
'name': 'Portal Partner Fix',
'version': '1.0',
'category': '',
'sequence': 14,
'summary': '',
'description': """
Portal Partner Fix
==================
Let user read his commercial partner
""",
'author': 'Ingenieria ADHOC',
'website': 'www.ingadhoc.com',
... | levkar/odoo-addons | portal_partner_fix/__openerp__.py | Python | agpl-3.0 | 631 |
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openerp import models, fields
class ResPartner(models.Model):
_inherit = 'res.partner'
coc_registration_number = fields.Char(
string='CoC Registration Number',
compute=lambda s: s._compute_identific... | acsone/partner-contact | partner_coc/models/res_partner.py | Python | agpl-3.0 | 588 |
import os
import sys
from os.path import dirname, join
PYTHON_DIR = join(dirname(__file__), '/opt/ofelia/vt_manager/src/python/')
# This is needed because wsgi disallows using stdout
sys.stdout = sys.stderr
os.environ['DJANGO_SETTINGS_MODULE'] = 'vt_manager.settings'
sys.path.insert(0,PYTHON_DIR)
from vt_manager.... | dana-i2cat/felix | vt_manager/src/python/vt_manager/tests/prueba.py | Python | apache-2.0 | 411 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.{{ model_name }}List.as_view(), name='list'),
url(r'^new/$', views.{{ model_name }}Create.as_view(), name='create'),
url(r'^(?P<pk>\d+)/$', views.{{ model_name }}Detail.as_view(), name='detail'),
url(r'^(?P<pk>\d+)/... | grantmcconnaughey/django-app-gen | appgen/templates/appgen/python/urls.py | Python | bsd-3-clause | 479 |
# -*- coding: utf-8 -*-
import uuid
from unittest2 import TestCase
from raven.utils.encoding import transform, shorten
class TransformTest(TestCase):
def test_incorrect_unicode(self):
x = 'רונית מגן'
result = transform(x)
self.assertEquals(type(result), str)
self.assertEquals(r... | alex/raven | tests/utils/encoding/tests.py | Python | bsd-3-clause | 5,169 |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | marmyshev/item_title | openlp/core/ui/slidecontroller.py | Python | gpl-2.0 | 62,270 |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | Serag8/Bachelor | google_appengine/google/appengine/datastore/datastore_query.py | Python | mit | 108,210 |
# 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 use ... | niteoweb/libcloud | example_aliyun_ecs.py | Python | apache-2.0 | 2,556 |
#! /usr/bin/env python3
from datetime import datetime, timedelta
from perceval.backends.core.gerrit import Gerrit
# hostname of the Gerrit instance
hostname = 'gerrit.opnfv.org'
# user for sshing to the Gerrit instance
user = 'd.arroyome'
# retrieve only reviews changed since one day ago
from_date = datetime.now() - ... | davidam/python-examples | perceval/perceval_gerrit_me.py | Python | gpl-3.0 | 615 |
# 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... | ctrlaltdel/neutrinator | vendor/openstack/tests/unit/network/v2/test_qos_policy.py | Python | gpl-3.0 | 1,862 |
#!/usr/bin/env python
import json
import numpy as np
t = {"plate": [{"id": 1,
"channels": [
{"id": 1,
"name": "GFP",
"time": ["00:00:00", "00:05:00", "00:10:00", "00:15:00"],
"well": ["A01", "A02", "A03", "A04", "A05", "... | gaoce/TimeVis | tests/gen_tests.py | Python | mit | 1,742 |
"""
Several type aliases used throughout PHASM
------------------------------------------
This is a separate module to prevent circular imports.
"""
from typing import (Mapping, Set, Callable, Union, Tuple, Iterable, Any,
NamedTuple)
# Reads and pairwise local alignments
Read = 'phasm.alignments.... | AbeelLab/phasm | phasm/typing.py | Python | mit | 1,062 |
# Import smtplib for the actual sending function
import os
import shutil
import smtplib
FROM = 'frederick.yh.li@htisec.com'
TO = ['daniel.ck.tse@htisec.com'] + [] + [ 'sbl.desk@htisec.com' ]
SUBJECT = 'HTI JP Availability List'
TEXT = ''
BODY = 'Subject: {0}\n\n{1}'.format(SUBJECT, TEXT)
shutil.copy2("\\\\p7fs0003\\... | frederick623/pb | ul_automation/copy_send_email.py | Python | apache-2.0 | 554 |
from annoying.functions import get_object_or_None
from pixelpuncher.game.models import CheatCode
from pixelpuncher.game.utils.game import daily_reset
from pixelpuncher.game.utils.message import add_game_message
class CheatBase(object):
def unlock(self, player):
raise NotImplementedError
def cheat(sel... | ej2/pixelpuncher | pixelpuncher/game/utils/cheatcodes.py | Python | bsd-3-clause | 2,688 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-17 22:07
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crowdsourcing', '0006_auto_20170811_2356'),
... | crowdresearch/daemo | crowdsourcing/migrations/0007_auto_20170817_2207.py | Python | mit | 716 |
# -*- coding: utf-8 -*-
"""paved.sphinx -- helpers and tasks for Sphinx documentation.
"""
from __future__ import unicode_literals
from . import paved, util
from paver.easy import task, needs, sh, path, options, Bunch, BuildFailure
util.update(
options.paved,
dict(
docs = Bunch(
path = pat... | eykd/paved | paved/docs.py | Python | bsd-3-clause | 4,080 |
"""Functions for accessing HDF5 files."""
from __future__ import division
from __future__ import print_function
import re
import h5py as h5
import numpy as np
import six
from six.moves import range
from ..utils import filter_regex, to_list
def _ls(item, recursive=False, groups=False, level=0):
keys = []
i... | cangermueller/deepcpg | deepcpg/data/hdf.py | Python | mit | 6,707 |
# Copyright 2017 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... | ghchinoy/tensorflow | tensorflow/python/tpu/tpu_feed.py | Python | apache-2.0 | 37,664 |
import os
import json
from time import strftime
from itertools import product, cycle
from collections import defaultdict, OrderedDict
import numpy as np
import h5py
from tqdm import tqdm
from keras.models import Model
from keras.layers import Input, Dense, Activation
from keras.initializers import RandomNormal, Random... | xdshang/VidVRD-helper | baseline/model.py | Python | mit | 12,481 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def settings_warning_message_chunk(apps, schema_editor):
Chunk = apps.get_model("configuration", "Chunk")
Chunk.objects.get_or_create(key="warning message")[0].save()
class Migration(migrations.Migratio... | lohner/Praktomat | src/configuration/migrations/0006_settings_warning_message_chunk.py | Python | gpl-2.0 | 499 |
import renderdoc as rd
# Open a capture file handle
cap = rd.OpenCaptureFile()
# Open a particular file - see also OpenBuffer to load from memory
status = cap.OpenFile('test.rdc', '', None)
# Make sure the file opened successfully
if status != rd.ReplayStatus.Succeeded:
raise RuntimeError("Couldn't open file: " ... | TurtleRockStudios/renderdoc_public | docs/python_api/examples/renderdoc_intro.py | Python | mit | 763 |
import ast
import configparser
import os
import botocore.session
import botocore.exceptions
from platform import system
from types import MethodType
def get_prepared_config(
profile,
region,
ssl_verification,
adfs_ca_bundle,
adfs_host,
output_format,
provider_id... | venth/aws-adfs | aws_adfs/prepare.py | Python | mit | 9,150 |
import numpy as np
import pyfits
import subprocess
import sys
import pandas as pd
import os
import json
import healpy as hp
from glob import glob
def to_json(cl, name):
cl_json = {}
for comp in cl.keys():
cl_json[comp] = []
for ell, value in cl[comp].iteritems():
cl_json[comp].appen... | zonca/python_spice | __init__.py | Python | gpl-3.0 | 4,587 |
#!/usr/bin/env python3
# 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 o... | google/ftc-object-detection | training/tracking.py | Python | apache-2.0 | 18,789 |
#!/usr/bin/python
"""
Core code of the `ghost' analytic galaxy-halo model, including pdf definitions
and convenience functions for calculating observables.
-- Phil Bull 2016 <philbull@gmail.com>
"""
import numpy as np
import pylab as P
import scipy.integrate
import scipy.interpolate
from scipy.special import erf, e... | philbull/ghost | galaxy_model.py | Python | mit | 31,827 |
"""Suite Legacy suite: Operations formerly handled by the Finder, but now automatically delegated to other applications
Level 1, version 1
Generated from /System/Library/CoreServices/Finder.app
AETE/AEUT resource version 0/144, language 0, script 0
"""
import aetools
import MacOS
_code = 'fleg'
class Legacy_suite_E... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/plat-mac/lib-scriptpackages/Finder/Legacy_suite.py | Python | gpl-2.0 | 7,675 |
'''
Compute the value of the control rates.
'''
import numpy
from . import proportions
class ControlRatesMax:
'''
Maximum control rates.
'''
diagnosis = 1
treatment = 10
nonadherence = 1
vaccination = 1
def ramp(x, tol = 0.001):
r'''
Piecewise linear
.. math:: f(x) =
... | janmedlock/HIV-95-vaccine | model/control_rates.py | Python | agpl-3.0 | 3,128 |
#!/usr/bin/env python
from iris_sdk.models.base_resource import BaseData
from iris_sdk.models.data.tn_list import TnList
from iris_sdk.models.maps.losing_carrier_tn_list import LosingCarrierTnListMap
class LosingCarrierTnList(LosingCarrierTnListMap, BaseData):
def __init__(self):
self.tn_list = TnList() | scottbarstow/iris-python | iris_sdk/models/data/losing_carrier_tn_list.py | Python | mit | 319 |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | psachin/swift | swift/proxy/server.py | Python | apache-2.0 | 31,800 |
##
# Copyright 2009-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | ocaisa/easybuild-easyblocks | easybuild/easyblocks/w/wxpython.py | Python | gpl-2.0 | 3,104 |
from .estimator_base import H2OEstimator
class H2OGradientBoostingEstimator(H2OEstimator):
"""
Builds gradient boosted classification trees, and gradient boosted regression trees on
a parsed data set. The default distribution function will guess the model type based on
the response column type run properly th... | kyoren/https-github.com-h2oai-h2o-3 | h2o-py/h2o/estimators/gbm.py | Python | apache-2.0 | 3,338 |
import re
from .static_data import MapItData, PartyData
from django import forms
from django.core.exceptions import ValidationError
class PostcodeForm(forms.Form):
postcode = forms.CharField(
label='Enter your postcode',
max_length=20
)
class ConstituencyForm(forms.Form):
constituency = ... | mhl/yournextmp-popit | candidates/forms.py | Python | agpl-3.0 | 6,862 |
import os, tempfile
class ScpError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return `self.value`
havescp2 = havepscp = None
f, g = os.popen4('scp2.exe', 't')
if g.read()[:12] == 'SSH scp2.exe':
havescp2 = 1
f.close()
g.close()
f, g = os.popen4('pscp.exe... | blueintegral/SmarterBoard | VideoCapture-0.9-5/Tools/webcam-uploader/scpdropin.py | Python | bsd-2-clause | 1,971 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt
from erpnext.controllers.item_variant import (
InvalidItemAttributeValueE... | mhbu50/erpnext | erpnext/stock/doctype/item_attribute/item_attribute.py | Python | gpl-3.0 | 2,414 |
# -*- coding: utf-8 -*-
#******************************************************************************
#
# IdentifyPlus
# ---------------------------------------------------------
# Extended identify tool. Supports displaying and modifying photos
#
# Copyright (C) 2012-2013 NextGIS (info@nextgis.org)
#
# This source ... | nextgis/ngq_compulink | qgis-installer/customization-conf/plugins/identifyplus/identifyplusmodel.py | Python | gpl-2.0 | 14,781 |
# 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | HybridF5/jacket | jacket/api/storage/v2/snapshot_metadata.py | Python | apache-2.0 | 5,975 |
#!/usr/bin/env python
##
## Biskit, a toolkit for the manipulation of macromolecular structures
## Copyright (C) 2004-2018 Raik Gruenberg & Johan Leckner
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Softwar... | graik/biskit | archive_biskit2/scripts/Dock/pdb2complex.py | Python | gpl-3.0 | 2,397 |
import test.sample as sample
from sparkle.data.ExtractRawData import extract_raw_data
from sparkle.data.ParsePST import parse_pst
test_types = ['tone',
'fmsweep',
'synthesized_batsound',
'amsound',
'broad_band_noise',
'narrow_band_noise',
... | Joel-U/sparkle | test/tests/unit/data/test_parse_batlab.py | Python | gpl-3.0 | 1,814 |
"""Support for RFXtrx covers."""
import logging
from homeassistant.components.cover import (
SUPPORT_CLOSE,
SUPPORT_CLOSE_TILT,
SUPPORT_OPEN,
SUPPORT_OPEN_TILT,
SUPPORT_STOP,
SUPPORT_STOP_TILT,
CoverEntity,
)
from homeassistant.const import CONF_DEVICES, STATE_OPEN
from homeassistant.core i... | aronsky/home-assistant | homeassistant/components/rfxtrx/cover.py | Python | apache-2.0 | 6,560 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | elfnor/sverchok | nodes/analyzer/mesh_select.py | Python | gpl-3.0 | 14,214 |
"""
Django settings for djmoney project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# B... | xuelians/djmoney | djmoney/settings.py | Python | gpl-3.0 | 3,182 |
"""todo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | kumarisneha/todo_app | todo/urls.py | Python | mit | 1,455 |
from flask import Flask
from flask.ext.bootstrap import Bootstrap
app = Flask(__name__)
Bootstrap(app)
app.config.from_object('config')
from app import views
| spil-marius/hiveweb | app/__init__.py | Python | apache-2.0 | 161 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
# 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
... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/pbr/packaging.py | Python | agpl-3.0 | 19,776 |
__author__ = 'Agustin Antoine'
__email__ = "antoineagustin@gmail.com"
from gfx import *
from Item import *
class ItemUtils:
def __init__(self):
self.items = dict();
comida = Item.Item("comida", 1, '0')
self.items['Manzana'] = comida
self.items['Platano'] = comida
self.items... | vgdev-beauchef/Wilson | engine/ItemUtils.py | Python | gpl-2.0 | 422 |
#!/usr/bin/env python
import sys
print 'len(argv) =', len(sys.argv)
for i, arg in enumerate(sys.argv):
#arg = arg.decode('utf-8')
print 'argv[%d] =' % i, arg
| chbrown/sandbox | python/argecho.py | Python | mit | 167 |
import datetime
from xml.dom import minidom
from django.contrib.sites.models import Site
from django.contrib.syndication import views
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from django.test.utils import requires_tz_support
from django.utils import ti... | savoirfairelinux/django | tests/syndication_tests/tests.py | Python | bsd-3-clause | 20,650 |
# $Id: it.py 7119 2011-09-02 13:00:23Z milde $
# Authors: Nicola Larosa <docutils@tekNico.net>;
# Lele Gaifax <lele@seldati.it>
# Copyright: This module has been placed in the public domain.
# Beware: the italian translation of the reStructuredText documentation
# at http://docit.bice.dyndns.org/static/ReST, ... | hurricup/intellij-community | python/helpers/py3only/docutils/parsers/rst/languages/it.py | Python | apache-2.0 | 3,268 |
#!/home/surfas/codeheroku/venv/bin/python
#
# The Python Imaging Library.
# $Id$
#
# print image files to postscript printer
#
# History:
# 0.1 1996-04-20 fl Created
# 0.2 1996-10-04 fl Use draft mode when converting.
# 0.3 2003-05-06 fl Fixed a typo or two.
#
from __future__ import print_function
VERSION... | SurfasJones/djcmsrc3 | venv/bin/pilprint.py | Python | mit | 2,399 |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = 'http://kansaslinuxfest.us'
RELATIVE_URLS = Fa... | KansasLinuxFest/website | publishconf.py | Python | apache-2.0 | 533 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 9 23:10:41 2017
@author: franklin
"""
import xlrd
datafile = "data/2013_ERCOT_Hourly_Load_Data.xls"
def parse_file(datafile):
workbook = xlrd.open_workbook(datafile)
sheet = workbook.sheet_by_index(0)
data = [[sheet.cell_value(r, col... | franklinsales/udacity-data-analyst-nanodegree | project3/class-works/data-wrangling/data-extract-fundamentals/2013_ERCOT_Hourly_Load_Data_quiz_corrected.py | Python | mit | 1,152 |
# Copyright 2016 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... | elingg/tensorflow | tensorflow/python/kernel_tests/metrics_test.py | Python | apache-2.0 | 127,143 |
# Copyright (c) 2018 PaddlePaddle 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
#
# Unlessf required by ap... | PaddlePaddle/Paddle | python/paddle/fluid/layers/tensor.py | Python | apache-2.0 | 67,174 |
#!/usr/bin/python
# Copyright (c) 2013 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.
"""Recipes for PNaCl target libs."""
import fnmatch
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__),... | sbc100/native_client | toolchain_build/pnacl_targetlibs.py | Python | bsd-3-clause | 41,655 |
from setuptools import setup
import simple_history
tests_require = [
'Django>=1.6', 'WebTest==2.0.24', 'django-webtest==1.8.0', 'mock==1.0.1']
setup(
name='django-simple-history',
version=simple_history.__version__,
description='Store model history and view/revert changes from admin site.',
long_d... | emergence/django-simple-history | setup.py | Python | bsd-3-clause | 1,376 |
from __future__ import print_function
from tables.indexesextension import keysort
import numpy
from time import time
N = 1000 * 1000
rnd = numpy.random.randint(N, size=N)
for dtype1 in ('S6', 'b1',
'i1', 'i2', 'i4', 'i8',
'u1', 'u2', 'u4', 'u8', 'f4', 'f8'):
for dtype2 in ('u4', 'i8'... | gdementen/PyTables | bench/keysort.py | Python | bsd-3-clause | 910 |
import os
from pip.req import parse_requirements
from setuptools import setup, find_packages
from cert_issuer import __version__
here = os.path.abspath(os.path.dirname(__file__))
install_reqs = parse_requirements('requirements.txt', session=False)
reqs = [str(ir.req) for ir in install_reqs]
with open(os.path.join(he... | cvegaj/ElectriCERT | cert-issuer/setup.py | Python | gpl-3.0 | 925 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 GNS3 Technologies Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | harrijs/gns3-server | gns3server/schemas/version.py | Python | gpl-3.0 | 1,140 |
########################################################################
#
# University of Southampton IT Innovation Centre, 2012
#
# Copyright in this library belongs to the University of Southampton
# University Road, Highfield, Southampton, UK, SO17 1BJ
#
# This software may not be used, sold, licensed, transferred,... | mmcardle/MServe | django-mserve/dataservice/static.py | Python | lgpl-2.1 | 11,367 |
#!/usr/bin/env python
from runtest import TestBase
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'abc', """
# DURATION TID FUNCTION [SOURCE]
0.678 us [ 19939] | __monstartup();
0.234 us [ 19939] | __cxa_atexit();
[ 19939] | main() { /* tests/s-abc.c:26 */
... | namhyung/uftrace | tests/t236_replay_srcline.py | Python | gpl-2.0 | 1,891 |
"""
This module defines the application configuration.
"""
from django.apps import AppConfig
class HomepageConfig(AppConfig):
"""
This class handles application-wide configuration by preparing resources.
"""
name = 'homepage'
| BIDS-collaborative/EDAM | app/homepage/apps.py | Python | bsd-2-clause | 244 |
from django.contrib import admin
from django.contrib.admin import helpers
from django.contrib.admin.options import reverse, InlineModelAdmin
from django.core.exceptions import PermissionDenied
from django.forms.formsets import all_valid
from django.http import Http404
from django.utils.decorators import method_decorato... | anshumanb/django-nested-inline | nested_inline/admin.py | Python | mit | 17,328 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py | Python | mit | 12,762 |
# !/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwar... | jimsize/PySolFC | pysollib/game.py | Python | gpl-3.0 | 122,465 |
#!/usr/bin/env python
#
# Copyright 2019 The Oppia 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... | prasanna08/oppia | scripts/pre_commit_hook.py | Python | apache-2.0 | 7,796 |
#
# This file is part of Checkbox.
#
# Copyright 2008 Canonical Ltd.
#
# Checkbox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# C... | jds2001/ocp-checkbox | checkbox_gtk/hyper_text_view.py | Python | gpl-3.0 | 4,689 |
# CamJam EduKit 3 - Robotics
# Worksheet 7 - Controlling the motors with PWM
import RPi.GPIO as GPIO # Import the GPIO Library
import time # Import the Time library
# Set the GPIO modes
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
# Set variables for the GPIO motor pins
pinMotorAForwards = 10
pinMotorABackwards ... | CamJam-EduKit/EduKit3 | CamJam Edukit 3 - RPi.GPIO/Code/7-pwm.py | Python | mit | 2,662 |
"""
auth_backend.py
Peter Zujko (@zujko)
Defines Django authentication backend for shibboleth.
04/05/17
"""
from django.contrib.auth.models import User
class Attributes():
EDU_AFFILIATION = 'urn:oid:1.3.6.1.4.1.4447.1.41'
FIRST_NAME = 'urn:oid:2.5.4.42'
LAST_NAME = 'urn:oid:2.5.4.4'
USERNAME = 'urn:... | ritstudentgovernment/PawPrints | auth/auth_backend.py | Python | apache-2.0 | 1,971 |
# Copyright (c) 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.apache.org/licenses/LICENSE-2.0
#
# Unless... | julianwang/cinder | cinder/openstack/common/scheduler/filters/__init__.py | Python | apache-2.0 | 1,389 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.