repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
jank3/django | django/core/exceptions.py | 486 | 5276 | """
Global Django exception and warning classes.
"""
from django.utils import six
from django.utils.encoding import force_text
class FieldDoesNotExist(Exception):
"""The requested model field does not exist"""
pass
class DjangoRuntimeWarning(RuntimeWarning):
pass
class AppRegistryNotReady(Exception):
... | bsd-3-clause |
Zhang-O/small | tensor__cpu/http/spyser_liyou.py | 1 | 5473 | import urllib.request
from bs4 import BeautifulSoup
import re
import urllib.parse
import xlsxwriter
import pandas as pd
import numpy as np
from urllib import request, parse
from urllib.error import URLError
import json
import multiprocessing
import time
# 详情页面的 地址 存放在这里面
urls_of_detail = []
total_pages = 0
# 要爬取的内容 ... | mit |
takeshineshiro/wagtail | wagtail/wagtailadmin/tests/test_page_chooser.py | 12 | 12788 | from django.test import TestCase
from django.core.urlresolvers import reverse
from wagtail.wagtailcore.models import Page
from wagtail.tests.testapp.models import SimplePage, EventPage, EventIndex
from wagtail.tests.utils import WagtailTestUtils
class TestChooserBrowse(TestCase, WagtailTestUtils):
def setUp(self... | bsd-3-clause |
zxsted/scipy | scipy/ndimage/io.py | 69 | 1320 | from __future__ import division, print_function, absolute_import
__all__ = ['imread']
from numpy import array
def imread(fname, flatten=False, mode=None):
"""
Read an image from a file as an array.
Parameters
----------
fname : str
Image file name, e.g. ``test.jpg``, or a file object.
... | bsd-3-clause |
zhanqxun/cv_fish | win32/test/test_win32pipe.py | 4 | 5680 | import unittest
import time
import threading
from pywin32_testutil import str2bytes # py3k-friendly helper
import win32pipe
import win32file
import win32event
import pywintypes
import winerror
import win32con
class PipeTests(unittest.TestCase):
pipename = "\\\\.\\pipe\\python_test_pipe"
def ... | apache-2.0 |
gdhungana/desispec | py/desispec/test/test_cosmics.py | 2 | 3730 | """
test desispec.cosmics
"""
import unittest
import numpy as np
from desispec.image import Image
from desispec.cosmics import reject_cosmic_rays_ala_sdss, reject_cosmic_rays
from desispec.log import get_logger
from desispec.maskbits import ccdmask
#- Create a DESI logger at level WARNING to quiet down the fiberflat ... | bsd-3-clause |
lastweek/gem5 | src/arch/x86/isa/insts/general_purpose/compare_and_test/bounds.py | 41 | 2471 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
abenzbiria/clients_odoo | addons/product_margin/__openerp__.py | 121 | 1927 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
eleonrk/SickRage | lib/hachoir_parser/misc/pdf.py | 95 | 16790 | """
Adobe Portable Document Format (PDF) parser.
Author: Christophe Gisquet <christophe.gisquet@free.fr>
"""
from hachoir_parser import Parser
from hachoir_core.field import (
Field, FieldSet,
ParserError,
GenericVector,
UInt8, UInt16, UInt32,
String,
RawBytes)
from hachoir_core.endian import ... | gpl-3.0 |
coolbombom/CouchPotatoServer | libs/pyutil/benchmarks/bench_xor.py | 106 | 1658 | #!/usr/bin/env python
# Copyright (c) 2002-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import hmac, sys, random
from pyutil.assertutil import _assert
from pyutil.xor import xor
from pyutil import benchfunc
from pyutil import randutil
SFUNCS = [hmac._strxor, xor.py_... | gpl-3.0 |
spisneha25/django | django/contrib/gis/feeds.py | 336 | 5978 | from __future__ import unicode_literals
from django.contrib.syndication.views import Feed as BaseFeed
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C ... | bsd-3-clause |
davelab6/pyfontaine | fontaine/charsets/noto_glyphs/notosansgeorgian_bold.py | 2 | 5263 | # -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansGeorgian-Bold'
native_name = ''
def glyphs(self):
glyphs = []
glyphs.append(0x0044) #uni10EA
glyphs.append(0x0046) #uni10EC
glyphs.append(0x0045) #uni10EB
glyphs.append(0x0048) #uni10EE
... | gpl-3.0 |
DStauffman/dstauffman | dstauffman/numba/optimized.py | 1 | 6619 | r"""
Replacement utilities that are optimized for speed using numba but not numpy.
Notes
-----
#. Written by David C. Stauffer in July 2020.
#. Moved into a submodule by David C. Stauffer in February 2021.
"""
#%% Imports
from __future__ import annotations
import doctest
import math
from typing import Sequence
impo... | lgpl-3.0 |
janplus/xbmc-addons-chinese | plugin.video.bdyun/resources/modules/rsa/pkcs1.py | 81 | 12230 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Un... | gpl-2.0 |
vnsofthe/odoo-dev | addons/account/wizard/account_chart.py | 271 | 5191 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
Nik0las1984/mudpyl | mudpyl/net/nvt.py | 1 | 5604 | """This module contains tools for emulating a network virtual terminal. See
RFC 854 for details of the NVT commands, and VT100 documentation for the
colour codes.
"""
from mudpyl.metaline import Metaline, RunLengthList
from mudpyl.colours import NORMAL_CODES, fg_code, bg_code, WHITE, BLACK
import re
ALL_RESET = '0'
B... | gpl-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_profile.py | 6 | 14052 | # Copyright 2014 Software Freedom Conservancy
# Copyright 2008-2011 WebDriver committers
# Copyright 2008-2011 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.a... | agpl-3.0 |
willingc/oh-mainline | vendor/packages/Pygments/scripts/vim2pygments.py | 127 | 26283 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Vim Colorscheme Converter
~~~~~~~~~~~~~~~~~~~~~~~~~
This script converts vim colorscheme files to valid pygments
style classes meant for putting into modules.
:copyright 2006 by Armin Ronacher.
:license: BSD, see LICENSE for details.
"""
impor... | agpl-3.0 |
ARudiuk/mne-python | mne/channels/interpolation.py | 4 | 6510 | # Authors: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
from numpy.polynomial.legendre import legval
from scipy import linalg
from ..utils import logger, warn
from ..io.pick import pick_types, pick_channels, pick_info
from ..surface import _normalize_vectors
from ..bem impo... | bsd-3-clause |
sanghinitin/golismero | thirdparty_libs/nltk/tokenize/__init__.py | 17 | 3600 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Tokenizers
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (minor additions)
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
r"""
NLTK Tokenizer P... | gpl-2.0 |
ruby32/solarcoin | qa/rpc-tests/assumevalid.py | 45 | 7764 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
assumevalid.py
Test logic for skipping signature validation on blocks which we've assumed
valid (http... | mit |
nickhand/nbodykit | nbodykit/source/mesh/array.py | 2 | 1952 | from nbodykit.base.mesh import MeshSource
from nbodykit import CurrentMPIComm
from nbodykit.utils import attrs_to_dict
from pmesh.pm import RealField, ComplexField
import numpy
class ArrayMesh(MeshSource):
"""
A MeshSource initalized from an in-memory numpy array.
.. note::
The in-memory array mu... | gpl-3.0 |
lloeki/python-dcpu_16 | test.py | 1 | 8924 | import unittest
import random
import dcpu_16
from dcpu_16 import CPU
class TestInstructions(unittest.TestCase):
"""Instruction set"""
def setUp(self):
pass
def test_SET(self):
dcpu_16.SET.opcode = (0x1,)
c = CPU()
c.a = 0x0
c.b = 0x42
dcpu_16.SET(c, c._poin... | bsd-3-clause |
zenodo/invenio | invenio/modules/formatter/manage.py | 13 | 10738 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014 CERN.
#
# Invenio 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... | gpl-2.0 |
RCAD/ringling-render-tools | src/rrt/maya/ui/submit.py | 1 | 13088 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\src\rrt\maya\ui\submit.ui'
#
# Created: Wed Oct 24 16:19:16 2012
# by: PyQt4 UI code generator 4.7.7
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUt... | mit |
alekseyev/wheatleycms | docutils/parsers/rst/languages/en.py | 6 | 3219 | # $Id: en.py 6460 2010-10-29 22:18:44Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated f... | bsd-3-clause |
riklaunim/django-custom-multisite | django/contrib/flatpages/views.py | 94 | 2859 | from django.contrib.flatpages.models import FlatPage
from django.template import loader, RequestContext
from django.shortcuts import get_object_or_404
from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect
from django.conf import settings
from django.core.xheaders import populate_xheaders
from dja... | bsd-3-clause |
jeanlinux/calibre | src/calibre/gui2/actions/view.py | 14 | 12505 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, time
from functools import partial
from PyQt5.Qt import Qt, QAction, pyqtSignal
from calibre.constants import... | gpl-3.0 |
kunalarya/simple-sat-solver | satsolver/solver.py | 1 | 9011 | from __future__ import print_function
import argparse
import logging
from collections import namedtuple
import satsolver.parser as parser
from satsolver.util import Success, Failure
from satsolver.state import Instance
class Node(object):
def __init__(self, lit, asg, level):
assert lit > 0
self.... | apache-2.0 |
luyijun/evennia_worldloader | worldloader/example_tutorial_world/worlddata/migrations/0001_initial.py | 1 | 5070 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='personal_objects',
fields=[
('key', models.Char... | bsd-3-clause |
CMUSV-VisTrails/WorkflowRecommendation | vistrails/packages/analytics/__init__.py | 1 | 1938 | ###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | bsd-3-clause |
namecoin/namecore | test/functional/test_framework/bignum.py | 77 | 1230 | #!/usr/bin/env python3
#
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Big number routines.
This file is copied from python-bitcoinlib.
"""
import struct
# generic big endian MPI format
def bn_bytes(v, have_ext=False):
... | mit |
zawzawzaw/offshore | node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | gpl-2.0 |
prodromou87/gem5 | src/mem/slicc/ast/FuncDeclAST.py | 18 | 3409 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
poryfly/scikit-learn | sklearn/manifold/spectral_embedding_.py | 128 | 19845 | """Spectral Embedding"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse
from scipy.linalg import eigh
from scipy.sparse.linalg import lobpcg
from ..base import BaseEstimator
from ..ext... | bsd-3-clause |
nanolearning/edx-platform | common/djangoapps/student/migrations/0001_initial.py | 188 | 8556 | # encoding: 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):
# Adding model 'UserProfile'
db.create_table('auth_userprofile', (
('id', self.gf('django.db.models.f... | agpl-3.0 |
bennojoy/ansible | lib/ansible/plugins/filter/core.py | 10 | 10867 | # (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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
# (at your option) any later version.... | gpl-3.0 |
M4sse/chromium.src | chrome/test/chromeos/utilities/vm_setup_state.py | 184 | 1114 | #!/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.
import logging
import pyauto_functional # has to be imported before pyauto
import pyauto
import sys
VM_CHROMEDRIVER_PORT = 4444
i... | bsd-3-clause |
HiroIshikawa/21playground | visualizer/_app_boilerplate/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py | 477 | 30319 | import errno
import logging
import sys
import warnings
from socket import error as SocketError, timeout as SocketTimeout
import socket
try: # Python 3
from queue import LifoQueue, Empty, Full
except ImportError:
from Queue import LifoQueue, Empty, Full
import Queue as _ # Platform-specific: Windows
fr... | mit |
toshywoshy/ansible | test/lib/ansible_test/_internal/git.py | 56 | 4379 | """Wrapper around git command-line tools."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from . import types as t
from .util import (
SubprocessError,
raw_command,
)
class Git:
"""Wrapper around git command-line tools."""
def __init__(self, root... | gpl-3.0 |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtGui/QAbstractSpinBox.py | 1 | 9176 | # encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
from .QWidget import QWidget
class QAbstractSpinBox(QWidget):
""" QAbstractSpinBox(QWidget parent=None) """
d... | gpl-2.0 |
broferek/ansible | lib/ansible/modules/network/aci/aci_l3out.py | 8 | 11082 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
wiso/dask | dask/store/core.py | 15 | 2780 | from collections import defaultdict, MutableMapping
from operator import getitem, add
from datetime import datetime
from time import time
from ..core import istask, ishashable
class Store(MutableMapping):
""" Store - A storage of data and computation
Example
-------
Store data like a dictionary
... | bsd-3-clause |
liqi328/rjrepaircompany | django/contrib/sessions/backends/cache.py | 268 | 1881 | from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.cache import cache
class SessionStore(SessionBase):
"""
A cache-based session store.
"""
def __init__(self, session_key=None):
self._cache = cache
super(SessionStore, self).__init__(session_key)
... | bsd-3-clause |
zxsted/scipy | scipy/sparse/linalg/isolve/iterative/test.py | 110 | 4126 | from __future__ import division, print_function, absolute_import
from scipy import *
from iterative import *
def test_fun(alpha, x, beta, y, A, n):
# compute z = alpha*A*x + beta*y
xx = x[:n]
yy = y[:n]
w = dot(A,xx)
z = alpha*w+beta*yy
y[:n] = z
return
def test_fun_t(alpha, x, beta, y,... | bsd-3-clause |
spencerpomme/coconuts-on-fire | person.py | 1 | 1237 | from classtools import AttrDisplay
class Person(AttrDisplay):
'''
Create and process person records
'''
def __init__(self, name, job=None, pay=0):
self.name = name
self.job = job
self.pay = pay
def lastName(self):
return self.name.split()[-1]
def giveRaise(self... | apache-2.0 |
jnerin/ansible | lib/ansible/modules/network/nxos/nxos_snmp_user.py | 7 | 9187 | #!/usr/bin/python
#
# 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
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
cloudbase/neutron-virtualbox | neutron/plugins/sriovnicagent/sriov_nic_agent.py | 2 | 14544 | # Copyright 2014 Mellanox Technologies, Ltd
#
# 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 t... | apache-2.0 |
jeffrey4l/nova | nova/tests/functional/v3/test_admin_actions.py | 24 | 2623 | # Copyright 2012 Nebula, Inc.
# 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... | apache-2.0 |
isyippee/nova | nova/tests/unit/api/openstack/compute/test_floating_ips.py | 14 | 38097 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 Eldar Nugaev
# 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://... | apache-2.0 |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/scipy/linalg/blas.py | 37 | 6855 | """
Low-level BLAS functions (:mod:`scipy.linalg.blas`)
===================================================
This module contains low-level functions from the BLAS library.
.. versionadded:: 0.12.0
.. warning::
These functions do little to no error checking.
It is possible to cause crashes by mis-using them,
... | gpl-3.0 |
j4/horizon | openstack_dashboard/dashboards/project/routers/tables.py | 38 | 8661 | # Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... | apache-2.0 |
mauzeh/formation-flight | runs/singlehub/z/run.py | 1 | 1259 | #!/usr/bin/env python
"""Simulation bootstrapper"""
from formation_flight.formation import handlers as formation_handlers
from formation_flight.aircraft import handlers as aircraft_handlers
from formation_flight.aircraft import generators
from formation_flight.hub import builders
from formation_flight.hub import alloc... | mit |
adoosii/edx-platform | lms/djangoapps/courseware/migrations/0011_add_model_StudentFieldOverride.py | 94 | 11581 | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'St... | agpl-3.0 |
octopicorn/cloudbrain | cloudbrain/connectors/MockConnector.py | 1 | 1165 | import time
import random
from cloudbrain.connectors.ConnectorInterface import Connector
from cloudbrain.utils.metadata_info import get_num_channels
class MockConnector(Connector):
def __init__(self, publishers, buffer_size, device_name, device_port='mock_port', device_mac=None):
"""
:return:
"""
... | agpl-3.0 |
insequent/quark | quark/cache/security_groups_client.py | 1 | 8108 | # Copyright 2014 Openstack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
klim-iv/phantomjs-qt5 | src/webkit/Tools/Scripts/webkitpy/tool/steps/applypatch.py | 128 | 2041 | # Copyright (C) 2010 Google 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 conditions and th... | bsd-3-clause |
github-account-because-they-want-it/django | tests/bash_completion/tests.py | 327 | 3888 | """
A series of tests to establish that the command-line bash completion works.
"""
import os
import sys
import unittest
from django.apps import apps
from django.core.management import ManagementUtility
from django.test.utils import captured_stdout
class BashCompletionTests(unittest.TestCase):
"""
Testing th... | bsd-3-clause |
netsamir/dotfiles | files/vim/bundle/YouCompleteMe/python/ycm/setup.py | 9 | 1867 | # Copyright (C) 2016 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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) ... | unlicense |
thebestgirl123/CloudBot | plugins/name_generator.py | 28 | 2056 | """
name_generator.py
Generates fun names using the textgen module.
Created By:
- Luke Rogers <https://github.com/lukeroge>
License:
GPL v3
"""
import json
import codecs
import os
from cloudbot import hook
from cloudbot.util import formatting, textgen
def get_generator(_json):
data = json.loads(_json... | gpl-3.0 |
harisbal/pandas | pandas/tests/test_panel.py | 1 | 95658 | # -*- coding: utf-8 -*-
# pylint: disable=W0612,E1101
from warnings import catch_warnings, simplefilter
from datetime import datetime
import operator
import pytest
import numpy as np
from pandas.core.dtypes.common import is_float_dtype
from pandas import (Series, DataFrame, Index, date_range, isna, notna,
... | bsd-3-clause |
dongjoon-hyun/tensorflow | tensorflow/python/ops/linalg/linear_operator_block_diag.py | 23 | 14165 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
alvations/Paddle | demo/recommendation/prediction.py | 2 | 1973 | #!/bin/env python2
# Copyright (c) 2016 Baidu, Inc. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
maaaks/andreas | andreas/db/model.py | 1 | 3293 | from typing import Dict, List, Optional, Tuple, Type
from playhouse import signals
from andreas.db.database import db
class Model(signals.Model):
class Meta:
database = db
schema = 'andreas'
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
... | mit |
avoinsystems/odoo | addons/account/res_currency.py | 340 | 2267 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010 OpenERP s.a. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... | agpl-3.0 |
richardcs/ansible | lib/ansible/modules/cloud/azure/azure_rm_containerinstance_facts.py | 33 | 9452 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
yongshengwang/hue | build/env/lib/python2.7/site-packages/Mako-0.8.1-py2.7.egg/mako/exceptions.py | 38 | 12536 | # mako/exceptions.py
# Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""exception classes"""
import traceback
import sys
import re
from mako import util, compat
c... | apache-2.0 |
malkoto1/just_cook | SQLAlchemy-1.0.4/lib/sqlalchemy/orm/descriptor_props.py | 60 | 25141 | # orm/descriptor_props.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Descriptor properties are more "auxiliary" properties
that exist as confi... | gpl-2.0 |
enavarro222/bblamp | webserver.py | 1 | 5293 | #!/usr/bin/python
#-*- coding:utf-8 -*-
import os
import sys
import json
# Make sure your gevent version is >= 1.0
import gevent
from gevent.wsgi import WSGIServer
from gevent.queue import Queue
from flask import Flask, Response
from flask import render_template, jsonify
from utils import ServerSentEvent
from api i... | agpl-3.0 |
kamladi/textback-web | twilio/rest/resources/sip/ip_access_control_lists.py | 4 | 3742 | from twilio.rest.resources import InstanceResource, ListResource
class IpAddress(InstanceResource):
""" An IP address entry in an Access Control List.
.. attribute:: sid
A 34 character string that uniquely identifies this resource.
.. attribute:: account_sid
The unique id of the Accoun... | mit |
molly/brandeis | tests/testvalidator.py | 1 | 3946 | # -*- coding: utf-8 -*-
# Brandeis - A tool to convert plaintext court cases (from the lochner
# tool: http://gitorious.org/lochner/) to wikitext.
#
# Copyright (C) 2013 Molly White
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | gpl-3.0 |
Pakoach/Sick-Beard | tests/scene_helpers_tests.py | 67 | 7197 | import unittest
import test_lib as test
import sys, os.path
sys.path.append(os.path.abspath('..'))
from sickbeard import show_name_helpers, scene_exceptions, common, name_cache
import sickbeard
from sickbeard import db
from sickbeard.databases import cache_db
from sickbeard.tv import TVShow as Show
c... | gpl-3.0 |
arbrandes/edx-platform | openedx/core/lib/tests/test_edx_api_utils.py | 4 | 12410 | """Tests covering edX API utilities."""
# pylint: disable=missing-docstring
import json
from unittest import mock
import httpretty
from django.core.cache import cache
from openedx.core.djangoapps.catalog.models import CatalogIntegration
from openedx.core.djangoapps.catalog.tests.mixins import CatalogIntegrationMixin... | agpl-3.0 |
phenoxim/nova | nova/privsep/fs.py | 3 | 12041 | # Copyright 2016 Red Hat, Inc
# Copyright 2017 Rackspace Australia
#
# 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
#
# Unles... | apache-2.0 |
enthought/distarray | docs/www/pelican-plugins/liquid_tags/include_code.py | 246 | 4490 | """
Include Code Tag
----------------
This implements a Liquid-style video tag for Pelican,
based on the octopress video tag [1]_
Syntax
------
{% include_code path/to/code [lang:python] [Title text] [codec:utf8] %}
The "path to code" is specified relative to the ``code`` subdirectory of
the content directory Option... | bsd-3-clause |
ualikhansars/Gwent | lib/python2.7/site-packages/django/contrib/gis/forms/fields.py | 504 | 4316 | from __future__ import unicode_literals
from django import forms
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from django.utils.translation import ugettext_lazy as _
from .widgets import OpenLayersWidget
class GeometryField(forms.Field):
"""
This is the basic form field for a Geometry. A... | mit |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/sympy/mpmath/tests/test_convert.py | 20 | 7364 | import random
from sympy.mpmath import *
from sympy.mpmath.libmp import *
def test_basic_string():
"""
Test basic string conversion
"""
mp.dps = 15
assert mpf('3') == mpf('3.0') == mpf('0003.') == mpf('0.03e2') == mpf(3.0)
assert mpf('30') == mpf('30.0') == mpf('00030.') == mpf(30.0)
for i... | mit |
darkryder/django | tests/template_tests/syntax_tests/test_static.py | 335 | 2614 | from django.conf import settings
from django.test import SimpleTestCase, override_settings
from django.utils.six.moves.urllib.parse import urljoin
from ..utils import setup
@override_settings(MEDIA_URL="/media/", STATIC_URL="/static/")
class StaticTagTests(SimpleTestCase):
libraries = {'static': 'django.template... | bsd-3-clause |
postmanlabs/postman-chrome-interceptor | scripts/configure.py | 2 | 1336 | # Configure Postman for testing or production
import os
import os.path, time
import string
import json
import shutil
import PIL
from optparse import OptionParser
from datetime import datetime
from jinja2 import Environment, PackageLoader, Template
def generate_config_file(web_url):
directory = os.path.dirname(os.path... | apache-2.0 |
2ndQuadrant/ansible | lib/ansible/executor/action_write_locks.py | 140 | 1911 | # (c) 2016 - Red Hat, Inc. <info@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
# (at your option) any later versi... | gpl-3.0 |
basicthinker/ThyNVM | src/arch/x86/isa/insts/general_purpose/data_transfer/xchg.py | 89 | 3288 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
toofishes/django-mailer | mailer/__init__.py | 9 | 3337 | VERSION = (0, 2, 0, "a", 1) # following PEP 386
DEV_N = 1
def get_version():
version = "%s.%s" % (VERSION[0], VERSION[1])
if VERSION[2]:
version = "%s.%s" % (version, VERSION[2])
if VERSION[3] != "f":
version = "%s%s%s" % (version, VERSION[3], VERSION[4])
if DEV_N:
vers... | mit |
mchristopher/PokemonGo-DesktopMap | app/pylibs/win32/Cryptodome/SelfTest/Util/test_Padding.py | 2 | 5793 | #
# SelfTest/Util/test_Padding.py: Self-test for padding functions
#
# ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are p... | mit |
jraede/dd-agent | dogstream/cassandra.py | 34 | 2560 | from datetime import datetime
import re
from dogstream import common
LOG4J_PRIORITY = [
"TRACE",
"DEBUG",
"INFO",
"WARN",
"ERROR",
"FATAL",
]
ALERT_TYPES = {
"FATAL": "error",
"ERROR": "error",
"WARN": "warning",
"INFO": "info",
"DEBUG": "info",
"TRACE": "info",
}
EVE... | bsd-3-clause |
securestate/king-phisher | tests/server/server_rpc.py | 4 | 8736 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tests/server/server_rpc.py
#
# 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 ... | bsd-3-clause |
aristotle-tek/cuny-bdif | AWS/ec2/lib/boto-2.34.0/tests/unit/glacier/test_concurrent.py | 88 | 7261 | #!/usr/bin/env python
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... | mit |
jjz/v2ex | money.py | 16 | 1441 | #!/usr/bin/env python
# coding=utf-8
import os
import re
import time
import datetime
import hashlib
import string
import random
from google.appengine.ext import webapp
from google.appengine.api import memcache
from google.appengine.ext import db
from google.appengine.ext.webapp import util
from google.appengine.ext.w... | bsd-3-clause |
mind1master/aiohttp | tests/test_parser_buffer.py | 1 | 5653 | from unittest import mock
import pytest
from aiohttp import errors, parsers
@pytest.fixture
def stream():
return mock.Mock()
@pytest.fixture
def buf():
return parsers.ParserBuffer()
def test_feed_data(buf):
buf.feed_data(b'')
assert len(buf) == 0
buf.feed_data(b'data')
assert len(buf) =... | apache-2.0 |
ron-rivest/split-value-voting | sv_tally.py | 2 | 2673 | # sv_tally.py
# python3
# Ronald L. Rivest
# 2014-06-23
""" Code for tally portion of simulated split-value election.
"""
# MIT open-source license.
# (See https://github.com/ron-rivest/split-value-voting.git)
import sys
import sv
def compute_tally(election):
""" Compute tallies for this election.
Data is... | mit |
ryuunosukeyoshi/PartnerPoi-Bot | lib/youtube_dl/extractor/urplay.py | 50 | 2304 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class URPlayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ur(?:play|skola)\.se/(?:program|Produkter)/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'http://urplay.se/program/190031-tripp-trapp-trad-sovkudde',
... | gpl-3.0 |
bodi000/odoo | addons/l10n_hn/__openerp__.py | 87 | 2258 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009-2010 Salvatore J. Trimarchi <salvatore@trimarchi.co.cc>
# (http://salvatoreweb.co.cc)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | agpl-3.0 |
dongguangming/python-for-android | src/buildlib/jinja2.egg/jinja2/meta.py | 659 | 4190 | # -*- coding: utf-8 -*-
"""
jinja2.meta
~~~~~~~~~~~
This module implements various functions that exposes information about
templates that might be interesting for various kinds of applications.
:copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
:license: BSD, see LICENSE fo... | mit |
franky88/emperioanimesta | env/Lib/encodings/latin_1.py | 853 | 1264 | """ Python 'latin-1' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is intended.
... | gpl-3.0 |
techdragon/django | tests/basic/tests.py | 16 | 29769 | from __future__ import unicode_literals
import threading
from datetime import datetime, timedelta
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections
from django.db.models.fields import Field
from django.db.models.manager im... | bsd-3-clause |
redhatrises/freeipa | ipapython/errors.py | 9 | 1984 | # Authors: Petr Viktorin <pviktori@redhat.com>
#
# Copyright (C) 2014 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 ve... | gpl-3.0 |
apophys/freeipa | ipaclient/plugins/certprofile.py | 8 | 1499 | #
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
#
from ipaclient.frontend import MethodOverride
from ipalib import util
from ipalib.parameters import File
from ipalib.plugable import Registry
from ipalib.text import _
register = Registry()
@register(override=True, no_fail=True)
class certprofil... | gpl-3.0 |
ttsirkia/a-plus | redirect_old_urls/tests.py | 2 | 4005 | from django.test import TestCase
from course.models import Course, CourseInstance, CourseModule,\
LearningObjectCategory
from exercise.exercise_models import StaticExercise
from django.contrib.auth.models import User
from django.utils import timezone
from datetime import timedelta
class RedirectTest(TestCase):
... | gpl-3.0 |
aniruddhkanojia/qtile | libqtile/state.py | 5 | 2582 | # Copyright (c) 2012, Tycho Andersen. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | mit |
dwitvliet/CATMAID | scripts/export/export_all_csv.py | 5 | 2541 | # Albert Cardona 2014-11-21
# This file is meant to be run from within ./manage.py shell in the environment, like:
# [1] load export_all_csv.py
# [2] project_id = 12
# [2] export(project_id, "all")
from __future__ import with_statement
from django.db import connection
from django.db import transaction
import gzip
def... | gpl-3.0 |
Allow2CEO/browser-ios | brave/node_modules/ad-block/node_modules/bloom-filter-cpp/vendor/depot_tools/third_party/pylint/pyreverse/writer.py | 68 | 7866 | # -*- coding: utf-8 -*-
# Copyright (c) 2008-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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 ver... | mpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.