repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
rmfitzpatrick/ansible
refs/heads/devel
lib/ansible/module_utils/vyos.py
1
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
tpo/ansible
refs/heads/devel
test/units/modules/conftest.py
35
# 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 import json import pytest from ansible.module_utils.six import string_types from ansible.module_ut...
MoamerEncsConcordiaCa/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/ops/kullback_leibler.py
24
# 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...
ozamiatin/glance
refs/heads/master
glance/api/common.py
9
# Copyright 2012 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 req...
liqd/adhocracy
refs/heads/develop
src/adhocracy/migration/versions/050_instance_require_valid_email.py
6
from sqlalchemy import Column, ForeignKey, MetaData, Table, Float from sqlalchemy import Boolean, DateTime, Integer, Unicode, UnicodeText from sqlalchemy import func metadata = MetaData() instance_table = Table( 'instance', metadata, Column('id', Integer, primary_key=True), Column('key', Unicode(20), nul...
ondrik/pubman
refs/heads/master
pubman/models.py
1
from django.db import models ############################################################################### class Author(models.Model): first_name = models.CharField(max_length=128, null=True) last_name = models.CharField(max_length=128) def __str__(self): ''' Conversion to a string. ...
R4stl1n/allianceauth
refs/heads/master
allianceauth/services/modules/teamspeak3/__init__.py
5
default_app_config = 'allianceauth.services.modules.teamspeak3.apps.Teamspeak3ServiceConfig'
vicky2135/lucious
refs/heads/master
lucious/lib/python2.7/site-packages/setuptools/glob.py
130
""" Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * `bytes` changed to `six.binary_type`. * Hidden files are not ignored. """ import os import re import fnmatch from six import binary_type __all__ = ["glob", "iglob", "escape"] def gl...
jakobworldpeace/scikit-learn
refs/heads/master
sklearn/cluster/mean_shift_.py
42
"""Mean shift clustering algorithm. Mean shift clustering aims to discover *blobs* in a smooth density of samples. It is a centroid based algorithm, which works by updating candidates for centroids to be the mean of the points within a given region. These candidates are then filtered in a post-processing stage to elim...
achang97/YouTunes
refs/heads/master
lib/python2.7/site-packages/youtube_dl/extractor/veoh.py
18
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..utils import ( int_or_none, ExtractorError, sanitized_Request, ) class VeohIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?veoh\.com/(?:watch|iphone/#_Watch)/(?P<id>(?:v|e|yapi-)[\da-zA-Z]+)' ...
sarthakmeh03/django
refs/heads/master
django/contrib/sessions/backends/signed_cookies.py
82
from django.conf import settings from django.contrib.sessions.backends.base import SessionBase from django.core import signing class SessionStore(SessionBase): def load(self): """ We load the data from the key itself instead of fetching from some external data store. Opposite of _get_sess...
Zhongqilong/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/tkinter/test/test_ttk/test_widgets.py
59
import unittest import tkinter from tkinter import ttk from test.support import requires import sys from tkinter.test.test_ttk.test_functions import MockTclObj from tkinter.test.support import (AbstractTkTest, tcl_version, get_tk_patchlevel, simulate_mouse_click) from tkinter.test.wid...
jarble/Polyglot-code-generator
refs/heads/master
examples/grammars/englishToPython.py
1
englishToPython = [ #Start of final outputs [["end (else|if|loop|for|while|def)"], "", "final"], [["the output of this shell command : <<foo>>"], "subprocess.Popen(<<foo>>, stdout=subprocess.PIPE).communicate()[0]", "final"], [["<<list>> (|(sorted|arranged) )(from longest to shortest|(in|by) (order of length|order ...
ZubairLK/CI20_linux
refs/heads/wip-ci20-v4.0-rc1-myrc1
Documentation/target/tcm_mod_builder.py
200
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
Work4Labs/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/tests/modeltests/lookup/__init__.py
12133432
beni55/olympia
refs/heads/master
apps/amo/management/commands/__init__.py
12133432
ProfessionalIT/maxigenios-website
refs/heads/master
sdk/google_appengine/lib/django-1.2/django/contrib/localflavor/fr/__init__.py
12133432
hydroshare/hydroshare
refs/heads/develop
hs_geographic_feature_resource/tests/__init__.py
12133432
SerCeMan/intellij-community
refs/heads/master
python/testData/refactoring/move/relativeImportSourceWithSpacesInsideMovedModule/after/src/pkg/__init__.py
12133432
izgzhen/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pytest/testing/python/raises.py
171
import pytest class TestRaises: def test_raises(self): source = "int('qwe')" excinfo = pytest.raises(ValueError, source) code = excinfo.traceback[-1].frame.code s = str(code.fullsource) assert s == source def test_raises_exec(self): pytest.raises(ValueError, "a,...
cgcgbcbc/django-xadmin
refs/heads/master
xadmin/plugins/multiselect.py
19
#coding:utf-8 from itertools import chain import xadmin from django import forms from django.db.models import ManyToManyField from django.forms.util import flatatt from django.template import loader from django.utils.encoding import force_unicode from django.utils.html import escape, conditional_escape from django.uti...
kynikos/outspline
refs/heads/master
src/outspline/extensions/organism_basicrules/occur_regularly.py
1
# Outspline - A highly modular and extensible outliner. # Copyright (C) 2011 Dario Giovannetti <dev@dariogiovannetti.net> # # This file is part of Outspline. # # Outspline 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 F...
trunca/enigma2
refs/heads/6.5
lib/python/Components/Converter/ChannelCryptoInfo.py
15
# # ChannelCryptoInfo Converter by mcbain // v0.1 // 20111109 # from enigma import iServiceInformation from Components.Converter.Converter import Converter from Components.Element import cached from Poll import Poll import os ECM_INFO = '/tmp/ecm.info' old_ecm_mtime = None data = None class ChannelCryptoInfo(Poll, ...
MichaelNedzelsky/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/superclassAsLocal.py
83
class A(object): def method(self): pass C = A class B(C): pass b = B() b.method() #Unresolved attribute reference 'method' for class 'B'
msrb/samba
refs/heads/master
third_party/dnspython/dns/rdtypes/ANY/DNSKEY.py
76
# Copyright (C) 2004-2007, 2009-2011 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 "...
MSeifert04/astropy
refs/heads/master
astropy/timeseries/tests/test_binned.py
7
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from numpy.testing import assert_equal, assert_allclose from astropy import units as u from astropy.time import Time, TimeDelta from astropy.utils.data import get_pkg_data_filename from astropy.timeseries.periodograms import BoxLeastSquare...
Reinaesaya/OUIRL-ChatBot
refs/heads/master
chatterbot/imgcaption/commu_server.py
1
import socket import sys import os import time import client_cv def run_image_capturing_server(host='', port=8075, target_host='192.168.0.113', target_port=8092, resizefactor=1): try: s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((host,port)) ...
Soya93/Extract-Refactoring
refs/heads/master
python/lib/Lib/os.py
74
r"""OS routines for Mac, NT, or Posix depending on what system we're on. This exports: - all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc. - os.path is one of the modules posixpath, or ntpath - os.name is 'posix', 'nt', 'os2', 'ce' or 'riscos' - os.curdir is a string representing the current di...
drxaero/calibre
refs/heads/master
src/calibre/ebooks/oeb/polish/tests/base.py
14
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import os, unittest, shutil from calibre import CurrentDir from calibre.pte...
imsplitbit/nova
refs/heads/master
nova/openstack/common/rpc/service.py
13
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not...
Widiot/simpleblog
refs/heads/master
venv/lib/python3.5/site-packages/alembic/autogenerate/rewriter.py
38
from alembic import util from alembic.operations import ops class Rewriter(object): """A helper object that allows easy 'rewriting' of ops streams. The :class:`.Rewriter` object is intended to be passed along to the :paramref:`.EnvironmentContext.configure.process_revision_directives` parameter i...
SAM-IT-SA/odoo
refs/heads/8.0
addons/l10n_ca/__init__.py
438
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it...
shubhdev/openedx
refs/heads/master
common/lib/xmodule/xmodule/partitions/tests/__init__.py
12133432
praekelt/vumi-go
refs/heads/develop
go/conversation/templatetags/__init__.py
12133432
mexeniz/django-oscar
refs/heads/master
tests/unit/dashboard/__init__.py
12133432
richardcs/ansible
refs/heads/devel
lib/ansible/modules/net_tools/netbox/__init__.py
12133432
kuba/letsencrypt
refs/heads/master
acme/acme/util.py
52
"""ACME utilities.""" import six def map_keys(dikt, func): """Map dictionary keys.""" return dict((func(key), value) for key, value in six.iteritems(dikt))
openlabs/mongo-python-driver
refs/heads/master
distribute_setup.py
6
#!python """Bootstrap distribute installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from distribute_setup import use_setuptools use_setuptools() If you want to require a specific version of se...
samtx/whatsmyrankine
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.py
2929
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
viki9698/jizhanggroup
refs/heads/master
django/contrib/webdesign/lorem_ipsum.py
230
""" Utility functions for generating "lorem ipsum" Latin text. """ from __future__ import unicode_literals import random COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ...
venn177/heroesoflegend.py
refs/heads/master
setup.py
1
from distutils.core import setup setup( name = 'heroesoflegend.py', packages = ['heroesoflegend.py'], # this must be the same as the name above version = '0.1', description = 'Converting Heroes of Legend to a python package', author = 'venn177', author_email = 'venn177@gmail.com', url = 'https://github.co...
Fsero/security_monkey
refs/heads/master
security_monkey/views/account.py
6
# Copyright 2014 Netflix, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
ysekky/chainer
refs/heads/master
tests/chainer_tests/functions_tests/array_tests/test_dstack.py
6
import unittest import numpy import six import chainer from chainer import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.utils import type_check @testing.parameterize(*testing.product_dict( [ {'shape': (2, ...
au9ustine/org.au9ustine.puzzles.codility
refs/heads/master
test/__init__.py
75
from __future__ import absolute_import from __future__ import division from __future__ import print_function
dluschan/school
refs/heads/master
olymp/divisible.py
1
digits = [0 for i in range(10)] for c in input(): digits[int(c)] += 1 sum = 0 for i in range(10): sum += i * digits[i] if sum % 3 != 0: for i in range(10): if digits[i] > 0 and (sum - i) % 3 == 0: digits[i] -= 1 sum -= i break for step in range(2): if sum %...
lulandco/SickRage
refs/heads/develop
lib/js2py/utils/__init__.py
12133432
sudheerchintala/LearnEraPlatForm
refs/heads/master
common/test/acceptance/pages/__init__.py
12133432
yencarnacion/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.5/tests/modeltests/serializers/tests.py
51
from __future__ import absolute_import, unicode_literals # -*- coding: utf-8 -*- import json from datetime import datetime from xml.dom import minidom from django.conf import settings from django.core import serializers from django.db import transaction, connection from django.test import TestCase, TransactionTestCas...
onitake/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_trafficmanagerendpoint.py
15
#!/usr/bin/python # # Copyright (c) 2018 Hai Cao, <t-haicao@microsoft.com>, Yunge Zhu <yungez@microsoft.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 = {'metadat...
0x7678/youtube-dl
refs/heads/master
youtube_dl/extractor/bet.py
16
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse from ..utils import ( xpath_text, xpath_with_ns, int_or_none, parse_iso8601, ) class BetIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?bet\.com/(?:[^/]+/)+(?P<id>.+?)\.html' ...
jumpstarter-io/neutron
refs/heads/master
neutron/tests/unit/test_auth.py
9
# Copyright 2012 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...
shosca/django-rest-witchcraft
refs/heads/master
rest_witchcraft/__init__.py
1
from .__version__ import __author__, __author_email__, __description__, __version__ # noqa
Gateworks/platform-external-chromium_org
refs/heads/imx_kk4.4.3_2.0.0-beta
tools/lsan/PRESUBMIT.py
24
# 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. """ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the presubmit API built into gcl. """ import re def Che...
p4datasystems/CarnotKE
refs/heads/master
jyhton/Lib/test/pickletester.py
10
import unittest import pickle import cPickle import StringIO import cStringIO import pickletools import copy_reg from test.test_support import (TestFailed, have_unicode, TESTFN, _2G, _1M, precisionbigmemtest, is_jython) # Tests that try a number of pickle protocols should have a # f...
adammaikai/OmicsPipe2.0
refs/heads/master
omics_pipe/main.py
2
#!/usr/bin/env python import os import sys import stat import urllib from optparse import OptionParser import webbrowser as browser import argparse from omics_pipe.parameters.default_parameters import default_parameters import yaml from omics_pipe.utils import * import runpy import subprocess import os.path import cs...
Piasy/proxy-searcher
refs/heads/master
site-packages/django/contrib/localflavor/jp/__init__.py
12133432
terotic/devheldev
refs/heads/master
users/migrations/__init__.py
12133432
lilydjwg/tornado
refs/heads/master
tornado/platform/__init__.py
12133432
bratsche/Neutron-Drive
refs/heads/master
google_appengine/lib/django_1_3/tests/regressiontests/settings_tests/models.py
12133432
semonte/intellij-community
refs/heads/master
python/testData/inspections/PyMissingTypeHintsInspection/noAnnotations.py
30
def <weak_warning descr="Type hinting is missing for function definition">foo</weak_warning>(x, y): pass
jazkarta/edx-platform
refs/heads/master
lms/lib/comment_client/user.py
144
from .utils import merge_dict, perform_request, CommentClientRequestError import models import settings class User(models.Model): accessible_fields = [ 'username', 'follower_ids', 'upvoted_ids', 'downvoted_ids', 'id', 'external_id', 'subscribed_user_ids', 'children', 'course_id', 'group_...
scienceopen/robust-flow
refs/heads/master
BlackRobustFlow.py
1
#!/usr/bin/env python import logging import imageio from pathlib import Path import numpy as np from robustflow import runblack,loadflow from matplotlib.pyplot import figure,show if __name__ == '__main__': from argparse import ArgumentParser p = ArgumentParser() p.add_argument('pgmstem',help='stem of pgm f...
weave-lab/nw.js
refs/heads/nw13
tools/package_binaries.py
64
#!/usr/bin/env python import argparse import getnwisrelease import getnwversion import gzip import os import platform import shutil import sys import tarfile import zipfile from subprocess import call steps = ['nw', 'chromedriver', 'symbol', 'headers', 'others'] ################################ # Parse command line a...
albertjan/pypyjs-presentation
refs/heads/gh-pages
assets/js/pypy.js-0.3.1/lib/modules/encodings/mac_iceland.py
593
""" Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
hickford/youtube-dl
refs/heads/master
youtube_dl/extractor/foxnews.py
50
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_iso8601, int_or_none, ) class FoxNewsIE(InfoExtractor): IE_DESC = 'Fox News and Fox Business Video' _VALID_URL = r'https?://(?P<host>video\.fox(?:news|business)\.com)/v/(?:video-embed\.htm...
rationalAgent/edx-platform-custom
refs/heads/master
lms/envs/dev_with_worker.py
148
""" This config file follows the dev enviroment, but adds the requirement of a celery worker running in the background to process celery tasks. The worker can be executed using: django_admin.py celery worker """ # We intentionally define lots of variables that aren't used, and # want to import all variables from bas...
lpirl/ansible
refs/heads/devel
lib/ansible/plugins/action/win_template.py
113
# (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...
xiebinhqy/Dynamomysql
refs/heads/master
nodes/0.7.x/python/Document.ListBuiltInCategories.py
10
import clr clr.AddReference('RevitAPI') clr.AddReference('RevitAPIUI') from Autodesk.Revit.DB import * import Autodesk OUT = dir(BuiltInCategory)
piffey/ansible
refs/heads/devel
lib/ansible/plugins/callback/debug.py
28
# (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 DOCUMENTATION = ''' callback: debug type: stdout short_description: formated stdout/stderr display...
Vgr255/Wolfbot
refs/heads/master
modules/common.py
1
# The bot commands implemented in here are present no matter which module is loaded import botconfig from tools import decorators import logging import tools.moduleloader as ld import traceback from settings import common as var from base64 import b64encode import imp import settings.wolfgame as settings import sys im...
zimmerle/gnuradio
refs/heads/master
gr-uhd/examples/python/usrp_nbfm_ptt.py
8
#!/usr/bin/env python # # Copyright 2005,2007,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your ...
dmpetrov/dataversioncontrol
refs/heads/master
tests/unit/scm/test_git.py
1
import os from tests.basic_env import TestDvcGit class TestGit(TestDvcGit): def test_belongs_to_scm_true_on_gitignore(self): path = os.path.join("path", "to", ".gitignore") self.assertTrue(self.dvc.scm.belongs_to_scm(path)) def test_belongs_to_scm_true_on_git_internal(self): path = o...
pyoceans/gridded
refs/heads/master
setup.py
1
from setuptools import setup, find_packages from gridded import __version__ reqs = [line.strip() for line in open('requirements.txt')] def readme(): with open('README.md') as f: return f.read() setup( name = "gridded", version = __version__, description = "API for int...
moonkun123/Bot-Kicker-1
refs/heads/master
LineAlpha/LineThrift/MessageService.py
4
# # Autogenerated by Thrift Compiler (0.9.3) # # 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 import logging from ttypes import * from thrift.Thrift import TProcessor from thrift.transport imp...
js0701/chromium-crosswalk
refs/heads/master
tools/telemetry/third_party/modulegraph/modulegraph_tests/testdata/syspath/mymodule3.py
26
""" fake module """
swift-lang/swift-e-lab
refs/heads/master
parsl/providers/cobalt/template.py
2
template_string = '''#!/bin/bash -e ${scheduler_options} ${worker_init} echo "Starting Cobalt job script" echo "----Cobalt Nodefile: -----" cat $$COBALT_NODEFILE echo "--------------------------" export JOBNAME="${jobname}" $user_script echo "End of Cobalt job" '''
stscieisenhamer/glue
refs/heads/master
glue/main.py
1
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import sys import optparse from glue import __version__ from glue.logger import logger try: from glue.utils.qt.decorators import die_on_error except ImportError: from glue.utils.decorators import die_on_error def parse(...
jansed26/tmg-server
refs/heads/master
extensions/ConfirmEdit/captcha.py
63
#!/usr/bin/python # # Script to generate distorted text images for a captcha system. # # Copyright (C) 2005 Neil Harris # # 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 ...
40223121/w17
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/browser/object_storage.py
627
import pickle class __UnProvided(): pass class ObjectStorage(): def __init__(self, storage): self.storage = storage def __delitem__(self, key): del self.storage[pickle.dumps(key)] def __getitem__(self, key): return pickle.loads(self.storage[pickle.dumps(key)]) def __se...
frederick-masterton/django
refs/heads/master
tests/admin_changelist/admin.py
57
from django.contrib import admin from django.core.paginator import Paginator from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from .models import Event, Child, Parent, Swallow site = admin.AdminSite(name="admin") site.register(User, UserAdmin) class CustomPaginator(Pagin...
mammique/django
refs/heads/tp_alpha
django/contrib/auth/tests/remote_user.py
91
from datetime import datetime from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth.backends import RemoteUserBackend from django.contrib.auth.models import User, AnonymousUser from django.contrib.auth.tests.utils import skipIfCustomUser from django.test import TestCase...
mhvk/astropy
refs/heads/placeholder
astropy/samp/hub_script.py
12
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy import time import sys import argparse from astropy import log, __version__ from .hub import SAMPHubServer __all__ = ['hub_script'] def hub_script(timeout=0): """ This main function is executed by the ``samp_hub`` command line to...
mdanielwork/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/localflavor/uk/forms.py
313
""" UK-specific Form helpers """ import re from django.forms.fields import CharField, Select from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ class UKPostcodeField(CharField): """ A form field that validates its input is a UK postcode. The regular expressi...
Bogh/django-oscar
refs/heads/master
tests/integration/dashboard/__init__.py
1349
# -*- coding: utf-8 -*-
reubano/csvkit
refs/heads/master
tests/test_py2.py
21
#!/usr/bin/env python # -*- coding: utf-8 -*- import six try: import unittest2 as unittest except ImportError: import unittest import csvkit @unittest.skipIf(six.PY3, "Not supported in Python 3.") class TestCSVKitReader(unittest.TestCase): def test_utf8(self): with open('examples/test_utf8.csv')...
jumpstarter-io/nova
refs/heads/master
nova/virt/xenapi/__init__.py
126
# Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
andersk/zulip
refs/heads/master
zilencer/tests.py
126
# -*- coding: utf-8 -*- from __future__ import absolute_import import ujson from django.test import TestCase class EndpointDiscoveryTest(TestCase): def test_staging_user(self): response = self.client.get("/api/v1/deployments/endpoints", {"email": "lfaraone@zulip.com"}) data = ujson.loads(response...
kingsdigitallab/dprr-django
refs/heads/master
promrep/migrations/0055_add_highest_office_field.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('promrep', '0054_rebuild_provinces_tree'), ] operations = [ migrations.AddField( model_name='person', ...
DataONEorg/d1_python
refs/heads/master
gmn/src/d1_gmn/tests/gmn_direct.py
1
# This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (the "License"); # you ma...
CTSRD-SOAAP/chromium-42.0.2311.135
refs/heads/master
remoting/tools/zip2msi.py
89
#!/usr/bin/env python # 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. """Generates .msi from a .zip archive or an unpacked directory. The structure of the input archive or directory should look like t...
thaines/rfam
refs/heads/master
performance/sim_asset_creation.py
1
#! /usr/bin/env python3 import time import random import json from urllib.parse import urljoin from browser import Browser # Specify how many of each asset type to create... create = { 'mat' : 50, 'prop' : 100, 'set' : 6, 'char' : 6, 'ani' : 12, 'shot' : 40, ...
pblottiere/QGIS
refs/heads/master
python/plugins/processing/algs/grass7/ext/r_li_padrange.py
45
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_padrange.py ---------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr **************************...
ChinaMassClouds/copenstack-server
refs/heads/master
openstack/src/nova-2014.2/nova/api/openstack/compute/schemas/v3/create_backup.py
14
# Copyright 2014 NEC Corporation. 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 ...
cryptobanana/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_vxlan_gateway.py
22
#!/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...
jmachuca77/ardupilot
refs/heads/master
Tools/scripts/decode_watchdog.py
2
#!/usr/bin/env python ''' decode an watchdog message /Tools/scripts/decode_watchdog.py "WDOG, 2641424, -3, 0, 0, 0, 0, 0, 0, 122, 3, 0, 181, 4196355, 135203219, SPI1" ''' import re import sys import optparse from collections import OrderedDict import decode_ICSR class DecodeWatchDog(object): class Component(...
lecaoquochung/ddnb.django
refs/heads/master
tests/resolve_url/__init__.py
12133432
atul-bhouraskar/django
refs/heads/master
django/contrib/postgres/aggregates/statistics.py
493
from django.db.models import FloatField, IntegerField from django.db.models.aggregates import Aggregate __all__ = [ 'CovarPop', 'Corr', 'RegrAvgX', 'RegrAvgY', 'RegrCount', 'RegrIntercept', 'RegrR2', 'RegrSlope', 'RegrSXX', 'RegrSXY', 'RegrSYY', 'StatAggregate', ] class StatAggregate(Aggregate): def __in...
dantebarba/docker-media-server
refs/heads/master
plex/Subliminal.bundle/Contents/Libraries/Shared/stevedore/tests/test_enabled.py
8
from stevedore import enabled def test_enabled(): def check_enabled(ep): return ep.name == 't2' em = enabled.EnabledExtensionManager( 'stevedore.test.extension', check_enabled, invoke_on_load=True, invoke_args=('a',), invoke_kwds={'b': 'B'}, ) assert len...
shaggytwodope/qutebrowser
refs/heads/master
qutebrowser/utils/version.py
2
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
msherry/PyXB-1.1.4
refs/heads/master
pyxb_114/bundles/wssplat/wsdl11.py
1
# Copyright 2009, Peter A. Bigot # # 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 ...