repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
jmerkow/VTK | Parallel/Core/Testing/Python/TestPolyDataPieces.py | 12 | 2945 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
math = vtk.vtkMath()
math.RandomSeed(22)
sphere = vtk.vtkSphereSource()
sphere.SetPhiResolution(32)
sphere.SetThetaResolution(32)
extract = vtk.vtkExtractPolyDataPiece()
extract.Set... | bsd-3-clause |
steinwurf/yaml-cpp | test/gmock-1.7.0/gtest/test/gtest_test_utils.py | 1100 | 10812 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
hanzorama/magenta | magenta/models/attention_rnn/attention_rnn_generate.py | 1 | 1936 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
skawu/RT-Thread-STM32F103ZET6 | tools/vs.py | 44 | 4662 | #
# File : vs.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the L... | gpl-2.0 |
svdata/kubernetes | cluster/juju/charms/trusty/kubernetes-master/unit_tests/kubernetes_installer_test.py | 213 | 4910 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
BorgERP/borg-erp-6of3 | verticals/hotel61/hotel/__init__.py | 4 | 1097 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
mschex1/pokedex | pokedex/formulae.py | 4 | 4538 | # encoding: utf8
"""Faithful translations of calculations the games make."""
from __future__ import division
from itertools import izip
def nCr(n, r):
"""n-choose-r.
Thanks for the "compact" solution go to:
http://stackoverflow.com/questions/2096573/counting-combinations-and-permutations-efficiently
... | mit |
topnotchgeek/capnlog | apps/www/views.py | 1 | 21358 |
import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import login, logout
from django.core.urlresolvers import reverse
from django.http import JsonResponse, HttpResponse, HttpResponseBadRequest
from django.db.models import Avg, Min... | apache-2.0 |
andyfaff/scipy | scipy/optimize/_dual_annealing.py | 7 | 29860 | # Dual Annealing implementation.
# Copyright (c) 2018 Sylvain Gubian <sylvain.gubian@pmi.com>,
# Yang Xiang <yang.xiang@pmi.com>
# Author: Sylvain Gubian, Yang Xiang, PMP S.A.
"""
A Dual Annealing global optimization algorithm
"""
import numpy as np
from scipy.optimize import OptimizeResult
from scipy.optimize import... | bsd-3-clause |
Aiacos/DevPyLib | mayaLib/rigLib/utils/clothMuscleSetup.py | 1 | 7679 | import pymel.core as pm
import maya.mel as mel
def getAllObjectUnderGroup(group, type='mesh'):
"""
Return all object of given type under group
:param group: str, group name
:param type: str, object type
:return: object list
"""
objList = None
if type == 'mesh':
objList = [pm.li... | agpl-3.0 |
VenusGrape/MITx-6.00.1x- | guess _my_number.py | 1 | 3740 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 25 13:53:05 2017
@author: venusgrape
In this problem, you'll create a program that guesses a secret number!
The program works as follows: you (the user) thinks of an integer between 0 (inclusive) and 100 (not inclusive).
The computer makes guesse... | mit |
ukanga/SickRage | lib/hachoir_parser/file_system/fat.py | 95 | 16153 | from hachoir_core.compatibility import sorted
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, StaticFieldSet,
RawBytes, PaddingBytes, createPaddingField, Link, Fragment,
Bit, Bits, UInt8, UInt16, UInt32,
String, Bytes, NullBytes)
from hachoir_core.field.integer import GenericInte... | gpl-3.0 |
valuehack/scholarium.at | Bibliothek/views.py | 1 | 1672 | from django.http import HttpResponseRedirect
import re
import os
from . import models
from django.db import transaction
from django.conf import settings
from Grundgeruest.views import ListeMitMenue
def liste_buecher(request):
return ListeMitMenue.as_view(
template_name='Bibliothek/buecher_alt.html',
... | mit |
takluyver/pyzmq | examples/mongodb/client.py | 1 | 1831 | #!/usr/bin/env python
#
# Copyright (c) 2010 Justin Riley
#
# This file is part of pyzmq.
#
# pyzmq is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# ... | lgpl-3.0 |
kprestel/PyInvestment | pytech/data/reader.py | 2 | 10810 | """
Act as a wrapper around pandas_datareader and write the responses to the
database to be accessed later.
"""
import datetime as dt
import logging
from typing import Dict, Iterable, Union, Tuple
import numpy as np
import pandas as pd
import pandas_datareader as pdr
from arctic.date import DateRange
from arctic.excep... | mit |
mmnelemane/neutron | neutron/db/migration/alembic_migrations/cisco_init_ops.py | 13 | 11857 | # Copyright 2014 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 ... | apache-2.0 |
Lekensteyn/buildbot | master/buildbot/scripts/restart.py | 11 | 1223 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
kantai/passe-framework-prototype | django/views/generic/detail.py | 154 | 5498 | import re
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import Http404
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, View
class SingleObjectMixin(object):
"... | bsd-3-clause |
IronLanguages/ironpython3 | Tests/test_compiler.py | 1 | 9033 | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import os
import unittest
from iptest import IronPythonTestCase, is_cli, is_netcoreapp, run_test, skipUnlessIron... | apache-2.0 |
Pymatteo/QtNMR | build/exe.win32-3.4/scipy/integrate/tests/test_integrate.py | 7 | 19403 | # Authors: Nils Wagner, Ed Schofield, Pauli Virtanen, John Travers
"""
Tests for numerical integration.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import (arange, zeros, array, dot, sqrt, cos, sin, eye, pi, exp,
allclose)
from scipy.lib.six im... | gpl-3.0 |
ak2703/edx-platform | openedx/core/lib/logsettings.py | 127 | 5765 | """Get log settings."""
import os
import platform
import sys
from logging.handlers import SysLogHandler
LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
def get_logger_config(log_dir,
logging_env="no_env",
tracking_filename="tracking.log",
... | agpl-3.0 |
ghedsouza/django | tests/indexes/tests.py | 35 | 5422 | from unittest import skipUnless
from django.db import connection
from django.db.models.deletion import CASCADE
from django.db.models.fields.related import ForeignKey
from django.test import TestCase, TransactionTestCase
from .models import Article, ArticleTranslation, IndexTogetherSingleList
class SchemaIndexesTest... | bsd-3-clause |
donutmonger/youtube-dl | youtube_dl/utils.py | 7 | 71290 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import calendar
import codecs
import contextlib
import ctypes
import datetime
import email.utils
import errno
import functools
import gzip
import itertools
import io
import json
import locale
import math
import operator
import os
im... | unlicense |
jmartinm/inspire-next | inspire/testsuite/test_workflows.py | 1 | 11909 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014, 2015 CERN.
#
# INSPIRE 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 |
kdwink/intellij-community | plugins/hg4idea/testData/bin/hgext/children.py | 93 | 1556 | # Mercurial extension to provide the 'hg children' command
#
# Copyright 2007 by Intevation GmbH <intevation@intevation.de>
#
# Author(s):
# Thomas Arendsen Hein <thomas@intevation.de>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version... | apache-2.0 |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/tkinter/test/runtktests.py | 9 | 2257 | """
Use this module to get and run all tk tests.
tkinter tests should live in a package inside the directory where this file
lives, like test_tkinter.
Extensions also should live in packages following the same rule as above.
"""
import os
import sys
import unittest
import importlib
import test.support
this_dir_path ... | apache-2.0 |
barbarahui/harvester | scripts/queue_image_harvest_for_doc_ids.py | 3 | 3728 | # -*- coding: utf-8 -*-
#! /bin/env python
import sys
import os
from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
from harvester.image_harvest import harvest_image_for_doc
EMAIL_RETURN_ADDRESS = os.environ.get('EMAIL_RETURN_ADDRESS',
'example@example.com')
# c... | bsd-3-clause |
espadrine/opera | chromium/src/tools/telemetry/telemetry/core/chrome/browser_backend.py | 3 | 8702 | # 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 urllib2
import httplib
import socket
import json
import re
import sys
from telemetry.core import util
from telemetry.core import exceptions
from ... | bsd-3-clause |
toshywoshy/ansible | lib/ansible/modules/cloud/vmware/vsphere_copy.py | 17 | 7469 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Dag Wieers (@dagwieers) <dag@wieers.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 = {
'metada... | gpl-3.0 |
newville/scikit-image | skimage/filter/__init__.py | 5 | 2789 | from .._shared.utils import skimage_deprecation
from warnings import warn
global _import_warned
warn(skimage_deprecation('The `skimage.filter` module has been renamed '
'to `skimage.filters`. This placeholder module '
'will be removed in v0.13.'))
_import_warned = Tr... | bsd-3-clause |
guitarmanj/king-phisher | tests/server/database/manager.py | 4 | 3528 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tests/server/database/manager.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,... | bsd-3-clause |
scith/htpc-manager_ynh | sources/libs/formencode/util/doctest24.py | 19 | 99378 | # Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
r"""Module doctest -- a framework for running examples in docstrings.
In... | gpl-3.0 |
kbkailashbagaria/subliminal | subliminal/converters/tvsubtitles.py | 7 | 1140 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from babelfish import LanguageReverseConverter, language_converters
class TVsubtitlesConverter(LanguageReverseConverter):
def __init__(self):
self.alpha2_converter = language_converters['alpha2']
self.from_tvsubtitles = {'br': ('por',... | mit |
bdh1011/cupeye | venv/lib/python2.7/site-packages/pip/_vendor/distlib/util.py | 203 | 51453 | #
# Copyright (C) 2012-2014 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
import... | bsd-3-clause |
Kiddinglife/geconet | thirdparty/googlemock/scripts/generator/cpp/gmock_class_test.py | 3 | 11804 | #!/usr/bin/env python
#
# Copyright 2009 Neal Norwitz All Rights Reserved.
# Portions Copyright 2009 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
#... | gpl-3.0 |
bsipocz/ccdproc | ccdproc/tests/test_ccdproc.py | 1 | 19488 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the base CCDData class
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from astropy.io import fits
from astropy.modeling import models
from astropy.un... | bsd-3-clause |
sugarsweetrobotics/wasanbon | wasanbon/core/plugins/admin/systeminstaller_plugin/__init__.py | 1 | 15530 | import os, sys, shutil
import wasanbon
from wasanbon.core.plugins import PluginFunction, manifest
class Plugin(PluginFunction):
""" This plugin provides APIs to install RTCs into System (automatically editting rtc.conf for rtcd to load RTCs when launched) """
def __init__(self):
#PluginFunction.__init... | gpl-3.0 |
DanielJRaine/Portfolio | node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | 1835 | 12124 | # Copyright (c) 2012 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.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | mit |
wkschwartz/django | tests/csrf_tests/views.py | 40 | 1236 | from django.http import HttpResponse
from django.middleware.csrf import get_token
from django.template import Context, RequestContext, Template
from django.template.context_processors import csrf
from django.views.decorators.csrf import ensure_csrf_cookie
def post_form_view(request):
"""Return a POST form (withou... | bsd-3-clause |
apanju/odoo | openerp/addons/base/ir/ir_cron.py | 276 | 15096 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
liyu1990/tensorflow | tensorflow/python/kernel_tests/dense_update_ops_test.py | 5 | 5333 | """Tests for tensorflow.ops.tf.Assign*."""
import tensorflow.python.platform
import numpy as np
import tensorflow as tf
class AssignOpTest(tf.test.TestCase):
def _initAssignFetch(self, x, y, use_gpu=False):
"""Initialize a param to init and update it with y."""
super(AssignOpTest, self).setUp()
with s... | apache-2.0 |
rigdenlab/SIMBAD | simbad/mr/molrep_mr.py | 1 | 18677 | #!/usr/bin/env ccp4-python
"""Module to run molrep on a model"""
__author__ = "Adam Simpkin"
__date__ = "02 May 2017"
__version__ = "1.0"
import os
import operator
import shutil
from simbad.mr.options import SGAlternatives
from simbad.util import mtz_util
from pyjob import cexec
from pyjob.script import EXE_EXT
d... | bsd-3-clause |
hfp/tensorflow-xsmm | tensorflow/python/debug/lib/session_debug_testlib.py | 11 | 64583 | # 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 |
neteler/QGIS | python/plugins/processing/algs/lidar/fusion/GridSurfaceCreate.py | 7 | 5821 | # -*- coding: utf-8 -*-
"""
***************************************************************************
GridSurfaceCreate.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
-----------------... | gpl-2.0 |
DanielSBrown/osf.io | framework/mongo/__init__.py | 43 | 1181 | # -*- coding: utf-8 -*-
from flask import request
from modularodm.storedobject import StoredObject as GenericStoredObject
from modularodm.ext.concurrency import with_proxies, proxied_members
from bson import ObjectId
from .handlers import client, database, set_up_storage
from api.base.api_globals import api_globals... | apache-2.0 |
tgreenyc/heat-templates | hot/software-config/elements/heat-config-docker-compose/install.d/hook-docker-compose.py | 8 | 3705 | #!/usr/bin/env python
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 |
ronekko/chainer | chainer/datasets/fashion_mnist.py | 12 | 3771 | import os
import numpy
import chainer
from chainer.dataset import download
from chainer.datasets._mnist_helper import make_npz
from chainer.datasets._mnist_helper import preprocess_mnist
_fashion_mnist_labels = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat',
'Sandal', 'Shirt', 'Snea... | mit |
mcfreis/pydtls | dtls/tlock.py | 2 | 1903 | # TLock: OpenSSL lock support on thread-enabled systems.
# Copyright 2012 Ray Brown
#
# 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
#
# The... | apache-2.0 |
imply/chuu | third_party/tlslite/tlslite/utils/ASN1Parser.py | 80 | 1038 | """Class for parsing ASN.1"""
from compat import *
from codec import *
#Takes a byte array which has a DER TLV field at its head
class ASN1Parser:
def __init__(self, bytes):
p = Parser(bytes)
p.get(1) #skip Type
#Get Length
self.length = self._getASN1Length(p)
#Get Value
... | bsd-3-clause |
hlin117/scikit-learn | sklearn/tests/test_pipeline.py | 2 | 31779 | """
Test the pipeline module.
"""
from tempfile import mkdtemp
import shutil
import time
import numpy as np
from scipy import sparse
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raises_regex
from sklearn.utils.testing import asse... | bsd-3-clause |
hzy/raven-python | tests/utils/wsgi/tests.py | 23 | 2841 | from raven.utils.testutils import TestCase
from raven.utils.wsgi import get_headers, get_host, get_environ
class GetHeadersTest(TestCase):
def test_tuple_as_key(self):
result = dict(get_headers({
('a', 'tuple'): 'foo',
}))
self.assertEquals(result, {})
def test_coerces_htt... | bsd-3-clause |
lihui7115/ChromiumGStreamerBackend | chrome/tools/build/win/resedit.py | 152 | 11259 | #!/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.
"""A utility script that can extract and edit resources in a Windows binary.
For detailed help, see the script's usage by invoking... | bsd-3-clause |
mnizol/ormpy | test/TestJoinPath.py | 1 | 5180 | ##############################################################################
# Package: ormpy
# File: TestJoinPath.py
# Author: Matthew Nizol
##############################################################################
""" This file contains unit tests for :class:`lib.JoinPath.JoinPath` """
from unittest impo... | gpl-2.0 |
gnowxilef/youtube-dl | youtube_dl/extractor/cartoonnetwork.py | 42 | 1776 | # coding: utf-8
from __future__ import unicode_literals
import re
from .turner import TurnerBaseIE
class CartoonNetworkIE(TurnerBaseIE):
_VALID_URL = r'https?://(?:www\.)?cartoonnetwork\.com/video/(?:[^/]+/)+(?P<id>[^/?#]+)-(?:clip|episode)\.html'
_TEST = {
'url': 'http://www.cartoonnetwork.com/vide... | unlicense |
umitproject/network-admin | netadmin/events/utils.py | 1 | 4469 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Adriano Monteiro Marques
#
# Authors: Amit Pal <amix.pal@gmail.com>
# Piotrek Wasilewski <wasilewski.piotrek@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pub... | agpl-3.0 |
leeclemens/dnspython | dns/rdtypes/ANY/NSEC3PARAM.py | 8 | 2995 | # Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | isc |
ohmini/thaifoodapi | lib/django/db/migrations/operations/special.py | 374 | 7425 | from __future__ import unicode_literals
from django.db import router
from .base import Operation
class SeparateDatabaseAndState(Operation):
"""
Takes two lists of operations - ones that will be used for the database,
and ones that will be used for the state change. This allows operations
that don't ... | bsd-3-clause |
noba3/KoTos | addons/script.module.youtube.dl/lib/youtube_dl/extractor/macgamestore.py | 142 | 1275 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import ExtractorError
class MacGameStoreIE(InfoExtractor):
IE_NAME = 'macgamestore'
IE_DESC = 'MacGameStore trailers'
_VALID_URL = r'https?://www\.macgamestore\.com/mediaviewer\.php\?trailer=(?P<id>\d+)'
_TEST = {... | gpl-2.0 |
yubbie/googleapps-message-recall | message_recall/lib/wtforms/ext/sqlalchemy/fields.py | 54 | 6679 | """
Useful form fields for use with SQLAlchemy ORM.
"""
from __future__ import unicode_literals
import operator
from wtforms import widgets
from wtforms.compat import text_type, string_types
from wtforms.fields import SelectFieldBase
from wtforms.validators import ValidationError
try:
from sqlalchemy.orm.util im... | apache-2.0 |
ecoal95/servo | tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/h2/events.py | 37 | 20478 | # -*- coding: utf-8 -*-
"""
h2/events
~~~~~~~~~
Defines Event types for HTTP/2.
Events are returned by the H2 state machine to allow implementations to keep
track of events triggered by receiving data. Each time data is provided to the
H2 state machine it processes the data and returns a list of Event objects.
"""
im... | mpl-2.0 |
tangyiyong/odoo | addons/website/models/ir_http.py | 162 | 13407 | # -*- coding: utf-8 -*-
import logging
import os
import re
import traceback
import werkzeug
import werkzeug.routing
import werkzeug.utils
import openerp
from openerp.addons.base import ir
from openerp.addons.base.ir import ir_qweb
from openerp.addons.website.models.website import slug, url_for, _UNSLUG_RE
from opener... | agpl-3.0 |
lavaner/pywim2 | docs/conf.py | 1 | 8296 | # -*- coding: utf-8 -*-
#
# pywim2 documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 22 00:19:46 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | gpl-3.0 |
jiangzhuo/kbengine | kbe/res/scripts/common/Lib/test/test_functools.py | 60 | 60228 | import abc
import collections
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import unittest
from weakref import proxy
import functools
py_functools = support.import_fresh_module('functools', blocked=['_functools'])
c_functools = support.import_fresh_mod... | lgpl-3.0 |
cemarchi/biosphere | Src/BioDataManagement/DataAccess/Repositories/GeneAnnotionRepository.py | 1 | 1780 | from typing import List, Dict
from Src.BioDataManagement.CrossCutting.Contracts.GeneAnnotationRepositoryBase import GeneAnnotationRepositoryBase
from Src.BioDataManagement.CrossCutting.DTOs.GeneAnnotationDto import GeneAnnotationDto
from Src.BioDataManagement.CrossCutting.Filters.FeListGeneAnnotation import FeListGene... | bsd-3-clause |
kobotoolbox/kpi | kpi/views/v2/user.py | 1 | 3070 | # coding: utf-8
from django.contrib.auth.models import User
from rest_framework import exceptions, mixins, renderers, status, viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework.reverse import reverse
from kpi.tasks import sync_kobocat_xforms
from kpi.... | agpl-3.0 |
sophieottaway/EA-New | node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/gyptest.py | 1752 | 8019 | #!/usr/bin/env python
# Copyright (c) 2012 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.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(obje... | mit |
simonmonk/pi_magazine | 03_alarm_clock/Adafruit_7Segment.py | 9 | 1693 | #!/usr/bin/python
import time
import datetime
from Adafruit_LEDBackpack import LEDBackpack
# ===========================================================================
# 7-Segment Display
# ===========================================================================
# This class is meant to be used with the four-cha... | mit |
qsnake/gpaw | doc/install/BGP/bgp_xlc_linker.py | 1 | 1654 | #!/usr/bin/env python
"""bgp_xlc.py is a wrapper for the BGP xlc compiler,
converting/removing incompatible gcc args. """
import sys
from subprocess import call
from glob import glob
args2change = {"-fno-strict-aliasing":"",
"-fmessage-length=0":"",
"-Wall":"",
"-std=... | gpl-3.0 |
rebase-helper/rebase-helper | rebasehelper/completion.py | 1 | 3433 | # -*- coding: utf-8 -*-
#
# This tool helps you rebase your package to the latest version
# Copyright (C) 2013-2019 Red Hat, 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... | gpl-2.0 |
haku86/icecream | docs/conf.py | 1 | 7738 | # -*- coding: utf-8 -*-
#
# icecream documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 17 11:46:20 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | mit |
warriorframework/warriorframework | warrior/Framework/ClassUtils/WSelenium/element_operations.py | 1 | 17685 | '''
Copyright 2017, Fujitsu Network Communications, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | apache-2.0 |
blooparksystems/odoo | openerp/addons/base/res/res_bank.py | 25 | 3705 | # -*- coding: utf-8 -*-
import re
from openerp import api, fields, models, _
from openerp.osv import expression
from openerp.exceptions import UserError
def sanitize_account_number(acc_number):
if acc_number:
return re.sub(r'\W+', '', acc_number).upper()
return False
class Bank(models.Model):
_d... | gpl-3.0 |
chiragjogi/odoo | addons/sale/sale.py | 55 | 74103 | # -*- 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 |
jonnary/keystone | keystone/common/wsgi.py | 8 | 30934 | # Copyright 2012 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | apache-2.0 |
J-Liu/qemu | tests/migration/guestperf/plot.py | 14 | 19005 | #
# Migration test graph plotting
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This 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 the Free Software Foundation; either
# version 2 of the License, or (at your option) any later v... | gpl-2.0 |
domenicosolazzo/practice-django | venv/lib/python2.7/site-packages/django/contrib/auth/tests/custom_user.py | 185 | 5668 | from django.db import models
from django.contrib.auth.models import (
BaseUserManager,
AbstractBaseUser,
AbstractUser,
UserManager,
PermissionsMixin,
Group,
Permission,
)
# The custom User uses email as the unique identifier, and requires
# that every user provide a date of birth. This let... | mit |
haad/ansible | lib/ansible/modules/network/panos/panos_import.py | 13 | 5075 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
jenix21/DarunGrim | Src/Scripts/Server/HTMLPages.py | 1 | 21721 | MainMenu = """
<P>[
<a href="/ShowProjects">Projects</a> /
<a href="/ShowFileImport">Files Import</a> /
<a href="/ShowFileList">Files List</a> /
<a href="/ShowFileSearch">File Search</a> /
<a href="/ShowMSPatchList">Microsoft Patches List</a> /
<a href="/">About</a>
]
<P>
"""
BannerText = """
<PRE>... | bsd-3-clause |
resouer/kubernetes | cluster/juju/layers/kubernetes-worker/reactive/kubernetes_worker.py | 24 | 55854 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
chafique-delli/OpenUpgrade | addons/website/tests/test_views.py | 221 | 8517 | # -*- coding: utf-8 -*-
import itertools
import unittest2
from lxml import etree as ET, html
from lxml.html import builder as h
from openerp.tests import common
def attrs(**kwargs):
return dict(('data-oe-%s' % key, str(value)) for key, value in kwargs.iteritems())
class TestViewSaving(common.TransactionCase):
... | agpl-3.0 |
mvaled/OpenUpgrade | addons/event/__openerp__.py | 261 | 2296 | # -*- 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 |
gangadharkadam/office_erp | erpnext/hr/doctype/appraisal/appraisal.py | 35 | 2346 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, getdate
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.model.document ... | agpl-3.0 |
dparshin/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/stubout.py | 671 | 4940 | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | bsd-3-clause |
blazek/QGIS | python/plugins/processing/algs/qgis/KNearestConcaveHull.py | 4 | 21488 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
KNearestConcaveHull.py
----------------------
Date : November 2014
Copyright : (C) 2014 by Detlev Neumann
Dr. Neumann Consulting - Geospatial Ser... | gpl-2.0 |
gaddman/ansible | test/units/modules/network/f5/test_bigip_monitor_gateway_icmp.py | 21 | 4431 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
aisipos/django | django/utils/http.py | 47 | 12708 | from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
import unicodedata
from binascii import Error as BinasciiError
from email.utils import formatdate
from django.core.exceptions import TooManyFieldsSent
from django.utils import six
from django.utils.datastructure... | bsd-3-clause |
cjhak/b2share | invenio/legacy/bibclassify/templates.py | 14 | 18916 | # This file is part of Invenio.
# Copyright (C) 2010, 2011, 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 later version... | gpl-2.0 |
reingart/web2conf | models/db_activity.py | 1 | 10359 | # -*- coding: utf-8 -*-
######################################
### MANAGE ACTIVITIES ("TALK" PROPOSALS)
######################################
autotranslate = lambda x: T(x) if not x in ("", None) else x
db.define_table('activity',
db.Field('authors',label=T("Authors"),default=('%s %s' %(auth.user.first_name, au... | bsd-3-clause |
EmreAtes/spack | var/spack/repos/builtin/packages/r-lsei/package.py | 5 | 2004 | ##############################################################################
# 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 |
GauravBh1010tt/DeepLearn | _deeplearn_utils/dl_text/lex_sem_ft.py | 1 | 7746 | """
** deeplean-ai.com **
** dl-lab **
created by :: GauravBh1010tt
"""
import pandas as pd
import numpy as np
import re
#from tqdm import tqdm
from nltk.corpus import wordnet
from nltk import bigrams, trigrams
from collections import Counter, defaultdict
from gensim.models import Word2Vec
from scipy.spatial.distance... | mit |
philipn/sycamore | Sycamore/support/Captcha/Visual/Base.py | 2 | 2266 | """ Captcha.Visual.BAse
Base classes for visual CAPTCHAs. We use the Python Imaging Library
to manipulate these images.
"""
#
# PyCAPTCHA Package
# Copyright (C) 2004 Micah Dowty <micah@navi.cx>
#
from Sycamore.support import Captcha
from PIL import Image
__all__ = ['ImageCaptcha', 'Layer']
class ImageCaptcha(Capt... | gpl-2.0 |
m-kuhn/QGIS | python/plugins/processing/algs/grass7/ext/v_sample.py | 4 | 1496 | # -*- coding: utf-8 -*-
"""
***************************************************************************
v_sample.py
-----------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
************************************... | gpl-2.0 |
Volvagia356/Hotot | hotot/utils.py | 4 | 7507 | # -*- coding: UTF-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
import subprocess
import os
import sys
from webbrowser import _iscommand as is_command
import gtk
import mimetypes, mimetools
import urllib
import config
import locale
try: import i18n
except: from gettext import gettext as _
supported... | lgpl-3.0 |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/testing/gtest/scripts/upload_gtest.py | 1963 | 2851 | #!/usr/bin/env python
#
# Copyright 2009, 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... | apache-2.0 |
mazafrav/JdeRobot | src/drivers/MAVLinkServer/modules/lib/wxgrapheditor.py | 8 | 2841 | '''
Graphical editing of graph definition
'''
from wx_loader import wx
from graphdefinition import GraphDefinition
class GraphDialog(wx.Dialog):
def __init__(self, title, graphdef, callback):
wx.Dialog.__init__(self, None, -1, title, size=(900, 400))
self.callback = callback
self.graphdef ... | gpl-3.0 |
moiseslorap/RIT | Computer Science 1/Labs/lab3/arrows.py | 1 | 8837 | """
file: arrows.py
language: python3
author: mal3941@g.rit.edu Moisés Lora Pérez
class: CSCI 141-03
description: This program draws colored recursive triangles both iteratively and recursively. It receives some random
parameters such as the length, angle, and distance, but also has fixed value like the numbers o... | mit |
hryamzik/ansible | lib/ansible/modules/network/aci/aci_epg_to_domain.py | 1 | 12442 | #!/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 |
windelbouwman/ppci-mirror | tools/fuzzer.py | 1 | 1546 | #!/usr/bin/python
"""
Tool that randomly generates code and feeds it through the code generator.
"""
import random
import io
from ppci.api import ir_to_object
from ppci import ir
from ppci.irutils import Builder, Writer, Verifier
class Generator:
def __init__(self):
self.builder = Builder()
... | bsd-2-clause |
Valloric/ycmd | ycmd/tests/shutdown_test.py | 5 | 3784 | # Copyright (C) 2016 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd... | gpl-3.0 |
angr/angr | angr/knowledge_plugins/patches.py | 1 | 3920 | from typing import Optional, List, Dict
from cle.address_translator import AddressTranslator
from sortedcontainers import SortedDict
from .plugin import KnowledgeBasePlugin
# TODO: Serializable
class Patch:
def __init__(self, addr, new_bytes, comment: Optional[str]=None):
self.addr = addr
self.n... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.