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
Gagaro/django
tests/mail/tests.py
119
53536
# -*- coding: utf-8 -*- from __future__ import unicode_literals import asyncore import mimetypes import os import shutil import smtpd import sys import tempfile import threading from email.mime.text import MIMEText from smtplib import SMTP, SMTPException from ssl import SSLError from django.core import mail from djan...
bsd-3-clause
grupoprog3/proyecto_final
proyecto/flask/Lib/site-packages/wtforms/ext/sqlalchemy/orm.py
75
10671
""" Tools for generating forms based on SQLAlchemy models. """ from __future__ import unicode_literals import inspect from wtforms import fields as f from wtforms import validators from wtforms.form import Form from .fields import QuerySelectField, QuerySelectMultipleField __all__ = ( 'model_fields', 'model_form...
apache-2.0
ishay2b/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/batch_test.py
62
2425
# Copyright 2015 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
pfmoore/pip
src/pip/_vendor/cachecontrol/caches/file_cache.py
36
4153
import hashlib import os from textwrap import dedent from ..cache import BaseCache from ..controller import CacheController try: FileNotFoundError except NameError: # py2.X FileNotFoundError = (IOError, OSError) def _secure_open_write(filename, fmode): # We only want to write to this file, so open i...
mit
unixsurfer/haproxyadmin
haproxyadmin/utils.py
1
18662
# pylint: disable=superfluous-parens # """ haproxyadmin.utils ~~~~~~~~~~~~~~~~~~ This module provides utility functions and classes that are used within haproxyadmin. """ import socket import os import stat from functools import wraps import six import re from haproxyadmin.exceptions import (CommandFailed, Multiple...
apache-2.0
DxCx/nzbToMedia
libs/unidecode/x062.py
252
4620
data = ( 'Lian ', # 0x00 'Nan ', # 0x01 'Mi ', # 0x02 'Tang ', # 0x03 'Jue ', # 0x04 'Gang ', # 0x05 'Gang ', # 0x06 'Gang ', # 0x07 'Ge ', # 0x08 'Yue ', # 0x09 'Wu ', # 0x0a 'Jian ', # 0x0b 'Xu ', # 0x0c 'Shu ', # 0x0d 'Rong ', # 0x0e 'Xi ', # 0x0f 'Cheng ', # 0x10 '...
gpl-3.0
tsgit/invenio
modules/webauthorprofile/lib/webauthorprofile_config.py
5
3310
## This file is part of Invenio. ## Copyright (C) 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ...
gpl-2.0
sjerdo/letsencrypt
acme/acme/jws.py
64
1380
"""ACME JOSE JWS.""" from acme import jose class Header(jose.Header): """ACME JOSE Header. .. todo:: Implement ``acmePath``. """ nonce = jose.Field('nonce', omitempty=True, encoder=jose.encode_b64jose) @nonce.decoder def nonce(value): # pylint: disable=missing-docstring,no-self-argument ...
apache-2.0
ychfan/tensorflow
tensorflow/contrib/predictor/contrib_estimator_predictor.py
58
3152
# 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
ysig/BioClassSim
source/graph/proximityGraph.py
1
9092
import os import sys import networkx as nx sys.path.append(os.path.join(os.path.dirname(__file__),'../../..')) from PyINSECT import representations as REP import scipy.spatial as spatial import numpy as np # could be done by using zip founction # in its inverse def decompose_tl(l): if(l==[]): return [],[] ...
apache-2.0
dochang/ansible-modules-core
cloud/amazon/ec2_group.py
33
17903
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
gpl-3.0
js0701/chromium-crosswalk
tools/telemetry/telemetry/internal/backends/chrome_inspector/inspector_console.py
8
1850
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class InspectorConsole(object): def __init__(self, inspector_websocket): self._inspector_websocket = inspector_websocket self._inspector_websocket...
bsd-3-clause
endlessm/chromium-browser
third_party/catapult/third_party/urllib3/urllib3/__init__.py
14
2721
""" urllib3 - Thread-safe connection pooling and re-using. """ from __future__ import absolute_import import warnings from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encode_multipart_formdata from .poolmanager impo...
bsd-3-clause
probcomp/bayeslite
tests/test_nig_normal.py
1
21595
# -*- coding: utf-8 -*- # Copyright (c) 2010-2016, MIT Probabilistic Computing Project # # 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/LICENS...
apache-2.0
anryko/ansible
lib/ansible/modules/database/postgresql/postgresql_privs.py
54
41782
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # Copyright: (c) 2019, Tobias Birkefeld (@tcraxs) <t@craxs.de> # 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 ANSI...
gpl-3.0
OpenBounds/Processing
process.py
1
9367
#!/usr/bin/env python3 import datetime import json import logging import os import sys import zipfile from shutil import rmtree from urllib.parse import urlparse import click import requests import adapters import geoutils import utils from filters import BasicFilterer @click.command() @click.argument("sources", ty...
mit
razvanphp/arangodb
3rdParty/V8-3.31.74.1/third_party/python_26/Lib/lib-tk/tkMessageBox.py
52
3635
# tk common message boxes # # this module provides an interface to the native message boxes # available in Tk 4.2 and newer. # # written by Fredrik Lundh, May 1997 # # # options (all have default values): # # - default: which button to make default (one of the reply codes) # # - icon: which icon to display (see below)...
apache-2.0
JoeLaMartina/AlphametricProject
submissions/Anderson/Alphametic.py
1
3714
# The GUI was modified from http://www.tkdocs.com/tutorial/firstexample.html. The original material # is copyrighted by Mark Roseman. The license can be found at https://creativecommons.org/licenses/by-nc-sa/2.5/ca/. # See the License for the specific language governing permissions and limitations under the License. fr...
mit
ElDeveloper/scikit-learn
sklearn/manifold/isomap.py
229
7169
"""Isomap for manifold learning""" # Author: Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) 2011 import numpy as np from ..base import BaseEstimator, TransformerMixin from ..neighbors import NearestNeighbors, kneighbors_graph from ..utils import check_array from ..utils.graph import...
bsd-3-clause
thaumos/ansible-modules-extras
cloud/vmware/vmware_guest.py
8
35298
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
gpl-3.0
mdimjasevic/debile
tests/test_interface.py
4
2490
from debile.master.dimport import dimport from debile.master.interface import DebileMasterInterface, NAMESPACE from debile.master.orm import Base, Builder, Person from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker import os import unittest class DebileInterfaceTestCase(unittest.TestCase): ...
mit
0k/OpenUpgrade
addons/account_check_writing/wizard/account_check_batch_printing.py
339
3373
# -*- 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
ghorn/casadi
docs/api/extra/generate_overview.py
4
1809
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl, # K.U. Leuven. All rights reserved. # Copyright (C) 2011-2014 Greg Horn # # CasADi is free software; you can...
lgpl-3.0
rendermotion/RMPY
core/hierarchy.py
1
3153
from RMPY.core import dataValidators import pymel.core as pm def insert_in_hierarchy(base_object, insert_object, insert_type="parent"): base_object = dataValidators.as_pymel_nodes(base_object) insert_object = dataValidators.as_pymel_nodes(insert_object) if insert_type == "parent": parent = base_ob...
lgpl-3.0
b0ttl3z/SickRage
tests/sickrage_tests/show/coming_episodes_tests.py
11
3862
# coding=utf-8 # This file is part of SickRage. # # URL: https://SickRage.GitHub.io # Git: https://github.com/SickRage/SickRage.git # # SickRage 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
RedHatInsights/insights-core
insights/parsers/mysqladmin.py
1
4303
""" mysqladmin command - Command ============================ Parsing and extracting data from output of command ``/bin/mysqladmin variables``. Parsers contained in this module are: MysqladminStatus - command ``/bin/mysqladmin status`` ----------------------------------------------------- MysqladminVars - command ``...
apache-2.0
sileht/deb-openstack-nova
nova/tests/test_compute_utils.py
5
4392
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack 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/...
apache-2.0
calebfoss/tensorflow
tensorflow/python/ops/special_math_ops.py
18
17787
# 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
brettdh/libpowertutor
cpp_source/iface_packet_rate_testing.py
1
3896
#!/usr/bin/env python import time, sys, math from subprocess import Popen, PIPE def get_lines(filename): #return open(filename).readlines() proc = Popen(['adb', 'shell', 'cat', filename], stdout=PIPE) lines = proc.communicate()[0].split('\r\n')[:-1] return lines def get_ip_hex(iface): ints = [int...
bsd-2-clause
ShineFan/odoo
addons/hr_holidays/wizard/hr_holidays_summary_department.py
337
2335
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # $Id: account.py 1005 2005-07-25 08:41:42Z nicoe $ # # This program is free software: you can redistrib...
agpl-3.0
bxlab/hifive
hifive/hic.py
1
202978
#!/usr/bin/env python """A class for handling HiC analysis.""" import os import sys import struct import numpy import h5py from scipy.stats import poisson, nbinom from scipy.optimize import fmin_l_bfgs_b as bfgs try: from mpi4py import MPI except: pass try: import mlpy except: pass import hic_binnin...
mit
pombredanne/or-tools
data/rogo/rogo_20110107.py
76
1034
# # The Rogo problem from 2011-01-07 # best: 36 # rows = 12 cols = 7 max_steps = 16 W = 0 B = -1 problem = [ # 1 2 3 4 5 6 7 [4,7,W,W,W,W,3], # 1 [W,W,W,W,3,W,4], # 2 [W,W,4,W,7,W,W], # 3 [7,W,3,W,W,W,W], # 4 [B,B,B,W,3,W,W], # 5 [B,B,W,7,W,W,7], # 6 [B,B,W,W,W,4,B], # 7 [B,4,4,W,W,W,B], # ...
apache-2.0
noxora/flask-base
flask/lib/python3.4/site-packages/setuptools/extension.py
229
1649
import sys import re import functools import distutils.core import distutils.errors import distutils.extension from .dist import _get_unpatched from . import msvc9_support _Extension = _get_unpatched(distutils.core.Extension) msvc9_support.patch_for_specialized_compiler() def _have_cython(): """ Return True...
mit
craynot/django
django/contrib/staticfiles/views.py
581
1329
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import os import posixpath from django.conf import settings from django.contrib.staticfiles import finders from django.http import Http404 from django.utils.six.moves.url...
bsd-3-clause
aleks-sngn/django-shop-categories
shop_categories/utils.py
2
1593
from django.conf import settings from django.core import exceptions CLASS_PATH_ERROR = '''django-shop-categories is unable to interpret settings value for %s. %s should ' \ 'be in ther form of a tuple: (\'path.to.models.Class\', \'app_label\').''' def get_model_string(model_name...
bsd-3-clause
mlperf/training_results_v0.6
Fujitsu/benchmarks/resnet/implementations/mxnet/tools/launch.py
16
5475
#!/usr/bin/env 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 # "L...
apache-2.0
karthik339/Agni
MainDemo/flask/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/html5lib/html5parser.py
310
117029
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import with_metaclass import types from . import inputstream from . import tokenizer from . import treebuilders from .treebuilders._base import Marker from . import utils from . import constants from .constants import spaceChara...
apache-2.0
enthought/pyside
tests/QtGui/customproxywidget_test.py
6
1095
import unittest from helper import UsesQApplication from PySide.QtCore import Qt, QTimer from PySide.QtGui import QLabel, QPainter from PySide.QtGui import QGraphicsScene, QGraphicsView, QGraphicsItem, QGraphicsProxyWidget class CustomProxy(QGraphicsProxyWidget): def __init__(self, parent=None, wFlags=0): ...
lgpl-2.1
elvisisking/modeshape
bin/release.py
9
18736
#!/usr/bin/python import re import sys import os import platform is_windows = platform.system().lower().startswith("win") import subprocess import shutil from markdown2 import * from datetime import * from multiprocessing import Process from utils import * from jira import * from docbook import * try: from xml.etree...
apache-2.0
caioserra/apiAdwords
examples/adspygoogle/dfp/v201302/company_service/update_companies.py
3
2078
#!/usr/bin/python # # Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
allenlavoie/tensorflow
tensorflow/python/eager/graph_callable.py
3
16832
# 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
nwokeo/supysonic
venv/lib/python2.7/site-packages/setuptools/command/install.py
529
4683
from distutils.errors import DistutilsArgError import inspect import glob import warnings import platform import distutils.command.install as orig import setuptools # Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for # now. See https://github.com/pypa/setuptools/issues/199/ _install = orig.in...
agpl-3.0
ptoraskar/scrapy
scrapy/utils/decorators.py
182
1273
import warnings from functools import wraps from twisted.internet import defer, threads from scrapy.exceptions import ScrapyDeprecationWarning def deprecated(use_instead=None): """This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the fu...
bsd-3-clause
lz1988/django-web2015
build/lib/django/contrib/admin/views/main.py
85
16606
import operator from functools import reduce from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.core.paginator import InvalidPage from django.core.urlresolvers import reverse from django.db import models from django.db.models.fields import FieldDoesNotExist from django.utils.datas...
bsd-2-clause
alistairlow/tensorflow
tensorflow/python/framework/versions_test.py
164
2130
# Copyright 2015 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
magosil86/ruffus
ruffus/test/test_ruffus_utility.py
1
40427
#!/usr/bin/env python from __future__ import print_function ################################################################################ # # test_ruffus_utility.py # ################################################################################# """ test_ruffus_utility.py """ import os import sys # add g...
mit
isandlaTech/cohorte-runtime
python/src/lib/python/unidecode/x0d1.py
253
4767
data = ( 'tyal', # 0x00 'tyalg', # 0x01 'tyalm', # 0x02 'tyalb', # 0x03 'tyals', # 0x04 'tyalt', # 0x05 'tyalp', # 0x06 'tyalh', # 0x07 'tyam', # 0x08 'tyab', # 0x09 'tyabs', # 0x0a 'tyas', # 0x0b 'tyass', # 0x0c 'tyang', # 0x0d 'tyaj', # 0x0e 'tyac', # 0x0f 'tyak', # ...
apache-2.0
scotthartbti/android_external_chromium_org
tools/telemetry/telemetry/page/profile_generator.py
25
4497
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Handles generating profiles and transferring them to/from mobile devices.""" import logging import optparse import os import shutil import sys import tem...
bsd-3-clause
staranjeet/fjord
smoketests/pages/generic_feedback_picker.py
2
1973
#!/usr/bin/env python # 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/. from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWa...
bsd-3-clause
vickenty/ookoobah
pyglet-c9188efc2e30/pyglet/media/riff.py
42
8107
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
mit
davtse/i9505
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
warmspringwinds/scikit-image
doc/examples/plot_gabor.py
3
4461
""" ============================================= Gabor filter banks for texture classification ============================================= In this example, we will see how to classify textures based on Gabor filter banks. Frequency and orientation representations of the Gabor filter are similar to those of the huma...
bsd-3-clause
jtattermusch/grpc
examples/python/interceptors/default_value/greeter_client.py
18
1677
# Copyright 2017 gRPC authors. # # 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...
apache-2.0
syphar/django
django/contrib/auth/management/__init__.py
109
5023
""" Creates permissions for all installed apps that need permissions. """ from __future__ import unicode_literals import getpass import unicodedata from django.apps import apps as global_apps from django.contrib.auth import get_permission_codename from django.core import exceptions from django.db import DEFAULT_DB_AL...
bsd-3-clause
rubenbe/pytradfri
pytradfri/gateway.py
2
7162
"""Represent the gateway.""" from datetime import datetime from .command import Command from .const import ( ROOT_DEVICES, ROOT_GROUPS, ROOT_MOODS, ROOT_SMART_TASKS, ROOT_GATEWAY, ATTR_NTP, ATTR_FIRMWARE_VERSION, ATTR_CURRENT_TIME_UNIX, ATTR_CURRENT_TIME_ISO8601, ATTR_FIRST_SETU...
mit
xuru/pyvisdk
pyvisdk/do/host_user_world_swap_not_enabled_event.py
1
1272
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def HostUserWorldSwapNotEnabledEvent(vim, *args, **kwargs): '''This event records that th...
mit
ging/horizon
openstack_dashboard/dashboards/admin/networks/agents/views.py
7
2637
# Copyright 2014 Kylincloud # # 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 ...
apache-2.0
837468220/python-for-android
python3-alpha/python3-src/Lib/test/test_cmath.py
51
21172
from test.support import run_unittest, requires_IEEE_754 from test.test_math import parse_testfile, test_file import unittest import cmath, math from cmath import phase, polar, rect, pi import sysconfig INF = float('inf') NAN = float('nan') complex_zeros = [complex(x, y) for x in [0.0, -0.0] for y in [0.0, -0.0]] com...
apache-2.0
gfreed/android_external_chromium-org
chrome/common/extensions/docs/server2/example_zipper.py
24
1839
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from io import BytesIO from zipfile import ZipFile class ExampleZipper(object): '''This class creates a zip file given a samples directory. ''' de...
bsd-3-clause
h3biomed/ansible
test/units/modules/network/netscaler/test_netscaler_gslb_site.py
68
24193
# Copyright (c) 2017 Citrix Systems # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
gpl-3.0
takeshineshiro/nova
nova/tests/unit/api/openstack/compute/contrib/test_console_output.py
27
6693
# Copyright 2011 Eldar Nugaev # 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 ...
apache-2.0
teslaji/homebase
venv/HomeBase/lib/python3.5/site-packages/django/contrib/sessions/models.py
347
1298
from __future__ import unicode_literals from django.contrib.sessions.base_session import ( AbstractBaseSession, BaseSessionManager, ) class SessionManager(BaseSessionManager): use_in_migrations = True class Session(AbstractBaseSession): """ Django provides full support for anonymous sessions. The s...
gpl-3.0
mattf/kubernetes
cluster/juju/charms/trusty/kubernetes/hooks/hooks.py
99
8297
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
akosyakov/intellij-community
python/lib/Lib/pwd.py
93
2552
""" This module provides access to the Unix password database. Password database entries are reported as 7-tuples containing the following items from the password database (see `<pwd.h>'), in order: pw_name, pw_passwd, pw_uid, pw_gid, pw_gecos, pw_dir, pw_shell. The uid and gid items are integers, all others are stri...
apache-2.0
hurrinico/l10n-italy
l10n_it_fatturapa_out/__openerp__.py
2
1663
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Davide Corio # Copyright 2015 Agile Business Group <http://www.agilebg.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU A...
agpl-3.0
sebgoa/client-python
kubernetes/client/models/v1_container_state_waiting.py
2
3830
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
midgetspy/Sick-Beard
lib/hachoir_metadata/qt/dialog_ui.py
94
2439
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'hachoir_metadata/qt/dialog.ui' # # Created: Mon Jul 26 03:10:06 2010 # by: PyQt4 UI code generator 4.7.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_Form(object): def setupUi(s...
gpl-3.0
lightcn/odoo
addons/account/report/account_balance.py
198
5905
# -*- 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
NickRuiz/wikitrans-pootle
pootle/i18n/gettext.py
4
2778
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2009 Zuza Software Foundation # # This file is part of Pootle. # # 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...
gpl-2.0
TestInABox/openstackinabox
openstackinabox/tests/models/keystone/test_tokens.py
2
13370
import datetime import mock import uuid import ddt from openstackinabox.tests.base import TestBase, DbFailure from openstackinabox.models.keystone import exceptions from openstackinabox.models.keystone.db.tokens import ( KeystoneDbTokens, UtcTimezone ) @ddt.ddt class TestKeystoneDbTokens(TestBase): de...
apache-2.0
Laurawly/tvm-1
python/tvm/auto_scheduler/loop_state.py
4
24591
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
arteria-project/arteria-core
arteria/web/routes.py
4
4440
import threading import re import itertools from tornado.web import URLSpec class RouteInfo: """Information about a method in a route""" def __init__(self, route, method, description): self.route = route self.method = method self.description = description def __repr__(self): ...
mit
damonkohler/sl4a
python/src/Lib/idlelib/FileList.py
52
3696
import os from Tkinter import * import tkMessageBox class FileList: from EditorWindow import EditorWindow # class variable, may be overridden # e.g. by PyShellFileList def __init__(self, root): self.root = root self.dict = {} self.inversedi...
apache-2.0
pombredanne/anvil
anvil/components/helpers/glance.py
1
19001
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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.or...
apache-2.0
aifil/odoo
addons/sale/tests/test_sale_order.py
40
7670
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.exceptions import UserError, AccessError from test_sale_common import TestSale class TestSaleOrder(TestSale): def test_sale_order(self): """ Test the sale order flow (invoicing and quantity upd...
gpl-3.0
thirdkey-solutions/pycoin
pycoin/scripts/tx.py
3
22834
#!/usr/bin/env python from __future__ import print_function import argparse import calendar import codecs import datetime import io import os.path import re import subprocess import sys from pycoin.convention import tx_fee, satoshi_to_mbtc from pycoin.encoding import hash160 from pycoin.key import Key from pycoin.ke...
mit
Emilgardis/falloutsnip
Vendor/IronPython/Lib/random.py
73
32237
"""Random variable generators. integers -------- uniform within range sequences --------- pick random element pick random sample generate random permutation distributions on the real line: ------------------------------ uniform ...
gpl-3.0
cpennington/edx-platform
lms/djangoapps/course_blocks/transformers/access_denied_filter.py
9
1414
""" Access Denied Message Filter Transformer implementation. """ # TODO: Remove this file after REVE-52 lands and old-mobile-app traffic falls to < 5% of mobile traffic from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer class AccessDeniedMessageFilterTransformer(BlockS...
agpl-3.0
usiraj/riserobotdb
src/felis/FelisJConf.py
1
19785
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'felis.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from python_qt_binding import QtCore, QtGui, QtWidgets try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: ...
apache-2.0
rolepoint/flump
flump/methods/get_many.py
1
1545
from flask import jsonify, request from ..schemas import ManyResponseData, make_response_schema class GetMany(object): def get_many(self, **kwargs): """ Handles HTTP GET requests where no entity is specified. Gets many instances using :func:`flump.view.FlumpView.get_many_entities...
mit
GladeRom/android_external_chromium_org
chrome/common/extensions/docs/server2/render_servlet_test.py
34
6071
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from extensions_paths import EXAMPLES, PUBLIC_TEMPLATES, STATIC_DOCS from local_file_system import LocalFileSystem fro...
bsd-3-clause
Priyansh2/test
ltrc/extractor/clustering/lda.py
1
4878
# -*- coding: utf-8 -*- #! /usr/bin/env python3 #from HindiTokenizer import Tokenizer from gensim import corpora , models import gensim import sys import os import re import math import codecs from operator import itemgetter reload(sys) sys.setdefaultencoding('utf8') path='/home/priyansh/Downloads/ltrc/1055' doc_set=[]...
gpl-3.0
johankaito/fufuka
microblog/old-flask/venv/lib/python2.7/site-packages/flask/signals.py
783
2140
# -*- coding: utf-8 -*- """ flask.signals ~~~~~~~~~~~~~ Implements signals based on blinker if available, otherwise falls silently back to a noop :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ signals_available = False try: from blinker import Name...
apache-2.0
Brocade-OpenSource/OpenStack-DNRM-Nova
nova/tests/db/test_db_api.py
1
279419
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # encoding=UTF8 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file ...
apache-2.0
giserh/TCFnetworks
tcfnetworks/annotators/cooccurrence.py
1
7076
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2013 Frederik Elwert <frederik.elwert@web.de> # # 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
botswana-harvard/bais-subject
bais_subject/models/household_questionnaire.py
1
4961
from django.db import models from edc_base.model_fields import OtherCharField from edc_base.model_mixins import BaseUuidModel from ..choices import ( MALE_FEMALE, MARITAL_STATUS, YES_NO_DNTKNW, YES_NO, HOUSEHOLD_RELATION, CITIZENSHIP, PERSON_HOUSEHOLD_LIVE, ATTENDED_SCHOOL, STUDY_L...
gpl-3.0
FCP-INDI/nipype
nipype/interfaces/fsl/tests/test_auto_Split.py
12
1111
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ....testing import assert_equal from ..utils import Split def test_Split_inputs(): input_map = dict(args=dict(argstr='%s', ), dimension=dict(argstr='-%s', mandatory=True, position=2, ), environ=dict(nohash=True, usedefault=True...
bsd-3-clause
EKiefer/edge-starter
py34env/Lib/site-packages/PIL/_binary.py
58
1408
# # The Python Imaging Library. # $Id$ # # Binary input/output support routines. # # Copyright (c) 1997-2003 by Secret Labs AB # Copyright (c) 1995-2003 by Fredrik Lundh # Copyright (c) 2012 by Brian Crowell # # See the README file for information on usage and redistribution. # from struct import unpack, pack if byte...
mit
jsma/django-cms
cms/utils/helpers.py
6
4142
# -*- coding: utf-8 -*- import re from django.contrib.sites.models import SITE_CACHE, Site from django.utils.timezone import get_current_timezone_name from django.utils.translation import force_text from .compat.dj import is_installed SITE_VAR = "site__exact" def find_placeholder_relation(obj): return 'page' ...
bsd-3-clause
reneleban/jak-services
tests/test_list.py
1
1641
# -*- coding: utf-8 -*- import unittest import uuid from webtest import TestApp from src.list import app # mock for response TESTLIST = "testlist" TEST_BOARD_ID = str(uuid.uuid4()) TEST_TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMmJhNDNjM2MtNmMzYS00OTRiLThi" \ "MGYtZTUyYWJmMjJjYjNjIn...
gpl-3.0
creffett/barbican
barbican_client.py
1
2496
#!/usr/bin/python ## # Main python module of the barbican client ## from yapsy.PluginManager import PluginManager from ConfigParser import ConfigParser, NoOptionError from argparse import ArgumentParser from threading import Thread from plugins.plugin_classes import MonitoringPlugin, FirewallPlugin import logging impo...
apache-2.0
sjlehtin/django
tests/model_formsets_regress/models.py
72
1135
from django.db import models class User(models.Model): username = models.CharField(max_length=12, unique=True) serial = models.IntegerField() class UserSite(models.Model): user = models.ForeignKey(User, models.CASCADE, to_field="username") data = models.IntegerField() class UserProfile(models.Mode...
bsd-3-clause
ingmarschuster/ModelSelection
modsel/test/deflation_is.py
1
5593
# -*- coding: utf-8 -*- """ Created on Mon Jan 19 09:43:18 2015 @author: Ingmar Schuster """ from __future__ import division, print_function, absolute_import import numpy as np import scipy as sp import scipy.stats as stats from numpy import exp, log, sqrt from scipy.misc import logsumexp from numpy.linalg import i...
gpl-3.0
kordano/samba-ldb-mdb
source4/dsdb/tests/python/deletetest.py
11
14139
#!/usr/bin/env python # -*- coding: utf-8 -*- import optparse import sys import os sys.path.insert(0, "bin/python") import samba samba.ensure_external_module("testtools", "testtools") samba.ensure_external_module("subunit", "subunit/python") import samba.getopt as options from samba.auth import system_session from ...
gpl-3.0
dormbase/dormbase
dormbase/core/views.py
1
2534
# Dormbase -- open-source dormitory database system # Copyright (C) 2012 Alex Chernyakhovsky <achernya@mit.edu> # Drew Dennison <dennison@mit.edu> # Isaac Evans <ine@mit.edu> # Luke O'Malley <omalley1@mit.edu> # # This program is free software...
gpl-3.0
vipins/ccccms
env/Lib/site-packages/sekizai/helpers.py
2
3915
# -*- coding: utf-8 -*- from django.conf import settings from django.template import TextNode, VariableNode, NodeList, Variable from django.template.loader import get_template from django.template.loader_tags import BlockNode, ExtendsNode from sekizai.templatetags.sekizai_tags import RenderBlock def is_variable_exten...
bsd-3-clause
rve/pracmcm
ca/symme.py
2
10457
import random lane_num = 2 lane = [[], []] max_car_num = 10000 road_len = 1000 h = 6 p_b = 0.94 p_0 = 0.5 p_d = 0.1 v_max = [6, 10] gap = 7 p_car = 1 p_crash = 0 time_period = 200 class Car: car_cnt = 0 def __init__(self, v = 1, lane = 1): self.size = 1 if random.random() < 0.1: ...
mit
nikolas/lettuce
tests/integration/lib/Django-1.2.5/tests/regressiontests/dispatch/tests/test_saferef.py
70
2071
from django.dispatch.saferef import * import unittest class Test1(object): def x(self): pass def test2(obj): pass class Test2(object): def __call__(self, obj): pass class Tester(unittest.TestCase): def setUp(self): ts = [] ss = [] for x in xrange(5000): ...
gpl-3.0
amisrs/one-eighty
angular_flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escprober.py
2936
3187
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
dexterx17/nodoSocket
clients/Python-2.7.6/Lib/test/test_cmd_line.py
82
5271
# Tests invocation of the interpreter with various command line arguments # All tests are executed with environment variables ignored # See test_cmd_line_script.py for testing of script execution import test.test_support import sys import unittest from test.script_helper import ( assert_python_ok, assert_python_fa...
mit