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
from awsses import AWSSES from sendgrid import SendGrid from mailgun import MailGun from postageapp import PostageApp from postmarkapp import PostmarkApp from critsend import CritSend
adamgilman/ems-costing
vendors/__init__.py
Python
mit
184
from zeit.cms.i18n import MessageFactory as _ from zeit.content.image.interfaces import INFOGRAPHIC_DISPLAY_TYPE from zope.browserpage import ViewPageTemplateFile from zope.cachedescriptors.property import Lazy as cachedproperty import PIL.Image import pkg_resources import z3c.conditionalviews import zeit.cms.browser.i...
ZeitOnline/zeit.content.image
src/zeit/content/image/browser/image.py
Python
bsd-3-clause
7,284
from setuptools import setup, find_packages import os import codecs here = os.path.abspath(os.path.dirname(__file__)) def read(*parts): # intentionally *not* adding an encoding option to open return codecs.open(os.path.join(here, *parts), 'r').read() install_requires = [ "click==6.6", "jinja2==2.8"...
nir0s/logrotated
setup.py
Python
apache-2.0
879
############################################################################## # Copyright (c) 2013-2017, 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...
wscullin/spack
var/spack/repos/builtin/packages/py-dask/package.py
Python
lgpl-2.1
1,557
__author__ = 'yuens'
ysh329/my-first-cnn
test/__init__.py
Python
mit
21
# Copyright 2014 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This module contains constants for Chrome OS bots.""" from __future__ import print_function import os BUILDBOT_DIR = '/b' BUILDBOT_USER = 'chrome-b...
guorendong/iridium-browser-ubuntu
third_party/chromite/compute/bot_constants.py
Python
bsd-3-clause
1,890
import ROOT import sys import os file_lines = open("training.csv").readlines() branch_def = ':'.join(file_lines[0].strip().split(',')) out_file = ROOT.TFile("test_out.root", "recreate") mvaTree = ROOT.TTree("mvaTree", "variables tree") # replacing the signal / background to 1 / 0 csv_string = ''.join(file_lines[1:...
yuanchao/pyHiggsML
pyTMVA/myRead.py
Python
gpl-2.0
488
import sys import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) try: import pymysql pymysql.install_as_MySQLdb() except ImportError: pass import dotenv env_file = os.path.join(BASE_DIR, '.env') # dotenv.read_dotenv(env_file) DEBUG = bool(int(os.environ.get('DEBUG', '0'))) TEMPLATE_DEBUG = ...
edilio/dental
dental/settings.py
Python
mit
2,930
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. from UM.Math.Polygon import Polygon from UM.Math.Float import Float import numpy import math import pytest class TestPolygon(): def setup_method(self, method): # Called before the first testfunction is exec...
onitake/Uranium
tests/Math/TestPolygon.py
Python
agpl-3.0
8,965
# -*- coding: utf-8 -*- """ Created on Wed Oct 28 11:09:51 2015 REMEMBER TO START TIME SERVER! @author: marcus """ from __future__ import division import time import socket import CastThread import os from psychopy import visual, core, event import constants_wally def create_broadcast_socket(ip = '0....
marcus-nystrom/share-gaze
demo_shared_gaze/server_wally.py
Python
mit
5,419
# -*- coding: utf-8 -*- import json from collections import defaultdict from django.db.models import Count, Q from django.contrib.auth.decorators import login_required from django.shortcuts import render from django.urls import reverse from django.utils.translation import ugettext as _ from ...server.models import ...
migasfree/migasfree
migasfree/stats/views/deployments.py
Python
gpl-3.0
9,415
# Copyright (c) 2016, PerformLine, 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 copyright # notice, this list of conditio...
PerformLine/python-performline-client
performline/products/chatscout/tests/chat_test.py
Python
bsd-3-clause
4,279
"""The switch tests for the nexia platform.""" from homeassistant.const import STATE_ON from .util import async_init_integration async def test_hold_switch(hass): """Test creation of the hold switch.""" await async_init_integration(hass) assert hass.states.get("switch.nick_office_hold").state == STATE_O...
rohitranjan1991/home-assistant
tests/components/nexia/test_switch.py
Python
mit
322
# vim: fileencoding=utf-8 spell spelllang=en ft=python """ :mod:`base8x` -- Encode binary data into ASCII and vice versa ============================================================= .. module:: base8x :platform: Python 2.x :synopsis: Base-(85 ~ 95) binary/ASCII conversion .. moduleauthor:: Cong Ma <cma@pmo.a...
congma/base8x
base8x.py
Python
bsd-3-clause
8,088
# -*- coding: utf-8 -*- import os from itertools import combinations list(combinations(range(5), 3)) os.system("pause")
NicovincX2/Python-3.5
Algorithmique/Mathématiques discrètes/Combinatoire/Combinaison/comb.py
Python
gpl-3.0
123
"""Forest covertype dataset. A classic dataset for classification benchmarks, featuring categorical and real-valued features. The dataset page is available from UCI Machine Learning Repository http://archive.ics.uci.edu/ml/datasets/Covertype Courtesy of Jock A. Blackard and Colorado State University. """ # Aut...
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/sklearn/datasets/covtype.py
Python
mit
3,977
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('metrics', '0004_metric_metadata'), ] operations = [ migrations.AddField( model_name='metric', name='...
nanchenchen/lsst-comaf
comaf/apps/metrics/migrations/0005_auto_20150601_0202.py
Python
mit
1,085
# This file is part of fedmsg. # Copyright (C) 2012-2015 Red Hat, Inc. # # fedmsg is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later versi...
Ghost-script/fedmsg_meta_fedora_infrastructure
fedmsg_meta_fedora_infrastructure/zanata.py
Python
lgpl-2.1
1,957
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This script converts old-style <a> links to API docs to the new $ref links. # See reference_resolver.py for more info on the form...
s20121035/rk3288_android5.1_repo
external/chromium_org/chrome/common/extensions/docs/server2/link_converter.py
Python
gpl-3.0
2,979
# AsteriskLint -- an Asterisk PBX config syntax checker # Copyright (C) 2015-2016 Walter Doekes, OSSO B.V. # # 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 ...
ossobv/asterisklint
asterisklint/app/vall/app_page.py
Python
gpl-3.0
916
from changes.config import db from changes.models.project import ProjectOption from changes.models.snapshot import Snapshot, SnapshotStatus from changes.testutils import APITestCase class SnapshotDetailsTest(APITestCase): def test_simple(self): project = self.create_project() snapshot = self.creat...
dropbox/changes
tests/changes/api/test_snapshot_details.py
Python
apache-2.0
2,394
import logging from urllib import quote import jsonpickle from MisuseCase import MisuseCase from tests.CairisTests import CairisTests __author__ = 'Robin Quetin' class MisuseCaseTests(CairisTests): # region Class fields logger = logging.getLogger(__name__) existing_risk_name = 'Unauthorised Certificate ...
RobinQuetin/CAIRIS-web
cairis/cairis/tests/MisuseCaseTests.py
Python
apache-2.0
1,642
from setuptools import setup, find_packages setup( name='StatHat', version='1.1', author='Valentin Bora', author_email = 'valentin@gosimplysocial.com', description = 'StatHat Python client', url = "http://", license = "MIT", packages = find_packages(exclude=['tests']), zip_safe = False, include_pac...
valentinbora/stathat
setup.py
Python
mit
408
class Node: def __init__(self, val): self.value = val self.left = None self.right = None # Needed for deletion, to heal our poor tree's severed stumps self.parent = None # For AVL tree-balancing, a node must # keep track of its own balance offset. #...
BFriedland/data-structures
balancing_tree/balancing_tree.py
Python
mit
36,928
# pylint: disable=W0611 # flake8: noqa from pandas.core.arrays.sparse import SparseArray, SparseDtype from pandas.core.sparse.series import SparseSeries from pandas.core.sparse.frame import SparseDataFrame
harisbal/pandas
pandas/core/sparse/api.py
Python
bsd-3-clause
206
# -*- coding: utf-8 -*- try: # Python 2.7 from collections import OrderedDict except: # Python 2.6 from gluon.contrib.simplejson.ordered_dict import OrderedDict from datetime import timedelta from gluon import current, Field from gluon.html import * from gluon.storage import Storage from gluon.valida...
collective/eden
private/templates/DRMP/config.py
Python
mit
166,118
""" Parser and evaluator for FormulaResponse and NumericalResponse Uses pyparsing to parse. Main function as of now is evaluator(). """ import math import numbers import operator import numpy import scipy.constants from pyparsing import ( CaselessLiteral, Combine, Forward, Group, Literal, Mat...
proversity-org/edx-platform
common/lib/calc/calc/calc.py
Python
agpl-3.0
13,906
""" MS SQL Server database backend for Django. """ try: import pyodbc as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error loading pyodbc module: %s" % e) import re m = re.match(r'(\d+)\.(\d+)\.(\d+)(?:-beta(\d+))?', Database.version)...
WilliamRen/django-pyodbc
sql_server/pyodbc/base.py
Python
bsd-3-clause
14,415
# -*- coding: utf-8 -*- #在Thread和Process中,应当优选Process,因为Process更稳定,而且,Process可以分布到多台机器上,而Thread最多只能分布到同一台机器的多个CPU上。 #Python的multiprocessing模块不但支持多进程,其中managers子模块还支持把多进程分布到多台机器上。一个服务进程可以作为调度者,将任务分布到其他多个进程中,依靠网络通信。由于managers模块封装很好,不必了解网络通信的细节,就可以很容易地编写分布式多进程程序。 #举个例子:如果我们已经有一个通过Queue通信的多进程程序在同一台机器上运行,现在,由于处理任务的进程任务繁重,希望...
SoPudge/lxfpyanswer
41processmana.py
Python
apache-2.0
995
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from . import test_business_requirement_sale_timesheet
OCA/business-requirement
business_requirement_sale_timesheet/tests/__init__.py
Python
agpl-3.0
121
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from google.cloud.dataproc_v1beta2.proto import jobs_pb2 as google_dot_cloud_dot_dataproc__v1beta2_dot_proto_dot_jobs__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 class JobControllerStub(object): "...
jonparrott/gcloud-python
dataproc/google/cloud/dataproc_v1beta2/proto/jobs_pb2_grpc.py
Python
apache-2.0
6,801
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('jirachat', '0003_auto_20150116_0411'), ] operations = [ migrations.AlterField( model_name='serverinfo', ...
wangzhe/jira-service
jirachat/migrations/0004_auto_20150122_0659.py
Python
gpl-2.0
411
from __future__ import print_function import os import vtk # Read the data os.chdir(os.path.dirname(__file__)) pl3d = vtk.vtkMultiBlockPLOT3DReader() xyx_file = "volume/combxyz.bin" q_file = "volume/combq.bin" pl3d.SetXYZFileName(xyx_file) pl3d.SetQFileName(q_file) pl3d.SetScalarFunctionNumber(100) pl3d.SetVectorFunct...
diego0020/tutorial-vtk-pyqt
00_read_and_draw.py
Python
mit
2,029
import xbmc import threading import sys from elementum.config import ONLY_CLIENT from elementum.logger import log from elementum.rpc import server_thread from elementum.monitor import ElementumMonitor from elementum.daemon import elementumd_thread from elementum.osarch import PLATFORM def run(): # Make sure the XB...
kreatorkodi/repository.torrentbr
plugin.video.elementum/resources/site-packages/elementum/service.py
Python
gpl-2.0
952
# Authors: Nils Wagner, Ed Schofield, Pauli Virtanen, John Travers """ Tests for numerical integration. """ import numpy from numpy import arange, zeros, array, dot, sqrt, cos, sin, eye, pi, exp, \ allclose from numpy.testing import * from scipy.integrate import odeint, ode, complex_ode #----------...
stefanv/scipy3
scipy/integrate/tests/test_integrate.py
Python
bsd-3-clause
6,456
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-astng. # # logilab-astng is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as publis...
tlksio/tlksio
env/lib/python3.4/site-packages/logilab/astng/scoped_nodes.py
Python
mit
34,433
from lib.model import BaseModel, Field import unittest import time class TestModel (BaseModel): field_a = Field() field_b = Field() class TestDefaultModel (BaseModel): field_a = Field(default='default') field_b = Field(default='hello') class TestRequiredModel (BaseModel): field_a ...
ianlivingstone/Bologna
bologna/tests/model_test.py
Python
mit
3,292
import pstats p = pstats.Stats('nohats.profile') p.sort_stats('time').print_stats(30)
victorvde/dota2_nohats
stats.py
Python
mit
86
# -*- coding: UTF-8 -*- """ This file is part of GEOVAL. (c) 2016- Alexander Loew For COPYING and LICENSE details, please refer to the LICENSE file """ # http://stackoverflow.com/questions/37742912/how-to-compile-pyx-using-cythonize-inside-setup-py # nstance python setup.py build_ext --inplace, or pip install -e . in...
pygeo/geoval
setup.py
Python
apache-2.0
5,529
import random from typing import Dict, List quiz_set = [ {"question": "What sound does a dog makes?", "answer": "Woof"}, {"question": "What sound does a cat makes?", "answer": "Meow"}, {"question": "What is 2 + 2?", "answer": "4"}, {"question": "What is sport is Chihayafuru about?", "answer": "karuta"}...
roghu/py3_projects
src/Text/quiz.py
Python
mit
1,560
import _plotly_utils.basevalidators class UidValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="uid", parent_name="volume", **kwargs): super(UidValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=k...
plotly/python-api
packages/python/plotly/plotly/validators/volume/_uid.py
Python
mit
428
import os import unittest import tornpsql from decimal import Decimal from psycopg2._json import Json from psycopg2.extras import HstoreAdapter class ConnectionTestCase(unittest.TestCase): @classmethod def setUpClass(self): try: self.db = tornpsql.Connection(database="tornpsql") e...
stevepeak/tornpsql
tests/tests.py
Python
apache-2.0
6,460
# coding=utf-8 # Copyright 2022 The Tensor2Tensor 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 applicable...
tensorflow/tensor2tensor
tensor2tensor/envs/tic_tac_toe_env_problem.py
Python
apache-2.0
1,691
""" The "travel from home to the park" example from my lectures. Author: Dana Nau <nau@cs.umd.edu>, May 31, 2013 This file should work correctly in both Python 2.7 and Python 3.2. """ import pyhop import random import sys from utils_plan import * from util_plot import * # state variables state1 = pyhop.State('state'...
mdasifhasan/Experiments_HTN_Planner
PyHop/exp_1.py
Python
gpl-3.0
6,445
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """Address objects for network connections.""" import warnings, os from zope.interface import implements from twisted.internet.interfaces import IAddress class IPv4Address(object): """ Object representing an IPv4 socket end...
eunchong/build
third_party/twisted_10_2/twisted/internet/address.py
Python
bsd-3-clause
4,196
import unittest import numpy import pytest import chainer from chainer import functions from chainer import testing from chainer.testing import backend @testing.parameterize(*testing.product({ 'x_dtype': [numpy.float16, numpy.float32, numpy.float64], 'W_dtype': [numpy.float16, numpy.float32, numpy.float64],...
okuta/chainer
tests/chainer_tests/functions_tests/connection_tests/test_linear.py
Python
mit
4,516
# coding: utf-8 from setuptools import find_packages, setup install_requires = ["requests>=2.20.0"] with open("README.rst") as file: long_description = file.read() setup( name="postmarker", url="https://github.com/Stranger6667/postmarker", version="0.18.2", license="MIT", author="Dmitry Dyg...
Stranger6667/postmarker
setup.py
Python
mit
1,616
# Copyright (c) 2014 Tobias Marquardt # # Distributed under terms of the (2-clause) BSD license. """ Low level functions for creation of irc client messages, as well as classes with constants for string commands, numeric commands and error responses. Specification: RFC 2812 'IRC: Client Protocol'. """ __all__ = ['Err...
worblehat/FredIRC
fredirc/messages.py
Python
bsd-2-clause
7,306
from Products.CMFCore.permissions import setDefaultRoles ADD_RATING_PERMISSION = 'ATRatings: Add rating' setDefaultRoles(ADD_RATING_PERMISSION, ( 'Manager', 'Owner', 'Authenticated') )
erikriver/eduIntelligent-cynin
products/ATRatings/Permissions.py
Python
gpl-3.0
192
# f90wrap: F90 to Python interface generator with derived type support # # Copyright James Kermode 2011-2018 # # This file is part of f90wrap # For the latest version see github.com/jameskermode/f90wrap # # f90wrap is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Gene...
jameskermode/f90wrap
examples/fixed_1D_derived_type_array_argument/tests.py
Python
lgpl-3.0
1,805
import os os.environ['DJANGO_SETTINGS_MODULE']='settings' import webapp2 as webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.ext.webapp import template import numpy as np import cgi import cgitb cgitb.enable() class genericBatchInputPage(webapp.RequestHandler): def get(self): ...
puruckertom/poptox
poptox/generic/generic_batchinput.py
Python
unlicense
1,372
# This file is part of Indico. # Copyright (C) 2002 - 2016 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...
DavidAndreev/indico
indico/util/decorators.py
Python
gpl-3.0
6,415
import sys import time from hypertable.thriftclient import * from hyperthrift.gen.ttypes import * try: client = ThriftClient("localhost", 38080) print "HQL examples" try: namespace = client.namespace_open("bad") except: print "Caught exception when tyring to open 'bad' namespace" namespace = client...
nijx/hypertable
src/py/ThriftClient/client_test.py
Python
gpl-3.0
4,079
#!/usr/bin/env python3 # # Copyright (c) 2017 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 """ Script to generate system call invocation macros This script parses the system call metadata JSON file emitted by parse_syscalls.py to create several files: - A file containing weak aliases of any potentially ...
galak/zephyr
scripts/gen_syscalls.py
Python
apache-2.0
17,833
#!/usr/bin/env python import os import pwd def get_username(): return pwd.getpwuid(os.getuid())[0]
cboyce93/epitome-xl
src/util/username.py
Python
gpl-3.0
105
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
ClearCorp-dev/odoo-costa-rica
l10n_cr_account_banking_cr_davivienda/__openerp__.py
Python
agpl-3.0
1,500
# GromacsWrapper: test_example.py # Copyright (c) 2009 Oliver Beckstein <orbeckst@gmail.com> # Released under the GNU Public License 3 (or higher, your choice) # See the file COPYING for details. import pytest import gromacs def test_version(): release = gromacs.__version__ assert isinstance(release, str)
Becksteinlab/GromacsWrapper
tests/test_version.py
Python
gpl-3.0
318
"""Standard test data. For more information, see - http://www.wiley.com/legacy/wileychi/pesarin/material.html """ import os as _os import numpy as np from .. import data_dir __all__ = ['load', 'kenya', ] def load(f): r"""Load a data file located in the data directory. Parameters ----...
jarrodmillman/permute
permute/data/__init__.py
Python
bsd-2-clause
5,034
# Copyright 2019 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...
tensorflow/tensorboard
tensorboard/plugins/graph/metadata.py
Python
apache-2.0
2,502
# coding: utf-8 """ Only use this if you want to update a bootstrapV.M.py file to a newer virtualenv! Usage: /path/to/specific/version/of/python gen.py """ import sys import virtualenv EXTENSION = """ # coding: utf-8 import os from os.path import abspath, basename, dirname, join, pardir import subprocess # get cu...
eahneahn/free
bootstrap/gen.py
Python
agpl-3.0
1,091
#-*- coding: utf-8 -*- from datetime import datetime from django.template import defaultfilters from django.utils.translation import ugettext as _ from django.utils.timezone import is_aware, utc from .. import register @register.filter(expects_localtime=True) def shortnaturaltime(value): """ now, 1s, 1m, 1...
Si-elegans/Web-based_GUI_Tools
spirit/templatetags/tags/utils/time.py
Python
apache-2.0
1,103
# (c) 2016 Open Source Geospatial Foundation - all rights reserved # (c) 2014 - 2015 Centre for Maritime Research and Experimentation (CMRE) # (c) 2013 - 2014 German Aerospace Center (DLR) # This code is licensed under the GPL 2.0 license, available at the root # application directory. import ftplib import pickle impo...
geoserver/wps-remote
src/wpsremote/ftpUpload.py
Python
gpl-2.0
9,550
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """An implementation of a data store based on mysql. --------------->>>>>>>>>>>>>>> DEPRECATED <<<<<<<<<<<<<<<--------------- Do not use!!!! This datastore will be removed in a future version of GRR. """ import Queue import threading import time import ...
pombredanne/grr
lib/data_stores/mysql_data_store.py
Python
apache-2.0
17,981
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ NED Query Tool ============== Module containing a series of functions that execute queries to the NASA Extragalactic Database (NED): .. topic:: Revision History Refactored using common API as a part of Google Summer of Code 2013. :Originall...
ceb8/astroquery
astroquery/ipac/ned/__init__.py
Python
bsd-3-clause
2,571
import json import logging import hashlib from luigi.s3 import S3Client import os import sys import shutil if sys.version_info[:2] <= (2, 6): import unittest2 as unittest else: import unittest from edx.analytics.tasks.url import url_path_join, get_target_from_url from edx.analytics.tasks.tests.acceptance.servi...
sssllliang/edx-analytics-pipeline
edx/analytics/tasks/tests/acceptance/__init__.py
Python
agpl-3.0
7,923
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
rschnapka/account-financial-tools
account_credit_control/report/credit_control_summary.py
Python
agpl-3.0
1,559
# -*- coding: utf-8 -*- def test_assert_false(testdir): """Test pytest does not display captured stderr on test failure.""" # create a temporary pytest test module testdir.makepyfile( """ import pytest import sys import datetime import logging import loggin...
hamzasheikh/pytest-hidecaptured
tests/test_hidecaptured.py
Python
mit
22,940
############################################################################## # 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...
tmerrick1/spack
var/spack/repos/builtin/packages/masurca/package.py
Python
lgpl-2.1
1,973
# Copyright 2017 AT&T Intellectual Property. All other 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...
att-comdev/deckhand
deckhand/context.py
Python
apache-2.0
1,765
# 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/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_storage_accounts_operations.py
Python
mit
50,857
from decimal import Decimal, InvalidOperation from django.utils.translation import ugettext as _ from corehq.apps.commtrack.dbaccessors import get_supply_point_case_by_location from dimagi.utils.decorators.memoized import memoized from corehq.apps.consumption.shortcuts import get_default_consumption, set_default_cons...
puttarajubr/commcare-hq
corehq/apps/locations/bulk.py
Python
bsd-3-clause
11,525
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Views for OAuth.""" from flask import url_for from flask_admin import Admin from i...
tiborsimko/invenio-oauthclient
tests/test_admin.py
Python
mit
1,773
from django.contrib import admin from arcane.browse.models import Track, Album, Artist, Genre, Location admin.site.register(Track) admin.site.register(Artist) admin.site.register(Album) admin.site.register(Genre) admin.site.register(Location) # Register your models here.
ArcaneStreaming/Arcane-Server
arcane/browse/admin.py
Python
gpl-3.0
273
from nose.tools import assert_equal, assert_true from ggplot.themes.element_target import * def test_element_target1(): txt = text() y = axis_text_y() assert_true(len(txt.__class__.__mro__) > len(y.__class__.__mro__)) def test_element_target2(): txt = text() x = axis_text_x() y = axis_text_...
Cophy08/ggplot
ggplot/tests/test_element_target.py
Python
bsd-2-clause
1,333
#!/usr/bin/env python # -*- coding: utf-8 -*- # __coconut_hash__ = 0x538c9a03 # Compiled with Coconut version 1.2.3-post_dev1 [Colonel] # Coconut Header: -------------------------------------------------------- from __future__ import print_function, absolute_import, unicode_literals, division import sys as _coconut...
cgarciae/tfinterface
tfinterface/layers.py
Python
mit
7,862
# 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"); y...
lukecwik/incubator-beam
learning/katas/python/test_helper.py
Python
apache-2.0
6,995
""" This module contains functions for searching the data scraped from mysupermarket.co.uk using pricesearch.scraper. """ from json import loads from scrapy import log def search_file(search_phrases, filename, match_fn=lambda item: output_match(item)): """Search the given JSON file for the given phrases, callin...
hmcc/price-search
search/search.py
Python
mit
1,249
# Write a program that reads a word and prints each character of the word on a sepa- # rate line. For example, if the user provides the input "Harry" , the program prints # H # a # r # r # y inputWord = str(input("Enter a word: ")) for i in range(len(inputWord)): print(inputWord[i])
futurepr0n/Books-solutions
Python-For-Everyone-Horstmann/Chapter4-Loops/P4.8.py
Python
mit
310
import os DEBUG = True TESTAPP_DIR = os.path.abspath(os.path.dirname(__file__)) SECRET_KEY = "testsecretkey" if os.environ.get("DJANGO_DATABASE_ENGINE") == "postgresql": DATABASES = { "default": {"ENGINE": "django.db.backends.postgresql", "NAME": "attachments"} } elif os.environ.get("DJANGO_DATABASE...
bartTC/django-attachments
attachments/tests/testapp/settings.py
Python
bsd-3-clause
1,859
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Copyright (c) 2020 ASMlover. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright...
ASMlover/study
python/coroutines/echogood2.py
Python
bsd-2-clause
2,280
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, F5 Networks 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', ...
mheap/ansible
lib/ansible/modules/network/f5/bigip_wait.py
Python
gpl-3.0
10,531
from django.db import models from django.contrib import admin import datetime from django.utils import timezone from django.core.validators import RegexValidator from django.contrib.auth.models import User, UserManager from django.forms import ValidationError from . import settings # Create your models here. DURATIO...
BobBowles/django-diary
diary/models.py
Python
mit
13,465
"""Infrastructure for detecting abstraction barrier violations.""" class AbstractionViolation(Exception): pass def datatype(obj): return type(obj).__name__ # Generic abstract data type class Abstract(object): def __add__(self, other): raise AbstractionViolation("Can't add {} object to {}".format(...
ajponte/yelpML
maps/tests/test_functions.py
Python
mit
5,659
"""The Pirate Bay Module.""" import logging import sys from torrench.utilities.Config import Config class ThePirateBay(Config): """ ThePirateBay class. This class fetches torrents from TPB proxy, and diplays results in tabular form. Further, torrent details can be fetched which are stored i...
kryptxy/torrench
torrench/modules/thepiratebay.py
Python
gpl-3.0
10,265
#!/usr/bin/env python ''' 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")...
radicalbit/ambari
ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/krberr.py
Python
apache-2.0
1,168
from dataclasses import dataclass, field from typing import Optional from xsdata.models.datatype import XmlDateTime from npoapi.data.api_constraint_media import Filter from npoapi.data.api_constraint_page import Filter as ApiConstraintPageFilter __NAMESPACE__ = "urn:vpro:api:profile:2013" @dataclass class ProfileDef...
npo-poms/pyapi
npoapi/data/profile.py
Python
gpl-3.0
1,838
class Membro(object): nome = None cargo = None def __init__(self, nome, cargo): self.nome = nome self.cargo = cargo
TeamWorkQualityReport/TeamWorkQualityReport
Backend/Analise/entidades/membro.py
Python
gpl-3.0
125
from typing import Set from pydantic import BaseModel, DSN, BaseSettings, PyObject class SubModel(BaseModel): foo = 'bar' apple = 1 class Settings(BaseSettings): redis_host = 'localhost' redis_port = 6379 redis_database = 0 redis_password: str = None auth_key: str = ... invoicing_...
petroswork/pydantic
docs/examples/settings.py
Python
mit
990
from pyd.support import setup, Extension, pydexe_sanity_check pydexe_sanity_check() projName = 'interpcontext' setup( name=projName, version='1.0', ext_modules=[ Extension(projName, ['interpcontext.d'], build_deimos=True, d_lump=True ) ], )
ariovistus/pyd
examples/interpcontext/setup.py
Python
mit
286
from django.conf.urls import url, include from django.contrib import admin from django.views.generic import TemplateView, RedirectView from myhome.views import * urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^favicon\.ico$', RedirectView.as_view(url='/static/favicon.ico', permanent=True)), ...
burzillibus/RobHome
RobHome/urls.py
Python
mit
862
########################################################################## # # Copyright (c) 2018, Image Engine Design 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: # # * Redistrib...
appleseedhq/gaffer
python/GafferSceneTest/CopyAttributesTest.py
Python
bsd-3-clause
6,464
from flask import Flask, render_template, request from httplib2 import Http app = Flask(__name__) @app.route("/") def index(): return render_template('index.html') @app.route("/zalando", methods=['GET',]) def api(): if request.method == 'GET': h = Http() headers = {'Accept': 'application/json...
taschik/handzando
webapp.py
Python
mit
945
req=requests.get("http://www.twse.com.tw/ch/trading/fund/BFI82U/BFI82U.php?report1=day&input_date=105%2F05%2F31&mSubmit=%ACd%B8%DF&yr=2016&w_date=20160530&m_date=20160501") req.encoding='utf-8' html=req.text.encode('utf-8') soup=BeautifulSoup(html,"html.parser") for td in soup.findAll("td",{"class":"basic2"}): prin...
macchiang/practice-on-big-data
crawl/crawl-twse.py
Python
mit
330
# Copyright (C) 2021 OpenMotics BV # # 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 Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribu...
openmotics/gateway
testing/unittests/gateway_tests/mappers/can_led_test.py
Python
agpl-3.0
3,548
# Copyright (c) 2007 Mitchell N. Charity # Copyright (c) 2009-2012 Walter Bender # Copyright (c) 2012 Flavio Danesse # Copyright (c) 2013 Aneesh Dogra <lionaneesh@gmail.com> # # This file is part of Ruler. # # Ruler is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public L...
walterbender/ruler
RulerActivity.py
Python
gpl-3.0
12,067
# -*- coding: utf-8 -*- """ werkzeug._internal ~~~~~~~~~~~~~~~~~~ This module provides internally used helpers and constants. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import inspect from weakref import WeakKeyDictiona...
Chitrank-Dixit/werkzeug
werkzeug/_internal.py
Python
bsd-3-clause
14,214
# Licensed under a 3-clause BSD style license - see LICENSE.rst import re import copy from collections import OrderedDict from . import core from astropy.table import Table from . import cparser from astropy.utils.misc import _set_locale class FastBasic(metaclass=core.MetaBaseReader): """ This class is inte...
pllim/astropy
astropy/io/ascii/fastbasic.py
Python
bsd-3-clause
16,348
# -*- coding: utf-8 -*- from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo class PrzeklejPl(DeadHoster): __name__ = "PrzeklejPl" __type__ = "hoster" __version__ = "0.13" __status__ = "stable" __pattern__ = r'http://(?:www\.)?przeklej\.pl/plik/.+' __config__ = [...
fzimmermann89/pyload
module/plugins/hoster/PrzeklejPl.py
Python
gpl-3.0
532
# # jython examples for jas. # $Id$ # ## \begin{PossoExample} ## \Name{Hawes2} ## \Parameters{a;b;c} ## \Variables{x;y[2];z[2]} ## \begin{Equations} ## x+2y_1z_1+3ay_1^2+5y_1^4+2cy_1 \& ## x+2y_2z_2+3ay_2^2+5y_2^4+2cy_2 \& ## 2 z_2+6ay_2+20 y_2^3+2c \& ## 3 z_1^2+y_1^2+b \& ## 3z_2^2+y_2^2+b \& ## \end{Equations} ## \e...
breandan/java-algebra-system
examples/hawes2_int.py
Python
gpl-2.0
1,478
import json from google.protobuf.descriptor import FieldDescriptor as FD class ParseError(Exception): pass def json2pb(pb, js): ''' convert JSON string to google.protobuf.descriptor instance ''' for field in pb.DESCRIPTOR.fields: if field.name not in js: continue if field.type == FD.TYPE_MESSAGE: pass ...
cookingkode/gorpc
test/protobuf_json.py
Python
apache-2.0
2,497