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 |
|---|---|---|---|---|---|
mozbhearsum/balrog | auslib/blobs/systemaddons.py | 1 | 4440 | from auslib.AUS import isForbiddenUrl
from auslib.blobs.base import Blob
from auslib.errors import BadDataError
class SystemAddonsBlob(Blob):
jsonschema = "systemaddons.yml"
def __init__(self, **kwargs):
Blob.__init__(self, **kwargs)
if "schema_version" not in self:
self["schema_v... | mpl-2.0 |
coreycb/horizon | openstack_dashboard/dashboards/project/networks/subnets/tables.py | 5 | 5494 | # Copyright 2012 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 |
sanyaade-teachings/gyp | test/intermediate_dir/gyptest-intermediate-dir.py | 100 | 1400 | #!/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 targets have independent INTERMEDIATE_DIRs.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('test.gyp', chdir=... | bsd-3-clause |
HaiFangHui/cf_log_parser | models.py | 1 | 2248 | import gzip
import re
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy import Column, Integer, String, DateTime, Text, func, desc
from config import config
db_spec = config.get('DATABASE', 'DB_SPEC')
en... | mit |
mindnervestech/mnrp | addons/l10n_be/__openerp__.py | 50 | 3750 | # -*- 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 |
SlimRoms/android_external_chromium_org | chrome/app/theme/PRESUBMIT.py | 121 | 1455 | # 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.
"""Presubmit script for Chromium theme resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... | bsd-3-clause |
SlimRoms/android_external_chromium_org | chrome/common/extensions/docs/server2/availability_finder_test.py | 7 | 15139 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import unittest
import api_schema_graph
from availability_finder import AvailabilityFinder, AvailabilityInfo
from ... | bsd-3-clause |
jaimahajan1997/sympy | sympy/polys/numberfields.py | 37 | 31789 | """Computational algebraic field theory. """
from __future__ import print_function, division
from sympy import (
S, Rational, AlgebraicNumber,
Add, Mul, sympify, Dummy, expand_mul, I, pi
)
from sympy.functions.elementary.exponential import exp
from sympy.functions.elementary.trigonometric import cos, sin
fr... | bsd-3-clause |
Hybrid-Cloud/conveyor | conveyor/conveyorheat/engine/lifecycle_plugin.py | 9 | 2138 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 |
samdoran/ansible | lib/ansible/modules/cloud/webfaction/webfaction_domain.py | 63 | 5507 | #!/usr/bin/python
#
# Create Webfaction domains and subdomains using Ansible and the Webfaction API
#
# ------------------------------------------
#
# (c) Quentin Stafford-Fraser 2015
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | gpl-3.0 |
zhreshold/mxnet | example/gluon/embedding_learning/data.py | 30 | 6391 | # 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 |
rogeriofalcone/treeio | core/migrations/0008_auto__add_field_attachment_filename.py | 1 | 21062 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
# encoding: 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):
#... | mit |
vlukes/sfepy | tests/test_normals.py | 4 | 2742 | from __future__ import absolute_import
import numpy as nm
from sfepy.base.testing import TestCommon
expected_normals = { # Need to be normalized!
'2_3' : nm.array([[ 0, -1],
[ 1, 1],
[-1, 0]], dtype=nm.float64),
'2_4' : nm.array([[ 0, -1],
[ ... | bsd-3-clause |
goliveirab/odoo | addons/mail/mail_followers.py | 168 | 12482 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/statsmodels-0.5.0-py2.7-linux-x86_64.egg/statsmodels/datasets/statecrime/data.py | 3 | 2985 | #! /usr/bin/env python
"""Statewide Crime Data"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """Public domain."""
TITLE = """Statewide Crime Data 2009"""
SOURCE = """
All data is for 2009 and was obtained from the American Statistical Abstracts except as indicated below.
"""
DESCRSHORT = """State ... | apache-2.0 |
jimsimon/sky_engine | testing/legion/tools/legion.py | 16 | 5772 | #!/usr/bin/env python
# Copyright 2015 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.
"""A helper module to run Legion multi-machine tests.
Example usage with 1 task machine:
$ testing/legion/tools/legion.py run \
--c... | bsd-3-clause |
DPaaS-Raksha/horizon | openstack_dashboard/dashboards/project/loadbalancers/tabs.py | 9 | 5153 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Big Switch Networks, 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... | apache-2.0 |
edevil/django | django/contrib/auth/middleware.py | 172 | 5116 | from django.contrib import auth
from django.contrib.auth import load_backend
from django.contrib.auth.backends import RemoteUserBackend
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import SimpleLazyObject
def get_user(request):
if not hasattr(request, '_cached_user'):
... | bsd-3-clause |
m7thon/tom | python/tests/sequence_test.py | 1 | 12007 | import unittest
import tom
class PlainPySequence:
"""Simple list of symbols: [o_0, ..., o_{N-1}]."""
def __init__(self, data):
if type(data) is list:
self.data = data
else:
self.data = list(range(data))
def __repr__(self):
return str(self.data)
def len... | mit |
alabarga/SocialLearning | SocialLearning/apps/learningobjects/management/commands/describe.py | 1 | 6166 | #-*- coding: UTF-8 -*-
from learningobjects.utils.search import *
from learningobjects.utils.parsers import *
from django.core.management.base import BaseCommand, CommandError
from learningobjects.models import *
from optparse import make_option
from learningobjects.utils import feedfinder
from learningobjects.manageme... | gpl-3.0 |
ClearwaterCore/gmock-upstream | gtest/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
SoteriousIdaofevil/xmlstar | mingw/libxml2-2.9.1/python/tests/xpathleak.py | 30 | 1563 | #!/usr/bin/python
import sys, libxml2
libxml2.debugMemory(True)
expect="""--> Invalid expression
--> xmlXPathEval: evaluation failed
--> Invalid expression
--> xmlXPathEval: evaluation failed
--> Invalid expression
--> xmlXPathEval: evaluation failed
--> Invalid expression
--> xmlXPathEval: evaluation failed
--> Inva... | mit |
ModdedPA/android_external_chromium_org | third_party/closure_linter/closure_linter/error_fixer.py | 135 | 17305 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | bsd-3-clause |
OpenTechFund/WebApp | addressfield/fields.py | 1 | 1809 | import json
from os import path
from django import forms
from django.core.exceptions import ValidationError
from .widgets import AddressWidget
basepath = path.dirname(__file__)
filepath = path.abspath(path.join(basepath, "static", "addressfield.min.json"))
with open(filepath, encoding='utf8') as address_data:
c... | gpl-2.0 |
40023256/W17test | wsgi.py | 1 | 27073 | # coding=utf-8
# 上面的程式內容編碼必須在程式的第一或者第二行才會有作用
################# (1) 模組導入區
# 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝
import cherrypy
# 導入 Python 內建的 os 模組, 因為 os 模組為 Python 內建, 所以無需透過 setup.py 安裝
import os
# 導入 random 模組
import random
import math
from cherrypy.lib.static import serve_file
# ... | agpl-3.0 |
RoboAvatar65/ChessRobot | algorithm.py | 1 | 5095 | ############################################################
###algorithm.py Chess Algorithm Engine ###
###Written by Nicholas Maselli ###
### ###
###Purpose: The Algorithm class creates a minimax tree ###
##... | mit |
tpazderka/pysaml2 | src/saml2/server.py | 1 | 27849 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""Contains classes and functions that a SAML2.0 Identity provider (IdP)
or attribute authority (AA) may use to conclude its tasks.
"""
import logging
import os
import importlib
import shelve
import threading
from saml2.eptid import EptidShelve, Eptid
from saml2.saml i... | bsd-2-clause |
okwasi/googlemock | scripts/generator/cpp/gmock_class.py | 82 | 7454 | #!/usr/bin/env python
#
# Copyright 2008 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... | bsd-3-clause |
zeha/multiapt | extlib/paramiko-1.7.3/paramiko/common.py | 1 | 4059 | # Copyright (C) 2003-2007 Robey Pointer <robey@lag.net>
#
# This file is part of paramiko.
#
# Paramiko 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 2.1 of the License, or (at your op... | mit |
netzkolchose/django-cms | cms/migrations/0002_auto_20140816_1918.py | 45 | 8472 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import cms.models.static_placeholder
import cms.models.fields
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import models, migrations
import django.utils.timezone
User = get_user_model()
user_model_label ... | bsd-3-clause |
sankhesh/VTK | Interaction/Widgets/Testing/Python/TestBoxWidget.py | 26 | 3843 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
=========================================================================
Program: Visualization Toolkit
Module: TestNamedColorsIntegration.py
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.... | bsd-3-clause |
Elettronik/SickRage | lib/requests/packages/urllib3/poolmanager.py | 137 | 16345 | from __future__ import absolute_import
import collections
import functools
import logging
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from .connectionpool import port_by_scheme
from .exceptions import LocationValueError, MaxRetryError, ProxyScheme... | gpl-3.0 |
lewismc/nutchpy | setup.py | 8 | 4958 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import os
import sys
from fnmatch import fnmatchcase
from distutils.core import Command, setup
from distutils.util import convert_path
import glob
import subprocess
import shutil
#------------------------------------------------... | bsd-2-clause |
ohmini/thaifoodapi | lib/django/contrib/sessions/models.py | 347 | 1298 | from __future__ import unicode_literals
from django.contrib.sessions.base_session import (
AbstractBaseSession, BaseSessionManager,
)
class SessionManager(BaseSessionManager):
use_in_migrations = True
class Session(AbstractBaseSession):
"""
Django provides full support for anonymous sessions. The s... | bsd-3-clause |
ehirt/odoo | addons/fetchmail/fetchmail.py | 6 | 15874 | # -*- 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 |
fafaman/django | django/contrib/gis/db/backends/base/models.py | 434 | 7111 | import re
from django.contrib.gis import gdal
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class SpatialRefSysMixin(object):
"""
The SpatialRefSysMixin is a class used by the database-dependent
SpatialRefSys objects to reduce redu... | bsd-3-clause |
blrm/openshift-tools | openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_utils/filter_plugins/openshift_hosted_filters.py | 44 | 1480 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Custom filters for use in openshift_hosted
'''
class FilterModule(object):
''' Custom ansible filters for use by openshift_hosted role'''
@staticmethod
def get_router_replicas(replicas=None, router_nodes=None):
''' This function will return the number... | apache-2.0 |
LearnEra/LearnEraPlaftform | common/lib/chem/chem/miller.py | 46 | 9239 | """ Calculation of Miller indices """
import numpy as np
import math
import fractions as fr
import decimal
import json
def lcm(a, b):
"""
Returns least common multiple of a, b
Args:
a, b: floats
Returns:
float
"""
return a * b / fr.gcd(a, b)
def segment_to_fraction(distanc... | agpl-3.0 |
aparo/django-nonrel | django/contrib/localflavor/at/forms.py | 71 | 2271 | """
AT-specific Form helpers
"""
import re
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import Field, RegexField, Select
from django.forms import ValidationError
re_ssn = re.compile(r'^\d{4} \d{6}')
class ATZipCodeField(RegexField):
"""
A form field that validates its inp... | bsd-3-clause |
40223236/w16b_test | static/Brython3.1.1-20150328-091302/Lib/_struct.py | 726 | 13787 | #
# This module is a pure Python version of pypy.module.struct.
# It is only imported if the vastly faster pypy.module.struct is not
# compiled in. For now we keep this version for reference and
# because pypy.module.struct is not ootype-backend-friendly yet.
#
# this module 'borrowed' from
# https://bitbucket.org/p... | agpl-3.0 |
laperry1/android_external_chromium_org | third_party/tlslite/scripts/tls.py | 109 | 10946 | #!/usr/bin/env python
# Authors:
# Trevor Perrin
# Marcelo Fernandez - bugfix and NPN support
# Martin von Loewis - python 3 port
#
# See the LICENSE file for legal information regarding use of this file.
from __future__ import print_function
import sys
import os
import os.path
import socket
import time
import ... | bsd-3-clause |
kustodian/ansible | lib/ansible/modules/network/f5/bigip_firewall_schedule.py | 24 | 21412 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, F5 Networks Inc.
# 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 |
mesoscloud/events | 0.6.1/docker.py | 2 | 6182 | import concurrent.futures
import datetime
import http.client
import json
import pickle
import select
import socket
__all__ = []
class HTTPConnection(http.client.HTTPConnection):
def __init__(self):
http.client.HTTPConnection.__init__(self, 'localhost')
def connect(self):
sock = socket.socke... | mit |
richtermondt/inithub-web | inithub/manager/views/interest_manager.py | 1 | 1278 | '''
@author: rtermondt
'''
from django.shortcuts import render_to_response
from django.template import RequestContext
from manager.models import Interest, Interests
from django.contrib.auth.decorators import login_required
@login_required()
def interest_manager(request):
system_message = None
if request.POST... | mit |
hassaanm/stock-trading | pybrain-pybrain-87c7ac3/examples/rl/environments/linear_fa/xor.py | 4 | 2197 | """ Toy example for RL with linear function approximation.
This illustrates how a 'AND'-state-space can be solved, but not
an 'XOR' space.
"""
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl.learners.valuebased.linearfa import Q_LinFA
from pybrain.rl.environments.classic.xor import XORTask
from pybrain.rl.... | apache-2.0 |
dmrtsvetkov/flowercoin | share/rpcuser/rpcuser.py | 115 | 1110 | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if len(sys.a... | mit |
trabacus-softapps/openerp-8.0-cc | openerp/addons/sale_crm/__openerp__.py | 5 | 2304 | # -*- 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 |
darcyliu/storyboard | boto/rds/dbsnapshot.py | 29 | 2730 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.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, modi... | mit |
probablytom/tomwallis.net | venv/lib/python2.7/site-packages/django/contrib/gis/measure.py | 93 | 12310 | # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
# 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,
#... | artistic-2.0 |
krux/adspygoogle | examples/adspygoogle/dfp/v201203/create_labels.py | 2 | 1778 | #!/usr/bin/python
#
# 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 b... | apache-2.0 |
compas-dev/compas | src/compas_rhino/conduits/faces.py | 1 | 2740 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
try:
basestring
except NameError:
basestring = str
from System.Drawing.Color import FromArgb
from Rhino.Geometry import Point3d
from compas.utilities import color_to_rgb
from compas_rhino.conduits.bas... | mit |
cym13/anime_verif | anime_verif.py | 1 | 4001 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Cédric Picard
#
# LICENSE
# 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) ... | gpl-3.0 |
openjck/kuma | scripts/clone_db.py | 2 | 10579 | #!/usr/bin/env python2.7
"""
This script performs all the steps needed to produce an anonymized DB dump:
* Produce a dump of the original DB
* Import the dump into a temporary DB
* Run anonymize.sql on the temporary DB
* Produce an anonymized dump from the temporary DB
* Drop the temporary DB
*... | mpl-2.0 |
insomnia-lab/calibre | src/calibre/ebooks/mobi/writer2/serializer.py | 9 | 14926 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import re, uni... | gpl-3.0 |
GbalsaC/bitnamiP | lms/djangoapps/instructor/tests/test_registration_codes.py | 42 | 12260 | """
Test for the registration code status information.
"""
from courseware.tests.factories import InstructorFactory
from xmodule.modulestore.tests.factories import CourseFactory
from django.utils.translation import ugettext as _
from shoppingcart.models import (
Invoice, CourseRegistrationCodeInvoiceItem, CourseReg... | agpl-3.0 |
hanlind/nova | nova/conf/service_token.py | 1 | 2573 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
marrow/schema | test/transform/test_boolean.py | 1 | 1445 | from marrow.schema.testing import TransformTest
from marrow.schema.transform.type import Boolean, boolean, WebBoolean, web_boolean
class TestBooleanNative(TransformTest):
transform = boolean.native
invalid = ('x', )
@property
def valid(self):
yield None, None
if boolean.none:
yield '', None
for ... | mit |
messi2050/android_kernel_huawei_msm8610 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
r-owen/TUI | TUI/Models/PermsModel.py | 1 | 1598 | #!/usr/bin/env python
"""A model of the state of the perms actor.
It contains instance variables that are KeyVariables
or sets of KeyVariables. All are directly associated
with status keywords.
History:
2003-12-10 ROwen
2003-12-17 ROwen Moved KeyVarFactory to RO.KeyVariable.
2004-05-18 ROwen Eliminated unused t... | bsd-3-clause |
tony810430/flink | flink-python/pyflink/fn_execution/beam/beam_operations_slow.py | 2 | 4637 | ################################################################################
# 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... | apache-2.0 |
viacoin/viacoin | test/functional/p2p_segwit.py | 1 | 92836 | #!/usr/bin/env python3
# Copyright (c) 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network."""
from test_framework.mininode import *
from test... | mit |
mihail911/nupic | nupic/regions/PictureSensorExplorers/block1DOF.py | 8 | 2863 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
SlimRemix/android_external_chromium_org | tools/telemetry/telemetry/core/browser_options.py | 26 | 12934 | # Copyright 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 copy
import logging
import optparse
import os
import shlex
import sys
from telemetry.core import browser_finder
from telemetry.core import profile_ty... | bsd-3-clause |
stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/raw/GL/ARB/matrix_palette.py | 9 | 1708 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | lgpl-3.0 |
j-be/wien-geodatenviewer-exporter | convert_coordinates.py | 1 | 1134 | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
from get_size import getSize
import os
# Fetch parameters from environment
start_major = int(os.environ['__VJ_START_MAJOR__'])
start_minor = int(os.environ['__VJ_START_MINOR__'])
# Specific do internet data
LINE_SHIFT=10
def getNext((major, minor) = (None, None), n = 0):... | mit |
wakatime/komodo-wakatime | components/wakatime/packages/pygments/lexers/dotnet.py | 7 | 27664 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dotnet
~~~~~~~~~~~~~~~~~~~~~~
Lexers for .net languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ... | bsd-3-clause |
ludmilamarian/invenio | invenio/modules/upgrader/upgrades/invenio_2013_03_18_aidPERSONIDDATA_last_updated.py | 15 | 1685 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 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 |
John-Boik/Principled-Societies-Project | leddaApp/static/brython/src/Lib/test/test_shlex.py | 113 | 5912 | import io
import shlex
import string
import unittest
from test import support
# The original test data set was from shellwords, by Hartmut Goebel.
data = r"""x|x|
foo bar|foo|bar|
foo bar|foo|bar|
foo bar |foo|bar|
foo bar bla fasel|foo|bar|bla|fasel|
x y z xxxx|x|y|z|xxxx|
\x bar|\|x|bar|
... | gpl-3.0 |
DNFcode/edx-platform | lms/djangoapps/courseware/tests/test_about.py | 4 | 19162 | """
Test the about xblock
"""
import datetime
import pytz
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from mock import patch
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from course_modes.models import CourseMode
from x... | agpl-3.0 |
UrLab/incubator | events/tests/test_forms.py | 1 | 1547 | from events.forms import EventForm
from datetime import datetime
import pytest
from users.models import User
@pytest.fixture(scope='function')
def user():
user = User.objects.create(username="test", email="test@test.be", first_name="Test", last_name="Test")
return user.id
@pytest.mark.django_db
def test_onl... | agpl-3.0 |
gerrive/horizon | openstack_dashboard/test/integration_tests/tests/test_host_aggregates.py | 14 | 2211 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
zacoxicompton/damnvid | ui/dMainFrame/dMainFrame.py | 12 | 32421 | # -*- coding: utf-8 -*-
from ..dUI import *
from dConverter import *
from dUpdater import *
from ..dPrefEditor import *
from ..dDoneDialog import *
from ..dAddURLDialog import *
from ..dAboutDialog import *
from ..dReportBug import *
from ..dBrowser import *
from ..dVideoHistory import *
from dMenubar import *
from dMa... | gpl-3.0 |
daviddupont69/CouchPotatoServer | libs/subliminal/api.py | 106 | 5646 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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... | gpl-3.0 |
mpetyx/palmdrop | venv/lib/python2.7/site-packages/html5lib/constants.py | 963 | 87346 | from __future__ import absolute_import, division, unicode_literals
import string
import gettext
_ = gettext.gettext
EOF = None
E = {
"null-character":
_("Null character in input stream, replaced with U+FFFD."),
"invalid-codepoint":
_("Invalid codepoint in stream."),
"incorrectly-placed-so... | apache-2.0 |
DVM-BITS-Pilani/BITS-BOSM-2015 | bosm2015/events/migrations/0001_initial.py | 2 | 1132 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import ckeditor.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='EventNew',
fields=[
('id... | gpl-2.0 |
ibinti/intellij-community | python/helpers/pycharm/django_manage_commands_provider/_xml.py | 78 | 6083 | # coding=utf-8
"""
This module exports information about manage commands and options from django to PyCharm.
Information is provided in XML (to prevent encoding troubles and simplify deserialization on java side).
Right after xml declaration, before root tag it contains following comment:
<!--jb pycharm data start-->
... | apache-2.0 |
redhat-openstack/django | django/contrib/formtools/tests/wizard/wizardtests/forms.py | 313 | 2203 | import os
import tempfile
from django import forms
from django.contrib.auth.models import User
from django.core.files.storage import FileSystemStorage
from django.forms.formsets import formset_factory
from django.forms.models import modelformset_factory
from django.http import HttpResponse
from django.template import ... | bsd-3-clause |
zaeleus/rust | src/grammar/testparser.py | 80 | 2564 | #!/usr/bin/env python
#
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
#... | apache-2.0 |
Yipit/pyeqs | tests/functional/test_connection.py | 1 | 1657 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sure import scenario
from pyeqs import QuerySet
from tests.helpers import prepare_data, cleanup_data, add_document
@scenario(prepare_data, cleanup_data)
def test_simple_search_with_host_string(context):
"""
Connect with host string
"""... | mit |
jawilson/home-assistant | homeassistant/components/camera/bloomsky.py | 28 | 2160 | """
Support for a camera of a BloomSky weather station.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/camera.bloomsky/
"""
import logging
import requests
from homeassistant.components.camera import Camera
from homeassistant.loader import get_componen... | mit |
jsoref/django | tests/postgres_tests/test_aggregates.py | 307 | 11910 | from django.contrib.postgres.aggregates import (
ArrayAgg, BitAnd, BitOr, BoolAnd, BoolOr, Corr, CovarPop, RegrAvgX,
RegrAvgY, RegrCount, RegrIntercept, RegrR2, RegrSlope, RegrSXX, RegrSXY,
RegrSYY, StatAggregate, StringAgg,
)
from django.db.models.expressions import F, Value
from django.test.utils import A... | bsd-3-clause |
xbot/alfred-pushbullet | lib/requests/packages/chardet/jisfreq.py | 3131 | 47315 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
SmartPeople/zulip | zerver/webhooks/stash/view.py | 13 | 1862 | # Webhooks for external integrations.
from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.models import get_client
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_er... | apache-2.0 |
ltsimps/metis_ros | vendor/googletest/googletest/scripts/common.py | 1180 | 2919 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the foll... | mit |
EarToEarOak/RTLSDR-Scanner | nsis/test_urls.py | 3 | 1992 | #
# rtlsdr_scan
#
# http://eartoearoak.com/software/rtlsdr-scanner
#
# Copyright 2012 - 2015 Al Brown
#
# A frequency scanning GUI for the OsmoSDR rtl-sdr library at
# http://sdr.osmocom.org/trac/wiki/rtl-sdr
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | gpl-3.0 |
projectexpert/pmis | analytic_resource_plan/wizard/resource_plan_line_make_purchase.py | 1 | 6559 | # Copyright 2019 LUXIM, Slovenia (Matjaž Mozetič)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
from odoo.tools.translate import _
from odoo.exceptions import ValidationError
class ResourcePlanLineMakePurchase(models.TransientModel):
_name = "res... | agpl-3.0 |
robbiet480/home-assistant | homeassistant/components/zestimate/sensor.py | 19 | 4377 | """Support for zestimate data from zillow.com."""
from datetime import timedelta
import logging
import requests
import voluptuous as vol
import xmltodict
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY, CONF_NAME
import homeassistant.helpers.c... | apache-2.0 |
batisteo/pasportaservo | blog/admin.py | 3 | 1434 | from django.contrib import admin
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from .models import Post
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
list_display = ['title', 'content', 'pub_date', 'published']
fields = (
('title', '... | agpl-3.0 |
ridfrustum/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/modeladmin/tests.py | 49 | 41260 | from datetime import date
from django import forms
from django.conf import settings
from django.contrib.admin.options import ModelAdmin, TabularInline, \
HORIZONTAL, VERTICAL
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.validation import validate
from django.contrib.admin.widgets impo... | gpl-3.0 |
liberatetheweb/blockedinrussia.org | code.py | 1 | 9146 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import web, bcrypt, redis, json, requests, dns.resolver, re, M2Crypto, cgi
from urlparse import urlsplit
from zbase62 import zbase62
web.config.debug = False
r_server = redis.Redis('localhost')
urls = (
'/', 'index',
'/check', 'check',
'/logout', 'logout',
'/registe... | cc0-1.0 |
heeraj123/oh-mainline | vendor/packages/whoosh/src/whoosh/compat.py | 17 | 1735 | import sys
if sys.version_info[0] < 3:
PY3 = False
def b(s):
return s
import cStringIO as StringIO
StringIO = BytesIO = StringIO.StringIO
callable = callable
integer_types = (int, long)
iteritems = lambda o: o.iteritems()
itervalues = lambda o: o.itervalues()
iterkeys = la... | agpl-3.0 |
fighterCui/L4ReFiascoOC | l4/pkg/python/contrib/Lib/multiprocessing/pool.py | 52 | 17699 | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2007-2008, R Oudkerk --- see COPYING.txt
#
__all__ = ['Pool']
#
# Imports
#
import threading
import Queue
import itertools
import collections
import time
from multiprocessing import Process, cpu_count, Ti... | gpl-2.0 |
JensTimmerman/pyopenssl | OpenSSL/test/util.py | 4 | 16826 | # Copyright (C) Jean-Paul Calderone
# Copyright (C) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Helpers for the OpenSSL test suite, largely copied from
U{Twisted<http://twistedmatrix.com/>}.
"""
import shutil
import traceback
import os, os.path
from tempfile import mktemp
from unittest import TestCase... | apache-2.0 |
esikachev/sahara-backup | sahara/service/edp/oozie/workflow_creator/shell_workflow.py | 9 | 1685 | # Copyright (c) 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
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 |
ahmetcemturan/SFACT | skeinforge_application/skeinforge_plugins/craft_plugins/chop.py | 8 | 10424 | """
This page is in the table of contents.
Chop is a script to chop a shape into svg slice layers.
==Settings==
===Add Layer Template to SVG===
Default is on.
When selected, the layer template will be added to the svg output, which adds javascript control boxes. So 'Add Layer Template to SVG' should be selected when... | agpl-3.0 |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/encodings/cp775.py | 272 | 34476 | """ Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict... | lgpl-3.0 |
chriskmanx/qmole | QMOLEDEV/boost_1_49_0/libs/python/pyste/src/Pyste/pyste.py | 54 | 14022 | # Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
Pyste version %s
Usage:
pyste [options] interface-files
where options are:
... | gpl-3.0 |
bearstech/ansible | test/units/modules/network/nxos/test_nxos_config.py | 47 | 4988 | #!/usr/bin/env python
#
# (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 ver... | gpl-3.0 |
sup95/zulip | zerver/views/webhooks/circleci.py | 11 | 1853 | # Webhooks for external integrations.
from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from six import text_type
from typing import Any
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, h... | apache-2.0 |
amitdubey90/lastdayasafreeman | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # Copyright (c) 2011 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.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.