repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
tafia/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/upload.py
232
def main(request, response): content = [] for key, values in sorted(item for item in request.POST.items() if not hasattr(item[1][0], "filename")): content.append("%s=%s," % (key, values[0])) content.append("\n") for key, values in sorted(item for item in request.POST.items() if hasattr(item[1...
zhimin711/nova
refs/heads/master
nova/tests/unit/servicegroup/test_api.py
9
# Copyright 2015 Intel Corp. # # 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, soft...
johankaito/fufuka
refs/heads/master
microblog/old-flask/lib/python2.7/site-packages/setuptools/command/install_lib.py
396
import os import imp from itertools import product, starmap import distutils.command.install_lib as orig class install_lib(orig.install_lib): """Don't add compiled flags to filenames of non-Python files""" def run(self): self.build() outfiles = self.install() if outfiles is not None: ...
snegovick/dswarm_simulator
refs/heads/master
emath/emath.py
1
""" Convert from polar (r,w) to rectangular (x,y) x = r cos(w) y = r sin(w) """ def rect(r, w, deg=0): # radian if deg=0; degree if deg=1 from math import cos, sin, pi if deg: w = pi * w / 180.0 return r * cos(w), r * sin(w) """ Convert from rectangular (x,y) to polar (r,w) r = sqrt(x^2 + y^2) w =...
ntt-sic/nova
refs/heads/master
nova/api/openstack/compute/contrib/hypervisors.py
11
# Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
barzan/dbseer
refs/heads/master
rs-sysmon2/plugins/dstat_sendmail.py
8
### Author: Dag Wieers <dag@wieers.com> ### FIXME: Should read /var/log/mail/statistics or /etc/mail/statistics (format ?) class dstat_plugin(dstat): def __init__(self): self.name = 'sendmail' self.vars = ('queue',) self.type = 'd' self.width = 4 self.scale = 100 def c...
jungla/ICOM-fluidity-toolbox
refs/heads/master
Detectors/offline_advection/plot_traj_23D.py
1
#!~/python import fluidity_tools import matplotlib as mpl mpl.use('ps') import matplotlib.pyplot as plt import myfun import numpy as np import os import fio import lagrangian_stats import advect_functions from matplotlib.patches import Ellipse exp = 'm_25_2' filename2D = 'traj_m_25_2_512_0_500_2D.csv' filename3D = 't...
liorsion/django-avatar
refs/heads/master
tests/settings.py
71
from django.conf.urls.defaults import patterns, include, handler500, handler404 DEFAULT_CHARSET = 'utf-8' DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = ':memory:' ROOT_URLCONF = 'settings' STATIC_URL = '/site_media/static/' SITE_ID = 1 INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.auth', ...
hurricup/intellij-community
refs/heads/master
python/testData/inspections/PyTypeCheckerInspection/MapReturnElementType.py
48
def test(): xs = map(lambda x: x + 1, [1, 2, 3]) print('foo' + xs[0]) # Can be a str since map returns list[V] | str | unicode ys = map(tuple, iter([1, 2, 3])) print(1 + <warning descr="Expected type 'Number', got 'Union[tuple, str, unicode]' instead">ys[0]</warning>, 'bar' + ys[1])
ffurano/root5
refs/heads/v5-34-00-patches
tutorials/pyroot/parse_CSV_file_with_TTree_ReadStream.py
28
#!/usr/bin/env python import ROOT import sys import os def parse_CSV_file_with_TTree_ReadStream(tree_name, afile): """ parse_CSV_file_with_TTree_ReadStream Michael Marino: mmarino@gmail.com This function provides an example of how one might massage a csv data file to read into a ROOT TTree ...
krafczyk/spack
refs/heads/develop
var/spack/repos/builtin/packages/r-amap/package.py
2
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
RichDijk/eXe
refs/heads/master
formless/webform.py
10
# -*- test-case-name: formless.test.test_freeform -*- # Copyright (c) 2004 Divmod. # See LICENSE for details. from __future__ import generators import os import os.path import warnings from nevow import inevow from nevow.stan import slot, specialMatches from nevow.tags import * from nevow import util from nevow im...
membase/ep-engine
refs/heads/master
management/cli_auth_utils.py
2
#!/usr/bin/env python import clitool import inspect import mc_bin_client import memcacheConstants import sys import os def cmd_decorator(f): """Decorate a function with code to authenticate based on 1-3 additional arguments.""" def g(*args, **kwargs): mc = args[0] spec = inspect.getargspe...
studiawan/pygraphc
refs/heads/master
pygraphc/clustering/MaxCliquesPercolation.py
1
import networkx as nx from itertools import combinations from KCliquePercolation import KCliquePercolation from ClusterUtility import ClusterUtility class MaxCliquesPercolation(KCliquePercolation): """This class find maximal cliques and their percolation in a graph. The procedure will find any intersection (...
nvoron23/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/context_processors/models.py
431
# Models file for tests to run.
2947721120/curly-hockeypuck
refs/heads/master
examples/python/crossword2.py
32
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
google-code-export/evennia
refs/heads/master
src/server/caches.py
2
""" Central caching module. """ from sys import getsizeof import os import threading from collections import defaultdict from src.server.models import ServerConfig from src.utils.utils import uses_database, to_str, get_evennia_pids _GA = object.__getattribute__ _SA = object.__setattr__ _DA = object.__delattr__ _IS...
hvaibhav/linux-media
refs/heads/master
tools/perf/util/setup.py
97
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
haiyangd/python-show-me-the-code-
refs/heads/master
renzongxian/0001/0001.py
40
# Source:https://github.com/Show-Me-the-Code/show-me-the-code # Author:renzongxian # Date:2014-11-30 # Python 3.4 """ 第 0001 题:做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码 (或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)? """ import uuid def generate_key(): key_list = [] for i in range(200): uuid_key = uuid....
codebhendi/scrapy
refs/heads/master
scrapy/utils/response.py
20
""" This module provides some useful functions for working with scrapy.http.Response objects """ import os import re import weakref import webbrowser import tempfile from twisted.web import http from twisted.web.http import RESPONSES from w3lib import html from scrapy.utils.decorators import deprecated @deprecated...
ElDeveloper/qiime
refs/heads/master
tests/test_plot_rank_abundance_graph.py
15
#!/usr/bin/env python # File created on 17 Aug 2010 from __future__ import division __author__ = "Jens Reeder" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Jens Reeder", "Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Justin Kuczynski" __email__ = "justinak@gmail...
beiko-lab/gengis
refs/heads/master
bin/Lib/site-packages/win32/Demos/security/list_rights.py
4
import win32security,win32file,win32api,ntsecuritycon,win32con from security_enums import TRUSTEE_TYPE,TRUSTEE_FORM,ACE_FLAGS,ACCESS_MODE new_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), (win32security.LookupPrivilegeValue('',ntsecurit...
Argon-Zhou/django
refs/heads/master
tests/multiple_database/tests.py
47
from __future__ import unicode_literals import datetime import pickle import warnings from operator import attrgetter from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.core import management from django.db import DEFAULT_DB_ALIAS, connections, router, t...
sbauza/sandbox
refs/heads/master
sandbox/__init__.py
1
# -*- coding: utf-8 -*- # 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, softw...
akiellor/selenium
refs/heads/master
py/test/selenium/webdriver/firefox/profile_tests.py
4
# Copyright 2008-2009 WebDriver committers # Copyright 2008-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 requ...
fangxingli/hue
refs/heads/master
desktop/core/ext-py/django-nose-1.3/testapp/runtests.py
45
#!/usr/bin/env python import sys from django.conf import settings if not settings.configured: settings.configure( DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3'}}, INSTALLED_APPS=[ 'django_nose', ], ) from django_nose import NoseTestSuiteRunner def runtests...
wesolutki/voter
refs/heads/master
common/models.py
1
# -*- coding: utf-8 -*- # from django.db import models from django.core.exceptions import ValidationError class ShortFloatField(models.FloatField): pass class ShortIntegerField(models.IntegerField): pass class AdditionalNotesField(models.TextField): pass class DescriptionField(models.TextField): ...
bvilhjal/ldpred
refs/heads/master
setup.py
1
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path import ldpred her...
js0701/chromium-crosswalk
refs/heads/master
build/android/gyp/jar_toc.py
19
#!/usr/bin/env python # # 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. """Creates a TOC file from a Java jar. The TOC file contains the non-package API of the jar. This includes all public/protected/pack...
havt/odoo
refs/heads/8.0
addons/mass_mailing/models/mail_thread.py
220
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
be-cloud-be/horizon-addons
refs/heads/9.0
server/addons/l10n_cn_small_business/__init__.py
256
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (C) 2007-2014 Jeff Wang(<http://jeff@osbzr.com>).
piffey/ansible
refs/heads/devel
lib/ansible/modules/utilities/logic/wait_for_connection.py
74
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Dag Wieers <dag@wieers.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', ...
rtroxell/brkt-cli
refs/heads/master
brkt_cli/service.py
1
# Copyright 2015 Bracket Computing, 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. # A copy of the License is located at # # https://github.com/brkt/brkt-sdk-java/blob/master/LICENSE # # or in the "license"...
nirvn/QGIS
refs/heads/master
python/pyplugin_installer/__init__.py
32
# -*- coding: utf-8 -*- """ *************************************************************************** __init__.py --------------------- Date : May 2013 Copyright : (C) 2013 by Borys Jurgiel Email : info at borysjurgiel dot pl This module is based on ...
myerpengine/odoo
refs/heads/master
addons/mail/mail_alias.py
32
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
ghickman/django
refs/heads/master
tests/fixtures_model_package/tests.py
312
from __future__ import unicode_literals import warnings from django.core import management from django.test import TestCase from .models import Article class SampleTestCase(TestCase): fixtures = ['fixture1.json', 'fixture2.json'] def testClassFixtures(self): "Test cases can load fixture objects in...
endlessm/chromium-browser
refs/heads/master
third_party/catapult/third_party/google-endpoints/future/backports/xmlrpc/__init__.py
1383
# This directory is a Python package.
nuncjo/odoo
refs/heads/8.0
openerp/report/render/simple.py
324
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
kevalds51/sympy
refs/heads/master
sympy/physics/gaussopt.py
113
from sympy.physics.optics.gaussopt import RayTransferMatrix, FreeSpace,\ FlatRefraction, CurvedRefraction, FlatMirror, CurvedMirror, ThinLens,\ GeometricRay, BeamParameter, waist2rayleigh, rayleigh2waist, geometric_conj_ab,\ geometric_conj_af, geometric_conj_bf, gaussian_conj, conjugate_gauss_beams from sy...
liggitt/openshift-ansible
refs/heads/master
roles/lib_utils/action_plugins/set_version_facts.py
10
""" Ansible action plugin to set version facts """ # pylint: disable=no-name-in-module, import-error, wrong-import-order from distutils.version import LooseVersion from ansible.plugins.action import ActionBase # pylint: disable=too-many-statements def set_version_facts_if_unset(version): """ Set version facts. T...
navigator8972/vae_hwmotion
refs/heads/master
dataset.py
3
import numpy as np class DataSets(object): pass class DataSet(object): def __init__(self, data, labels=None): if labels is not None: #check consistency assert data.shape[0]==labels.shape[0], ( 'data.shape: %s labels.shape: %s' % (data.shape, ...
oschulz/pkg-inst-tools
refs/heads/master
bin/genPkgRules.py
1
#!/usr/bin/env python # Copyright (C) 2014 Oliver Schulz <oliver.schulz@tu-dortmund.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) ...
msiebuhr/v8.go
refs/heads/master
v8/tools/stats-viewer.py
143
#!/usr/bin/env python # # Copyright 2008 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 # noti...
rachel3834/event_observer
refs/heads/master
scripts/version.py
1
# -*- coding: utf-8 -*- """ Created on Mon Apr 4 23:19:06 2016 @author: robouser """ # Version string stored separately from the package so that setup.py can # read it without importing the entire package __version__ = '1.0'
endlessm/chromium-browser
refs/heads/master
third_party/catapult/third_party/pyasn1/pyasn1/type/__init__.py
3653
# This file is necessary to make this directory a package.
joeyjojo/django_offline
refs/heads/master
src/django/db/transaction.py
41
""" This module implements a transaction manager that can be used to define transaction handling in a request or view function. It is used by transaction control middleware and decorators. The transaction manager can be in managed or in auto state. Auto state means the system is using a commit-on-save strategy (actual...
LinkHS/incubator-mxnet
refs/heads/master
example/rnn/old/gru_bucketing.py
38
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Jumpscale/jumpscale6_core
refs/heads/master
apps/osis/logic/system/info/OSIS_info_impl.py
1
from JumpScale import j from JumpScale.grid.osis.OSISStoreES import OSISStoreES # from JumpScale.grid.osis.OSISStore import OSISStore class mainclass(OSISStoreES): """ """
seungjin/app5-seungjin-net.appspot.com
refs/heads/master
django/contrib/contenttypes/management.py
315
from django.contrib.contenttypes.models import ContentType from django.db.models import get_apps, get_models, signals from django.utils.encoding import smart_unicode def update_contenttypes(app, created_models, verbosity=2, **kwargs): """ Creates content types for models in the given app, removing any model ...
zorojean/tushare
refs/heads/master
tushare/stock/fundamental.py
21
# -*- coding:utf-8 -*- """ 基本面数据接口 Created on 2015/01/18 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ import pandas as pd from tushare.stock import cons as ct import lxml.html from lxml import etree import re from pandas.compat import StringIO try: from urllib.request import ur...
lisaglendenning/pynet
refs/heads/master
source/pynet/io/poll/py24/selects.py
1
# @copyright # @license from ipolls import IPoller, EVENTS, POLLIN, POLLOUT, POLLEX, POLLHUP import select as pyselect ############################################################################## ############################################################################## class Poller(IPoller): readabl...
chauhanhardik/populo_2
refs/heads/master
lms/envs/sauce.py
116
""" This config file extends the test environment configuration so that we can run the lettuce acceptance tests on SauceLabs. """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import from sel...
odyaka341/pyglet
refs/heads/master
pyglet/gl/agl.py
46
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
bottompawn/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py
304
'''SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested wi...
DomainGroupOSS/luigi
refs/heads/master
luigi/interface.py
2
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
GitAngel/django
refs/heads/master
tests/migrations/migrations_test_apps/lookuperror_a/models.py
103
from django.db import models class A1(models.Model): pass class A2(models.Model): pass class A3(models.Model): b2 = models.ForeignKey('lookuperror_b.B2') c2 = models.ForeignKey('lookuperror_c.C2') class A4(models.Model): pass
cetic/ansible
refs/heads/devel
lib/ansible/modules/database/mssql/mssql_db.py
8
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Vedit Firat Arig <firatarig@gmail.com> # Outline and parts are reused from Mark Theunissen's mysql_db module # 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_functi...
Swordf1sh/Moderat
refs/heads/master
modules/mlogviewer/main.py
1
import main_ui from PyQt4.QtGui import * from PyQt4.QtCore import * import os from libs.wav_factory import spectrum_analyzer_image, audio_duration class mainPopup(QWidget, main_ui.Ui_Form): def __init__(self, args): QWidget.__init__(self) self.setupUi(self) self.anim = QPropertyAnimatio...
flycn1985/shadowsocks
refs/heads/master
tests/test.py
1016
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 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 required b...
emilyemorehouse/flask-restless
refs/heads/master
docs/conf.py
10
# -*- coding: utf-8 -*- # # Flask-Restless documentation build configuration file, created by # sphinx-quickstart on Fri Mar 2 00:35:49 2012. # # 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. ...
kolsan/StarWarsCarnival
refs/heads/master
Score-Sounds/starwars08.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- #the next line is only needed for python2.x and not necessary for python3.x from __future__ import print_function, division import serial import time import pygame import os import sys import random # if using python2, the get_input command needs to act like raw...
crepererum/invenio
refs/heads/master
invenio/legacy/bibrank/adminlib.py
13
# This file is part of Invenio. # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the ...
geopython/QGIS
refs/heads/master
scripts/parse_dash_results.py
14
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ****************************3*********************************************** parse_dash_results.py --------------------- Date : October 2016 Copyright : (C) 2016 by Nyall Dawson Email : nyall dot dawson at ...
christianurich/VIBe2UrbanSim
refs/heads/master
3rdparty/opus/src/synthesizer/gui/results_menu/doRandPoints.py
2
# PopGen 1.1 is A Synthetic Population Generator for Advanced # Microsimulation Models of Travel Demand # Copyright (C) 2009, Arizona State University # See PopGen/License #----------------------------------------------------------- # # Generate Random Points # # A QGIS plugin for generating a simple random p...
fbossy/SickRage
refs/heads/master
lib/hachoir_core/stream/output.py
74
from cStringIO import StringIO from hachoir_core.endian import BIG_ENDIAN, LITTLE_ENDIAN from hachoir_core.bits import long2raw from hachoir_core.stream import StreamError from errno import EBADF MAX_READ_NBYTES = 2 ** 16 class OutputStreamError(StreamError): pass class OutputStream(object): def __init__(sel...
sagenschneider/FrameworkBenchmarks
refs/heads/master
frameworks/Python/responder/app.py
13
import asyncio import asyncpg import os import responder import jinja2 from random import randint from operator import itemgetter READ_ROW_SQL = 'SELECT "randomnumber" FROM "world" WHERE id = $1' WRITE_ROW_SQL = 'UPDATE "world" SET "randomnumber"=$1 WHERE id=$2' ADDITIONAL_ROW = [0, 'Additional fortune added at reque...
dbarobin/google-mysql-tools
refs/heads/master
pylib/trickle_lib.py
4
# Copyright 2006 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...
yglazko/socorro
refs/heads/master
socorro/unittest/external/postgresql/test_setupdb_app.py
9
# 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/. import mock from psycopg2 import ProgrammingError import psycopg2 from .unittestbase import PostgreSQLTestCase from nos...
aspaas/ion
refs/heads/master
contrib/wallettools/walletunlock.py
1
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:12700") pwd = raw_input("Enter wallet passphrase: ") access.walletpassphrase(pwd, 60)
anbangleo/NlsdeWeb
refs/heads/master
Python-3.6.0/Lib/sqlite3/test/transactions.py
2
#-*- coding: iso-8859-1 -*- # pysqlite2/test/transactions.py: tests transactions # # Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages #...
kifcaliph/odoo
refs/heads/8.0
addons/mass_mailing/models/mail_thread.py
220
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
marcossilvadecastro/googletest
refs/heads/master
test/gtest_list_tests_unittest.py
1898
#!/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...
ibinti/intellij-community
refs/heads/master
python/lib/Lib/modjy/modjy_impl.py
109
### # # Copyright Alan Kennedy. # # You may contact the copyright holder at this uri: # # http://www.xhaus.com/contact/modjy # # The licence under which this code is released is the Apache License v2.0. # # The terms and conditions of this license are listed in a file contained # in the distribution that also cont...
ychen820/microblog
refs/heads/master
y/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.1/webapp2_extras/appengine/auth/models.py
49
# -*- coding: utf-8 -*- """ webapp2_extras.appengine.auth.models ==================================== Auth related models. :copyright: 2011 by tipfy.org. :license: Apache Sotware License, see LICENSE for details. """ import time try: from ndb import model except ImportError: # pragma: no cove...
askulkarni2/ansible
refs/heads/devel
docsite/conf.py
147
# -*- coding: utf-8 -*- # # documentation build configuration file, created by # sphinx-quickstart on Sat Sep 27 13:23:22 2008-2009. # # This file is execfile()d with the current directory set to its # containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
CARocha/plasystem
refs/heads/master
productores/migrations/0002_auto_20170327_0841.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-27 14:41 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('productores', '0001_initial'), ] operations = [ migrations.AlterField( ...
rxcomm/pyaxo
refs/heads/master
examples/ratchet_watcher.py
2
#!/usr/bin/env python import copy import os from pyaxo import Axolotl name1 = 'Angie' name2 = 'Barb' a = Axolotl(name1, dbname='name1.db', dbpassphrase=None) b = Axolotl(name2, dbname='name2.db', dbpassphrase=None) a.loadState(name1, name2) b.loadState(name2, name1) topic = [' My Name', 'Other Name', ...
williamHuang5468/StockServer
refs/heads/master
venv/lib/python3.5/site-packages/wheel/test/test_install.py
455
# Test wheel. # The file has the following contents: # hello.pyd # hello/hello.py # hello/__init__.py # test-1.0.data/data/hello.dat # test-1.0.data/headers/hello.dat # test-1.0.data/scripts/hello.sh # test-1.0.dist-info/WHEEL # test-1.0.dist-info/METADATA # test-1.0.dist-info/RECORD # The ...
jotyGill/openpyn-nordvpn
refs/heads/master
openpyn/api.py
1
import logging import sys from typing import Dict, List import requests import verboselogs from openpyn import filters logger = logging.getLogger(__package__) verboselogs.install() # Using requests, GETs and returns json from a url. def get_json(url) -> Dict: headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6...
40223114/w16b_test
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/errno.py
624
""" This module makes available standard errno system symbols. The value of each symbol is the corresponding integer value, e.g., on most systems, errno.ENOENT equals the integer 2. The dictionary errno.errorcode maps numeric codes to symbol names, e.g., errno.errorcode[2] could be the string 'ENOENT'. Symbols that ar...
mfherbst/bohrium
refs/heads/master
core/codegen/argparse_utils.py
6
import os import argparse class FullPaths(argparse.Action): """Expand user- and relative-paths""" def __call__(self, parser, namespace, values, option_string=None): setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values))) def is_dir(dirname): """Checks if a path is an actual dire...
Kozea/pygal
refs/heads/master
demo/moulinrouge/__init__.py
1
# -*- coding: utf-8 -*- # This file is part of pygal # # A python svg graph plotting library # Copyright © 2012-2016 Kozea # # 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...
davidharrigan/django
refs/heads/master
django/db/models/fields/related_lookups.py
287
from django.db.models.lookups import ( Exact, GreaterThan, GreaterThanOrEqual, In, LessThan, LessThanOrEqual, ) class MultiColSource(object): contains_aggregate = False def __init__(self, alias, targets, sources, field): self.targets, self.sources, self.field, self.alias = targets, sources, field...
NeCTAR-RC/ceilometer
refs/heads/nectar/icehouse
ceilometer/compute/util.py
3
# -*- encoding: utf-8 -*- # # Copyright © 2014 Red Hat, Inc # # Author: Eoghan Glynn <eglynn@redhat.com> # # 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/license...
pombredanne/bokeh
refs/heads/master
sphinx/source/docs/user_guide/source_examples/styling_glyph_hover.py
6
from bokeh.plotting import figure, output_file, show from bokeh.models import HoverTool from bokeh.sampledata.glucose import data output_file("styling_hover.html") subset = data.ix['2010-10-06'] x, y = subset.index.to_series(), subset['glucose'] # Basic plot setup plot = figure(width=600, height=300, x_axis_type="d...
martinbuc/missionplanner
refs/heads/master
Lib/site-packages/scipy/linalg/setup_atlas_version.py
51
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" import os from distutils.core import Extension from numpy.distutils.misc_util import get_path, default_config_dict from numpy.distutils.system_info import get_info,AtlasNotFoundError def configuration (parent_package=...
mark-adams/python-social-auth
refs/heads/master
social/backends/exacttarget.py
5
""" ExactTarget OAuth support. Support Authentication from IMH using JWT token and pre-shared key. Requires package pyjwt """ from datetime import timedelta, datetime import jwt from social.exceptions import AuthFailed, AuthCanceled from social.backends.oauth import BaseOAuth2 class ExactTargetOAuth2(BaseOAuth2): ...
mnahm5/django-estore
refs/heads/master
Lib/site-packages/setuptools/command/py36compat.py
286
import os from glob import glob from distutils.util import convert_path from distutils.command import sdist from setuptools.extern.six.moves import filter class sdist_add_defaults: """ Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code ...
MarcelloLins/ServerlessCrawler-VancouverRealState
refs/heads/master
Bootstrapper/urllib3/contrib/_securetransport/low_level.py
136
""" Low-level helpers for the SecureTransport bindings. These are Python functions that are not directly related to the high-level APIs but are necessary to get them to work. They include a whole bunch of low-level CoreFoundation messing about and memory management. The concerns in this module are almost entirely abou...
crakensio/django_training
refs/heads/master
lib/python2.7/site-packages/django/core/mail/backends/locmem.py
227
""" Backend for test environment. """ from django.core import mail from django.core.mail.backends.base import BaseEmailBackend class EmailBackend(BaseEmailBackend): """A email backend for use during test sessions. The test connection stores email messages in a dummy outbox, rather than sending them out o...
oudalab/fajita
refs/heads/master
pythonAPI/flask/lib/python3.5/site-packages/chardet/mbcharsetprober.py
289
######################## 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...
naitoh/py2rb
refs/heads/master
tests/functions/bitand.py
1
x = 32424 y = 1437 z = x & y print(z)
shssoichiro/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/abort_wsh.py
465
# Copyright 2012, 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 of conditions and the f...
grupozeety/CDerpnext
refs/heads/bk_master
erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py
12
# 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 from frappe.utils import flt from frappe import _ from erpnext.accounts.utils import get_account_currency from erpnext.controllers.account...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/tangible/furniture/city/shared_streetlamp_large_01.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 = Tangible() result.template = "object/tangible/furniture/city/shared_streetlamp_large_01.iff" result.attribute_tem...
mauriciofierrom/testing
refs/heads/master
iaen_curriculum_ws.py
1
# -*- coding: utf-8 -*- from suds.client import Client from suds.wsse import * from suds.sax.element import Element from suds.sax.attribute import Attribute from suds.xsd.sxbasic import Import class IaenCurriculumWs: """ :module: IaenCurriculum """ def __init__(self, usuario=None): # Usuario para consultar el ...
marqueedev/django
refs/heads/master
django/core/files/__init__.py
839
from django.core.files.base import File __all__ = ['File']
rob356/SickRage
refs/heads/master
lib/futures/__init__.py
124
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Execute computations asynchronously using threads or processes.""" import warnings from concurrent.futures import (FIRST_COMPLETED, FIRST_EXCEPTION, ...
robertmattmueller/sdac-compiler
refs/heads/master
sympy/polys/tests/test_densetools.py
24
"""Tests for dense recursive polynomials' tools. """ from sympy.polys.densebasic import ( dup_LC, dmp_LC, dup_normal, dmp_normal, dup_from_raw_dict, dmp_from_dict, dmp_convert, dmp_swap, dmp_one_p, ) from sympy.polys.densearith import ( dup_add, dup_mul, dup_exquo, dmp_neg, dmp_sub, dmp_mul_ground...
simonsfoundation/CaImAn
refs/heads/master
use_cases/CaImAnpaper/create_movie_zebra.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Complete pipeline for online processing using OnACID. @author: Andrea Giovannucci @agiovann and Eftychios Pnevmatikakis @epnev Special thanks to Andreas Tolias and his lab at Baylor College of Medicine for sharing their data used in this demo. KERAS_BACKEND=tensorflow...