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
recht/raven-python
tests/contrib/django/urls.py
19
1367
from __future__ import absolute_import from django.conf import settings try: from django.conf.urls import url, patterns except ImportError: # for Django version less than 1.4 from django.conf.urls.defaults import url, patterns # NOQA from django.http import HttpResponse def handler404(request): ret...
bsd-3-clause
Xowap/ansible
lib/ansible/executor/process/worker.py
30
6205
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 the License, or # (at your option) an...
gpl-3.0
flavour/tldrmp
private/templates/default/menus.py
4
4148
# -*- coding: utf-8 -*- from gluon import * from s3 import * from s3layouts import * try: from .layouts import * except ImportError: pass import s3menus as default # Below is an example which you can base your own template's menus.py on # - there are also other examples in the other templates folders # =====...
mit
defaultnamehere/grr
lib/time_utils.py
4
2416
#!/usr/bin/env python """This file contains various utilities for datetime handling.""" import calendar import datetime import re import time # Special Windows value for 'the beginning of time' NULL_FILETIME = datetime.datetime(1601, 1, 1, 0, 0, 0) # Regex for times in windows wmi converted format 20080726084622....
apache-2.0
pwmarcz/django
django/template/defaultfilters.py
11
28360
"""Default variable filters.""" from __future__ import unicode_literals import re import random as random_module from decimal import Decimal, InvalidOperation, Context, ROUND_HALF_UP from functools import wraps from pprint import pformat import warnings from django.template.base import Variable, Library, VariableDoes...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/pprint.py
71
11777
# Author: Fred L. Drake, Jr. # fdrake@acm.org # # This is a simple little module I wrote to make life easier. I didn't # see anything quite like it in the library, though I may have overlooked # something. I wrote this when I was trying to read some heavily nested # tuples with fairly non-desc...
gpl-3.0
davidvon/pipa-pay-server
site-packages/pip/vcs/git.py
473
7898
import tempfile import re import os.path from pip.util import call_subprocess from pip.util import display_path, rmtree from pip.vcs import vcs, VersionControl from pip.log import logger from pip.backwardcompat import url2pathname, urlparse urlsplit = urlparse.urlsplit urlunsplit = urlparse.urlunsplit class Git(Versi...
apache-2.0
scs/uclinux
user/python/python-2.4.4/Lib/imaplib.py
5
45542
"""IMAP4 client. Based on RFC 2060. Public class: IMAP4 Public variable: Debug Public functions: Internaldate2tuple Int2AP ParseFlags Time2Internaldate """ # Author: Piers Lauder <piers@cs.su.oz.au> December 1997. # # Auth...
gpl-2.0
Kodextor/arkos-beacon
beacon/beacon.py
1
2491
#!/usr/bin/env python import OpenSSL import os import pam import json import socket import ssl import subprocess import threading def shutdown(): subprocess.call(['halt']) def reload(): subprocess.call(['systemctl', 'restart', 'genesis']) def reboot(): subprocess.call(['reboot']) def handle_client(sock): data...
gpl-3.0
bsmr-eve/Pyfa
gui/builtinAdditionPanes/projectedView.py
1
11834
# ============================================================================= # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. # # pyfa 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 ...
gpl-3.0
openhatch/new-mini-tasks
vendor/packages/Django/django/contrib/admin/actions.py
101
3193
""" Built-in, globally-available admin actions. """ from django.core.exceptions import PermissionDenied from django.contrib.admin import helpers from django.contrib.admin.util import get_deleted_objects, model_ngettext from django.db import router from django.template.response import TemplateResponse from django.utils...
apache-2.0
fitoria/askbot-devel
askbot/management/commands/askbot_update_index.py
9
3711
import sys from optparse import make_option from django.core.management import get_commands, load_command_class from django.utils.translation import activate as activate_language from django.core.management.base import BaseCommand, CommandError from django.conf import settings try: from haystack.management.comman...
gpl-3.0
ampax/edx-platform
common/djangoapps/external_auth/djangostore.py
224
3356
"""A openid store using django cache""" from openid.store.interface import OpenIDStore from openid.store import nonce from django.core.cache import cache import logging import time DEFAULT_ASSOCIATIONS_TIMEOUT = 60 DEFAULT_NONCE_TIMEOUT = 600 ASSOCIATIONS_KEY_PREFIX = 'openid.provider.associations.' NONCE_KEY_PREF...
agpl-3.0
devoid/nova
nova/api/openstack/compute/plugins/v3/server_diagnostics.py
3
1916
# Copyright 2011 OpenStack Foundation # 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 requ...
apache-2.0
chiragjogi/odoo
openerp/addons/base/ir/ir_attachment.py
183
16487
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
tedsunnyday/SE-Server
server/lib/jinja2/compiler.py
121
61899
# -*- coding: utf-8 -*- """ jinja2.compiler ~~~~~~~~~~~~~~~ Compiles nodes into python code. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from cStringIO import StringIO from itertools import chain from copy import deepcopy from jinja2 import nodes from j...
apache-2.0
eenchev/idea-note-taking-app
env/lib/python2.7/site-packages/psycopg2/tests/test_async_keyword.py
7
7351
#!/usr/bin/env python # -*- coding: utf-8 -*- # test_async_keyword.py - test for objects using 'async' as attribute/param # # Copyright (C) 2017 Daniele Varrazzo <daniele.varrazzo@gmail.com> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public Lice...
mit
deepakkv07/Implementation-of-UDP-Lite-in-ns-3
src/core/examples/sample-simulator.py
34
2387
# -*- Mode:Python; -*- # /* # * Copyright (c) 2010 INRIA # * # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation; # * # * This program is distributed in the hope that it will b...
gpl-2.0
TurboTurtle/sos
sos/report/plugins/jars.py
3
5168
# Copyright (C) 2016 Red Hat, Inc., Michal Srb <michal@redhat.com> # This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General ...
gpl-2.0
hugobuddel/orange3
Orange/tests/test_lazytable.py
1
76434
import os import unittest from itertools import chain, islice from math import isnan import random from Orange import data from Orange.data import filter, Variable from Orange.data import Unknown import numpy as np from unittest.mock import Mock, MagicMock, patch # GUI is necessary to get a LazyTable from an InfiniT...
gpl-3.0
itsjeyd/edx-platform
lms/djangoapps/certificates/tests/tests.py
15
6170
""" Tests for the certificates models. """ from ddt import ddt, data, unpack from mock import patch from django.conf import settings from nose.plugins.attrib import attr from badges.tests.factories import CourseCompleteImageConfigurationFactory from xmodule.modulestore.tests.factories import CourseFactory from xmodule...
agpl-3.0
arnedesmedt/dotfiles
.config/sublime-text-3/Packages.symlinkfollow/pygments/all/pygments/unistring.py
51
51150
# -*- coding: utf-8 -*- """ pygments.unistring ~~~~~~~~~~~~~~~~~~ Strings of all Unicode characters of a certain category. Used for matching in Unicode-aware languages. Run to regenerate. Inspired by chartypes_create.py from the MoinMoin project. :copyright: Copyright 2006-2015 by the Pygment...
mit
KSanthanam/rethinkdb
external/v8_3.30.33.16/build/gyp/test/same-target-name-different-directory/gyptest-all.py
242
1179
#!/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. """ Test cases when multiple targets in different directories have the same name. """ import TestGyp test = TestGyp.TestGyp(formats=['andr...
agpl-3.0
rajatchopra/origin
vendor/github.com/google/certificate-transparency/python/ct/crypto/pem.py
23
14910
"""Read and write PEM files and strings.""" import base64 import StringIO from ct.crypto import error class PemError(error.EncodingError): pass _START_TEMPLATE = "-----BEGIN %s-----" _END_TEMPLATE = "-----END %s-----" class PemReader(object): """A reader class for iteratively reading PEM files.""" d...
apache-2.0
VishvajitP/django-extensions
django_extensions/mongodb/fields/encrypted.py
28
2037
""" Encrypted fields from Django Extensions, modified for use with mongoDB """ from django import forms from django.conf import settings from django.core.exceptions import ImproperlyConfigured from mongoengine.base import BaseField try: from keyczar import keyczar except ImportError: raise ImportError('Using a...
mit
40223211/2015cd_midterm-
static/Brython3.1.1-20150328-091302/Lib/urllib/parse.py
735
35170
"""Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, Decemb...
gpl-3.0
GaetanCambier/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/tmz.py
30
1229
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class TMZIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tmz\.com/videos/(?P<id>[^/]+)/?' _TEST = { 'url': 'http://www.tmz.com/videos/0_okj015ty/', 'md5': '791204e3bf790b1426cb2db0706184c0', ...
gpl-3.0
jbonofre/incubator-beam
sdks/python/apache_beam/runners/direct/direct_runner_test.py
7
1440
# # 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
emedinaa/contentbox
third_party/unidecode/x0c8.py
4
4991
data = ( 'jeo', # 0x00 'jeog', # 0x01 'jeogg', # 0x02 'jeogs', # 0x03 'jeon', # 0x04 'jeonj', # 0x05 'jeonh', # 0x06 'jeod', # 0x07 'jeol', # 0x08 'jeolg', # 0x09 'jeolm', # 0x0a 'jeolb', # 0x0b 'jeols', # 0x0c 'jeolt', # 0x0d 'jeolp', # 0x0e 'jeolh', # 0x...
apache-2.0
zpzgone/paramiko
paramiko/primes.py
39
4949
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # 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 (a...
lgpl-2.1
watonyweng/horizon
openstack_dashboard/static_settings.py
9
6269
# 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
jneves/OctoPrint
tests/util/test_comm_helpers.py
18
5466
# coding=utf-8 from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" import unittest from ddt im...
agpl-3.0
romain-li/edx-platform
lms/urls.py
1
33080
""" URLs for LMS """ from django.conf import settings from django.conf.urls import patterns, include, url from django.views.generic.base import RedirectView from ratelimitbackend import admin from django.conf.urls.static import static from courseware.views.views import CourseTabView, EnrollStaffView, StaticCourseTabV...
agpl-3.0
dawnpower/nova
nova/api/openstack/compute/plugins/v3/access_ips.py
33
3886
# 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 agreed t...
apache-2.0
MRigal/django
tests/model_formsets/models.py
49
7480
from __future__ import unicode_literals import datetime import uuid from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) class Meta: or...
bsd-3-clause
bcorbet/SickRage
lib/unidecode/x09b.py
252
4655
data = ( 'Ti ', # 0x00 'Li ', # 0x01 'Bin ', # 0x02 'Zong ', # 0x03 'Ti ', # 0x04 'Peng ', # 0x05 'Song ', # 0x06 'Zheng ', # 0x07 'Quan ', # 0x08 'Zong ', # 0x09 'Shun ', # 0x0a 'Jian ', # 0x0b 'Duo ', # 0x0c 'Hu ', # 0x0d 'La ', # 0x0e 'Jiu ', # 0x0f 'Qi ', # 0x10 'L...
gpl-3.0
autvincere/bureau-veritas-food
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
388
91069
# 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. # Notes: # # This is all roughly based on the Makefile system used by the Linux # kernel, but is a non-recursive make -- we put the entire dependency # graph in fr...
mit
jtyr/ansible
lib/ansible/module_utils/facts/packages.py
51
2601
# (c) 2018, Ansible Project # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function __metaclass__ = type from abc import ABCMeta, abstractmethod from ansible.module_utils.six import with_metaclass from...
gpl-3.0
40223134/0512
static/Brython3.1.1-20150328-091302/Lib/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...
gpl-3.0
Jamesjue/linux_kernel_db
tools/perf/util/setup.py
242
1531
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
donniexyz/calligra
3rdparty/google-breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/decoder.py
261
25883
# 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: # # * Redistributions o...
gpl-2.0
devaha/archagent
node_modules/grunt-plugin/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
107
43862
# 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. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
gpl-2.0
glewis17/fuel
tests/test_streams.py
21
2142
import numpy from numpy.testing import assert_equal, assert_raises from fuel.datasets import IterableDataset, IndexableDataset from fuel.schemes import SequentialExampleScheme, SequentialScheme from fuel.streams import AbstractDataStream, DataStream class DummyDataStream(AbstractDataStream): def reset(self): ...
mit
sigma-random/asuswrt-merlin
release/src/router/samba36/lib/dnspython/dns/rdtypes/ANY/SOA.py
246
5180
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
gpl-2.0
sclabs/sitestatus-nonrel
django/db/models/aggregates.py
521
2101
""" Classes to represent the definitions of aggregate functions. """ class Aggregate(object): """ Default Aggregate definition. """ def __init__(self, lookup, **extra): """Instantiate a new aggregate. * lookup is the field on which the aggregate operates. * extra is a diction...
bsd-3-clause
faust64/ansible
lib/ansible/modules/network/panos/panos_nat_policy.py
25
10517
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
wskplho/sl4a
python/xmpppy/xmpp/auth.py
196
15633
## auth.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later version. ##...
apache-2.0
fitermay/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/geos/geometry.py
230
24281
""" This module contains the 'base' GEOSGeometry object -- all GEOS Geometries inherit from this object. """ # Python, ctypes and types dependencies. import re import warnings from ctypes import addressof, byref, c_double, c_size_t # super-class for mutable list behavior from django.contrib.gis.geos.mutable_list imp...
apache-2.0
yinquan529/platform-external-chromium_org
third_party/jinja2/tests.py
638
3444
# -*- coding: utf-8 -*- """ jinja2.tests ~~~~~~~~~~~~ Jinja test functions. Used with the "is" operator. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re from jinja2.runtime import Undefined from jinja2._compat import text_type, string_types, mappi...
bsd-3-clause
sidartaoliveira/ansible
test/runner/lib/delegation.py
24
11372
"""Delegate test execution to another environment.""" from __future__ import absolute_import, print_function import os import re import sys import tempfile import lib.pytar import lib.thread from lib.executor import ( SUPPORTED_PYTHON_VERSIONS, IntegrationConfig, ShellConfig, SanityConfig, Units...
gpl-3.0
thomastu/django-wiki
wiki/plugins/attachments/settings.py
16
3502
from __future__ import absolute_import from __future__ import unicode_literals from django import VERSION from django.conf import settings as django_settings from wiki.conf import settings as wiki_settings from django.core.exceptions import ImproperlyConfigured # This is not used in django 1.7+ APP_LABEL = 'attachment...
gpl-3.0
hsu1994/Terminator
Server/RelyON/boost_1_61_0/tools/build/src/build/project.py
11
50988
# Status: ported. # Base revision: 64488 # Copyright 2002, 2003 Dave Abrahams # Copyright 2002, 2005, 2006 Rene Rivera # Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1...
apache-2.0
UTSA-ICS/keystone-SID
keystone/contrib/revoke/controllers.py
5
1810
# 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 # distributed under t...
apache-2.0
apache/incubator-eagle
eagle-external/hadoop_jmx_collector/hadoop_ha_checker.py
4
5879
# !/usr/bin/python # # 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 "Licens...
apache-2.0
soerendip42/rdkit
Code/SimDivPickers/Wrap/testPickers.py
3
5424
from rdkit import RDConfig import unittest,os from rdkit.SimDivFilters import rdSimDivPickers from rdkit.DataManip.Metric import rdMetricMatrixCalc as rdmmc import numpy import random class TestCase(unittest.TestCase): def setUp(self) : self.n = 1000 self.m = 80 self.d = 2 self.dataPts = nump...
bsd-3-clause
rosmo/ansible
lib/ansible/modules/cloud/amazon/aws_config_recorder.py
27
7722
#!/usr/bin/python # Copyright: (c) 2018, Aaron Smith <ajsmith10381@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
qqzwc/XX-Net
code/default/python27/1.0/lib/stat.py
319
1842
"""Constants/functions for interpreting results of os.stat() and os.lstat(). Suggested usage: from stat import * """ # Indices for stat struct members in the tuple returned by os.stat() ST_MODE = 0 ST_INO = 1 ST_DEV = 2 ST_NLINK = 3 ST_UID = 4 ST_GID = 5 ST_SIZE = 6 ST_ATIME = 7 ST_MTIME = 8 ST_CTIME = 9 ...
bsd-2-clause
tuckbloor/node.js-chat
node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
2214
1347
#!/usr/bin/env python import re import json # http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
bbc/kamaelia
Sketches/PO/KamPlanet/introspector.py
3
1823
# -*- coding: utf-8 -*- # http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&nodeid=1200236224 # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # no...
apache-2.0
luismasuelli/python-server-cantrips
cantrips/protocol/messaging/formats.py
1
10136
from cantrips.features import Feature from cantrips.types.exception import factory from collections import namedtuple from enum import Enum import json from cantrips.protocol.messaging import Message _32bits = (1 << 32) - 1 class MsgPackFeature(Feature): @classmethod def _import_it(cls): """ ...
lgpl-3.0
AnishShah/tensorflow
tensorflow/contrib/learn/python/learn/datasets/synthetic.py
42
7451
# 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
CharellKing/gobang
human_role.py
1
9940
#!/usr/bin/python #-*-coding:utf-8-*- import os import sys from threading import Thread import socket, select from module_msg import ModuleMsg from gobang import Gobang, Stone class HumanRole(object): def __init__(self, human_in, human_out, human_interface_in, human_interface_out): self.inputs = [] ...
apache-2.0
viblo/pymunk
pymunk/shape_filter.py
1
4464
from typing import NamedTuple class ShapeFilter(NamedTuple): """ Pymunk has two primary means of ignoring collisions: groups and category masks. Groups are used to ignore collisions between parts on a complex object. A ragdoll is a good example. When jointing an arm onto the torso, you'll wan...
mit
jiangzhuo/kbengine
kbe/src/lib/python/Lib/test/test_enumerate.py
72
8072
import unittest import operator import sys import pickle from test import support class G: 'Sequence using __getitem__' def __init__(self, seqn): self.seqn = seqn def __getitem__(self, i): return self.seqn[i] class I: 'Sequence using iterator protocol' def __init__(self, seqn): ...
lgpl-3.0
betoesquivel/CIE
flask/lib/python2.7/site-packages/sqlalchemy/event/base.py
33
7248
# event/base.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Base implementation classes. The public-facing ``Events`` serves as the base class...
mit
stevielu/viewfinder
backend/www/admin/admin.py
13
3707
# Copyright 2012 Viewfinder Inc. All Rights Reserved. """Handlers for viewfinder web application administration. AdminHandler: top-level admin handler """ __author__ = 'spencer@emailscrubbed.com (Spencer Kimball)' import httplib import logging import os import traceback from tornado import gen, web from viewfinde...
apache-2.0
savoirfairelinux/django
django/core/management/commands/makemigrations.py
18
14261
import os import sys from itertools import takewhile from django.apps import apps from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections, router from django.db.migrations import Migration from django.db.migrations.autodetec...
bsd-3-clause
Watkurem/Arch_Lab1
tests.py
1
36384
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2016 Alexander Melnyk / Олександр Мельник # # This file is part of Arch_Lab package. # # Arch_Lab is free software: you can redistribute it and/or modify it under # the terms of th...
gpl-3.0
datasnakes/Datasnakes-Scripts
OrthoEvol/Tools/slackify/notify.py
1
3182
"""Slackify sends messages or milestones to a slack channel.""" import configparser import os from slacker import Slacker import slacker class Slackify(object): """Send messages or milestones to a slack channel.""" def __init__(self, slackconfig='slackconfig.cfg', cfg=True): """Configure Slackify. ...
mit
afedchin/xbmctorrent
resources/site-packages/bs4/testing.py
440
24510
"""Helper classes for tests.""" import copy import functools import unittest from unittest import TestCase from bs4 import BeautifulSoup from bs4.element import ( CharsetMetaAttributeValue, Comment, ContentMetaAttributeValue, Doctype, SoupStrainer, ) from bs4.builder import HTMLParserTreeBuilder d...
gpl-3.0
wilhelmryan/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/packages/six.py
2375
11628
"""Utilities for writing code that runs on Python 2 and 3""" #Copyright (c) 2010-2011 Benjamin Peterson #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 l...
lgpl-2.1
eul-721/The-Perfect-Pokemon-Team-Balancer
libs/env/Lib/encodings/hp_roman8.py
647
7391
""" Python Character Mapping Codec generated from 'hp_roman8.txt' with gencodec.py. Based on data from ftp://dkuug.dk/i18n/charmaps/HP-ROMAN8 (Keld Simonsen) Original source: LaserJet IIP Printer User's Manual HP part no 33471-90901, Hewlet-Packard, June 1989. """#" import codecs ### Codec APIs class ...
gpl-2.0
cbingos/hongmafund
nvd3/stackedAreaChart.py
5
3803
#!/usr/bin/python # -*- coding: utf-8 -*- """ Python-nvd3 is a Python wrapper for NVD3 graph library. NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. Project location : https://github.com/areski/python-nvd3 """ from .NVD3Chart import NVD...
mit
antonyc/django_mongo_cache
src/tools_mongodb_cache/cache.py
2
12742
# coding: utf-8 from __future__ import unicode_literals import base64 import logging import cPickle as pickle from datetime import timedelta from django.utils import timezone from pymongo import errors as pymongo_errors from pymongo import uri_parser from django.core.exceptions import ImproperlyConfigured from djang...
mit
mrquim/repository.mrquim
repo/plugin.video.salts/js2py/constructors/jsarray.py
71
1280
from ..base import * @Js def Array(): if len(arguments)==0 or len(arguments)>1: return arguments.to_list() a = arguments[0] if isinstance(a, PyJsNumber): length = a.to_uint32() if length!=a.value: raise MakeError('RangeError', 'Invalid array length') temp = Js([]...
gpl-2.0
polimediaupv/edx-platform
common/lib/xmodule/xmodule/video_module/video_xfields.py
46
8327
""" XFields for video module. """ import datetime from xblock.fields import Scope, String, Float, Boolean, List, Dict, DateTime from xmodule.fields import RelativeTime # Make '_' a no-op so we can scrape strings _ = lambda text: text class VideoFields(object): """Fields for `VideoModule` and `VideoDescriptor`....
agpl-3.0
ChinaMassClouds/copenstack-server
openstack/src/nova-2014.2/nova/keymgr/single_key_mgr.py
18
2526
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
gpl-2.0
alistairlow/tensorflow
tensorflow/contrib/boosted_trees/estimator_batch/custom_export_strategy.py
7
10990
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
mbohlool/client-python
kubernetes/client/models/v2beta1_horizontal_pod_autoscaler_condition.py
1
7109
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
phonelab/android_kernel
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
tinchoss/Python_Android
python/src/Mac/Demo/PICTbrowse/oldPICTbrowse.py
34
4689
"""browsepict - Display all "PICT" resources found""" import FrameWork import EasyDialogs from Carbon import Res from Carbon import Qd from Carbon import Win from Carbon import List import struct import macresource # # Resource definitions ID_MAIN=512 MAIN_LIST=1 MAIN_SHOW=2 # Where is the picture window? LEFT=200 T...
apache-2.0
code-google-com/rad2py
ide2py/simplejsonrpc.py
8
4860
#!/usr/bin/python # -*- coding: utf-8 -*- # This program 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, or (at your option) any later # version. # # This program is distributed in the...
gpl-3.0
davehunt/kuma
vendor/packages/translate/lang/test_nqo.py
26
1743
#!/usr/bin/env python # -*- coding: utf-8 -*- from translate.lang import factory def test_punctranslate(): """Tests that we can translate punctuation.""" language = factory.getlanguage('nqo') assert language.punctranslate(u"") == u"" assert language.punctranslate(u"abc efg") == u"abc efg" assert ...
mpl-2.0
MrNuggles/HeyBoet-Telegram-Bot
temboo/Library/Salesforce/Passwords/ResetPassword.py
5
5475
# -*- coding: utf-8 -*- ############################################################################### # # ResetPassword # Resets a user's password to new randomized password. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you ma...
gpl-3.0
bmaluenda/switch
examples/3zone_toy_stochastic_PySP/ReferenceModel.py
1
3880
# Copyright 2016 The Switch Authors. All rights reserved. # Licensed under the Apache License, Version 2, which is in the LICENSE file. """ Generate a model for use with the PySP pyomo module, either for use with the runef or runph commands. Both these scripts require a single .py file that creates a pyomo model obje...
apache-2.0
tgoodlet/pytest
doc/en/example/multipython.py
8
1748
""" module containing a parametrized tests testing cross-python serialization via the pickle module. """ import py import pytest import _pytest._code pythonlist = ['python2.6', 'python2.7', 'python3.4', 'python3.5'] @pytest.fixture(params=pythonlist) def python1(request, tmpdir): picklefile = tmpdir.join("data.pic...
mit
bslatkin/8-bits
appengine-mapreduce/python/src/mapreduce/file_formats.py
3
13599
#!/usr/bin/env 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 ...
apache-2.0
jbuchbinder/youtube-dl
youtube_dl/extractor/cnbc.py
69
1135
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import smuggle_url class CNBCIE(InfoExtractor): _VALID_URL = r'https?://video\.cnbc\.com/gallery/\?video=(?P<id>[0-9]+)' _TEST = { 'url': 'http://video.cnbc.com/gallery/?video=3000503714', '...
unlicense
ii0/bits
python/testefi.py
2
2376
# Copyright (c) 2015, Intel Corporation # 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 condit...
bsd-3-clause
ryfeus/lambda-packs
Spacy/source2.7/numpy/ma/tests/test_regression.py
8
2437
from __future__ import division, absolute_import, print_function import warnings import numpy as np from numpy.testing import ( assert_, assert_array_equal, assert_allclose, run_module_suite, suppress_warnings ) class TestRegression(object): def test_masked_array_create(self): # Ticket #17 ...
mit
kawasaki2013/python-for-android-x86
python-build/python-libs/gdata/build/lib/gdata/tlslite/integration/XMLRPCTransport.py
271
5812
"""TLS Lite + xmlrpclib.""" import xmlrpclib import httplib from gdata.tlslite.integration.HTTPTLSConnection import HTTPTLSConnection from gdata.tlslite.integration.ClientHelper import ClientHelper class XMLRPCTransport(xmlrpclib.Transport, ClientHelper): """Handles an HTTPS transaction to an XML-RPC server.""" ...
apache-2.0
forfuns/shadowsocks
shadowsocks/lru_cache.py
983
4290
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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
savanu/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/extensions.py
489
31780
# Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
disqus/overseer
overseer/templatetags/overseer_helpers.py
2
1722
""" overseer.templatetags.overseer_helpers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ import datetime from django import template from django.template.defaultfilters import stringfilter register = template.Library() @register....
apache-2.0
magul/volontulo
backend/apps/volontulo/tests/views/api/organizations/test_read.py
3
3698
""" .. module:: test_read """ from rest_framework import status from rest_framework.test import APITestCase from apps.volontulo.factories import OrganizationFactory from apps.volontulo.factories import UserFactory class _TestOrganizationsReadAPIView(APITestCase): """Tests for REST API's read organization view....
mit
NcLang/vimrc
sources_non_forked/YouCompleteMe/third_party/ycmd/third_party/python-future/src/future/moves/urllib/request.py
70
3525
from __future__ import absolute_import from future.standard_library import suspend_hooks from future.utils import PY3 if PY3: from urllib.request import * # This aren't in __all__: from urllib.request import (getproxies, pathname2url, proxy_b...
mit
Schevo/kiwi
kiwi/db/sqlobj.py
2
9074
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2007 Async Open Source ## ## This program 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 ## of the License, or...
lgpl-2.1
dhanunjaya/neutron
neutron/tests/unit/services/metering/test_metering_plugin.py
34
20852
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
MartinHjelmare/home-assistant
homeassistant/components/reddit/sensor.py
7
4105
"""Support for Reddit.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, CONF_MAXIMUM) import homeassistant.helpers.config_validation as cv from homeassistant.helpers.enti...
apache-2.0
xupei0610/ComputerGraphics-HW
final/lib/assimp/port/PyAssimp/scripts/3d_viewer_py3.py
6
41620
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ This program loads a model with PyASSIMP, and display it. Based on: - pygame code from http://3dengine.org/Spectator_%28PyOpenGL%29 - http://www.lighthouse3d.com/tutorials - http://www.songho.ca/opengl/gl_transform.html - http://code.activestate.com/recipes/325391/ - ...
mit