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 |
|---|---|---|---|---|---|
bolkedebruin/airflow | airflow/providers/vertica/hooks/vertica.py | 16 | 1616 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
MaximeBiset/care4care | main/migrations/0040_auto_20141205_1736.py | 1 | 12414 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import multiselectfield.db.fields
import django.core.validators
import re
class Migration(migrations.Migration):
dependencies = [
('main', '0039_merge'),
]
operations = [
migrations.... | agpl-3.0 |
MIPS/external-chromium_org | third_party/protobuf/python/google/protobuf/internal/descriptor_database_test.py | 213 | 2872 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
montanapr/Plugin.Video.Mercy | servers/rapidvideo.py | 34 | 2249 | # -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para rapidvideo
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from co... | gpl-2.0 |
benjaminrigaud/django | django/core/serializers/base.py | 181 | 6813 | """
Module for abstract serializer/unserializer base classes.
"""
import warnings
from django.db import models
from django.utils import six
from django.utils.deprecation import RemovedInDjango19Warning
class SerializerDoesNotExist(KeyError):
"""The requested serializer was not found."""
pass
class Serializ... | bsd-3-clause |
SolusOS-discontinued/pisi | scripts/make-changelog.py | 4 | 2280 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import urllib2
import piksemel
first_revision = "27898"
accounts_url = "http://svn.pardus.org.tr/uludag/trunk/common/accounts"
authors = {}
def get_author_name_mail(author):
if not authors:
accounts = urllib2.urlopen(accounts_url)
for line in a... | gpl-2.0 |
divergentdave/inspectors-general | inspectors/treasury.py | 2 | 15149 | #!/usr/bin/env python
import datetime
import logging
import os
import re
from urllib.parse import urljoin, unquote
from utils import utils, inspector, admin
# https://www.treasury.gov/about/organizational-structure/ig/Pages/audit_reports_index.aspx
archive = 2005
# options:
# standard since/year options for a yea... | cc0-1.0 |
martinbalsam/timing-rp | timingrp/sanit.py | 1 | 2984 | import re
import argparse
"""
This script sanitize the raw data experted from "Timing.app",
it adds the proper double quotes around the "Path" attribute,
and it removes unwanted double quotes inside the "Path" attribute,
that may yield an unwanted escape of the field.
--- TODO ---
speedup:
as for now I'm iterating twi... | gpl-2.0 |
kirbyfan64/shedskin | examples/mandelbrot2_main.py | 6 | 3732 | # interactive mandelbrot program
# copyright Tony Veijalainen, tony.veijalainen@gmail.com
try:
import tkinter as tk
except ImportError:
import Tkinter as tk
import os
from PIL import Image, ImageTk
from mandelbrot2 import mandel_file
main_file = 'm-1 0i_3.5_240.bmp'
class MandelbrotTk(tk.Tk):
def __init... | gpl-3.0 |
curtisstpierre/django | tests/migrations/test_state.py | 96 | 43522 | from django.apps.registry import Apps
from django.contrib.contenttypes.fields import GenericForeignKey
from django.db import models
from django.db.migrations.exceptions import InvalidBasesError
from django.db.migrations.operations import (
AddField, AlterField, DeleteModel, RemoveField,
)
from django.db.migrations.... | bsd-3-clause |
TribeMedia/sky_engine | mojo/python/tests/generation_unittest.py | 10 | 1148 | # 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.
import mojo_unittest
from mojo_bindings import reflection
from mojo_bindings import interface_reflection
class GenerationTest(mojo_unittest.MojoTestCase):
... | bsd-3-clause |
NunoEdgarGub1/kubernetes | third_party/htpasswd/htpasswd.py | 897 | 5219 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2013 Edgewall Software
# Copyright (C) 2008 Eli Carter
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edge... | apache-2.0 |
endlessm/chromium-browser | third_party/pexpect/FSM.py | 171 | 14248 | #!/usr/bin/env python
"""This module implements a Finite State Machine (FSM). In addition to state
this FSM also maintains a user defined "memory". So this FSM can be used as a
Push-down Automata (PDA) since a PDA is a FSM + memory.
The following describes how the FSM works, but you will probably also need to
see the... | bsd-3-clause |
hkariti/mopidy | tests/local/test_library.py | 12 | 23197 | from __future__ import absolute_import, unicode_literals
import os
import shutil
import tempfile
import unittest
import mock
import pykka
from mopidy import core, exceptions
from mopidy.local import actor, json
from mopidy.models import Album, Artist, Image, Track
from tests import path_to_data_dir
# TODO: updat... | apache-2.0 |
chromium/chromium | build/android/gyp/native_libraries_template.py | 7 | 1781 | # Copyright 2019 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.
NATIVE_LIBRARIES_TEMPLATE = """\
// This file is autogenerated by
// build/android/gyp/write_native_libraries_java.py
// Please do not change its content... | bsd-3-clause |
shobhitmishra/CodingProblems | LeetCode/Session3/BinaryTreePaths.py | 1 | 1149 | from typing import List
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def binaryTreePaths(self, root: TreeNode) -> List[str]:
result = []
if not root:
return result
self.binaryTreePathsHelper(ro... | mit |
cntnboys/410Lab6 | build/django/django/contrib/admin/helpers.py | 53 | 14115 | from __future__ import unicode_literals
from django import forms
from django.contrib.admin.utils import (flatten_fieldsets, lookup_field,
display_for_field, label_for_field, help_text_for_field)
from django.contrib.admin.templatetags.admin_static import static
from django.core.exceptions import ObjectDoesNotExist
... | apache-2.0 |
Kobzol/kaira | ptp/gencpp/simrun.py | 12 | 3084 | #
# Copyright (C) 2013 Stanislav Bohm
#
# This file is part of Kaira.
#
# Kaira is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License, or
# (at your option) any later versi... | gpl-3.0 |
renaelectronics/linuxcnc | lib/python/gladevcp/hal_meter.py | 39 | 9330 | # vim: sts=4 sw=4 et
# GladeVcp Widgets
#
# Copyright (c) 2010 Pavel Shramov <shramov@mexmat.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at you... | gpl-2.0 |
ksmit799/Toontown-Source | toontown/building/DistributedKnockKnockDoor.py | 1 | 6420 | from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from KnockKnockJokes import *
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM
import DistributedAnimatedProp
from ... | mit |
yml/django-filer | filer/migrations/0001_initial.py | 36 | 13407 |
from south.db import db
from django.db import models
from filer.models import *
class Migration:
def forwards(self, orm):
# Adding model 'Image'
db.create_table('filer_image', (
('file_ptr', orm['filer.Image:file_ptr']),
('_height', orm['filer.Image:_height'])... | mit |
jakobworldpeace/scikit-learn | sklearn/ensemble/forest.py | 8 | 67993 | """Forest of trees-based ensemble methods
Those methods include random forests and extremely randomized trees.
The module structure is the following:
- The ``BaseForest`` base class implements a common ``fit`` method for all
the estimators in the module. The ``fit`` method of the base ``Forest``
class calls the ... | bsd-3-clause |
brian-yang/mozillians | vendor-local/lib/python/rest_framework/settings.py | 3 | 6369 | """
Settings for REST framework are all namespaced in the REST_FRAMEWORK setting.
For example your project's `settings.py` file might look like this:
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer',
'rest_framework.renderers.YAMLRenderer',
)
'DEFAULT... | bsd-3-clause |
karlgrz/karlgrz.com-plugins | github_activity/github_activity.py | 4 | 1827 | # -*- coding: utf-8 -*-
# NEEDS WORK
"""
Copyright (c) Marco Milanesi <kpanic@gnufunk.org>
Github Activity
---------------
A plugin to list your Github Activity
"""
from __future__ import unicode_literals, print_function
import logging
logger = logging.getLogger(__name__)
from pelican import signals
class GitHub... | agpl-3.0 |
k-nut/AMPds | the_cloud/web/obvius.log.reading.py | 2 | 2475 | # Copyright (C) 2012 Stephen Makonin. All Right Reserved.
import sys, os, cgi, gzip, traceback
from lib_config_msh import *
from lib_obvius import *
filepath = ""
# exit with unauthorized error
def unauth():
print "Status: 401 Access Denied"
print
sys.exit(0)
# exit with fail
def fail(reason):
print... | mit |
cs564/heron | integration-test/src/python/integration_test/topology/global_grouping/global_grouping.py | 8 | 1102 | # copyright 2016 twitter. 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 agree... | apache-2.0 |
Peddle/hue | desktop/core/ext-py/python-ldap-2.3.13/Lib/ldapurl.py | 44 | 11503 | """
ldapurl - handling of LDAP URLs as described in RFC 4516
See http://www.python-ldap.org/ for details.
\$Id: ldapurl.py,v 1.45 2010/05/07 08:15:47 stroeder Exp $
Python compability note:
This module only works with Python 2.0+ since
1. string methods are used instead of module string and
2. list comprehensions ar... | apache-2.0 |
dslomov/intellij-community | plugins/hg4idea/testData/bin/hgext/graphlog.py | 93 | 2081 | # ASCII graph log extension for Mercurial
#
# Copyright 2007 Joel Rosdahl <joel@rosdahl.net>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''command to view revision graphs from a shell
This extension adds a --graph option to ... | apache-2.0 |
jsakamoto/selenium | py/test/selenium/webdriver/common/window_tests.py | 7 | 6445 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
uzgit/ardupilot | mk/VRBRAIN/Tools/genmsg/doc/conf.py | 51 | 8929 | # -*- coding: utf-8 -*-
#
# genmsg documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 14 07:48:35 2011.
#
# 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.
... | gpl-3.0 |
ryanjmccall/nupic | tests/swarming/nupic/swarming/experiments/simple_cla_multistep/permutations.py | 4 | 5228 | # ----------------------------------------------------------------------
# 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 |
albertjan/pypyjs-presentation | assets/js/pypy.js-0.3.1/lib/modules/test/test_py_compile.py | 105 | 1744 | import imp
import os
import py_compile
import shutil
import tempfile
import unittest
from test import test_support
class PyCompileTests(unittest.TestCase):
def setUp(self):
self.directory = tempfile.mkdtemp()
self.source_path = os.path.join(self.directory, '_test.py')
self.pyc_path = self... | unlicense |
dslomov/bazel-windows | third_party/py/gflags/gflags2man.py | 407 | 18864 | #!/usr/bin/env python
# Copyright (c) 2006, 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 l... | apache-2.0 |
pinterb/st2 | st2common/st2common/util/jinja.py | 2 | 2074 | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | apache-2.0 |
MiLk/ansible | test/sanity/validate-modules/test_validate_modules_regex.py | 162 | 2807 | #!/usr/bin/env python
# This is a standalone test for the regex inside validate-modules
# It is not suitable to add to the make tests target because the
# file under test is outside the test's sys.path AND has a hyphen
# in the name making it unimportable.
#
# To execute this by hand:
# 1) cd <checkoutdir>
# 2) so... | gpl-3.0 |
maxalbert/ansible | contrib/inventory/linode.py | 145 | 11235 | #!/usr/bin/env python
'''
Linode external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
Linode using the Chube library.
NOTE: This script assumes Ansible is being executed where Chube is already
installed and has a valid config at ~/.chube... | gpl-3.0 |
revmischa/boto | tests/integration/support/test_layer1.py | 135 | 3029 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | mit |
resba/gnuradio | gnuradio-core/src/python/gnuradio/gr/gr_threading_23.py | 94 | 21922 | """Thread module emulating a subset of Java's threading model."""
# This started life as the threading.py module of Python 2.3
# It's been patched to fix a problem with join, where a KeyboardInterrupt
# caused a lock to be left in the acquired state.
import sys as _sys
try:
import thread
except ImportError:
... | gpl-3.0 |
rhinstaller/blivet | blivet/autopart.py | 1 | 20576 | #
# Copyright (C) 2009-2015 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 in the hope that it wi... | lgpl-2.1 |
5n1p/appengine-overheard-python | gaeunit.py | 5 | 18637 | #!/usr/bin/env python
'''
GAEUnit: Google App Engine Unit Test Framework
Usage:
1. Put gaeunit.py into your application directory. Modify 'app.yaml' by
adding the following mapping below the 'handlers:' section:
- url: /test.*
script: gaeunit.py
2. Write your own test cases by extending unittest.TestCas... | apache-2.0 |
zeehio/META-SHARE | metashare/sync/management/commands/synchronize.py | 6 | 11826 | """
Management utility to trigger synchronization.
"""
import logging
import socket
from metashare import settings
from metashare.sync.sync_utils import login, get_inventory, get_full_metadata, \
remove_resource
from django.core.management.base import BaseCommand
from optparse import make_option
from metashare.sto... | bsd-3-clause |
gvb/odoo | addons/account/res_config.py | 200 | 25453 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
inclement/vispy | examples/basics/gloo/animate_images_slice.py | 18 | 4149 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: Irwin Zaid
# vispy: gallery 2
"""
Example demonstrating a 3D Texture. The volume contains noise that
is smoothed in the z-direction. Shown is one slice throught that volume
to give the effect of "morphing" noise.
"""
import numpy as np
from vispy.util.transform... | bsd-3-clause |
mdjurfeldt/nest-simulator | pynest/nest/tests/test_sp/test_get_sp_status.py | 5 | 3009 | # -*- coding: utf-8 -*-
#
# test_get_sp_status.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Lice... | gpl-2.0 |
wavelets/ThinkStats2 | code/moments.py | 1 | 1149 | """This file contains code for use with "Think Bayes",
by Allen B. Downey, available from greenteapress.com
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import math
import thinkstats2
def RawMoment(xs, k):
return sum(x**k for x in xs) / float(len(xs))
def CentralMo... | gpl-3.0 |
flavour/Turkey | modules/s3db/delphi.py | 12 | 22626 | # -*- coding: utf-8 -*-
""" Sahana Eden Delphi Decision Maker Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
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 ... | mit |
shinglyu/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_msgutil.py | 413 | 54959 | #!/usr/bin/env python
#
# 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... | mpl-2.0 |
tashaxe/Red-DiscordBot | lib/pip/__init__.py | 328 | 11348 | #!/usr/bin/env python
from __future__ import absolute_import
import locale
import logging
import os
import optparse
import warnings
import sys
import re
# 2016-06-17 barry@debian.org: urllib3 1.14 added optional support for socks,
# but if invoked (i.e. imported), it will issue a warning to stderr if socks
# isn't a... | gpl-3.0 |
keeeener/nicki | platform/external/webkit/Tools/Scripts/webkitpy/tool/steps/checkstyle.py | 15 | 2811 | # 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 th... | gpl-2.0 |
jjscarafia/odoo | addons/mrp/wizard/__init__.py | 374 | 1199 | # -*- 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 |
orgito/ansible | lib/ansible/modules/utilities/logic/wait_for_connection.py | 14 | 3059 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.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_v... | gpl-3.0 |
FusionSP/android_external_chromium_org | tools/telemetry/telemetry/unittest/json_results.py | 27 | 8638 | # 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.
import functools
import json
import re
import time
import unittest
import urllib2
# TODO(dpranke): This code is largely cloned from, and redundant with,
# ... | bsd-3-clause |
factorlibre/OCB | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/gui.py | 382 | 31513 | ##########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gener... | agpl-3.0 |
skirsdeda/django | django/contrib/flatpages/models.py | 35 | 1531 | from __future__ import unicode_literals
from django.db import models
from django.contrib.sites.models import Site
from django.core.urlresolvers import get_script_prefix
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import iri_to_uri, python_2_unicode_compatible
@python_2_unicode_... | bsd-3-clause |
agustinhenze/nikola.debian | nikola/plugins/command/check.py | 3 | 16206 | # -*- coding: utf-8 -*-
# Copyright © 2012-2015 Roberto Alsina and others.
# 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 t... | mit |
2014c2g5/2014c2 | exts/w2/static/Brython2.0.0-20140209-164925/Lib/linecache.py | 785 | 3864 | """Cache lines from files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""
import sys
import os
import tokenize
__all__ = ["getline", "clearcache", "checkcache"]
def getline(filename, lineno, module_globa... | gpl-2.0 |
bclau/nova | nova/objects/base.py | 4 | 21053 | # Copyright 2013 IBM Corp.
#
# 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 agree... | apache-2.0 |
yashu-seth/networkx | networkx/algorithms/coloring/tests/test_coloring.py | 24 | 10511 | # -*- coding: utf-8 -*-
"""Greedy coloring test suite.
Run with nose: nosetests -v test_coloring.py
"""
__author__ = "\n".join(["Christian Olsson <chro@itu.dk>",
"Jan Aagaard Meier <jmei@itu.dk>",
"Henrik Haugbølle <hhau@itu.dk>",
"Jake VanderPla... | bsd-3-clause |
shinigota/dagpi_splendor | SplendorCode/src/mvc/Display.py | 1 | 32173 | from tkinter import *
from src.element.Card import Card
from src.element.ResourceType import ResourceType
from src.game.GameState import GameState
from src.mvc.EventType import EventType
from src.mvc.GameBoard import GameBoard
from src.mvc.GameRules import GameRules
from src.player.AI import AI
import time
class Displ... | gpl-3.0 |
guillaume-philippon/aquilon | lib/aquilon/worker/commands/compile_hostname.py | 2 | 1769 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | apache-2.0 |
thejinchao/moboair_mosquitto | test/lib/03-publish-c2b-qos2.py | 19 | 3173 | #!/usr/bin/env python
# Test whether a client sends a correct PUBLISH to a topic with QoS 2.
# The client should connect to port 1888 with keepalive=60, clean session set,
# and client id publish-qos2-test
# The test will send a CONNACK message to the client with rc=0. Upon receiving
# the CONNACK the client should v... | bsd-3-clause |
raags/ansible-modules-core | cloud/openstack/os_networks_facts.py | 30 | 4248 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... | gpl-3.0 |
tellesnobrega/horizon | openstack_dashboard/dashboards/project/volumes/test.py | 29 | 3468 | # Copyright 2012 Nebula, 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 agree... | apache-2.0 |
pankeshang/django-allauth | allauth/socialaccount/providers/stackexchange/views.py | 77 | 1315 | import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from allauth.socialaccount.providers import registry
from .provider import S... | mit |
nrc/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/filters/lint.py | 979 | 4306 | from __future__ import absolute_import, division, unicode_literals
from gettext import gettext
_ = gettext
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
... | mpl-2.0 |
bennyhat/me-benbrewer-academic-thesis-ns-3 | src/wifi/bindings/modulegen__gcc_LP64.py | 10 | 765133 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
CINPLA/exana | exana/tracking/fields.py | 1 | 32391 | import numpy as np
def spatial_rate_map(x, y, t, spike_train, binsize=0.01, box_xlen=1,
box_ylen=1, mask_unvisited=True, convolve=True,
return_bins=False, smoothing=0.02):
"""Divide a 2D space in bins of size binsize**2, count the number of spikes
in each bin and divi... | gpl-3.0 |
xindus40223115/2015cda_g1 | static/Brython3.1.1-20150328-091302/Lib/_abcoll.py | 688 | 5155 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... | gpl-3.0 |
msduketown/xbmc | tools/EventClients/lib/python/ps3/keymaps.py | 245 | 2329 | # -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
... | gpl-2.0 |
rpmcpp/Audacity | lib-src/lv2/sord/waflib/Configure.py | 147 | 9872 | #! /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 os,shlex,sys,time
from waflib import ConfigSet,Utils,Options,Logs,Context,Build,Errors
try:
from urllib import request
except ImportError:
from urllib import urlopen
... | gpl-2.0 |
40223137/w1717 | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/locals.py | 603 | 1141 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License... | gpl-3.0 |
btovar/cctools | apps/wq_hypersweep/test.py | 1 | 1690 | from work_queue import *
import sys
def compose_task(i,j):
id = (i-1)*20+j
d_rate = i*0.05
r_blok = j
outfile = "results%d.csv" % id
command = "./script.sh results%d.csv %f %d" % (id,d_rate,r_blok)
t = Task(command)
t.specify_file("env.tar.gz", "env.tar.gz", WORK_QUEUE_INPUT, cache=True)
t.specify_file("dat... | gpl-2.0 |
dvitme/odoomrp-wip | mrp_production_simulated_capacity/models/mrp_production.py | 11 | 1393 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program 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... | agpl-3.0 |
Pluto-tv/chromium-crosswalk | third_party/typ/typ/tests/test_case_test.py | 84 | 1908 | # Copyright 2014 Dirk Pranke. 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... | bsd-3-clause |
michelp/pybladeRF | bladeRF/_cffi.py | 2 | 1811 | import os
import inspect
from functools import wraps
from cffi import FFI
lib = None
ffi = FFI()
ffi.cdef('const char * bladerf_strerror(int error);')
ffi.cdef("""
#define BLADERF_ERR_UNEXPECTED ...
#define BLADERF_ERR_RANGE ...
#define BLADERF_ERR_INVAL ...
#define BLADERF_ERR_MEM ...
#define BLADERF_ERR_IO ...
#de... | gpl-3.0 |
jhseu/tensorflow | tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/basic.py | 1 | 2547 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
wnt-zhp/hufce | django/db/models/sql/subqueries.py | 87 | 8259 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.core.exceptions import FieldError
from django.db.models.fields import DateField, FieldDoesNotExist
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures import Date
from django.db.models... | gpl-3.0 |
anak10thn/graphics-dojo-qt5 | dragmove/dragmovecharm.py | 1 | 3229 | #############################################################################
##
## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
## Contact: Qt Software Information (qt-info@nokia.com)
##
## This file is part of the Graphics Dojo project on Qt Labs.
##
## This file may be used under the terms of th... | gpl-2.0 |
Workday/OpenFrame | native_client_sdk/src/build_tools/tests/verify_filelist_test.py | 132 | 3854 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
BUILD_TOOLS_DIR = os.path.dirname(SCR... | bsd-3-clause |
julianwang/cinder | cinder/tests/unit/test_huawei_18000.py | 6 | 40275 | # Copyright (c) 2013 - 2014 Huawei Technologies Co., Ltd.
# 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.... | apache-2.0 |
dursk/django | django/contrib/gis/utils/ogrinfo.py | 564 | 1984 | """
This module includes some utility functions for inspecting the layout
of a GDAL data source -- the functionality is analogous to the output
produced by the `ogrinfo` utility.
"""
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.geometries import GEO_CLASSES
def ogrinfo(data_source, num... | bsd-3-clause |
JackMorris/CaiusHallHelper | main.py | 1 | 1768 | import sys
from datetime import date, timedelta
from configuration import Configuration
from service import raven_service, email_service
def main():
configuration_file_path = sys.argv[1]
configuration = Configuration(configuration_file_path)
_authenticate_services(configuration)
_make_user_bookings(co... | mit |
hehongliang/tensorflow | tensorflow/python/ops/linalg/linear_operator_diag.py | 12 | 9235 | # 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 |
pombredanne/pytype | pytype/tests/test_attributes.py | 1 | 2408 | """Test instance and class attributes."""
from pytype.tests import test_inference
class TestAttributes(test_inference.InferenceTest):
"""Tests for attributes."""
def testSimpleAttribute(self):
with self.Infer("""
class A(object):
def method1(self):
self.a = 3
def method2(self... | apache-2.0 |
ngokevin/zamboni | mkt/developers/tests/test_views_versions.py | 2 | 30543 | import datetime
import os
from django.conf import settings
import mock
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
import amo
import amo.tests
from amo.tests import req_factory_factory
from mkt.comm.models import CommunicationNote
from mkt.constants.applications import DEVICE_TYPES
from mkt.dev... | bsd-3-clause |
inasafe/inasafe | safe/report/extractors/composer.py | 3 | 19646 | # coding=utf-8
"""Module used to generate context for composer related rendering.
Particular example are:
- Map rendering
- PDF rendering
- PNG rendering
"""
import datetime
from copy import deepcopy
from qgis.core import QgsProject
from safe.common.version import get_version
from safe.definitions.fields import ana... | gpl-3.0 |
svirusxxx/cjdns | node_build/dependencies/libuv/build/gyp/test/linux/gyptest-implicit-rpath.py | 252 | 1172 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that the implicit rpath is added only when needed.
"""
import TestGyp
import re
import subprocess
import sys
if sys.platform... | gpl-3.0 |
DolphinDream/sverchok | nodes/curve/nearest_point.py | 1 | 6929 | import numpy as np
import bpy
from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty
from mathutils import Matrix
from mathutils.kdtree import KDTree
import sverchok
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nestin... | gpl-3.0 |
blackzw/openwrt_sdk_dev1 | staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/unittest/runner.py | 109 | 6502 | """Running tests"""
import sys
import time
from . import result
from .signals import registerResult
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self,stream):
self.stream = stream
def __getattr__(self, at... | gpl-2.0 |
sandipbgt/nodeshot | nodeshot/networking/links/models/link.py | 5 | 12283 | from django.contrib.gis.db import models
from django.contrib.gis.geos import LineString
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
from django.db.models import Q
from django_hstore.fields import DictionaryField, ReferencesField
from netaddr import valid_... | gpl-3.0 |
jskew/gnuradio | gr-digital/python/digital/qa_diff_encoder.py | 57 | 3099 | #!/usr/bin/env python
#
# Copyright 2006,2007,2010,2012,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... | gpl-3.0 |
Soya93/Extract-Refactoring | python/lib/Lib/site-packages/django/contrib/messages/storage/__init__.py | 393 | 1183 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_storage(import_path):
"""
Imports the message storage class described by import_path, where
import_path is the full Python path to the class.
"""
try:
... | apache-2.0 |
methoxid/micropystat | tests/bytecode/pylib-tests/keyword.py | 761 | 2049 | #! /usr/bin/env python3
"""Keywords (from "graminit.c")
This file is automatically generated; please don't muck it up!
To update the symbols in this file, 'cd' to the top directory of
the python source tree after building the interpreter and run:
./python Lib/keyword.py
"""
__all__ = ["iskeyword", "kwlist"]
k... | mit |
GladeRom/android_external_chromium_org | tools/remove_stale_pyc_files.py | 106 | 1093 | #!/usr/bin/env python
# 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.
import os
import sys
def RemoveAllStalePycFiles(base_dir):
"""Scan directories for old .pyc files without a .py file and delete the... | bsd-3-clause |
lituan/tools | pisa/ccp4_pisa.py | 1 | 2552 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
run pisa to parse interfaces in PDBs
first install CCP4 and change the following variables
"""
import os
import sys
import subprocess
import cPickle as pickle
from multiprocessing import Pool
os.environ['CCP4_SCR'] = 'C:\\ccp4temp'
os.environ['CCP4I_TCLTK'] = 'C:\\CCP4... | cc0-1.0 |
adngdb/socorro | socorro/external/postgresql/fakedata.py | 3 | 37384 | #!/usr/bin/python
#
# Generate fake data for Socorro.
#
# Products, versions, number of days to generate data for, etc. are
# configurable, and test data is randomized using configurable probability
# but deterministic (within reason.)
import datetime
import uuid
import random
import json
crash_ids = []
def date_ra... | mpl-2.0 |
kisna72/django | django/template/defaulttags.py | 17 | 53746 | """Default tags used by the template system, available to all templates."""
from __future__ import unicode_literals
import os
import re
import sys
import warnings
from datetime import datetime
from itertools import cycle as itertools_cycle, groupby
from django.conf import settings
from django.utils import six, timezo... | bsd-3-clause |
Innovahn/odoo.old | addons/payment_ogone/tests/test_ogone.py | 430 | 9309 | # -*- coding: utf-8 -*-
from lxml import objectify
import time
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_ogone.controllers.main import OgoneController
from openerp.tools i... | agpl-3.0 |
scowcron/ImagesOfNetwork | images_of/entrypoints/audit_mods.py | 1 | 1450 | import click
from images_of import command, settings, Reddit
@command
@click.option('--print-mods', is_flag=True, help='List the non-default moderators for all subreddits')
def main(print_mods):
"""Find subs without mods and disenfranchised mods"""
mods = settings.DEFAULT_MODS
r = Reddit('Moderator ... | mit |
zhangpf/vbox | src/VBox/ValidationKit/common/constants/result.py | 4 | 1355 | # -*- coding: utf-8 -*-
# $Id$
"""
Test statuses.
"""
__copyright__ = \
"""
Copyright (C) 2012-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or modify it under the terms of the GN... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.