repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
mongodb/mongo-python-driver
refs/heads/master
test/unicode/test_utf8.py
2
import sys sys.path[0:0] = [""] from bson import encode from bson.errors import InvalidStringData from test import unittest class TestUTF8(unittest.TestCase): # Verify that python and bson have the same understanding of # legal utf-8 if the first byte is 0xf4 (244) def _assert_same_utf8_validation(self,...
ntuecon/server
refs/heads/master
pyenv/Lib/site-packages/django/db/backends/dummy/base.py
429
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends.base.base import BaseDatabas...
chrismeyersfsu/ansible
refs/heads/devel
lib/ansible/modules/network/asa/asa_command.py
30
#!/usr/bin/python # # 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. # # Ansible is distribut...
mrb/letsencrypt
refs/heads/master
acme/acme/crypto_util_test.py
12
"""Tests for acme.crypto_util.""" import socket import threading import time import unittest from six.moves import socketserver # pylint: disable=import-error from acme import errors from acme import jose from acme import test_util class SSLSocketAndProbeSNITest(unittest.TestCase): """Tests for acme.crypto_uti...
cpyou/odoo
refs/heads/master
addons/website_hr/controllers/main.py
115
# -*- coding: utf-8 -*- from openerp import http from openerp.http import request class website_hr(http.Controller): @http.route(['/page/website.aboutus', '/page/aboutus'], type='http', auth="public", website=True) def blog(self, **post): hr_obj = request.registry['hr.employee'] employee_ids ...
UITools/saleor
refs/heads/master
saleor/graphql/core/utils.py
1
import graphene from django.core.exceptions import ValidationError def clean_seo_fields(data): """Extract and assign seo fields to given dictionary.""" seo_fields = data.pop('seo', None) if seo_fields: data['seo_title'] = seo_fields.get('title') data['seo_description'] = seo_fields.get('de...
llvm-mirror/lldb
refs/heads/master
packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
4
from __future__ import print_function import json import re import gdbremote_testcase from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestGdbRemoteThreadsInStopReply( gdbremote_testcase.GdbRemoteTestCaseBase): mydir = TestBase.compu...
BrotherPhil/django
refs/heads/master
tests/select_related_regress/tests.py
206
from __future__ import unicode_literals from django.test import TestCase from django.utils import six from .models import ( A, B, C, Building, Chick, Child, Class, Client, ClientStatus, Connection, Country, Device, Enrollment, Hen, Item, Organizer, Person, Port, SpecialClient, State, Student, TUser, ) c...
hnakamur/django-admin2
refs/heads/develop
example/blog/models.py
3
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, unicode_literals from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ @python_2_unicode_compatible class Post(models.Mod...
dreamsxin/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/ctypes/test/__main__.py
105
from ctypes.test import load_tests import unittest unittest.main()
krsjoseph/youtube-dl
refs/heads/master
youtube_dl/extractor/wimp.py
37
from __future__ import unicode_literals from .common import InfoExtractor from .youtube import YoutubeIE class WimpIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?wimp\.com/(?P<id>[^/]+)/' _TESTS = [{ 'url': 'http://www.wimp.com/maruexhausted/', 'md5': 'ee21217ffd66d058e8b16be340b74883', ...
sdrogers/ms2ldaviz
refs/heads/master
ms2ldaviz/decomposition/views.py
1
from django.shortcuts import render,HttpResponse from ipware.ip import get_client_ip import json from django.views.decorators.csrf import csrf_exempt from django.http import JsonResponse from decomposition.models import GlobalMotif,DocumentGlobalMass2Motif,Decomposition,GlobalMotifsToSets,MotifSet,FeatureSet,APIBatch...
zenodo/invenio
refs/heads/zenodo-master
invenio/legacy/bibindex/engine_stemmer_greek.py
16
# -*- coding: utf-8 -*- # # 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...
ProfessionalIT/maxigenios-website
refs/heads/master
sdk/google_appengine/lib/django-1.5/django/db/backends/mysql/validation.py
190
from django.db.backends import BaseDatabaseValidation class DatabaseValidation(BaseDatabaseValidation): def validate_field(self, errors, opts, f): """ MySQL has the following field length restriction: No character (varchar) fields can have a length exceeding 255 characters if they h...
cloudera/hue
refs/heads/master
apps/security/src/security/old_migrations/__init__.py
929
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
zdszxp/gamesrc
refs/heads/master
Trdlib/src/boost_1_60_0/tools/build/example/customization/verbatim.py
24
# Copyright 2010 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # This file is only used with Python port of Boost.Build # This file shows some of the primary customization mechanisms in Boost.Build V2 # an...
blacklin/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/unittest/test/test_skipping.py
73
import unittest from unittest.test.support import LoggingResult class Test_TestSkipping(unittest.TestCase): def test_skipping(self): class Foo(unittest.TestCase): def test_skip_me(self): self.skipTest("skip") events = [] result = LoggingResult(events) ...
asajeffrey/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/wptserve/tests/test_replacement_tokenizer.py
28
from __future__ import unicode_literals import pytest from wptserve.pipes import ReplacementTokenizer @pytest.mark.parametrize( "content,expected", [ [b"aaa", [('ident', 'aaa')]], [b"bbb()", [('ident', 'bbb'), ('arguments', [])]], [b"bcd(uvw, xyz)", [('ident', 'bcd'), ('arguments', ['...
ArcherSys/ArcherSys
refs/heads/master
eclipse/plugins/org.python.pydev.jython_4.5.5.201603221110/Lib/argparse.py
95
# Author: Steven J. Bethard <steven.bethard@gmail.com>. """Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages - supports parsers that dispatch to sub-parsers The...
jloehel/python_smaclient
refs/heads/dependabot/pip/pyyaml-5.4
docs/conf.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # python_smaclient documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in t...
Elettronik/SickRage
refs/heads/master
lib/httplib2/socks.py
811
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. 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 ...
denys-duchier/django
refs/heads/master
tests/custom_migration_operations/more_operations.py
530
from django.db.migrations.operations.base import Operation class TestOperation(Operation): def __init__(self): pass def deconstruct(self): return ( self.__class__.__name__, [], {} ) @property def reversible(self): return True d...
kaarl/pyload
refs/heads/stable
module/plugins/accounts/FilesMailRu.py
5
# -*- coding: utf-8 -*- from module.plugins.internal.Account import Account class FilesMailRu(Account): __name__ = "FilesMailRu" __type__ = "account" __version__ = "0.17" __status__ = "testing" __description__ = """Filesmail.ru account plugin""" __license__ = "GPLv3" __authors...
micropython/micropython
refs/heads/master
tests/basics/builtin_setattr.py
23
class A: var = 132 def __init__(self): self.var2 = 34 a = A() setattr(a, "var", 123) setattr(a, "var2", 56) print(a.var) print(a.var2) try: setattr(a, b'var3', 1) except TypeError: print('TypeError') # try setattr on a built-in function try: setattr(int, 'to_bytes', 1) except (Attribut...
jacobwegner/django-user-accounts
refs/heads/master
account/mixins.py
21
from __future__ import unicode_literals from account.conf import settings from account.utils import handle_redirect_to_login class LoginRequiredMixin(object): redirect_field_name = "next" login_url = None def dispatch(self, request, *args, **kwargs): self.request = request self.args = a...
siyei/python-whatsapp-bot
refs/heads/master
modules/eliza.py
3
#---------------------------------------------------------------------- # eliza.py # # a cheezy little Eliza knock-off by Joe Strout <joe@strout.net> # with some updates by Jeff Epler <jepler@inetnebr.com> # hacked into a module and updated by Jez Higgins <jez@jezuk.co.uk> # last revised: 28 February 2005 #...
caveman-dick/ansible
refs/heads/devel
lib/ansible/modules/cloud/webfaction/webfaction_db.py
29
#!/usr/bin/python # # (c) Quentin Stafford-Fraser 2015, with contributions gratefully acknowledged from: # * Andy Baker # * Federico Tarantini # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # # Create a webfaction database using Ansible and the Webfaction API fro...
smmribeiro/intellij-community
refs/heads/master
python/testData/quickFixes/PyRemoveDictKeyQuickFixTest/inTheMiddle_after.py
80
a = {'x':1, "y":2, "c":2}
laslabs/odoo
refs/heads/9.0
addons/board/__openerp__.py
18
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Dashboards', 'version': '1.0', 'category': 'Extra Tools', 'summary': 'Create your custom dashboard', 'description': """ Lets the user create a custom dashboard. ============================...
Siddartha07/elasticsearch
refs/heads/master
dev-tools/get-bwc-version.py
136
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
ilexius/odoo
refs/heads/master
addons/website_hr_recruitment/models/hr_applicant.py
44
# -*- coding: utf-8 -*- from openerp.osv import osv class hr_applicant(osv.Model): _inherit = 'hr.applicant' def website_form_input_filter(self, request, values): if 'partner_name' in values: values.setdefault('name', '%s\'s Application' % values['partner_name']) return values
cogitate/twitter-zipkin-uuid
refs/heads/uuid-work
doc/src/sphinx/exts/includecode.py
121
import os import codecs from os import path from docutils import nodes from docutils.parsers.rst import Directive, directives class IncludeCode(Directive): """ Include a code example from a file with sections delimited with special comments. """ has_content = False required_arguments = 1 opti...
yongshengwang/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/test_client_regress/session.py
155
from django.contrib.sessions.backends.base import SessionBase class SessionStore(SessionBase): """ A simple cookie-based session storage implementation. The session key is actually the session data, pickled and encoded. This means that saving the session will change the session key. """ def __...
all-umass/manifold_spanning_graphs
refs/heads/master
viz.py
1
import numpy as np from matplotlib import pyplot def scatterplot(X, marker='.', title=None, fig=None, ax=None, **kwargs): '''General plotting function for a set of points X. May be [1-3] dimensional.''' assert len(X.shape) in (1,2), 'Only valid for 1 or 2-d arrays of points' assert len(X.shape) == 1 or X.shape[...
alexander-95/client_python
refs/heads/master
prometheus_client/exposition.py
3
#!/usr/bin/python from __future__ import unicode_literals import os import socket import time import threading from . import core try: from BaseHTTPServer import BaseHTTPRequestHandler from BaseHTTPServer import HTTPServer from urllib2 import build_opener, Request, HTTPHandler from urllib import quot...
mhrheaume/puz
refs/heads/master
puz/tests/test_package_use.py
1
# Copyright (C) 2013 Matthew Rheaume # # 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...
Overkiz/webiopi
refs/heads/master
python/webiopi/devices/extendedcomm.py
1
## Copyright Overkiz import serial import time import glob from webiopi.utils.logger import debug try: import _webiopi.GPIO as GPIO except: pass def getFunctionFromStr(functionStr): function = -1 if functionStr =="INP" : function = GPIO.IN elif functionStr == "OPP" : function = GPIO.OUT elif functio...
lisprolog/python
refs/heads/master
rotate_hole.py
1
''' Sometimes humans build weird things. Our Robots have discovered and wish to use an ancient circular cannon loading system. This system looks like numbered pipes arranged in a circular manner. There is a rotating mechanism behind these pipes, and the cannons are attached to the end. This system is incredibly anc...
zanderle/django
refs/heads/master
django/utils/inspect.py
146
from __future__ import absolute_import import inspect from django.utils import six def getargspec(func): if six.PY2: return inspect.getargspec(func) sig = inspect.signature(func) args = [ p.name for p in sig.parameters.values() if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWOR...
remiemalik/concourse
refs/heads/develop
concourse-driver-python/concourse/thriftapi/data/ttypes.py
9
# # Autogenerated by Thrift Compiler (0.9.2) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ..shared.ttypes import * # must use relative import or pdoc breaks from thrift.transport imp...
hungtt57/matchmaker
refs/heads/master
lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/operations.py
80
from __future__ import unicode_literals from psycopg2.extras import Inet from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations class DatabaseOperations(BaseDatabaseOperations): def unification_cast_sql(self, output_field): internal_type = output_field.get...
devlights/try-python
refs/heads/master
trypython/stdlib/json_/json01.py
1
# coding: utf-8 """ jsonモジュールについてのサンプルです。 """ import json import pathlib from trypython.common.commoncls import SampleBase from trypython.common.commonfunc import pr class Sample(SampleBase): def exec(self): # # jsonモジュールには load() と dump() がある # また、文字列で処理するための loads(), dumps() もある ...
IsCoolEntertainment/debpkg_libcloud
refs/heads/master
libcloud/test/compute/test_vpsnet.py
3
# 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 ...
moulecorp/greezly
refs/heads/greezly
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
smallyear/linuxLearn
refs/heads/master
salt/salt/utils/timed_subprocess.py
1
# -*- coding: utf-8 -*- '''For running command line executables with a timeout''' from __future__ import absolute_import import subprocess import threading import salt.exceptions from salt.ext import six class TimedProc(object): ''' Create a TimedProc object, calls subprocess.Popen with passed args and **kwa...
Ye-Yong-Chi/docker-py
refs/heads/master
docker/utils/decorators.py
24
import functools from .. import errors from . import utils def check_resource(f): @functools.wraps(f) def wrapped(self, resource_id=None, *args, **kwargs): if resource_id is None: if kwargs.get('container'): resource_id = kwargs.pop('container') elif kwargs.get...
ChenJunor/hue
refs/heads/master
desktop/libs/libsentry/src/libsentry/tests.py
17
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
hortonworks/hortonworks-sandbox
refs/heads/master
desktop/core/ext-py/Django-1.2.3/django/core/servers/fastcgi.py
28
""" FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol. Uses the flup python package: http://www.saddi.com/software/flup/ This is a adaptation of the flup package to add FastCGI server support to run Django apps from Web servers that support the FastCGI protocol. This module can be run standalo...
ssdxiao/kimchi
refs/heads/master
src/kimchi/control/networks.py
1
# # Project Kimchi # # Copyright IBM, Corp. 2013 # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This lib...
rogerscristo/BotFWD
refs/heads/master
env/lib/python3.6/site-packages/chardet/sbcsgroupprober.py
273
######################## 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...
temasek/lge-kernel-star
refs/heads/cm-10.1
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
HEPData/hepdata-converter
refs/heads/master
hepdata_converter/testsuite/test_yamlparser.py
1
# -*- encoding: utf-8 -*- import hepdata_converter from hepdata_converter.testsuite import insert_path, insert_data_as_str from hepdata_converter.testsuite.test_writer import WriterTestSuite __author__ = 'Michał Szostak' class YAMLWriterTestSuite(WriterTestSuite): @insert_path('yaml_qual') @insert_data_as_st...
priyom/priyomdb
refs/heads/master
graphtest.py
1
#!/usr/bin/python2 """ File name: graphtest.py This file is part of: priyomdb LICENSE The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/ S...
ericlink/adms-server
refs/heads/master
playframework-dist/1.1-src/python/Lib/CGIHTTPServer.py
2
"""CGI-savvy HTTP Server. This module builds on SimpleHTTPServer by implementing GET and POST requests to cgi-bin scripts. If the os.fork() function is not present (e.g. on Windows), os.popen2() is used as a fallback, with slightly altered semantics; if that function is not present either (e.g. on Macintosh), ...
fxsjy/pybrain
refs/heads/master
pybrain/datasets/importance.py
5
__author__ = 'Tom Schaul, tom@idsia.ch' from scipy import ones, dot from sequential import SequentialDataSet from pybrain.utilities import fListToString # CHECKME: does this provide for importance-datasets in the non-sequential case # maybe there should be a second class - or another structure! class ImportanceDa...
helena-project/beetle
refs/heads/master
controller/manager/application/manager.py
1
import socket import os import sys import threading import warnings from main.constants import SESSION_TOKEN_LEN from main.settings import BASE_DIR from network.models import ConnectedGateway, ConnectedDevice IPC_COMMAND_PATH = BASE_DIR + "/manager-ipc" class ManagerException(Exception): """Exception thrown by ma...
devs1991/test_edx_docmode
refs/heads/master
venv/lib/python2.7/site-packages/html5lib/treebuilders/etree_lxml.py
1724
"""Module for supporting the lxml.etree library. The idea here is to use as much of the native library as possible, without using fragile hacks like custom element names that break between releases. The downside of this is that we cannot represent all possible trees; specifically the following are known to cause proble...
Georgiiagon/equanimous-meow
refs/heads/master
meow.py
2
for i in range(100): print('Meow world')
HenrikSolver/micropython
refs/heads/master
tests/basics/equal.py
118
# test equality print(None == None) print(False == None) print(False == False) print(False == True) print(() == ()) print(() == []) print([] == []) print(() == {}) print({} == ()) print(() == None) print(() == False) print(() == print) print([] == None) print([] == False) print([] == print) print({} == None) prin...
sallyyoo/ced2
refs/heads/master
py/可变参数.py
1
def report(name,*grades): sum = 0 for grade in grades: sum += grade print("%s's total score is %d" % (name,sum)) report('mike',90,89,38,59)
michael-dev2rights/ansible
refs/heads/ansible-d2r
lib/ansible/modules/network/lenovo/cnos_vlag.py
26
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, 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 # ...
bthirion/scikit-learn
refs/heads/master
sklearn/datasets/tests/test_mldata.py
384
"""Test functionality of mldata fetching utilities.""" import os import shutil import tempfile import scipy as sp from sklearn import datasets from sklearn.datasets import mldata_filename, fetch_mldata from sklearn.utils.testing import assert_in from sklearn.utils.testing import assert_not_in from sklearn.utils.test...
baiyunping333/BurpSuite-Plugins
refs/heads/master
faraday/model/controller.py
2
''' Faraday Penetration Test IDE - Community Version Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/) See the file 'doc/LICENSE' for the license information ''' import time import threading import Queue import traceback import datetime import model.common # this is to make sure the factory is created imp...
boompieman/iim_project
refs/heads/master
project_python2/lib/python2.7/site-packages/pattern/server/cherrypy/cherrypy/_cptree.py
40
"""CherryPy Application and Tree objects.""" import os import sys import cherrypy from cherrypy._cpcompat import ntou, py3k from cherrypy import _cpconfig, _cplogging, _cprequest, _cpwsgi, tools from cherrypy.lib import httputil class Application(object): """A CherryPy Application. Servers and gateways sho...
kudlav/dnf
refs/heads/master
dnf/automatic/__init__.py
22
# __init__.py # dnf.automatic toplevel. # # Copyright (C) 2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is...
iniverno/RnR-LLC
refs/heads/master
simics-3.0-install/simics-3.0.31/amd64-linux/lib/python/mod_local_space_mapper_commands.py
2
## Copyright 2003-2007 Virtutech AB from cli import * import sim_commands def get_info(obj): spaces = obj.memory_spaces return [("Space translations", [(spaces[i][0].name, spaces[i][1].name) for i in range(len(spaces))])] sim_commands.new_info_command("local-space-mapper", g...
tianyi33/simple_blog
refs/heads/master
django/contrib/localflavor/ch/forms.py
101
""" Swiss-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.ch.ch_states import STATE_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select f...
madscatt/zazzie_1.5
refs/heads/master
trunk/sassie/tools/merge_utilities/merge_utilities.py
1
''' SASSIE: Copyright (C) 2011 Joseph E. Curtis, Ph.D. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
andymckay/zamboni
refs/heads/master
mkt/webpay/serializers.py
2
from rest_framework import serializers from mkt.webpay.models import ProductIcon class ProductIconSerializer(serializers.ModelSerializer): url = serializers.SerializerMethodField('get_url') def get_url(self, obj): if not obj.pk: return '' return obj.url() class Meta: ...
Elandril/SickRage
refs/heads/master
lib/hachoir_parser/image/common.py
95
from hachoir_core.field import FieldSet, UserVector, UInt8 class RGB(FieldSet): color_name = { ( 0, 0, 0): "Black", (255, 0, 0): "Red", ( 0, 255, 0): "Green", ( 0, 0, 255): "Blue", (255, 255, 255): "White", } static_size = 24 def createFields(self...
webgeodatavore/django
refs/heads/master
tests/known_related_objects/tests.py
363
from __future__ import unicode_literals from django.test import TestCase from .models import Organiser, Pool, PoolStyle, Tournament class ExistingRelatedInstancesTests(TestCase): @classmethod def setUpTestData(cls): cls.t1 = Tournament.objects.create(name='Tourney 1') cls.t2 = Tournament.ob...
KuKuKai/104asiajava
refs/heads/master
stock.py
1
# -*- coding: utf-8 -*- """ Created on Mon Oct 22 01:44:49 2018 @author: JinJheng """ import requests #requests:幫我們抓取 csv 檔 from io import StringIO import pandas as pd #pandas:幫我們選股 import numpy as np datestr = '20181018' r = requests.post('http://www.twse.com.tw/exch...
jonparrott/google-cloud-python
refs/heads/master
videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/transports/video_intelligence_service_grpc_transport.py
2
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
40223117cda/w17test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/importlib/_bootstrap.py
623
"""Core implementation of import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public-facing ver...
thinkopensolutions/l10n-brazil
refs/heads/10.0
financial/wizards/financial_edit.py
5
# -*- coding: utf-8 -*- # Copyright 2017 KMEE # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, fields, models class FinancialEdit(models.TransientModel): _name = 'financial.edit' name = fields.Char() currency_id = fields.Many2one( comodel_name='res.currency'...
PennartLoettring/Poettrix
refs/heads/master
rootfs/usr/lib/python3.4/site-packages/libmount/__init__.py
44
from .pylibmount import *
caronc/nzbget-subliminal
refs/heads/master
Subliminal/apprise/plugins/NotifyWindows.py
1
# -*- coding: utf-8 -*- # # Windows Notify Wrapper # # Copyright (C) 2017-2018 Chris Caron <lead2gold@gmail.com> # # This file is part of apprise. # # 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 Fo...
manahl/arctic
refs/heads/master
arctic/store/_pickle_store.py
1
import io import logging from operator import itemgetter import bson import six from bson.binary import Binary from bson.errors import InvalidDocument from six.moves import cPickle, xrange from ._version_store_utils import checksum, pickle_compat_load, version_base_or_id from .._compression import decompress, compres...
gregdek/ansible
refs/heads/devel
lib/ansible/modules/network/fortimanager/fmgr_device_config.py
14
#!/usr/bin/python # # 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. # # Ansible is distribut...
openstack/python-heatclient
refs/heads/master
heatclient/osc/v1/resource_type.py
1
# 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 # distrib...
zennobjects/kivy
refs/heads/master
kivy/context.py
4
''' Context ======= .. versionadded:: 1.8.0 .. warning:: This is experimental and subject to change as long as this warning notice is present. Kivy have few "global" instances that is used directly by many piece of the framework: `Cache`, `Builder`, `Clock`. TODO: document this module. ''' __all__ = ('Co...
Orange9000/Codewars
refs/heads/master
Solutions/6kyu/6kyu_is_mac48_address.py
1
import re is_mac_48_address = lambda address: bool(re.fullmatch('-'.join(['[0-9A-F]{2}']*6), address))
amw2104/fireplace
refs/heads/master
tests/test_mechanics.py
1
from utils import * from fireplace.cards.utils import Give, JOUST def test_armor(): game = prepare_game(WARRIOR, WARRIOR) assert game.current_player.hero.armor == 0 assert not game.current_player.hero.power.exhausted assert game.current_player.hero.power.is_usable() game.current_player.hero.power.use() assert g...
hpi-xnor/BMXNet
refs/heads/master
example/reinforcement-learning/dqn/replay_memory.py
43
# 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...
iglpdc/nipype
refs/heads/master
nipype/workflows/dmri/fsl/tests/__init__.py
156
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et:
inveniosoftware/flask-security-fork
refs/heads/master
flask_security/views.py
3
# -*- coding: utf-8 -*- """ flask_security.views ~~~~~~~~~~~~~~~~~~~~ Flask-Security views module :copyright: (c) 2012 by Matt Wright. :license: MIT, see LICENSE for more details. """ from flask import Blueprint, after_this_request, current_app, jsonify, \ redirect, request from flask_login i...
albertomurillo/ansible
refs/heads/devel
lib/ansible/modules/network/fortios/fortios_vpn_ipsec_phase2.py
21
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, 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 3 of the Lic...
ledtvavs/repository.ledtv
refs/heads/master
script.module.liveresolver/lib/liveresolver/modules/recaptcha_v2.py
10
# -*- coding: utf-8 -*- """ urlresolver XBMC Addon Copyright (C) 2016 tknorris Derived from Shani's LPro Code (https://github.com/Shani-08/ShaniXBMCWork2/blob/master/plugin.video.live.streamspro/unCaptcha.py) This program is free software: you can redistribute it and/or modify it under the terms of...
mspark93/VTK
refs/heads/master
Rendering/Core/Testing/Python/TestRotate.py
20
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() cone = vtk.vtkConeSource() cone.SetRadius(0.05) cone.SetHeight(0.25) cone.SetResolution(256) cone.SetCenter(0.15,0.0,0.15) rotate = vtk.vtkRotationFilter() rotate.SetInputConnection(c...
freevo/kaa-candy
refs/heads/master
src/widgets/text.py
1
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------------- # text.py - multiline text widget # ----------------------------------------------------------------------------- # kaa-candy - Fourth generation Canvas System using Clutter as backend # Copyright (C) 2011 Dirk ...
ansible/ansible
refs/heads/devel
lib/ansible/plugins/doc_fragments/default_callback.py
11
# -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # 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 class ModuleDocFragment(object): DOCUMENTATION = r''' options: ...
yueyongyue/saltshaker
refs/heads/master
utility/models.py
10644
from django.db import models # Create your models here.
kenshay/ImageScript
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/scipy/linalg/basic.py
5
# # Author: Pearu Peterson, March 2002 # # w/ additions by Travis Oliphant, March 2002 # and Jake Vanderplas, August 2012 from __future__ import division, print_function, absolute_import from warnings import warn import numpy as np from numpy import atleast_1d, atleast_2d from .flinalg import get_flinalg...
bowlofstew/common
refs/heads/develop
model/declare/data_declaration.py
5
from biicode.common.utils.bii_logging import logger from biicode.common.model.brl.block_cell_name import BlockCellName from biicode.common.exception import BiiException import os from biicode.common.model.declare.declaration import Declaration from biicode.common.model.deps_props import DependenciesProperties class D...
saurabh6790/tru_app_back
refs/heads/master
patches/october_2012/update_permission.py
30
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals def execute(): import webnotes webnotes.conn.sql(""" delete from `tabDocPerm` where role in ('Sales User', 'Sales Manager', 'Sales Master M...
EmreAtes/spack
refs/heads/develop
var/spack/repos/builtin/packages/py-py/package.py
1
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
bOOm-X/spark
refs/heads/master
examples/src/main/python/ml/vector_indexer_example.py
123
# # 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...
ProfessionalIT/professionalit-webiste
refs/heads/master
sdk/google_appengine/lib/webob-1.1.1/webob/datetime_utils.py
21
import time import calendar from datetime import datetime, date, timedelta, tzinfo from email.utils import parsedate_tz, mktime_tz, formatdate __all__ = [ 'UTC', 'timedelta_to_seconds', 'year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'parse_date', 'serialize_date', 'parse_date_delta', 'seri...
angyukai/boulderactive2016-landing-page
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
388
# 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. """ This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import os import re import subprocess import sys fr...
lsst-sqre/ltd-keeper
refs/heads/master
keeper/editiontracking/__init__.py
1
from .trackingmodes import EditionTrackingModes