repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
byndcivilization/toy-infrastructure
refs/heads/master
flask-app/migrations/env.py
557
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig import logging # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config ...
nysan/yocto-autobuilder
refs/heads/master
lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-linux-x86_64.egg/sqlalchemy/sql/operators.py
4
# sql/operators.py # Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # This module is part of SQLAlchemy and is released under # the MIT License: http://w...
mahak/neutron
refs/heads/master
neutron/tests/functional/services/logapi/test_logging.py
2
# Copyright (c) 2017 Fujitsu Limited # 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 requi...
ldoktor/autotest
refs/heads/master
tko/migrations/018_add_indexes.py
11
def migrate_up(manager): manager.execute_script(CREATE_INDICES) def migrate_down(manager): manager.execute_script(DROP_INDICES) CREATE_INDICES = """ CREATE INDEX job_idx ON tests (job_idx); CREATE INDEX reason ON tests (reason); CREATE INDEX test ON tests (test); CREATE INDEX subdir ON tests (subdir); CREAT...
LyonsLab/coge
refs/heads/master
bin/last_wrapper/Bio/pairwise2.py
2
# Copyright 2002 by Jeffrey Chang. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """This package implements pairwise sequence alignment using a dynamic programming algorithm. ...
juliengdt/juliengdt-resources
refs/heads/master
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_clbuiltins.py
370
# -*- coding: utf-8 -*- """ pygments.lexers._clbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ANSI Common Lisp builtins. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ BUILTIN_FUNCTIONS = [ # 638 functions '<', '<=', '=', '>', '>=', '-', '...
billonahill/heron
refs/heads/master
heron/statemgrs/src/python/statemanager.py
8
# Copyright 2016 Twitter. 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 agree...
HighSchoolHacking/GLS
refs/heads/master
test/integration/Concatenate/three strings.py
4
# aaa + bbb + ccc #
GMadorell/Shades
refs/heads/master
Code/Pieces/Systems/LastStepSystem.py
1
import larv from Globals import * class LastStepSystem(larv.System): """ Does the last steps of the game loop: - Updates physics engine (if physics bool is True) - Updates pygame display - Sets the frame clock correctly """ def __init__(self, physics = True): self.physics = p...
13xforever/webserver
refs/heads/master
qa/270-Options-asterisk1.py
7
from base import * class Test (TestBase): def __init__ (self): TestBase.__init__ (self, __file__) self.name = "OPTIONS *" self.request = "OPTIONS * HTTP/1.0\r\n" % (globals()) self.expected_error = 200 self.expected_content = ["Content-Length: 0"] ...
minghuadev/chromeos-kernel-3-8
refs/heads/chromeos-3.8
scripts/tracing/draw_functrace.py
14679
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
ademinn/AdaptiveIPFilter
refs/heads/master
.ycm_extra_conf.py
1
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
wdv4758h/ZipPy
refs/heads/master
lib-python/3/encodings/shift_jisx0213.py
816
# # shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jisx0213') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEnc...
philmui/django-boiler
refs/heads/master
lists/migrations/0002_item_text.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('lists', '0001_initial'), ] operations = [ migrations.AddField( model_name='item', name='text', ...
apagac/cfme_tests
refs/heads/master
scripts/cleanup_openstack_instance_snapshot.py
2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Cleanup unused instance snapshot from glance repository Usage: scripts/cleanup_openstack_instance_snapshot.py [optional list of provider keys] If no providers specified, it will cleanup all of them. """ import argparse from datetime import datetime from datetime impo...
suncycheng/intellij-community
refs/heads/master
python/testData/docstrings/simpleGoogleDocString.py
53
def func(x, y, *args, **kwargs): """Summary Parameters: x (int) : first parameter y: second parameter with longer description Raises: Exception: if anything bad happens Returns: None: always """ pass
Elandril/SickRage
refs/heads/master
lib/hachoir_core/language.py
95
from hachoir_core.iso639 import ISO639_2 class Language: def __init__(self, code): code = str(code) if code not in ISO639_2: raise ValueError("Invalid language code: %r" % code) self.code = code def __cmp__(self, other): if other.__class__ != Language: r...
AOSP-S4-KK/platform_external_chromium_org
refs/heads/kk-4.4
build/android/pylib/perf/surface_stats_collector.py
26
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import Queue import datetime import logging import re import threading # Log marker containing SurfaceTexture timestamps. _SURFACE_TEXTURE_TIMESTAMPS_MESSA...
acsone/server-tools
refs/heads/8.0
super_calendar/models/super_calendar.py
37
# -*- coding: utf-8 -*- ############################################################################## # # Odoo, Open Source Management Solution # # Copyright (c) All rights reserved: # (c) 2012 Agile Business Group sagl (<http://www.agilebg.com>) # (c) 2012 Domsense srl (<http://www.domse...
ollien/Timpani
refs/heads/master
timpani/webserver/controllers/admin.py
1
import flask import os.path import datetime import json import uuid import magic import mimetypes from sqlalchemy.exc import IntegrityError from .. import webhelpers from ... import blog from ... import auth from ... import themes from ... import settings FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) CONF...
carmark/vbox
refs/heads/master
src/VBox/ValidationKit/tests/shutdown/tdGuestOsShutdown1.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ VMM Guest OS boot tests. """ __copyright__ = \ """ Copyright (C) 2010-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify it ...
mancoast/CPythonPyc_test
refs/heads/master
fail/342_test_message.py
72
import unittest import textwrap from email import policy, message_from_string from email.message import EmailMessage, MIMEPart from test.test_email import TestEmailBase, parameterize # Helper. def first(iterable): return next(filter(lambda x: x is not None, iterable), None) class Test(TestEmailBase): polic...
kaleid0scope/SITE-database
refs/heads/master
DjangoWebProject/DjangoWebProject/users/conf.py
3
from appconf import AppConf from django.conf import settings class UsersAppConf(AppConf): VERIFY_EMAIL = False CREATE_SUPERUSER = settings.DEBUG SUPERUSER_EMAIL = 'superuser@djangoproject.com' SUPERUSER_PASSWORD = 'django' EMAIL_CONFIRMATION_TIMEOUT_DAYS = 3 SPAM_PROTECTION = True REGISTRA...
PriklyGrayp/Noitacude.PY
refs/heads/master
__init__.py
22
__author__ = "Prikly Grayp" __license__ = "MIT" __version__ = "1.0.0" __email__ = "priklygrayp@gmail.com" __status__ = "Development"
titze/apparecium
refs/heads/master
androguard/core/bytecodes/api_permissions.py
50
DVM_PERMISSIONS_BY_PERMISSION = { "BIND_DEVICE_ADMIN" : { "Landroid/app/admin/DeviceAdminReceiver;" : [ ("C", "ACTION_DEVICE_ADMIN_ENABLED", "Ljava/lang/String;"), ], "Landroid/app/admin/DevicePolicyManager;" : [ ("F", "getRemoveWarning", "(Landroid/content/ComponentName; Landroid/os/RemoteCallback;)"), ("F", ...
4talesa/rethinkdb
refs/heads/next
external/re2_20140111/re2/make_unicode_groups.py
121
#!/usr/bin/python # Copyright 2008 The RE2 Authors. All Rights Reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Generate C++ tables for Unicode Script and Category groups.""" import sys import unicode _header = """ // GENERATED BY make_unicode_groups...
qt-haiku/LibreOffice
refs/heads/master
wizards/com/sun/star/wizards/web/data/CGPublish.py
9
# # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This file incorporates work covered by the following license noti...
sourcefabric/Booktype
refs/heads/master
lib/booki/editor/south_migrations/0021_auto__chg_field_license_url.py
8
# -*- 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): # Changing field 'License.url' db.alter_column(u'editor_license', 'url', self.gf('django.db.models.fields.U...
liorvh/golismero
refs/heads/master
doc/plugins/source/conf.py
8
# -*- coding: utf-8 -*- # # golismero documentation build configuration file, created by # sphinx-quickstart on Mon May 27 16:39:33 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 this # autogenerated file. # # A...
wangdeshui/zulip
refs/heads/master
zerver/lib/mention.py
125
from __future__ import absolute_import # Match multi-word string between @** ** or match any one-word # sequences after @ find_mentions = r'(?<![^\s\'\"\(,:<])@(?:\*\*([^\*]+)\*\*|(\w+))' wildcards = ['all', 'everyone'] def user_mention_matches_wildcard(mention): return mention in wildcards
gh0std4ncer/thug
refs/heads/master
src/ActiveX/modules/CABrightStor.py
8
# CA BrightStor # CVE-NOMATCH import logging log = logging.getLogger("Thug") def AddColumn(self, arg0, arg1): if len(arg0) > 100: log.ThugLogging.log_exploit_event(self._window.url, "CA BrightStor ActiveX", "Overflow in Ad...
praveenaki/zulip
refs/heads/master
zerver/lib/actions.py
114
from __future__ import absolute_import from django.conf import settings from django.core import validators from django.contrib.sessions.models import Session from zerver.lib.cache import flush_user_profile from zerver.lib.context_managers import lockfile from zerver.models import Realm, RealmEmoji, Stream, UserProfile...
ns950/calibre
refs/heads/master
src/calibre/gui2/dialogs/comments_dialog.py
14
#!/usr/bin/env python2 __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' __license__ = 'GPL v3' from PyQt5.Qt import Qt, QDialog, QDialogButtonBox from calibre.gui2 import gprefs, Application from calibre.gui2.dialogs.comments_dialog_ui import Ui_CommentsDialog from cali...
pycontw/pycontw2016
refs/heads/master
src/users/migrations/0010_cocrecord.py
1
# Generated by Django 3.0.2 on 2020-02-23 12:28 import core.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('users', '0009_auto_20160227_1656'), ] operations = [ mi...
devs1991/test_edx_docmode
refs/heads/master
venv/lib/python2.7/site-packages/edx_proctoring/callbacks.py
1
""" Various callback paths that support callbacks from SoftwareSecure """ import logging from django.template import Context, loader from django.conf import settings from django.http import HttpResponse import pytz from datetime import datetime from ipware.ip import get_ip from django.core.urlresolvers import reverse ...
awemulya/fieldsight-kobocat
refs/heads/master
kobocat/lib/python3.5/site-packages/wheel/util.py
345
"""Utility functions.""" import sys import os import base64 import json import hashlib try: from collections import OrderedDict except ImportError: OrderedDict = dict __all__ = ['urlsafe_b64encode', 'urlsafe_b64decode', 'utf8', 'to_json', 'from_json', 'matches_requirement'] def urlsafe_b64encode(d...
Allianzcortex/scrapy
refs/heads/master
scrapy/http/response/text.py
98
""" This module implements the TextResponse class which adds encoding handling and discovering (through HTTP headers) to base Response class. See documentation in docs/topics/request-response.rst """ import six from six.moves.urllib.parse import urljoin from w3lib.encoding import html_to_unicode, resolve_encoding, \...
nss350/magPy
refs/heads/master
utils/utilsFreq.py
1
# utility functions for frequency related stuff import numpy as np import numpy.fft as fft import math def getFrequencyArray(fs, samples): # frequencies go from to nyquist nyquist = fs/2 return np.linspace(0, nyquist, samples) # use this function for all FFT calculations # then if change FFT later (i.e. FFTW), j...
metacademy/metacademy-application
refs/heads/master
server/apps/roadmaps/views.py
1
import difflib import os from operator import attrgetter import bleach import markdown import re import urlparse import reversion from lazysignup.templatetags.lazysignup_tags import is_lazy_user from django.db import transaction from django.contrib.auth.models import User from django.http import HttpResponse, HttpRes...
mikemow/youtube-dl
refs/heads/master
youtube_dl/extractor/cbs.py
93
from __future__ import unicode_literals from .common import InfoExtractor class CBSIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?:cbs\.com/shows/[^/]+/(?:video|artist)|colbertlateshow\.com/(?:video|podcasts))/[^/]+/(?P<id>[^/]+)' _TESTS = [{ 'url': 'http://www.cbs.com/shows/garth-brooks/vid...
elibixby/gcloud-python
refs/heads/master
gcloud/pubsub/connection.py
6
# Copyright 2015 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 a...
googleapis/python-spanner-django
refs/heads/master
django_spanner/creation.py
1
# Copyright 2020 Google LLC # # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd import os import sys from unittest import skip from django.conf import settings from django.db.backends.base.creation import...
addition-it-solutions/project-all
refs/heads/master
addons/web_tests_demo/__openerp__.py
384
{ 'name': "Demonstration of web/javascript tests", 'category': 'Hidden', 'description': """ OpenERP Web demo of a test suite ================================ Test suite example, same code as that used in the testing documentation. """, 'depends': ['web'], 'data' : [ 'views/web_tests_dem...
tboyce021/home-assistant
refs/heads/dev
homeassistant/components/tfiac/climate.py
21
"""Climate platform that offers a climate device for the TFIAC protocol.""" from concurrent import futures from datetime import timedelta import logging from pytfiac import Tfiac import voluptuous as vol from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity from homeassistant.components.climate....
MattNolanLab/ei-attractor
refs/heads/master
grid_cell_model/simulations/simulation_demo/default_params.py
2
# # default_params.py # # Default neuron and network parameters # # Copyright (C) 2012 Lukas Solanka <l.solanka@sms.ed.ac.uk> # # 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 F...
adwu73/robotframework-selenium2library
refs/heads/master
test/lib/mockito/spying.py
70
#!/usr/bin/env python # coding: utf-8 '''Spying on real objects.''' from invocation import RememberedProxyInvocation, VerifiableInvocation from mocking import TestDouble __author__ = "Serhiy Oplakanets <serhiy@oplakanets.com>" __copyright__ = "Copyright 2009-2010, Mockito Contributors" __license__ = "MIT" __maintain...
ahmedbodi/vertcoin
refs/heads/master
contrib/testgen/base58.py
45
# Copyright (c) 2012-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import has...
vitan/hue
refs/heads/master
desktop/core/ext-py/tablib-develop/tablib/packages/xlwt/Row.py
57
# -*- coding: windows-1252 -*- import BIFFRecords import Style from Cell import StrCell, BlankCell, NumberCell, FormulaCell, MulBlankCell, BooleanCell, ErrorCell, \ _get_cells_biff_data_mul import ExcelFormula import datetime as dt try: from decimal import Decimal except ImportError: # Python 2.3: decimal ...
joeythesaint/yocto-autobuilder
refs/heads/master
lib/python2.7/site-packages/sqlalchemy_migrate-0.6-py2.6.egg/migrate/tests/versioning/test_shell.py
5
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import tempfile try: from runpy import run_module except ImportError: pass #python2.4 from sqlalchemy import MetaData, Table from nose.plugins.skip import SkipTest from migrate.versioning.repository import Repository from migrate.versioning i...
globality-corp/microcosm
refs/heads/develop
microcosm/loaders/keys.py
1
""" Key expansion. """ from typing import ( Any, Callable, Dict, List, ) def expand_config( dct: Dict[Any, Any], separator: str = '.', skip_to: int = 0, key_func: Callable[[str], str] = lambda key: key.lower(), key_parts_filter: Callable[[List[str]], bool] = lambda key_parts: True...
toshywoshy/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/os_image_info.py
20
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
shinate/phantomjs
refs/heads/master
src/breakpad/src/tools/gyp/test/sibling/gyptest-all.py
151
#!/usr/bin/env python # Copyright (c) 2009 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. """ """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('build/all.gyp', chdir='src') test.build('build/all.gyp', test.ALL, chdir='...
kbidarkar/robottelo
refs/heads/master
tests/foreman/api/test_subnet.py
1
"""Tests for the ``subnets`` paths. An API reference is available here: http://theforeman.org/api/apidoc/v2/1.15.html :Requirement: Subnet :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: API :TestType: Functional :CaseImportance: High :Upstream: No """ from robottelo.decorators import ( s...
hanlind/nova
refs/heads/master
nova/wsgi/nova-metadata.py
40
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
shanot/imp
refs/heads/develop
modules/em/test/test_volumes_and_images.py
2
import IMP.test import IMP.em import os class Tests(IMP.test.TestCase): def test_em_maps(self): """Check volume reading and writing""" # Read in Xmipp format rw1 = IMP.em.SpiderMapReaderWriter( self.get_input_file_name("media_mon_iter3.xmp"), False, False, True) ...
xq262144/hue
refs/heads/master
desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/reader/style.py
13
from __future__ import absolute_import # Copyright (c) 2010-2015 openpyxl """Read shared style definitions""" # package imports from openpyxl.compat import OrderedDict, zip from openpyxl.utils.indexed_list import IndexedList from openpyxl.styles import ( numbers, Font, Fill, PatternFill, GradientF...
milafrerichs/geonode
refs/heads/master
geonode/people/migrations/0003_auto_20160824_0245.py
5
# -*- coding: utf-8 -*- # flake8: noqa from __future__ import unicode_literals from django.db import migrations, models import taggit.managers class Migration(migrations.Migration): dependencies = [ ('people', '0002_auto_20160821_1919'), ] operations = [ migrations.AlterField( ...
Apptimize-OSS/github-reviewboard-sync
refs/heads/master
tests/unit_tests/test_repo.py
1
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from hashlib import sha1 from mock import Mock import unittest2 from github_reviewboard_sync.exceptions import MissingRemoteException, MissingBranchExcpetion from githu...
sarthfrey/sentimizer
refs/heads/master
lib/flask/testsuite/test_apps/config_module_app.py
1257
import os import flask here = os.path.abspath(os.path.dirname(__file__)) app = flask.Flask(__name__)
openhatch/oh-mainline
refs/heads/master
vendor/packages/zope.interface/src/zope/interface/tests/m2.py
83
############################################################################## # # Copyright (c) 2004 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
hchen1202/django-react
refs/heads/master
virtualenv/lib/python3.6/site-packages/django/db/migrations/operations/base.py
127
from __future__ import unicode_literals from django.db import router class Operation(object): """ Base class for migration operations. It's responsible for both mutating the in-memory model state (see db/migrations/state.py) to represent what it performs, as well as actually performing it agains...
kustodian/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_profile_dns.py
22
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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 os import json import pytest import sys if sys.version_info < (2...
jbbskinny/sympy
refs/heads/master
sympy/solvers/tests/test_constantsimp.py
112
""" If the arbitrary constant class from issue 4435 is ever implemented, this should serve as a set of test cases. """ from sympy import (acos, cos, cosh, Eq, exp, Function, I, Integral, log, Pow, S, sin, sinh, sqrt, Symbol) from sympy.solvers.ode import constant_renumber, constantsimp from sympy.ut...
jakirkham/bokeh
refs/heads/master
examples/app/gapminder/main.py
5
# -*- coding: utf-8 -*- import pandas as pd from bokeh.core.properties import field from bokeh.io import curdoc from bokeh.layouts import layout from bokeh.models import (ColumnDataSource, HoverTool, SingleIntervalTicker, Slider, Button, Label, CategoricalColorMapper) from bokeh.palettes impo...
gogozs/shadowsocks
refs/heads/master
shadowsocks/eventloop.py
949
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013-2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
mattclay/ansible-modules-core
refs/heads/devel
network/nxos/nxos_vxlan_vtep.py
13
#!/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...
collinprice/titanium_mobile
refs/heads/master
support/common/css/csslex.py
75
# -*- coding: utf-8 -*- ''' A lexical grammar for CSS. ''' import re from ply import lex as _lex __all__ = ('lex','csslexer') # re helpers def r_nongroup(rx): return ur'(?:' + rx + ur')' def r_or(*rxs): return r_nongroup(ur'|'.join([r_nongroup(x) for x in rxs])) def r_star(rx): return r_nongroup(rx) +...
sirex/Misago
refs/heads/master
misago/threads/views/generic/thread/__init__.py
8
# flake8: noqa from misago.threads.views.generic.thread.postsactions import PostsActions from misago.threads.views.generic.thread.threadactions import ThreadActions from misago.threads.views.generic.thread.view import ThreadView
camptocamp/ngo-addons-backport
refs/heads/master
addons/mail/tests/test_mail_features.py
22
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
ASCrookes/django
refs/heads/master
django/template/engine.py
199
import warnings from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache, six from django.utils.deprecation import RemovedInDjango110Warning from django.utils.functional import cached_property from django.utils.module_loading import import_string from .base import Context, Template f...
oblalex/django-workflow
refs/heads/master
src/workflow/admin.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import logging import datetime from functools import partial from django import template from django import forms from django.db import models, transaction, router from django.conf import settings from django.conf.urls import patterns, url f...
DmZ/ajenti
refs/heads/dev
plugins/power/main.py
1
from ajenti.ui import * from ajenti import version from ajenti.com import implements from ajenti.api import * from ajenti.utils import shell from backend import * class PowerPlugin(CategoryPlugin): text = 'Power' icon = '/dl/power/icon.png' folder = 'hardware' def get_ui(self): ui = self.app...
Johnzero/OE7
refs/heads/master
openerp/addons-fg/fg_sale/__openerp__.py
1
# -*- encoding: utf-8 -*- { 'name': '富光销售模块', 'version': '2.0', 'category' : '富光', 'description': """销售模块""", 'author': '杨振宇', 'website': 'http://www.fuguang.cn', 'depends': ['base', 'board', 'product', 'fg_base'], 'init_xml': [], 'update_xml': [ 'fg_sale_data.xml', ...
sunny94/temp
refs/heads/iss8501_parsing
sympy/printing/gtk.py
117
from __future__ import print_function, division from sympy.printing.mathml import mathml import tempfile import os def print_gtk(x, start_viewer=True): """Print to Gtkmathview, a gtk widget capable of rendering MathML. Needs libgtkmathview-bin""" from sympy.utilities.mathml import c2p tmp = tempfil...
M4rtinK/modrana
refs/heads/master
tests/voice_tests.py
1
# -*- coding: utf-8 -*- # Copyright (C) 2017 Osmo Salomaa # # 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. # # This pr...
asermax/livestreamer
refs/heads/master
src/livestreamer/plugins/livestream.py
4
import re from collections import defaultdict from livestreamer.compat import urljoin from livestreamer.exceptions import PluginError, NoStreamsError from livestreamer.plugin import Plugin from livestreamer.stream import AkamaiHDStream, HLSStream from livestreamer.utils import urlget, verifyjson, res_xml, parse_json ...
dbeyer/benchexec
refs/heads/master
benchexec/tablegenerator/test_util.py
3
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 from decimal import Decimal import sys import unittest from benchexec.tablegenerator impo...
canwe/NewsBlur
refs/heads/master
vendor/seacucumber/management/commands/ses_usage.py
20
""" Shows some usage levels and limits for the last and previous 24 hours. """ import datetime from django.core.management.base import BaseCommand from seacucumber.util import get_boto_ses_connection class Command(BaseCommand): """ This command shows some really vague usage and quota stats from SES. """ ...
Bryan792/dotfiles
refs/heads/master
vim/vim.symlink/eclim/autoload/eclim/python/rope/refactor/extract.py
56
import re from rope.base import ast, codeanalyze from rope.base.change import ChangeSet, ChangeContents from rope.base.exceptions import RefactoringError from rope.refactor import (sourceutils, similarfinder, patchedast, suites, usefunction) # Extract refactoring has lots of special cases....
uppi/adventofcode2016
refs/heads/master
adventofcode/adv_23.py
1
import re HEIGHT = 6 WIDTH = 50 PARSER = re.compile("(inc|dec|cpy|jnz|tgl) (-?\d+|[a-d]) ?(-?\d+|[a-d])?$") def parse_input(input_seq): for cmd in input_seq: op, a, b = PARSER.match(cmd).groups() if not a.isalpha(): a = int(a) if b is not None: if not b.isalpha():...
Mitchkoens/sympy
refs/heads/master
sympy/solvers/__init__.py
22
"""A module for solving all kinds of equations. Examples ======== >>> from sympy.solvers import solve >>> from sympy.abc import x >>> solve(x**5+5*x**4+10*x**3+10*x**2+5*x+1,x) [-1] """ from .solvers import solve, solve_linear_system, solve_linear_system_LU, \ solve_undetermined_coeffs, ns...
diegocrzt/pmspy
refs/heads/master
pms/modelo/peticionControlador.py
1
from entidad import Proyecto, Peticion, Voto, LB_Ver, Miembro, ItemPeticion,LineaBase from initdb import db_session, init_db, shutdown_session from pms.modelo.proyectoControlador import getProyectoId from pms.modelo.usuarioControlador import getUsuarios from pms.modelo.itemControlador import getVersionId, getVersionIte...
mglukhikh/intellij-community
refs/heads/master
python/testData/refactoring/introduceVariable/py2862.py
83
response = self._reqXml('PUT', <selection>'/import/' + urllib.quote(projectId) + '/issues?' + urllib.urlencode({'assigneeGroup': assigneeGroup})</selection>, xml, 400).toxml().encode('utf-8')
mahak/cinder
refs/heads/master
cinder/policies/snapshot_metadata.py
5
# Copyright (c) 2017 Huawei Technologies Co., Ltd. # 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 # # ...
adarob/magenta
refs/heads/master
magenta/models/nsynth/wavenet/fastgen.py
2
# Copyright 2019 The Magenta Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
JetBrains/intellij-community
refs/heads/master
python/helpers/py2only/docutils/writers/odf_odt/pygmentsformatter.py
244
# $Id: pygmentsformatter.py 5853 2009-01-19 21:02:02Z dkuhlman $ # Author: Dave Kuhlman <dkuhlman@rexx.com> # Copyright: This module has been placed in the public domain. """ Additional support for Pygments formatter. """ import pygments import pygments.formatter class OdtPygmentsFormatter(pygments.formatter.For...
JCBarahona/edX
refs/heads/master
common/djangoapps/util/tests/test_keyword_sub_utils.py
130
""" Tests for keyword_substitution.py """ from student.tests.factories import UserFactory from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from ddt import ddt, file_data from mock import patch from util.date_utils import get_default_...
ecoal95/servo
refs/heads/master
components/script/dom/bindings/codegen/parser/tests/test_interface_maplikesetlikeiterable.py
53
import WebIDL import traceback def WebIDLTest(parser, harness): def shouldPass(prefix, iface, expectedMembers, numProductions=1): p = parser.reset() p.parse(iface) results = p.finish() harness.check(len(results), numProductions, "%s - Should have production cou...
areriff/pythonlearncanvas
refs/heads/master
Python Script Sample/portscanner.py
1
# Script Name : portscanner.py # Author : Craig Richards # Created : 20 May 2013 # Last Modified : # Version : 1.0 # Modifications : # Description : Port Scanner, you just pass the host and the ports import optparse # Import the module from socket import * # Import the module from threading import * # Impor...
chauhanhardik/populo_2
refs/heads/master
common/lib/xmodule/xmodule/tests/test_bulk_assertions.py
173
import ddt import itertools from xmodule.tests import BulkAssertionTest, BulkAssertionError STATIC_PASSING_ASSERTIONS = ( ('assertTrue', True), ('assertFalse', False), ('assertIs', 1, 1), ('assertEqual', 1, 1), ('assertEquals', 1, 1), ('assertIsNot', 1, 2), ('assertIsNone', None), ('as...
procoder317/scikit-learn
refs/heads/master
sklearn/externals/joblib/_memory_helpers.py
303
try: # Available in Python 3 from tokenize import open as open_py_source except ImportError: # Copied from python3 tokenize from codecs import lookup, BOM_UTF8 import re from io import TextIOWrapper, open cookie_re = re.compile("coding[:=]\s*([-\w.]+)") def _get_normal_name(orig_enc): ...
PX4/Firmware
refs/heads/master
src/lib/parameters/px4params/srcparser.py
2
import sys import re import math global default_var default_var = {} class ParameterGroup(object): """ Single parameter group """ def __init__(self, name): self.name = name self.no_code_generation = False #for injected parameters self.params = [] def AddParameter(self, par...
wyom/sympy
refs/heads/master
sympy/vector/functions.py
66
from sympy.vector.coordsysrect import CoordSysCartesian from sympy.vector.dyadic import Dyadic from sympy.vector.vector import Vector, BaseVector from sympy.vector.scalar import BaseScalar from sympy import sympify, diff, integrate, S def express(expr, system, system2=None, variables=False): """ Global functi...
bowlofstew/Herd
refs/heads/master
herd/BitTornado/BT1/__init__.py
101
# placeholder
freedesktop-unofficial-mirror/telepathy__telepathy-mission-control
refs/heads/master
tests/twisted/account-manager/auto-connect.py
1
# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # 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 l...
carloscrespog/HookTemperature
refs/heads/master
node_modules/hook.io/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/ninja_test.py
39
#!/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. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import TestCommon class Tes...
ShinyROM/android_external_chromium_org
refs/heads/master
tools/perf/benchmarks/spaceport.py
23
# 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. """Runs spaceport.io's PerfMarks benchmark.""" import logging import os import sys from telemetry import test from telemetry.core import util from tele...
taxido/django-xadmin
refs/heads/master
xadmin/plugins/relate.py
9
# coding=UTF-8 from django.core.urlresolvers import reverse from django.utils.encoding import force_unicode from django.utils.encoding import smart_str from django.utils.safestring import mark_safe from django.db.models.sql.query import LOOKUP_SEP from django.db.models.related import RelatedObject from django.utils.tra...
pyjs/pyjs
refs/heads/master
examples/showcase/src/demos_widgets/checkBox.py
13
""" The ``ui.CheckBox`` class is used to show a standard checkbox. When the user clicks on the checkbox, the checkbox's state is toggled. The ``setChecked(checked)`` method checks or unchecks the checkbox depending on the value of the parameter. To get the current value of the checkbox, call ``isChecked()``. You ca...
helenwarren/pied-wagtail
refs/heads/master
wagtail/wagtailusers/forms.py
3
from django import forms from django.contrib.auth import get_user_model from django.contrib.auth.forms import UserCreationForm as BaseUserCreationForm from django.utils.translation import ugettext_lazy as _ User = get_user_model() # extend Django's UserCreationForm with an 'is_superuser' field class UserCreationForm...