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 |
|---|---|---|---|---|---|
wangjun/wakatime | wakatime/packages/pygments_py3/pygments/lexers/felix.py | 72 | 9410 | # -*- coding: utf-8 -*-
"""
pygments.lexers.felix
~~~~~~~~~~~~~~~~~~~~~
Lexer for the Felix language.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups, default, words, \
comb... | bsd-3-clause |
edx-solutions/discussion-edx-platform-extensions | social_engagement/engagement.py | 1 | 14753 | """
Business logic tier regarding social engagement scores
"""
import logging
import sys
from collections import defaultdict
from datetime import datetime
import pytz
from django.conf import settings
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from django.http import ... | agpl-3.0 |
vaskalas/aiohttp | aiohttp/multipart.py | 3 | 32102 | import asyncio
import binascii
import base64
import json
import io
import mimetypes
import os
import re
import uuid
import warnings
import zlib
from urllib.parse import quote, unquote, urlencode, parse_qsl
from collections import deque, Mapping, Sequence
from pathlib import Path
from multidict import CIMultiDict
from... | apache-2.0 |
doomsterinc/odoo | addons/hr_recruitment/report/hr_recruitment_report.py | 325 | 4836 | # -*- 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 |
sss/calibre-at-bzr | setup/installer/__init__.py | 3 | 6660 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import subprocess, tempfile, os, time, socket
from setup import Command, installer_n... | gpl-3.0 |
egnyte/gitlabform | gitlabform/gitlabform/test/test_group_shared_with.py | 1 | 5232 | import pytest
from gitlabform.gitlabform.test import (
run_gitlabform,
)
@pytest.fixture(scope="function")
def one_owner(gitlab, group, groups, users):
gitlab.add_member_to_group(group, users[0], 50)
gitlab.remove_member_from_group(group, "root")
yield group
# we are running tests with root's ... | mit |
GodBlessPP/W17test_2nd_1 | static/Brython3.1.1-20150328-091302/Lib/_sre.py | 622 | 51369 | # NOT_RPYTHON
"""
A pure Python reimplementation of the _sre module from CPython 2.4
Copyright 2005 Nik Haldimann, licensed under the MIT license
This code is based on material licensed under CNRI's Python 1.6 license and
copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB
"""
MAXREPEAT = 2147483648
#import ar... | gpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.3.0/Lib/lib2to3/pygram.py | 170 | 1114 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Export the Python grammar and symbols."""
# Python imports
import os
# Local imports
from .pgen2 import token
from .pgen2 import driver
from . import pytree
# The grammar file
_GRAMMAR_FILE = os.path.join(os.path.... | mit |
jravetch/ubuntu-make | setup.py | 6 | 5396 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Didier Roche
#
# 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; version 3.
#
# This program is distri... | gpl-3.0 |
codekaki/odoo | addons/plugin_outlook/plugin_outlook.py | 92 | 2079 | # -*- 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 |
arkanister/minitickets | lib/utils/html/templatetags/icons.py | 1 | 2009 | # -*- coding: utf-8 -*-
from django import template
from django.template import TemplateSyntaxError, Node
from ..icons.base import Icon
from ..tags import token_kwargs, resolve_kwargs
register = template.Library()
class IconNode(Node):
def __init__(self, _icon, kwargs=None):
super(IconNode, self).__in... | apache-2.0 |
JioCloud/nova | nova/db/sqlalchemy/migrate_repo/versions/227_fix_project_user_quotas_resource_length.py | 81 | 1366 | # Copyright 2013 NEC Corporation
#
# 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 |
isaacbernat/awis | setup.py | 1 | 1887 | from setuptools import setup, find_packages
# from codecs import open
# from os import path
# here = path.abspath(path.dirname(__file__))
# # Get the long description from the README file
# with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
# long_description = f.read()
setup(
# Application nam... | gpl-3.0 |
arc6373/django-rest-swagger | tests/cigar_example/cigar_example/app/models.py | 19 | 1274 | from django.db import models
class Cigar(models.Model):
FORM_CHOICES = (
('parejo', 'Parejo'),
('torpedo', 'Torpedo'),
('pyramid', 'Pyramid'),
('perfecto', 'Perfecto'),
('presidente', 'Presidente'),
)
name = models.CharField(max_length=25, help_text='Cigar Name')
... | bsd-2-clause |
BeeeOn/server | t/gws/t1006-sensor-data-export.py | 1 | 4343 | #! /usr/bin/env python3
import config
config.import_libs()
import unittest
import websocket
import json
import time
import uuid
from gws import assureIsClosed, assureNotClosed, registerGateway, ZMQConnection
class TestSensorData(unittest.TestCase):
def setUp(self):
self.zmq = ZMQConnection(config.gws_zmq_endpoin... | bsd-3-clause |
faarwa/EngSocP5 | zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/dvips.py | 34 | 3452 | """SCons.Tool.dvips
Tool-specific initialization for dvips.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#... | gpl-3.0 |
Mhynlo/SickRage | lib/fake_useragent/utils.py | 21 | 3284 | from __future__ import absolute_import, unicode_literals
import codecs
import json
import os
import re
from time import sleep
from threading import Lock
try: # Python 2
from urllib2 import urlopen, Request, URLError
from urllib import quote_plus
except ImportError: # Python 3
from urllib.request import ... | gpl-3.0 |
hendradarwin/VTK | ThirdParty/Twisted/twisted/conch/test/test_keys.py | 27 | 27826 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.ssh.keys}.
"""
try:
import Crypto.Cipher.DES3
except ImportError:
# we'll have to skip these tests without PyCypto and pyasn1
Crypto = None
try:
import pyasn1
except ImportError:
pyasn1 = None
i... | bsd-3-clause |
EricMountain-1A/openshift-ansible | roles/lib_openshift/src/test/unit/test_oc_pvc.py | 60 | 13429 | '''
Unit tests for oc pvc
'''
import copy
import os
import six
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylint: disable=import... | apache-2.0 |
google-research/google-research | kws_streaming/models/lstm.py | 1 | 3941 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
alikins/ansible | lib/ansible/modules/cloud/vmware/vmware_vsan_cluster.py | 47 | 3753 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Russell Teague <rteague2 () csc.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 = {'metadata_version': '1.1',... | gpl-3.0 |
knehez/edx-platform | lms/djangoapps/instructor_task/tests/test_tasks_helper.py | 13 | 57777 | # -*- coding: utf-8 -*-
"""
Unit tests for LMS instructor-initiated background tasks helper functions.
Tests that CSV grade report generation works with unicode emails.
"""
import ddt
from mock import Mock, patch
import tempfile
import unicodecsv
from django.core.urlresolvers import reverse
from django.test.utils im... | agpl-3.0 |
yingyun001/ovirt-engine | packaging/setup/plugins/ovirt-engine-rename/ovirt-engine/engine.py | 8 | 1604 |
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | apache-2.0 |
Hybrid-Cloud/conveyor | conveyor/tests/unit/clone/drivers/openstack/test_driver.py | 1 | 5751 | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
bobsilverberg/oneanddone | oneanddone/tasks/tests/test_views.py | 4 | 17708 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.core.urlresolvers import reverse
from django.http import HttpRequest
from django.utils.translation import ug... | mpl-2.0 |
VinnieJohns/ggrc-core | src/ggrc/migrations/versions/20170222151635_2e049f7d3b0b_update_roles_in_options_table.py | 3 | 1132 | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
update roles in options table
Create Date: 2017-02-13 06:00:17.987416
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from alembic imp... | apache-2.0 |
fake-name/ReadableWebProxy | WebMirror/management/GravityTalesManage.py | 1 | 1202 |
import calendar
import datetime
import json
import os
import os.path
import shutil
import traceback
from concurrent.futures import ThreadPoolExecutor
import urllib.error
import urllib.parse
from sqlalchemy import and_
from sqlalchemy import or_
import sqlalchemy.exc
from sqlalchemy_continuum_vendored.utils import ve... | bsd-3-clause |
idncom/odoo | addons/purchase/stock.py | 58 | 18545 | # -*- 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 |
amith01994/intellij-community | python/lib/Lib/site-packages/django/contrib/staticfiles/views.py | 71 | 6101 | """
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
import mimetypes
import os
import posixpath
import re
import stat
import urllib
from email.Utils import parsedate_tz, mktime_tz
from django.conf import settings
from djan... | apache-2.0 |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | Algor/flask/lib/python2.7/site-packages/unidecode/x0fb.py | 252 | 3838 | data = (
'ff', # 0x00
'fi', # 0x01
'fl', # 0x02
'ffi', # 0x03
'ffl', # 0x04
'st', # 0x05
'st', # 0x06
'[?]', # 0x07
'[?]', # 0x08
'[?]', # 0x09
'[?]', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'[?]', # 0x0f
'[?]', # 0x10
'[?]', # 0x11
'[?]', ... | apache-2.0 |
SteveHNH/ansible | lib/ansible/modules/network/avi/avi_tenant.py | 27 | 3806 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
bakerlover/project2 | lib/werkzeug/testsuite/contrib/cache.py | 94 | 7212 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.cache
~~~~~~~~~~~~~~~~~~~~~~~~
Tests the cache system
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import time
import unittest
import tempfile
import shutil
from werkzeug.testsuite import Werkzeug... | apache-2.0 |
tmerrick1/spack | lib/spack/spack/test/cmd/cd.py | 5 | 1470 | ##############################################################################
# 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 |
jounex/hue | desktop/core/ext-py/boto-2.38.0/boto/fps/__init__.py | 429 | 1101 | # Copyright (c) 2008, Chris Moyer http://coredumped.org
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... | apache-2.0 |
jspraul/bite-project | deps/gdata-python-client/samples/spreadsheets/spreadsheetExample.py | 39 | 6433 | #!/usr/bin/python
#
# Copyright (C) 2007 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 ... | apache-2.0 |
Mhynlo/SickRage | lib/unidecode/x08e.py | 252 | 4659 | data = (
'Chu ', # 0x00
'Jing ', # 0x01
'Nie ', # 0x02
'Xiao ', # 0x03
'Bo ', # 0x04
'Chi ', # 0x05
'Qun ', # 0x06
'Mou ', # 0x07
'Shu ', # 0x08
'Lang ', # 0x09
'Yong ', # 0x0a
'Jiao ', # 0x0b
'Chou ', # 0x0c
'Qiao ', # 0x0d
'[?] ', # 0x0e
'Ta ', # 0x0f
'Jian ', # 0x10... | gpl-3.0 |
DanaOshri/Open-Knesset | video/management/commands/add_video.py | 14 | 1246 | # encoding: utf-8
from django.core.management.base import NoArgsCommand
from optparse import make_option
from video.management.commands.sub_commands.AddVideo import AddVideo
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option('--video-link',action='store',dest='video-lin... | bsd-3-clause |
sseago/kubernetes | cluster/juju/charms/trusty/kubernetes-master/hooks/install.py | 105 | 3183 | #!/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 |
ppizarror/Hero-of-Antair | bin/mechanize/_opener.py | 3 | 14766 | """URL opener.
Copyright 2004-2006 John J Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
import os, urllib2, bisect, httplib, types, tempfile
from _request import ... | gpl-2.0 |
aisipos/django | tests/view_tests/generic_urls.py | 329 | 1356 | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.views.generic import RedirectView
from . import views
from .models import Article, DateArticle
date_based_info_dict = {
'queryset': Article.objects.all()... | bsd-3-clause |
dariox2/CADL | session-5/libs/stylenet.py | 4 | 11350 | """Style Net w/ tests for Video Style Net.
Video Style Net requires OpenCV 3.0.0+ w/ Contrib for Python to be installed.
Creative Applications of Deep Learning w/ Tensorflow.
Kadenze, Inc.
Copyright Parag K. Mital, June 2016.
"""
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import os
fro... | apache-2.0 |
liorshahverdi/authomatic | authomatic/providers/openid.py | 14 | 17332 | # -*- coding: utf-8 -*-
"""
|openid| Providers
----------------------------------
Providers which implement the |openid|_ protocol based on the
`python-openid`_ library.
.. warning::
This providers are dependent on the |pyopenid|_ package.
.. autosummary::
OpenID
Yahoo
Google
"""
# We ne... | mit |
hydrospanner/DForurm | DForurm/env/Lib/site-packages/django/conf/locale/cy/formats.py | 504 | 1822 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '25 Hy... | mit |
CristianBB/SickRage | lib/feedparser/urls.py | 43 | 4592 | from __future__ import absolute_import, unicode_literals
import re
try:
import urllib.parse as urlparse
except ImportError:
import urlparse as urlparse
from .html import _BaseHTMLProcessor
# If you want feedparser to allow all URL schemes, set this to ()
# List culled from Python's urlparse documentation at... | gpl-3.0 |
draekko/android_kernel_samsung_kylessopen | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
sprymix/sockjs | tests/test_transport.py | 2 | 2362 | from unittest import mock
from aiohttp import web
from test_base import TestCase
from sockjs import protocol
from sockjs.transports import base
class TransportTestCase(TestCase):
TRANSPORT_CLASS = base.StreamingTransport
def test_transport_ctor(self):
manager = object()
session = object()
... | apache-2.0 |
tta/gnuradio-tta | gnuradio-core/src/python/build_utils.py | 11 | 5901 | #
# Copyright 2004,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later versi... | gpl-3.0 |
soundofjw/appengine-mapreduce | python/test/mapreduce gcs/cloudstorage/common.py | 129 | 12326 | # 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 |
borysiasty/QGIS | tests/src/python/test_qgslayoutpolygon.py | 26 | 12819 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutItemPolygon.
.. note:: 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.
... | gpl-2.0 |
supermari0/ironic | doc/source/conf.py | 8 | 2542 | # -*- coding: utf-8 -*-
#
# -- General configuration ----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.view... | apache-2.0 |
flaviogrossi/billiard | billiard/process.py | 2 | 10580 | #
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
#
# Imports
#
import os
import sys
import signal
import itertools
import logging
im... | bsd-3-clause |
McIntyre-Lab/papers | newman_t1d_cases_2017/scripts/bwa_sam_parse.py | 1 | 2304 | #!/usr/bin/env python
import argparse
## This script parses a sam file from BWA-MEM and outputs a log of alignment counts and percentages.
# Parse command line arguments
parser = argparse.ArgumentParser(description='Parse sam file to get alignment counts.')
parser.add_argument('-sam','--sam_file',dest='sam', action='... | lgpl-3.0 |
Alignak-monitoring-contrib/alignak-app | test/test_panel_widget.py | 1 | 9176 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2018:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) 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 Sof... | agpl-3.0 |
golharam/rgtools | scripts/galaxy/api/addFilesToLibrary.py | 1 | 4458 | #!/usr/bin/env python
"""
Author: Ryan Golhar <ryan.golhar@bms.com>
Date: 06/24/15
This script adds readme.txt, *.fastq.gz to a Galaxy Library
Usage: addFilesToLibrary [-h] [--api-key <API_KEY>] [--api-url <API_URL>] <path of directory to scan> <library_name>
"""
import ConfigParser
import os
import argparse
import s... | lgpl-3.0 |
areski/django | django/template/loaders/eggs.py | 145 | 2388 | # Wrapper for loading templates from eggs via pkg_resources.resource_string.
from __future__ import unicode_literals
import warnings
from django.apps import apps
from django.template import Origin, TemplateDoesNotExist
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from .b... | bsd-3-clause |
nitzmahone/ansible | test/units/modules/network/ovs/test_openvswitch_db.py | 44 | 6197 | #
# (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 your option) any later version.
#
# Ansible is d... | gpl-3.0 |
dfdx2/django | tests/admin_views/test_multidb.py | 23 | 2467 | from unittest import mock
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth.models import User
from django.db import connections
from django.test import TestCase, override_settings
from django.urls import reverse
from .models import Book
class Router:
target_db = None
... | bsd-3-clause |
jayhetee/dask | dask/array/numpy_compat.py | 9 | 1606 | import numpy as np
try:
isclose = np.isclose
except AttributeError:
def isclose(*args, **kwargs):
raise RuntimeError("You need numpy version 1.7 or greater to use "
"isclose.")
try:
full = np.full
except AttributeError:
def full(shape, fill_value, dtype=None, order=N... | bsd-3-clause |
tiagocoutinho/PyTango | tango/pytango_pprint.py | 4 | 6400 | # ------------------------------------------------------------------------------
# This file is part of PyTango (http://pytango.rtfd.io)
#
# Copyright 2006-2012 CELLS / ALBA Synchrotron, Bellaterra, Spain
# Copyright 2013-2014 European Synchrotron Radiation Facility, Grenoble, France
#
# Distributed under the terms of ... | lgpl-3.0 |
antonioUnina/neutron | neutron/tests/unit/dummy_plugin.py | 41 | 4644 | # Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
bonitadecker77/python-for-android | python-modules/twisted/twisted/web/test/test_resource.py | 53 | 4638 | # Copyright (c) 2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.resource}.
"""
from twisted.trial.unittest import TestCase
from twisted.web import error
from twisted.web.http import NOT_FOUND, FORBIDDEN
from twisted.web.resource import ErrorPage, NoResource, ForbiddenResource
... | apache-2.0 |
CERNDocumentServer/cds-videos | cds/modules/theme/views.py | 6 | 1189 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 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... | gpl-2.0 |
sbg/sevenbridges-python | sevenbridges/meta/collection.py | 1 | 4097 | from sevenbridges.errors import PaginationError, SbgError
from sevenbridges.models.compound.volumes.volume_object import VolumeObject
from sevenbridges.models.compound.volumes.volume_prefix import VolumePrefix
from sevenbridges.models.link import Link, VolumeLink
class Collection(list):
"""
Wrapper for SevenB... | apache-2.0 |
google/brain-tokyo-workshop | WANNRelease/prettyNEAT/vis/lplot.py | 2 | 2027 | """
Laconic plot functions to replace some of the matplotlibs verbosity
"""
from matplotlib import pyplot as plt
import numpy as np
import seaborn as sns
# -- File I/O ------------------------------------------------------------ -- #
def lsave(data,fileName):
np.savetxt(fileName, data, delimiter=',',fmt='%1.2e') ... | apache-2.0 |
srikantbmandal/ansible | lib/ansible/modules/cloud/amazon/iam_server_certificate_facts.py | 77 | 5772 | #!/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 |
TribeMedia/sky_engine | build/android/lint/suppress.py | 96 | 3912 | #!/usr/bin/env python
#
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Add all generated lint_result.xml files to suppressions.xml"""
import collections
import optparse
import os
import sys
from ... | bsd-3-clause |
RNAcentral/rnacentral-webcode | rnacentral/portal/management/commands/update_example_locations.py | 1 | 4551 | """
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | apache-2.0 |
gbiggs/rtshell | rtshell/path.py | 2 | 1105 | #!/usr/bin/env python2
# -*- Python -*-
# -*- coding: utf-8 -*-
'''rtshell
Copyright (C) 2009-2015
Geoffrey Biggs
RT-Synthesis Research Group
Intelligent Systems Research Institute,
National Institute of Advanced Industrial Science and Technology (AIST),
Japan
All rights reserved.
Licensed und... | lgpl-3.0 |
jamslevy/gsoc | app/django/contrib/comments/views/moderation.py | 15 | 6664 | from django import template
from django.conf import settings
from django.shortcuts import get_object_or_404, render_to_response
from django.contrib.auth.decorators import login_required, permission_required
from utils import next_redirect, confirmation_view
from django.core.paginator import Paginator, InvalidPage
from ... | apache-2.0 |
mikelum/pyspeckit | pyspeckit/spectrum/readers/read_class.py | 1 | 67070 | """
------------------------
GILDAS CLASS file reader
------------------------
Read a CLASS file into an :class:`pyspeckit.spectrum.ObsBlock`
"""
from __future__ import print_function
from astropy.extern.six.moves import xrange
from astropy.extern.six import iteritems
try:
import astropy.io.fits as pyfits
except I... | mit |
geminas/dnsteal | dnsteal.py | 12 | 3710 | #!/usr/bin/env python
# ~ \x90
######################
import socket
import sys
import binascii
import time
import random
import hashlib
import zlib
c = { "r" : "\033[1;31m", "g": "\033[1;32m", "y" : "\033[1;33m", "e" : "\033[0m" }
VERSION = "1.0"
class DNSQuery:
def __init__(self, data):
self.data = data
self... | gpl-2.0 |
aparo/django-nonrel | tests/regressiontests/context_processors/tests.py | 50 | 4683 | """
Tests for Django's bundled context processors.
"""
from django.conf import settings
from django.contrib.auth import authenticate
from django.db.models import Q
from django.test import TestCase
from django.template import Template
class RequestContextProcessorTests(TestCase):
"""
Tests for the ``django.cor... | bsd-3-clause |
willthames/ansible | lib/ansible/modules/network/nxos/nxos_vtp_password.py | 7 | 7866 | #!/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 |
slohse/ansible | test/units/executor/test_task_executor.py | 11 | 18682 | # (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 |
theguardian/JIRA-APPy | lib/tlslite/utils/datefuncs.py | 206 | 2278 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
import os
#Functions for manipulating datetime objects
#CCYY-MM-DDThh:mm:ssZ
def parseDateClass(s):
year, month, day = s.split("-")
day, tail = day[:2], day[2:]
hour, minute, second = tail[1:].split(":")
s... | gpl-2.0 |
cgstudiomap/cgstudiomap | main/eggs/phonenumbers-7.1.1-py2.7.egg/phonenumbers/data/region_TK.py | 10 | 1412 | """Auto-generated file, do not edit by hand. TK metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_TK = PhoneMetadata(id='TK', country_code=690, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2-9]\\d{3}', possible_number_pattern='\... | agpl-3.0 |
fivethreeo/lesscpy | lesscpy/lessc/formatter.py | 5 | 1090 | # -*- coding: utf8 -*-
"""
.. module:: lesscpy.lessc.formatter
:synopsis: CSS Formatter class.
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Johann T. Mariusson <jtm@robot.is>
"""
class Formatter(object):
def __init__(self, args):
self.args = args
def format(self, parse):
... | mit |
lmprice/ansible | test/sanity/validate-modules/test_validate_modules_regex.py | 162 | 2807 | #!/usr/bin/env python
# This is a standalone test for the regex inside validate-modules
# It is not suitable to add to the make tests target because the
# file under test is outside the test's sys.path AND has a hyphen
# in the name making it unimportable.
#
# To execute this by hand:
# 1) cd <checkoutdir>
# 2) so... | gpl-3.0 |
MungoRae/home-assistant | homeassistant/components/sensor/cert_expiry.py | 13 | 3516 | """
Counter for the days till a HTTPS (TLS) certificate will expire.
For more details about this sensor please refer to the documentation at
https://home-assistant.io/components/sensor.cert_expiry/
"""
import logging
import socket
import ssl
from datetime import datetime, timedelta
import voluptuous as vol
import ho... | apache-2.0 |
rumirand/GalaxyPlayer5-kernel | scripts/rt-tester/rt-tester.py | 1094 | 5362 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# 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.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
xbuf/blender_io_xbuf | protocol.py | 1 | 4603 | # This file is part of blender_io_xbuf. blender_io_xbuf 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 WARRANT... | gpl-3.0 |
luogangyi/bcec-nova | nova/ipv6/api.py | 40 | 1275 | # Copyright (c) 2011 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 ... | apache-2.0 |
QinerTech/QinerApps | openerp/addons/base/tests/test_ir_sequence.py | 40 | 8375 | # -*- coding: utf-8 -*-
# Run with one of these commands:
# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
# OPENERP_DATABASE=yy PYTHONPATH=. python tests/test_ir_sequence.py
# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
# OPENERP_DATABASE=yy nosetests tests/test_ir_se... | gpl-3.0 |
nattee/cafe-grader-web | lib/assets/Lib/this.py | 18 | 1031 | s = """Gur Mra bs Clguba, ol Gvz Crgref
Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygu... | mit |
siliconsmiley/QGIS | python/plugins/processing/algs/lidar/LidarToolsAlgorithmProvider.py | 4 | 9955 | # -*- coding: utf-8 -*-
"""
***************************************************************************
LidarToolsAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
-------... | gpl-2.0 |
biswajitsahu/kuma | vendor/packages/translate/tools/porestructure.py | 24 | 5556 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2005, 2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 ... | mpl-2.0 |
acetcom/nextepc | lib/nas/eps/support/cache/nas-msg-214.py | 2 | 1879 | ies = []
ies.append({ "iei" : "", "value" : "EPS bearer identity for packet filter", "type" : "Linked EPS bearer identity", "reference" : "9.9.4.6", "presence" : "M", "format" : "V", "length" : "1/2"})
ies.append({ "iei" : "", "value" : "Traffic flow aggregate", "type" : "Traffic flow aggregate description", "reference... | agpl-3.0 |
martydill/url_shortener | code/venv/lib/python2.7/site-packages/jinja2/exceptions.py | 977 | 4428 | # -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import imap, text_type, PY2, implements_to_string
class TemplateError(Exception):
"""Baseclass for al... | mit |
tinjyuu/xhtml2pdf | xhtml2pdf/context.py | 2 | 34095 | # -*- coding: utf-8 -*-
from reportlab.lib.enums import TA_LEFT
from reportlab.lib.fonts import addMapping
from reportlab.lib.pagesizes import landscape, A4
from reportlab.lib.styles import ParagraphStyle
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.platypus.frame... | apache-2.0 |
subodhchhabra/airflow | tests/contrib/hooks/test_gcp_container_hook.py | 5 | 10109 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
ModulousSmash/Modulous | KerbalStuff/blueprints/mods.py | 1 | 19423 | from flask import Blueprint, render_template, request, g, Response, redirect, session, abort, send_file, make_response, url_for
from flask.ext.login import current_user
from sqlalchemy import desc
from KerbalStuff.objects import User, Mod, ModVersion, DownloadEvent, FollowEvent, ReferralEvent, Featured, Media, GameVers... | mit |
samstern/Greengraph | Greengraph/tests/test_maps.py | 1 | 2937 | from ..greengraph import Greengraph
from ..map import Map
import geopy
from nose.tools import assert_equal, assert_almost_equal
import numpy.testing as np_test
from mock import Mock, patch
import requests
from matplotlib import image
import yaml
import os
import numpy as np
#@patch.object(Greengraph, 'location_sequen... | mit |
baylee/django | django/template/utils.py | 199 | 3733 | import os
from collections import Counter, OrderedDict
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache
from django.utils._os import upath
from django.utils.functional import cached_property
from django.utils.module... | bsd-3-clause |
iw3hxn/LibrERP | l10n_ch_scan_bvr/partner.py | 4 | 1433 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Vincent Renaville
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... | agpl-3.0 |
hefen1/chromium | native_client_sdk/src/tools/tests/chrome_mock.py | 51 | 1549 | #!/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.
"""Mock chrome process used by test code for http server."""
import argparse
import sys
import time
import urllib2
def PrintAndFl... | bsd-3-clause |
cfromknecht/namecoin-legacy | client/DNS/Lib.py | 39 | 23343 | # -*- encoding: utf-8 -*-
"""
$Id: Lib.py,v 1.11.2.7 2009/06/09 18:39:06 customdesigned Exp $
This file is part of the pydns project.
Homepage: http://pydns.sourceforge.net
This code is covered by the standard Python License.
Library code. Largely this is packers and unpackers for various types.
"""
#
#
# See ... | mit |
ratschlab/RNA-geeq | SAFT/find_optimal_param_set.py | 1 | 11493 | """
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.
Written (W) 2095-2010 Andre Kahles
Copyright (C) 2009-2010 by... | mit |
don-github/edx-platform | common/lib/xmodule/xmodule/tests/test_split_test_module.py | 44 | 23169 | """
Tests for the Split Testing Module
"""
import ddt
import lxml
from mock import Mock, patch
from fs.memoryfs import MemoryFS
from xmodule.partitions.tests.test_partitions import StaticPartitionService, PartitionTestCase, MockUserPartitionScheme
from xmodule.tests.xml import factories as xml
from xmodule.tests.xml i... | agpl-3.0 |
intel-ctrlsys/actsys | datastore/datastore/database_schema/schema_migration/versions/d43655797899_changing_table_name_from_group_to_.py | 1 | 2060 | """Changing table name from 'group' to 'device_group'
Revision ID: d43655797899
Revises: 38f3c80e9932
Create Date: 2017-08-24 15:17:10.671537
"""
import textwrap
from alembic import op
# revision identifiers, used by Alembic.
revision = 'd43655797899'
down_revision = '38f3c80e9932'
branch_labels = None
depends_on =... | apache-2.0 |
SafeStack/ava | ava_core/test_builder/views.py | 2 | 40881 | # Python Imports
from logging import getLogger
import json
import os
import shutil
# Django Imports
from django.apps import *
from django.conf import settings
from django.http import HttpResponse
# Rest Imports
from rest_framework.views import APIView
from rest_framework import status
# Logger
log = getLogger(__name__... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.