repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
openweave/happy
bin/happy-node-edit.py
1
1893
#!/usr/bin/env python3 # # Copyright (c) 2021 Google LLC. # 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/LICE...
apache-2.0
LEDS/millennium-falcon
millenium_falcon_old/gestao/models.py
1
2775
from __future__ import unicode_literals from django.db import models class Parceiro(models.Model): #Na verdade é o Cliente com nome mais bonito nome_parceiro = models.CharField(max_length=255) nome_representante = models.CharField(max_length=255) telefone = models.CharField(max_length=255) email = ...
apache-2.0
rjsproxy/wagtail
wagtail/wagtailusers/views/groups.py
11
4499
from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.models import Group from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.views.decorators.vary import ...
bsd-3-clause
huanghao/mic
mic/3rdparty/pykickstart/handlers/fc5.py
10
1066
# # Chris Lumens <clumens@redhat.com> # # Copyright 2007 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. This program is distributed in the hope that it # will be usef...
gpl-2.0
HugoMMRabson/fonsa
src/my/installer/copyintomaple/die.py
1
1324
#!/usr/bin/python3 ''' Created on Aug 18, 2019 @author: johnrabsonjr ''' # potential colors are WHITE, PERIWINKLE, YELLOW, GREEN, VIOLET, BLUE, RED, BLACK import os from time import sleep from atxraspisettings import * os.system('systemctl stop atxraspihello') # Stop the shutdownirq.py script daemon setup_gpio()...
gpl-3.0
olomix/django-navbar
navbar/utils.py
3
2177
def _Qperm(user=None): from django.db.models.query import Q exQ = Q() if user is None or user.is_anonymous(): exQ = (Q(user_type__exact = 'A') | Q(user_type__exact = 'E')) & Q( groups__isnull=True) elif user.is_superuser: exQ = ~Q(user_type__exact = 'A') elif user.is_sta...
mit
wooster/django-topsoil
topsoil/middleware.py
1
2874
from django.conf import settings from django.contrib.auth.middleware import AuthenticationMiddleware from django.contrib.auth.models import AnonymousUser from django.utils.translation import ugettext as _ from oauth.oauth import OAuthError from oauth_provider.decorators import CheckOAuth from oauth_provider.utils impor...
bsd-3-clause
timsnyder/bokeh
examples/reference/models/multi_select_server.py
1
1279
## Bokeh server for MultiSelect import pandas as pd from bokeh.io import curdoc from bokeh.layouts import row from bokeh.models import ColumnDataSource from bokeh.models.widgets import MultiSelect from bokeh.plotting import figure x=[3,4,6,12,10,1] y=[7,1,3,4,1,6] label=['Red', 'Orange', 'Red', 'Orange','Red', 'Orange...
bsd-3-clause
wunderlins/learning
python/django/lib/python2.7/site-packages/setuptools/msvc9_support.py
429
2187
try: import distutils.msvc9compiler except ImportError: pass unpatched = dict() def patch_for_specialized_compiler(): """ Patch functions in distutils.msvc9compiler to use the standalone compiler build for Python (Windows only). Fall back to original behavior when the standalone compiler is no...
gpl-2.0
9929105/KEEP
keep_backend/vocab/vocab_to_mongo.py
2
3250
''' This is a standalone script that is to be used to load the vocab into the server's mongo database. This only needs to be run once, with the appropriate vocabulary on the filesystem as a one column flat list text file. ''' import re import sys import pymongo as pm from optparse import OptionParser ''' Thi...
mit
labase/vitollino
src/_spy/vitollino/__init__.py
1
1232
#! /usr/bin/env python # -*- coding: UTF8 -*- # Este arquivo é parte do programa Vittolino # Copyright 2011-2017 Carlo Oliveira <carlo@nce.ufrj.br>, # `Labase <http://labase.selfip.org/>`__; `GPL <http://is.gd/3Udt>`__. # # Vittolino é um software livre; você pode redistribuí-lo e/ou # modificá-lo dentro dos termos da ...
gpl-3.0
ytaben/cyphesis
rulesets/acorn/world/objects/buildings/FarmHouse1.py
2
2955
#This file is distributed under the terms of the GNU General Public license. #Copyright (C) 2001 Al Riddoch (See the file COPYING for details). from cyphesis.Thing import Thing from atlas import * from Vector3D import Vector3D # bbox = 8,8,2.5 # bmedian = 7.5,7.5,2.5 # offset = SW corner = -0.5,-0.5,0 class Farmhous...
gpl-2.0
mkrupcale/ansible
lib/ansible/modules/web_infrastructure/ejabberd_user.py
11
7573
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2013, Peter Sprygada <sprygada@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at ...
gpl-3.0
erdc-cm/air-water-vv
2d/numericalTanks/nonlinearWaves/ls_consrv_n.py
12
1901
from proteus.default_n import * from proteus import (StepControl, TimeIntegration, NonlinearSolvers, LinearSolvers, LinearAlgebraTools, NumericalFlux) import ls_consrv_p as physics from proteus import Context ct = ...
mit
bssthu/L5MapEditor
editor/main_window.py
1
18257
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Module : main.py # Author : bssthu # Project : L5MapEditor # Creation date : 2015-09-24 # Description : # import math import os import sqlite3 from PyQt5 import QtWidgets from PyQt5.QtCore import pyqtSlot, Qt, QObject from PyQt5.QtGui import QCur...
lgpl-3.0
neechbear/ansible
roles/zabbix-agent/library/zabbix_host2.py
1
18982
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, 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 # (...
bsd-3-clause
ajopanoor/hydra
tools/perf/scripts/python/syscall-counts.py
1996
1700
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
Changaco/oh-mainline
vendor/packages/twisted/twisted/runner/topfiles/setup.py
48
1292
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. try: from twisted.python.dist import setup, ConditionalExtension as Extension except ImportError: raise SystemExit("twisted.python.dist module not found. Make sure you " "have installed the Twisted core package before...
agpl-3.0
j0gurt/ggrc-core
src/ggrc_workflows/service_specs/steps/factories.py
7
2339
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> from behave import given from factory.fuzzy import FuzzyChoice import tests.ggrc.behave.factories as factories from ggrc import models from ggrc_workflows.models import ( Workflow, TaskGroup, Work...
apache-2.0
dmitriy-serdyuk/fuel
fuel/converters/mnist.py
18
6073
import gzip import os import struct import h5py import numpy from fuel.converters.base import fill_hdf5_file, check_exists MNIST_IMAGE_MAGIC = 2051 MNIST_LABEL_MAGIC = 2049 TRAIN_IMAGES = 'train-images-idx3-ubyte.gz' TRAIN_LABELS = 'train-labels-idx1-ubyte.gz' TEST_IMAGES = 't10k-images-idx3-ubyte.gz' TEST_LABELS =...
mit
farm3r/ardupilot
mk/PX4/Tools/genmsg/src/genmsg/deps.py
216
3993
# 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
alanjw/GreenOpenERP-Win-X86
python/Lib/bsddb/test/test_fileid.py
7
1891
"""TestCase for reseting File ID. """ import os import shutil import unittest from test_all import db, test_support, get_new_environment_path, get_new_database_path class FileidResetTestCase(unittest.TestCase): def setUp(self): self.db_path_1 = get_new_database_path() self.db_path_2 =...
agpl-3.0
Mafarricos/Mafarricos-modded-xbmc-addons
plugin.video.streamajoker/resources/site-packages/bs4/element.py
438
61538
import collections import re import sys import warnings from bs4.dammit import EntitySubstitution DEFAULT_OUTPUT_ENCODING = "utf-8" PY3K = (sys.version_info[0] > 2) whitespace_re = re.compile("\s+") def _alias(attr): """Alias one attribute name to another for backward compatibility""" @property def alias...
gpl-2.0
Leila20/django
django/shortcuts.py
117
5429
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ from django.http import ( Http404, HttpResponse, HttpResponsePermanentRedirect, HttpResponseRedirect, ) from django.template imp...
bsd-3-clause
ybdesire/apk_sdk_analysis
common/Androguard-2.0/tests/test_sign.py
23
2170
#!/usr/bin/env python # This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard 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,...
gpl-3.0
rreimann/electron
script/upload-node-headers.py
12
2019
#!/usr/bin/env python import argparse import glob import os import shutil import sys from lib.config import PLATFORM, get_target_arch, s3_config from lib.util import safe_mkdir, scoped_cwd, s3put SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DIST_DIR = os.path.join(SOURCE_ROOT, 'dist'...
mit
fkorotkov/pants
src/python/pants/reporting/report.py
17
4044
# coding=utf-8 # Copyright 2014 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 threading imp...
apache-2.0
FDio/vpp
test/test_arping.py
2
8702
from scapy.layers.l2 import ARP from scapy.layers.inet6 import ICMPv6ND_NS, ICMPv6ND_NA, IPv6 from framework import VppTestCase """ TestArping is a subclass of VPPTestCase classes. Basic test for sanity check of arping. """ class TestArping(VppTestCase): """ Arping Test Case """ @classmethod def set...
apache-2.0
OaklandPeters/dist-map-reduce
endgame/indexes/shared.py
1
2001
from __future__ import absolute_import import os import json import collections import itertools __all__ = [ 'dirpath_to_confpath', 'confpath_to_dirpath', 'directory_to_config' ] def dirpath_to_confpath(dirpath): if dirpath[-1] == os.sep: confpath = dirpath[:-1] + ".json" else: co...
mit
shapiromatron/tblBuilder
src/private/scripts/reports/epi/ResultTable.py
1
4586
from textwrap import dedent from docxUtils.reports import DOCXReport from docxUtils.tables import TableMaker class EpiResultTables(DOCXReport): COLUMN_WIDTHS = [1.0, 1.7, 0.75, 0.75, 1.0, 1.2, 2.6] def _build_result(self, res): rows = 0 tbl = TableMaker( self.COLUMN_WIDTHS, num...
mit
pgmillon/ansible
lib/ansible/modules/cloud/google/gcp_compute_region_disk.py
2
22530
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
sdoran35/hate-to-hugs
venv/lib/python3.6/site-packages/nltk/tokenize/toktok.py
7
8031
# -*- coding: utf-8 -*- # Natural Language Toolkit: Python port of the tok-tok.pl tokenizer. # # Copyright (C) 2001-2015 NLTK Project # Author: Jon Dehdari # Contributors: Liling Tan, Selcuk Ayguney, ikegami, Martijn Pieters # # URL: <http://nltk.sourceforge.net> # For license information, see LICENSE.TXT """ The tok-...
mit
olemis/brython
www/src/Lib/test/test_importlib/extension/test_finder.py
26
1223
from importlib import machinery from .. import abc from . import util import unittest class FinderTests(abc.FinderTests): """Test the finder for extension modules.""" def find_module(self, fullname): importer = machinery.FileFinder(util.PATH, (machinery.Extens...
bsd-3-clause
Limags/MissionPlanner
Lib/site-packages/scipy/linalg/basic.py
53
17691
# # Author: Pearu Peterson, March 2002 # # w/ additions by Travis Oliphant, March 2002 __all__ = ['solve', 'solve_triangular', 'solveh_banded', 'solve_banded', 'inv', 'det', 'lstsq', 'pinv', 'pinv2'] from numpy import asarray, zeros, sum, conjugate, dot, transpose, \ asarray_chkfinite, single imp...
gpl-3.0
activitycentral/ebookreader
src/overlaywidget.py
1
1061
from gi.repository import Gtk from gi.repository import Gdk from sugar3.graphics.icon import Icon class OverlayWidget(Gtk.Window): def __init__(self, widget_to_overlay): Gtk.Window.__init__(self) self._box = Gtk.VBox() self._widget_to_overlay = widget_to_overlay self.set_decorate...
gpl-2.0
Maistho/CouchPotatoServer
libs/rsa/pkcs1.py
110
13153
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
gpl-3.0
bartvm/pylearn2
pylearn2/sandbox/rnn/costs/tests/test_gradient_clipping.py
44
1513
""" Unit tests for the gradient clipping cost """ import unittest import numpy as np from theano import function from pylearn2.costs.mlp import Default from pylearn2.models.mlp import MLP, Linear from pylearn2.sandbox.rnn.costs.gradient_clipping import GradientClipping class TestGradientClipping(unittest.TestCase):...
bsd-3-clause
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Mac/Modules/cf/cfsupport.py
35
26266
# This script generates a Python interface for an Apple Macintosh Manager. # It uses the "bgen" package to generate C code. # The function specifications are generated by scanning the mamager's header file, # using the "scantools" package (customized for this particular manager). #error missing SetActionFilter import...
mit
drpngx/tensorflow
tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py
12
22234
# 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
danakj/chromium
third_party/closure_linter/closure_linter/errors.py
99
4184
#!/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
ingadhoc/openerp-travel
travel_rental_car/travel_rental_car.py
2
3163
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or m...
agpl-3.0
tyagiarpit/servo
tests/wpt/css-tests/css-fonts-3_dev/html/reference/support/fonts/makegsubfonts.py
1616
14125
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
jgmize/bedrock
lib/l10n_utils/management/commands/l10n_extract.py
11
7162
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os from textwrap import dedent from django.conf import settings from django.core.management import call_command ...
mpl-2.0
Andrew-McNab-UK/DIRAC
ResourceStatusSystem/PolicySystem/Actions/BaseAction.py
4
1493
# $HeadURL: $ ''' BaseAction Base class for Actions. ''' from DIRAC import gLogger __RCSID__ = '$Id: $' class BaseAction( object ): ''' Base class for all actions. It defines a constructor an a run main method. ''' def __init__( self, name, decisionParams, enforcementResult, singlePolicyResults, cl...
gpl-3.0
kuiwei/edx-platform
common/test/acceptance/performance/test_lms_performance.py
62
4375
""" Single page performance tests for LMS. """ from bok_choy.web_app_test import WebAppTest, with_cache from ..pages.lms.auto_auth import AutoAuthPage from ..pages.lms.courseware import CoursewarePage from ..pages.lms.dashboard import DashboardPage from ..pages.lms.course_info import CourseInfoPage from ..pages.lms.log...
agpl-3.0
alphafoobar/intellij-community
python/lib/Lib/site-packages/django/core/mail/backends/base.py
660
1164
"""Base email backend class.""" class BaseEmailBackend(object): """ Base class for email backend implementations. Subclasses must at least overwrite send_messages(). """ def __init__(self, fail_silently=False, **kwargs): self.fail_silently = fail_silently def open(self): """Op...
apache-2.0
harshilasu/LinkurApp
y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/beanstalk/layer1.py
7
56243
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 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...
gpl-3.0
bsmr-misc-forks/letsencrypt
certbot-apache/certbot_apache/tests/obj_test.py
11
5342
"""Tests for certbot_apache.obj.""" import unittest class VirtualHostTest(unittest.TestCase): """Test the VirtualHost class.""" def setUp(self): from certbot_apache.obj import Addr from certbot_apache.obj import VirtualHost self.addr1 = Addr.fromstring("127.0.0.1") self.addr2...
apache-2.0
gbaty/pyside2
tests/QtWidgets/qabstracttextdocumentlayout_test.py
3
1258
import unittest import py3kcompat as py3k from PySide2.QtCore import QSizeF, QTimer from PySide2.QtGui import QTextFormat, QTextCharFormat, QPyTextObject from PySide2.QtWidgets import QTextEdit from helper import UsesQApplication class Foo(QPyTextObject): called = False def intrinsicSize(self, doc, posInDocu...
lgpl-2.1
karlito40/servo
tests/wpt/css-tests/css21_dev/xhtml1/reference/support/fonts/makegsubfonts.py
820
14309
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
jonathanverner/brython
www/src/Lib/html/parser.py
737
19605
"""A parser for HTML and XHTML.""" # This file is based on sgmllib.py, but the API is slightly different. # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable character # data -- only char and entity references and end tags are special) # and CDAT...
bsd-3-clause
kokogaga/arducopter
mk/PX4/Tools/genmsg/test/test_genmsg_gentools.py
215
9526
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, 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...
gpl-3.0
wangzhe0417/shadowsocks
utils/autoban.py
22
2086
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2015 clowwindy # # 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 u...
mit
NikiStanchev/SoftUni
AngularFundamentals/Angular2/Redux/node_modules/node-gyp/gyp/pylib/gyp/common.py
1292
20063
# 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. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
mit
vikas1885/test1
common/lib/xmodule/xmodule/modulestore/tests/test_mongo_call_count.py
91
7866
""" Tests to verify correct number of MongoDB calls during course import/export and traversal when using the Split modulestore. """ from tempfile import mkdtemp from shutil import rmtree from unittest import TestCase, skip import ddt from xmodule.modulestore.xml_importer import import_course_from_xml from xmodule.mod...
agpl-3.0
wangyum/tensorflow
tensorflow/contrib/sparsemax/python/kernel_tests/sparsemax_loss_test.py
36
8009
# 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
burakbayramli/quant_at
data/simple.py
1
7677
from pymongo import MongoClient import logging, Quandl, random, os import datetime, glob, pandas as pd from pandas_datareader import data, wb import numpy as np, sys from memo import * MONGO_STAT = "C:\\Progra~1\\MongoDB\\Server\\3.2\\bin\\mongostat.exe /rowcount:1" @memo # so that we dont constantly read the .quand...
gpl-3.0
40223142/2015cad0623
static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_result.py
788
19069
import io import sys import textwrap from test import support import traceback import unittest class Test_TestResult(unittest.TestCase): # Note: there are not separate tests for TestResult.wasSuccessful(), # TestResult.errors, TestResult.failures, TestResult.testsRun or # TestResult.shouldStop because t...
gpl-3.0
rossjones/ScraperWikiX
web/frontend/migrations/0014_add_message.py
2
7348
from south.db import db from django.db import models from frontend.models import * class Migration: def forwards(self, orm): # Adding model 'Message' db.create_table('frontend_message', ( ('id', orm['frontend.message:id']), ('text', orm['frontend.message:text'...
agpl-3.0
rarbg/ZeroNet
src/lib/geventwebsocket/resource.py
21
1865
import re from .protocols.base import BaseProtocol from .exceptions import WebSocketError class WebSocketApplication(object): protocol_class = BaseProtocol def __init__(self, ws): self.protocol = self.protocol_class(self) self.ws = ws def handle(self): self.protocol.on_open() ...
gpl-2.0
Mirdrack/4chanscrapper
lib/python2.7/site-packages/setuptools/archive_util.py
409
6601
"""Utilities for extracting common archive formats""" __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter", "UnrecognizedFormat", "extraction_drivers", "unpack_directory", ] import zipfile, tarfile, os, shutil, posixpath from pkg_resources import ensure_directory from distutils....
mit
jjlee3/openthread
tests/scripts/thread-cert/ipv6.py
5
35645
#!/usr/bin/python # # Copyright (c) 2016, The OpenThread Authors. # 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 # not...
bsd-3-clause
wgwoods/lorax
src/pylorax/api/bisect.py
2
1682
# # Copyright (C) 2018 Red Hat, Inc. # # 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. # # This program is distributed i...
gpl-2.0
stackforge/monasca-api
monasca_api/tests/test_alarms.py
1
94731
# -*- coding: utf-8 -*- # Copyright 2015 Cray Inc. # (C) Copyright 2015,2017 Hewlett Packard Enterprise Development LP # Copyright 2016-2017 FUJITSU LIMITED # # 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 t...
apache-2.0
Cedev/a10-neutron-lbaas
a10_neutron_lbaas/db/migration/alembic_migrations/versions/2a280aba7701_create_orchestration.py
4
2753
# 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
bealdav/OpenUpgrade
addons/project/res_config.py
34
4484
# -*- 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
apyrgio/ganeti
lib/rapi/client_utils.py
3
3149
# # # 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and ...
bsd-2-clause
eyalfa/spark
python/pyspark/java_gateway.py
6
7460
# # 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
chunyang-wen/orc
c++/libs/gmock-1.7.0/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...
apache-2.0
elijah513/ice
csharp/test/Ice/enums/run.py
9
1064
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
gpl-2.0
atlashealth/ansible-modules-extras
cloud/lxc/lxc_container.py
3
54951
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kevin Carter <kevin.carter@rackspace.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...
gpl-3.0
sgml/popcorn_maker
vendor-local/lib/python/debug_toolbar/utils/sqlparse/lexer.py
12
12456
# -*- coding: utf-8 -*- # Copyright (C) 2008 Andi Albrecht, albrecht.andi@gmail.com # # This module is part of python-sqlparse and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php. """SQL Lexer""" # This code is based on the SqlLexer in pygments. # http://pygments.org/ # It's s...
bsd-3-clause
richm/designate
designate/openstack/common/systemd.py
1
3061
# Copyright 2012-2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
adityachap/fabric-sdk-node
node_modules/grpc/third_party/boringssl/third_party/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...
apache-2.0
xinjiguaike/edx-platform
openedx/core/djangoapps/user_api/tests/test_middleware.py
152
4415
"""Tests for user API middleware""" from mock import Mock, patch from unittest import TestCase from django.http import HttpResponse from django.test.client import RequestFactory from student.tests.factories import UserFactory, AnonymousUserFactory from ..tests.factories import UserCourseTagFactory from ..middleware ...
agpl-3.0
siddharths067/HuHubaProject
lib/chardet/mbcsgroupprober.py
343
2012
######################## 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
diogommartins/ryu
ryu/hooks.py
43
2575
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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://...
apache-2.0
zimmerman-zimmerman/OIPA
OIPA/iati/management/commands/set_searchable_activities.py
2
1970
from django.conf import settings from django.core.management.base import BaseCommand from iati.models import Activity from iati.transaction.models import Transaction class Command(BaseCommand): def update_searchable_activities(self): """ Set all activities to searchable if the reporting org is i...
agpl-3.0
jotes/ansible
v2/ansible/plugins/action/fail.py
16
1140
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2012, Dag Wieers <dag@wieers.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 ...
gpl-3.0
webjunkie/python-social-auth
social/backends/github_enterprise.py
53
1330
""" Github Enterprise OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/github_enterprise.html """ from six.moves.urllib.parse import urljoin from social.utils import append_slash from social.backends.github import GithubOAuth2, GithubOrganizationOAuth2, \ GithubTeamOAuth2 class GithubEnter...
bsd-3-clause
jdavisp3/TigerShark
tigershark/tools/surveyPyX12.py
2
1592
#!/usr/bin/env python """Survey PyX12 Segment Definitions. Read ALL pyx12 message definitions, accumulate all Segment definitions. """ from __future__ import print_function import xml.dom.minidom as DOM import os, glob segmentTypes= {} segmentUse= {} def getDef( aFile ): """Get the Segment Definitions from an XM...
bsd-3-clause
ThiefMaster/indico
indico/util/json.py
4
1603
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from collections import UserDict from datetime import date, datetime from speaklater import _LazyString ...
mit
h3llrais3r/SickRage
lib/sqlalchemy/dialects/drizzle/mysqldb.py
154
1270
""" .. dialect:: drizzle+mysqldb :name: MySQL-Python :dbapi: mysqldb :connectstring: drizzle+mysqldb://<user>:<password>@<host>[:<port>]/<dbname> :url: http://sourceforge.net/projects/mysql-python """ from sqlalchemy.dialects.drizzle.base import ( DrizzleDialect, DrizzleExecutionContext, ...
gpl-3.0
dvliman/jaikuengine
.google_appengine/lib/django-1.3/django/core/management/commands/runserver.py
158
5632
from optparse import make_option import os import re import sys import socket from django.core.management.base import BaseCommand, CommandError from django.core.handlers.wsgi import WSGIHandler from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException from django.utils import autoreload nai...
apache-2.0
WarmongeR1/pyvideo.ru
proposal/parsers.py
2
6473
# coding: utf-8 import re from django.core.serializers import SerializerDoesNotExist from django.conf import settings from rest_framework.settings import api_settings from richard.videos.models import Category from .serializers import CategorySerializer, VideoSerializer from .utils import force_path from .exceptions ...
bsd-3-clause
cloudbase/nova-virtualbox
nova/virt/configdrive.py
2
6568
# Copyright 2012 Michael Still and Canonical 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 # # ...
apache-2.0
YarnSeemannsgarn/pyshorteners
pyshorteners/shorteners/readability.py
1
1691
# encoding: utf-8 """ Readbility url shortner api implementation Located at: https://readability.com/developers/api/shortener Doesnt' need anything from the app """ from .base import BaseShortener from ..exceptions import ShorteningErrorException, ExpandingErrorException class ReadabilityShortener(BaseShortener): ...
mit
jumpojoy/neutron
neutron/tests/functional/cmd/test_netns_cleanup.py
52
2634
# Copyright (c) 2015 Red Hat, 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 require...
apache-2.0
prometheanfire/portage
pym/portage/util/_eventloop/PollSelectAdapter.py
4
1908
# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from .PollConstants import PollConstants import select class PollSelectAdapter(object): """ Use select to emulate a poll object, for systems that don't support poll(). """ def __init__(self): self._regi...
gpl-2.0
sdecoder/CMDS-HDFS
common/contrib/hod/hodlib/GridServices/mapred.py
182
8167
#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 use thi...
apache-2.0
pedropva/AIprojects
sources/Main.py
1
6236
import os from Node import Node from Search import Search from Data import Data from Utils import Utils cities = Data.cities() situations = Data.cfg() def Main(): option = 0 option1 = 0 start = None finisht = None while True: os.system('cls') if(option == 0): option=0 ...
gpl-3.0
joomel1/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/examples/add_person.py
432
1656
#! /usr/bin/python # See README.txt for information and build instructions. import addressbook_pb2 import sys # This function fills in a Person message based on user input. def PromptForAddress(person): person.id = int(raw_input("Enter person ID number: ")) person.name = raw_input("Enter name: ") email = raw_...
bsd-3-clause
mscelnik/exercises
exercises/random_list.py
1
2865
""" Python training exercise Random list Below is a list of random numbers between 0 and 100. Using built-in funcions and the list sub-functions, can you?: (a) Sort the list? HINT: Use the sorted() built-in function. (b) What are the smallest and largest numbers? HINT: There are two ways to do t...
gpl-3.0
ridfrustum/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/custom_columns_regress/tests.py
91
2919
from django.test import TestCase from django.core.exceptions import FieldError from models import Author, Article def pks(objects): """ Return pks to be able to compare lists""" return [o.pk for o in objects] class CustomColumnRegression(TestCase): def assertRaisesMessage(self, exc, msg, func, *args, **...
gpl-3.0
lowiki-org/localwiki-backend-server
localwiki/pages/fields.py
3
3448
from django import forms from django.utils.translation import ugettext_lazy as _ from ckeditor.models import HTML5FragmentField class WikiHTMLField(HTML5FragmentField): allowed_elements = [ 'p', 'br', 'a', 'em', 'strong', 'u', 'img', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'ul', 'ol', 'li', 'p...
gpl-2.0
Jusedawg/SickRage
lib/tmdb_api/test_tmdb_api.py
52
5468
""" test.py contains unit tests for tmdbsimple.py Fill in Global Variables below before running tests. Created by Celia Oakley on 2013-11-05 """ import unittest import sys from tmdb_api import TMDB # # Global Variables (fill in or put in keys.py) # TMDB_API_KEY = 'edc5f123313769de83a71e157758030b' try: from k...
gpl-3.0
angelman/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/filters/webkit_extras.py
121
2830
# Copyright (C) 2009 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...
bsd-3-clause
UITools/saleor
saleor/order/migrations/0045_auto_20180329_0142.py
1
1425
# Generated by Django 2.0.3 on 2018-03-29 06:42 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django_prices.models class Migration(migrations.Migration): dependencies = [ ('product', '0054_merge_20180320_1108'), ('order', '0044_...
bsd-3-clause
maxsocl/django
django/db/backends/mysql/operations.py
26
7908
from __future__ import unicode_literals import uuid from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.utils import six, timezone from django.utils.encoding import force_text class DatabaseOperations(BaseDatabaseOperations): compiler_module = "djan...
bsd-3-clause
apache/incubator-airflow
tests/providers/amazon/aws/operators/test_emr_terminate_job_flow.py
10
1847
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0