repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
zploskey/servo
refs/heads/master
components/script/dom/bindings/codegen/parser/tests/test_double_null.py
276
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface DoubleNull { attribute byte?? foo; }; """) results = parser.finish() except: threw = True harness.ok(threw, "Should have thrown.")
leafclick/intellij-community
refs/heads/master
python/helpers/py2only/docutils/parsers/rst/languages/he.py
128
# Author: Meir Kriheli # Id: $Id: he.py 7119 2011-09-02 13:00:23Z milde $ # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each language: ...
StevenVanAcker/mitmproxy
refs/heads/master
examples/simple/modify_form.py
6
from mitmproxy import http def request(flow: http.HTTPFlow) -> None: if flow.request.urlencoded_form: # If there's already a form, one can just add items to the dict: flow.request.urlencoded_form["mitmproxy"] = "rocks" else: # One can also just pass new form data. # This sets t...
moble/sympy
refs/heads/master
examples/advanced/fem.py
107
#!/usr/bin/env python """FEM library Demonstrates some simple finite element definitions, and computes a mass matrix $ python fem.py [ 1/60, 0, -1/360, 0, -1/90, -1/360] [ 0, 4/45, 0, 2/45, 2/45, -1/90] [-1/360, 0, 1/60, -1/90, 0, -1/360] [ 0, 2/45, -1/90, 4/45, 2/45, 0] ...
luckylavish/zamboni
refs/heads/master
mkt/ratings/__init__.py
67
REVIEW_MODERATE_KEEP = -1 REVIEW_MODERATE_SKIP = 0 REVIEW_MODERATE_DELETE = 1
seanli9jan/tensorflow
refs/heads/master
tensorflow/contrib/optimizer_v2/optimizer_v2.py
2
# 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...
yanheven/nova
refs/heads/master
nova/tests/unit/api/openstack/compute/contrib/test_security_groups.py
9
# Copyright 2011 OpenStack Foundation # Copyright 2012 Justin Santa Barbara # # 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 # #...
mabushadi/dpxdt
refs/heads/master
dependencies/appengine-gcs-client/python/demo/cloudstorage/test_utils.py
45
# Copyright 2013 Google Inc. All Rights Reserved. """Utils for testing.""" class MockUrlFetchResult(object): def __init__(self, status, headers, body): self.status_code = status self.headers = headers self.content = body self.content_was_truncated = False self.final_url = None
qrizan/moopy
refs/heads/master
moopy/moopy/wsgi.py
1
""" WSGI config for moopy project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTIN...
ProjectCloudly/cloudly
refs/heads/master
userprofile/views.py
2
# -*- coding: utf-8 -*- import os import time import logging import unicodedata import datetime import string, pickle from random import choice from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext_lazy as _ from django.http import H...
PongPi/isl-odoo
refs/heads/8.0
addons/l10n_be_hr_payroll_account/__init__.py
430
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
sgraham/nope
refs/heads/master
tools/gyp/test/mac/gyptest-cflags.py
100
#!/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 compile-time flags work. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.TestGyp(formats=['...
jameshensman/pymc3
refs/heads/master
pymc3/examples/factor_potential.py
14
from pymc3 import * with Model() as model: x = Normal('x', 1, 1) x2 = Potential('x2', -x ** 2) start = model.test_point h = find_hessian(start) step = Metropolis(model.vars, h) def run(n = 3000): if n == "short": n = 50 with model: trace = sample(n, step, start) if __name...
lucuma/solution
refs/heads/master
tests/test_collections.py
2
# coding=utf-8 from operator import eq import solution as f def lists_are_equal(l1, l2): return all(map(eq, l1, l2)) def test_render_(): field = f.Collection() field.name = 'abc' field.load_data(u'a, b,c') assert field() == field.as_input() assert (field(foo='bar') == u'<input ...
crakensio/django_training
refs/heads/master
lib/python2.7/site-packages/pip/commands/help.py
401
from pip.basecommand import Command, SUCCESS from pip.exceptions import CommandError class HelpCommand(Command): """Show help for commands""" name = 'help' usage = """ %prog <command>""" summary = 'Show help for commands.' def run(self, options, args): from pip.commands import comma...
trondkr/romstools
refs/heads/master
CreateObsFileIS4DVAR/writeObsfile.py
1
from netCDF4 import Dataset from netCDF4 import num2date import numpy as np import time import os import datetime __author__ = 'Trond Kristiansen' __email__ = 'trond.kristiansen@imr.no' __created__ = datetime.datetime(2012, 12, 30) __modified__ = datetime.datetime(2013, 2, 12) __version__ = "1.0" ...
elianerpereira/gtg
refs/heads/master
GTG/backends/backend_mantis.py
2
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
was4444/chromium.src
refs/heads/nw15
native_client_sdk/src/build_tools/build_updater.py
51
#!/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. """Build script to generate a new sdk_tools bundle. This script packages the files necessary to generate the SDK updater -- the to...
Fireblend/chromium-crosswalk
refs/heads/master
build/android/pylib/device/device_list.py
114
# Copyright 2014 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. """A module to keep track of devices across builds.""" import os LAST_DEVICES_FILENAME = '.last_devices' LAST_MISSING_DEVICES_FILENAME = '.last_missing' ...
fasrc/lilpsp
refs/heads/master
lilpsp/config.py
1
""" basic configuration DESCRIPTION Paremeters controlling how the site functions. This file is intended to be modified. See comments below for details on each option. See the README for a higer-level overview. REQUIREMENTS n/a AUTHOR Copyright (c) 2011-2013 Harvard FAS Research Computing John Brunelle <...
bwh0/stuff
refs/heads/master
website/Farooqui Conjecture.py
1
# Farooqui Conjecture.py # Imaad Farooqui # Farooqui Conjecture LCM # Modules import math from time import sleep # LCM Function def LCM(num1, num2): stop = 0 # Set Variables # Find biggest value if(num1>num2): maximum = math.ceil(0.5 * num1) bigger = 1 else: maximum ...
pothosware/gr-runtime
refs/heads/master
gnuradio-runtime/python/gnuradio/gr/pubsub.py
78
#!/usr/bin/env python # # Copyright 2008,2009 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 optio...
hack4impact/asylum-connect-catalog
refs/heads/master
app/bulk_resource/forms.py
2
from flask.ext.wtf import Form from flask_wtf.file import InputRequired from wtforms.fields import (FieldList, FormField, RadioField, SelectField, SelectMultipleField, SubmitField) class NavigationForm(Form): submit_next = SubmitField('Next') submit_cancel = SubmitField('Cancel') ...
mglukhikh/intellij-community
refs/heads/master
python/testData/stubs/FullyQualifiedTypingNamedTupleKwargsWithAs.py
27
import typing as T nt = T.NamedTuple("name", field=str)
abstract-open-solutions/OCB
refs/heads/8.0
addons/auth_signup/res_users.py
90
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
RPi-Distro/python-energenie
refs/heads/master
examples/simple/on_off.py
3
from energenie import switch_on, switch_off from time import sleep while True: print("switching on...") switch_on() sleep(2) print("switching off...") switch_off() sleep(2)
aral/isvat
refs/heads/master
django/contrib/auth/forms.py
19
from __future__ import unicode_literals from django import forms from django.forms.util import flatatt from django.template import loader from django.utils.datastructures import SortedDict from django.utils.html import format_html, format_html_join from django.utils.http import urlsafe_base64_encode from django.utils....
atopuzov/nitro-python
refs/heads/master
nssrc/com/citrix/netscaler/nitro/resource/stat/pq/pq_stats.py
3
# # Copyright (c) 2008-2015 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 l...
raju249/oppia
refs/heads/develop
scripts/build.py
5
# Copyright 2014 The Oppia 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 applicable ...
dsquareindia/scikit-learn
refs/heads/master
sklearn/neighbors/tests/test_approximate.py
30
""" Testing for the approximate neighbor search using Locality Sensitive Hashing Forest module (sklearn.neighbors.LSHForest). """ # Author: Maheshakya Wijewardena, Joel Nothman import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_a...
allenlavoie/tensorflow
refs/heads/master
tensorflow/contrib/gan/python/eval/python/classifier_metrics_test.py
15
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
lablup/sorna-common
refs/heads/20.03
src/ai/backend/common/logging_utils.py
1
import logging class BraceMessage: __slots__ = ('fmt', 'args') def __init__(self, fmt, args): self.fmt = fmt self.args = args def __str__(self): return self.fmt.format(*self.args) class BraceStyleAdapter(logging.LoggerAdapter): def __init__(self, logger, extra=None): ...
vinicius-alves/InternetBanking
refs/heads/master
app/models/transaction_vip.py
1
from django.db import models from app.models import TransactionManager from app.models.data_models import Transaction, Transaction_Type from datetime import datetime from pytz import timezone class TransactionVip (TransactionManager): def updateDebits(self): ''' Inicialmente, chama o "Cashier" par...
pengphei/cinemaman
refs/heads/master
ui/MovieListView.py
1
# -*- coding: utf-8 -*- import Tkinter as tk import ttk from CMApp import * class CMMovieListView(ttk.Frame): def __init__(self, root, parent, width_): ttk.Frame.__init__(self, parent, class_="CMMovieListView", width=width_) self.root = root self.parent = parent self.width = widt...
xrmx/django
refs/heads/master
django/contrib/gis/gdal/__init__.py
130
""" This module houses ctypes interfaces for GDAL objects. The following GDAL objects are supported: CoordTransform: Used for coordinate transformations from one spatial reference system to another. Driver: Wraps an OGR data source driver. DataSource: Wrapper for the OGR data source object, supports OGR-su...
scorpilix/Golemtest
refs/heads/develop
tests/golem/core/test_fileencrypt.py
2
import os import random from golem.core.fileencrypt import FileHelper, FileEncryptor, AESFileEncryptor from golem.resource.dirmanager import DirManager from golem.tools.testdirfixture import TestDirFixture class TestAESFileEncryptor(TestDirFixture): """ Test encryption using AESFileEncryptor """ def setUp(s...
aerophile/django
refs/heads/master
django/db/backends/sqlite3/utils.py
108
from django.conf import settings from django.utils import timezone from django.utils.dateparse import parse_datetime def parse_datetime_with_timezone_support(value): dt = parse_datetime(value) # Confirm that dt is naive before overwriting its tzinfo. if dt is not None and settings.USE_TZ and timezone.is_n...
GbalsaC/bitnamiP
refs/heads/master
edx-ora2/docs/en_us/course_authors/source/conf.py
48
# -*- coding: utf-8 -*- # import sys, os # on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally import sphinx_rtd_theme html_theme ...
111pontes/ydk-py
refs/heads/master
cisco-ios-xe/ydk/models/cisco_ios_xe/ATM_TC_MIB.py
1
""" ATM_TC_MIB This MIB Module provides Textual Conventions and OBJECT\-IDENTITY Objects to be used by ATM systems. """ import re import collections from enum import Enum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk.errors import YPYError, YPYModelError from ydk.mod...
sinkuri256/python-for-android
refs/heads/master
python-modules/twisted/twisted/pair/ip.py
55
# -*- test-case-name: twisted.pair.test.test_ip -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """Support for working directly with IP packets""" import struct import socket from twisted.internet import protocol from twisted.pair import raw from zope.interface import implem...
MobinRanjbar/hue
refs/heads/master
desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/__init__.py
44
""" ldap - base module See http://www.python-ldap.org/ for details. $Id: __init__.py,v 1.70 2011/02/19 14:36:53 stroeder Exp $ """ # This is also the overall release version number __version__ = '2.3.13' import sys if __debug__: # Tracing is only supported in debugging mode import traceback _trace_level = 0...
benjaminpope/whisky
refs/heads/master
Seeing/phasescreen.py
2
# ------------------------------------------------------------ phasescreen.py ---------------------------------------- # Author: Alexey Latyshev -------------------------------------------------------------------------------------------- # ------------------- This file contains functions for generating atmosphere phase...
nikhilprathapani/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/test/test_crypt.py
63
from test import support import unittest crypt = support.import_module('crypt') class CryptTestCase(unittest.TestCase): def test_crypt(self): c = crypt.crypt('mypassword', 'ab') if support.verbose: print('Test encryption: ', c) def test_main(): support.run_unittest(CryptTestCase)...
Woomp/fibonacci
refs/heads/develop
setup.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*-\ from setuptools import find_packages from setuptools.command.test import test as TestCommand import sys try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme_file: readme = readme_file.read()...
UQ-UQx/old_injestor
refs/heads/master
base/daemon.py
1
#!/usr/bin/env python import sys, os, time, atexit from signal import SIGTERM class Daemon: """ A generic daemon class. Usage: subclass the Daemon class and override the run() method """ def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): self.std...
PepperPD/edx-pepper-platform
refs/heads/master
common/lib/html_to_text.py
244
"""Provides a function to convert html to plaintext.""" import logging from subprocess import Popen, PIPE log = logging.getLogger(__name__) def html_to_text(html_message): """ Converts an html message to plaintext. Currently uses lynx in a subprocess; should be refactored to use something more python...
orgito/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_resource_facts.py
1
#!/usr/bin/python # # Copyright (c) 2018 Zim Kalinowski, <zikalino@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 = {'metadata_version': '1.1', ...
aabbox/kbengine
refs/heads/master
kbe/src/lib/python/Lib/plat-sunos5/IN.py
108
# Generated by h2py from /usr/include/netinet/in.h # Included from sys/feature_tests.h # Included from sys/isa_defs.h _CHAR_ALIGNMENT = 1 _SHORT_ALIGNMENT = 2 _INT_ALIGNMENT = 4 _LONG_ALIGNMENT = 8 _LONG_LONG_ALIGNMENT = 8 _DOUBLE_ALIGNMENT = 8 _LONG_DOUBLE_ALIGNMENT = 16 _POINTER_ALIGNMENT = 8 _MAX_ALIGNMENT = 16 _A...
waseem18/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/web/test/test_wsgi.py
18
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.wsgi}. """ __metaclass__ = type from sys import exc_info from urllib import quote from thread import get_ident import StringIO, cStringIO, tempfile from zope.interface.verify import verifyObject from twisted.python....
romanz/trezor-agent
refs/heads/master
agents/trezor/trezor_agent.py
1
from libagent import signify, gpg, ssh from libagent.device.trezor import Trezor as DeviceType ssh_agent = lambda: ssh.main(DeviceType) gpg_tool = lambda: gpg.main(DeviceType) gpg_agent = lambda: gpg.run_agent(DeviceType) signify_tool = lambda: signify.main(DeviceType)
dgzurita/odoo
refs/heads/8.0
addons/base_gengo/__openerp__.py
312
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
geary/claslite
refs/heads/master
web/app/lib/antlr3/compat.py
150
"""Compatibility stuff""" # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 Terence Parr # 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 mus...
Yannig/ansible
refs/heads/devel
lib/ansible/modules/network/panos/panos_dag.py
29
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
sorenmalling/skype4py
refs/heads/master
Skype4Py/lang/fi.py
23
apiAttachAvailable = u'API saatavilla' apiAttachNotAvailable = u'Ei saatavilla' apiAttachPendingAuthorization = u'Odottaa valtuutusta' apiAttachRefused = u'Ev\xe4tty' apiAttachSuccess = u'Onnistui' apiAttachUnknown = u'Tuntematon' budDeletedFriend = u'Poistettu yst\xe4v\xe4listasta' budFriend = u'Yst\xe4v\xe4' budNever...
clstl/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/manifest/utils.py
12
import os from six import StringIO blacklist = ["/", "/tools/", "/resources/", "/common/", "/conformance-checkers/", "_certs"] def rel_path_to_url(rel_path, url_base="/"): assert not os.path.isabs(rel_path) if url_base[0] != "/": url_base = "/" + url_base if url_base[-1] != "/": url_base +...
riklaunim/django-custom-multisite
refs/heads/master
django/contrib/staticfiles/storage.py
66
from __future__ import with_statement import hashlib import os import posixpath import re from urllib import unquote from urlparse import urlsplit, urlunsplit, urldefrag from django.conf import settings from django.core.cache import (get_cache, InvalidCacheBackendError, cache as default_...
tumbl3w33d/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_remote_role.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...
bsmr-ansible/ansible-modules-extras
refs/heads/devel
cloud/cloudstack/cs_staticnat.py
44
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
abhishekgahlot/scikit-learn
refs/heads/master
examples/svm/plot_weighted_samples.py
69
""" ===================== SVM: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. The sample weighting rescales the C parameter, which means that the classifier puts more emphasis on getting these points right. The effect might ...
mitmproxy/mitmproxy
refs/heads/main
test/mitmproxy/addons/test_maplocal.py
2
import sys from pathlib import Path import pytest from mitmproxy.addons.maplocal import MapLocal, MapLocalSpec, file_candidates from mitmproxy.utils.spec import parse_spec from mitmproxy.test import taddons from mitmproxy.test import tflow @pytest.mark.parametrize( "url,spec,expected_candidates", [ ...
nonZero/OpenCommunity
refs/heads/master
src/communities/south_migrations/0013_auto__add_field_community_inform_system_manager.py
3
# -*- 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 field 'Community.inform_system_manager' db.add_column(u'communities_community', 'inform_system_mana...
torchbox/sunburnt
refs/heads/master
sunburnt/sunburnt.py
1
from __future__ import absolute_import import cgi import cStringIO as StringIO from itertools import islice import logging import socket, time, urllib, urlparse import warnings from .schema import SolrSchema, SolrError from .search import LuceneQuery, MltSolrSearch, SolrSearch, params_from_dict MAX_LENGTH_GET_URL =...
karlp/pyusb
refs/heads/master
tests/test_util.py
8
# Copyright (C) 2009-2014 Wander Lairson Costa # # The following terms apply to all files associated # with the software unless explicitly disclaimed in individual files. # # The authors hereby grant permission to use, copy, modify, distribute, # and license this software and its documentation for any purpose, provided...
jealone/shadowsocks
refs/heads/master
shadowsocks/daemon.py
386
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014-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...
williamfeng323/py-web
refs/heads/master
flask/lib/python3.6/site-packages/sqlalchemy/dialects/oracle/zxjdbc.py
33
# oracle/zxjdbc.py # Copyright (C) 2005-2017 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 """ .. dialect:: oracle+zxjdbc :name: zxJDBC for Jython :dbapi: zxjdbc ...
jeanlinux/calibre
refs/heads/master
src/cherrypy/lib/static.py
83
try: from io import UnsupportedOperation except ImportError: UnsupportedOperation = object() import logging import mimetypes mimetypes.init() mimetypes.types_map['.dwg']='image/x-dwg' mimetypes.types_map['.ico']='image/x-icon' mimetypes.types_map['.bz2']='application/x-bzip2' mimetypes.types_map['.gz']='applica...
rytaft/h-store
refs/heads/master
tools/hstore/fabric/abstractfabric.py
9
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------- # Copyright (C) 2013 by H-Store Project # Brown University # Massachusetts Institute of Technology # Yale University # # http://hstore.cs.brown.edu/ # # Permission is hereby granted, free of charge, to any person obtaini...
azureplus/hue
refs/heads/master
desktop/core/ext-py/guppy-0.1.10/guppy/heapy/test/test_RefPat.py
37
from guppy.heapy.test import support import StringIO, sys, types, unittest class TestCase(support.TestCase): def setUp(self): support.TestCase.setUp(self) self.RefPat = self.heapy.RefPat self.iso = self.Use.iso def makegraph(self, width, length): # Generate a structure which will yield a high number # of...
syci/OCB
refs/heads/9.0
addons/decimal_precision/__init__.py
47
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. #import decimal_precision from decimal_precision import get_precision
alex/html5lib-python
refs/heads/master
html5lib/treewalkers/__init__.py
499
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
zirou30/python_student
refs/heads/master
87.py
1
ingredientes = ['queijo', 'tomate', 'calabresa'] for ingrediente in ingredientes: if ingrediente == 'tomate': print('Desculpa estamos sem ' + ingredientes[1]) else: print('Adicionado ' + ingrediente + '.') print('Pizza Pronta')
johnw424/airflow
refs/heads/master
airflow/operators/__init__.py
8
''' Imports operators dynamically while keeping the package API clean, abstracting the underlying modules ''' from airflow.utils import import_module_attrs as _import_module_attrs # These need to be integrated first as other operators depend on them _import_module_attrs(globals(), { 'check_operator': [ 'Ch...
scalable-networks/gnuradio-3.7.2.1
refs/heads/master
grc/python/Platform.py
7
__doc__ = """ Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your opt...
heran7/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/tests/test_html_module.py
61
import unittest from mock import Mock from xblock.field_data import DictFieldData from xmodule.html_module import HtmlModule from . import get_test_system class HtmlModuleSubstitutionTestCase(unittest.TestCase): descriptor = Mock() def test_substitution_works(self): sample_xml = '''%%USER_ID%%''' ...
staticlibs/android-ndk-r9d-arm-linux-androideabi-4.8
refs/heads/master
lib/python2.7/test/test_codecmaps_cn.py
150
#!/usr/bin/env python # # test_codecmaps_cn.py # Codec mapping tests for PRC encodings # from test import test_support from test import test_multibytecodec_support import unittest class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'gb2312' map...
hhkaos/awesome-arcgis
refs/heads/master
node_modules/gitbook-cli/node_modules/npmi/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py
2779
# Copyright (c) 2011 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. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
woodshop/chainer
refs/heads/master
tests/functions_tests/test_softmax.py
4
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.testing import condition if cuda.available: cuda.init() class TestSoftmax(unittest.TestCase...
StuartMacKay/checklists_scrapers
refs/heads/master
checklists_scrapers/tests/scripts/validate_worldbirds_scraper.py
1
""" validate_worldbirds_scraper.py This script used to validate the scraper used to download checklists from a WorldBirds server. Once the scraper has completed the suite of tests in the module checklists_scrapers.tests.sites is executed to verify that all the information is extracted correctly from the site. To run ...
vladmm/intellij-community
refs/heads/master
python/testData/inspections/AddCallSuperOptionalAndRequiredParamsNameCollision.py
79
class A: def __init__(self, a): pass class B(A): def <warning descr="Call to __init__ of super class is missed">__init_<caret>_</warning>(self, a=1): pass
gcode-mirror/audacity
refs/heads/master
lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/Tools/irixcc.py
330
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os from waflib import Utils from waflib.Tools import ccroot,ar from waflib.Configure import conf @conf def find_irixcc(conf): v=conf.env cc=None if v['CC']:cc=v['CC'...
sgarrity/bedrock
refs/heads/master
bedrock/newsletter/redirects.py
4
from bedrock.redirects.util import redirect redirectpatterns = ( # bug 926629 redirect(r'^newsletter/about_mobile(?:/(?:index\.html)?)?$', 'newsletter.subscribe'), redirect(r'^newsletter/about_mozilla(?:/(?:index\.html)?)?$', 'mozorg.contribute.index'), redirect(r'^newsletter/new(?:/(?:index\.html)?)?...
creativeprogramming/ajenti
refs/heads/master
plugins/services/groups.py
12
from ajenti.api import * from ajenti.com import * class ServiceGroups (Plugin): def __init__(self): self.read() def read(self): if not self.app.config.has_section('services'): self.app.config.add_section('services') r = {} names = {} content = {} f...
israeleriston/scientific-week
refs/heads/master
backend/venv/lib/python3.5/site-packages/pip/req/req_set.py
338
from __future__ import absolute_import from collections import defaultdict from itertools import chain import logging import os from pip._vendor import pkg_resources from pip._vendor import requests from pip.compat import expanduser from pip.download import (is_file_url, is_dir_url, is_vcs_url, url_to_path, ...
jcpowermac/ansible
refs/heads/devel
lib/ansible/module_utils/service.py
37
# 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...
DailyActie/Surrogate-Model
refs/heads/master
01-codes/scipy-master/scipy/linalg/_solvers.py
1
"""Matrix equation solver routines""" # Author: Jeffrey Armstrong <jeff@approximatrix.com> # February 24, 2012 # Modified: Chad Fulton <ChadFulton@gmail.com> # June 19, 2014 # Modified: Ilhan Polat <ilhanpolat@gmail.com> # September 13, 2016 from __future__ import division, print_function, absolute_import import nu...
lucafavatella/intellij-community
refs/heads/cli-wip
python/testData/refactoring/extractsuperclass/importMultiFile/source_module.after.py
320
from dest_module import NewParent class MyClass(NewParent): pass
rlutes/volttron-applications
refs/heads/master
kisensum/openadr/openadr/features/steps/drevent.py
2
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # Copyright (c) 2017, Battelle Memorial Institute # 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. Redistri...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/static/space/debris/shared_droid_fighter_debris_s02.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/space/debris/shared_droid_fighter_debris_s02.iff" result.attribute_temp...
MFoster/breeze
refs/heads/master
tests/regressiontests/urlpatterns_reverse/views.py
51
from django.http import HttpResponse from django.views.generic import RedirectView from django.core.urlresolvers import reverse_lazy from django.contrib.auth.decorators import user_passes_test def empty_view(request, *args, **kwargs): return HttpResponse('') def kwargs_view(request, arg1=1, arg2=2): return H...
mvidalgarcia/indico
refs/heads/master
indico/modules/events/contributions/models/persons.py
2
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from indico.core.db.sqlalchemy import PyIntEnum, db from indico.m...
savoirfairelinux/OpenUpgrade
refs/heads/master
addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py
382
########################################################################## # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gener...
emijrp/youtube-dl
refs/heads/master
youtube_dl/postprocessor/metadatafromtitle.py
115
from __future__ import unicode_literals import re from .common import PostProcessor from ..utils import PostProcessingError class MetadataFromTitlePPError(PostProcessingError): pass class MetadataFromTitlePP(PostProcessor): def __init__(self, downloader, titleformat): super(MetadataFromTitlePP, se...
evanccnyc/ansible
refs/heads/devel
test/units/template/__init__.py
7690
# (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...
avigmati/djcat
refs/heads/master
tests/catalog_module_realty/apps.py
1
from django.apps import AppConfig class CatalogModuleRealtyConfig(AppConfig): name = 'catalog_module_realty'
CamelBackNotation/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/plat-mac/Carbon/File.py
82
from _File import *
Shadowsocksfork/ShadowsocksFork
refs/heads/master
tests/graceful_cli.py
977
#!/usr/bin/python import socks import time SERVER_IP = '127.0.0.1' SERVER_PORT = 8001 if __name__ == '__main__': s = socks.socksocket() s.set_proxy(socks.SOCKS5, SERVER_IP, 1081) s.connect((SERVER_IP, SERVER_PORT)) s.send(b'test') time.sleep(30) s.close()
bohlian/erpnext
refs/heads/develop
erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py
32
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import json from frappe.model.document import Document from frappe.utils.jinja import validate_template class TermsandConditions(Document...
yongshengwang/builthue
refs/heads/master
desktop/core/ext-py/Django-1.4.5/django/contrib/gis/geos/base.py
86
from ctypes import c_void_p from types import NoneType from django.contrib.gis.geos.error import GEOSException # Trying to import GDAL libraries, if available. Have to place in # try/except since this package may be used outside GeoDjango. try: from django.contrib.gis import gdal except ImportError: # A 'dumm...
brutkin/commons
refs/heads/master
tests/python/twitter/common/metrics/test_sampling.py
13
# ================================================================================================== # Copyright 2013 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
jcoady9/python-for-android
refs/heads/master
python3-alpha/extra_modules/gdata/tlslite/utils/Python_AES.py
48
"""Pure-Python AES implementation.""" from .cryptomath import * from .AES import * from .rijndael import rijndael def new(key, mode, IV): return Python_AES(key, mode, IV) class Python_AES(AES): def __init__(self, key, mode, IV): AES.__init__(self, key, mode, IV, "python") self.rijndael = rij...