code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
# ---------------------------------------------------------------------------- # Copyright (c) 2015--, micronota development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # ---------------------------------------------...
tkosciol/micronota
micronota/cli.py
Python
bsd-3-clause
3,634
# -*- coding: utf-8 -*- """ jinja2.testsuite.filters ~~~~~~~~~~~~~~~~~~~~~~~~ Tests for the jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Markup, Environment fro...
josephlewis42/magpie
magpie/lib/jinja2/testsuite/filters.py
Python
bsd-3-clause
19,379
import datetime from dateutil.tz import tzoffset from decimal import Decimal from django.db import models from django.contrib.auth.models import User from django.test import TestCase from django.http import HttpRequest from tastypie.bundle import Bundle from tastypie.exceptions import ApiFieldError, NotFound from tas...
ocadotechnology/django-tastypie
tests/core/tests/fields.py
Python
bsd-3-clause
56,800
#!/usr/bin/env python """NDG Security test harness for authorisation middleware NERC DataGrid Project """ __author__ = "P J Kershaw" __date__ = "20/11/08" __copyright__ = "(C) 2009 Science and Technology Facilities Council" __contact__ = "Philip.Kershaw@stfc.ac.uk" __revision__ = "$Id$" from os import path import opt...
philipkershaw/ndg_security_server
ndg/security/server/test/integration/openidrelyingparty/authenticationservicesapp.py
Python
bsd-3-clause
2,769
from django.db import models from django.contrib.auth.models import User from django.conf import settings import os class Animal(models.Model): name = models.CharField(max_length=150) latin_name = models.CharField(max_length=150) count = models.IntegerField() def __unicode__(self): return self...
weigj/django-multidb
tests/regressiontests/fixtures_regress/models.py
Python
bsd-3-clause
5,996
# -*- coding: utf-8 -*- # # __code_header example # put your license header here # it will be added to all the generated files # from bambou import NURESTFetcher class GARootsFetcher(NURESTFetcher): """ Represents a GARoots fetcher Notes: This fetcher enables to fetch GARoot objects. ...
nuagenetworks/monolithe
tests/base/sdk/python/tdldk/v1_0/fetchers/garoots_fetcher.py
Python
bsd-3-clause
598
#!/usr/bin/env python # -*- coding: utf-8 -*- from distutils.core import setup setup( name='saved_searches', version='2.0.0-alpha', description='Saves user searches for integration with Haystack.', author='Daniel Lindsley', author_email='daniel@toastdriven.com', url='http://github.com/toastdriv...
dablak/saved_searches
setup.py
Python
bsd-3-clause
792
#!/usr/bin/python import pymongo import string import sys from argparse import ArgumentParser def get_args(): parser = ArgumentParser(description='Run health checks of mongo and mtools systems') parser.add_argument('-a', '--action', dest='action', required=True, help='action to take...
ParsePlatform/flashback
record/set_mongo_profiling.py
Python
bsd-3-clause
2,460
from django import template from django.utils.safestring import mark_safe register = template.Library() @register.simple_tag def upload_js(): return mark_safe(""" <!-- The template to display files available for upload --> <script id="template-upload" type="text/x-tmpl"> {% for (var i=0, file; file=o.files[i]; i+...
raonyguimaraes/mendelmd
individuals/templatetags/upload_tags.py
Python
bsd-3-clause
3,137
from django import forms from django.contrib.auth import get_user_model from django.contrib.sites.shortcuts import get_current_site from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_lazy from connect.utils import send_connect_...
nlhkabu/connect
connect/accounts/utils.py
Python
bsd-3-clause
2,295
#!/usr/bin/env python import pytest import sklearn.datasets as datasets import sklearn.semi_supervised as ss import pandas_ml as pdml import pandas_ml.util.testing as tm class TestSemiSupervised(tm.TestCase): def test_objectmapper(self): df = pdml.ModelFrame([]) self.assertIs(df.s...
sinhrks/expandas
pandas_ml/skaccessors/test/test_semi_supervised.py
Python
bsd-3-clause
1,015
#!/usr/bin/python # -*- coding: utf-8 -*- # Software License Agreement (BSD License) # # Copyright (c) 2012, 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: # # * Redistrib...
jcicolani/Nomad
devel/_setup_util.py
Python
bsd-3-clause
12,770
# Copyright (c) 2013 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. """Parses the command line, discovers the appropriate tests, and runs them. Handles test configuration, but all the logic for actually running the test ...
ChromiumWebApps/chromium
tools/telemetry/telemetry/test_runner.py
Python
bsd-3-clause
6,124
# Copyright (c) 2011-2015 Berkeley Model United Nations. All rights reserved. # Use of this source code is governed by a BSD License (see LICENSE). import json import requests from django.conf import settings def get_contact(school): if not settings.ZOHO_CREDENTIALS: return list_url = 'https://invoic...
ctmunwebmaster/huxley
huxley/utils/zoho.py
Python
bsd-3-clause
1,767
# -*- coding: utf-8 -*- """ Tests for DatetimeArray """ import operator import numpy as np import pytest from pandas.core.dtypes.dtypes import DatetimeTZDtype import pandas as pd from pandas.core.arrays import DatetimeArray from pandas.core.arrays.datetimes import sequence_to_dt64ns import pandas.util.testing as tm ...
GuessWhoSamFoo/pandas
pandas/tests/arrays/test_datetimes.py
Python
bsd-3-clause
10,666
from decimal import Decimal from django.core import exceptions from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from oscar.core.compat import AUTH_USER_MODEL, user_is_authenticated @py...
sonofatailor/django-oscar
src/oscar/apps/voucher/abstract_models.py
Python
bsd-3-clause
6,712
import doto.model import doto.model.task CREATE_CMD = """ CREATE TABLE IF NOT EXISTS timerecords ( id INTEGER NOT NULL, task_id INTEGER, start TIMESTAMP, end TIMESTAMP, PRIMARY KEY (id)...
tantSinnister/doto
doto/model/timerecord.py
Python
bsd-3-clause
2,998
#!/usr/bin/env pythonw import sys from os import path import pkg_resources command = path.split(sys.argv[0])[-1] from .program_envs import prog_env if command.endswith(".py"): mpl_env = prog_env.get(command[:-3]) elif command.endswith("_a"): mpl_env = prog_env.get(command[:-2]) else: mpl_env = prog_env.g...
lfairchild/PmagPy
programs/__init__.py
Python
bsd-3-clause
1,586
import warnings import sqlalchemy as sa from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base, synonym_for from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy_utils import ( InstrumentedList, coercion_listener, aggregates...
tonyseek/sqlalchemy-utils
tests/__init__.py
Python
bsd-3-clause
3,454
DEBUG = True USE_TZ = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', } } INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'custom_user', 'test_custom_user_subclass', ] SECRET_KEY = 'not_random' AUTH_USER_MODEL = 'test_custom_user_subclass....
dragonfly-science/django-custom-user
test_settings/settings_subclass.py
Python
bsd-3-clause
339
from ..ndtypes import (make_slice_type, make_array_type, ptr_type, ArrayT, TupleT, ScalarT, Type, PtrT, Int64, IntT, Float64) from ..syntax import (Alloc, AllocArray, ArrayView, Const, Index, Slice, Struct, Var, Select, Expr) from ..syntax.helpers import (const, zero_i64, wrap_if_constant, slic...
pombredanne/parakeet
parakeet/builder/array_builder.py
Python
bsd-3-clause
9,545
import datetime from django.contrib.auth.decorators import user_passes_test from django.core import urlresolvers from django.http import Http404 from django.shortcuts import get_object_or_404, render_to_response from satchmo.payment.config import credit_choices from satchmo.product.models import Product, Category from ...
sankroh/satchmo
satchmo/feeds/views.py
Python
bsd-3-clause
1,945
class LayoutWidget: """ All top-level layout widgets and all widgets that may be set in an overlay must comply with this API. """ # Title is only required for windows, not overlay components title = "" keyctx = "" def key_responder(self): """ Returns the obje...
Kriechi/mitmproxy
mitmproxy/tools/console/layoutwidget.py
Python
mit
1,022
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild # The source was png.ksy from here - https://github.com/kaitai-io/kaitai_struct_formats/blob/9370c720b7d2ad329102d89bdc880ba6a706ef26/image/png.ksy import array import struct import zlib from enum import Enum from kaita...
laurmurclar/mitmproxy
mitmproxy/contrib/kaitaistruct/png.py
Python
mit
11,809
import random random.randint(0, 3) random.randint(0, 3) print(random.randint(0, 3)) print(random.randint(0, 3)) print(random.randint(0, 3)) # What does randint do? # What do the values 0 and 3 do? Try changing those numbers, rerun the program, and write down what changed. # What is the difference between random.randi...
bensk/CS9
_site/Code Examples/March21DoNow.py
Python
mit
361
# -*- coding: utf-8 -*- # Kay application: %app_name%
yosukesuzuki/kay-template
project/kay/management/app_template/__init__.py
Python
mit
54
import datetime import sqlalchemy as sa from sqlalchemy.testing import engines from sqlalchemy import testing from sqlalchemy import Integer, String, Date, ForeignKey, literal_column, \ orm, exc, select, TypeDecorator from sqlalchemy.testing.schema import Table, Column from sqlalchemy.orm import mapper, relationshi...
Cito/sqlalchemy
test/orm/test_versioning.py
Python
mit
27,671
"""Test that inheriting from something which is not a class emits a warning. """ # pylint: disable=no-init, import-error, invalid-name, using-constant-test, useless-object-inheritance # pylint: disable=missing-docstring, too-few-public-methods, no-absolute-import from missing import Missing if 1: Ambigu...
ruchee/vimrc
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/i/inherit_non_class.py
Python
mit
1,693
# -*- coding: iso-8859-15 -*- # ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # Angelos Tzotsos <tzotsos@gmail.com> # # Copyright (c) 2015 Tom Kralidis # Copyright (c) 2015 Angelos Tzotsos # # Permission is hereby granted, free of charge, to...
kevinpdavies/pycsw
pycsw/plugins/profiles/apiso/apiso.py
Python
mit
50,869
#!/usr/bin/env python3 # Copyright (c) 2015-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test BIP65 (CHECKLOCKTIMEVERIFY). Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) b...
bitcoinknots/bitcoin
test/functional/feature_cltv.py
Python
mit
8,354
# 对ass弹幕文件进行延时。。。 # 为什么会有这个需求呢?因为妈蛋ffmpeg剪切ts视频失败啊!! # 只好弹幕来配合了。。。 # 如果以后经常遇到。。再整理得好用一些。。。 # 酱~ import re def t_delay(h,m,s,delay): s += delay; if s >= 60: s -= 60 m += 1 if m >= 60: m -= 60 h += 1 return [h,m,s] filename = r'in.ass' delay = 30; fid = open(...
claudelee/bilibili-api
danmu-Delay/danmu_delay.py
Python
mit
966
#!/usr/bin/python import os from os.path import join, isdir def listfiles(the_path, depth): for f in os.listdir(the_path): f_or_d = join(the_path, f) if isdir(f_or_d): print "%s contains:" % (f_or_d) listfiles(f_or_d, depth + 1) else: print "%s%s" % (''.join("\t" * depth), f) def main(): listfiles("...
clotterman/Algorithmic-Nature
recursiveFunctions/12_python_list_recursive.py
Python
mit
362
import unittest from test import support import subprocess import sys import signal import os import tempfile import time import re mswindows = (sys.platform == "win32") # # Depends on the following external programs: Python # if mswindows: SETBINARY = ('import msvcrt; msvcrt.setmode(sys.stdout.fileno(), ' ...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.0/Lib/test/test_subprocess.py
Python
mit
31,033
import os import os.path from django.db import transaction from bibliotik import manage_bibliotik from bibliotik.models import BibliotikTransTorrent, BibliotikTorrent from home.models import LogEntry, DownloadLocation def sync_instance_db(instance): b_torrents = instance.get_b_torrents_by_hash() t_torrents ...
grandmasterchef/WhatManager2
bibliotik/trans_sync.py
Python
mit
3,805
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from indico.core.db import db from indico.modules.events.contributions.models.fields import ContributionFi...
pferreir/indico
indico/modules/events/abstracts/models/fields.py
Python
mit
1,096
# -*- coding: utf-8 -*- # # Copyright 2010 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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 Lice...
diorcety/translate
translate/storage/projstore.py
Python
gpl-2.0
14,767
"""distutils.unixccompiler Contains the UnixCCompiler class, a subclass of CCompiler that handles the "typical" Unix-style command-line C compiler: * macros defined with -Dname[=value] * macros undefined with -Uname * include search directories specified with -Idir * libraries specified with -lllib * library...
gautamMalu/rootfs_xen_arndale
usr/lib/python3.4/distutils/unixccompiler.py
Python
gpl-2.0
13,694
# TestIt.py # Copyright (C) 2009 Matthias Treder # # 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 ...
venthur/pyff
src/lib/P300VisualElement/TestIt.py
Python
gpl-2.0
1,957
# # Copyright (C) 2006, 2013 Red Hat, Inc. # Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.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 # (...
giuseppe/virt-manager
virtManager/about.py
Python
gpl-2.0
1,472
# -*- coding: utf-8 -*- # Copyright 2012 Jaap Karssenberg <jaap.karssenberg@gmail.com> import gtk from zim.fs import TrashNotSupportedError from zim.config import XDG_DATA_HOME, data_file from zim.templates import list_template_categories, list_templates from zim.gui.widgets import Dialog, BrowserTreeView, Button, ...
fabricehong/zim-desktop
zim/gui/templateeditordialog.py
Python
gpl-2.0
5,701
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """Base Indexed Corpus class.""" import logging import numpy from gensim import interfaces, utils logger = logging.getLogger(__name...
midnightradio/gensim
gensim/corpora/indexedcorpus.py
Python
gpl-3.0
6,432
# Copyright (c) 2011 The Chromium OS Authors. # # SPDX-License-Identifier: GPL-2.0+ # import command import re import os import series import subprocess import sys import terminal import checkpatch import settings # True to use --no-decorate - we check this in Setup() use_no_decorate = True def LogCmd(commit_range,...
sdphome/UHF_Reader
u-boot-2015.04/tools/patman/gitutil.py
Python
gpl-3.0
19,567
#----------------------------------------------------------------------------- # Copyright (c) 2005-2020, PyInstaller Development Team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # # The full license is in the file COPYING.txt, ...
etherkit/OpenBeacon2
macos/venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_enchant.py
Python
gpl-3.0
968
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2018 Steve R <steversig@virginmedia.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...
StefanBruens/libsigrokdecode
decoders/rc_encode/pd.py
Python
gpl-3.0
6,428
# -*- coding: utf-8 -*- # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 the License, or # (a...
s-hertel/ansible
test/units/plugins/connection/test_ssh.py
Python
gpl-3.0
31,464
# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this software; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. # from gnuradio import gr, gr_unittest from ...
greenoaktree/gr-burst
python/qa_synchronizer_v2.py
Python
gpl-3.0
1,453
hiddenimports = ['decimal']
ryandoherty/RaceCapture_App
install/hooks/hook-autosportlabs.racecapture.views.configuration.rcp.scriptview.py
Python
gpl-3.0
28
#Copyright (C) Nial Peters 2013 # #This file is part of AvoPlot. # #AvoPlot is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation, either version 3 of the License, or #(at your option) any later version. # #AvoPlot is ...
breisfeld/avoplot
src/avoplot/gui/gridlines.py
Python
gpl-3.0
2,511
############################################################################# ## ## Copyright (C) 2010 Hans-Peter Jansen <hpj@urpla.net>. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENSE:BSD$ ## You may ...
DevinDewitt/pyqt5
examples/widgets/stylesheet/stylesheeteditor.py
Python
gpl-3.0
4,557
# 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 https://mozilla.org/MPL/2.0/. # Copyright (c) 2017 Mozilla Corporation import os from bottle import route, run, response, request, default_app from b...
mpurzynski/MozDef
loginput/index.py
Python
mpl-2.0
6,727
# 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/. from __future__ import absolute_import, print_function from distutils.spawn import find_executable from distutils.versi...
sadmansk/servo
python/servo/bootstrap.py
Python
mpl-2.0
13,376
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # 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/. # ***** END LICENSE BLOCK ***** import os import sys import glob...
cstipkovic/spidermonkey-research
testing/mozharness/scripts/gaia_unit.py
Python
mpl-2.0
4,408
# -*- 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 GN...
poiesisconsulting/openerp-restaurant
epn/epn.py
Python
agpl-3.0
2,129
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class UsedSalesOrder(Document): pass
aruizramon/alec_erpnext
erpnext/selling/doctype/used_sales_order/used_sales_order.py
Python
agpl-3.0
276
""" Classes used to model the roles used in the courseware. Each role is responsible for checking membership, adding users, removing users, and listing members """ from abc import ABCMeta, abstractmethod from django.contrib.auth.models import User, Group from xmodule.modulestore import Location from xmodule.modulest...
mjg2203/edx-platform-seas
lms/djangoapps/courseware/roles.py
Python
agpl-3.0
7,324
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh.""" # pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long from import_shims.warn import warn_deprecated_import warn_deprecated_import('contentstore.views.checklists', 'cms.djangoapps.co...
eduNEXT/edunext-platform
import_shims/studio/contentstore/views/checklists.py
Python
agpl-3.0
410
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from . import gen_data_banks
factorlibre/l10n-spain
l10n_es_partner/gen_src/__init__.py
Python
agpl-3.0
95
############################################################################## # 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...
EmreAtes/spack
var/spack/repos/builtin/packages/r-iranges/package.py
Python
lgpl-2.1
2,504
from pylayers.gis.readvrml import * import pylayers.util.pyutil as pyu import matplotlib.pyplot as plt import numpy as np filename = pyu.getlong('B11D-E1.wrl','struc') VL = VLayout() VL.load(filename) plt.figure(figsize=(15,5)) # 0 1 WALL 2 3 4 VL.show(1) # # Analysis of walls # dwall = VL.wallanalysis() # # Visualiz...
buguen/pylayers
pylayers/gis/examples/ex_readvrml.py
Python
lgpl-3.0
2,081
a = 'blorg' def format(data): return 'formatted'
gbiggs/rtshell
test/blorg.py
Python
lgpl-3.0
55
"""The tests for the Switch component.""" import pytest from homeassistant import core from homeassistant.components import switch from homeassistant.const import CONF_PLATFORM from homeassistant.setup import async_setup_component from tests.components.switch import common @pytest.fixture(autouse=True) def entities...
home-assistant/home-assistant
tests/components/switch/test_init.py
Python
apache-2.0
2,287
#!/usr/bin/env python # The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/li...
sparkslabs/kamaelia
Sketches/RJL/bittorrent/BitTorrent/bittorrent-console.py
Python
apache-2.0
7,540
# Copyright (c) 2015 Orange. # 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 a...
stackforge/networking-bagpipe-l2
networking_bagpipe/tests/unit/agent/base.py
Python
apache-2.0
12,322
# Copyright 2013 PLUMgrid, 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 ...
leeseuljeong/leeseulstack_neutron
neutron/tests/unit/plumgrid/test_plumgrid_plugin.py
Python
apache-2.0
7,267
# # Copyright 2009 the Melange 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 law or agreed to i...
MatthewWilkes/mw4068-packaging
src/melange/src/soc/tasks/helper/__init__.py
Python
apache-2.0
654
""" Settings for the markup part. """ from django.conf import settings from django.core.exceptions import ImproperlyConfigured COMMENTS_APP = getattr(settings, 'COMMENTS_APP', 'comments') FLUENT_COMMENTSAREA_THREADEDCOMMENTS = 'threadedcomments' in settings.INSTALLED_APPS # Test threadedcomments support if FLUENT_C...
ixc/django-fluent-contents
fluent_contents/plugins/commentsarea/appsettings.py
Python
apache-2.0
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"); you may not u...
DinoCow/airflow
airflow/providers/microsoft/azure/example_dags/example_local_to_adls.py
Python
apache-2.0
1,492
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 requ...
savi-dev/keystone
tests/test_migrate_nova_auth.py
Python
apache-2.0
5,879
# coding=utf-8 # # 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 # di...
redhat-openstack/ironic
ironic/common/keystone.py
Python
apache-2.0
5,538
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2020 PyBuilder Team # # 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/l...
pybuilder/pybuilder
src/main/python/pybuilder/pip_utils.py
Python
apache-2.0
12,342
#!/bin/sh # -*- mode: 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....
sharvanath/cassandra
bin/cqlsh.py
Python
apache-2.0
104,917
# -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Version 2.0 (the "Lic...
sparkslabs/kamaelia_
Sketches/RJL/Util/Lagger.py
Python
apache-2.0
1,090
from django.db import models class AssetField(models.ForeignKey): description = 'A file asset' def __init__(self, **kwargs): kwargs.setdefault('blank', True) kwargs.setdefault('null', True) kwargs.setdefault('default', None) # Normally, Django creates a backwards relationship...
AlmostBetterNetwork/podmaster-host
assets/fields.py
Python
apache-2.0
1,224
# Webhooks for external integrations. from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.models import get_client from zerver.lib.actions import check_send_stream_message from zerver.lib.response import json_success, json_error from zerver.decorator import...
amanharitsh123/zulip
zerver/webhooks/semaphore/view.py
Python
apache-2.0
2,201
# -*- coding: utf-8 -*- from website.addons.dataverse.client import get_dataset, get_files, \ get_dataverse, connect_from_settings from website.project.decorators import must_be_contributor_or_public from website.project.decorators import must_have_addon from website.util import rubeus def dataverse_hgrid_root(...
revanthkolli/osf.io
website/addons/dataverse/views/hgrid.py
Python
apache-2.0
2,011
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
zen/openstack-dashboard
django-openstack/django_openstack/tests/view_tests/dash/container_tests.py
Python
apache-2.0
4,367
_CPB_EDIT_HOST='CPB_EDIT_HOST' _CPB_EDIT_USER='CPB_EDIT_USER' _CPB_EDIT_PASS='CPB_EDIT_PASS' _NCBI_URI='https://ftp.ncbi.nih.gov' _NCBI_PATH='/gene/DATA/GENE_INFO/Mammalia/'
Zhong-Lab-UCSD/Genomic-Interactive-Visualization-Engine
includes/constants_template.py
Python
apache-2.0
175
from django.contrib import admin from django.utils.safestring import mark_safe from .models import Asset from dashboard.models import AssetImportRequest class AssetImportRequestInline(admin.TabularInline): model = AssetImportRequest fk_name = 'asset' readonly_fields = ('resolved', 'failed', ) extra =...
Pinecast/pinecast
assets/admin.py
Python
apache-2.0
1,531
# # Copyright 2016 Quantopian, 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 wr...
humdings/zipline
zipline/data/data_portal.py
Python
apache-2.0
51,743
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. __all__ = ["ClrClass", "ClrInterface", "accepts", "returns", "attribute", "propagate_attributes"] import clr c...
slozier/ironpython2
Src/StdLib/Lib/clrtype.py
Python
apache-2.0
27,760
test = { 'name': '', 'points': 1, 'suites': [ { 'cases': [ { 'code': r""" >>> print_kth_top_movie_year(4) Year number 4 for total gross movie sales was: 2009 """, 'hidden': False, 'locked': False }, ], 'scored': Tru...
jamesfolberth/NGC_STEM_camp_AWS
notebooks/data8_notebooks/lab04/tests/q2_5.py
Python
bsd-3-clause
400
from __future__ import absolute_import from sentry.models import OrganizationMember from sentry.testutils import AcceptanceTestCase class ListOrganizationMembersTest(AcceptanceTestCase): def setUp(self): super(ListOrganizationMembersTest, self).setUp() self.user = self.create_user('foo@example.co...
looker/sentry
tests/acceptance/test_member_list.py
Python
bsd-3-clause
1,244
from django.contrib import admin from oscar.apps.shipping.models import ( OrderAndItemCharges, WeightBand, WeightBased) class OrderChargesAdmin(admin.ModelAdmin): exclude = ('code',) list_display = ('name', 'description', 'price_per_order', 'price_per_item', 'free_shipping_threshold')...
elliotthill/django-oscar
oscar/apps/shipping/admin.py
Python
bsd-3-clause
576
from __future__ import absolute_import, print_function from datetime import timedelta from django.utils import timezone from django.core.exceptions import ValidationError from mock import patch import pytest from sentry.models import ScheduledJob from sentry.models.scheduledjob import schedule_jobs from sentry.testu...
ifduyue/sentry
tests/sentry/tasks/test_enqueue_scheduled_jobs.py
Python
bsd-3-clause
2,512
from django.db import models class Article(models.Model): headline = models.CharField(max_length=100) pub_date = models.DateTimeField() class Meta: index_together = [ ["headline", "pub_date"], ]
Proggie02/TestRepo
tests/regressiontests/indexes/models.py
Python
bsd-3-clause
238
''' go list comprehensions ''' def main(): a = []int(x for x in range(3)) TestError( len(a)==3 ) TestError( a[0]==0 ) TestError( a[1]==1 ) TestError( a[2]==2 )
pombredanne/PythonJS
regtests/go/list_comprehension.py
Python
bsd-3-clause
167
from qiita_db.user import User from json import loads, dumps from qiita_core.qiita_settings import r_client from qiita_db.sql_connection import TRN from qiita_db.software import Software, Command from qiita_db.exceptions import QiitaDBError, QiitaDBDuplicateError from qiita_db.util import convert_to_id # one of the ...
ElDeveloper/qiita
qiita_db/support_files/patches/python_patches/75.py
Python
bsd-3-clause
7,784
# -*- coding: utf-8 -*- import unittest import os import numpy as npy from skrf.media import DefinedGammaZ0, Media from skrf.network import Network from skrf.frequency import Frequency import skrf class DefinedGammaZ0TestCase(unittest.TestCase): def setUp(self): self.files_dir = os.path.join( ...
scikit-rf/scikit-rf
skrf/media/tests/test_media.py
Python
bsd-3-clause
11,278
# This file taken from Python, licensed under the Python License Agreement from __future__ import print_function """ Tests common to list and UserList.UserList """ import sys import os from blist.test import unittest from blist.test import test_support from blist.test import seq_tests from decimal import Decimal d...
pfmoore/blist
blist/test/list_tests.py
Python
bsd-3-clause
19,502
"""A module that handles matrices. Includes functions for fast creating matrices like zero, one/eye, random matrix etc. """ from matrices import Matrix, SMatrix, zero, zeronm, zeros, one, ones, eye, \ hessian, randMatrix, GramSchmidt, wronskian, casoratian, \ list2numpy, matrix2numpy, DeferredVector
hazelnusse/sympy-old
sympy/matrices/__init__.py
Python
bsd-3-clause
312
# -*- coding: utf-8 -*- from datetime import datetime import simplejson as json from bson import ObjectId from bson.dbref import DBRef from cerberus import SchemaError from unittest import TestCase from eve.io.mongo import Validator, Mongo, MongoJSONEncoder from eve.io.mongo.parser import parse, ParseError from eve.t...
bcrochet/eve
eve/tests/io/mongo.py
Python
bsd-3-clause
14,202
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
samedder/azure-cli
src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/_exception_handler.py
Python
mit
800
import pytest from qtpy import PYSIDE2, PYSIDE6, PYQT6 @pytest.mark.skipif((PYSIDE6 or PYQT6), reason="not available with qt 6.0") def test_qtxmlpatterns(): """Test the qtpy.QtXmlPatterns namespace""" from qtpy import QtXmlPatterns assert QtXmlPatterns.QAbstractMessageHandler is not None assert QtXmlPa...
stonebig/winpython
winpython/_vendor/qtpy/tests/test_qtxmlpatterns.py
Python
mit
1,117
''' Proxy for drivers. Copyright (c) 2009, 2013 Peter Parente Permission to use, copy, modify, and 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 AUTHOR ...
openrobotics/openrobotics_thunderbot
pyttsx/pyttsx/driver.py
Python
mit
6,982
#!/usr/bin/env python """ Batch Normalization + SVRG on MNIST CPU Version Independent Study May 18, 2016 Yintai Ma """ from __future__ import print_function import sys import os import time import matplotlib import matplotlib.pyplot as plt import pylab import numpy as np import theano import theano.tensor as T i...
myt00seven/svrg
nips2017_mnist/mnist.py
Python
mit
14,964
''' Video ===== The :class:`Video` widget is used to display video files and streams. Depending on your Video core provider, platform, and plugins, you will be able to play different formats. For example, the pygame video provider only supports MPEG1 on Linux and OSX. GStreamer is more versatile, and can read many vid...
ehealthafrica-ci/kivy
kivy/uix/video.py
Python
mit
7,503
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by roadhump # Copyright (c) 2014 roadhump # # License: MIT # """This module exports the ESLint plugin class.""" import sublime import os import re from SublimeLinter.lint import NodeLinter class ESLint(NodeLinter): ...
thatneat/dotfiles
other_applications/sublime-text-3/Packages/SublimeLinter-contrib-eslint/linter.py
Python
mit
3,189
import urwid from mitmproxy import http from mitmproxy.tools.console import common, searchable from mitmproxy.utils import human from mitmproxy.utils import strutils def maybe_timestamp(base, attr): if base is not None and getattr(base, attr): return human.format_timestamp_with_milli(getattr(base, attr))...
zlorb/mitmproxy
mitmproxy/tools/console/flowdetailview.py
Python
mit
5,591
## # Copyright 2015-2021 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
boegel/easybuild-easyblocks
easybuild/easyblocks/s/samcef.py
Python
gpl-2.0
4,106
# ChangeFile # A class which represents a Debian change file. # Copyright 2002 Colin Walters <walters@gnu.org> # This file 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...
xypron/mini-dinstall
minidinstall/ChangeFile.py
Python
gpl-2.0
4,579