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 |
|---|---|---|---|---|---|
mancoast/CPythonPyc_test | cpython/220_test_gl.py | 15 | 6640 | #! /usr/bin/env python
"""Very simple test script for the SGI gl library extension module
taken mostly from the documentation.
Roger E. Masse
"""
from test_support import verbose, TestSkipped
import gl, GL, time
glattrs = ['RGBcolor', 'RGBcursor', 'RGBmode', 'RGBrange', 'RGBwritemask',
'__doc__', '__name__', '... | gpl-3.0 |
guewen/OpenUpgrade | addons/point_of_sale/report/pos_lines.py | 150 | 2369 | # -*- 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 |
dozeo/x264 | tools/digress/scm/git.py | 145 | 2727 | """
Git SCM backend for Digress.
"""
from subprocess import Popen, PIPE, STDOUT
import re
from digress.errors import SCMError
GIT_BRANCH_EXPR = re.compile("[*] (.*)")
def checkout(revision):
"""
Checkout a revision from git.
"""
proc = Popen([
"git",
"checkout",
"-f",
... | gpl-2.0 |
timchenxiaoyu/Diamond | src/collectors/jbossapi/jbossapi.py | 22 | 13926 | # coding=utf-8
"""
V. 1.0
JbossApiCollector is a collector that uses JBOSS 7 native API to collect data
Tested on jboss 7.X.X??
Much of the code was borrowed from:
http://bit.ly/XRrCWx
https://github.com/lukaf/munin-plugins/blob/master/jboss7_
References:
https://docs.jboss.org/author/display/AS7/Management+API+re... | mit |
mapbox/pixelmatch-cpp | deps/gyp/pylib/gyp/generator/ninja.py | 9 | 91743 | # Copyright (c) 2013 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.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | isc |
scs/uclinux | user/python/python-2.4.4/Lib/plat-irix5/FL.py | 16 | 5486 | # Constants used by the FORMS library (module fl).
# This corresponds to "forms.h".
# Recommended use: import FL; ... FL.NORMAL_BOX ... etc.
# Alternate use: from FL import *; ... NORMAL_BOX ... etc.
_v20 = 1
_v21 = 1
##import fl
##try:
## _v20 = (fl.get_rgbmode is not None)
##except:
## _v20 = 0
##del fl
N... | gpl-2.0 |
sencha/chromium-spacewalk | tools/json_to_struct/struct_generator_test.py | 129 | 1924 | #!/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.
from struct_generator import GenerateField
from struct_generator import GenerateStruct
import unittest
class StructGeneratorTest(u... | bsd-3-clause |
ppries/tensorflow | tensorflow/contrib/training/python/training/batch_sequences_with_states_test.py | 12 | 11913 | # 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 |
pizzathief/scipy | scipy/spatial/tests/test__procrustes.py | 9 | 4982 | import numpy as np
from numpy.testing import assert_allclose, assert_equal, assert_almost_equal
from pytest import raises as assert_raises
from scipy.spatial import procrustes
class TestProcrustes(object):
def setup_method(self):
"""creates inputs"""
# an L
self.data1 = np.array([[1, 3], ... | bsd-3-clause |
aerwin3/swift | test/unit/cli/test_form_signature.py | 3 | 3943 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Samuel Merritt <sam@swiftstack.com>
#
# 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 r... | apache-2.0 |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_4_0_0/models/endpoint_tests.py | 1 | 6296 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import endpoint
from .fhirdate import FHIRDate
class EndpointTests(unittest.TestCase):
def instantiate_from(self, filename):
... | bsd-3-clause |
lazycoder-ru/pelican-plugins | creole_reader/creole_reader.py | 71 | 2939 | #-*- conding: utf-8 -*-
'''
Creole Reader
-------------
This plugins allows you to write your posts using the wikicreole syntax. Give to
these files the creole extension.
For the syntax, look at: http://www.wikicreole.org/
'''
from pelican import readers
from pelican import signals
from pelican import settings
from... | agpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Cython-0.22.1/Cython/Build/Inline.py | 9 | 10977 | from __future__ import absolute_import
import sys, os, re, inspect
import imp
try:
import hashlib
except ImportError:
import md5 as hashlib
from distutils.core import Distribution, Extension
from distutils.command.build_ext import build_ext
import Cython
from ..Compiler.Main import Context, CompilationOptio... | mit |
demarle/VTK | Filters/Parallel/Testing/Python/testTransmit.py | 8 | 3814 | import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetTempDir
VTK_TEMP_DIR = vtkGetTempDir()
contr = vtk.vtkMultiProcessController.GetGlobalController()
if not contr:
nranks = 1
rank = 0
else:
nranks = contr.GetNumberOfProcesses()
rank = contr.GetLocalProcessId()
def GetSource(dataTy... | bsd-3-clause |
zhangtao11/scrapy | tests/mockserver.py | 110 | 6622 | from __future__ import print_function
import sys, time, random, os, json
import six
from six.moves.urllib.parse import urlencode
from subprocess import Popen, PIPE
from twisted.web.server import Site, NOT_DONE_YET
from twisted.web.resource import Resource
from twisted.internet import reactor, defer, ssl
from scrapy imp... | bsd-3-clause |
WisniewskiP/meson | install_meson.py | 1 | 3639 | #!/usr/bin/env python3
# Copyright 2013-2014 The Meson development 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/licenses/LICENSE-2.0
# Unless required by... | apache-2.0 |
cpopescu/whispermedialib | third-party/gstreamer/gst-plugins-good/common/gst-xmlinspect.py | 8 | 4861 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
"""
examine all plugins and elements and output xml documentation for them
used as part of the plugin documentation build
"""
import sys
import os
import pygst
pygst.require('0.10')
import gst
INDENT_SIZE = 2
# all templates
PAD_TEMPLATE = """<caps>
<name>%(name)... | lgpl-3.0 |
aweinstock314/servo | tests/wpt/harness/wptrunner/executors/executorservo.py | 14 | 7768 | # 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/.
import base64
import hashlib
import json
import os
import subprocess
import tempfile
import threading
import urlparse
im... | mpl-2.0 |
wuwx/ssbc | search/management/commands/loadlist.py | 36 | 1208 | #coding: utf8
from django.core.management.base import BaseCommand
from django import db as ddb
from search.models import FileList
import pymongo
import json
import binascii
db = pymongo.MongoClient().dht
class Command(BaseCommand):
def handle(self, *args, **options):
#FileList.objects.all().delete()
... | gpl-2.0 |
Gricha/django-empty | django-empty-auth/newproject/settings.py | 1 | 3305 | """
Django settings for newproject project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | unlicense |
SKIRT/PTS | magic/region/panda.py | 1 | 4117 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | agpl-3.0 |
rjpower/spark | python/examples/pi.py | 10 | 1382 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
hyperized/ansible | lib/ansible/module_utils/network/vyos/facts/facts.py | 17 | 2271 | # Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The facts class for vyos
this file validates each subset of facts and selectively
calls the appropriate facts gathering function
"""
from __future__ import absolute_import, division, print_functio... | gpl-3.0 |
fujita-shintaro/mkdocs | mkdocs/commands/build.py | 21 | 9619 | # coding: utf-8
from __future__ import unicode_literals
from datetime import datetime
import io
import logging
import os
from jinja2.exceptions import TemplateNotFound
import jinja2
import json
from mkdocs import nav, search, utils
from mkdocs.relative_path_ext import RelativePathExtension
import mkdocs
log = loggi... | bsd-2-clause |
jor-/matrix-decomposition | setup.py | 1 | 2841 | # Copyright (C) 2017-2018 Joscha Reimer jor@informatik.uni-kiel.de
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later versi... | agpl-3.0 |
orgito/ansible | lib/ansible/modules/cloud/amazon/sqs_queue.py | 39 | 9868 | #!/usr/bin/python
# Copyright: Ansible Project
# 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': ['stableinterf... | gpl-3.0 |
w1ll1am23/home-assistant | homeassistant/components/ring/switch.py | 21 | 3209 | """This component provides HA switch support for Ring Door Bell/Chimes."""
from datetime import timedelta
import logging
import requests
from homeassistant.components.switch import SwitchEntity
from homeassistant.core import callback
import homeassistant.util.dt as dt_util
from . import DOMAIN
from .entity import Ri... | apache-2.0 |
DARKPOP/external_chromium_org | tools/compile_test/compile_test.py | 159 | 1781 | #!/usr/bin/env python
# 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.
"""
Tries to compile given code, produces different output depending on success.
This is similar to checks done by ./configure scr... | bsd-3-clause |
arju88nair/projectCulminate | venv/lib/python3.5/site-packages/RAKE/stoplists/NLTKStopList.py | 3 | 1887 | wordlist = [
'a',
'about',
'above',
'after',
'again',
'against',
"ain't",
'all',
'am',
'an',
'and',
'any',
'are',
'aren',
'as',
'at',
'be',
'because',
'been',
'before',
'being',
'below',
'between',
'both',
'but',
'by... | apache-2.0 |
plxaye/chromium | src/chrome/common/extensions/docs/server2/future_test.py | 58 | 1982 | #!/usr/bin/env python
# Copyright 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.
import traceback
import unittest
from future import Future
class FutureTest(unittest.TestCase):
def testNoValueOrDelegate(self):
... | apache-2.0 |
vmarkovtsev/django | django/core/mail/backends/console.py | 696 | 1477 | """
Email backend that writes messages to console instead of sending them.
"""
import sys
import threading
from django.core.mail.backends.base import BaseEmailBackend
from django.utils import six
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
self.stream = kwargs.pop('stream',... | bsd-3-clause |
mbernasocchi/inasafe | safe_extras/raven/contrib/bottle/__init__.py | 7 | 2761 | """
raven.contrib.bottle
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import sys
from bottle import request
from raven.conf import setup_logging
from raven.contrib.bottle.utils impor... | gpl-3.0 |
GaretJax/s3ftp | fabtasks/assets.py | 2 | 1208 | import os
from livereload import Server
from fabric.api import task, local, env
@task
def watch_styles():
config = os.path.join(env.assets_dir, 'sass', 'config.rb')
local('compass watch -c {}'.format(config))
@task
def compile_styles():
config = os.path.join(env.assets_dir, 'sass', 'config.rb')
loca... | mit |
tayfun/django | tests/custom_managers/models.py | 238 | 6791 | """
Giving models a custom manager
You can use a custom ``Manager`` in a particular model by extending the base
``Manager`` class and instantiating your custom ``Manager`` in your model.
There are two reasons you might want to customize a ``Manager``: to add extra
``Manager`` methods, and/or to modify the initial ``Q... | bsd-3-clause |
ella/mypage | mypage/pages/migrations/0003_change_default_value_on_site_fk.py | 1 | 3108 |
from south.db import db
from django.db import models
from mypage.pages.models import *
class Migration:
def forwards(self, orm):
# Changing field 'Page.site'
db.alter_column('pages_page', 'site_id', models.ForeignKey(orm['sites.Site'], default= lambda :settings.SITE_ID))
... | bsd-3-clause |
adamtiger/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/layers/decisions_to_data.py | 133 | 9484 | # 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 |
QuantumElephant/horton | tools/qa/check_names.py | 4 | 2490 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | gpl-3.0 |
vermouthmjl/scikit-learn | sklearn/gaussian_process/tests/test_gpr.py | 23 | 11915 | """Testing for Gaussian process regression """
# Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Licence: BSD 3 clause
import numpy as np
from scipy.optimize import approx_fprime
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels \
import RBF, Constan... | bsd-3-clause |
CydarLtd/ansible | lib/ansible/modules/database/vertica/vertica_facts.py | 50 | 9410 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
bpsinc-native/src_third_party_libjingle_source_talk | PRESUBMIT.py | 2 | 5115 | # libjingle
# Copyright 2013 Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following dis... | bsd-3-clause |
Endika/Algorithm-Implementations | Johnson_Search/Python/paveldedik/johnson.py | 23 | 2103 | def initialize(G, s):
"""Initialize graph G and vertex s."""
V, E = G
d = {v: float('inf') for v in V}
p = {v: None for v in V}
d[s] = 0
return d, p
def bellman_ford(G, w, s):
"""Bellman-Ford's algorithm for shortest-path search. Expects oriented graph.
Parameter G is a graph represent... | mit |
LarryHillyer/PoolHost | PoolHost/env/Lib/site-packages/django/contrib/postgres/operations.py | 46 | 1527 | from django.contrib.postgres.signals import register_hstore_handler
from django.db.migrations.operations.base import Operation
class CreateExtension(Operation):
reversible = True
def __init__(self, name):
self.name = name
def state_forwards(self, app_label, state):
pass
def database... | gpl-3.0 |
infinyte/oppia | core/domain/subscription_services_test.py | 13 | 8327 | # 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 |
etzhou/edx-platform | common/djangoapps/util/tests/test_file.py | 86 | 11237 | # -*- coding: utf-8 -*-
"""
Tests for file.py
"""
import ddt
from io import StringIO
from django.test import TestCase
from datetime import datetime
from django.utils.timezone import UTC
from mock import patch, Mock
from django.http import HttpRequest
from django.core.files.uploadedfile import SimpleUploadedFile
import... | agpl-3.0 |
IllusionRom-deprecated/android_platform_tools_idea | python/lib/Lib/site-packages/django/contrib/localflavor/pl/forms.py | 273 | 5444 | """
Polish-specific form helpers
"""
import re
from django.forms import ValidationError
from django.forms.fields import Select, RegexField
from django.utils.translation import ugettext_lazy as _
from django.core.validators import EMPTY_VALUES
class PLProvinceSelect(Select):
"""
A select widget with list of P... | apache-2.0 |
rysson/filmkodi | plugin.video.xbmcfilm/resources/lib/utils/beta/t0mm0/common/addon.py | 9 | 26636 | '''
common XBMC Module
Copyright (C) 2011 t0mm0
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 later version.
Th... | apache-2.0 |
mochi/udplog | setup.py | 2 | 2318 | import os
from setuptools import setup
EXTRAS = {
'rabbitmq': [
'txAMQP'
],
'redis': [
'txredis',
],
'scribe': [
'thrift',
'scribe',
],
'kafka': [
'kafka-python',
],
'dev': [
'coverage',
'pyflakes',
'Sphinx',
]
}
E... | mit |
elkingtonmcb/sympy | sympy/simplify/epathtools.py | 97 | 10248 | """Tools for manipulation of expressions using paths. """
from __future__ import print_function, division
from sympy.core.compatibility import range
from sympy.core import Basic
class EPath(object):
r"""
Manipulate expressions using paths.
EPath grammar in EBNF notation::
literal ::= /[A-Za-... | bsd-3-clause |
ric2b/Vivaldi-browser | chromium/third_party/tlslite/tlslite/integration/httptlsconnection.py | 115 | 4314 | # Authors:
# Trevor Perrin
# Kees Bos - Added ignoreAbruptClose parameter
# Dimitris Moraitis - Anon ciphersuites
# Martin von Loewis - python 3 port
#
# See the LICENSE file for legal information regarding use of this file.
"""TLS Lite + httplib."""
import socket
try:
import httplib
except ImportError:
... | bsd-3-clause |
EvangelouSotiris/flightradiationcalc | main.py | 1 | 5469 | import time
import requests
##############################################################
############## REQUESTS MANAGEMENT/ LINKS ####################
##############################################################
headers = {'User-Agent' : 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52... | gpl-3.0 |
KSG-IT/ksg-nett | api/serializers.py | 1 | 4959 | from django.conf import settings
from rest_framework import serializers
from rest_framework_simplejwt.serializers import TokenObtainSlidingSerializer
from api.exceptions import InsufficientFundsException, NoSociSessionError
from economy.models import SociProduct, ProductOrder, SociSession, SociBankAccount
class Cust... | gpl-3.0 |
fordcars/SDL3D | tools/Frameworkify/frameworkify.py | 1 | 3860 | #!/usr/bin/env python -S
# -*- coding: utf-8 -*-
r"""
frameworkify
~~~~~~~~~~~~
A small command line tool that can rewrite the paths to dynamic
loaded libraries in .dylib files so that they reference other
paths. By default it will rewrite the path so that it points to
the bundle's Frameworks ... | gpl-3.0 |
d40223223/w16b_test | static/Brython3.1.1-20150328-091302/Lib/external_import.py | 742 | 2985 | import os
from browser import doc
import urllib.request
## this module is able to download modules that are external to
## localhost/src
## so we could download from any URL
class ModuleFinder:
def __init__(self, path_entry):
print("external_import here..")
#print(path_entry)
self._module=... | gpl-3.0 |
alvinli1991/wechatServer | site-packages/requests/packages/chardet/eucjpprober.py | 2919 | 3678 | ######################## 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... | mit |
jwlawson/tensorflow | tensorflow/contrib/signal/python/ops/mfcc_ops.py | 6 | 4706 | # 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 |
darkonie/dcos | packages/adminrouter/extra/src/test-harness/modules/mocker/endpoints/basehandler.py | 3 | 10107 | # Copyright (C) Mesosphere, Inc. See LICENSE file for details.
"""Module that defines the behaviour common to all requests handlers used by mocker.
"""
import abc
import http.server
import json
import logging
import socket
import time
import traceback
from urllib.parse import parse_qs, urlparse
from exceptions impo... | apache-2.0 |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/PIL/ImageStat.py | 26 | 3826 | #
# The Python Imaging Library.
# $Id$
#
# global image statistics
#
# History:
# 1996-04-05 fl Created
# 1997-05-21 fl Added mask; added rms, var, stddev attributes
# 1997-08-05 fl Added median
# 1998-07-05 hk Fixed integer overflow error
#
# Notes:
# This class shows how to implement delayed evaluation of att... | mit |
amrdraz/brython | www/src/Lib/collections/__init__.py | 12 | 34896 | #__all__ = ['deque', 'defaultdict', 'Counter']
from _collections import deque, defaultdict
#from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
'UserString', 'Counter', 'OrderedDict']
# For bootstrapping re... | bsd-3-clause |
fmyzjs/horizon-hacker | horizon/loaders.py | 16 | 1571 | """
Wrapper for loading templates from "templates" directories in panel modules.
"""
import os
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
# Set up a cache of the panel directories to searc... | apache-2.0 |
william-richard/moto | tests/test_ec2/test_instances.py | 1 | 62435 | from __future__ import unicode_literals
from botocore.exceptions import ClientError
import pytest
from unittest import SkipTest
import base64
import ipaddress
import six
import boto
import boto3
from boto.ec2.instance import Reservation, InstanceAttribute
from boto.exception import EC2ResponseError
from freezegun i... | apache-2.0 |
ManiacalLabs/BiblioPixel | test/bibliopixel/project/fill_test.py | 2 | 3691 | import copy, unittest
from bibliopixel.project import fill, merge, project
from bibliopixel.animation.sequence import Sequence
from bibliopixel.animation.matrix import Matrix
from bibliopixel.animation.off import Off
from bibliopixel.layout import cube, matrix, strip
from bibliopixel.util import data_file
BASE = {
... | mit |
acbilson/forbidden-island | tests/test_print.py | 1 | 1905 | import sys
sys.path.append('../src')
from tiles import *
from tile import *
class Test(object):
def __init__(self):
self.board = ""
def gen_board(self, tiles):
segments = []
rows = [[0,1],
[2,3,4,5],
[6,7,8,9,10,11],
[12,13,14,15,16... | gpl-3.0 |
ivano666/tensorflow | tensorflow/python/platform/flags.py | 28 | 4260 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
Inboxen/website | views/inbox/delete.py | 1 | 2017 | ##
# Copyright (C) 2013 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... | agpl-3.0 |
xpndlabs/kivy | kivy/core/gl/__init__.py | 44 | 2824 | # pylint: disable=W0611
'''
OpenGL
======
Select and use the best OpenGL library available. Depending on your system, the
core provider can select an OpenGL ES or a 'classic' desktop OpenGL library.
'''
from os import environ
from sys import platform as sysplatform, exit
MIN_REQUIRED_GL_VERSION = (2, 0)
def msgbo... | mit |
juan-cb/django-cookie-law | setup.py | 1 | 1609 | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
from itertools import chain
from glob import glob
import cookielaw
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
... | bsd-2-clause |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tseries/frequencies.py | 2 | 15559 | from datetime import timedelta
import re
from typing import Dict
import numpy as np
from pytz import AmbiguousTimeError
from pandas._libs.algos import unique_deltas
from pandas._libs.tslibs import Timedelta, Timestamp
from pandas._libs.tslibs.ccalendar import MONTH_ALIASES, int_to_weekday
from pandas._libs.tslibs.fie... | apache-2.0 |
khkaminska/djangoproject.com | releases/migrations/0001_initial.py | 9 | 1131 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Release',
fields=[
('version',... | bsd-3-clause |
RolanDroid/lge_MonsterKernel-JB-Stock | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
wakatime/wakatime | wakatime/packages/py27/cryptography/x509/ocsp.py | 6 | 13310 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import datetime
from enum import Enum
import six
from crypto... | bsd-3-clause |
hdinsight/hue | desktop/core/ext-py/thrift-0.9.1/src/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 |
sonali0901/zulip | analytics/views.py | 1 | 37020 | from __future__ import absolute_import, division
from django.conf import settings
from django.core import urlresolvers
from django.db import connection
from django.db.models import Sum
from django.db.models.query import QuerySet
from django.http import HttpResponseNotFound, HttpRequest, HttpResponse
from django.templa... | apache-2.0 |
luboslenco/cyclesgame | blender/arm/utils.py | 1 | 24354 | import bpy
import json
import os
import glob
import platform
import zipfile
import re
import subprocess
import webbrowser
import numpy as np
import arm.lib.armpack
import arm.make_state as state
import arm.log as log
class NumpyEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.ndarra... | lgpl-3.0 |
kevalds51/sympy | doc/src/conf.py | 54 | 6371 | # -*- coding: utf-8 -*-
#
# SymPy documentation build configuration file, created by
# sphinx-quickstart.py on Sat Mar 22 19:34:32 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickle... | bsd-3-clause |
asm666/sympy | sympy/printing/tests/test_ccode.py | 46 | 13866 | from sympy.core import (pi, oo, symbols, Rational, Integer,
GoldenRatio, EulerGamma, Catalan, Lambda, Dummy, Eq)
from sympy.functions import (Piecewise, sin, cos, Abs, exp, ceiling, sqrt,
gamma, sign)
from sympy.utilities.pytest import raises
from sympy.printing.ccod... | bsd-3-clause |
pforret/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/BaseDB.py | 238 | 3508 | """Base class for SharedKeyDB and VerifierDB."""
import anydbm
import thread
class BaseDB:
def __init__(self, filename, type):
self.type = type
self.filename = filename
if self.filename:
self.db = None
else:
self.db = {}
self.lock = thre... | apache-2.0 |
jmargeta/scikit-learn | sklearn/tests/test_pls.py | 6 | 9383 | import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.datasets import load_linnerud
from sklearn import pls
def test_pls():
d = load_linnerud()
X = d.data
Y = d.target
# 1) Canonical (symetric) PLS (PLS 2 blocks canonical mode A)
# ============================... | bsd-3-clause |
xiangel/hue | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/admin/__init__.py | 37 | 6199 | #
# Autocomplete feature for admin panel
#
import six
import operator
from six.moves import reduce
from django.http import HttpResponse, HttpResponseNotFound
from django.conf import settings
from django.db import models
from django.db.models.query import QuerySet
from django.utils.encoding import smart_str
from django... | apache-2.0 |
xujun10110/Empire | lib/modules/persistence/misc/install_ssp.py | 22 | 8473 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Install-SSP',
'Author': ['@mattifestation'],
'Description': ('Installs a security support provider (SSP) dll.'),
'Background' : True,
... | bsd-3-clause |
avoinsystems/odoo | addons/survey/wizard/survey_email_compose_message.py | 214 | 10914 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
rui-castro/Sick-Beard | lib/requests/packages/charade/escsm.py | 206 | 8081 | ######################## 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.
... | gpl-3.0 |
vveerava/Openstack | neutron/plugins/openvswitch/common/config.py | 6 | 4097 | # Copyright 2012 Red Hat, 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 agre... | apache-2.0 |
errx/django | django/core/files/move.py | 103 | 3164 | """
Move a file in the safest way possible::
>>> from django.core.files.move import file_move_safe
>>> file_move_safe("/tmp/old_file", "/tmp/new_file")
"""
import os
from django.core.files import locks
try:
from shutil import copystat
except ImportError:
import stat
def copystat(src, dst):
... | bsd-3-clause |
shubhamdipt/django-autocomplete-light | src/dal/forward.py | 2 | 1830 | """Classes for class-based forward declaration."""
class Forward(object):
"""Base class for autocomplete forward declaration."""
def type(self):
"""Forward type. Should be implemented in subclasses."""
raise NotImplementedError("Please use one of my subclasses")
def to_dict(self):
... | mit |
Technorip/Myntra | Django Backend/myntra/env/lib/python2.7/site-packages/pip/_vendor/colorama/ansi.py | 640 | 2524 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
OSC = '\033]'
BEL = '\007'
def code_to_chars(code):
return CSI + str(code) + 'm'
def set... | gpl-2.0 |
VladimirFilonov/django-waffle | waffle/south_migrations/0007_auto__chg_field_flag_created__chg_field_flag_modified__chg_field_switc.py | 22 | 8209 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Flag.created'
db.alter_column('waffle_flag', 'created', self.gf('django.db.models.fields.... | bsd-3-clause |
TOCyna/tabelinha | flask/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/__init__.py | 79 | 1171 | # mysql/__init__.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
from . import base, mysqldb, oursql, \
pyodbc, zxjdbc, mysqlconnector, pymysql... | gpl-2.0 |
nuclear-wizard/moose | test/tests/mesh/tiled_mesh/tiled_mesh.py | 21 | 1531 | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
"""
Creates... | lgpl-2.1 |
bak1an/django | tests/multiple_database/models.py | 70 | 2216 | from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Review(models.Model):
source = models.CharField(max_length=100)
content_type = mo... | bsd-3-clause |
ozamiatin/glance | glance/common/utils.py | 1 | 26028 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2014 SoftLayer Technologies, Inc.
# Copyright 2015 Mirantis, Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
dentaku65/pelisalacarta | python/main-classic/lib/gdata/tlslite/constants.py | 279 | 7476 | """Constants used in various places."""
class CertificateType:
x509 = 0
openpgp = 1
cryptoID = 2
class HandshakeType:
hello_request = 0
client_hello = 1
server_hello = 2
certificate = 11
server_key_exchange = 12
certificate_request = 13
server_hello_done = 14
certificate_ve... | gpl-3.0 |
ultilix/catawampus | tr/download_test.py | 6 | 20731 | #!/usr/bin/python
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
keitaroyam/yamtbx | cctbx_progs/dano_vs_d.py | 1 | 1364 | """
Usage:
phenix.python dano_vs_d.py your.sca 20
"""
import iotbx.file_reader
from cctbx.array_family import flex
def run(hklin, n_bins):
for array in iotbx.file_reader.any_file(hklin).file_server.miller_arrays:
# skip if not anomalous intensity data
if not (array.is_xray_intensity_array() and a... | bsd-3-clause |
maxkoryukov/headphones | lib/requests/models.py | 69 | 29173 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | gpl-3.0 |
shsingh/ansible | lib/ansible/modules/network/fortios/fortios_wireless_controller_vap.py | 7 | 61928 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
ianstalk/Flexget | flexget/components/managed_lists/lists/movie_list/db.py | 3 | 7317 | from datetime import datetime
from loguru import logger
from sqlalchemy import Column, DateTime, ForeignKey, Integer, Unicode, func
from sqlalchemy.orm import relationship
from sqlalchemy.sql.elements import and_
from flexget import plugin
from flexget.db_schema import versioned_base, with_session
from flexget.entry ... | mit |
jamespcole/home-assistant | homeassistant/components/eight_sleep/binary_sensor.py | 1 | 1832 | """Support for Eight Sleep binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from . import CONF_BINARY_SENSORS, DATA_EIGHT, NAME_MAP, EightSleepHeatEntity
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['eight_sleep']
async def async_setup_platform(hass,... | apache-2.0 |
avoinsystems/odoo | addons/google_drive/google_drive.py | 98 | 14693 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<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... | agpl-3.0 |
xbmc/xbmc-antiquated | xbmc/lib/libPython/Python/Lib/pickle.py | 5 | 45729 | """Create portable serialized representations of Python objects.
See module cPickle for a (much) faster implementation.
See module copy_reg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.
Classes:
Pickler
Unpickler
Functions:
dump(object, file)
... | gpl-2.0 |
kytvi2p/Sigil | 3rdparty/python/Tools/scripts/fixdiv.py | 94 | 13938 | #! /usr/bin/env python3
"""fixdiv - tool to fix division operators.
To use this tool, first run `python -Qwarnall yourscript.py 2>warnings'.
This runs the script `yourscript.py' while writing warning messages
about all uses of the classic division operator to the file
`warnings'. The warnings look like this:
<fil... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.