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 |
|---|---|---|---|---|---|
whiteshield/EHScripter | EHScripter/netsparker.py | 1 | 6143 | ##!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import re
import string
from io import StringIO
from lxml import etree
try:
from .util import *
except Exception as e:
from util import *
class NetsparkerToMarkdown:
def __init__(self, options):
self.options=options
self.... | gpl-2.0 |
OpenCanada/website | people/migrations/0003_create_list_page.py | 2 | 1217 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import VERSION as DJANGO_VERSION
from django.db import migrations, models
def create_page(apps, schema_editor):
Page = apps.get_model("wagtailcore", "Page")
ContributorListPage = apps.get_model("people", "ContributorListPage")
ho... | mit |
GinnyN/Team-Fortress-RPG-Generators | build/lib/django/contrib/staticfiles/management/commands/findstatic.py | 244 | 1230 | import os
from optparse import make_option
from django.core.management.base import LabelCommand
from django.utils.encoding import smart_str, smart_unicode
from django.contrib.staticfiles import finders
class Command(LabelCommand):
help = "Finds the absolute paths for the given static file(s)."
args = "[file .... | bsd-3-clause |
hryamzik/ansible | lib/ansible/modules/monitoring/grafana_plugin.py | 14 | 7425 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Thierry Sallé (@seuf)
# 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
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'com... | gpl-3.0 |
leoc/home-assistant | homeassistant/components/sensor/rfxtrx.py | 6 | 4781 | """
Support for RFXtrx sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.rfxtrx/
"""
import logging
import voluptuous as vol
import homeassistant.components.rfxtrx as rfxtrx
import homeassistant.helpers.config_validation as cv
from homeassi... | mit |
darktears/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/tool/mocktool_unittest.py | 56 | 2400 | # Copyright (C) 2010 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 f... | bsd-3-clause |
ntuecon/server | pyenv/Lib/site-packages/twisted/web/domhelpers.py | 12 | 8640 | # -*- test-case-name: twisted.web.test.test_domhelpers -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A library for performing interesting tasks with DOM objects.
"""
import StringIO
from twisted.web import microdom
from twisted.web.microdom import getElementsByTagName, escape, unesc... | bsd-3-clause |
BlindHunter/django | tests/template_tests/filter_tests/test_rjust.py | 521 | 1030 | from django.template.defaultfilters import rjust
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class RjustTests(SimpleTestCase):
@setup({'rjust01': '{% autoescape off %}.{{ a|rjust:"5" }}. .{{ b|rjust:"5" }}.{% endautoescape %}'})
def test_rju... | bsd-3-clause |
bistromath/gr-smartnet | src/python/logging_receiver.py | 2 | 4743 | #!/usr/env/python
from gnuradio import blks2, gr, gru
from grc_gnuradio import blks2 as grc_blks2
from gnuradio import smartnet
import string
import random
import time, datetime
import os
class logging_receiver(gr.hier_block2):
def __init__(self, talkgroup, options):
gr.hier_block2.__init__(self, "fsk_demod",
... | gpl-3.0 |
rhdedgar/openshift-tools | openshift/installer/vendored/openshift-ansible-3.7.0/roles/lib_openshift/src/ansible/oc_obj.py | 25 | 1253 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-branches
def main():
'''
ansible oc module for services
'''
module = AnsibleModule(
argument_spec=dict(
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
state=dict(default='present'... | apache-2.0 |
zulip/django | tests/string_lookup/models.py | 281 | 1533 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
def... | bsd-3-clause |
swcurran/tfrs | backend/api/models/UserViewModel.py | 1 | 1507 | """
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
... | apache-2.0 |
jbzdak/edx-platform | common/lib/capa/capa/tests/test_shuffle.py | 196 | 13736 | """Tests the capa shuffle and name-masking."""
import unittest
import textwrap
from . import test_capa_system, new_loncapa_problem
from capa.responsetypes import LoncapaProblemError
class CapaShuffleTest(unittest.TestCase):
"""Capa problem tests for shuffling and choice-name masking."""
def setUp(self):
... | agpl-3.0 |
blois/AndroidSDKCloneMin | ndk/prebuilt/linux-x86_64/lib/python2.7/test/test_funcattrs.py | 117 | 12749 | from test import test_support
import types
import unittest
class FuncAttrsTest(unittest.TestCase):
def setUp(self):
class F:
def a(self):
pass
def b():
return 3
self.f = F
self.fi = F()
self.b = b
def cannot_set_attr(self, obj, na... | apache-2.0 |
vanesa/kid-o | kido/admin/utils.py | 1 | 3921 | # -*- coding: utf-8 -*-
""" Flask-Admin utilities."""
from flask import abort, redirect, request, url_for
from flask_admin import AdminIndexView, expose
from flask_admin.base import MenuLink
from flask_admin.contrib.sqla import ModelView
from flask_login import current_user
from functools import wraps
from kido impo... | bsd-3-clause |
rickshawman/twitter | venv/lib/python2.7/site-packages/pip/pep425tags.py | 79 | 11853 | """Generate and work with PEP 425 Compatibility Tags."""
from __future__ import absolute_import
import re
import sys
import warnings
import platform
import logging
import ctypes
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distut... | gpl-3.0 |
wdwvt1/qiime | scripts/filter_fasta.py | 12 | 7969 | #!/usr/bin/env python
# File created on 18 May 2010
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Greg Caporaso", "Jens Reeder", "Yoshiki Vazquez Baeza"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__e... | gpl-2.0 |
flavour/eden | modules/feedparser5213.py | 9 | 159822 | """Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit https://code.google.com/p/feedparser/ for the latest version
Visit http://packages.python.org/feedparser/ for the latest documentation
Required: Python 2.4 or later
Recommended: iconv_codec <http://cjkpython.i18n.org... | mit |
takis/django | tests/managers_regress/models.py | 245 | 3566 | """
Various edge-cases for model managers.
"""
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
class OnlyFred(mo... | bsd-3-clause |
eepgwde/pyeg0 | gmus/GMus0.py | 1 | 1699 | ## @file GMus0.py
# @brief Application support class for the Unofficial Google Music API.
# @author weaves
#
# @details
# This class uses @c gmusicapi.
#
# @note
# An application support class is one that uses a set of driver classes
# to provide a set of higher-level application specific methods.
#
# @see
# https://g... | gpl-3.0 |
nkhuyu/bazel | third_party/py/mock/setup.py | 91 | 2134 | #! /usr/bin/env python
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
from mock import __version__
import os
NAME = 'mock'
MODULES = ['mock']
DESCRIPTION = 'A Python Mocking and Patching Library for Testing'
URL = "... | apache-2.0 |
samfpetersen/gnuradio | gr-zeromq/examples/python/server.py | 27 | 4700 | #
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio.
#
# This 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 version.
#
# Thi... | gpl-3.0 |
Asana/mypipe | avro/lang/c/jansson/doc/conf.py | 58 | 7023 | # -*- coding: utf-8 -*-
#
# Jansson documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 5 21:47:20 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... | apache-2.0 |
marcosmodesto/django-testapp | django/django/contrib/gis/geos/prototypes/geom.py | 102 | 4430 | from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_sized_string, check_string, check_zero)
from django.contrib.gis.geos.prototypes.threadsafe import G... | bsd-3-clause |
bobobox/ansible | lib/ansible/modules/files/replace.py | 11 | 6445 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Evan Kaufman <evan@digitalflophouse.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 t... | gpl-3.0 |
captainpete/rethinkdb | test/memcached_workloads/multi_serial_mix.py | 29 | 3527 | #!/usr/bin/env python
# Copyright 2010-2012 RethinkDB, all rights reserved.
from __future__ import print_function
import sys, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import multiprocessing, time, pickle
import memcached_workload_common, serial_mix
from v... | agpl-3.0 |
mdmueller/ascii-profiling | parallel.py | 1 | 4245 | import timeit
import time
from astropy.io import ascii
import pandas
import numpy as np
from astropy.table import Table, Column
from tempfile import NamedTemporaryFile
import random
import string
import matplotlib.pyplot as plt
import webbrowser
def make_table(table, size=10000, n_floats=10, n_ints=0, n_strs=0, float_... | mit |
patriciohc/carga-de-xls-a-MySQL | Choose_file.py | 1 | 3639 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Choose_file.ui'
#
# Created: Sat Oct 17 15:55:19 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except At... | apache-2.0 |
Endika/partner-contact | partner_firstname/tests/test_name.py | 25 | 3241 | # -*- coding: utf-8 -*-
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual... | agpl-3.0 |
evancich/apm_motor | mk/PX4/Tools/genmsg/test/test_genmsg_srvs.py | 216 | 3233 | # 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 |
benssson/flatbuffers | python/flatbuffers/compat.py | 19 | 1465 | # Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
ppanczyk/ansible | lib/ansible/modules/network/f5/bigip_user.py | 10 | 18341 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUM... | gpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/tests/unit/emr/test_emr_responses.py | 98 | 17266 | # Copyright (c) 2010 Jeremy Thurgood <firxen+boto@gmail.com>
#
# 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, mod... | mit |
x111ong/odoo | addons/base_import/models.py | 222 | 14243 | import csv
import itertools
import logging
import operator
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import psycopg2
from openerp.osv import orm, fields
from openerp.tools.translate import _
FIELDS_RECURSION_LIMIT = 2
ERROR_PREVIEW_BYTES = 200
_logger = logging.ge... | agpl-3.0 |
sgraham/nope | tools/telemetry/telemetry/image_processing/image_util_numpy_impl.py | 6 | 6585 | # Copyright 2014 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.
from __future__ import division
from telemetry.core import util
from telemetry.image_processing import histogram
from telemetry.image_processing import rgba... | bsd-3-clause |
Lujeni/ansible | lib/ansible/modules/cloud/docker/docker_config.py | 16 | 9206 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# 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': ['prev... | gpl-3.0 |
RitaLee79/android_kernel_xiaomi_armani-kk | 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 |
FusionSP/external_chromium_org_third_party_skia | tools/add_codereview_message.py | 83 | 1716 | #!/usr/bin/python2
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Add message to codereview issue.
This script takes a codereview issue number as its argument and a (possibly
multi-line) message on stdin. It appends the message... | bsd-3-clause |
ge0rgi/cinder | cinder/api/contrib/capabilities.py | 2 | 2657 | # Copyright (c) 2015 Hitachi Data Systems, 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
#
# U... | apache-2.0 |
aherlihy/mongo-python-driver | pymongo/client_options.py | 17 | 7755 | # Copyright 2014-2015 MongoDB, 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 |
NeuralProsthesisLab/unlock | unlock/analysis/test/test_data_bank.py | 1 | 3421 | # Copyright (c) James Percent and Unlock contributors.
# 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 l... | bsd-3-clause |
NL66278/OCB | addons/account/report/account_balance.py | 183 | 6162 | # -*- 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 |
jskew/gnuradio | gr-zeromq/python/zeromq/__init__.py | 47 | 1139 | #
# Copyright 2013 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 version.
#
#... | gpl-3.0 |
c0cky/mediathread | mediathread/djangosherd/api.py | 1 | 4549 | # pylint: disable-msg=R0904
from tastypie import fields
from tastypie.resources import ModelResource
from mediathread.api import UserResource, TagResource
from mediathread.assetmgr.models import Asset
from mediathread.djangosherd.models import SherdNote, DiscussionIndex
from mediathread.projects.models import ProjectN... | gpl-2.0 |
joariasl/odoo | addons/account_budget/wizard/account_budget_crossovered_report.py | 375 | 2089 | # -*- 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 |
jjmleiro/hue | desktop/core/ext-py/Django-1.6.10/tests/custom_managers_regress/models.py | 64 | 1192 | """
Regression tests for custom manager classes.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class RestrictedManager(models.Manager):
"""
A manager that filters out non-public instances.
"""
def get_queryset(self):
return super(RestrictedMana... | apache-2.0 |
x111ong/django | tests/auth_tests/test_views.py | 183 | 44561 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import os
import re
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.contrib.admin.models import LogEntry
from django.contrib.auth import REDIRECT_FIELD_NAME, S... | bsd-3-clause |
Ingenico-ePayments/connect-sdk-python2 | ingenico/connect/sdk/domain/definitions/fraugster_results.py | 2 | 1783 | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.data_object import DataObject
class FraugsterResults(DataObject):
__fraud_investigation_points = None
__fraud_score = None
@pro... | mit |
brianjgeiger/osf.io | api_tests/taxonomies/views/test_taxonomy_list.py | 15 | 4498 | import pytest
from django.db.models import BooleanField, Case, When
from api.base.settings.defaults import API_BASE
from osf.models import Subject
from osf_tests.factories import SubjectFactory
@pytest.mark.django_db
class TestTaxonomy:
@pytest.fixture(autouse=True)
def subject(self):
return Subjec... | apache-2.0 |
rtindru/django | django/contrib/gis/gdal/geomtype.py | 297 | 3228 | from django.contrib.gis.gdal.error import GDALException
from django.utils import six
class OGRGeomType(object):
"Encapulates OGR Geometry Types."
wkb25bit = -2147483648
# Dictionary of acceptable OGRwkbGeometryType s and their string names.
_types = {0: 'Unknown',
1: 'Point',
... | bsd-3-clause |
Farkal/kivy | kivy/uix/gridlayout.py | 12 | 14937 | '''
Grid Layout
===========
.. only:: html
.. image:: images/gridlayout.gif
:align: right
.. only:: latex
.. image:: images/gridlayout.png
:align: right
.. versionadded:: 1.0.4
The :class:`GridLayout` arranges children in a matrix. It takes the available
space and divides it into columns a... | mit |
fdslight/fdslight | freenet/handlers/tundev.py | 1 | 5566 | #!/usr/bin/env python3
import os, sys
import pywind.evtframework.handlers.handler as handler
import freenet.lib.fn_utils as fn_utils
import freenet.lib.simple_qos as simple_qos
try:
import fcntl
except ImportError:
pass
class tun_base(handler.handler):
__creator_fd = None
# 要写入到tun的IP包
___ip_pac... | bsd-2-clause |
nuodb/nuodb-django | test/auth/tests/tokens.py | 1 | 2747 | import sys
from datetime import date, timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
from django.utils import unittest... | bsd-3-clause |
Evervolv/android_external_chromium_org | chrome/common/extensions/docs/server2/subversion_file_system.py | 23 | 7618 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import posixpath
import traceback
import xml.dom.minidom as xml
from xml.parsers.expat import ExpatError
from appengine_url_fetcher impor... | bsd-3-clause |
sdague/home-assistant | homeassistant/scripts/ensure_config.py | 18 | 1344 | """Script to ensure a configuration file exists."""
import argparse
import asyncio
import os
import homeassistant.config as config_util
from homeassistant.core import HomeAssistant
# mypy: allow-untyped-calls, allow-untyped-defs
def run(args):
"""Handle ensure config commandline script."""
parser = argparse... | apache-2.0 |
joelddiaz/openshift-tools | ansible/roles/lib_zabbix/library/zbx_trigger.py | 13 | 8058 | #!/usr/bin/env python
'''
ansible module for zabbix triggers
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Zabbix trigger ansible module
#
#
# Copyright 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.
# ... | apache-2.0 |
JuliBakagianni/CEF-ELRC | lib/python2.7/site-packages/django_jenkins/tasks/run_pyflakes.py | 3 | 1798 | # -*- coding: utf-8 -*-
import os
import re
import sys
from pyflakes.scripts import pyflakes
from cStringIO import StringIO
from django_jenkins.functions import relpath
from django_jenkins.tasks import BaseTask, get_apps_locations
class Task(BaseTask):
def __init__(self, test_labels, options):
super(Task,... | bsd-3-clause |
pjdelport/django | tests/modeltests/update_only_fields/tests.py | 7 | 9587 | from __future__ import absolute_import
from django.db.models.signals import pre_save, post_save
from django.test import TestCase
from .models import Person, Employee, ProxyEmployee, Profile, Account
class UpdateOnlyFieldsTests(TestCase):
def test_update_fields_basic(self):
s = Person.objects.create(name... | bsd-3-clause |
sserrot/champion_relationships | venv/Lib/site-packages/pygments/styles/vim.py | 4 | 1976 | # -*- coding: utf-8 -*-
"""
pygments.styles.vim
~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by vim.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keywor... | mit |
darkleons/lama | addons/procurement/procurement.py | 44 | 15869 | # -*- 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 |
durden/dayonetools | dayonetools/services/habit_list.py | 1 | 10350 | """
This module provides a way to import data from the Habit List iPhone
application (http://habitlist.com/) into Day One Journal
(http://dayoneapp.com/) entries.
To use this module you must first do a manual export of your data from Habit
list. This can be done by the following:
- Open Habit List iPhone app
... | mit |
memtoko/django | django/template/loaders/cached.py | 20 | 3031 | """
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
"""
import hashlib
from django.template.base import Template, TemplateDoesNotExist
from django.utils.encoding import force_bytes
from .base import Loader as BaseLoader
class... | bsd-3-clause |
jakevdp/pelican-plugins | static_comments/static_comments.py | 72 | 1216 | # -*- coding: utf-8 -*-
import codecs
import logging
import markdown
import os
logger = logging.getLogger(__name__)
from pelican import signals
def initialized(pelican):
from pelican.settings import DEFAULT_CONFIG
DEFAULT_CONFIG.setdefault('STATIC_COMMENTS', False)
DEFAULT_CONFIG.setdefault('STATIC_COM... | agpl-3.0 |
log2timeline/dfvfs | dfvfs/vfs/apfs_file_entry.py | 2 | 8402 | # -*- coding: utf-8 -*-
"""The APFS file entry implementation."""
from dfdatetime import apfs_time as dfdatetime_apfs_time
from dfvfs.lib import definitions
from dfvfs.lib import errors
from dfvfs.path import apfs_path_spec
from dfvfs.vfs import file_entry
class APFSDirectory(file_entry.Directory):
"""File system... | apache-2.0 |
theflofly/tensorflow | tensorflow/python/keras/keras_parameterized.py | 10 | 12005 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
proversity-org/edx-platform | lms/djangoapps/class_dashboard/urls.py | 18 | 1499 | """
Class Dashboard API endpoint urls.
"""
from django.conf import settings
from django.conf.urls import url
import class_dashboard.views
import class_dashboard.dashboard_data
COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN
urlpatterns = [
# Json request data for metrics for entire course
url(r'^{}/all_sequen... | agpl-3.0 |
patrikryd/kernel | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
jezdez/kuma | vendor/packages/translate/storage/test_monolingual.py | 22 | 1421 | #!/usr/bin/env python
#
# -*- coding: utf-8 -*-
#
# These test classes should be used as super class of test classes for the
# classes that doesn't support the target property
from translate.storage import base, test_base
class TestMonolingualUnit(test_base.TestTranslationUnit):
UnitClass = base.TranslationUnit
... | mpl-2.0 |
ehfeng/pipet | pipet/api/views.py | 2 | 1357 | from flask import Blueprint, request
from pipet.sources import SCHEMANAME, Event, Group, Identity, Page
from pipet.sources.api.tasks import process_event, process_page
blueprint = Blueprint(SCHEMANAME, __name__)
@blueprint.route('/identity', methods=['PUT'])
def identity():
organization = Organization.query.fi... | mit |
gtcasl/eiger | Eiger.py | 1 | 20400 | #!/usr/bin/python
#
# \file Eiger.py
# \author Eric Anger <eanger@gatech.edu>
# \date July 6, 2012
#
# \brief Command line interface into Eiger modeling framework
#
# \changes Added more plot functionality; Benjamin Allan, SNL 5/2013
#
import argparse
import matplotlib.pyplot as plt
import numpy as np
import math
impo... | bsd-3-clause |
akhilari7/pa-dude | lib/python2.7/site-packages/pymongo/common.py | 9 | 18768 | # Copyright 2011-2015 MongoDB, 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... | mit |
gskachkov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py | 119 | 31715 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
beblount/Steer-Clear-Backend-Web | env/Lib/encodings/__init__.py | 406 | 5698 | """ Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to normalized encoding
names as defined in the normalize_encoding() function below, e.g.
'utf-8' must be implemented by the module 'utf_8.py'.
Ea... | mit |
vesellov/bitdust.devel | customer/data_sender.py | 1 | 14665 | #!/usr/bin/python
# data_sender.py
#
# Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io
#
# This file (data_sender.py) is part of BitDust Software.
#
# BitDust 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 Softwa... | agpl-3.0 |
ondra-novak/chromium.src | build/android/pylib/host_driven/setup.py | 48 | 6473 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Setup for instrumentation host-driven tests."""
import logging
import os
import sys
import types
from pylib.host_driven import test_case
from pylib.host... | bsd-3-clause |
agacek/camkes-tool | camkes/internal/version.py | 1 | 1813 | #
# Copyright 2014, NICTA
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_BSD2.txt" for details.
#
# @TAG(NICTA_BSD)
#
'''Versioning functionality. This computes a version identifier based on the
current source co... | bsd-2-clause |
greatmazinger/or-tools | examples/python/set_covering.py | 34 | 2650 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 |
mafiya69/sympy | sympy/polys/tests/test_injections.py | 126 | 1795 | """Tests for functions that inject symbols into the global namespace. """
from sympy.polys.rings import vring
from sympy.polys.fields import vfield
from sympy.polys.domains import QQ
from sympy.utilities.pytest import raises
# make r1 with call-depth = 1
def _make_r1():
return vring("r1", QQ)
# make r2 with cal... | bsd-3-clause |
ForgottenKahz/CloudOPC | venv/Lib/site-packages/sqlalchemy/testing/suite/test_update_delete.py | 203 | 1582 | from .. import fixtures, config
from ..assertions import eq_
from sqlalchemy import Integer, String
from ..schema import Table, Column
class SimpleUpdateDeleteTest(fixtures.TablesTest):
run_deletes = 'each'
__backend__ = True
@classmethod
def define_tables(cls, metadata):
Table('plain_pk', m... | mit |
ibrica/universe-server | play.py | 1 | 1073 | from multiprocessing import Process
import time
import gym
import universe
from universe.spaces.vnc_event import keycode
from envs import create_env
def start_game(model, env_name):
"""regular Python process, not using torch"""
p = Process(target=play_game, args=(model,env_name))
p.start()
# Don't wa... | mit |
m038/superdesk-content-api | content_api/errors.py | 6 | 1588 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
"""
A ... | agpl-3.0 |
alzamer2/crunchy-xml-decoder | crunchy-xml-decoder/unidecode/x083.py | 252 | 4643 | data = (
'Fu ', # 0x00
'Zhuo ', # 0x01
'Mao ', # 0x02
'Fan ', # 0x03
'Qie ', # 0x04
'Mao ', # 0x05
'Mao ', # 0x06
'Ba ', # 0x07
'Zi ', # 0x08
'Mo ', # 0x09
'Zi ', # 0x0a
'Di ', # 0x0b
'Chi ', # 0x0c
'Ji ', # 0x0d
'Jing ', # 0x0e
'Long ', # 0x0f
'[?] ', # 0x10
'Niao ', ... | gpl-2.0 |
vinodkc/spark | python/pyspark/ml/tests/test_training_summary.py | 15 | 25466 | #
# 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 |
chrishas35/django-travis-ci | tests/regressiontests/handlers/tests.py | 34 | 1232 | from django.conf import settings
from django.core.handlers.wsgi import WSGIHandler
from django.test import RequestFactory
from django.utils import unittest
class HandlerTests(unittest.TestCase):
def test_lock_safety(self):
"""
Tests for bug #11193 (errors inside middleware shouldn't leave
... | bsd-3-clause |
conwin/node-gyp | gyp/test/mac/gyptest-app.py | 85 | 1409 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that app bundles are built correctly.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.TestGyp(fo... | mit |
sandeepdsouza93/TensorFlow-15712 | tensorflow/examples/learn/hdf5_classification.py | 17 | 2201 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
droundy/deft | talks/colloquium/figs/plot-walls.py | 1 | 3242 | #!/usr/bin/python
# We need the following two lines in order for matplotlib to work
# without access to an X server.
from __future__ import division
import matplotlib
matplotlib.use('Agg')
import pylab, numpy, sys
xmax = 2.5
xmin = -0.4
def plotit(dftdata, mcdata):
dft_len = len(dftdata[:,0])
dft_dr = dftda... | gpl-2.0 |
iddqd1/django-cms | cms/test_utils/project/urls.py | 47 | 1646 | from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from cms.utils.compat.dj import is_installed
from cms.utils.conf import get_cms_setting
from cm... | bsd-3-clause |
vjraitila/alfred-issues | src/requests/packages/chardet/charsetprober.py | 3127 | 1902 | ######################## 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 |
michaelaye/vispy | examples/basics/scene/volume.py | 4 | 5162 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | bsd-3-clause |
ericzundel/pants | src/python/pants/backend/jvm/tasks/properties.py | 16 | 3411 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import re
from colle... | apache-2.0 |
AprilBrother/esptool | esptool.py | 1 | 28432 | #!/usr/bin/env python
#
# ESP8266 ROM Bootloader Utility
# https://github.com/themadinventor/esptool
#
# Copyright (C) 2014 Fredrik Ahlberg
#
# 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; eith... | gpl-2.0 |
silly-wacky-3-town-toon/SOURCE-COD | toontown/coghq/SellbotMegaFactoryLavaRoomFoyer_Action01.py | 7 | 8680 | from toontown.coghq.SpecImports import *
GlobalEntities = {1000: {'type': 'levelMgr',
'name': 'LevelMgr',
'comment': '',
'parentEntId': 0,
'cogLevel': 0,
'farPlaneDistance': 1500,
'modelFilename': 'phase_10/models/cashbotHQ/ZONE18a',
'wantDoors': 1},
1001: {'type... | apache-2.0 |
webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/pip/_vendor/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... | gpl-2.0 |
borosnborea/SwordGO_app | example/kivymap/.buildozer/android/app/_applibs/requests/packages/chardet/constants.py | 3008 | 1335 | ######################## 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... | gpl-3.0 |
phil-lopreiato/the-blue-alliance | tests/consts_tests/fcm/test_platform_priority.py | 3 | 1613 | import unittest2
from consts.fcm.platform_priority import PlatformPriority
from consts.fcm.platform_type import PlatformType
class TestPlatformPriority(unittest2.TestCase):
def test_validate_invalid(self):
with self.assertRaises(ValueError):
PlatformPriority.validate(2)
def test_validat... | mit |
homhei/glance | glance/glance_pull/lib/GlanceBattery.py | 2 | 3375 | #!/usr/bin/env python
#encode=utf-8
#vim: tabstop=4 shiftwidth=4 softtabstop=4
#Created on 2013-8-17
#Copyright 2013 nuoqingyun xuqifeng
import sys
# Somes libs depends of OS
is_BSD = sys.platform.find('bsd') != -1
is_Linux = sys.platform.startswith('linux')
is_Mac = sys.platform.startswith('darwin')
is... | apache-2.0 |
uclouvain/osis | base/migrations/0333_auto_20180820_1343.py | 2 | 1081 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-08-20 13:43
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0332_auto_20180816_1540'),
]
operations = ... | agpl-3.0 |
AnhellO/DAS_Sistemas | Ago-Dic-2017/Enrique Castillo/Ordinario/test/Lib/site-packages/django/core/validators.py | 7 | 18596 | import ipaddress
import os
import re
from urllib.parse import urlsplit, urlunsplit
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.functional import SimpleLazyObject
from django.utils.ipv6 import is_valid_ipv6_address
from django.utils.translati... | mit |
cgar/servo | tests/wpt/css-tests/css-text-3_dev/xhtml1print/reference/support/generate-segment-break-transformation-rules-tests.py | 324 | 4862 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests segment-break-transformation-rules-001 ~ 049 which
cover all possible combinations of characters at two sides of segment breaks.
More specifically, there are seven types of characters involve in these rules:
1. East Asian Full-width (F)... | mpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.