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 |
|---|---|---|---|---|---|
KellyChan/python-examples | javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/db/models/manager.py | 98 | 8171 | import copy
from django.db import router
from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist
def ensure_default_manager(sender, **kwargs):
"""
Ensures that a Model subclass contains a d... | mit |
aristanetworks/arista-ovs-nova | nova/utils.py | 1 | 38397 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | apache-2.0 |
larsbutler/swift | swift/obj/expirer.py | 1 | 12641 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | apache-2.0 |
AMOboxTV/AMOBox.LegoBuild | plugin.video.specto/resources/lib/sources/beinmovie_mv.py | 7 | 4294 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | gpl-2.0 |
intgr/django-cms | cms/management/commands/subcommands/list.py | 18 | 3378 | # -*- coding: utf-8 -*-
from cms.management.commands.subcommands.base import SubcommandsCommand
from cms.models import Page
from cms.models.pluginmodel import CMSPlugin
from cms.plugin_pool import plugin_pool
from django.core.management.base import NoArgsCommand
class ListApphooksCommand(NoArgsCommand):
help ... | bsd-3-clause |
orangeduck/PyAutoC | Python27/Lib/test/test_gc.py | 42 | 20414 | import unittest
from test.test_support import verbose, run_unittest
import sys
import gc
import weakref
### Support code
###############################################################################
# Bug 1055820 has several tests of longstanding bugs involving weakrefs and
# cyclic gc.
# An instance of C1055820 h... | bsd-2-clause |
trrigger/python_training | mysql/connector/charsets.py | 22 | 12326 | # -*- coding: utf-8 -*-
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. T... | apache-2.0 |
VigTech/Vigtech-Services | env/lib/python2.7/site-packages/django/utils/dates.py | 590 | 2296 | "Commonly-used date structures"
from django.utils.translation import pgettext_lazy, ugettext_lazy as _
WEEKDAYS = {
0: _('Monday'), 1: _('Tuesday'), 2: _('Wednesday'), 3: _('Thursday'), 4: _('Friday'),
5: _('Saturday'), 6: _('Sunday')
}
WEEKDAYS_ABBR = {
0: _('Mon'), 1: _('Tue'), 2: _('Wed'), 3: _('Thu'),... | lgpl-3.0 |
Rctue/nao-lib | gestures/sta.py | 1 | 3412 | names = list()
times = list()
keys = list()
names.append("HeadYaw")
times.append([ 2.00000])
keys.append([ [ 0.00000, [ 3, -0.66667, 0.00000], [ 3, 0.00000, 0.00000]]])
names.append("HeadPitch")
times.append([ 2.00000])
keys.append([ [ -0.30000, [ 3, -0.66667, 0.00000], [ 3, 0.00000, 0.00000]]])
names.append("LShoul... | gpl-2.0 |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/WebKit/Tools/Scripts/webkitpy/formatter/fix_docstrings.py | 9 | 2236 | # Copyright 2016 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.
"""A 2to3 fixer that reformats docstrings.
This should transform docstrings to be closer to the conventions in pep-0257;
see https://www.python.org/dev/peps... | gpl-3.0 |
JulienMcJay/eclock | windows/Python27/Lib/distutils/command/config.py | 175 | 13130 | """distutils.command.config
Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications. The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" i... | gpl-2.0 |
alwaysadeel/AJ-Kernel | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
maleficarium/youtube-dl | youtube_dl/downloader/__init__.py | 19 | 1445 | from __future__ import unicode_literals
from .common import FileDownloader
from .f4m import F4mFD
from .hls import HlsFD
from .http import HttpFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from .rtsp import RtspFD
from .external import (
get_external_downloader,
FFmpegFD,
)
from ..utils import ... | unlicense |
JackDanger/sentry | src/sentry/south_migrations/0304_auto__add_deploy.py | 2 | 69495 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Deploy'
db.create_table('sentry_deploy', (
('... | bsd-3-clause |
google-code-export/tipfy | tipfy/auth/google.py | 9 | 4324 | # -*- coding: utf-8 -*-
"""
tipfy.auth.google
~~~~~~~~~~~~~~~~~
Implementation of Google authentication scheme.
Ported from `tornado.auth`_.
:copyright: 2009 Facebook.
:copyright: 2011 tipfy.org.
:license: Apache License Version 2.0, see LICENSE.txt for more details.
"""
from __future__ i... | bsd-3-clause |
akaihola/django | tests/regressiontests/m2m_regress/tests.py | 43 | 3423 | from __future__ import absolute_import
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import (SelfRefer, Tag, TagCollection, Entry, SelfReferChild,
SelfReferChildSibling, Worksheet)
class M2MRegressionTests(TestCase):
def test_multiple_m2m(self):
# Multip... | bsd-3-clause |
MrLoick/python-for-android | python-build/python-libs/xmpppy/xmpp/debug.py | 207 | 14069 | ## debug.py
##
## Copyright (C) 2003 Jacob Lundqvist
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU Lesser General Public License as published
## by the Free Software Foundation; either version 2, or (at your option)
## any later version.
##
## ... | apache-2.0 |
WeblateOrg/weblate | weblate/legal/pipeline.py | 2 | 1594 | #
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | gpl-3.0 |
samueldotj/TeeRISC-Simulator | src/mem/ruby/structures/RubyPrefetcher.py | 22 | 2316 | # Copyright (c) 2012 Mark D. Hill and David A. Wood
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditio... | bsd-3-clause |
lgarren/spack | lib/spack/docs/tutorial/examples/1.package.py | 3 | 1981 | ##############################################################################
# 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... | lgpl-2.1 |
andim/scipy | scipy/optimize/_hungarian.py | 8 | 9381 | # Hungarian algorithm (Kuhn-Munkres) for solving the linear sum assignment
# problem. Taken from scikit-learn. Based on original code by Brian Clapper,
# adapted to NumPy by Gael Varoquaux.
# Further improvements by Ben Root, Vlad Niculae and Lars Buitinck.
#
# Copyright (c) 2008 Brian M. Clapper <bmc@clapper.org>, Gae... | bsd-3-clause |
Dziolas/invenio | modules/miscutil/lib/sequtils.py | 26 | 2599 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 ... | gpl-2.0 |
j-marjanovic/myhdl | myhdl/_join.py | 6 | 1288 | # This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2003-2008 Jan Decaluwe
#
# The myhdl library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by t... | lgpl-2.1 |
krivenko/som | python/som.py | 1 | 1706 | ##############################################################################
#
# SOM: Stochastic Optimization Method for Analytic Continuation
#
# Copyright (C) 2016-2020 Igor Krivenko <igor.s.krivenko@gmail.com>
#
# SOM is free software: you can redistribute it and/or modify it under the
# terms of the GNU General P... | gpl-3.0 |
atumanov/ray | python/ray/exceptions.py | 1 | 3236 | import os
import colorama
try:
import setproctitle
except ImportError:
setproctitle = None
class RayError(Exception):
"""Super class of all ray exception types."""
pass
class RayTaskError(RayError):
"""Indicates that a task threw an exception during execution.
If a task throws an exceptio... | apache-2.0 |
Pretio/boto | boto/s3/prefix.py | 237 | 1661 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
eljefe6a/HBaseThrift | thrift/server/TNonblockingServer.py | 111 | 11818 | #
# 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... | apache-2.0 |
mysociety/barnetplanning | alerts/forms.py | 1 | 2895 | import urllib2
import simplejson
from django import forms
from django.contrib.localflavor.uk.forms import UKPostcodeField
from models import Alert
# Due to a bug in UKPostcodeField, can't override error message. This is
# fixed in: http://code.djangoproject.com/ticket/12017
# So remove this extra class when we have... | agpl-3.0 |
gorjuce/odoo | addons/l10n_ae/__init__.py | 669 | 1059 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
imply/chuu | third_party/closure_linter/closure_linter/common/htmlutil.py | 286 | 4732 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | bsd-3-clause |
KevinMidboe/statusHandler | flask/lib/python3.4/encodings/iso8859_13.py | 272 | 13271 | """ Python Character Mapping Codec iso8859_13 generated from 'MAPPINGS/ISO8859/8859-13.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... | mit |
CEG-FYP-OpenStack/scheduler | nova/api/openstack/compute/legacy_v2/extensions.py | 26 | 1793 | # Copyright 2011 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 |
kustodian/ansible | lib/ansible/modules/storage/netapp/na_ontap_security_key_manager.py | 43 | 8360 | #!/usr/bin/python
# (c) 2019, NetApp, Inc
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
catroot/rethinkdb | test/common/http_support/flask/testsuite/config.py | 556 | 11820 | # -*- coding: utf-8 -*-
"""
flask.testsuite.config
~~~~~~~~~~~~~~~~~~~~~~
Configuration and instances.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import flask
import pkgutil
import unittest
from contextlib import contextmanager
fr... | agpl-3.0 |
SHA2017-badge/micropython-esp32 | tests/basics/struct2.py | 1 | 1284 | # test ustruct with a count specified before the type
try:
import ustruct as struct
except:
try:
import struct
except ImportError:
print("SKIP")
raise SystemExit
print(struct.calcsize('0s'))
print(struct.unpack('0s', b''))
print(struct.pack('0s', b'123'))
print(struct.calcsize('2s... | mit |
iut-ibk/DynaMind-UrbanSim | 3rdparty/opus/src/urbansim/gridcell/total_nonresidential_value.py | 2 | 1925 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from variable_functions import my_attribute_label
class total_nonresidential_value(Variable):
"""Sum of the nonresidential improvement val... | gpl-2.0 |
aliyun/oss-ftp | python27/unix/lib/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... | mit |
xzturn/tensorflow | tensorflow/python/tpu/device_assignment.py | 3 | 16390 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
bcharlas/mytrunk | examples/gts-horse/gts-random-pack.py | 10 | 3271 |
""" CAUTION:
Running this script can take very long!
"""
from numpy import arange
from yade import pack
import pylab
# define the section shape as polygon in 2d; repeat first point at the end to close the polygon
poly=((1e-2,5e-2),(5e-2,2e-2),(7e-2,-2e-2),(1e-2,-5e-2),(1e-2,5e-2))
# show us the meridian shape
#pylab.... | gpl-2.0 |
tscholl2/smc | src/scripts/new_lxc_image.py | 3 | 1760 | #!/usr/bin/env python
###############################################################################
#
# CoCalc: Collaborative Calculation in the Cloud
#
# Copyright (C) 2016, Sagemath Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | agpl-3.0 |
jiaphuan/models | research/slim/nets/mobilenet/mobilenet.py | 1 | 16178 | # 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 |
ticosax/django | django/core/cache/backends/dummy.py | 629 | 1213 | "Dummy cache backend"
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
class DummyCache(BaseCache):
def __init__(self, host, *args, **kwargs):
BaseCache.__init__(self, *args, **kwargs)
def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None):
key = self.make_key... | bsd-3-clause |
fhaoquan/kbengine | kbe/src/lib/python/Lib/tkinter/dialog.py | 153 | 1568 | # dialog.py -- Tkinter interface to the tk_dialog script.
from tkinter import *
from tkinter import _cnfmerge
if TkVersion <= 3.6:
DIALOG_ICON = 'warning'
else:
DIALOG_ICON = 'questhead'
class Dialog(Widget):
def __init__(self, master=None, cnf={}, **kw):
cnf = _cnfmerge((cnf, kw))
self.... | lgpl-3.0 |
denisenkom/django | django/contrib/gis/tests/geo3d/tests.py | 5 | 12106 | from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import postgis
from django.test import TestCase
from django.utils._os import upath
if HAS_GEOS:
... | bsd-3-clause |
bertucho/epic-movie-quotes-quiz | dialogos/build/scrapy/tests/test_downloadermiddleware.py | 56 | 3504 | from twisted.trial.unittest import TestCase
from twisted.python.failure import Failure
from scrapy.http import Request, Response
from scrapy.spiders import Spider
from scrapy.core.downloader.middleware import DownloaderMiddlewareManager
from scrapy.utils.test import get_crawler
class ManagerTestCase(TestCase):
... | mit |
Autodesk/molecular-design-toolkit | moldesign/interfaces/nbo_interface.py | 1 | 9611 | from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
# Copyright 2017 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | apache-2.0 |
crowdhackathon-transport/optimizers | crowdstance-api/venv/lib/python2.7/site-packages/setuptools/tests/test_resources.py | 345 | 23973 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# NOTE: the shebang and encoding lines are for ScriptHeaderTests do not remove
import os
import sys
import tempfile
import shutil
from unittest import TestCase
import pkg_resources
from pkg_resources import (parse_requirements, VersionConflict, parse_version,
Distribution... | mit |
wufangjie/leetcode | 187. Repeated DNA Sequences.py | 1 | 1241 | class Solution(object):
def findRepeatedDnaSequences(self, s):
"""
:type s: str
:rtype: List[str]
"""
more_than_once, once = set(), set()
for i in range(len(s) - 9):
t = s[i:i+10]
if t not in more_than_once:
if t in once:
... | gpl-3.0 |
Oslandia/vizitown_plugin | zope/interface/tests/odd.py | 79 | 3079 | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | gpl-2.0 |
aksaxena80/test | tensorflow/python/kernel_tests/random_shuffle_queue_test.py | 5 | 36448 | """Tests for tensorflow.ops.data_flow_ops.Queue."""
import random
import re
import time
import tensorflow.python.platform
import numpy as np
import tensorflow as tf
class RandomShuffleQueueTest(tf.test.TestCase):
def setUp(self):
# Useful for debugging when a test times out.
super(RandomShuffleQueueTest,... | apache-2.0 |
ging/keystone | keystone/contrib/keystone_scim/routers.py | 1 | 11710 | #
# Copyright 2014 Telefonica Investigacion y Desarrollo, S.A.U
#
# 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 unde... | apache-2.0 |
openid/python-openid | openid/yadis/manager.py | 1 | 6142 | from __future__ import unicode_literals
class YadisServiceManager(object):
"""Holds the state of a list of selected Yadis services, managing
storing it in a session and iterating over the services in order."""
def __init__(self, starting_url, yadis_url, services, session_key):
# The URL that was ... | apache-2.0 |
SinnerSchraderMobileMirrors/django-cms | cms/test_utils/project/extensionapp/cms_toolbar.py | 3 | 3707 | # -*- coding: utf-8 -*-
from cms.api import get_page_draft
from cms.test_utils.project.extensionapp.models import MyTitleExtension, MyPageExtension
from cms.utils import get_cms_setting
from cms.utils.permissions import has_page_change_permission
from django.core.urlresolvers import reverse, NoReverseMatch
from django.... | bsd-3-clause |
mojodna/debian-mapnik | plugins/input/osm/build.py | 1 | 1631 | #
# This file is part of Mapnik (c++ mapping toolkit)
#
# Copyright (C) 2007 Artem Pavlenko, Jean-Francois Doyon
#
# Mapnik is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Li... | lgpl-2.1 |
caphrim007/ansible | lib/ansible/modules/cloud/openstack/os_group.py | 34 | 4758 | #!/usr/bin/python
# Copyright (c) 2016 IBM
# 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 |
wildtetris/python-social-auth | examples/flask_me_example/__init__.py | 57 | 1210 | import sys
from flask import Flask, g
from flask.ext import login
from flask.ext.mongoengine import MongoEngine
sys.path.append('../..')
from social.apps.flask_app.routes import social_auth
from social.apps.flask_app.me.models import init_social
from social.apps.flask_app.template_filters import backends
# App
app... | bsd-3-clause |
teoliphant/numpy-refactor | numpy/random/setupscons.py | 100 | 1384 | import glob
from os.path import join, split
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration, get_mathlibs
config = Configuration('random',parent_package,top_path)
source_files = [join('mtrand', i) for i in ['mtrand.c',
... | bsd-3-clause |
arahuja/scikit-learn | sklearn/calibration.py | 12 | 18774 | """Calibration of predicted probabilities."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Balazs Kegl <balazs.kegl@gmail.com>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Mathieu Blondel <mathieu@mblondel.org>
#
# License: BSD 3 clause
from __future__ impo... | bsd-3-clause |
ivar1234/babu.repo | contrib/inventory/openstack.py | 15 | 6257 | #!/usr/bin/env python
# Copyright (c) 2012, Marco Vito Moscaritolo <marco@agavee.com>
# Copyright (c) 2013, Jesse Keating <jesse.keating@rackspace.com>
# Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | gpl-3.0 |
ddaeschler/pyrax | samples/cloudfiles/temporary_url.py | 13 | 2203 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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.ap... | apache-2.0 |
viniciuschiele/central | central/config/dynamodb.py | 1 | 4852 | """
DynamoDB config implementation.
"""
from collections import Mapping
from ..compat import string_types
from ..exceptions import LibraryRequiredError
from ..structures import IgnoreCaseDict
from ..utils import make_ignore_case
from .core import BaseDataConfig
try:
import boto3
from boto3.dynamodb.condition... | mit |
dudulianangang/vps | EneConsTest.py | 1 | 5969 | import sdf
import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl
plt.style.use('seaborn-white')
# plt.rcParams['font.family'] = 'sans-serif'
# plt.rcParams['font.sans-serif'] = 'Tahoma'
# # plt.rcParams['font.monospace'] = 'Ubuntu Mono'
plt.rcParams['font.size'] = 16
# plt.rcParams['axes.labelsiz... | apache-2.0 |
taknevski/tensorflow-xsmm | tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py | 75 | 29377 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
michhar/flask-webapp-aml | env1/Lib/site-packages/jinja2/constants.py | 220 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | mit |
kofron/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/ifort.py | 61 | 3350 | """SCons.Tool.ifort
Tool-specific initialization for newer versions of the Intel Fortran Compiler
for Linux/Windows (and possibly Mac OS X).
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) ... | apache-2.0 |
l1204366/gcoin-community | qa/rpc-tests/test_framework/bignum.py | 230 | 1995 | #
#
# bignum.py
#
# This file is copied from python-bitcoinlib.
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
"""Bignum routines"""
from __future__ import absolute_import, division, print_function, unicode_literals
imp... | apache-2.0 |
Adamssss/projectEuler | pb347.py | 1 | 1198 | import math
import time
t1 = time.time()
N = 10000000
prime = []
def primeSieve(n):
global prime
n = (n+1)//2
p = [True]*(n)
i = 1
prime.append(2)
while i < n:
if p[i]:
t = 2*i+1
prime.append(t)
p[i] = False
j = 2*i*i+2*i
wh... | mit |
otfbot/otfbot | otfbot/lib/chatMod.py | 1 | 4027 | # This file is part of OtfBot.
#
# OtfBot 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.
#
# OtfBot is distributed in the hope that it... | gpl-2.0 |
garygriswold/Bible.js | Versions/Release.2.1.x/py/BibleValidate2.py | 2 | 3377 | # This program reads all of the records in the Bible table
# And then does a retrieval of the info.json file to create
# a table of contents. Then it does a head of the last chapter
# of each book of the Bible.
# Then it does the same last chapter of each book head for
# each damId.
import sqlite3
import boto3
import... | mit |
strk/QGIS | python/PyQt/PyQt5/Qt.py | 45 | 1036 | # -*- coding: utf-8 -*-
"""
***************************************************************************
Qt.py
---------------------
Date : September 2016
Copyright : (C) 2015 by Marco Bernasocchi
Email : marco at opengis dot ch
*****************************... | gpl-2.0 |
ojengwa/oh-mainline | vendor/packages/django-reversion/src/reversion/revisions.py | 16 | 14725 | """Revision management for Reversion."""
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.3, 2.4 fallback.
import operator
from threading import local
from django.contrib.contenttypes.models import ContentType
from django.core import serializers
from... | agpl-3.0 |
nagyistoce/oppia | feconf.py | 7 | 15090 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
doheekim/chuizonetest | lib/sqlalchemy/dialects/sybase/base.py | 33 | 28629 | # sybase/base.py
# Copyright (C) 2010-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
# get_select_precolumns(), limit_clause() implementation
# copyright (C) 2007 Fisch Asset Management
# AG http://www.fam.ch, with coding by Alexander Houben
# alexander.houben@thor-solutions.ch
#
# This module is par... | apache-2.0 |
40223201/w16b_test | static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/SDL.py | 603 | 1813 | from browser import document
SDL_INIT_VIDEO=0
SDL_GL_DOUBLEBUFFER=1
SDL_GL_DEPTH_SIZE=2
SDL_DOUBLEBUF=3
SDL_ANYFORMAT=4
SDL_ACTIVEEVENT=5
SDL_ALLEVENTS=5
SDL_KEYDOWN=6
SDL_KEYUP=7
SDL_MOUSEMOTION=8
SDL_MOUSEBUTTONDOWN=9
SDL_MOUSEBUTTONUP=10
SDL_JOYAXISMOTION=11
SDL_JOYBALLMOTION=12
SDL_JOYHATMOTION=13
SDL_JOYBUTTON... | agpl-3.0 |
Jusedawg/SickRage | lib/requests/packages/chardet/escprober.py | 2936 | 3187 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
iam-TJ/node-gyp | gyp/test/lib/TestCommon.py | 307 | 21397 | """
TestCommon.py: a testing framework for commands and scripts
with commonly useful error handling
The TestCommon module provides a simple, high-level interface for writing
tests of executable commands and scripts, especially commands and scripts
that interact with the file system. All methods throw... | mit |
gvb/odoo | addons/l10n_co/__init__.py | 313 | 1180 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) David Arnold (devCO).
# Author David Arnold (devCO), dar@devco.co
# Co-Authors Juan Pablo Aries (devCO), jpa@devco.co
# Hector Iva... | agpl-3.0 |
robbertvanginkel/buck | test/com/facebook/buck/android/testdata/android_project/java/com/preprocess/convert.py | 42 | 1111 | #!/usr/bin/env python
import sys
import os
import zipfile
import shutil
def main(argv):
indir = argv[1]
outdir = argv[2]
for root, dirs, files in os.walk(indir):
outroot = os.path.join(outdir, os.path.relpath(root, indir))
for d in dirs:
os.mkdir(os.path.join(outroot, d))
... | apache-2.0 |
nikolas/raven-python | conftest.py | 1 | 1947 | from django.conf import settings
import os.path
import sys
collect_ignore = []
if sys.version_info[0] > 2:
collect_ignore.append("tests/contrib/flask")
if sys.version_info[1] == 2:
collect_ignore.append("tests/handlers/logbook")
try:
import gevent
except ImportError:
collect_ignore.append("te... | bsd-3-clause |
tisnik/fabric8-analytics-common | integration-tests/features/steps/jobs_api.py | 1 | 14506 | """Tests for jobs API endpoints."""
import os
import requests
import uuid
from behave import given, then, when
from src.attribute_checks import check_timestamp, check_job_token_attributes
from src.parsing import parse_token_clause
from src.authorization_tokens import jobs_api_authorization
@given('Jobs debug API is... | apache-2.0 |
pombreda/mic | mic/3rdparty/pykickstart/commands/mediacheck.py | 10 | 2042 | #
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2007 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
# will be usef... | gpl-2.0 |
googleapis/googleapis-gen | google/cloud/webrisk/v1beta1/webrisk-v1beta1-py/google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/transports/grpc.py | 2 | 14215 | # -*- coding: utf-8 -*-
# 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... | apache-2.0 |
pleoni/game-of-life | plot/old/test_perf_mpi/life_perf_compilers.py | 1 | 1863 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from numpy import *
import sys
import datetime
datafile1="life_host_icc.out"
datafile2="life_host_gnu.out"
datafile3="life_host_pgi.out"
if len(sys.argv) > 1:
datafile=sys.argv[1]
plotfile="compilers_perf_eurora.png"
data1 = loadtxt(datafile... | gpl-2.0 |
IdeaSolutionsOnline/ERP4R | core/objs/sai_pesquisacont.py | 1 | 4546 | # !/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
ERP+
"""
__author__ = ['António Anacleto', 'Jair Medina']
__credits__ = []
__version__ = "1.0"
__maintainer__ = ['António Anacleto', 'Jair Medina']
__status__ = "Development"
__model_name__= 'sai_pesquisacont.SaiPesquisacont'
#import base_models#auth,
from orm impo... | mit |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/raw/GL/OES/fixed_point.py | 9 | 11043 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | gpl-3.0 |
EmreAtes/spack | var/spack/repos/builtin/packages/r-a4preproc/package.py | 3 | 1721 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
Tendrl/node-agent | tendrl/node_agent/node_sync/services_and_index_sync.py | 2 | 6927 | import json
import uuid
import etcd
from tendrl.commons.event import Event
from tendrl.commons.message import ExceptionMessage
from tendrl.commons.utils import etcd_utils
from tendrl.commons.utils import log_utils as logger
# TODO(darshan) this has to be moved to Definition file
TENDRL_SERVICES = [
"tendrl-node... | lgpl-2.1 |
druidpld/bletrack | Vestigo/scan.py | 2 | 5343 | #!/usr/bin/env python
import pexpect
import subprocess
import thread
from multiprocessing.pool import ThreadPool
import time
from settings import Settings
import requests
import json
from logger import Logger
class Scanner():
def __init__(self,settings,logger):
self._logger=logger
self._bleScanProc = None
self... | mit |
2ndQuadrant/ansible | lib/ansible/modules/cloud/azure/azure_rm_trafficmanagerendpoint.py | 14 | 13863 | #!/usr/bin/python
#
# Copyright (c) 2018 Hai Cao, <t-haicao@microsoft.com>, Yunge Zhu <yungez@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 = {'metadat... | gpl-3.0 |
macarthur-lab/xbrowse | breakpoint_search/urls.py | 1 | 1099 | from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
import xbrowse_server.base.views.igv_views
import xbrowse_server.base.views.family_group_views
import xbrowse_server.base.views.reference_views... | agpl-3.0 |
aberklotz/crimereport | parser/crimeparser/spiders/test_police_spider.py | 1 | 5741 | from unittest import TestCase
from scrapy.http import Request, HtmlResponse
from conftest import RESOURCE_DIR
from crimeparser.spiders.police_spider import PoliceSpider
class TestPoliceSpider(TestCase):
def test_parse_id(self):
response = self.fake_response("sample.html",
... | mit |
edsono/gce | src/profiles/views.py | 19 | 2481 | from __future__ import unicode_literals
from django.views import generic
from django.shortcuts import get_object_or_404, redirect
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from . import forms
from . import models
class ShowProfile(LoginRequiredMixin, generic.Templat... | mit |
pk-sam/crosswalk | tools/reflection_generator/java_method.py | 2 | 29170 | #!/usr/bin/env python
# Copyright (c) 2014 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
from collections import OrderedDict
from string import Template
def ConvertClassExpressionToClassType(class_name):
""" ... | bsd-3-clause |
openilabs/falconlab | env/lib/python2.7/site-packages/Cython/Compiler/CmdLine.py | 90 | 8191 | #
# Cython - Command Line Parsing
#
import os
import sys
import Options
usage = """\
Cython (http://cython.org) is a compiler for code written in the
Cython language. Cython is based on Pyrex by Greg Ewing.
Usage: cython [options] sourcefile.{pyx,py} ...
Options:
-V, --version Display version ... | mit |
ampax/edx-platform | common/djangoapps/student/tests/test_userstanding.py | 41 | 4180 | """
These are tests for disabling and enabling student accounts, and for making sure
that students with disabled accounts are unable to access the courseware.
"""
import unittest
from student.tests.factories import UserFactory, UserStandingFactory
from student.models import UserStanding
from django.conf import setting... | agpl-3.0 |
DistrictDataLabs/yellowbrick | yellowbrick/classifier/rocauc.py | 1 | 29053 | # yellowbrick.classifier.rocauc
# Implements visual ROC/AUC curves for classification evaluation.
#
# Author: Rebecca Bilbro
# Author: Benjamin Bengfort
# Author: Neal Humphrey
# Created: Tue May 03 18:15:42 2017 -0400
#
# Copyright (C) 2016 The scikit-yb developers
# For license information, see LICENSE.txt
#
#... | apache-2.0 |
linkslice/ZenPacks.community.EMCIsilon | ZenPacks/community/EMCIsilon/modeler/plugins/community/snmp/EMCIsilonDiskPerfs.py | 1 | 1526 | from Products.DataCollector.plugins.CollectorPlugin import (
SnmpPlugin, GetTableMap,
)
class EMCIsilonDiskPerfs(SnmpPlugin):
relname = 'emcisilon_diskperfs'
modname = 'ZenPacks.community.EMCIsilon.EMCIsilonDiskPerf'
snmpGetTableMaps = (
GetTableMap(
'diskPerfTable', '.1.3.6.1... | mit |
ellak-monades-aristeias/enhydris | enhydris/hcore/migrations/0006_offset_help.py | 1 | 2090 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('hcore', '0005_remove_is_active'),
]
operations = [
migrations.AlterField(
model_name='timeseries',
n... | agpl-3.0 |
k3nnyfr/s2a_fr-nsis | s2a/Python/Lib/idlelib/idle_test/test_delegator.py | 140 | 1294 | import unittest
from idlelib.Delegator import Delegator
class DelegatorTest(unittest.TestCase):
def test_mydel(self):
# test a simple use scenario
# initialize
mydel = Delegator(int)
self.assertIs(mydel.delegate, int)
self.assertEqual(mydel._Delegator__cache, set())
... | gpl-3.0 |
felipebetancur/scipy | scipy/optimize/tests/test_nonlin.py | 67 | 15160 | """ Unit tests for nonlinear solvers
Author: Ondrej Certik
May 2007
"""
from __future__ import division, print_function, absolute_import
from numpy.testing import assert_, dec, TestCase, run_module_suite
from scipy._lib.six import xrange
from scipy.optimize import nonlin, root
from numpy import matrix, diag, dot
from... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.