repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
joegomes/deepchem | deepchem/models/autoencoder_models/test_tensorflowEncoders.py | 1 | 1452 | from unittest import TestCase
from nose.tools import assert_equals
from rdkit import Chem
import deepchem as dc
from deepchem.data import DiskDataset
from deepchem.feat.one_hot import zinc_charset
from deepchem.models.autoencoder_models.autoencoder import TensorflowMoleculeEncoder, TensorflowMoleculeDecoder
class T... | mit |
limodou/uliweb | uliweb/utils/setup.py | 1 | 5756 | from setuptools import setup
from setuptools.command import build_py as b
import os,sys
import glob
#remove build and dist directory
import shutil
#if os.path.exists('build'):
# shutil.rmtree('build')
#if os.path.exists('dist'):
# shutil.rmtree('dist')
def copy_dir(self, package, src, dst):
self.mkpath(dst)... | bsd-2-clause |
robacklin/sigrok | libsigrokdecode/decoders/jtag/__init__.py | 13 | 1169 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
##
## 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 Li... | gpl-3.0 |
teodoc/home-assistant | homeassistant/util/__init__.py | 4 | 12035 | """
homeassistant.util
~~~~~~~~~~~~~~~~~~
Helper methods for various modules.
"""
import collections
from itertools import chain
import threading
import queue
from datetime import datetime
import re
import enum
import socket
import random
import string
from functools import wraps
# DEPRECATED AS OF 4/27/2015 - moved ... | mit |
czhengsci/pymatgen | pymatgen/vis/tests/test_structure_vtk.py | 11 | 1209 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
Created on Apr 25, 2012
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Sh... | mit |
chipaca/snapcraft | tests/unit/extractors/test_setuppy.py | 2 | 4140 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
drkitty/cyder | vendor-local/src/django-extensions/build/lib/django_extensions/tests/test_dumpscript.py | 16 | 1086 | import sys
from StringIO import StringIO
from django.test import TestCase
from django.core.management import call_command
from django_extensions.tests.models import Name
from django.conf import settings
from django.db.models import loading
class DumpScriptTests(TestCase):
def setUp(self):
self.real_stdout... | bsd-3-clause |
doduytrung/odoo-8.0 | addons/portal_claim/portal_claim.py | 315 | 1871 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
ayushagrawal288/zamboni | mkt/extensions/tests/test_models.py | 1 | 3724 | # -*- coding: utf-8 -*-
import mock
from nose.tools import eq_, ok_
from django.forms import ValidationError
from mkt.extensions.models import Extension
from mkt.files.tests.test_models import UploadCreationMixin, UploadTest
from mkt.site.storage_utils import private_storage
from mkt.site.tests import TestCase
clas... | bsd-3-clause |
sysbot/namecoinq | client/DNS/Status.py | 65 | 2225 | """
$Id: Status.py,v 1.7 2002/04/23 12:52:19 anthonybaxter Exp $
This file is part of the pydns project.
Homepage: http://pydns.sourceforge.net
This code is covered by the standard Python License.
Status values in message header
"""
NOERROR = 0 # No Error [RFC 1035]
FORMERR = 1 ... | mit |
henryroe/Py2MASS | py2mass/__main__.py | 1 | 2088 | from __future__ import absolute_import
import pickle
import sys
from .py2mass import set_2mass_path, fetch_2mass_xsc_box, fetch_2mass_psc_box, __version__
def main():
show_help = False
if len(sys.argv) == 1 or "help" in sys.argv:
show_help = True
else:
if sys.argv[1] == 'psc':
... | mit |
chrisburr/scikit-learn | examples/covariance/plot_sparse_cov.py | 300 | 5078 | """
======================================
Sparse inverse covariance estimation
======================================
Using the GraphLasso estimator to learn a covariance and sparse precision
from a small number of samples.
To estimate a probabilistic model (e.g. a Gaussian model), estimating the
precision matrix, t... | bsd-3-clause |
abtink/openthread | tools/harness-automation/cases/ed_6_3_1.py | 18 | 1869 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# notic... | bsd-3-clause |
cdeboever3/WASP | mapping/rmdup.py | 6 | 1396 | from random import choice
import pysam
import os
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input_bam', help="input BAM or SAM file (must be sorted!)")
parser.add_argument("output_bam", help="output BAM or SAM file")
options = parser.parse_args()
if options.input_bam.endswith(... | apache-2.0 |
IllusionRom-deprecated/android_platform_tools_idea | python/lib/Lib/site-packages/django/core/management/color.py | 635 | 1608 | """
Sets up the terminal color scheme.
"""
import os
import sys
from django.utils import termcolors
def supports_color():
"""
Returns True if the running system's terminal supports color, and False
otherwise.
"""
unsupported_platform = (sys.platform in ('win32', 'Pocket PC'))
# isatty is not ... | apache-2.0 |
1ec5/osm2pgsql | tests/regression-test.py | 2 | 43030 | #!/usr/bin/env python
import unittest
import psycopg2
import os
import fnmatch
import subprocess
exe_path="./osm2pgsql"
full_import_file="tests/liechtenstein-2013-08-03.osm.pbf"
multipoly_import_file="tests/test_multipolygon.osm" #This file contains a number of different multi-polygon test cases
diff_import_file="tes... | gpl-2.0 |
peterbarker/ardupilot-1 | Tools/autotest/arducopter.py | 4 | 46222 | # fly ArduCopter in SITL
# Flight mode switch positions are set-up in arducopter.param to be
# switch 1 = Circle
# switch 2 = Land
# switch 3 = RTL
# switch 4 = Auto
# switch 5 = Loiter
# switch 6 = Stabilize
from __future__ import print_function
import math
import os
import shutil
import time
import pexpe... | gpl-3.0 |
graphql-python/graphql-core | tests/validation/test_unique_directive_names.py | 1 | 2732 | from functools import partial
from graphql.utilities import build_schema
from graphql.validation.rules.unique_directive_names import UniqueDirectiveNamesRule
from .harness import assert_sdl_validation_errors
assert_errors = partial(assert_sdl_validation_errors, UniqueDirectiveNamesRule)
assert_valid = partial(asser... | mit |
J861449197/edx-platform | lms/djangoapps/django_comment_client/tests/test_models.py | 88 | 2904 | """
Tests for the django comment client integration models
"""
from django.test.testcases import TestCase
from nose.plugins.attrib import attr
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE
import django_comment_common.mo... | agpl-3.0 |
lokeshjindal15/pd-gem5 | src/arch/x86/isa/insts/simd128/floating_point/arithmetic/horizontal_addition.py | 89 | 4044 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
yingzha/blocks-examples | parity_problem/__init__.py | 6 | 3821 | from __future__ import print_function
import random
import numpy as np
import theano
import theano.tensor as T
from fuel.streams import DataStream
from fuel.datasets import IterableDataset
from blocks.bricks import Linear, Logistic
from blocks.bricks.recurrent import LSTM
from blocks.bricks.cost import BinaryCrossEn... | mit |
heisencoder/route-finder | third_party/lib/python/django/db/backends/postgresql_psycopg2/introspection.py | 105 | 5005 | from __future__ import unicode_literals
from django.db.backends import BaseDatabaseIntrospection, FieldInfo
from django.utils.encoding import force_text
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type codes to Django Field types.
data_types_reverse = {
16: 'BooleanField',
... | mit |
ckc6cz/osf.io | tests/test_archiver.py | 5 | 30739 | #-*- coding: utf-8 -*-
import datetime
import functools
import json
import logging
import itertools
import celery
import mock # noqa
from contextlib import nested
from mock import call
from nose.tools import * # noqa PEP8 asserts
import httpretty
from modularodm import Q
from scripts import cleanup_failed_registrat... | apache-2.0 |
valohai/valohai-cli | valohai_cli/git.py | 1 | 2207 | import os
import subprocess
from typing import Sequence
from valohai_cli.exceptions import NoCommit, NoGitRepo
def check_git_output(args: Sequence[str], directory: str) -> bytes:
try:
return subprocess.check_output(
args=args,
cwd=directory,
shell=False,
st... | mit |
maartenbreddels/ipyvolume | ipyvolume/utils.py | 1 | 9843 | from __future__ import print_function
import os
import io
import time
import functools
import collections
import collections.abc
import numpy as np
import requests
import IPython
import zmq
# https://stackoverflow.com/questions/14267555/find-the-smallest-power-of-2-greater-than-n-in-python
def next_power_of_2(x):
... | mit |
jhseu/tensorflow | tensorflow/python/debug/cli/readline_ui_test.py | 7 | 6843 | # 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... | apache-2.0 |
thom-at-redhat/cfme_tests | scripts/template_upload_rhevm.py | 1 | 16744 | #!/usr/bin/env python2
"""This script takes various parameters specified in
cfme_data['template_upload']['template_upload_rhevm'] and/or by command-line arguments.
Parameters specified by command-line have higher priority, and override data in cfme_data.
This script is designed to run either as a standalone rhevm tem... | gpl-2.0 |
snnn/tensorflow | tensorflow/python/profiler/internal/model_analyzer_testlib.py | 46 | 4078 | # 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... | apache-2.0 |
Accelerite/cinder | cinder/volume/drivers/nfs.py | 2 | 15287 | # Copyright (c) 2012 NetApp, 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... | apache-2.0 |
antoine-de/navitia | source/jormungandr/jormungandr/modules/example_routing/__init__.py | 18 | 1181 | # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public transport:... | agpl-3.0 |
P2PHash/p2pool-procoin | p2pool/data.py | 20 | 38480 | from __future__ import division
import hashlib
import os
import random
import sys
import time
from twisted.python import log
import p2pool
from p2pool.bitcoin import data as bitcoin_data, script, sha256
from p2pool.util import math, forest, pack
# hashlink
hash_link_type = pack.ComposedType([
('state', pack.Fi... | gpl-3.0 |
RossBrunton/django | tests/template_tests/test_unicode.py | 347 | 1431 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
from django.template import Context, Engine
from django.template.base import TemplateEncodingError
from django.utils import six
from django.utils.safestring import SafeData
class UnicodeTests(TestCase):
def test_templa... | bsd-3-clause |
NelisVerhoef/scikit-learn | examples/manifold/plot_mds.py | 261 | 2616 | """
=========================
Multi-dimensional scaling
=========================
An illustration of the metric and non-metric MDS on generated noisy data.
The reconstructed points using the metric MDS and non metric MDS are slightly
shifted to avoid overlapping.
"""
# Author: Nelle Varoquaux <nelle.varoquaux@gmail.... | bsd-3-clause |
amyliu345/zulip | zerver/lib/response.py | 13 | 2227 | from __future__ import absolute_import
from django.http import HttpResponse, HttpResponseNotAllowed
import ujson
from typing import Optional, Any, Dict, List, Text
from zerver.lib.str_utils import force_bytes
class HttpResponseUnauthorized(HttpResponse):
status_code = 401
def __init__(self, realm, www_auth... | apache-2.0 |
cedk/odoo | addons/mail/mail_message.py | 141 | 47462 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
popazerty/test | lib/python/Components/Renderer/PositionGauge.py | 132 | 1892 | from Renderer import Renderer
from enigma import ePositionGauge
class PositionGauge(Renderer):
def __init__(self):
Renderer.__init__(self)
self.__position = 0
self.__seek_position = 0
self.__length = 0
self.__seek_enable = 0
self.__cutlist = [ ]
GUI_WIDGET = ePositionGauge
def postWidgetCreate(self, i... | gpl-2.0 |
damonkohler/sl4a | python/src/Lib/idlelib/EditorWindow.py | 47 | 58813 | import sys
import os
import re
import imp
from itertools import count
from Tkinter import *
import tkSimpleDialog
import tkMessageBox
from MultiCall import MultiCallCreator
import webbrowser
import idlever
import WindowList
import SearchDialog
import GrepDialog
import ReplaceDialog
import PyParse
from configHandler im... | apache-2.0 |
ojotoxy/iTerm2 | tests/ranges.py | 16 | 1112 | #!/usr/bin/python
# Converts a file containing a list of hex values into C code representing the
# ranges compactly.
print """
struct {
UTF32Char minVal;
UTF32Char maxVal;
} ranges[] = {"""
# length of the shortest allowed range
def p(a, b):
return "{ %s, %s }, " % (hex(a), hex(b))
values = []
# put your f... | gpl-2.0 |
raoyvn/deep-learning | tv-script-generation/submission/problem_unittests.py | 68 | 13049 | import numpy as np
import tensorflow as tf
from tensorflow.contrib import rnn
def _print_success_message():
print('Tests Passed')
def test_create_lookup_tables(create_lookup_tables):
with tf.Graph().as_default():
test_text = '''
Moe_Szyslak Moe's Tavern Where the elite meet to drink
... | mit |
jeffhammond/spaghetty | branches/spaghetty2/generate_source_triples_sortacc.py | 2 | 6570 | import fileinput
import string
import sys
import os
# BGP
#fortran_compiler = '/bgsys/drivers/ppcfloor/comm/bin/mpixlf77_r'
#fortran_opt_flags = '-O5 -qhot -qprefetch -qcache=auto -qalign=4k -qunroll=yes -qmaxmem=-1 -qalias=noaryovrlp:nopteovrlp -qnoextname -qnosmp -qreport=hotlist -c'
#src_dir = '/gpfs/home/jhammond/... | bsd-2-clause |
TheCamusean/DLRCev3 | scripts/Computer_vision_files/pose_estimation.py | 1 | 2128 | import numpy as np
import cv2
import glob
import math as m
import time
import timeout_decorator as tm
def draw(img, corners, imgpts):
corner = tuple(corners[0].ravel())
img = cv2.line(img, corner, tuple(imgpts[0].ravel()), (255,0,0), 5)
img = cv2.line(img, corner, tuple(imgpts[1].ravel()), (0,255,0), 5)
... | mit |
epall/selenium | selenium/src/py/lib/docutils/writers/latex2e/__init__.py | 5 | 79388 | # Author: Engelbert Gruber
# Contact: grubert@users.sourceforge.net
# Revision: $Revision: 4515 $
# Date: $Date: 2006-04-24 11:15:38 +0200 (Mon, 24 Apr 2006) $
# Copyright: This module has been placed in the public domain.
"""
LaTeX2e document tree Writer.
"""
__docformat__ = 'reStructuredText'
# code co... | apache-2.0 |
pauliacomi/pyGAPS | tests/characterisation/test_t_plot.py | 1 | 2958 | """
This test module has tests relating to t-plots
All functions in /calculations/tplot.py are tested here.
The purposes are:
- testing the user-facing API function (tplot)
- testing individual low level functions against known results.
Functions are tested against pre-calculated values on real isotherms.
Al... | mit |
infobloxopen/neutron | neutron/tests/unit/database_stubs.py | 35 | 6712 | # Copyright 2011, Cisco Systems, 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 requ... | apache-2.0 |
ChromiumWebApps/chromium | third_party/protobuf/python/google/protobuf/internal/descriptor_test.py | 261 | 24195 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
yu239/Paddle | v1_api_demo/sequence_tagging/rnn_crf.py | 6 | 3214 | # Copyright (c) 2016 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
#
# Unless required by applic... | apache-2.0 |
salaria/odoo | addons/purchase/wizard/purchase_line_invoice.py | 177 | 5258 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
sankha93/servo | components/script/dom/bindings/codegen/parser/tests/test_interface_maplikesetlikeiterable.py | 74 | 21227 | import WebIDL
import traceback
def WebIDLTest(parser, harness):
def shouldPass(prefix, iface, expectedMembers, numProductions=1):
p = parser.reset()
p.parse(iface)
results = p.finish()
harness.check(len(results), numProductions,
"%s - Should have production cou... | mpl-2.0 |
CENDARI/scrapy | scrapy/log.py | 15 | 5014 | """
Scrapy logging facility
See documentation in docs/topics/logging.rst
"""
import sys
import logging
import warnings
from twisted.python import log
import scrapy
from scrapy.utils.python import unicode_to_str
from scrapy.settings import overridden_settings
# Logging levels
DEBUG = logging.DEBUG
INFO = logging.INF... | bsd-3-clause |
saurabhjn76/sympy | sympy/strategies/core.py | 94 | 3114 | """ Generic SymPy-Independent Strategies """
from __future__ import print_function, division
from sympy.core.compatibility import get_function_name
identity = lambda x: x
def exhaust(rule):
""" Apply a rule repeatedly until it has no effect """
def exhaustive_rl(expr):
new, old = rule(expr), expr
... | bsd-3-clause |
EarthSystemCoG/COG | cog/templatetags/cog_utils.py | 2 | 28549 | from cog.models import *
from cog.models.auth import userHasUserPermission, userHasContributorPermission, userHasAdminPermission, userHasProjectRole
from cog.models.utils import site_index, listPeople
from cog.views import encodeMembershipPar, NEW_MEMBERSHIP, OLD_MEMBERSHIP, NO_MEMBERSHIP
from cog.views import userCanP... | bsd-3-clause |
atomic83/youtube-dl | youtube_dl/downloader/f4m.py | 11 | 13501 | from __future__ import division, unicode_literals
import base64
import io
import itertools
import os
import time
from .fragment import FragmentFD
from ..compat import (
compat_etree_fromstring,
compat_urlparse,
compat_urllib_error,
compat_urllib_parse_urlparse,
)
from ..utils import (
encodeFilena... | unlicense |
mxalbert1996/emojione-android | generate_emoji_name_data.py | 3 | 14406 | #!/usr/bin/env python
# -*- coding: utf-8 -*-#
#
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | apache-2.0 |
DinoCow/airflow | airflow/contrib/operators/bigquery_to_gcs.py | 7 | 1696 | #
# 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... | apache-2.0 |
Xiol/CVEChecker | old/rhsa.py | 1 | 5144 | #!/usr/bin/env python -OO
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# CVE -> RHSA Report Generator
#
# Requires Beautiful Soup: http://www.crummy.com/software/Be... | mpl-2.0 |
Inspq/ansible | lib/ansible/modules/windows/win_updates.py | 6 | 4944 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Davis <mdavis_ansible@rolpdog.com>
#
# This file is part of Ansible
#
# Ansible 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 t... | gpl-3.0 |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/vibe_min/indicators/make_indicators.py | 4 | 4825 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
# script to produce a number of PSRC indicators --
# this illustrates using traits-based configurations programatically
from opus_core.configurations.dataset_pool_configuration import DatasetP... | gpl-2.0 |
jszymon/pacal | pacal/examples/central_limit_demo.py | 1 | 2068 | #!===============================
#! Demo of central limit theorem
#!===============================
from __future__ import print_function
import sys
from pylab import *
from pacal import *
from pacal import params
import time
params.general.warn_on_dependent = False
if __name__ == "__main__":
colors = "kbgrcmy... | gpl-3.0 |
mdrobisch/roseguarden | server/migrations/versions/296a9288bc8e_.py | 2 | 1334 | """empty message
Revision ID: 296a9288bc8e
Revises: 1c98d63b6508
Create Date: 2016-02-19 14:10:58.055152
"""
# revision identifiers, used by Alembic.
revision = '296a9288bc8e'
down_revision = '1c98d63b6508'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | gpl-3.0 |
educloudalliance/eca-auth-data | authdata/tests/test_forms.py | 1 | 2524 |
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014-2015 Haltu Oy, http://haltu.fi
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | mit |
craftytrickster/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treebuilders/etree.py | 721 | 12609 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBuilder(Elemen... | mpl-2.0 |
daeinki/drm | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
Moriadry/tensorflow | tensorflow/python/ops/conv2d_benchmark.py | 8 | 5038 | # 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... | apache-2.0 |
ramondelafuente/ansible-modules-extras | cloud/cloudstack/cs_loadbalancer_rule.py | 44 | 11296 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Darren Worrall <darren@iweb.co.uk>
# (c) 2015, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible 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 So... | gpl-3.0 |
huangkuan/hack | lib/gcloud/streaming/stream_slice.py | 7 | 2260 | """Small helper class to provide a small slice of a stream."""
from six.moves import http_client
class StreamSlice(object):
"""Provides a slice-like object for streams.
:type stream: readable file-like object
:param stream: the stream to be buffered
:type max_bytes: integer
:param max_bytes: ... | apache-2.0 |
pmorie/kubernetes | hack/verify-flags-underscore.py | 205 | 4659 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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 appli... | apache-2.0 |
nikolay-saskovets/Feedly | feedly/activity.py | 4 | 13069 | from feedly import exceptions as feedly_exceptions
from feedly.utils import make_list_unique, datetime_to_epoch
import datetime
import uuid
MAX_AGGREGATED_ACTIVITIES_LENGTH = 15
class BaseActivity(object):
'''
Common parent class for Activity and Aggregated Activity
Check for this if you want to see if... | bsd-3-clause |
anacode/anacode-toolkit | anacode/api/writers.py | 1 | 20217 | # -*- coding: utf-8 -*-
import os
import csv
import datetime
import pandas as pd
from itertools import chain
from functools import partial
from anacode import codes
def backup(root, files):
"""Backs up `files` from `root` directory and return list of backed up
file names. Backed up files will have datetime s... | bsd-3-clause |
AngelLMbot/The-Cocky-Website | functions/googlegroups.py | 2 | 1191 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import bs4 as bs
import urllib2
import re
def getStats(GGname):
GGescapedUrl='https://groups.google.com/forum/?_escap... | gpl-2.0 |
Ahmad31/Web_Flask_Cassandra | flask/lib/python2.7/site-packages/cqlengine/tests/test_consistency.py | 2 | 3151 | from cqlengine.management import sync_table, drop_table
from cqlengine.tests.base import BaseCassEngTestCase
from cqlengine.models import Model
from uuid import uuid4
from cqlengine import columns
import mock
from cqlengine import ALL, BatchQuery
class TestConsistencyModel(Model):
id = columns.UUID(primary_k... | apache-2.0 |
sony/nnabla | python/src/nnabla/backward_function/dropout.py | 1 | 1383 | # Copyright 2019,2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# 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
#
# Un... | apache-2.0 |
javierTerry/PyGithub | github/CommitStats.py | 74 | 3093 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
bitjammer/swift | utils/swift_build_support/swift_build_support/migration.py | 44 | 1926 | # swift_build_support/migration.py - Migrating build-script -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt fo... | apache-2.0 |
mosra/m.css | documentation/test_doxygen/test_doxyfile.py | 1 | 6508 | #
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019, 2020 Vladimír Vondruš <mosra@centrum.cz>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, inc... | mit |
yaolinz/flatbuffers | tests/MyGame/Example/Stat.py | 46 | 1260 | # automatically generated, do not modify
# namespace: Example
import flatbuffers
class Stat(object):
__slots__ = ['_tab']
# Stat
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# Stat
def Id(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._... | apache-2.0 |
tBaxter/activity-monitor | activity_monitor/models.py | 1 | 4354 | from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.functional import cached_property
from .managers import ActivityItemManager
class Activity(models.Model):
"""... | mit |
DistributedSystemsGroup/zoe | zoe_master/scheduler/elastic_scheduler.py | 1 | 14941 | # Copyright (c) 2017, Daniele Venzano
#
# 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... | apache-2.0 |
mattesno1/CouchPotatoServer | couchpotato/core/downloaders/synology.py | 34 | 9218 | import json
import traceback
from couchpotato.core._base.downloader.main import DownloaderBase
from couchpotato.core.helpers.encoding import isInt
from couchpotato.core.helpers.variable import cleanHost
from couchpotato.core.logger import CPLog
import requests
log = CPLog(__name__)
autoload = 'Synology'
class Syn... | gpl-3.0 |
bigswitch/neutron | neutron/plugins/ml2/drivers/openvswitch/agent/ovs_agent_extension_api.py | 4 | 3482 | # Copyright 2016 Intel 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. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
jackytu/newbrandx | src/oscar/apps/partner/importers.py | 4 | 8102 | import os
from datetime import datetime
from decimal import Decimal as D
from django.db.transaction import atomic
from django.utils.translation import ugettext_lazy as _
from oscar.apps.catalogue.categories import create_from_breadcrumbs
from oscar.core.compat import UnicodeCSVReader
from oscar.core.loading import ge... | bsd-3-clause |
dscorbett/pygments | pygments/lexers/esoteric.py | 4 | 9489 | # -*- coding: utf-8 -*-
"""
pygments.lexers.esoteric
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for esoteric languages.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, words
from pygments.token imp... | bsd-2-clause |
tedelhourani/ansible | lib/ansible/modules/storage/netapp/netapp_e_storagepool.py | 17 | 37283 | #!/usr/bin/python
# (c) 2016, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
tmerrick1/spack | var/spack/repos/builtin/packages/py-pyfasta/package.py | 5 | 1682 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
jonathanslenders/pymux | pymux/pipes/win32_client.py | 1 | 1071 | from __future__ import unicode_literals
from .win32 import read_message_from_pipe, write_message_to_pipe, connect_to_pipe
from ctypes import windll
from prompt_toolkit.eventloop import From, Return
import six
__all__ = [
'PipeClient',
]
class PipeClient(object):
r"""
Windows pipe client.
:param pipe... | bsd-3-clause |
praba230890/PYPOWER | pypower/t/t_scale_load.py | 2 | 21996 | # Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Tests for code in C{scale_load}.
"""
from os.path import dirname, join
from numpy import array, zeros, in1d, vstack, flatnonzero as find
from pypower.loadcas... | bsd-3-clause |
mwrightevent38/MissionPlanner | Lib/distutils/util.py | 42 | 22236 | """distutils.util
Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
"""
__revision__ = "$Id$"
import sys, os, string, re
from distutils.errors import DistutilsPlatformError
from distutils.dep_util import newer
from distutils.spawn import spawn
from distu... | gpl-3.0 |
bjorand/django-allauth | allauth/socialaccount/providers/openid/south_migrations/0003_auto__del_openidaccount.py | 82 | 1958 | # encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'OpenIDAccount'
db.delete_table('openid_openidaccount')
def backwards(self, orm):
# Adding model 'OpenIDAccount... | mit |
eivanov/pyotp | setup.py | 2 | 1096 | #!/usr/bin/env python
import os, glob
from setuptools import setup, find_packages
install_requires = [line.rstrip() for line in open(os.path.join(os.path.dirname(__file__), "requirements.txt"))]
setup(
name='pyotp',
version='2.0.0',
url='https://github.com/pyotp/pyotp',
license='BSD License',
aut... | mit |
Arno-Nymous/pyload | module/web/cnl_app.py | 4 | 4579 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from os.path import join
import re
from urllib import unquote
from base64 import standard_b64decode
from binascii import unhexlify
from bottle import route, request, HTTPError
from webinterface import PYLOAD, DL_ROOT, JS
try:
from Crypto.Cipher import AES
except:
... | gpl-3.0 |
MangoMangoDevelopment/neptune | lib/ros_comm-1.12.0/tools/rosgraph/test/test_rosenv.py | 1 | 2781 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... | bsd-3-clause |
keshashah/GCompris | src/braille_lotto-activity/braille_lotto.py | 3 | 18732 | # gcompris - braille_lotto.py
#
# Copyright (C) 2011 Bruno Coudoin and Srishti Sethi
#
# 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 opt... | gpl-2.0 |
boland1992/seissuite_iran | build/lib.linux-x86_64-2.7/seissuite/ant/psdepthmodel.py | 6 | 9233 | """
Module taking care of the forward modelling: theoretical dispersion
curve given a 1D crustal model of velocities and densities.
Uses the binaries of the Computer Programs in Seismology, with
must be installed in *COMPUTER_PROGRAMS_IN_SEISMOLOGY_DIR*
"""
import numpy as np
import matplotlib.pyplot as plt
import os
... | gpl-3.0 |
jacquesd/indico-plugins | livesync/indico_livesync/base.py | 2 | 3877 | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
ucdrascal/hcibench | axopy/storage.py | 2 | 12668 | """Experiment data storage.
There are two main use cases for the functionality in this module:
reading/writing data during an experiment session, and reading data once an
experiment is complete (i.e. for analysis). See the :ref:`user guide <storage>`
for information on these use cases/api.jpeg/api.jpeg/api.jpeg.
"""
... | mit |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/numpy/polynomial/polynomial.py | 22 | 52694 | """
Objects for dealing with polynomials.
This module provides a number of objects (mostly functions) useful for
dealing with polynomials, including a `Polynomial` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with polynomial objects is in
the do... | mit |
s40523144/2017springwcm_hw | plugin/summary/test_summary.py | 339 | 2634 | # -*- coding: utf-8 -*-
import unittest
from jinja2.utils import generate_lorem_ipsum
# generate one paragraph, enclosed with <p>
TEST_CONTENT = str(generate_lorem_ipsum(n=1))
TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False)
from pelican.contents import Page
import summary
class TestSummary(unittest.TestCase... | agpl-3.0 |
possnfiffer/py-emde | py-emde-wind-direction.py | 1 | 5361 | ndata = []
with open('data/winddir_20160202.dat') as f:
for line in f:
ndata.append(line.split(" "))
flist = []
for l in ndata:
if l[4].endswith('00') or l[4].endswith('15') or l[4].endswith('30') or l[4].endswith('45'):
if float(l[-1].strip()) == 0 or float(l[-1].strip()) == 360:
f... | bsd-2-clause |
uclaros/QGIS | tests/src/python/test_qgsserver_response.py | 45 | 2326 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServerResponse.
From build dir, run: ctest -R PyQgsServerResponse -V
.. note:: 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 t... | gpl-2.0 |
eLvErDe/methlab | pymethlab/updatehelper.py | 1 | 1970 | # methlab - A music library application
# Copyright (C) 2007 Ingmar K. Steen (iksteen@gmail.com)
#
# 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... | gpl-2.0 |
biddisco/VTK | ThirdParty/Twisted/twisted/trial/_dist/managercommands.py | 45 | 1560 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Commands for reporting test success of failure to the manager.
@since: 12.3
"""
from twisted.protocols.amp import Command, String, Boolean, ListOf
class AddSuccess(Command):
"""
Add a success.
"""
arguments = [('testName',... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.