repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
anisku11/sublimeku
refs/heads/master
Packages/CodeComplice/libs/chardet/mbcharsetprober.py
8
######################## 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...
DougFirErickson/qgisSpaceSyntaxToolkit
refs/heads/master
esstoolkit/external/networkx/algorithms/isomorphism/matchhelpers.py
51
"""Functions which help end users define customize node_match and edge_match functions to use during isomorphism checks. """ from itertools import permutations import types import networkx as nx __all__ = ['categorical_node_match', 'categorical_edge_match', 'categorical_multiedge_match', ...
rananda/cfme_tests
refs/heads/master
utils/ftp.py
15
# -*- coding: utf-8 -*- """ FTP manipulation library @author: Milan Falešník <mfalesni@redhat.com> """ import fauxfactory import ftplib import re from datetime import datetime from time import strptime, mktime try: from cStringIO import StringIO except ImportError: from StringIO import StringIO class FTPExce...
MrLoick/python-for-android
refs/heads/master
python-build/python-libs/gdata/build/lib/gdata/blogger/data.py
136
#!/usr/bin/env python # # Copyright (C) 2009 Google 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 ...
40223148/finaltest
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/unittest/result.py
727
"""Test result object""" import io import sys import traceback from . import util from functools import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'failfast', False): self.stop() return method(self, *args, **kw) ...
marqueedev/django
refs/heads/master
tests/template_tests/filter_tests/test_yesno.py
430
from django.template.defaultfilters import yesno from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_true(self): self.assertEqual(yesno(True), 'yes') def test_false(self): self.assertEqual(yesno(False), 'no') def test_none(self): self.assertEqual...
mollstam/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/contrib/postgres/operations.py
111
from django.contrib.postgres.signals import register_hstore_handler from django.db.migrations.operations.base import Operation class CreateExtension(Operation): reversible = True def __init__(self, name): self.name = name def state_forwards(self, app_label, state): pass def database...
binary-signal/mass-apk-installer
refs/heads/master
mass_apk/ziptools.py
1
"""Compression related functions.""" import os from zipfile import ZipFile, ZIP_DEFLATED, is_zipfile from typing import Optional, Union from pathlib import Path __all__ = ["unzipify", "zipify"] def zipify(src_path: Union[str, os.PathLike], dest_path: Union[str, os.PathLike]): """Compress a folder into a zip arc...
fpsluozi/youtube-dl
refs/heads/master
youtube_dl/extractor/drtv.py
112
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, parse_iso8601, ) class DRTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?dr\.dk/tv/se/(?:[^/]+/)*(?P<id>[\da-z-]+)(?:[/#?]|$)' _TEST = { 'url': 'https://www....
legionus/billing
refs/heads/master
tests/test_database.py
1
import unithelper import uuid import time import random import unittest2 as unittest from bc import database class Test(unithelper.DBTestCase): def setUp(self): with database.DBConnect() as db: test_base_dropper = """ DROP TABLE IF EXISTS new_table; """ test_base_creator=""" CREATE TABLE new_table ...
jodal/comics
refs/heads/main
comics/comics/nemibt.py
1
from comics.aggregator.crawler import CrawlerBase, CrawlerImage from comics.core.comic_data import ComicDataBase class ComicData(ComicDataBase): name = "Nemi (bt.no)" language = "no" url = "https://www.bt.no/kultur/tegneserier/" start_date = "1997-01-01" rights = "Lise Myhre" class Crawler(Crawl...
Orav/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test_userlist.py
2
# Check every path through every method of UserList from collections import UserList from test import support, list_tests class UserListTest(list_tests.CommonTest): type2test = UserList def test_getslice(self): super().test_getslice() l = [0, 1, 2, 3, 4] u = self.type2test(...
chrishas35/django-travis-ci
refs/heads/master
tests/regressiontests/i18n/commands/compilation.py
4
import os try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.core.management import CommandError from django.core.management.commands.compilemessages import compile_messages from django.test import TestCase from django.test.utils import override_settings from djan...
karimbahgat/Pipy
refs/heads/master
pipy/pip/__main__.py
834
from __future__ import absolute_import import os import sys # If we are running from a wheel, add the wheel to sys.path # This allows the usage python pip-*.whl/pip install pip-*.whl if __package__ == '': # __file__ is pip-*.whl/pip/__main__.py # first dirname call strips of '/__main__.py', second strips off ...
archyufa/CloudFerry
refs/heads/master
cloudferrylib/base/action/get_info_iter.py
2
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
Elucidation/schmeckle_bot
refs/heads/master
sb_helpers.py
1
# -*- coding: utf-8 -*- import re import time import locale from datetime import datetime from math import isinf # For converting from string numbers with english-based commas to floats #locale.setlocale(locale.LC_ALL, 'eng_USA') # Windows locale.setlocale(locale.LC_ALL, 'en_GB.utf8') # Linux (Raspberry Pi 2) def get...
jymannob/CouchPotatoServer
refs/heads/develop
libs/suds/umx/basic.py
211
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
zisko/swift
refs/heads/master
utils/pass-pipeline/src/passes.py
22
from pass_pipeline import Pass # TODO: This should not be hard coded. Create a tool in the compiler that knows # how to dump the passes and the pipelines themselves. AADumper = Pass('AADumper') ABCOpt = Pass('ABCOpt') AddressLowering = Pass('AddressLowering') AllocBoxToStack = Pass('AllocBoxToStack') CFGPrinter = Pas...
mmnelemane/neutron
refs/heads/master
neutron/tests/unit/db/test_securitygroups_db.py
30
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
jackchi/interview-prep
refs/heads/master
trees/tree_trace.py
1
# Your previous Plain Text content is preserved below: # # ValueError ValueError ValueError # | | | | # foo foo -> foo zoo # | | / \ | # bar baz bar baz far # # # Val...
fjfnaranjo/fjfnaranjo-bot
refs/heads/dev
tests/test_auth.py
1
from contextlib import contextmanager from unittest import TestCase from unittest.mock import patch, sentinel from telegram.ext.dispatcher import DispatcherHandlerStop from fjfnaranjobot.auth import friends, logger, only_friends, only_owner, only_real from fjfnaranjobot.common import SORRY_TEXT, User from .base impo...
fritsvanveen/QGIS
refs/heads/master
python/plugins/db_manager/db_plugins/__init__.py
3
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
jn7163/django
refs/heads/master
tests/expressions/models.py
261
""" Tests for F() query expression syntax. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Employee(models.Model): firstname = models.CharField(max_length=50) lastname = models.CharField...
rupran/ansible
refs/heads/devel
lib/ansible/utils/module_docs_fragments/asa.py
123
# # (c) 2016, Peter Sprygada <psprygada@ansible.com> # (c) 2016, Patrick Ogenstad <@ogenstad> # # 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 th...
eayunstack/ceilometer
refs/heads/master
ceilometer/tests/unit/compute/pollsters/test_location_metadata.py
6
# # Copyright 2012 eNovance <licensing@enovance.com> # Copyright 2012 Red Hat, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
Adnn/django
refs/heads/master
django/core/mail/backends/dummy.py
835
""" Dummy email backend that does nothing. """ from django.core.mail.backends.base import BaseEmailBackend class EmailBackend(BaseEmailBackend): def send_messages(self, email_messages): return len(list(email_messages))
sonaht/ansible
refs/heads/devel
lib/ansible/modules/cloud/ovirt/ovirt_affinity_labels_facts.py
45
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, 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 #...
alexei-matveev/ccp1gui
refs/heads/master
interfaces/mndo.py
1
# # This file is part of the CCP1 Graphical User Interface (ccp1gui) # # (C) 2002-2007 CCLRC Daresbury Laboratory # # 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 ...
code-google-com/shaderman
refs/heads/master
modes/Unix/__init__.py
4
import os import subprocess def name(): return "Unix" def generator(self, filename, code): print code #code = "bash -c '%s'" % code #os.system(code) #pipe = subprocess.Popen(code, shell=True, stdout=subprocess.PIPE).stdout #buffer = str("".join(pipe.readlines())) #print buffer #print `pwd` p = subprocess.P...
pfnet/chainer
refs/heads/master
tests/chainerx_tests/unit_tests/routines_tests/test_indexing.py
3
import unittest import numpy import pytest import chainer.testing import chainerx import chainerx.testing from chainerx_tests import array_utils from chainerx_tests import dtype_utils from chainerx_tests import math_utils from chainerx_tests import op_utils @op_utils.op_test(['native:0', 'cuda:0']) @chainer.testin...
wjzhang/pyOCD
refs/heads/master
pyOCD/gdbserver/signals.py
14
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2015 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
akosyakov/intellij-community
refs/heads/master
python/testData/inspections/PyCallingNonCallableInspection/tupleNonCallable.py
83
<warning descr="'(int, int)' object is not callable">(1,2)()</warning>
rgommers/statsmodels
refs/heads/master
statsmodels/nonparametric/smoothers_lowess.py
37
# -*- coding: utf-8 -*- """Lowess - wrapper for cythonized extension Author : Chris Jordan-Squire Author : Carl Vogel Author : Josef Perktold """ import numpy as np from ._smoothers_lowess import lowess as _lowess def lowess(endog, exog, frac=2.0/3.0, it=3, delta=0.0, is_sorted=False, missing='drop', ret...
jeasoft/odoo
refs/heads/marcos-8.0
comunity_modules/menu_collapsible/__init__.py
3
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ONESTEiN BV (<http://www.onestein.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
SKA-ScienceDataProcessor/integration-prototype
refs/heads/master
sip/science_pipeline_workflows/ical_dask/pipelines/imaging_processing.py
1
#!/usr/bin/python3 -u # coding: utf-8 """Pipeline processing using Dask (processing stage only). This script demonstrates the continuum imaging and ICAL pipelines. """ import logging import pprint import pickle import numpy import sys import json from data_models.polarisation import PolarisationFrame from data_mode...
sephii/django
refs/heads/master
django/utils/autoreload.py
40
# Autoreloading launcher. # Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org). # Some taken from Ian Bicking's Paste (http://pythonpaste.org/). # # Portions copyright (c) 2004, CherryPy Team (team@cherrypy.org) # All rights reserved. # # Redistribution and use in source and binary forms, with ...
regras/btc_offline_pos
refs/heads/master
terminal_de_baixo_custo/python-cgi/bitcoin/ripemd.py
31
## ripemd.py - pure Python implementation of the RIPEMD-160 algorithm. ## Bjorn Edstrom <be@bjrn.se> 16 december 2007. ## ## Copyrights ## ========== ## ## This code is a derived from an implementation by Markus Friedl which is ## subject to the following license. This Python implementation is not ## subject to...
hiaselhans/OpenGlider
refs/heads/develop
openglider/glider/parametric/export_ods.py
2
import copy import math import ezodf import openglider.glider import openglider.glider.parametric.glider from openglider.glider.ballooning import BallooningBezierNeu from openglider.glider.cell import DiagonalRib from openglider.glider.parametric.arc import ArcCurve from openglider.utils.table import Table file_vers...
tph-thuering/vnetsource
refs/heads/master
ts_om/models.py
2
from StringIO import StringIO import datetime from xml.etree.ElementTree import ParseError from django.core.exceptions import MultipleObjectsReturned from django.utils import timezone from django.db import models from django.contrib.auth.models import User from lxml import etree from lxml.etree import XMLSyntaxError i...
heukelum/linux
refs/heads/devel
tools/perf/scripts/python/sctop.py
1996
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
dnozay/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/django/contrib/gis/geometry/backend/__init__.py
388
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module geom_backend = getattr(settings, 'GEOMETRY_BACKEND', 'geos') try: module = import_module('.%s' % geom_backend, 'django.contrib.gis.geometry.backend') except ImportError, e: ...
sparkslabs/kamaelia
refs/heads/master
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/Vector.py
12
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License...
Zyell/home-assistant
refs/heads/master
tests/components/binary_sensor/test_command_line.py
8
"""The tests for the Command line Binary sensor platform.""" import unittest from homeassistant.const import (STATE_ON, STATE_OFF) from homeassistant.components.binary_sensor import command_line from tests.common import get_test_home_assistant class TestCommandSensorBinarySensor(unittest.TestCase): """Test the ...
leeseulstack/openstack
refs/heads/master
neutron/tests/unit/ml2/test_security_group.py
12
# Copyright (c) 2013 OpenStack Foundation # Copyright 2013, Nachi Ueno, NTT MCL, 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.ap...
KitKatXperience/platform_external_chromium_org
refs/heads/kk
chrome/test/pyautolib/pyauto_errors.py
69
# 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. """PyAuto Errors.""" class JavascriptRuntimeError(RuntimeError): """Represent an error raised by injected Javascript.""" pass class JSONInterfaceE...
xinchoubiology/cuda-convnet2
refs/heads/master
layer.py
162
# Copyright 2014 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 by applicable law or...
jonparrott/gcloud-python
refs/heads/master
websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url_pb2_grpc.py
591
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc
codito/pomito
refs/heads/master
tests/plugins/ui/test_timer_window.py
1
# -*- coding: utf-8 -*- """Tests for the timer window.""" import pytest from pomito.plugins.ui.qt.timer_window import TimerWindow from pomito.test import PomitoTestFactory, FakeKeyBinder @pytest.fixture(scope="function") def timer_window(qtbot): factory = PomitoTestFactory() pomodoro_service = factory.crea...
nagyistoce/edx-platform
refs/heads/master
openedx/core/lib/tests/test_course_tabs.py
116
""" Tests of specific tabs. """ from mock import patch, Mock from unittest import TestCase import xmodule.tabs as xmodule_tabs from openedx.core.lib.course_tabs import CourseTabPluginManager class CourseTabPluginManagerTestCase(TestCase): """Test cases for CourseTabPluginManager class""" @patch('openedx.c...
rahatm1/kinect-drone
refs/heads/master
libardrone/demo.py
3
#!/usr/bin/env python # Copyright (c) 2011 Bastian Venthur # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modi...
muravjov/ansible
refs/heads/stable-1.9
v2/ansible/executor/play_iterator.py
5
# (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...
TheTypoMaster/asuswrt
refs/heads/master
release/src/router/libxml2/python/tests/xpathext.py
87
#!/usr/bin/python -u import sys import libxml2 # Memory debug specific libxml2.debugMemory(1) def foo(ctx, x): return x + 1 def bar(ctx, x): return "%d" % (x + 2) doc = libxml2.parseFile("tst.xml") ctxt = doc.xpathNewContext() res = ctxt.xpathEval("//*") if len(res) != 2: print "xpath query: wrong node ...
duhzecca/cinder
refs/heads/master
cinder/volume/drivers/infortrend/eonstor_ds_cli/common_cli.py
20
# Copyright (c) 2015 Infortrend Technology, 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 # # ...
SCPR/firetracker
refs/heads/master
calfire_tracker/migrations/0010_auto__add_wildfiretweet.py
1
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'WildfireTweet' db.create_table('calfire_tracker_wildfiretweet', ( ('id', self.gf...
TheKK/Shedskin
refs/heads/master
setup.py
3
#!/usr/bin/env python from distutils.core import setup, Command import os class run_tests(Command): description = "run testsuite" user_options = [] def initialize_options(self): pass def finalize_options(self): self.cwd = os.getcwd() ss_dir = os.path.abspath(__file__).split(os....
scripni/rethinkdb
refs/heads/next
external/v8_3.30.33.16/build/gyp/test/hello/gyptest-regyp.py
268
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that Makefiles get rebuilt when a source gyp file changes. """ import TestGyp # Regenerating build files when a gyp file chan...
admiraltoad/ScotchPy
refs/heads/master
scripts/unpackfiles.py
1
""" Unpack Files """ import os, sys, shutil, errno from ScotchPy.application import Application, get_root_directory from ScotchPy.utils import folder_utils, file_utils class UnpackFilesApp(Application): def __init__(self): super(UnpackFilesApp, self).__init__("Unpack Files") def run(self): """ Run the a...
MoritzS/django
refs/heads/master
tests/flatpages_tests/test_forms.py
43
from django.conf import settings from django.contrib.flatpages.forms import FlatpageForm from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import TestCase, modify_settings, override_settings from django.utils import translation @modify_settings(INSTALLE...
40223144/2015cdafinal
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/antigravity.py
917
import webbrowser import hashlib webbrowser.open("http://xkcd.com/353/") def geohash(latitude, longitude, datedow): '''Compute geohash() using the Munroe algorithm. >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68') 37.857713 -122.544543 ''' # http://xkcd.com/426/ h = hashlib.md5(d...
stgraber/snapcraft
refs/heads/master
integration_tests/test_clean.py
7
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
arnaud-morvan/QGIS
refs/heads/master
python/plugins/processing/algs/qgis/HubDistancePoints.py
12
# -*- coding: utf-8 -*- """ *************************************************************************** HubDistancePoints.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com *******************...
franky88/emperioanimesta
refs/heads/master
env/Lib/os.py
15
r"""OS routines for NT or Posix depending on what system we're on. This exports: - all functions from posix, nt or ce, e.g. unlink, stat, etc. - os.path is either posixpath or ntpath - os.name is either 'posix', 'nt' or 'ce'. - os.curdir is a string representing the current directory ('.' or ':') - os.pardir...
mastizada/kuma
refs/heads/master
vendor/packages/ipython/IPython/testing/plugin/setup.py
46
#!/usr/bin/env python """A Nose plugin to support IPython doctests. """ from setuptools import setup setup(name='IPython doctest plugin', version='0.1', author='The IPython Team', description = 'Nose plugin to load IPython-extended doctests', license = 'LGPL', py_modules = ['ipdoctest'],...
RydrDojo/Ridr_app
refs/heads/master
pylotVenv/lib/python2.7/site-packages/wheel/test/test_basic.py
472
""" Basic wheel tests. """ import os import pkg_resources import json import sys from pkg_resources import resource_filename import wheel.util import wheel.tool from wheel import egg2wheel from wheel.install import WheelFile from zipfile import ZipFile from shutil import rmtree test_distributions = ("complex-dist"...
edcomstock/werkzeug
refs/heads/master
werkzeug/testapp.py
364
# -*- coding: utf-8 -*- """ werkzeug.testapp ~~~~~~~~~~~~~~~~ Provide a small test application that can be used to test a WSGI server and check it for WSGI compliance. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ impo...
FlintHill/SUAS-Competition
refs/heads/master
env/lib/python2.7/site-packages/pip/_vendor/cachecontrol/cache.py
74
""" The cache object API for implementing caches. The default is a thread safe in-memory dictionary. """ from threading import Lock class BaseCache(object): def get(self, key): raise NotImplementedError() def set(self, key, value): raise NotImplementedError() def delete(self, key): ...
Venturi/cms
refs/heads/master
env/lib/python2.7/site-packages/cms/migrations/0010_migrate_use_structure.py
7
# -*- coding: utf-8 -*- import warnings from django.contrib.auth.models import Permission, Group from django.contrib.contenttypes.models import ContentType from django.conf import settings from django.db import models, migrations def forwards(apps, schema_editor): user_model = apps.get_model(settings.AUTH_USER_M...
zverevalexei/trex-http-proxy
refs/heads/master
trex_client/external_libs/pyzmq-14.5.0/python3/fedora18/64bit/zmq/sugar/__init__.py
33
"""pure-Python sugar wrappers for core 0MQ objects.""" # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. from zmq.sugar import ( constants, context, frame, poll, socket, tracker, version ) from zmq import error __all__ = ['constants'] for submod in ( constants, cont...
thonkify/thonkify
refs/heads/master
src/lib/google/protobuf/type_pb2.py
8
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/type.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import ...
Rhadow/leetcode
refs/heads/master
lintcode/Medium/140_Fast_Power.py
1
class Solution: """ @param a, b, n: 32bit integers @return: An integer """ def fastPower(self, a, b, n): # write your code here res = 1 while (n > 0): if (n % 2 == 1): res *= a % b n /= 2 a *= a % b return (res % b);...
jesopo/bitbot
refs/heads/master
src/utils/datetime/common.py
1
import datetime as _datetime import enum ISO8601_FORMAT_DT = "%Y-%m-%dT%H:%M:%S" ISO8601_FORMAT_TZ = "%z" TIME_HUMAN = "%H:%M:%S" DATE_HUMAN = "%Y-%m-%d" class TimeSpec(enum.Enum): NORMAL = 1 MILLISECOND = 2 TIME_SECOND = 1 TIME_MINUTE = TIME_SECOND*60 TIME_HOUR = TIME_MINUTE*60 TIME_DAY = TIME_HOUR*24 TIME...
sam-tsai/django-old
refs/heads/master
tests/modeltests/transactions/models.py
11
""" 15. Transactions Django handles transactions in three different ways. The default is to commit each transaction upon a write, but you can decorate a function to get commit-on-success behavior. Alternatively, you can manage the transaction manually. """ from django.db import models, DEFAULT_DB_ALIAS class Reporte...
barryrobison/arsenalsuite
refs/heads/master
cpp/lib/PyQt4/examples/itemviews/editabletreemodel/ui_mainwindow.py
15
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainwindow.ui' # # Created: Fri Mar 27 22:12:50 2009 # by: PyQt4 UI code generator 4.4.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_MainWindow(object): def setupUi(self, MainW...
lizaifang/zinnia
refs/heads/master
python/test.py
12
#!/usr/bin/python import zinnia input = "(character (width 1000)(height 1000)(strokes ((243 273)(393 450))((700 253)(343 486)(280 716)(393 866)(710 880))))"; try: s = zinnia.Character() r = zinnia.Recognizer() r.open("/usr/local/lib/zinnia/model/tomoe/handwriting-ja.model") if (not s.parse(input...
timm/timmnix
refs/heads/master
pypy3-v5.5.0-linux64/lib-python/3/test/test_email/test_policy.py
34
import io import types import textwrap import unittest import email.policy import email.parser import email.generator from email import headerregistry def make_defaults(base_defaults, differences): defaults = base_defaults.copy() defaults.update(differences) return defaults class PolicyAPITests(unittest.T...
jlmadurga/microbot
refs/heads/master
permabots/views/hooks/kik_hook.py
2
from rest_framework.views import APIView from permabots.serializers import KikMessageSerializer from permabots.models import KikBot, KikUser, KikChat, KikMessage from rest_framework.response import Response from rest_framework import status import logging from permabots.tasks import handle_message from datetime import ...
jounex/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/template_tests/test_unicode.py
110
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template import Template, TemplateEncodingError, Context from django.utils.safestring import SafeData from django.utils import six from django.utils.unittest import TestCase class UnicodeTests(TestCase): def test_template(self): ...
goodwinnk/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/utils/dateformat.py
234
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print df.format('jS F Y H:i') 7th October 2003 11:39 >>> """ import re import time import calendar from django.utils.dates import MONTHS, MONTHS_3, ...
alorchhota/bioinformatics-algorithms-1
refs/heads/master
week9/code/7.SuffixArrayConstruction.py
1
import os import csv import sys import re import importlib import networkx as nx # settings #curDir = 'E:/GitHub/bioinformatics-algorithms-1/week9' curDir = 'D:/GitHub/bioinformatics-algorithms-1/week9' inputFile = './data/7.SuffixArrayConstruction-2.txt' inputFile = 'C:/Users/Ashis/Downloads/dataset_310_2.txt' output...
chachan/nodeshot
refs/heads/master
nodeshot/core/websockets/urls.py
8
from django.conf.urls import patterns, url from django.conf import settings urlpatterns = patterns('',) if settings.DEBUG: urlpatterns += patterns('nodeshot.core.websockets.views', url(r'^test/$', 'test', name='websocket_test'), )
vasilenkomike/xen-api
refs/heads/master
ocaml/idl/binding_sanity_checks/create_vm.py
34
#!/usr/bin/env python import XenAPI import provision import sanitychecklib #log in session=sanitychecklib.getsession() sx=session.xenapi #find the template for Debian Etch vms = sx.VM.get_all() print "Server", sanitychecklib.server, "has ", len(vms), "VMs", etch_template_list = [x for x in vms if (('Etch' in sx.VM....
harish1696/Midterm-Project
refs/heads/master
vendor/googletest/googletest/test/gtest_break_on_failure_unittest.py
2140
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
alivecor/tensorflow
refs/heads/master
tensorflow/python/keras/_impl/keras/layers/recurrent.py
6
# 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...
gundalow/ansible
refs/heads/devel
lib/ansible/module_utils/facts/system/lsb.py
95
# Collect facts related to LSB (Linux Standard Base) # # 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 late...
chevah/python-cffi
refs/heads/master
demo/readdir_build.py
12
import sys from cffi import FFI if not sys.platform.startswith('linux'): raise Exception("Linux-only demo") ffi = FFI() ffi.cdef(""" typedef void DIR; typedef long ino_t; typedef long off_t; struct dirent { ino_t d_ino; /* inode number */ off_t d_off; ...
eul721/The-Perfect-Pokemon-Team-Balancer
refs/heads/master
libs/env/Lib/encodings/unicode_escape.py
852
""" Python 'unicode-escape' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is inte...
runtimejs/runtime
refs/heads/master
deps/v8/tools/testrunner/local/statusfile.py
2
# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
yxping/leetcode
refs/heads/master
solutions/102.Binary_Tree_Level_Order_Traversal/AC_dfs_n.py
7
#!/usr/bin/python # -*- coding: utf-8 -*- # Author: illuz <iilluzen[at]gmail.com> # File: AC_dfs_n.py # Create Date: 2015-03-09 09:30:11 # Usage: AC_dfs_n.py # Descripton: # Definition for a binary tree node class TreeNode: def __init__(self, x): self.val = x self.left = None...
40223119/2015cd_0505
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/copy.py
628
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is only relev...
lmazuel/azure-sdk-for-python
refs/heads/master
azure-servicefabric/azure/servicefabric/models/property_batch_operation.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
empeeu/numpy
refs/heads/master
numpy/polynomial/legendre.py
75
""" Legendre Series (:mod: `numpy.polynomial.legendre`) =================================================== .. currentmodule:: numpy.polynomial.polynomial This module provides a number of objects (mostly functions) useful for dealing with Legendre series, including a `Legendre` class that encapsulates the usual arith...
crossin/yuan-xin
refs/heads/master
settings.py
11
# -*- coding: utf-8 -*- # Django settings for the example project. import os DEBUG = True TEMPLATE_DEBUG = False ##LANGUAGE_CODE = 'zh-CN' ##LANGUAGE_CODE = 'fr' LOCALE_PATHS = 'locale' USE_I18N = True TEMPLATE_LOADERS=('django.template.loaders.filesystem.load_template_source', 'zipl...
barma1309/Kalista
refs/heads/master
.virtualenvs/Kalista/lib/python3.4/site-packages/django/contrib/gis/measure.py
344
# Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz> # 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, #...
RoboJackets/robocup-software
refs/heads/staging
soccer/gameplay/plays/testing/test_one_touch_pass.py
2
import play import behavior import tactics.one_touch_pass ## Continually runs a one_touch_pass pass tactic class TestOneTouchPass(play.Play): def __init__(self): super().__init__(continuous=True) self.add_transition(behavior.Behavior.State.start, behavior.Behavior.Stat...
nikhilgarg459/bcs
refs/heads/master
bcs_server/config.py
2
__doc__ = """ This module all the config parameters for bcs serevr """ # Storage config DB_FILE = 'bank.db' # Server config TCP_IP = '127.0.0.1' TCP_PORT = 5010 MAX_CONNECTIONS = 2 MESSAGE_LENGTH = 1024 # Superuser account ADMIN_NAME = 'admin' ADMIN_EMAIL = 'admin@bcs.com' ADMIN_PASSWORD = 'admin' # Log config...
jacquesd/indico
refs/heads/master
indico/util/fossilize/__init__.py
2
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
bmcfee/gordon
refs/heads/master
examples/playdar_resolver/playdar.py
1
#!/usr/bin/python # Copyright (C) 2010 Michael Mandel # # This file is part of Gordon. # # Gordon 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 lat...
qilicun/python
refs/heads/master
python3/matplotlib/spines_demo_bounds.py
7
""" Demo of spines using custom bounds to limit the extent of the spine. """ import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 2*np.pi, 50) y = np.sin(x) y2 = y + 0.1 * np.random.normal(size=x.shape) fig, ax = plt.subplots() ax.plot(x, y, 'k--') ax.plot(x, y2, 'ro') # set ticks and tick labels a...
sidartaoliveira/ansible
refs/heads/devel
lib/ansible/compat/__init__.py
241
# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.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) any later...
gleon99/rpyc
refs/heads/logs
rpyc/lib/colls.py
1
from __future__ import with_statement import weakref from threading import Lock import logging class WeakValueDict(object): """a light-weight version of weakref.WeakValueDictionary""" __slots__ = ("_dict",) def __init__(self): self._dict = {} def __repr__(self): return repr(self._dict)...