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 |
|---|---|---|---|---|---|
vismartltd/edx-platform | common/test/acceptance/tests/test_cohorted_courseware.py | 123 | 9754 | """
End-to-end test for cohorted courseware. This uses both Studio and LMS.
"""
import json
from nose.plugins.attrib import attr
from studio.base_studio_test import ContainerBase
from ..pages.studio.settings_group_configurations import GroupConfigurationsPage
from ..pages.studio.auto_auth import AutoAuthPage as Stud... | agpl-3.0 |
commtrack/temp-aquatest | apps/buildmanager/api/resources.py | 1 | 5466 | import os
import bz2
import sys
import logging
import traceback
import cStringIO
import tempfile
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest
from django.core.servers.basehttp import FileWrapper
from django.core import serializers
from buildmanager.models ... | bsd-3-clause |
FCP-INDI/nipype | nipype/interfaces/spm/tests/test_auto_ApplyDeformations.py | 12 | 1224 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..preprocess import ApplyDeformations
def test_ApplyDeformations_inputs():
input_map = dict(deformation_field=dict(field='comp{1}.def',
mandatory=True,
),
ignore_exception=dict(nohash=True,
usedefault=T... | bsd-3-clause |
kopach/git-cola | cola/widgets/text.py | 2 | 28098 | """Text widgets"""
from __future__ import division, absolute_import, unicode_literals
import math
from qtpy import QtCore
from qtpy import QtGui
from qtpy import QtWidgets
from qtpy.QtCore import Qt
from qtpy.QtCore import Signal
from ..qtutils import get
from .. import hotkeys
from .. import qtutils
from ..i18n impo... | gpl-2.0 |
code-sauce/tensorflow | tensorflow/contrib/learn/python/learn/ops/embeddings_ops.py | 116 | 3510 | # 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 |
sumedhasingla/VTK | ThirdParty/Twisted/twisted/internet/task.py | 23 | 29498 | # -*- test-case-name: twisted.test.test_task,twisted.test.test_cooperator -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Scheduling utility methods and classes.
"""
from __future__ import division, absolute_import
__metaclass__ = type
import sys
import time
from zope.interface impo... | bsd-3-clause |
azaghal/ansible | test/lib/ansible_test/_internal/cloud/scaleway.py | 49 | 1991 | """Scaleway plugin for integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from . import (
CloudProvider,
CloudEnvironment,
CloudEnvironmentConfig,
)
from ..util import (
ConfigParser,
display,
)
class ScalewayCloudProvider(Clo... | gpl-3.0 |
jyotikamboj/container | django/contrib/redirects/middleware.py | 109 | 1861 | from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.contrib.redirects.models import Redirect
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ImproperlyConfigured
from django import http
class RedirectFallback... | mit |
python-bonobo/bonobo | bonobo/config/configurables.py | 2 | 7319 | from bonobo.errors import AbstractError
from bonobo.util import get_name, iscontextprocessor, isoption, sortedlist
__all__ = ["Configurable"]
get_creation_counter = lambda v: v._creation_counter
class ConfigurableMeta(type):
"""
Metaclass for Configurables that will add options to a special __options__ dict... | apache-2.0 |
rcordovano/autopsy | release_scripts/localization_scripts/test/test_csvutil.py | 3 | 1591 | import codecs
import os
import unittest
from typing import TypeVar, List
from csvutil import records_to_csv, csv_to_records
from test.unittestutil import get_output_path
class CsvUtilTest(unittest.TestCase):
T = TypeVar('T')
def assert_equal_arr(self, a: List[T], b: List[T]):
self.assertEqual(len(a)... | apache-2.0 |
vponomaryov/rally | rally/plugins/openstack/scenarios/ceilometer/samples.py | 1 | 1179 | # 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 agreed to in... | apache-2.0 |
Frodox/buildbot | master/buildbot/www/hooks/bitbucketserver.py | 2 | 6256 | # 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 |
ocefpaf/cartopy | lib/cartopy/io/img_tiles.py | 1 | 22922 | # (C) British Crown Copyright 2011 - 2019, Met Office
#
# This file is part of cartopy.
#
# cartopy 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 3 of the License, or
# (at your option)... | lgpl-3.0 |
dnlm92/chokoretto | temp/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/big5prober.py | 2931 | 1684 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | mit |
dparlevliet/zelenka-report-storage | server-db/twisted/test/plugin_basic.py | 62 | 1029 | # Copyright (c) 2005 Divmod, Inc.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# Don't change the docstring, it's part of the tests
"""
I'm a test drop-in. The plugin system's unit tests use me. No one
else should.
"""
from zope.interface import classProvides
from twisted.plugin import I... | lgpl-3.0 |
fbossy/SickRage | sickbeard/clients/transmission_client.py | 16 | 5249 | # Author: Mr_Orange <mr_orange@hotmail.it>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 |
titasakgm/brc-stock | openerp/addons/report_geraldo/lib/geraldo/site/newsite/django_1_0/tests/regressiontests/datatypes/models.py | 13 | 2338 | """
This is a basic model to test saving and loading boolean and date-related
types, which in the past were problematic for some database backends.
"""
from django.db import models
from django.conf import settings
class Donut(models.Model):
name = models.CharField(max_length=100)
is_frosted = models.BooleanFi... | agpl-3.0 |
meghana1995/sympy | sympy/strategies/rl.py | 20 | 4295 | """ Generic Rules for SymPy
This file assumes knowledge of Basic and little else.
"""
from __future__ import print_function, division
from sympy.utilities.iterables import sift
from .util import new
# Functions that create rules
def rm_id(isid, new=new):
""" Create a rule to remove identities
isid - fn :: ... | bsd-3-clause |
Chilledheart/chromium | chrome/common/extensions/docs/server2/api_models.py | 37 | 7028 | # 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 posixpath
from compiled_file_system import Cache, SingleFile, Unicode
from extensions_paths import API_PATHS
from features_bundle import HasParent, G... | bsd-3-clause |
Yannig/ansible-modules-core | cloud/amazon/rds_subnet_group.py | 17 | 5033 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
zstackio/zstack-woodpecker | integrationtest/vm/vpc/test_two_vpc_two_vm_connection.py | 2 | 2156 | '''
@author: FangSun
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.vm_operations as vm_ops
import zstackwoodpecker.oper... | apache-2.0 |
speedovation/CrashReporter-Qt-Breakpad | breakpad/src/tools/python/filter_syms.py | 76 | 8032 | #!/usr/bin/env python
# Copyright (c) 2012 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 lis... | apache-2.0 |
hobson/pug-dj | pug/dj/sqlserver.py | 1 | 7833 | from django.db import connections #, transaction
from collections import OrderedDict, namedtuple
from django.conf import settings
from django.db import DatabaseError
from traceback import print_exc
from ansi.constants import field_type_name
def dictfetchall(cursor):
"""Returns all rows from a cursor as a dict (r... | mit |
alexcuellar/odoo | addons/website/models/website.py | 25 | 35943 | # -*- coding: utf-8 -*-
import cStringIO
import contextlib
import datetime
import hashlib
import inspect
import logging
import math
import mimetypes
import unicodedata
import os
import re
import time
import urlparse
from PIL import Image
from sys import maxint
import werkzeug
# optional python-slugify import (https:/... | agpl-3.0 |
thiriel/maps | venv/lib/python2.7/site-packages/django/views/generic/create_update.py | 87 | 8928 | from django.forms.models import ModelFormMetaclass, ModelForm
from django.template import RequestContext, loader
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.core.xheaders import populate_xheaders
from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured
from django.... | bsd-3-clause |
almarklein/visvis.dev | examples/embeddingInQt4.py | 5 | 1816 | #!/usr/bin/env python
"""
This example illustrates embedding a visvis figure in a Qt application.
"""
from PyQt4 import QtGui, QtCore
import visvis as vv
# Create a visvis app instance, which wraps a qt4 application object.
# This needs to be done *before* instantiating the main window.
app = vv.use('qt4')
class M... | bsd-3-clause |
golivieri/ansible | lib/ansible/runner/action_plugins/async.py | 6 | 1940 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
rajathkumarmp/robocomp | tools/rcmaster/test/test.py | 1 | 6886 | import pexpect, sys
from os import environ , path
from time import sleep
from copy import deepcopy
import unittest
class Comp:
def __init__(self, name, cmd):
self.init_name = name
self.name = self.init_name
self.cmd = cmd
self.staus = 0
self.output = ''
self.extra_p... | gpl-3.0 |
cmcantalupo/geopm | integration/test/test_geopmagent.py | 1 | 6341 | #!/usr/bin/env python
#
# Copyright (c) 2015 - 2021, Intel Corporation
#
# 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, thi... | bsd-3-clause |
lzweopard/carve | external/gtest-1.5.0/test/gtest_color_test.py | 3259 | 4911 | #!/usr/bin/env python
#
# Copyright 2008, 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... | gpl-3.0 |
shaftoe/home-assistant | homeassistant/components/zwave/node_entity.py | 1 | 5871 | """Entity class that represents Z-Wave node."""
import logging
from homeassistant.core import callback
from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_WAKEUP
from homeassistant.helpers.entity import Entity
from homeassistant.util import slugify
from .const import ATTR_NODE_ID, DOMAIN, COMMAND_CLASS_WAKE_UP
f... | apache-2.0 |
jrleja/bsfh | misc/timings_pyfsps.py | 3 | 4274 | #compare a lookup table of spectra at ages and metallicities to
#calls to fsps.sps.get_spectrum() for different metallicities
import time, os, subprocess, re, sys
import numpy as np
#import matplotlib.pyplot as pl
import fsps
from prospect import sources as sps_basis
from prospect.models import sedmodel
def run_comma... | mit |
acarmel/CouchPotatoServer | couchpotato/core/media/_base/providers/torrent/kickasstorrents.py | 7 | 7085 | import re
import traceback
from bs4 import BeautifulSoup
from couchpotato.core.helpers.variable import tryInt, getIdentifier
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.torrent.base import TorrentMagnetProvider
log = CPLog(__name__)
class Base(TorrentMagnetProvider):
... | gpl-3.0 |
lindycoder/fake-switches | fake_switches/terminal/ssh.py | 4 | 2985 | # Copyright 2015 Internap.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | apache-2.0 |
saullocastro/compmech | theory/func/bardell/print_bardell_integrals_to_fortran.py | 2 | 2549 | import os
import glob
from ast import literal_eval
import numpy as np
import sympy
from sympy import pi, sin, cos, var
var('xi1, xi2')
var('x1t, x1r, x2t, x2r')
var('y1t, y1r, y2t, y2r')
subs = {
}
def List(*e):
return list(e)
printstr_12 = ''
printstr_full = ''
for i, filepath in enumerate(
glo... | bsd-3-clause |
ClinicalGraphics/scikit-image | doc/examples/xx_applications/plot_morphology.py | 6 | 8329 | """
=======================
Morphological Filtering
=======================
Morphological image processing is a collection of non-linear operations related
to the shape or morphology of features in an image, such as boundaries,
skeletons, etc. In any given technique, we probe an image with a small shape or
template ca... | bsd-3-clause |
yausern/stlab | devices/Keithley_6430.py | 1 | 1068 | import visa
import numpy as np
from stlab.devices.instrument import instrument
import time
class keithley6430(instrument):
def __init__(self,addr = "TCPIP::192.168.1.212::1470::SOCKET", reset = True, verb=True, read_termination='\r\n'):
#Needs \r\n line termination
super().__init__(addr,reset... | gpl-3.0 |
deedwar/pure | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
mjtamlyn/django | tests/raw_query/models.py | 19 | 1246 | from django.db import models
class Author(models.Model):
first_name = models.CharField(max_length=255)
last_name = models.CharField(max_length=255)
dob = models.DateField()
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Protect against annotations being passe... | bsd-3-clause |
codenote/chromium-test | ppapi/native_client/tests/breakpad_crash_test/crash_dump_tester.py | 6 | 8213 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
import tempfile
import time
script_dir = os.path.dirname(__file__)
sys.path.append(os.path.join... | bsd-3-clause |
jawilson/Flexget | flexget/tests/test_assume_quality.py | 9 | 4925 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import pytest
from jinja2 import Template
import flexget.utils.qualities as qualities
from flexget.task import TaskAbort
class TestAssumeQuality(object):
_config = "... | mit |
bkolli/swift | test/unit/container/test_sync.py | 5 | 45683 |
# 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 agre... | apache-2.0 |
freedomtan/tensorflow | tensorflow/python/keras/optimizer_v2/adam.py | 4 | 20375 | # Copyright 2020 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 |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/django-1.4/django/core/servers/basehttp.py | 76 | 8894 | """
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
import o... | mit |
tliron/ronin | examples/installing/build.py | 1 | 1465 | #!/usr/bin/env python
#
# Installing Example
#
# build.py
#
# Requirements:
#
# Ubuntu: sudo apt install gcc ccache
#
# To install your build, use the Copy executor and set "inputs_from=" to the generating phase,
# as well as "output_strip_prefix_from=" if you want to strip the original output path.
#
# Run with th... | apache-2.0 |
mandoku/mdweb | app/main/errors.py | 1 | 1045 | # -*- coding: utf-8 -*-
from flask import render_template, request, jsonify
from . import main
@main.app_errorhandler(403)
def forbidden(e):
if request.accept_mimetypes.accept_json and \
not request.accept_mimetypes.accept_html:
response = jsonify({'error': 'forbidden'})
response.st... | mit |
hainm/dask | dask/dataframe/shuffle.py | 4 | 2967 | from itertools import count
from collections import Iterator
from math import ceil
from toolz import merge, accumulate, merge_sorted
import toolz
from operator import getitem, setitem
import pandas as pd
import numpy as np
from pframe import pframe
from .. import threaded
from .core import DataFrame, Series, get, name... | bsd-3-clause |
auto-mat/klub | apps/aklub/autocom.py | 1 | 6964 | # -*- coding: utf-8 -*-
# Author: Hynek Hanke <hynek.hanke@auto-mat.cz>
#
# Copyright (C) 2010 o.s. Auto*Mat
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or... | gpl-3.0 |
duducosmos/pgs4a | python-install/lib/python2.7/test/test_platform.py | 17 | 9707 | import sys
import os
import unittest
import platform
import subprocess
from test import test_support
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
if hasattr(os, "symlink"):
def test_architecture_via_symlink(self): # issue3762
de... | lgpl-2.1 |
PaulPetring/zulip | zerver/management/commands/enqueue_file.py | 115 | 1715 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.lib.queue import queue_json_publish
import sys
import ujson
def error(*args):
raise Exception('We cannot enqueue because settings.USING_RABBITMQ is False.')
class Command(BaseCommand):
help = """Read JSON... | apache-2.0 |
opennode/waldur-mastermind | src/waldur_core/structure/tests/unittests/test_handlers.py | 1 | 5755 | from unittest import mock
from django.test import TestCase
from waldur_core.structure import models as structure_models
from waldur_core.structure.tests import factories, fixtures
class LogProjectSaveTest(TestCase):
@mock.patch('waldur_core.structure.handlers.event_logger')
def test_logger_called_once_on_pr... | mit |
bonus-tm/euforia | events/distribute.py | 1 | 2523 | # Распределение зерна на еду и на посев
import re
import data, ask, act
from event import Event
class Distribute(Event):
"""Распределение зерна"""
#
def start(self):
"""docstring for start"""
self.min_for_food = data.resources['peasant'] + data.resources['soldier'] + 1
self.min... | mit |
davidovich/pip | pip/commands/uninstall.py | 798 | 2884 | from __future__ import absolute_import
import pip
from pip.wheel import WheelCache
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
"""
Uninstall packages.
pip is a... | mit |
Yelp/dumb-init | tests/exit_status_test.py | 1 | 1237 | import signal
import sys
from subprocess import Popen
import pytest
@pytest.mark.parametrize('exit_status', [0, 1, 2, 32, 64, 127, 254, 255])
@pytest.mark.usefixtures('both_debug_modes', 'both_setsid_modes')
def test_exit_status_regular_exit(exit_status):
"""dumb-init should exit with the same exit status as the... | mit |
sdphome/UHF_Reader | rfs/rootfs/usr/lib/python2.7/_pyio.py | 28 | 69294 | """
Python implementation of the io module.
"""
from __future__ import (print_function, unicode_literals)
import os
import abc
import codecs
import warnings
import errno
# Import thread instead of threading to reduce startup cost
try:
from thread import allocate_lock as Lock
except ImportError:
from dummy_thr... | gpl-3.0 |
honnix/oh-my-zsh | plugins/git-prompt/gitstatus.py | 49 | 3299 | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import re
from subprocess import Popen, PIPE, check_output
def get_tagname_or_hash():
"""return tagname if exists else hash"""
# get hash
hash_cmd = ['git', 'rev-parse', '--short', 'HEAD']
hash_ = check_output(hash_cmd).... | mit |
MER-GROUP/intellij-community | python/lib/Lib/site-packages/django/core/files/locks.py | 420 | 1791 | """
Portable file locking utilities.
Based partially on example by Jonathan Feignberg <jdf@pobox.com> in the Python
Cookbook, licensed under the Python Software License.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
Example Usage::
>>> from django.core.files import locks
>>> f = open('./... | apache-2.0 |
Antiun/bank-statement-reconcile | account_advanced_reconcile/base_advanced_reconciliation.py | 12 | 12243 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Contributor: Leonardo Pistone
# Copyright 2012-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | agpl-3.0 |
mdaniel/intellij-community | python/helpers/py3only/docutils/languages/da.py | 50 | 1872 | # -*- coding: utf-8 -*-
# $Id: da.py 7678 2013-07-03 09:57:36Z milde $
# Author: E D
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each... | apache-2.0 |
a4fr/my_nerd_bot | GoogleAppEngine/lib/werkzeug/script.py | 318 | 11249 | # -*- coding: utf-8 -*-
r'''
werkzeug.script
~~~~~~~~~~~~~~~
.. admonition:: Deprecated Functionality
``werkzeug.script`` is deprecated without replacement functionality.
Python's command line support improved greatly with :mod:`argparse`
and a bunch of alternative modules.
Most ... | apache-2.0 |
nimasmi/wagtail | wagtail/admin/widgets.py | 3 | 11517 | import itertools
import json
from functools import total_ordering
from django import forms
from django.conf import settings
from django.forms import widgets
from django.forms.utils import flatatt
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.formats import get_fo... | bsd-3-clause |
reed-jpm-alpert/OpenMAMA.233 | site_scons/site_tools/scan-build.py | 13 | 1266 | """SCons.Tool.clang
Tool-specific initialization for clang.
"""
import re
import subprocess
import os
import SCons.Tool
import SCons.Util
sconsmod = __import__ ('SCons.Tool.g++', globals(), locals(), [])
sconstool = getattr (sconsmod, 'Tool')
gplusplus = getattr (sconstool, 'g++')
compilers = ['clang', 'clang++', ... | lgpl-2.1 |
challenge19/conpy | classify/classify_node.py | 1 | 2070 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import networkx as nx
import numpy as np
import random
import Lib_gen_Graph as lig
import Lib_cal_control as lcc
import classify_by_add_node as can
import classify_by_renorm.classify_by_renorm_undirected as cru
#import StructuralRenorm.package.Lib_struct_renorm as lsr
... | mit |
IronLanguages/ironpython2 | Tests/test_ipyc.py | 2 | 14655 | # 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.
##
## Testing IronPython Compiler
##
from iptest.assert_util import *
skiptest("win32")
from iptest.file_util... | apache-2.0 |
urandu/rethinkdb | external/v8_3.30.33.16/buildtools/checkdeps/cpp_checker.py | 50 | 3436 | # 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.
"""Checks C++ and Objective-C files for illegal includes."""
import codecs
import os
import re
import results
from rules import Rule, MessageRule
cla... | agpl-3.0 |
lamby/pkg-fabric | fabric/tasks.py | 9 | 15409 | from __future__ import with_statement
from functools import wraps
import inspect
import sys
import textwrap
from fabric import state
from fabric.utils import abort, warn, error
from fabric.network import to_dict, normalize_to_string, disconnect_all
from fabric.context_managers import settings
from fabric.job_queue im... | bsd-2-clause |
b-jesch/plugin.program.tvhighlights | starter.py | 2 | 5768 | #!/usr/bin/python
###########################################################################
#
# FILE: plugin.program.tvhighlights/starter.py
#
# AUTHOR: Tobias D. Oestreicher
#
# LICENSE: GPLv3 <http://www.gnu.org/licenses/gpl.txt>
# VERSION: 0.1.5
# CREATED: 05.02.2016
#
######... | gpl-3.0 |
jtl999/certbot | certbot-nginx/certbot_nginx/tls_sni_01.py | 2 | 5689 | """A class that performs TLS-SNI-01 challenges for Nginx"""
import itertools
import logging
import os
from certbot import errors
from certbot.plugins import common
from certbot_nginx import obj
from certbot_nginx import nginxparser
logger = logging.getLogger(__name__)
class NginxTlsSni01(common.TLSSNI01):
""... | apache-2.0 |
allanino/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py | 69 | 24593 | # Todd Miller jmiller@stsci.edu
from __future__ import division
import os, sys, math
import Tkinter as Tk, FileDialog
import tkagg # Paint image to Tk photo blitter extension
from backend_agg import FigureCanvasAgg
import os.path
import matplotlib
from matplotlib.cbook import is_string_like
from ... | agpl-3.0 |
weisongchen/flaskapp | venv/lib/python2.7/site-packages/sqlalchemy/orm/events.py | 5 | 84909 | # orm/events.py
# Copyright (C) 2005-2017 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
"""ORM event interfaces.
"""
from .. import event, exc, util
from .base import _mappe... | mit |
lshain-android-source/external-chromium_org | chrome/test/functional/webrtc_call.py | 29 | 8808 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
# This little construct ensures we can run even if we have a bad version of
# psutil installed. If so, we'll just skip... | bsd-3-clause |
drexly/openhgsenti | lib/django/forms/fields.py | 42 | 47141 | """
Field classes.
"""
from __future__ import unicode_literals
import copy
import datetime
import os
import re
import sys
import uuid
import warnings
from decimal import Decimal, DecimalException
from io import BytesIO
from django.core import validators
from django.core.exceptions import ValidationError
# Provide th... | apache-2.0 |
algorhythms/LeetCode | 527 Word Abbreviation.py | 1 | 1679 | #!/usr/bin/python3
"""
premium question
"""
from typing import List
from collections import defaultdict
class Solution:
def wordsAbbreviation(self, words: List[str]) -> List[str]:
"""
Sort the word, check prefix and last word
Group by first and last char, group by prefix and last char
... | mit |
katrielalex/rate-equations-odeint | redirect_std.py | 1 | 1258 | # http://stackoverflow.com/a/22434262/398968
import os
import sys
import contextlib
def fileno(file_or_fd):
fd = getattr(file_or_fd, 'fileno', lambda: file_or_fd)()
if not isinstance(fd, int):
raise ValueError("Expected a file (`.fileno()`) or a file descriptor")
return fd
@contextlib.contextmana... | gpl-3.0 |
bincentvaret/bsd-cloudinit | cloudbaseinit/tests/plugins/common/userdataplugins/test_heat.py | 4 | 2897 | # Copyright 2013 Cloudbase Solutions Srl
#
# 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 l... | apache-2.0 |
ksetyadi/Sahana-Eden | models/06_supply.py | 1 | 5661 | # -*- coding: utf-8 -*-
"""
Supply
@author: Michael Howden (michael@sahanafoundation.org)
@date-created: 2010-08-16
Generic Supply functionality such as catalogs and items that will be used across multiple modules
"""
module = "supply"
if deployment_settings.has_module("logs"):
#================... | mit |
osamak/student-portal | activities/migrations/0023_invitation.py | 2 | 2488 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('activities', '0022_depository'),
]
... | agpl-3.0 |
falcondai/svcrawl | models.py | 1 | 2640 | # description: download Google StreetViews images and save them
# the Google StreeView API is documented here:
# https://developers.google.com/maps/documentation/streetview/
# author: Falcon Dai
import cStringIO
import mongoengine as me
from PIL import Image
from google_streetview_api import *
class Pano(me.Document... | mit |
muntasirsyed/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/plugins/do_symfix.py | 102 | 1894 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Command line debugger using WinAppDbg
# Fix the symbol store path
# Copyright (c) 2009-2014, Mario Vilas
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the followin... | apache-2.0 |
diego-d5000/MisValesMd | env/lib/site-packages/pip/_vendor/colorama/win32.py | 446 | 5121 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
import ctypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
from ctypes import wintypes
except (AttributeError, ImportError):
windll = None
SetCon... | mit |
epage/telepathy-python | src/client/__init__.py | 2 | 1217 | # telepathy-python - Base classes defining the interfaces of the Telepathy framework
#
# Copyright (C) 2005, 2006 Collabora Limited
# Copyright (C) 2005, 2006 Nokia Corporation
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as pub... | lgpl-2.1 |
jdduke/googletest | test/gtest_color_test.py | 3259 | 4911 | #!/usr/bin/env python
#
# Copyright 2008, 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... | bsd-3-clause |
mike10004/adventofcode2016 | advent14_otp.py | 1 | 6772 | #!/usr/bin/env python
import sys
import re
import hashlib
import logging
from collections import defaultdict
_log = logging.getLogger('a14otp')
_PATT3 = re.compile(r'(?:(\w)\1\1)')
_PATT5 = re.compile(r'(?:(\w)\1\1\1\1)')
_MAX_CURSOR = 10000000 # 10 million
def clean(items, predicate):
assert isinstance(items,... | mit |
sdanielf/dictate | setup.py | 1 | 5131 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 S. Daniel Francis <francis@sugarlabs.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 License, ... | gpl-3.0 |
mhoffman/kmos | kmos/cli.py | 1 | 16514 | #!/usr/bin/env python
"""Entry point module for the command-line
interface. The kmos executable should be
on the program path, import this modules
main function and run it.
To call kmos command as you would from the shell,
use ::
kmos.cli.main('...')
Every command can be shortened as long as... | gpl-3.0 |
cccfran/sympy | sympy/concrete/tests/test_sums_products.py | 4 | 30439 | from sympy import (
Abs, And, binomial, Catalan, cos, Derivative, E, Eq, exp, EulerGamma,
factorial, Function, harmonic, I, Integral, KroneckerDelta, log,
nan, Ne, Or, oo, pi, Piecewise, Product, product, Rational, S, simplify,
sqrt, Sum, summation, Symbol, symbols, sympify, zeta, gamma, Le
)
from sympy... | bsd-3-clause |
40223110/2015CDAFinal_test2 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/sprite.py | 603 | 55779 | ## pygame - Python Game Library
## Copyright (C) 2000-2003, 2007 Pete Shinners
## (C) 2004 Joe Wreschnig
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; e... | gpl-3.0 |
gperciva/artifastring | interactive/tuning_pitch.py | 1 | 1587 | #!/usr/bin/env python
##
# Copyright 2010--2013 Graham Percival
# This file is part of Artifastring.
#
# Artifastring 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... | gpl-3.0 |
bcl/pykickstart | pykickstart/handlers/f22.py | 3 | 5158 | #
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2014 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 |
aelarabawy/hostap | tests/hwsim/test_peerkey.py | 2 | 2575 | # PeerKey tests
# Copyright (c) 2013, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import time
import hwsim_utils
import hostapd
from wlantest import Wlantest
def test_peerkey(dev, apdev):
... | gpl-2.0 |
ondrejch/FSM | scripts/mk1/surfaces.py | 1 | 2678 | #!/usr/bin/env python3
#
# Generate surfaces, pins, and lattice for FastDrum Serpent deck
# Ondrej Chvala, ochvala@utk.edu
# 2016-08-02
import math
def write_surfaces(N, r, refl):
'''Function to write material cards for Serpent input deck.
Inputs:
N: size of the N x N checkerboard lattice
... | gpl-3.0 |
halberom/ansible | lib/ansible/modules/storage/netapp/na_cdot_user_role.py | 18 | 7307 | #!/usr/bin/python
# (c) 2017, NetApp, Inc
#
# 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 |
miminus/youtube-dl | youtube_dl/extractor/francetv.py | 44 | 12637 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
clean_html,
ExtractorError,
int_or_none,
parse_duration,
determine_ext,
)
from .dailymotion import DailymotionCloudIE
clas... | unlicense |
zhanghenry/stocks | tests/test_client_regress/views.py | 13 | 5231 | import json
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.serializers.json import DjangoJSONEncoder
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from dj... | bsd-3-clause |
JRepoInd/plugin.video.tvondesizonexl | xoze/utils/system.py | 3 | 1966 | '''
Created on Oct 11, 2013
@author: 'ajdeveloped'
This file is part of XOZE.
XOZE 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.
XOZE ... | gpl-3.0 |
pegasus-isi/pegasus | packages/pegasus-python/src/Pegasus/service/monitoring/errors.py | 1 | 1894 | import logging
from flask import make_response
from sqlalchemy.orm.exc import NoResultFound
from Pegasus.service._query import InvalidQueryError
from Pegasus.service._serialize import jsonify
from Pegasus.service._sort import InvalidSortError
from Pegasus.service.base import ErrorResponse, InvalidJSONError
from Pegas... | apache-2.0 |
NEricN/RobotCSimulator | Python/App/Lib/bsddb/dbtables.py | 98 | 30866 | #-----------------------------------------------------------------------
#
# Copyright (C) 2000, 2001 by Autonomous Zone Industries
# Copyright (C) 2002 Gregory P. Smith
#
# License: This is free software. You may use this software for any
# purpose including modification/redistribution, so long as
... | apache-2.0 |
samuelbustamante/dirinfo | tickets/models.py | 1 | 2476 | # coding=utf-8
from django.db import models
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
STATUS_OPEN = 0
STATUS_ON_HOLD = 1
STATUS_BELATED = 2
STATUS_RESOLVED = 3
STATUS_CLOSED = 4
PRIORITY_LOW = 0
PRIORITY_NORMAL = 1
PRIORITY_HIGHT = 2
PERMISSION_CAN_ASSIGNED = "can_assign... | apache-2.0 |
Salat-Cx65/python-for-android | python-build/python-libs/gdata/build/lib/gdata/sample_util.py | 133 | 7858 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 ... | apache-2.0 |
nhmc/LAE | python_modules/cloudy/utils.py | 1 | 11349 | from barak.utilities import between
from barak.io import parse_config, readtxt
from scipy.integrate import simps
import numpy as np
from barak.constants import Ryd_Ang, pi, hplanck
import os
def get_data_path():
""" Return the path to the data directory for this package.
"""
return os.path.abspath(__file_... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.