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 |
|---|---|---|---|---|---|
gVallverdu/pymatgen | pymatgen/core/libxcfunc.py | 4 | 13158 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Enumerator with the libxc identifiers.
This is a low level object, client code should not interact with LibxcFunc directly
but use the API provided by the Xcfunc object defined in core.xcfunc.py.
Part of thi... | mit |
pigeonflight/strider-plone | docker/appengine/lib/django-1.2/django/core/mail/backends/base.py | 660 | 1164 | """Base email backend class."""
class BaseEmailBackend(object):
"""
Base class for email backend implementations.
Subclasses must at least overwrite send_messages().
"""
def __init__(self, fail_silently=False, **kwargs):
self.fail_silently = fail_silently
def open(self):
"""Op... | mit |
Sajid3/orp | third-party/qemu-orp/scripts/tracetool/transform.py | 78 | 4238 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Type-transformation rules.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnocz... | apache-2.0 |
sankalpg/Essentia_tonicDebug_TEMP | src/python/essentia/plotting.py | 6 | 4133 | # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), either version 3 of the ... | agpl-3.0 |
MarcosCommunity/odoo | addons/l10n_pa/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
tfrdidi/PhiDi | libs/flask/helpers.py | 776 | 33793 | # -*- coding: utf-8 -*-
"""
flask.helpers
~~~~~~~~~~~~~
Implements various helpers.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import pkgutil
import posixpath
import mimetypes
from time import time
from zlib import adler32
from th... | apache-2.0 |
swarna-k/MyDiary | flask/lib/python2.7/site-packages/pbr/hooks/commands.py | 10 | 2346 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# Unles... | bsd-3-clause |
Princeton-Quadcopter/PQ-Software | Ardupilot/mk/PX4/Tools/gencpp/src/gencpp/__init__.py | 214 | 9473 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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 ... | gpl-3.0 |
whiteinge/ob-randr | ob-randr.py | 2 | 8035 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""A small utility to make xrandr adjustments from an OpenBox menu.
To install, put this file somewhere and make sure it is executable.
Edit your $HOME/.config/openbox/menu.xml file. Add something like the following
near the top::
<menu id="randr-menu" label="randr"... | bsd-3-clause |
shahar-stratoscale/nova | nova/cells/driver.py | 126 | 1393 | # Copyright (c) 2012 Rackspace Hosting
# 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 req... | apache-2.0 |
jomyhuang/sdwle | SDWLE/ui/game_console.py | 1 | 9331 | from SDWLE.constants import CHARACTER_CLASS
card_abbreviations = {
'Mark of the Wild': 'Mrk Wild',
'Power of the Wild': 'Pow Wild',
'Wild Growth': 'Wld Grth',
'Healing Touch': 'Hlng Tch',
'Mark of Nature': 'Mrk Ntr',
'Savage Roar': 'Svg Roar',
'Soul of the Forest': 'Sol Frst',
'Force of... | mit |
bykoianko/omim | search/pysearch/run_search_server.py | 11 | 2565 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from __future__ import print_function
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import argparse
import json
import os
import pysearch
import urlparse
DIR = os.path.dirname(__file__)
RESOURCE_PATH = os.path.realpath(os.path.join(DIR, '..', '..', 'data... | apache-2.0 |
piquadrat/django | django/db/backends/sqlite3/introspection.py | 7 | 11272 | import re
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.db.models.indexes import Index
field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$')
def get_field_size(name):
""" Extract the size number from a "varchar(11)" type na... | bsd-3-clause |
alma-siwon/Solid_Kernel-GPROJ | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
balloob/home-assistant | homeassistant/components/travisci/sensor.py | 13 | 5424 | """This component provides HA sensor support for Travis CI framework."""
from datetime import timedelta
import logging
from travispy import TravisPy
from travispy.errors import TravisError
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_A... | apache-2.0 |
kawamon/hue | desktop/core/ext-py/celery-4.2.1/celery/bootsteps.py | 2 | 12545 | # -*- coding: utf-8 -*-
"""A directed acyclic graph of reusable components."""
from __future__ import absolute_import, unicode_literals
from collections import deque
from threading import Event
from kombu.common import ignore_errors
from kombu.utils.encoding import bytes_to_str
from kombu.utils.imports import symbol_... | apache-2.0 |
davgibbs/django | django/contrib/gis/db/backends/postgis/introspection.py | 330 | 5441 | from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.postgresql.introspection import DatabaseIntrospection
class GeoIntrospectionError(Exception):
pass
class PostGISIntrospection(DatabaseIntrospection):
# Reverse dictionary for PostGIS geometry types not populated until
# introspectio... | bsd-3-clause |
urwid/urwid | examples/dialog.py | 3 | 10254 | #!/usr/bin/env python
#
# Urwid example similar to dialog(1) program
# Copyright (C) 2004-2009 Ian Ward
#
# 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 ... | lgpl-2.1 |
pdellaert/ansible | test/units/modules/network/fortios/test_fortios_user_peer.py | 21 | 11827 | # 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 License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
jackkiej/SickRage | lib/chardet/eucjpprober.py | 53 | 3666 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
blissland/devflixx | lib/subliminal/subliminal/providers/opensubtitles.py | 1 | 8161 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import base64
import logging
import os
import re
import zlib
import babelfish
import guessit
from . import Provider
from .. import __version__
from ..compat import ServerProxy, TimeoutTransport
from ..exceptions import ProviderError, AuthenticationError, D... | gpl-2.0 |
johankaito/fufuka | microblog/old-flask/lib/python2.7/site-packages/whoosh/lang/snowball/french.py | 96 | 14461 | from .bases import _StandardStemmer
from whoosh.compat import u
class FrenchStemmer(_StandardStemmer):
"""
The French Snowball stemmer.
:cvar __vowels: The French vowels.
:type __vowels: unicode
:cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
:type __step1_suffixe... | apache-2.0 |
nhicher/ansible | lib/ansible/modules/cloud/cloudstack/cs_instance.py | 14 | 38918 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
benjaminrigaud/django | tests/signing/tests.py | 36 | 4807 | from __future__ import unicode_literals
import time
from django.core import signing
from django.test import TestCase
from django.utils.encoding import force_str
from django.utils import six
class TestSigner(TestCase):
def test_signature(self):
"signature() method should generate a signature"
si... | bsd-3-clause |
jiumx60rus/grishyGhost | node_modules/nodegit/node_modules/pangyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
dpiers/coderang-meteor | public/jsrepl/extern/python/closured/lib/python2.7/base64.py | 229 | 11357 | #! /usr/bin/env python
"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
import re
import struct
import binascii
__all__ = [
# Legacy interface exports traditional RFC 1521 Base6... | mit |
ryanahall/django | tests/schema/fields.py | 13 | 2628 | from django.db.models.fields.related import (
RECURSIVE_RELATIONSHIP_CONSTANT, ManyRelatedObjectsDescriptor,
ManyToManyField, ManyToManyRel, RelatedField,
create_many_to_many_intermediary_model,
)
from django.utils.functional import curry
class CustomManyToManyField(RelatedField):
"""
Ticket #2410... | bsd-3-clause |
grap/OCB | addons/web/controllers/main.py | 2 | 70114 | # -*- coding: utf-8 -*-
import ast
import base64
import csv
import glob
import itertools
import logging
import operator
import datetime
import hashlib
import os
import re
import simplejson
import time
import urllib
import urllib2
import urlparse
import xmlrpclib
import zlib
from xml.etree import ElementTree
from cStri... | agpl-3.0 |
MarineLasbleis/GrowYourIC | notebooks/Yoshida.py | 1 | 4212 | # -*- coding: UTF-8 -*-
import numpy as np
import matplotlib.pyplot as plt #for figures
#from mpl_toolkits.basemap import Basemap #to render maps
import math
from GrowYourIC import tracers, positions, geodyn, geodyn_trg, geodyn_static, plot_data, data, geodyn_analytical_flows
#plt.rcParams['figure.figsize'] = (8.0,... | mit |
UCRoboticsLab/BaxterTictactoe | src/baxter_tictactoe/scripts/camera_gui.py | 1 | 15093 | #!/usr/bin/env python
"""
A GUI to help user take snapshot with hand camera
"""
import rospy
import struct
import Tkinter as tk
import tkFileDialog, tkMessageBox
import tkSimpleDialog
from baxter_interface.camera import CameraController
from PIL import Image
from PIL import ImageTk, ImageDraw
import numpy as np
f... | apache-2.0 |
cogeorg/BlackRhino | examples/firesales_simple/networkx/algorithms/tests/test_cluster.py | 89 | 7321 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestTriangles:
def test_empty(self):
G = nx.Graph()
assert_equal(list(nx.triangles(G).values()),[])
def test_path(self):
G = nx.path_graph(10)
assert_equal(list(nx.triangles(G).values()),
... | gpl-3.0 |
pp-mo/iris | lib/iris/tests/integration/test_cube.py | 5 | 2218 | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Integration tests for :class:`iris.cube.Cube`."""
# Import iris.tests first so that some things can be initialised before
#... | lgpl-3.0 |
zerc/django | django/contrib/gis/geoip2/base.py | 335 | 9054 | import os
import socket
import geoip2.database
from django.conf import settings
from django.core.validators import ipv4_re
from django.utils import six
from django.utils.ipv6 import is_valid_ipv6_address
from .resources import City, Country
# Creating the settings dictionary with any settings, if needed.
GEOIP_SETT... | bsd-3-clause |
Julian/home-assistant | tests/util/test_yaml.py | 5 | 8377 | """Test Home Assistant yaml loader."""
import io
import unittest
import os
import tempfile
from homeassistant.util import yaml
import homeassistant.config as config_util
from tests.common import get_test_config_dir
class TestYaml(unittest.TestCase):
"""Test util.yaml loader."""
def test_simple_list(self):
... | mit |
xinfang/face-recognize | tests/openface_neural_net_training_tests.py | 5 | 3071 | # OpenFace training tests.
#
# Copyright 2015-2016 Carnegie Mellon University
#
# 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 req... | apache-2.0 |
youprofit/shogun | examples/undocumented/python_modular/structure_multiclass_bmrm.py | 15 | 2927 | #!/usr/bin/env python
import numpy as np
def gen_data(num_classes,num_samples,dim):
np.random.seed(0)
covs = np.array([[[0., -1. ], [2.5, .7]],
[[3., -1.5], [1.2, .3]],
[[ 2, 0 ], [ .0, 1.5 ]]])
X = np.r_[np.dot(np.random.randn(num_samples, dim), covs[0]) + np.array([0, 10]),
np.dot(np.random.randn... | gpl-3.0 |
iniqua/plecost | plecost_lib/libs/plugins_utils.py | 1 | 9305 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Plecost: Wordpress vulnerabilities finder
#
# @url: http://iniqua.com/labs/
# @url: https://github.com/iniqua/plecost
#
# @author:Francisco J. Gomez aka ffranz (http://iniqua.com/)
# @author:Daniel Garcia aka cr0hn (http://www.cr0hn.com/me/)
#
# Copyright (c) 2015, Iniqua T... | bsd-3-clause |
djaodjin/drop | src/dlogwatch.py | 1 | 6707 | #!/usr/bin/env python
#
# Copyright (c) 2020, DjaoDjin 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this ... | bsd-2-clause |
litecoin2/litecoin2 | contrib/testgen/gen_base58_test_vectors.py | 1064 | 4344 | #!/usr/bin/env python
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json
gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json
'''
# 2012 Wladimir J. van der Laan
# R... | mit |
BT-astauder/odoo | openerp/addons/base/res/res_lang.py | 4 | 11722 | # -*- coding: 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 the GNU... | agpl-3.0 |
Danisan/odoo-1 | addons/payment_ogone/controllers/main.py | 389 | 1179 | # -*- coding: utf-8 -*-
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class OgoneController(http.Controller):
_accept_url = '/payment/ogone/test/accept'
_decline_url = '/payment/ogone/test/decline'
... | agpl-3.0 |
rubyinhell/brython | www/src/Lib/test/test_memoryview.py | 30 | 15575 | """Unit tests for the memoryview
Some tests are in test_bytes. Many tests that require _testbuffer.ndarray
are in test_buffer.
"""
import unittest
import test.support
import sys
import gc
import weakref
import array
import io
class AbstractMemoryTests:
source_bytes = b"abcdef"
@property
def _sour... | bsd-3-clause |
pawelmhm/AutobahnPython | examples/twisted/websocket/streaming/frame_based_server.py | 18 | 2612 | ###############################################################################
##
## Copyright (C) 2011-2013 Tavendo GmbH
##
## 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
##
#... | apache-2.0 |
andreMonkey/camera_processing | filming_test.py | 1 | 1179 | #!/usr/bin/python
from __future__ import absolute_import, division, print_function, unicode_literals
import picamera
import time
import pi3d
W, H = 800, 600
with picamera.PiCamera() as camera:
camera.resolution = (W, H)
camera.framerate = 24
camera.start_preview()
#NB layer argument below, fps as sl... | bsd-2-clause |
hogarthj/ansible | lib/ansible/modules/network/nxos/nxos_vrrp.py | 16 | 13019 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
chouseknecht/openshift-restclient-python | openshift/test/test_v1_project_spec.py | 1 | 4225 | # coding: utf-8
"""
OpenShift API (with Kubernetes)
OpenShift provides builds, application lifecycle, image content management, and administrative policy on top of Kubernetes. The API allows consistent management of those objects. All API operations are authenticated via an Authorization bearer token that is... | apache-2.0 |
YeelerG/twilio-python | twilio/rest/resources/phone_numbers.py | 11 | 11396 | import re
from twilio.exceptions import TwilioException
from .util import change_dict_key, transform_params
from .util import UNSET_TIMEOUT
from . import InstanceResource, ListResource
TYPES = {"local": "Local", "tollfree": "TollFree", "mobile": "Mobile"}
class AvailablePhoneNumber(InstanceResource):
""" An av... | mit |
deapubhi/myblog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/default.py | 364 | 2532 | # -*- coding: utf-8 -*-
"""
pygments.styles.default
~~~~~~~~~~~~~~~~~~~~~~~
The default highlighting style.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Com... | mit |
Hackplayers/Empire-mod-Hackplayers | lib/modules/python/management/osx/shellcodeinject64.py | 12 | 6833 | from lib.common import helpers
import os
import base64
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Shellcode Inject x64',... | bsd-3-clause |
sdpp/python-keystoneclient | keystoneclient/auth/identity/access.py | 6 | 1916 | # 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, software
# distributed under t... | apache-2.0 |
alfa-addon/addon | plugin.video.alfa/lib/requests_toolbelt/__init__.py | 12 | 1181 | # -*- coding: utf-8 -*-
"""
requests-toolbelt
=================
See http://toolbelt.rtfd.org/ for documentation
:copyright: (c) 2014 by Ian Cordasco and Cory Benfield
:license: Apache v2.0, see LICENSE for more details
"""
from .adapters import SSLAdapter, SourceAddressAdapter
from .auth.guess import GuessAuth
from ... | gpl-3.0 |
paolodedios/tensorflow | tensorflow/compiler/tests/self_adjoint_eig_op_test.py | 18 | 2194 | # Copyright 2019 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 |
steveklabnik/servo | tests/wpt/web-platform-tests/mixed-content/generic/tools/generate.py | 96 | 6567 | #!/usr/bin/env python
import os, sys, json
from common_paths import *
import spec_validator
import argparse
def expand_pattern(expansion_pattern, test_expansion_schema):
expansion = {}
for artifact_key in expansion_pattern:
artifact_value = expansion_pattern[artifact_key]
if artifact_value ==... | mpl-2.0 |
Jorge-Rodriguez/ansible | lib/ansible/modules/windows/win_ping.py | 146 | 1451 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_ME... | gpl-3.0 |
debugger22/sympy | sympy/physics/quantum/tests/test_operator.py | 97 | 6870 | from sympy import (Derivative, diff, Function, Integer, Mul, pi, sin, Symbol,
symbols)
from sympy.physics.quantum.qexpr import QExpr
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.hilbert import HilbertSpace
from sympy.physics.quantum.operator import (Operator, UnitaryOper... | bsd-3-clause |
lukw00/powerline | powerline/bindings/vim/__init__.py | 18 | 11437 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
import codecs
try:
import vim
except ImportError:
vim = object()
from powerline.lib.unicode import unicode
if (
hasattr(vim, 'options')
and hasattr(vim, 'vvars')
and vim.vvars['version... | mit |
mythmon/airmozilla | airmozilla/manage/tests/views/test_tags.py | 1 | 3865 | import json
from nose.tools import eq_, ok_
from funfactory.urlresolvers import reverse
from airmozilla.main.models import Tag, Event
from .base import ManageTestCase
class TestTags(ManageTestCase):
def test_tags(self):
"""Tag management pages return successfully."""
response = self.client.get(... | bsd-3-clause |
slackhq/python-slackclient | integration_tests/samples/basic_usage/views_2.py | 1 | 3819 | import json
import logging
logging.basicConfig(level=logging.DEBUG)
# ---------------------
# Slack WebClient
# ---------------------
import os
from slack_sdk.web import WebClient
from slack_sdk.errors import SlackApiError
from slack_sdk.signature import SignatureVerifier
from slack_sdk.models.blocks import InputBl... | mit |
pgmillon/ansible | test/utils/shippable/tools/run.py | 29 | 3634 | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
# (c) 2016 Red Hat, 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 yo... | gpl-3.0 |
bobthekingofegypt/servo | tests/wpt/web-platform-tests/tools/py/doc/conf.py | 218 | 8482 | # -*- coding: utf-8 -*-
#
# py documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 21 08:30:10 2010.
#
# 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.
#
# All conf... | mpl-2.0 |
WalrusCow/euler | Solutions/problem61.py | 1 | 2077 | from collections import defaultdict
def triangle(n):
return int((n * (n + 1)) / 2)
def square(n):
return n * n
def pentagon(n):
return int((n * (3 * n - 1)) / 2)
def hexagon(n):
return n * (2 * n - 1)
def heptagon(n):
return int((n * (5 * n - 3)) / 2)
def octagon(n):
return n * (3 * ... | mit |
timlinux/geonode | geonode/social/templatetags/social_tags.py | 5 | 2852 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
ram8647/gcb-mobilecsp | modules/questionnaire/questionnaire_tests.py | 4 | 9221 | # Copyright 2014 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 ... | apache-2.0 |
asanfilippo7/osf.io | website/notifications/emails.py | 15 | 6935 | from babel import dates, core, Locale
from website import mails
from website import models as website_models
from website.notifications import constants
from website.notifications import utils
from website.notifications.model import NotificationDigest
from website.notifications.model import NotificationSubscription
fr... | apache-2.0 |
XianliangJ/collections | Jellyfish/pox/pox/lib/threadpool.py | 6 | 2913 | # Copyright 2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | gpl-3.0 |
kaichogami/sympy | sympy/tensor/indexed.py | 12 | 17230 | """Module that defines indexed objects
The classes IndexedBase, Indexed and Idx would represent a matrix element
M[i, j] as in the following graph::
1) The Indexed class represents the entire indexed object.
|
___|___
' '
M[i, j]
... | bsd-3-clause |
Vilsepi/infinimonkey | backend/ratings-api.py | 1 | 1556 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import json
import boto3
table = boto3.resource("dynamodb").Table(os.environ.get("RAMBLINGS_TABLE_NAME"))
# def update_item_rating(vote):
# table.update_item(
# Key={
# 'username': 'janedoe',
# 'last_name': 'Doe'
# },
# UpdateE... | mit |
demarle/VTK | ThirdParty/Twisted/twisted/web/test/test_resource.py | 43 | 8158 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.resource}.
"""
from twisted.trial.unittest import TestCase
from twisted.web.error import UnsupportedMethod
from twisted.web.resource import (
NOT_FOUND, FORBIDDEN, Resource, ErrorPage, NoResource, ForbiddenResourc... | bsd-3-clause |
hcsturix74/django | django/forms/formsets.py | 362 | 17988 | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import BooleanField, IntegerField
from django.forms.utils import ErrorList
from django.forms.widgets import HiddenInput
from django.utils import six
from django.utils.encodi... | bsd-3-clause |
hsuantien/scikit-learn | sklearn/mixture/tests/test_gmm.py | 200 | 17427 | import unittest
import copy
import sys
from nose.tools import assert_true
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_raises)
from scipy import stats
from sklearn import mixture
from sklearn.datasets.samples_generator import make_spd_ma... | bsd-3-clause |
eva-oss/linux | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
ioram7/keystone-federado-pgid2013 | build/sqlalchemy/build/lib.linux-x86_64-2.7/sqlalchemy/databases/__init__.py | 35 | 1160 | # databases/__init__.py
# Copyright (C) 2005-2012 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
"""Include imports from the sqlalchemy.dialects package for backwards
compatibil... | apache-2.0 |
PatrickOReilly/scikit-learn | sklearn/gaussian_process/gpr.py | 7 | 18711 | """Gaussian processes regression. """
# Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve, solve_triangular
from scipy.optimize import fmin_l_bfgs_b
from sklearn.base im... | bsd-3-clause |
dadiletta/Saber | venv/lib/python3.4/site-packages/pip/util.py | 343 | 24172 | import sys
import shutil
import os
import stat
import re
import posixpath
import zipfile
import tarfile
import subprocess
import textwrap
from pip.exceptions import InstallationError, BadCommand, PipError
from pip.backwardcompat import(WindowsError, string_types, raw_input,
console_to_s... | mit |
gnuhub/intellij-community | python/lib/Lib/site-packages/django/contrib/markup/tests.py | 245 | 3155 | # Quick tests for the markup templatetags (django.contrib.markup)
import re
from django.template import Template, Context, add_to_builtins
from django.utils import unittest
from django.utils.html import escape
add_to_builtins('django.contrib.markup.templatetags.markup')
try:
import textile
except ImportError:
... | apache-2.0 |
fredericlepied/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork_facts.py | 8 | 5361 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANS... | gpl-3.0 |
gfvandehei/roomlight-6 | light_GUI.py | 1 | 3827 | import pyaudio
import numpy as np
import threading
import serial
from tkinter import *
import serial
class GUI(Frame):
def audio_thread(self):
'''
This function is in charge of collecting data from microphone
and changing it into usable data. Is meant to be ran as a thread
so it do... | mit |
kubernetes/test-infra | gubernator/third_party/cloudstorage/storage_api.py | 75 | 28161 | # Copyright 2012 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 |
csirtgadgets/py-csirtgsdk | test/test_search_live.py | 3 | 5086 | import pytest
import os
from time import sleep
from csirtgsdk.indicator import Indicator
from csirtgsdk.feed import Feed
from csirtgsdk.client.http import HTTP as Client
from csirtgsdk.search import Search
CI_BUILD = os.environ.get('CI_BUILD', False)
TOKEN = os.environ.get('CSIRTG_TOKEN', None)
USER = os.environ.get('... | lgpl-3.0 |
Alwnikrotikz/urssus | urssus/processdialog.py | 4 | 2232 | # -*- coding: utf-8 -*-
# uRSSus, a multiplatform GUI news agregator
# Copyright (C) 2008 Roberto Alsina
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distribu... | lgpl-2.1 |
jorgeslima/files_copier | dependencies/tinydb/tinydb/storages.py | 2 | 2980 | """
Contains the :class:`base class <tinydb.storages.Storage>` for storages and
implementations.
"""
from abc import ABCMeta, abstractmethod
import os
from .utils import with_metaclass
try:
import ujson as json
except ImportError:
import json
def touch(fname, create_dirs):
if create_dirs:
base... | mit |
lahwaacz/qutebrowser | qutebrowser/browser/webkit/webkittab.py | 1 | 27974 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
shopmium/titanium_mobile | support/android/tcpserver.py | 37 | 7728 | #
# BaseServer and TCPServer copied from Python 2.6 to be compatible w/ Python 2.5
#
import os, sys, socket
import select, threading, urllib
class BaseServer:
"""Base class for server classes.
Methods for the caller:
- __init__(server_address, RequestHandlerClass)
- serve_forever(poll_interval=0.5)
- shutdown(... | apache-2.0 |
abo-abo/edx-platform | common/lib/xmodule/xmodule/tests/xml/test_inheritance.py | 49 | 1071 | """
Test that inherited fields work correctly when parsing XML
"""
from nose.tools import assert_equals # pylint: disable=no-name-in-module
from xmodule.tests.xml import XModuleXmlImportTest
from xmodule.tests.xml.factories import CourseFactory, SequenceFactory, ProblemFactory
class TestInheritedFieldParsing(XModul... | agpl-3.0 |
dhenrygithub/QGIS | python/ext-libs/nose2/plugins/printhooks.py | 11 | 1767 | """
This plugin is primarily useful for plugin authors who want to debug
their plugins.
It prints each hook that is called to stderr, along with details of
the event that was passed to the hook.
To do that, this plugin overrides :meth:`nose2.events.Plugin.register`
and, after registration, replaces all existing
:clas... | gpl-2.0 |
JTCunning/sentry | src/sentry/plugins/sentry_urls/models.py | 13 | 1027 | """
sentry.plugins.sentry_urls.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import sentry
from django.utils.translation import ugettext_lazy as _
from sentr... | bsd-3-clause |
LeartS/odoo | addons/payment_ogone/controllers/main.py | 389 | 1179 | # -*- coding: utf-8 -*-
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class OgoneController(http.Controller):
_accept_url = '/payment/ogone/test/accept'
_decline_url = '/payment/ogone/test/decline'
... | agpl-3.0 |
rednaxelafx/apache-spark | examples/src/main/python/streaming/queue_stream.py | 150 | 1763 | #
# 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 |
vasudev-33/os | Documentation/target/tcm_mod_builder.py | 3119 | 42754 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
bjacquemet/python-oauth2 | oauth2/__init__.py | 458 | 29044 | """
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | mit |
henn/haas | tests/deployment/headnodes.py | 2 | 2516 | # Copyright 2013-2015 Massachusetts Open Cloud Contributors
#
# 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 applicab... | apache-2.0 |
lsiemens/lsiemens.github.io | theory/fractional_calculus/code/old/FCC2.py | 1 | 1663 | """
Ideas about fractional calculus defined on C^2
J^b f(x, a) = f(x, a + b)
"""
import numpy
from matplotlib import pyplot
from scipy import special
def monomial(x, a, x_0, a_0):
return (x - x_0)**(a - a_0)/special.gamma(a - a_0 + 1)
def exp(x, a, b):
return b**(-a)*numpy.exp(b*x)
def projx(f, x, a):
n... | mit |
fajoy/nova | nova/tests/api/openstack/compute/contrib/test_hosts.py | 1 | 14601 | # Copyright (c) 2011 OpenStack, LLC.
# 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 |
MISP/misp-modules | misp_modules/modules/import_mod/csvimport.py | 1 | 15484 | # -*- coding: utf-8 -*-
from pymisp import MISPEvent, MISPObject
from pymisp import __path__ as pymisp_path
import csv
import io
import json
import os
import base64
misperrors = {'error': 'Error'}
moduleinfo = {'version': '0.2', 'author': 'Christian Studer',
'description': 'Import Attributes from a csv f... | agpl-3.0 |
datasciencedev/locality-sensitive-hashing | mapreduce/namespace_range.py | 37 | 15075 | #!/usr/bin/env python
# Copyright 2010 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 ... | apache-2.0 |
pmeier82/BOTMpy | botmpy/test/test_nodes_artifacts.py | 1 | 3553 | # -*- coding: utf-8 -*-
#_____________________________________________________________________________
#
# Copyright (c) 2012 Berlin Institute of Technology
# All rights reserved.
#
# Developed by: Neural Information Processing Group (NI)
# School for Electrical Engineering and Computer Science
# ... | mit |
release-monitoring/anitya | anitya/lib/backends/cpan.py | 1 | 3710 | # -*- coding: utf-8 -*-
"""
(c) 2014-2016 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
Ralph Bean <rbean@redhat.com>
"""
import logging
from defusedxml import ElementTree as ET
from anitya.lib.backends import BaseBackend, get_versions_by_regex, REGEX
from anitya.lib.exceptions... | gpl-2.0 |
saisai/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/config/charts.py | 122 | 2458 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
dumbringer/ns-3-dev-ndnSIM | src/lte/test/examples-to-run.py | 151 | 3664 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
... | gpl-2.0 |
sztosz/neonet | CommercialReturns/views.py | 1 | 4999 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Created on 2013-10-11
#
# @author: Bartosz Nowak sztosz@gmail.com
#
# This file is licensed GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
from __future__ import unicode_literals
import unicodecsv
from django.contrib.auth import logout
from django.shortcuts import red... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.