code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
# -*- coding: utf-8 -*- from trac.test import Mock from trac.web.api import Request, RequestDone from StringIO import StringIO import unittest class RequestTestCase(unittest.TestCase): def _make_environ(self, scheme='http', server_name='example.org', server_port=80, method='GET', script_n...
zjj/trac_hack
trac/web/tests/api.py
Python
bsd-3-clause
6,314
from distutils.version import LooseVersion import pytest import numpy.testing as nptest from wqio.tests import helpers import scipy import pandas from wqio.features import Location, Dataset OLD_SCIPY = LooseVersion(scipy.version.version) < LooseVersion("0.19") @pytest.fixture(params=[True, False]) def location(r...
phobson/wqio
wqio/tests/test_features.py
Python
bsd-3-clause
13,698
# -*- coding: utf-8 -*- from __future__ import unicode_literals import inspect import mock import raven import time import six import os from raven.base import Client, ClientState from raven.exceptions import RateLimited from raven.transport import AsyncTransport from raven.transport.http import HTTPTransport from ra...
johansteffner/raven-python
tests/base/tests.py
Python
bsd-3-clause
20,540
from django.core.management import call_command from django.core.management.base import BaseCommand from ._utils import add_arguments class Command(BaseCommand): help = "Rebuilds the search index by clearing the search index and then performing an update." add_arguments = add_arguments def handle(self, ...
Sparrho/bungiesearch
bungiesearch/management/commands/rebuild_index.py
Python
bsd-3-clause
444
import json import logging from django.db import transaction from rest_framework import mixins, serializers, status, viewsets from rest_framework.response import Response from mkt.api.authentication import RestOAuthAuthentication from mkt.api.authorization import GroupPermission from mkt.api.base import CORSMixin fr...
wagnerand/zamboni
mkt/monolith/resources.py
Python
bsd-3-clause
1,858
#!/bin/env python """ This file defines a set of system_info classes for getting information about various resources (libraries, library directories, include directories, etc.) in the system. Currently, the following classes are available: atlas_info atlas_threads_info atlas_blas_info atlas_blas_threads_info ...
mwiebe/numpy
numpy/distutils/system_info.py
Python
bsd-3-clause
84,440
r""" Diametrically point loaded 2-D disk with postprocessing and probes. See :ref:`sec-primer`. Find :math:`\ul{u}` such that: .. math:: \int_{\Omega} D_{ijkl}\ e_{ij}(\ul{v}) e_{kl}(\ul{u}) = 0 \;, \quad \forall \ul{v} \;, where .. math:: D_{ijkl} = \mu (\delta_{ik} \delta_{jl}+\delta_{il} \delta_{...
rc/sfepy
examples/linear_elasticity/its2D_5.py
Python
bsd-3-clause
3,399
#!/usr/bin/env python import os import sys import django from django.conf import settings from django.core.management import execute_from_command_line from django.conf import settings, global_settings as default_settings from os.path import dirname, realpath, abspath # Give feedback on used versions sys.stderr.write...
pombredanne/django_polymorphic
runtests.py
Python
bsd-3-clause
3,374
from django.conf.urls.defaults import * urlpatterns = patterns('', # serve static files (r'^static/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': settings.MEDIA_ROOT, 'show_indexes': True }), # reverse url lookups # (r'^', include('djangobaselibrary.sample.urls')), )
Almad/rpgrules
tests/example_project/urls.py
Python
bsd-3-clause
304
#!/usr/bin/python # Copyright (c) 2010 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. import os import re import types import pyauto_functional # Must be imported before pyauto import pyauto class BrowserTest(pyauto.P...
meego-tablet-ux/meego-app-browser
chrome/test/functional/browser.py
Python
bsd-3-clause
9,680
from django.contrib import admin from pressgang.actions.revert.models import ReversionRecord class ReversionRecordAdmin(admin.ModelAdmin): list_display = ('blog_name', 'blog_path', 'started', 'ended', 'succeeded') ordering = ('ended',) admin.site.register(ReversionRecord, ReversionRecordAdmin)
oberlin/pressgang
pressgang/actions/revert/admin.py
Python
bsd-3-clause
302
# Copyright (c) 2012-2015 The GPy authors (see AUTHORS.txt) # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np from scipy import stats,special import scipy as sp from . import link_functions from ..util.misc import chain_1, chain_2, chain_3, blockify_dhess_dtheta, blockify_third, blockify_h...
befelix/GPy
GPy/likelihoods/likelihood.py
Python
bsd-3-clause
35,968
#! /usr/bin/env python # # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2015. It is licensed under # the three-clause BSD license; see LICENSE. # Contact: khmer-project@idyll.org # """ Accept or discard sequences XXX, based on the given counting h...
Winterflower/khmer
sandbox/filter-median.py
Python
bsd-3-clause
1,824
# 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. """Loads a PYPOWER case dictionary. """ import sys from os.path import basename, splitext, exists from copy import deepcopy from numpy import array, zeros, one...
praba230890/PYPOWER
pypower/loadcase.py
Python
bsd-3-clause
9,819
"""Application base, containing global templates.""" import datetime from django.contrib.sitemaps import Sitemap from django.core.urlresolvers import reverse class PathsSitemap(Sitemap): def __init__(self, pages=[], priority=None, changefreq=None): self.pages = pages self.changefreq = changefreq ...
elin-moco/ffclub
ffclub/base/__init__.py
Python
bsd-3-clause
965
DBNAME = '' DBUSER = '' DBPASSWORD = '' DBHOST = '' DBPORT = '' DJ_SECRET_KEY = '' DJ_DEBUG = True DJ_ALLOWED_HOSTS = [] DJ_EMAIL_HOST = '' DJ_EMAIL_PORT = '' DJ_EMAIL_HOST_USER = '' DJ_EMAIL_HOST_PASSWORD = ''
alfegupe/retro
retro/parameters-dist.py
Python
bsd-3-clause
213
# -*- coding: utf-8 -*- """Copyright (c) 2010-2012 David Rio Vierra Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE...
gpmidi/MCEdit-Unified
directories.py
Python
isc
13,619
# coding: utf-8 import os import json from unipath import FSPath as Path BASE_DIR = Path(__file__).absolute().parent.parent.parent SECRETS_PATH = BASE_DIR.parent.child('conf').child('secrets.json') try: with open(SECRETS_PATH) as handle: SECRETS = json.load(handle) except IOError: SECRETS = { ...
kushiahu/djangomx
djangomx/djangomx/settings/common.py
Python
mit
4,490
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import os, base64, re import hashlib import mimetypes from frappe.utils import get_site_path, get_hook_method, get_files_path, random_string, encode, cstr, call_hook...
vqw/frappe
frappe/utils/file_manager.py
Python
mit
10,724
"""Test case for autocomplete implementations.""" import uuid from django import VERSION from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.utils import six from sbo_selenium import SeleniumTestCase from selenium.common.exceptions import NoSuchElement...
Eraldo/django-autocomplete-light
src/dal/test/case.py
Python
mit
2,502
"""Test script for poplib module.""" # Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL # a real test suite import poplib import asyncore import asynchat import socket import os import time import errno from unittest import TestCase, skipUnless from test import support as test_support threading ...
timm/timmnix
pypy3-v5.5.0-linux64/lib-python/3/test/test_poplib.py
Python
mit
11,954
#!/usr/bin/env python # Helpful little script that spits out a comma-separated list of # language codes for Qt icons that should be included # in binary bytecoin distributions import glob import os import re import sys if len(sys.argv) != 3: sys.exit("Usage: %s $QTDIR/translations $BYTECOINDIR/src/qt/locale"%sys.a...
ahmedbodi/bytecoin
contrib/qt_translations.py
Python
mit
620
'''Visualization of the filters of VGG16, via gradient ascent in input space. This script can run on CPU in a few minutes. Results example: http://i.imgur.com/4nj4KjN.jpg ''' from __future__ import print_function from scipy.misc import imsave import numpy as np import time from keras.applications import vgg16 from k...
infilect/ml-course1
keras-scripts/conv_filter_visualization.py
Python
mit
4,274
class Series(object): def __init__(self, name, data): self.name = name self.data = data def to_javascript(self): jsc = "{" jsc += "name: '" + self.name + "'," jsc += "data: " + str(self.data) + "}" return jsc
jpmfribeiro/PyCharts
pycharts/fields/series/series.py
Python
mit
268
#!/usr/bin/env python ''' NAME latex2png - Converts LaTeX source to PNG file SYNOPSIS latex2png [options] INFILE DESCRIPTION This filter reads LaTeX source text from the input file INFILE (or stdin if INFILE is -) and renders it to PNG image file. Typically used to render math equations. Requ...
tectronics/evergreen-mobile-opac
dev/asciidoc/filters/latex/latex2png.py
Python
mit
6,352
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/batch/__init__.py
Python
mit
1,754
from .core import UnitedStates from ..registry_tools import iso_register from ..core import MON @iso_register('US-IL') class Illinois(UnitedStates): """Illinois""" include_thanksgiving_friday = True include_lincoln_birthday = True include_election_day_even = True class ChicagoIllinois(Illinois): ...
novafloss/workalendar
workalendar/usa/illinois.py
Python
mit
877
from sqlalchemy import Integer, func from alembic.testing.fixtures import TestBase from alembic.testing import config from sqlalchemy import TIMESTAMP, MetaData, Table, Column, text from sqlalchemy.engine.reflection import Inspector from alembic import op, util from alembic.testing import eq_, assert_raises_message fr...
ImaginationForPeople/alembic
tests/test_mysql.py
Python
mit
9,352
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base.version import Version from twilio.rest.lookups.v1.phone_number import PhoneNumberList class V1(Version): def __init__(self, domain): """ Initialize the V1 ver...
tysonholub/twilio-python
twilio/rest/lookups/v1/__init__.py
Python
mit
1,004
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.basemap import Basemap map = Basemap() fig = plt.figure() ax = Axes3D(fig) ''' ax.azim = 270 ax.elev = 90 ax.dist = 5 ''' ax.add_collection3d(map.drawcoastlines(linewidth=0.25)) ax.add_collection3d(map.drawcountries(linewidth=...
rveciana/BasemapTutorial
code_examples/cookbook/plotting_3d_basic.py
Python
cc0-1.0
338
# # Chris Lumens <clumens@redhat.com> # # Copyright 2007, 2009, 2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope that it # ...
pbokoc/pykickstart
pykickstart/commands/harddrive.py
Python
gpl-2.0
2,974
# -*- coding: utf-8 -*- """QGIS Unit tests for the memory layer provider. .. 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 the License, or (at your option) any later vers...
pblottiere/QGIS
tests/src/python/test_provider_memory.py
Python
gpl-2.0
44,152
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
rkashapov/buildbot
worker/buildbot_worker/test/unit/test_commands_transfer.py
Python
gpl-2.0
16,620
language_list = [ 'en', # English 'es', # Spanish 'ja', # Japanese 'cz', # Czech 'da', # Danish 'de', # German 'fi', # Finnish 'fr', # French 'hu', # Hungarian 'it', # Italian 'ko', # Korean 'nl', # Dutch ...
chrisism/plugin.program.advanced.emulator.launcher
dev-scrapers/data/ScreenScraper_languages.py
Python
gpl-2.0
525
# -*- coding: utf-8 -*- # # Copyright © 2013-2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed...
crobinso/pkgdb2
pkgdb2/ui/packages.py
Python
gpl-2.0
43,624
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of the Shiboken Python Bindings Generator project. # # Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). # # Contact: PySide team <contact@pyside.org> # # This program is free software; you can redistribute it and/or # modify it under t...
codewarrior0/Shiboken
tests/minimalbinding/listuser_test.py
Python
gpl-2.0
11,139
import pytest def test_apot_pair_stress_weight_missing(potfit): potfit.create_param_file() potfit.run() assert potfit.has_error() assert 'stress_weight' in potfit.stderr def test_apot_pair_stress_weight_empty(potfit): potfit.create_param_file(stress_weight='') potfit.call_makeapot('startpot', ...
potfit/potfit
tests/apot/pair/stress/test_apot_pair_stress.py
Python
gpl-2.0
2,243
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'LegalPage.body_html' db.delete_column('staticpages_legalpage', 'body_html') # Ch...
ttreeagency/PootleTypo3Org
pootle/apps/staticpages/migrations/0003_auto__del_field_legalpage_body_html__chg_field_legalpage_body.py
Python
gpl-2.0
1,685
from esc import NUL import esccmd import escio from esctypes import Point, Rect from escutil import AssertEQ, AssertScreenCharsInRectEqual, GetCursorPosition, GetScreenSize, knownBug class DCHTests(object): def test_DCH_DefaultParam(self): """DCH with no parameter should delete one character at the cursor.""" ...
margaritis/iTerm2
tests/esctest/tests/dch.py
Python
gpl-2.0
2,438
import unittest import socket from M2Crypto import SSL from subscription_manager.gui import utils from fixture import FakeException, FakeLogger import rhsm.connection as connection class FakeErrorWindow: def __init__(self, msg, parent=None): self.msg = msg class HandleGuiExceptionTests(unittest.TestCa...
vritant/subscription-manager
test/test_handle_gui_exception.py
Python
gpl-2.0
5,281
"""Test OpenBabel executables from Python Note: Python bindings not used On Windows or Linux, you can run these tests at the commandline in the build folder with: "C:\Program Files\CMake 2.6\bin\ctest.exe" -C CTestTestfile.cmake -R pytest -VV You could also "chdir" into bui...
baoilleach/openbabel
test/testfastsearch.py
Python
gpl-2.0
1,914
# -*- encoding: iso-8859-2 -*- import ekg import time def status_handler(session, uid, status, desc): # for sesja in ekg.sessions(): # if sesja.connected(): # ekg.echo("sesja '%s' po³±czona" % (name,)) # ekg.echo("status: "+sesja['status']) # else: # ekg.echo("sesja '%s' nie jest po³±czona" % (name,)) ...
wcb2/wcb2
contrib/python/sample.py
Python
gpl-2.0
3,325
import unittest from mock import call, patch, MagicMock, Mock from pymongo.errors import AutoReconnect from pulp.devel import mock_config from pulp.server import config from pulp.server.db import connection from pulp.server.exceptions import PulpCodedException class MongoEngineConnectionError(Exception): pass ...
nthien/pulp
server/test/unit/server/db/test_connection.py
Python
gpl-2.0
34,833
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
GirlsCodePy/girlscode-coursebuilder
modules/invitation/invitation.py
Python
gpl-3.0
17,503
import re, os import SCons.Util nsisFiles_re = re.compile(r'^\s*File "([^"]*)"', re.M) """ TODO: - Extract the target from the nsis file - When a target is provided use the output function """ def generate(env) : """Add Builders and construction variables for qt to an Environment.""" print "Loading nsis tool..." ...
txemagon/takeatease
vendorsrc/clam-1.4.0/scons/sconstools/nsis.py
Python
gpl-3.0
1,062
import sys import os import logging import getpass import platform import time #import pkg_resources import json import sassie.util.sasconfig as sasconfig if sasconfig.__level__ == "DEBUG": DEBUG = True class run_utils(): def __init__(self,app,txtOutput): self.__application__ = app self.txtOutpu...
madscatt/zazzie_1.5
trunk/sassie/util/module_utilities.py
Python
gpl-3.0
7,017
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
GirlsCodePy/girlscode-coursebuilder
modules/admin/enrollments.py
Python
gpl-3.0
37,647
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
hnakamur/ansible
lib/ansible/module_utils/urls.py
Python
gpl-3.0
31,571
import taggit from django import forms from django.utils.translation import ugettext_lazy as _ from geonode.people.models import Profile from geonode.documents.models import Document class DocumentForm(forms.ModelForm): date = forms.DateTimeField(widget=forms.SplitDateTimeWidget) date.widget.widgets[0].attrs...
sopac/pacgeo
geonode/documents/forms.py
Python
gpl-3.0
2,091
# 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/LICENSE-2.0 # # Unless required by applicable law or a...
Eric-Gaudiello/tensorflow_dev
tensorflow_home/tensorflow_venv/lib/python3.4/site-packages/tensorflow/python/ops/embedding_ops.py
Python
gpl-3.0
12,213
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # Copyright (c) 2013 Matt Hite <mhite@hotmail.com> # 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 ANSIBL...
photoninger/ansible
lib/ansible/modules/network/f5/bigip_pool_member.py
Python
gpl-3.0
17,653
#pylint: disable=invalid-name,no-init from __future__ import (absolute_import, division, print_function) import stresstesting from mantid.simpleapi import * ###################################################################### # Common configuration # Main data file /SNS/SEQ/IPTS-4783/data DATA_FILE = "SEQ_11499_even...
dymkowsk/mantid
Testing/SystemTests/tests/analysis/SNSConvertToMDTest.py
Python
gpl-3.0
6,953
""" This module provides GOCDB2CSAgent code. The agent is used to synchronize information between GOCDB and DIRAC configuration System (CS) """ from DIRAC import S_OK, S_ERROR from DIRAC.Core.Base.AgentModule import AgentModule from DIRAC.Core.LCG.GOCDBClient import GOCDBClient from DIRAC.Core.Utilities.SitesDIRACGOC...
arrabito/DIRAC
ConfigurationSystem/Agent/GOCDB2CSAgent.py
Python
gpl-3.0
10,349
# Copyright (C) 2013 Matthew C. Zwier and Lillian T. Chong # # This file is part of WESTPA. # # WESTPA 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...
nrego/westpa
src/west/propagators/__init__.py
Python
gpl-3.0
3,193
import os import pynsive import importlib from operator import itemgetter from .utilities.dict2List import dict2List from .utilities.logger import logger class PluginSet(object): def __init__(self, plugin_location, enabled_plugins=None): self.plugin_location = plugin_location self.enabled_plugins...
jeffbryner/MozDef
mozdef_util/mozdef_util/plugin_set.py
Python
mpl-2.0
4,225
# Copyright (C) 2015 Mozilla Contributors # # 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 distribu...
escapewindow/signingscript
src/signingscript/vendored/mozbuild/mozpack/hg.py
Python
mpl-2.0
3,409
import random import math def generate(data): height_canvas = 400 data["params"]["height_canvas"] = height_canvas base_triangle = 180 height_triangle = 240 xA = 40 yA = height_canvas - 80 xB = xA + base_triangle yB = yA xC = xB yC = y...
rbessick5/PrairieLearn
exampleCourse/questions/examplePLDrawingCentroid/server.py
Python
agpl-3.0
998
# DWC Network Server Emulator # Copyright (C) 2014 polaris- # Copyright (C) 2014 ToadKing # Copyright (C) 2014 AdmiralCurtiss # Copyright (C) 2014 msoucy # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
bmezali/dwc_network_server_emulator
gamespy/gs_utility.py
Python
agpl-3.0
12,197
from django.db import models from geodata.models import Country class UnescoIndicator(models.Model): id = models.CharField(max_length=50, primary_key=True) description = models.TextField(null=True, blank=True) friendly_label = models.CharField(max_length=255, null=True, blank=True) def __unicode__(se...
tokatikato/OIPA
OIPA/indicator_unesco/models.py
Python
agpl-3.0
926
{ 'name': 'Multiuser To-Do', 'description': 'Extend To-Do Tasks for multiuser', 'author': 'Daniel Reis', 'depends': ['todo_app'], 'data': ['todo_view.xml', 'security/todo_access_rules.xml'], 'demo': ['todo.task.csv', 'todo_data.xml'], }
raycarnes/todo_app
todo_user/__openerp__.py
Python
agpl-3.0
261
# -*- coding: utf-8 -*- # Copyright 2017 Lara Baggio - Link IT srl # (<http://www.linkgroup.it/>) # Copyright 2014-2017 Lorenzo Battistini - Agile Business Group # (<http://www.agilebg.com>) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from . import models from . import wizard
linkitspa/l10n-italy
l10n_it_vat_registries_cash_basis/__init__.py
Python
agpl-3.0
298
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import platform class PyScipy(PythonPackage): """SciPy (pronounced "Sigh Pie") is a Scientific Library for Python. ...
LLNL/spack
var/spack/repos/builtin/packages/py-scipy/package.py
Python
lgpl-2.1
7,478
############################################################################## # 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...
TheTimmy/spack
var/spack/repos/builtin/packages/r-magrittr/package.py
Python
lgpl-2.1
1,824
# -*- coding: utf-8 -*- # # Detective.io documentation build configuration file, created by # sphinx-quickstart on Wed Jul 2 12:38:10 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
carlvlewis/detective.io
docs/conf.py
Python
lgpl-3.0
9,968
"""Test Home Assistant pressure utility functions.""" import pytest from homeassistant.const import ( PRESSURE_CBAR, PRESSURE_HPA, PRESSURE_INHG, PRESSURE_KPA, PRESSURE_MBAR, PRESSURE_PA, PRESSURE_PSI, ) import homeassistant.util.pressure as pressure_util INVALID_SYMBOL = "bob" VALID_SYMBO...
jawilson/home-assistant
tests/util/test_pressure.py
Python
apache-2.0
3,635
# coding: utf-8 from __future__ import unicode_literals from contextlib import contextmanager from cryptography.hazmat.backends import default_backend from datetime import datetime, timedelta import json from mock import Mock, mock_open, patch, sentinel import pytest import random import string from boxsdk.auth.jwt_au...
sanketdjain/box-python-sdk
test/unit/auth/test_jwt_auth.py
Python
apache-2.0
7,519
#!/usr/bin/env python import os import sys import argparse import pprint from collections import defaultdict, OrderedDict from collections import namedtuple from enum import Enum try: from elftools.elf.elffile import ELFFile from elftools.common.py3compat import itervalues from elftools.dwarf.descriptions impo...
trailofbits/mcsema
tools/mcsema_disass/ida7/var_recovery.py
Python
apache-2.0
17,326
# Copyright(c) 2007-2008 by Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> # 2009 by Yaco S.L. <lgs@yaco.es> # # This file is part of PyCha. # # PyCha 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 Softwa...
jmouriz/sanaviron
sanaviron/src/3rd/pycha/tests/color.py
Python
apache-2.0
5,920
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
bolkedebruin/airflow
airflow/utils/log/file_task_handler.py
Python
apache-2.0
13,517
# 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 u...
airbnb/airflow
tests/providers/amazon/aws/hooks/test_athena.py
Python
apache-2.0
8,056
# 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 u...
kaiping/incubator-singa
examples/cifar10/predict.py
Python
apache-2.0
3,356
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
takeshineshiro/keystone
keystone/tests/unit/common/test_notifications.py
Python
apache-2.0
46,330
# Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
ramineni/myironic
ironic/drivers/ilo.py
Python
apache-2.0
2,664
#!/usr/bin/python # Copyright 2014 Google. # # 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...
google/compare-codecs
lib/vp8_mpeg_unittest.py
Python
apache-2.0
2,004
# Dummy test import pytest def test_file1_method1(): print("Hello")
Humbedooh/ponymail
test_one.py
Python
apache-2.0
72
# Copyright (c) 2007-2019 UShareSoft, 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 requi...
usharesoft/hammr
hammr/commands/os/__init__.py
Python
apache-2.0
651
"""Remote control support for Panasonic Viera TV.""" from __future__ import annotations from homeassistant.components.remote import RemoteEntity from homeassistant.const import CONF_NAME, STATE_ON from homeassistant.helpers.entity import DeviceInfo from .const import ( ATTR_DEVICE_INFO, ATTR_MANUFACTURER, ...
jawilson/home-assistant
homeassistant/components/panasonic_viera/remote.py
Python
apache-2.0
2,653
#!/usr/bin/python2.5 # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
svn2github/appengine-pipeline
src/pipeline/util.py
Python
apache-2.0
6,644
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
benfinke/ns_python
nssrc/com/citrix/netscaler/nitro/resource/config/cr/crvserver_filterpolicy_binding.py
Python
apache-2.0
7,861
import os import logging import pkg_resources log = logging.getLogger(__name__) def register_ew_resources(manager): manager.register_directory( 'js', pkg_resources.resource_filename('allura', 'lib/widgets/resources/js')) manager.register_directory( 'css', pkg_resources.resource_filename('allu...
Bitergia/allura
Allura/allura/config/resources.py
Python
apache-2.0
1,135
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
benfinke/ns_python
nssrc/com/citrix/netscaler/nitro/resource/config/appfw/appfwtransactionrecords.py
Python
apache-2.0
7,068
# Copyright 2014 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
zhaochao/fuel-web
fuel_agent_ci/fuel_agent_ci/tests/test_partition.py
Python
apache-2.0
9,086
# # 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...
Acehaidrey/incubator-airflow
tests/api/common/test_mark_tasks.py
Python
apache-2.0
29,540
# # 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 us...
lukecwik/incubator-beam
sdks/python/apache_beam/examples/dataframe/wordcount.py
Python
apache-2.0
2,857
""" This sample shows how to loop through all users and delete all their content and groups Python 2.x ArcREST 3.5 """ from __future__ import print_function import arcrest from arcresthelper import resettools from arcresthelper import common def trace(): """ trace finds the line, the filename ...
pLeBlanc93/ArcREST
samples/remove_all_content_groups_allusers.py
Python
apache-2.0
2,295
""" Copyright 2020 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distr...
rachel-fenichel/blockly
appengine/main.py
Python
apache-2.0
1,173
"""Test converted models """ import os import argparse import sys import logging import mxnet as mx from convert_caffe_modelzoo import convert_caffe_model, get_model_meta_info curr_path = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.join(curr_path, "../../example/image-classification")) from test_...
danithaca/mxnet
tools/caffe_converter/test_converter.py
Python
apache-2.0
2,297
from CoreFoundation import * from Foundation import NSDictionary, NSMutableDictionary, NSCFDictionary from PyObjCTools.TestSupport import * try: long except NameError: long = int class TestCFDictionary (TestCase): def testCreation(self): dictionary = CFDictionaryCreate(None, ('aa...
albertz/music-player
mac/pyobjc-framework-Cocoa/PyObjCTest/test_cfdictionary.py
Python
bsd-2-clause
6,093
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.forms.fields import Field from django.forms.util import ValidationError as FormValidationError from django.template import TemplateSyntaxError from django.template.loader import get_template import re def ContextNameVali...
Krozark/Kraggne
Kraggne/fields.py
Python
bsd-2-clause
2,331
########################################################################## # # Copyright (c) 2011-2013, John Haddon. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
DoubleNegativeVisualEffects/gaffer
python/Gaffer/About.py
Python
bsd-3-clause
5,658
########################################################################## # # Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved. # Copyright (c) 2011-2012, John Haddon. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
DoubleNegativeVisualEffects/gaffer
python/GafferUI/CompoundVectorParameterValueWidget.py
Python
bsd-3-clause
4,546
from __future__ import absolute_import import unittest import bokeh.core.query as query from bokeh.models import ( Axis, BoxZoomTool, ColumnDataSource, DatetimeAxis, GlyphRenderer, Grid, LinearAxis, LogAxis, PanTool, Plot, PreviewSaveTool, Range1d, ResetTool, ResizeTool, Tool, WheelZoomTool, ) from bokeh.mod...
pombredanne/bokeh
bokeh/core/tests/test_query.py
Python
bsd-3-clause
6,856
def ignore(line): return line.startswith("m4_include") or line.startswith("#") or line.startswith("l:") or line.startswith("h:") or not len(line) def print_summary(summary): for language, data in summary.items(): with open(language.split()[1] + ".txt", "w", encoding='utf-8-sig') as outFile: keyLen = max(map(le...
FarGroup/FarManager
far/tools/translation.summary.py
Python
bsd-3-clause
1,144
from distutils.core import setup from distutils.command.install import INSTALL_SCHEMES import os import sys def fullsplit(path, result=None): """ Split a pathname into components (the opposite of os.path.join) in a platform-neutral way. """ if result is None: result = [] head, tail = os...
paulsmith/geodjango
setup.py
Python
bsd-3-clause
2,032
from tests.base_test_case import BaseTestCase import radiotherm from radiotherm.thermostat import CT50v194 class TestGetThermostatClass(BaseTestCase): def test_class_exists(self): ret = radiotherm.get_thermostat_class('CT50 V1.94') self.assertEqual(ret, CT50v194) def test_class_does_not_exist(...
trisk/radiotherm
tests/radiotherm/test_get_thermostat_class.py
Python
bsd-3-clause
418
from __future__ import absolute_import, unicode_literals from django.test import SimpleTestCase from localflavor.ar.forms import (ARProvinceSelect, ARPostalCodeField, ARDNIField, ARCUITField) class ARLocalFlavorTests(SimpleTestCase): def test_ARProvinceSelect(self): f =...
M157q/django-localflavor
tests/test_ar.py
Python
bsd-3-clause
4,069
""" Reference for line-styles included with Matplotlib. """ import numpy as np import matplotlib.pyplot as plt color = 'cornflowerblue' points = np.ones(5) # Draw 5 points for each line text_style = dict(horizontalalignment='right', verticalalignment='center', fontsize=12, fontdict={'family': 'mono...
bundgus/python-playground
matplotlib-playground/examples/lines_bars_and_markers/line_styles_reference.py
Python
mit
772
def read_data(filename): # Read filename where filename starts with comment lines # defined by symbol '#' then contains data in 2 columns # of identical length inp = open(filename, 'r') myline = inp.readline() while myline[0] == '#': myline = inp.readline() t = []; h = [] while myline: mls = myline.split()...
nicholasmalaya/arcanus
uq/ps3/read_data.py
Python
mit
429
""" Python 'hex_bytes' Codec - 2-digit hex codec with spaces between bytes. Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. """ import codecs, binascii from string import hexdigits ### Codec APIs def hex_encode(input, errors='stri...
chubbymaggie/Sark
sark/encodings/hex_bytes.py
Python
mit
2,424
# encoding: utf-8 """ Test suite for pptx.coreprops module """ from __future__ import absolute_import import pytest from datetime import datetime, timedelta from pptx.opc.constants import CONTENT_TYPE as CT from pptx.oxml.parts.coreprops import CT_CoreProperties from pptx.parts.coreprops import CoreProperties cl...
cchanrhiza/python-pptx
tests/parts/test_coreprops.py
Python
mit
8,938