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 |
|---|---|---|---|---|---|
moreati/revelation | epiphany/test/test_execute_bitwise.py | 1 | 7492 | from pydgin.utils import trim_32
from epiphany.instruction import Instruction
from epiphany.isa import decode
from epiphany.machine import RESET_ADDR
from epiphany.test.machine import StateChecker, new_state
import opcode_factory
import pytest
@pytest.mark.parametrize('rn,rm,is16bit', [(-1, 28, True),
... | bsd-3-clause |
MassStash/htc_m8_kernel_GPE_5.0.1 | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
mmauroy/SickRage | lib/dogpile/cache/compat.py | 60 | 1278 | import sys
py2k = sys.version_info < (3, 0)
py3k = sys.version_info >= (3, 0)
py32 = sys.version_info >= (3, 2)
py27 = sys.version_info >= (2, 7)
jython = sys.platform.startswith('java')
win32 = sys.platform.startswith('win')
try:
import threading
except ImportError:
import dummy_threading as threading # noq... | gpl-3.0 |
JioCloud/glance | glance/common/location_strategy/store_type.py | 15 | 4232 | # Copyright 2014 IBM Corp.
# 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 app... | apache-2.0 |
adambrenecki/django | django/contrib/admin/filters.py | 2 | 16057 | """
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.db import models... | bsd-3-clause |
mclois/iteexe | twisted/scripts/tap2deb.py | 20 | 7362 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os, string, shutil
from twisted.python import usage
class MyOptions(usage.Options):
optFlags = [["unsigned", "u"]]
optParameters = [["tapfile", "t", "twistd.tap"],
["maintainer", "m", "", "The ma... | gpl-2.0 |
pkyad/libreERP | Employee/models.py | 2 | 8557 | from django.db import models
from django import forms
from django.contrib.auth.models import User
from time import time
# Create your models here.
def getSignaturesPath(instance , filename):
return 'images/Sign/%s_%s_%s' % (str(time()).replace('.', '_'), instance.user.username, filename)
def getDisplayPicturePath(... | gpl-2.0 |
alistairlow/tensorflow | tensorflow/python/debug/lib/debug_graph_reconstruction_test.py | 15 | 6937 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
UTNkar/moore | src/home/migrations/0049_auto_20210202_1600.py | 1 | 85313 | # Generated by Django 3.1.5 on 2021-02-02 15:00
import blocks.models
from django.db import migrations
import google.models
import involvement.blocks.contact_card_block
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
... | agpl-3.0 |
opticron/asterisk-testsuite-temporary | tests/bridge/parkcall_timeout/comebacktoorigin_no/Executioner.py | 3 | 7011 | #!/usr/bin/env python
'''
Copyright (C) 2013, Digium, Inc.
Jonathan Rose <jrose@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
'''
import sys
import logging
sys.path.append("lib/python")
from version import AsteriskVersion
LOGGER = logging.getLog... | gpl-2.0 |
jeromecc/doctoctocbot | src/customer/migrations/0009_product.py | 1 | 6685 | # Generated by Django 2.2.4 on 2019-12-11 01:56
from decimal import Decimal
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('customer', '0008_auto_20191210_2010'),
]
operations = [
migrations.CreateModel(
... | mpl-2.0 |
nbari/my-sandbox | python/email/server.py | 1 | 1444 | import smtplib
import smtpd
import asyncore
import email.utils
from email.mime.text import MIMEText
import threading
class SMTPReceiver(smtpd.SMTPServer):
def process_message(self, peer, mailfrom, rcpttos, data):
print 'Receiving message from:', peer
print 'Message addressed from:', mailfrom
... | bsd-3-clause |
laurentb/weboob | modules/onlinenet/module.py | 1 | 2721 | # -*- coding: utf-8 -*-
# Copyright(C) 2016 Edouard Lambert
#
# This file is part of a weboob module.
#
# This weboob module 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... | lgpl-3.0 |
eeshangarg/oh-mainline | vendor/packages/sphinx/sphinx/builders/websupport.py | 16 | 6266 | # -*- coding: utf-8 -*-
"""
sphinx.builders.websupport
~~~~~~~~~~~~~~~~~~~~~~~~~~
Builder for the web support package.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from os import path
import posixpath
import shutil
from docutils.io ... | agpl-3.0 |
OpenPymeMx/OCB | addons/mrp_operations/report/mrp_code_barcode.py | 53 | 1538 | # -*- 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... | agpl-3.0 |
yuvadm/django-pipeline | pipeline/conf.py | 7 | 2785 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings as _settings
DEFAULTS = {
'DEBUG': False,
'PIPELINE_ENABLED': not _settings.DEBUG,
'PIPELINE_ROOT': _settings.STATIC_ROOT,
'PIPELINE_URL': _settings.STATIC_URL,
'PIPELINE_STORAGE': 'pipeline.storage... | mit |
liangazhou/django-rdp | packages/Django-1.8.6/tests/lookup/tests.py | 33 | 36080 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from unittest import skipUnless
from django.core.exceptions import FieldError
from django.db import connection
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .models import Article, ... | apache-2.0 |
mccheung/kbengine | kbe/src/lib/python/Lib/colorsys.py | 144 | 4064 | """Conversion functions between RGB and other color systems.
This modules provides two functions for each color system ABC:
rgb_to_abc(r, g, b) --> a, b, c
abc_to_rgb(a, b, c) --> r, g, b
All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly... | lgpl-3.0 |
kanairen/RegularIcosahedronDict | src/map/factory/base_shape_map_factory.py | 1 | 4162 | #!/usr/bin/env python
# coding: utf-8
import numpy as np
from src.obj.obj3d import Obj3d
from src.obj.grid.base_grid import BaseGrid
class BaseShapeMapFactory(object):
DIST_UNDEFINED = -1
def __init__(self, model_id, obj3d, grid, n_div, cls, grid_scale):
"""
:type model_id: int or long:
... | mit |
fpy171/django | tests/gis_tests/gdal_tests/test_ds.py | 273 | 11450 | import os
import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from ..test_data import TEST_DATA, TestDS, get_ds_file
if HAS_GDAL:
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, GDALException, OGRIndexError, GDAL_VERSION
from django.contrib.gis.... | bsd-3-clause |
slisson/intellij-community | python/lib/Lib/site-packages/django/contrib/admin/widgets.py | 73 | 11754 | """
Form Widget classes specific to the Django admin site.
"""
import django.utils.copycompat as copy
from django import forms
from django.forms.widgets import RadioFieldRenderer
from django.forms.util import flatatt
from django.utils.html import escape
from django.utils.text import truncate_words
from django.utils.t... | apache-2.0 |
jdinuncio/ansible-modules-extras | cloud/cloudstack/cs_ip_address.py | 48 | 7197 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Darren Worrall <darren@iweb.co.uk>
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 So... | gpl-3.0 |
ikben/troposphere | examples/WAF_Common_Attacks_Sample.py | 1 | 5554 | # Converted from AWS WAF Sample located at:
# https://s3.amazonaws.com/cloudformation-examples/community/common-attacks.json
from troposphere import (
Template,
Parameter,
Join,
Ref
)
from troposphere.waf import (
Rule,
SqlInjectionMatchSet,
WebACL,
SizeConstraintSet,
IPSet,
Xss... | bsd-2-clause |
jonlatorre/VideoCargador | video/models.py | 1 | 1791 | # encoding: utf-8
from django.db import models
import os
from mencoder import *
class Video(models.Model):
"""This is a small demo using just two fields. The slug field is really not
necessary, but makes the code simpler. ImageField depends on PIL or
pillow (where Pillow is easily installable in a virtual... | mit |
Manuel4131/youtube-dl | youtube_dl/extractor/newstube.py | 113 | 3537 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class NewstubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?newstube\.ru/media/(?P<id>.+)'
_TEST = {
'url': 'http://www.newstube.ru/media/telekanal-cnn-pere... | unlicense |
firstjob/python-social-auth | social/apps/flask_app/default/models.py | 74 | 2369 | """Flask SQLAlchemy ORM models for Social Auth"""
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship, backref
from sqlalchemy.schema import UniqueConstraint
from sqlalchemy.ext.declarative import declarative_base
from social.utils import setting_name, module_member
from ... | bsd-3-clause |
mrshu/scikit-learn | examples/plot_permutation_test_for_classification.py | 1 | 2236 | """
=================================================================
Test with permutations the significance of a classification score
=================================================================
In order to test if a classification score is significative a technique
in repeating the classification procedure aft... | bsd-3-clause |
adit-chandra/tensorflow | tensorflow/python/framework/test_combinations.py | 5 | 14405 | # Copyright 2018 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 |
broferek/ansible | lib/ansible/modules/cloud/amazon/aws_eks_cluster.py | 4 | 9874 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
surajssd/kuma | vendor/packages/nose/core.py | 69 | 13093 | """Implements nose test program and collector.
"""
from __future__ import generators
import logging
import os
import sys
import time
import unittest
from nose.config import Config, all_config_files
from nose.loader import defaultTestLoader
from nose.plugins.manager import PluginManager, DefaultPluginManager, \
R... | mpl-2.0 |
codebikeclimb/NASARobotComp | Robot2017_Master/Robot2016/motorTest.py | 1 | 2963 | #!/usr/bin/python
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor
import serial
import time
import atexit
#initialize i2c communication with motor shield
roboMotor = Adafruit_MotorHAT(addr=0x60)
#initialize serial communications with XBee RF reciever
xBee = serial.Serial('/dev/ttyACM1',57600)
compas... | gpl-3.0 |
aruneral01/auto-sklearn | autosklearn/estimators.py | 5 | 4834 | import os
import random
import shutil
import numpy as np
import autosklearn.automl
from autosklearn.constants import *
class AutoSklearnClassifier(autosklearn.automl.AutoML):
"""This class implements the classification task. It must not be pickled!
Parameters
----------
time_left_for_this_task : in... | bsd-3-clause |
pluralsight/guides-cms | pskb_website/models/heart.py | 2 | 3054 | """
Module to manage CRUD operations on 'heart'ing guides
"""
from .. import app
from .. import utils
redis_obj = None
url = app.config.get('REDIS_HEARTS_DB_URL')
if not url:
url = app.config.get('REDISCLOUD_URL')
app.logger.debug('Attempting to store hearts with REDISCLOUD_URL')
else:
app.logger.debug(... | agpl-3.0 |
kirti3192/spoken-website | cron/spoken_search/whoosh/analysis/tokenizers.py | 93 | 12678 | # Copyright 2007 Matt Chaput. 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 list of conditions and the... | gpl-3.0 |
kamalx/edx-platform | common/djangoapps/student/management/commands/create_user.py | 167 | 4361 | from optparse import make_option
from django.conf import settings
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.utils import translation
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations impor... | agpl-3.0 |
rzinkstok/skymap | skymap/labeling/runner.py | 1 | 2495 | import time
import random
from PIL import Image, ImageDraw
from skymap.labeling.common import Point, BoundingBox, evaluate, POSITION_WEIGHT
from skymap.labeling.greedy import GreedyLabeler, AdvancedGreedyLabeler
from skymap.labeling.grasp import GraspLabeler
from skymap.labeling.genetic import GeneticLabeler, CachedGe... | gpl-3.0 |
akosiaris/p2pool | p2pool/util/memoize.py | 281 | 1737 | import itertools
class LRUDict(object):
def __init__(self, n):
self.n = n
self.inner = {}
self.counter = itertools.count()
def get(self, key, default=None):
if key in self.inner:
x, value = self.inner[key]
self.inner[key] = self.counter.next(), value
... | gpl-3.0 |
bertucho/epic-movie-quotes-quiz | dialogos/build/scrapy/build/lib/scrapy/exceptions.py | 183 | 1396 | """
Scrapy core exceptions
These exceptions are documented in docs/topics/exceptions.rst. Please don't add
new exceptions here without documenting them there.
"""
# Internal
class NotConfigured(Exception):
"""Indicates a missing configuration situation"""
pass
# HTTP and crawling
class IgnoreRequest(Except... | mit |
kolas001/pyoptools | pyoptools/raytrace/_comp_lib/spherical_lens.py | 9 | 6385 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#------------------------------------------------------------------------------
# Copyright (c) 2007, Ricardo Amézquita Orozco
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redis... | bsd-3-clause |
jamalex/fle-home | fle_site/apps/articles/migrations/0004_set_tag_slugs.py | 10 | 8108 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
no_dry_run = True
def forwards(self, orm):
"""Finds all tags with an empty slug and populates it"""
for tag in orm.Tag.objects.filter(... | mit |
kazarinov/python-daemon-manager | tests/test_daemon.py | 1 | 2769 | # -*- coding: utf-8 -*-
import unittest
import subprocess
import shlex
class TestConsole(unittest.TestCase):
def call(self, command):
args = shlex.split(command)
command = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return command.stdout.read()
def command(... | lgpl-3.0 |
iut-ibk/DynaMind-UrbanSim | 3rdparty/opus/src/randstad/estimation/HLCM_specification.py | 2 | 2279 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
specification ={}
specification = {
0: #submodel
[
("urbansim.gridcell.ln_total_value","BTV"),
("urbansim.gridcell.travel_time_to_CBD","BCBD"),
... | gpl-2.0 |
google/mannequinchallenge | loaders/aligned_data_loader.py | 1 | 1933 | # Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | apache-2.0 |
prisae/pelican-plugins | photos/test_photos.py | 20 | 4982 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from pelican.generators import ArticlesGenerator
from pelican.tests.support import unittest, get_settings
from tempfile import mkdtemp
from shutil import rmtree
import photos
CUR_DIR = os.path.dirname(__file__)
class TestPhotos(unittest.TestC... | agpl-3.0 |
tchernomax/ansible | test/units/modules/network/edgeos/test_edgeos_command.py | 39 | 4249 | # (c) 2018 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 dis... | gpl-3.0 |
tynn/numpy | tools/swig/test/testVector.py | 116 | 15018 | #! /usr/bin/env python
from __future__ import division, absolute_import, print_function
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = TypeE... | bsd-3-clause |
supergentle/migueltutorial | flask/lib/python2.7/site-packages/jinja2/testsuite/api.py | 402 | 10381 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.api
~~~~~~~~~~~~~~~~~~~~
Tests the public API and related stuff.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
import os
import tempfile
import shutil
from jinja2.testsuite import JinjaTestCase... | bsd-3-clause |
openshift/openshift-tools | openshift/installer/vendored/openshift-ansible-3.9.40/roles/lib_utils/library/yedit.py | 5 | 32305 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (... | apache-2.0 |
weimingtom/python-for-android | python-modules/twisted/twisted/conch/insults/window.py | 78 | 26264 | # -*- test-case-name: twisted.conch.test.test_window -*-
"""
Simple insults-based widget library
@author: Jp Calderone
"""
import array
from twisted.conch.insults import insults, helper
from twisted.python import text as tptext
class YieldFocus(Exception):
"""Input focus manipulation exception
"""
class B... | apache-2.0 |
mlperf/inference_results_v0.7 | closed/Inspur/code/rnnt/tensorrt/preprocessing/dataset.py | 12 | 11741 | # Copyright (c) 2020, NVIDIA CORPORATION. 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 applic... | apache-2.0 |
aabadie/scikit-learn | examples/mixture/plot_concentration_prior.py | 25 | 5631 | """
========================================================================
Concentration Prior Type Analysis of Variation Bayesian Gaussian Mixture
========================================================================
This example plots the ellipsoids obtained from a toy dataset (mixture of three
Gaussians) fitte... | bsd-3-clause |
snbueno/anaconda | pyanaconda/ui/gui/hubs/progress.py | 2 | 11117 | # Progress hub classes
#
# Copyright (C) 2011-2013 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, or (at your option) any later version.
# This program is distributed... | gpl-2.0 |
wanghaven/readthedocs.org | readthedocs/vcs_support/backends/svn.py | 29 | 3421 | import csv
from StringIO import StringIO
from readthedocs.projects.exceptions import ProjectImportError
from readthedocs.vcs_support.base import BaseVCS, VCSVersion
class Backend(BaseVCS):
supports_tags = False
fallback_branch = '/trunk/'
def __init__(self, project, version, **kwargs):
super(Bac... | mit |
xemul/p.haul | phaul/connection.py | 1 | 1171 | #
# p.haul connection module contain logic needed to establish connection
# between p.haul and p.haul-service.
#
import logging
import socket
import util
class connection(object):
"""p.haul connection
Class encapsulate connections reqired for p.haul work, including rpc socket
(socket for RPC calls), memory socke... | lgpl-2.1 |
PulsePod/old-www-do-not-use | lib/python2.7/site-packages/requests/packages/urllib3/__init__.py | 650 | 1701 | # urllib3/__init__.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
urllib3 - Thread-safe connection pooling and re-using.
"""
__author__ = 'Andrey Petrov (a... | mit |
pwong-mapr/private-hue | desktop/core/ext-py/ctypes-1.0.2/ctypes/test/test_values.py | 66 | 3225 | """
A testcase which accesses *values* in a dll.
"""
import unittest
from ctypes import *
import _ctypes_test
class ValuesTestCase(unittest.TestCase):
def test_an_integer(self):
ctdll = CDLL(_ctypes_test.__file__)
an_integer = c_int.in_dll(ctdll, "an_integer")
x = an_integer.value
... | apache-2.0 |
DeMille/emailhooks | django_nonrel/django/utils/unittest/util.py | 751 | 2821 | """Various utility functions."""
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
return result[:_MAX_LENGTH] + ' [truncated]...'... | mit |
pamfilos/invenio | modules/webalert/lib/webalert_templates.py | 25 | 28709 | ## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 ... | gpl-2.0 |
bpgc-cte/python2017 | Week 7/django/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/operations.py | 28 | 4266 | from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.db.backends.base.operations import (
BaseSpatialOperations,
)
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.db.models import GeometryField, aggregates
from django.db.backends.mysql.o... | mit |
Rogentos/entropy | lib/entropy/client/interfaces/noticeboard.py | 6 | 6085 | # -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy Package Manager Client Notice Board functions Interface}.
"""
import hashlib
import os
from entropy.core.settings.base import SystemSettings... | gpl-2.0 |
AQORN/thunder-engine | thunder_web/api/views.py | 1 | 1791 | from django.shortcuts import render
from rest_framework import status
from rest_framework.decorators import api_view
#
from rest_framework.response import Response
from task.models import Task
from api.serializers import TaskSerializer
#
@api_view(['GET', 'POST'])
def task_list(request):
"""
List all tasks, ... | gpl-3.0 |
2ndQuadrant/ansible | lib/ansible/modules/cloud/amazon/s3_website.py | 39 | 10634 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
benfinkelcbt/CPD200 | CPD200-Lab12-Python/rsa/prime.py | 81 | 4560 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Un... | gpl-3.0 |
apache/airflow | airflow/providers/microsoft/azure/hooks/base_azure.py | 3 | 4790 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
sbalde/edx-platform | lms/djangoapps/shoppingcart/migrations/0012_auto__del_field_courseregistrationcode_transaction_group_name__del_fie.py | 114 | 17592 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'CourseRegistrationCode.transaction_group_name'
db.delete_column('shoppingcart_courseregist... | agpl-3.0 |
mars-knowsnothing/amos-bot | src/Lib/site-packages/wheel/test/test_tagopt.py | 326 | 5927 | """
Tests for the bdist_wheel tag options (--python-tag, --universal, and
--plat-name)
"""
import sys
import shutil
import pytest
import py.path
import tempfile
import subprocess
SETUP_PY = """\
from setuptools import setup, Extension
setup(
name="Test",
version="1.0",
author_email="author@example.com",
... | gpl-3.0 |
cbmoore/statsmodels | statsmodels/sandbox/regression/tests/results_gmm_poisson.py | 34 | 28423 | import numpy as np
est = dict(
rank = 8,
N = 3629,
Q = 4.59536484786e-20,
J = 1.66765790329e-16,
J_df = 0,
k_1 = 8,
converged = 1,
has_xtinst = 0,
type = 1,
n_eq = 1,
k = 8,
n_moments = 8... | bsd-3-clause |
kohnle-lernmodule/exeLearningPlus1_04 | twisted/protocols/telnet.py | 78 | 12270 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""TELNET implementation, with line-oriented command handling.
"""
import warnings
warnings.warn(
"As of Twisted 2.1, twisted.protocols.telnet is deprecated. "
"See twisted.conch.telnet for the current, supported API.",
D... | gpl-2.0 |
calvinleenyc/zulip | zerver/management/commands/rate_limit.py | 28 | 2935 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from zerver.models import UserProfile, get_user_profile_by_email
from zerver.lib.rate_limiter import block_user, unblock_user
from django.core.management.base import BaseCommand
fro... | apache-2.0 |
fo2rist/infra-strike | backend/venv/Lib/encodings/mbcs.py | 860 | 1211 | """ Python 'mbcs' Codec for Windows
Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
# Import them explicitly to cause an ImportError
# on non-Windows systems
from codecs import mbcs... | lgpl-3.0 |
shgandhi/mase | src/a12.py | 13 | 11660 |
"""
## Analysis of Experimental Data
This page is about the non-parametric a12 test. It is also a chance for us to discuss a little
statistical theory.
### Standard Header
"""
from __future__ import division
import sys
sys.dont_write_bytecode = True
from base import *
"""
## Background
For the most part, we ... | unlicense |
PyBossa/pybossa | test/test_sched_depth_first_all.py | 1 | 48364 | # -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2015 Scifabric LTD.
#
# PYBOSSA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | agpl-3.0 |
ondrejmular/pcs | pcs_test/tools/command_env/config_runner_pcmk.py | 3 | 26047 | import os
from pcs_test.tools.command_env.mock_runner import (
Call as RunnerCall,
CheckStdinEqualXml,
)
from pcs_test.tools.fixture_cib import modify_cib
from pcs_test.tools.fixture_crm_mon import complete_state
from pcs_test.tools.misc import get_test_resource as rc
from pcs_test.tools.xml import etree_to_st... | gpl-2.0 |
simbs/edx-platform | common/test/acceptance/tests/lms/test_lms_edxnotes.py | 84 | 44359 | """
Test LMS Notes
"""
from uuid import uuid4
from datetime import datetime
from nose.plugins.attrib import attr
from ..helpers import UniqueCourseTest
from ...fixtures.course import CourseFixture, XBlockFixtureDesc
from ...pages.lms.auto_auth import AutoAuthPage
from ...pages.lms.course_nav import CourseNavPage
from .... | agpl-3.0 |
alxnov/ansible-modules-core | cloud/amazon/ec2_vol.py | 1 | 22132 | #!/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 |
yyamano/RESTx | src/python/restx/render/__init__.py | 1 | 1140 | """
RESTx: Sane, simple and effective data publishing and integration.
Copyright (C) 2010 MuleSoft Inc. http://www.mulesoft.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version... | gpl-3.0 |
Negamann303/kernel-nk1-negalite-lt02ltespr | scripts/build-all.py | 133 | 9588 | #! /usr/bin/env python
# Copyright (c) 2009-2011, The Linux Foundation. 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
# ... | gpl-2.0 |
brandond/ansible | lib/ansible/modules/storage/zfs/zfs_facts.py | 31 | 7995 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@gmail.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 |
octesian/IoTEM | IoTEM/urls.py | 1 | 1376 | """IoTEM URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | gpl-3.0 |
ityaptin/ceilometer | ceilometer/tests/unit/ipmi/notifications/ipmi_test_data.py | 13 | 30181 | #
# Copyright 2014 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 agreed to in writi... | apache-2.0 |
tjcsl/cslbot | cslbot/commands/metar.py | 1 | 2400 | # -*- coding: utf-8 -*-
# Copyright (C) 2013-2018 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Tris Wilson
#
# 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 Softw... | gpl-2.0 |
stephenmcd/mezzanine | mezzanine/accounts/defaults.py | 2 | 3187 | """
Default settings for all mezzanine.accounts app. Each of these can be
overridden in your project's settings module, just like regular
Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.
Thought should be given to how a setting is actually used before
mak... | bsd-2-clause |
gandarez/wakatime | wakatime/packages/pygments_py2/pygments/lexers/inferno.py | 72 | 3116 | # -*- coding: utf-8 -*-
"""
pygments.lexers.inferno
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Inferno os and all the related stuff.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, by... | bsd-3-clause |
o5k/openerp-oemedical-v0.1 | openerp/addons/base_vat/res_company.py | 448 | 1404 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
wooga/airflow | airflow/api/client/api_client.py | 5 | 2340 | #
# 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... | apache-2.0 |
bdrung/audacity | lib-src/lv2/sratom/waflib/Tools/ifort.py | 330 | 1460 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re
from waflib import Utils
from waflib.Tools import fc,fc_config,fc_scan,ar
from waflib.Configure import conf
@conf
def find_ifort(conf):
fc=conf.find_program('ifort'... | gpl-2.0 |
LumPenPacK/NetworkExtractionFromImages | osx_build/nefi2_osx_amd64_xcode_2015/site-packages/numpy/core/tests/test_records.py | 34 | 13432 | from __future__ import division, absolute_import, print_function
import sys
import collections
import pickle
from os import path
import numpy as np
from numpy.compat import asbytes
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_array_equal,
assert_array_almost_equal, ass... | bsd-2-clause |
hollabaq86/haikuna-matata | env/lib/python2.7/site-packages/pip/basecommand.py | 341 | 11910 | """Base Command class, and related routines"""
from __future__ import absolute_import
import logging
import os
import sys
import optparse
import warnings
from pip import cmdoptions
from pip.index import PackageFinder
from pip.locations import running_under_virtualenv
from pip.download import PipSession
from pip.excep... | mit |
wangyum/beam | sdks/python/apache_beam/internal/gcp/json_value.py | 7 | 5972 | #
# 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 |
gnowxilef/Wox | PythonHome/Lib/site-packages/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
Jdizzle80/G901F-JDKernel | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/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 |
sbalde/edxplatform | cms/urls.py | 10 | 9507 | from django.conf import settings
from django.conf.urls import patterns, include, url
# There is a course creators admin table.
from ratelimitbackend import admin
admin.autodiscover()
# pylint: disable=bad-continuation
# Pattern to match a course key or a library key
COURSELIKE_KEY_PATTERN = r'(?P<course_key_string>(... | agpl-3.0 |
cprov/snapcraft | tests/unit/commands/snapcraftctl/test_set_grade.py | 4 | 2293 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
googleapis/google-api-java-client-services | generator/src/googleapis/codegen/schema.py | 1 | 18349 | #!/usr/bin/python2.7
# 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 requi... | apache-2.0 |
maellak/invenio | modules/bibexport/lib/bibexport_method_fieldexporter_webinterface.py | 35 | 22858 | # -*- coding: utf-8 -*-
## $Id: webmessage_webinterface.py,v 1.13 2008/03/12 16:48:08 tibor Exp $
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 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 t... | gpl-2.0 |
3dfxmadscientist/CBSS | addons/account/wizard/account_move_line_select.py | 56 | 2827 | # -*- 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 |
kostimarko/portfolio-v2 | node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/svg.py | 362 | 5867 | # -*- coding: utf-8 -*-
"""
pygments.formatters.svg
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for SVG output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt, get... | mit |
Mirantis/mos-horizon | horizon/test/test_hacking.py | 13 | 3752 | # Copyright 2015 Intel, 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 agr... | apache-2.0 |
SteveXiSong/UW-Madison-ECE757-S15-MulticastSnooping | src/arch/x86/isa/insts/x87/control/clear_exceptions.py | 91 | 2159 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
dthgeek/QuickOSM | core/actions.py | 1 | 4118 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
QuickOSM
A QGIS plugin
OSM Overpass API frontend
-------------------
begin : 2014-06-11
copyright : (C) 2014 by 3Liz
email ... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.