repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
h2oai/sparkling-water
refs/heads/master
py/tests/unit/with_runtime_sparkling/test_data_import.py
1
# # 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 us...
gilbertron/whidbeysci
refs/heads/master
boilerplate/external/babel/messages/tests/frontend.py
30
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists of v...
michaelhuang/QuantSoftwareToolkit
refs/heads/master
Legacy/epydoc-3.0.1/epydoc/docwriter/plaintext.py
99
# epydoc -- Plaintext output generation # # Copyright (C) 2005 Edward Loper # Author: Edward Loper <edloper@loper.org> # URL: <http://epydoc.sf.net> # # $Id: plaintext.py 1473 2007-02-13 19:46:05Z edloper $ """ Plaintext output generation. """ __docformat__ = 'epytext en' from epydoc.apidoc import * import re class ...
Plexxi/st2
refs/heads/master
st2common/st2common/transport/__init__.py
3
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
mith1979/ansible_automation
refs/heads/master
applied_python/applied_python/lib/python2.7/site-packages/django/contrib/gis/geometry/regex.py
657
import re # Regular expression for recognizing HEXEWKB and WKT. A prophylactic measure # to prevent potentially malicious input from reaching the underlying C # library. Not a substitute for good Web security programming practices. hex_regex = re.compile(r'^[0-9A-F]+$', re.I) wkt_regex = re.compile(r'^(SRID=(?P<srid...
TuXiaokang/pyseeta
refs/heads/master
pyseeta/config.py
1
import os import sys config = { 'win32': { 'detector': 'seeta_fd_lib.dll', 'aligner': 'seeta_fa_lib.dll', 'identifier': 'seeta_fi_lib.dll' }, 'darwin': { 'detector': 'libseeta_fd_lib.dylib', 'aligner': 'libseeta_fa_lib.dylib', 'identifier': 'libseeta_fi_lib....
tkem/mopidy
refs/heads/develop
mopidy/file/library.py
2
from __future__ import unicode_literals import logging import operator import os import sys import urllib2 from mopidy import backend, exceptions, models from mopidy.audio import scan, tags from mopidy.internal import path logger = logging.getLogger(__name__) FS_ENCODING = sys.getfilesystemencoding() class FileLi...
sleep-walker/pybugz
refs/heads/master
bugz/argparsers.py
1
import bugz.cli from bugz import __version__ def make_attach_parser(subparsers): attach_parser = subparsers.add_parser('attach', help='attach file to a bug') attach_parser.add_argument('bugid', help='the ID of the bug where the file should be attached') attach_parser.add_argument('filename', help='the name ...
losywee/rethinkdb
refs/heads/next
external/v8_3.30.33.16/build/gyp/pylib/gyp/xcodeproj_file.py
505
# 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. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
SUSE/azure-sdk-for-python
refs/heads/master
azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet_association.py
2
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
dagwieers/ansible
refs/heads/devel
lib/ansible/modules/cloud/google/gcp_cloudbuild_trigger_facts.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
GinnyN/Team-Fortress-RPG-Generators
refs/heads/master
build/lib/django/contrib/gis/sitemaps/kml.py
482
from django.core import urlresolvers from django.contrib.sitemaps import Sitemap from django.contrib.gis.db.models.fields import GeometryField from django.db import models class KMLSitemap(Sitemap): """ A minimal hook to produce KML sitemaps. """ geo_format = 'kml' def __init__(self, locations=Non...
mrry/tensorflow
refs/heads/windows
tensorflow/models/image/cifar10/cifar10_multi_gpu_train.py
21
# 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...
andymckay/addons-server
refs/heads/master
src/olympia/migrations/819-deleted-addons-nullify-guid.py
7
"""Deleting add-ons is in fact soft deleting them, and emptying some of its fields with a unique constraint (like the slug). We now also empty the GUID field, to allow re-submitting those add-ons (once the GUID has been removed from the BlacklistedGuid through the admin. This migration empties all the previously soft ...
kbdick/RecycleTracker
refs/heads/gh-pages
recyclecollector/scrap/gdata-2.0.18/samples/apps/marketplace_sample/atom/http.py
56
#!/usr/bin/python # # Copyright (C) 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
OptiPop/external_chromium_org
refs/heads/opti-5.1
native_client_sdk/src/build_tools/__init__.py
180
# 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_tools Package This package contains general python utilities that are used for creating the Native Client SDK."""
mmclenna/engine
refs/heads/master
build/android/pylib/android_commands_unittest.py
94
# 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. import os import shutil import sys import unittest sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) from pylib import android_commands ...
StarvingMarvin/common-workflow-language
refs/heads/master
v1.1.0-dev1/salad/schema_salad/__init__.py
11
import logging import sys import typing __author__ = 'peter.amstutz@curoverse.com' _logger = logging.getLogger("salad") _logger.addHandler(logging.StreamHandler()) _logger.setLevel(logging.INFO)
dbfr3qs/moto
refs/heads/master
moto/packages/responses/responses.py
4
from __future__ import ( absolute_import, print_function, division, unicode_literals ) import inspect import json as json_module import re import six from collections import namedtuple, Sequence, Sized from functools import update_wrapper from cookies import Cookies from requests.adapters import HTTPAdapter from ...
bsipocz/pyspeckit
refs/heads/master
docs/sphinxext/docscrape_sphinx.py
89
import re, inspect, textwrap, pydoc from docscrape import NumpyDocString, FunctionDoc, ClassDoc class SphinxDocString(NumpyDocString): # string conversion routines def _str_header(self, name, symbol='`'): return ['.. rubric:: ' + name, ''] def _str_field_list(self, name): return [':' + nam...
jsonchin/nba_stats_scraper_db_storage
refs/heads/master
nba_ss_db/db/store.py
1
""" Handles the creation of tables and storage into tables. """ from typing import List from .. import db, CONFIG from ..scrape.utils import is_proper_date_format, format_date PROTECTED_COL_NAMES = {'TO'} DATE_QUERY_PARAMS = {'GAME_DATE', 'DATE_TO'} def store_nba_response(data_name: str, nba_response, primary_keys=...
ROIV/ViorCoin-ElectrumServer
refs/heads/master
src/stratum_http.py
43
#!/usr/bin/env python # Copyright(C) 2012 thomasv@gitorious # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # ...
enStratus/unix-agent
refs/heads/master
extensions/docker/dcmdocker/top_container.py
3
# # Copyright (C) 2014 Dell, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
evansd/django
refs/heads/master
tests/template_tests/test_logging.py
35
import logging from django.template import Context, Engine, Variable, VariableDoesNotExist from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango21Warning class TestHandler(logging.Handler): def __init__(self): super().__init__() self.log_reco...
TightSquad/HABIP
refs/heads/master
pi/temp/i2ctemp.py
1
#!/usr/bin/python # python library for 2 wire comms, including i2c. import smbus import time # unicode degree_sign= u'\N{DEGREE SIGN}' """ readTempF Function to obtain current temperature and print to prompt Note: Hard configured for PCT2075 I2C Temperature Sensor with all three address pins tied to ground -> (0x4...
rrrene/django
refs/heads/master
tests/model_meta/models.py
192
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models class Relation(models.Model): pass class AbstractPerson(models.Model): # DATA fields data_abstract = models.CharField(max_len...
adrienbrault/home-assistant
refs/heads/dev
homeassistant/components/arlo/camera.py
5
"""Support for Netgear Arlo IP cameras.""" import logging from haffmpeg.camera import CameraMjpeg import voluptuous as vol from homeassistant.components.camera import PLATFORM_SCHEMA, Camera from homeassistant.components.ffmpeg import DATA_FFMPEG from homeassistant.const import ATTR_BATTERY_LEVEL from homeassistant.h...
terbolous/SickRage
refs/heads/master
lib/mako/lexer.py
61
# mako/lexer.py # Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """provides the Lexer class for parsing template strings into parse trees.""" import re import code...
Luka111/TDRAnketa
refs/heads/master
node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
899
# 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. import collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
trezorg/django
refs/heads/master
tests/regressiontests/views/tests/generic/create_update.py
47
import datetime from django.test import TestCase from django.core.exceptions import ImproperlyConfigured from regressiontests.views.models import Article, UrlArticle class CreateObjectTest(TestCase): fixtures = ['testdata.json'] def test_login_required_view(self): """ Verifies that an unauth...
victorlapin/kernel_lge_bullhead-NG
refs/heads/YAOSP-NG-7.1.1_r14
tools/perf/scripts/python/sctop.py
11180
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
CourseTalk/edx-platform
refs/heads/master
lms/djangoapps/shoppingcart/tests/test_views.py
13
""" Tests for Shopping Cart views """ from collections import OrderedDict import pytz from urlparse import urlparse from decimal import Decimal import json from django.http import HttpRequest from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from django.c...
gusseppe/sparkmach
refs/heads/master
setup.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ 'Click>=6.0', # TODO: put package requirements here ] test_requirem...
nds32/gcc
refs/heads/master
libstdc++-v3/python/libstdcxx/v6/printers.py
5
# Pretty-printers for libstdc++. # Copyright (C) 2008-2014 Free Software Foundation, Inc. # 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)...
arpitremarkable/django-registration
refs/heads/master
registration/backends/default/views.py
17
from django.conf import settings from ... import signals from ...models import RegistrationProfile from ...views import ActivationView as BaseActivationView from ...views import RegistrationView as BaseRegistrationView from ...compat import RequestSite, is_app_installed, get_site_model from ...users import UserModel ...
AdrianGaudebert/socorro
refs/heads/master
alembic/versions/46c7fb8a8671_bug_946266_reprocess.py
14
"""bug 946266 reprocessing table Revision ID: 46c7fb8a8671 Revises: 3a5471a358bf Create Date: 2013-12-04 08:17:58.348462 """ # revision identifiers, used by Alembic. revision = '46c7fb8a8671' down_revision = '144f7ace11e7' from alembic import op from socorro.lib import citexttype, jsontype from socorro.lib.migratio...
RapidApplicationDevelopment/tensorflow
refs/heads/master
tensorflow/contrib/layers/python/layers/encoders_test.py
14
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
themiken/mtasa-blue
refs/heads/master
vendor/google-breakpad/src/tools/gyp/pylib/gyp/generator/gypd.py
912
# 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. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are ...
ingokegel/intellij-community
refs/heads/master
python/testData/formatter/alignListComprehensionInDict_after.py
79
def foo(): return {field.key: field for key, field in inspect.getmembers(instance) if isinstance(field, QueryableAttribute) and isinstance(field.property, ColumnProperty) or field.foreign_keys}
meee1/pymavlink
refs/heads/master
examples/mavtester.py
30
#!/usr/bin/env python ''' test mavlink messages ''' import sys, struct, time, os from curses import ascii # allow import from the parent directory, where mavlink.py is sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')) import mavlink, mavtest, mavutil from optparse import OptionPar...
HLFH/CouchPotatoServer
refs/heads/develop
couchpotato/core/media/movie/providers/metadata/mediabrowser.py
75
import os from couchpotato.core.media.movie.providers.metadata.base import MovieMetaData autoload = 'MediaBrowser' class MediaBrowser(MovieMetaData): def getThumbnailName(self, name, root, i): return os.path.join(root, 'folder.jpg') def getFanartName(self, name, root, i): return os.path.j...
40223240/2015cdb_g3_40223240
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/antigravity.py
917
import webbrowser import hashlib webbrowser.open("http://xkcd.com/353/") def geohash(latitude, longitude, datedow): '''Compute geohash() using the Munroe algorithm. >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68') 37.857713 -122.544543 ''' # http://xkcd.com/426/ h = hashlib.md5(d...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/validators/layout/template/data/_sunburst.py
2
import _plotly_utils.basevalidators class SunburstValidator(_plotly_utils.basevalidators.CompoundArrayValidator): def __init__( self, plotly_name="sunburst", parent_name="layout.template.data", **kwargs ): super(SunburstValidator, self).__init__( plotly_name=plotly_name, ...
vipul-sharma20/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/test/test_reflect.py
18
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.reflect module. """ import weakref, os from ihooks import ModuleImporter try: from collections import deque except ImportError: deque = None from twisted.trial import unittest from twisted.python import reflec...
xamfoo/thumbor-docker
refs/heads/master
setup/thumbor/thumbor/__init__.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/globocom/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com '''This is the main module in thumbor''' __version__ = "4.11.1"
pferreir/indico
refs/heads/master
indico/modules/api/__init__.py
3
# This file is part of Indico. # Copyright (C) 2002 - 2021 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 flask import session from indico.core import signals from indico.core.db import db from indico.core....
turbokongen/home-assistant
refs/heads/dev
tests/components/melcloud/test_config_flow.py
8
"""Test the MELCloud config flow.""" import asyncio from unittest.mock import patch from aiohttp import ClientError, ClientResponseError import pymelcloud import pytest from homeassistant import config_entries from homeassistant.components.melcloud.const import DOMAIN from homeassistant.const import HTTP_FORBIDDEN, H...
ktsitsikas/odemis
refs/heads/master
src/odemis/acq/align/test/delphi_test.py
1
# -*- coding: utf-8 -*- ''' Created on 18 Jul 2014 @author: Kimon Tsitsikas Copyright © 2012-2013 Kimon Tsitsikas, Delmic This file is part of Odemis. Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Fou...
RBE-Avionik/skylines
refs/heads/master
skylines/lib/geo.py
7
# -*- coding: utf-8 -*- import math EARTH_RADIUS = 6367009 METERS_PER_DEGREE = 111319.0 FEET_PER_METER = 3.2808399 def geographic_distance(loc1, loc2): """ Calculate the great circle distance between two points on the earth (specified in decimal degrees) """ # convert decimal degrees to radians ...
ltilve/chromium
refs/heads/igalia-sidebar
build/toolchain/mac/setup_toolchain.py
146
# Copyright (c) 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 os import stat import sys def CopyTool(source_path): """Copies the given tool to the current directory, including a warning not to edit it.""...
KuroeKurose/gem5
refs/heads/master
util/stats/db.py
90
# Copyright (c) 2003-2004 The Regents of The University of Michigan # 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 ...
hbtech-ai/ARPS
refs/heads/master
tmsvm/src/feature_select.py
6
#!/usr/bin/python #_*_ coding: utf-8 _*_ #author:张知临 zhzhl202@163.com #Filename: feature_select.py '''利用卡方进行特征选择的程序''' import math import pickle import measure from fileutil import read_dic def feature_select(filename,indexes,global_fun,dic_save_path,ratio,stop_words_dic,str_splitTag,tc_splitTag): '...
damdam-s/OpenUpgrade
refs/heads/8.0
addons/l10n_at/__init__.py
438
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) conexus.at # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
ns950/calibre
refs/heads/master
src/odf/chart.py
96
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # 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 you...
potsmaster/cinder
refs/heads/master
cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py
19
# Copyright (c) 2015 Infortrend Technology, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
Sweetgrassbuffalo/ReactionSweeGrass-v2
refs/heads/master
.meteor/local/dev_bundle/python/Lib/mutex.py
21
"""Mutual exclusion -- for use with module sched A mutex has two pieces of state -- a 'locked' bit and a queue. When the mutex is not locked, the queue is empty. Otherwise, the queue contains 0 or more (function, argument) pairs representing functions (or methods) waiting to acquire the lock. When the mutex is unlocke...
jonathanverner/brython
refs/heads/master
www/src/Lib/browser/template.py
2
"""Brython templating engine. Templates in HTML pages can include: - Python code blocks: <tr b-code="for item in items"> ... </tr> - Python expressions: {message} - tag attributes: <option value="{name}", selected="{name===expected}"> - inclusion of subtemplates: <div b-include="men...
vetu11/piloco
refs/heads/master
telegram/inlinequeryresultcachedphoto.py
1
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2016 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
PeteW/luigi
refs/heads/master
luigi/db_task_history.py
5
# -*- 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...
ujjwal96/mitmproxy
refs/heads/master
mitmproxy/stateobject.py
1
import typing from typing import Any # noqa from typing import MutableMapping # noqa import json from mitmproxy.coretypes import serializable from mitmproxy.utils import typecheck class StateObject(serializable.Serializable): """ An object with serializable state. State attributes can either be serial...
Galarzaa90/NabBot
refs/heads/master
launcher.py
1
# Copyright 2019 Allan Galarza # # 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 writi...
kawamon/hue
refs/heads/master
apps/security/src/security/tests.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (...
i5o/openshot-sugar
refs/heads/master
ignacio/openshot/uploads/youtube/gdata/tlslite/utils/Python_RSAKey.py
239
"""Pure-Python RSA implementation.""" from cryptomath import * import xmltools from ASN1Parser import ASN1Parser from RSAKey import * class Python_RSAKey(RSAKey): def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0): if (n and not e) or (e and not n): raise AssertionError() ...
tysonclugg/django
refs/heads/master
django/contrib/gis/db/backends/base/features.py
27
import re from django.contrib.gis.db.models import aggregates class BaseSpatialFeatures: gis_enabled = True # Does the database contain a SpatialRefSys model to store SRID information? has_spatialrefsys_table = True # Does the backend support the django.contrib.gis.utils.add_srs_entry() utility? ...
harrisonfeng/gunicorn
refs/heads/master
scripts/update_thanks.py
22
#!/usr/bin/env python # Usage: git log --format="%an <%ae>" | python update_thanks.py # You will get a result.txt file, you can work with the file (update, remove, ...) # # Install # ======= # pip install validate_email pyDNS # from __future__ import print_function import os import sys from validate_email import valid...
Khan/reviewboard
refs/heads/master
reviewboard/diffviewer/evolutions/add_diff_hash.py
2
from django_evolution.mutations import AddField, RenameField from django.db import models MUTATIONS = [ RenameField('FileDiff', 'diff', 'diff64', db_column='diff_base64'), RenameField('FileDiff', 'parent_diff', 'parent_diff64', db_column='parent_diff_base64'), AddField('FileDiff', 'diff_hash', models.Fore...
ryfeus/lambda-packs
refs/heads/master
Keras_tensorflow_nightly/source2.7/tensorflow/contrib/distributions/python/ops/bijectors/sigmoid.py
82
# 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...
aurelijusb/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/build/gyp/pylib/gyp/xcodeproj_file.py
505
# 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. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
cjltsod/python-social-auth
refs/heads/master
social/backends/coursera.py
4
from social_core.backends.coursera import CourseraOAuth2
paulcalabro/zato
refs/heads/master
code/alembic/versions/0007_c16781527a4_gh119_oauth_1_0_http.py
7
"""gh119: OAuth 1.0 HTTP channels Revision ID: 0007_c16781527a4 Revises: 0006_2538d53b16c8 Create Date: 2013-11-13 14:57:36.541735 """ # revision identifiers, used by Alembic. revision = '0007_c16781527a4' down_revision = '0006_2538d53b16c8' from alembic import op import sqlalchemy as sa def upgrade(): op.crea...
miipl-naveen/optibizz
refs/heads/master
addons/portal_stock/__openerp__.py
437
# -*- 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...
nathanial/lettuce
refs/heads/master
tests/integration/django/alfaces/donothing/views.py
21
from django.shortcuts import render_to_response def index(request): return render_to_response('index.html')
Antiun/odoomrp-wip
refs/heads/8.0
stock_lock_lot/models/__init__.py
14
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from . import product_category from . import stock_producti...
plumgrid/plumgrid-nova
refs/heads/master
nova/weights.py
22
# Copyright (c) 2011-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 # # Un...
silenceli/nova
refs/heads/master
nova/tests/unit/volume/test_cinder.py
43
# Copyright 2013 Mirantis, Inc. # Copyright 2013 OpenStack Foundation # # 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 # # Un...
npinto/libsvm-2.88_objs-np
refs/heads/master
tools/checkdata.py
1
#!/usr/bin/env python # # A format checker for LIBSVM # # # Copyright (c) 2007, Rong-En Fan # # All rights reserved. # # This program is distributed under the same license of the LIBSVM package. # from sys import argv, exit import os.path def err(line_no, msg): print "line %d: %s" % (line_no, msg) # works like f...
arsfeld/conduit
refs/heads/master
test/python-tests/TestDataProviderN800.py
3
#common sets up the conduit environment from common import * import traceback import conduit.modules.N800Module.N800Module as N800Module #simulate a n800 fakeN800Dir = os.path.join(os.environ['TEST_DIRECTORY'],"n800") if not os.path.exists(fakeN800Dir): os.mkdir(fakeN800Dir) ok("Created fake n800 at %s" % fakeN8...
AWFU/bottle
refs/heads/master
test/test_jinja2.py
50
# -*- coding: utf-8 -*- import unittest from bottle import Jinja2Template, jinja2_template, jinja2_view, touni from tools import warn class TestJinja2Template(unittest.TestCase): def test_string(self): """ Templates: Jinja2 string""" t = Jinja2Template('start {{var}} end').render(var='var') ...
click-contrib/click-threading
refs/heads/master
click_threading/monkey.py
1
# -*- coding: utf-8 -*- import types import contextlib import inspect from ._compat import PY2, getargspec class FunctionInfo(object): def __init__(self, interactive): self.interactive = interactive _ui_functions = { 'echo_via_pager': FunctionInfo(interactive=True), 'prompt': FunctionInfo(inte...
kamyu104/LeetCode
refs/heads/master
Python/number-complement.py
2
# Time: O(1) # Space: O(1) # Given a positive integer, output its complement number. # The complement strategy is to flip the bits of its binary representation. # # Note: # The given integer is guaranteed to fit within the range of a 32-bit signed integer. # You could assume no leading zero bit in the integer’s binar...
Ichag/odoo
refs/heads/8.0
addons/crm/wizard/crm_phonecall_to_phonecall.py
337
# -*- 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...
msarahan/bokeh
refs/heads/master
bokeh/server/protocol/receiver.py
17
''' Assemble websocket wire message fragments into complete Bokeh Server message objects that can be processed. ''' from __future__ import absolute_import import six from tornado.concurrent import return_future from ..exceptions import ValidationError import logging log = logging.getLogger(__name__) class Receiver...
gfreed/android_external_chromium-org
refs/heads/android-4.4
chrome/common/extensions/docs/server2/build_server.py
57
#!/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. # This script is used to copy all dependencies into the local directory. # The package of files can then be uploaded to App Engine....
WebSpider/SickRage
refs/heads/master
lib/socks/__init__.py
138
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this ...
Vivek-anand-jain/Implementation-of-BLUE-in-ns-3
refs/heads/master
src/wimax/bindings/modulegen__gcc_ILP32.py
17
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
badock/nova
refs/heads/master
nova/api/openstack/compute/plugins/v3/scheduler_hints.py
16
# Copyright 2011 OpenStack Foundation # # 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 ...
leafclick/intellij-community
refs/heads/master
python/testData/console/ipython/psi/helpWildcards.py
14
*int*?
ArpegiusWhooves/pypy-CFFI-Presentation
refs/heads/master
cl.py
1
from select import select from cffi import FFI ffi= FFI() ffi.cdef(open('cl.h').read()) #ffi.cdef(open('gl.h').read()) lib= ffi.verify(open('cl.c').read(),libraries=['OpenCL']) PLATFORMS_ID=ffi.new('cl_platform_id[4]',0) PLATFORM_COUNT=ffi.new('cl_uint*',0) err= clGetPlatformIDs(4 , PLATFORMS_I...
eklitzke/tornado
refs/heads/master
tornado/test/resolve_test_helper.py
29
from __future__ import absolute_import, division, print_function from tornado.ioloop import IOLoop from tornado.netutil import ThreadedResolver # When this module is imported, it runs getaddrinfo on a thread. Since # the hostname is unicode, getaddrinfo attempts to import encodings.idna # but blocks on the import lock...
Zyell/home-assistant
refs/heads/master
homeassistant/components/camera/foscam.py
7
""" This component provides basic support for Foscam IP cameras. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/camera.foscam/ """ import logging import requests from homeassistant.components.camera import DOMAIN, Camera from homeassistant.helpers impo...
astagi/taiga-back
refs/heads/master
tests/integration/resources_permissions/test_storage_resources.py
21
from django.core.urlresolvers import reverse from taiga.base.utils import json from taiga.userstorage.serializers import StorageEntrySerializer from taiga.userstorage.models import StorageEntry from tests import factories as f from tests.utils import helper_test_http_method from tests.utils import helper_test_http_me...
opencbsoft/django-bnr-exchangerate
refs/heads/master
bnr_exchangerate/management/__init__.py
4
__author__ = 'johnyb'
jamesob/err
refs/heads/master
errbot/core_plugins/utils.py
3
from os import path from errbot import BotPlugin, botcmd from errbot.version import VERSION from errbot.utils import tail class Utils(BotPlugin): min_err_version = VERSION # don't copy paste that for your plugin, it is just because it is a bundled plugin ! max_err_version = VERSION # noinspection PyUnu...
sebras/mupdf
refs/heads/master
scripts/mutool_draw.py
1
import collections import getopt import os import re import sys import time import mupdf # Force stderr to be line-buffered - i.e. python will flush to the underlying # stderr stream every newline. This ensures that our output interleaves with # the output of mupdf C code, making it easier to compare our output with...
xingyepei/edx-platform
refs/heads/release
lms/djangoapps/mobile_api/social_facebook/courses/tests.py
128
# pylint: disable=E1101, W0201 """ Tests for Courses """ import httpretty import json from django.core.urlresolvers import reverse from xmodule.modulestore.tests.factories import CourseFactory from opaque_keys.edx.keys import CourseKey from ..test_utils import SocialFacebookTestCase class TestCourses(SocialFacebookT...
nox/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/trickle.py
95
import time def main(request, response): chunk = "TEST_TRICKLE\n" delay = float(request.GET.first("ms", 500)) / 1E3 count = int(request.GET.first("count", 50)) if "specifylength" in request.GET: response.headers.set("Content-Length", count * len(chunk)) time.sleep(delay) response.header...
tiagovignatti/intel-gpu-tools
refs/heads/master
debugger/system_routine/pre_cpp.py
9
#!/usr/bin/env python3 # Copyright © 2011 Intel Corporation # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mod...
bkahlert/seqan-research
refs/heads/master
raw/pmbs12/pmsb13-data-20120615/trunk/misc/seqan_instrumentation/bin/classes/simplejson/ordered_dict.py
1039
"""Drop-in replacement for collections.OrderedDict by Raymond Hettinger http://code.activestate.com/recipes/576693/ """ from UserDict import DictMixin # Modified from original to support Python 2.4, see # http://code.google.com/p/simplejson/issues/detail?id=53 try: all except NameError: def all(seq): ...
RGood/praw
refs/heads/master
praw/models/reddit/__init__.py
10
"""Provide all models that map to reddit objects."""
jnewland/home-assistant
refs/heads/ci
tests/components/mqtt_room/__init__.py
36
"""Tests for the mqtt_room component."""