repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
MarishaYasko/interactive-stories-stands
refs/heads/master
InteractiveStands/Lib/encodings/iso8859_1.py
266
""" Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
TinLe/Diamond
refs/heads/master
src/collectors/solr/solr.py
29
# coding=utf-8 """ Collect the solr stats for the local node #### Dependencies * posixpath * urllib2 * json """ import posixpath import urllib2 try: import json except ImportError: import simplejson as json import diamond.collector class SolrCollector(diamond.collector.Collector): def get_defau...
clouserw/olympia
refs/heads/master
sites/altdev/settings_base.py
1
"""private_base will be populated from puppet and placed in this directory""" import logging import os import dj_database_url from lib.settings_base import CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING from .. import splitstrip import private_base as private ENGAGE_ROBOTS = False EMAIL_BACKEND = 'django.core.m...
Firebird1915/FRC2015PY
refs/heads/master
oi.py
4
import wpilib from wpilib import SmartDashboard from wpilib.buttons import JoystickButton #import subsystems from subsystems.drivetrain import DriveTrain from subsystems.lift import LiftMech from subsystems.pneumatics_comp import Pneumatics #import commands from commands.speed_toggle import SpeedToggle from commands....
kenshay/ImageScripter
refs/heads/master
ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/telemetry/util/image_util.py
31
# 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. """Provides implementations of basic image processing functions. Implements basic image processing functions, such as reading/writing images, cropping, find...
sbuss/voteswap
refs/heads/master
lib/networkx/algorithms/link_prediction.py
40
""" Link prediction algorithms. """ from __future__ import division import math import networkx as nx from networkx.utils.decorators import * __all__ = ['resource_allocation_index', 'jaccard_coefficient', 'adamic_adar_index', 'preferential_attachment', 'cn_soundarajan_hop...
Ritsyy/fjord
refs/heads/master
fjord/base/validators.py
7
from django.core.exceptions import ValidationError from django.core.validators import URLValidator from fjord.base.utils import is_url class EnhancedURLValidator(URLValidator): """URLValidator that also validates about: and chrome:// urls""" def __call__(self, value): # is_url turns around and uses U...
tyc85/nwsdr-3.6.3-dsc
refs/heads/master
gr-analog/python/qa_dpll.py
3
#!/usr/bin/env python # # Copyright 2012 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 option) # ...
crawfordsm/ccdproc
refs/heads/placeholder
ccdproc/tests/test_gain.py
5
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This module implements the base CCDData class. from __future__ import (absolute_import, division, print_function, unicode_literals) from numpy.testing import assert_array_equal from astropy.tests.helper import pytest from astropy...
bjrara/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...
openstack/nova
refs/heads/master
nova/tests/unit/objects/test_instance_info_cache.py
4
# Copyright 2013 IBM 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 agree...
ghisvail/vispy
refs/heads/master
vispy/testing/_runners.py
7
# -*- coding: utf-8 -*- # vispy: testskip # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """Test running functions""" from __future__ import print_function import sys import os import warnings from os import path as op from copy import deepcopy ...
eatbyte/Swift
refs/heads/master
test/unit/cli/test_form_signature.py
17
# -*- coding: utf-8 -*- # Copyright (c) 2014 Samuel Merritt <[email protected]> # # 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 r...
ProfessionalIT/maxigenios-website
refs/heads/master
sdk/google_appengine/lib/django-1.4/django/utils/unittest/suite.py
353
"""TestSuite""" import sys import unittest from django.utils.unittest import case, util __unittest = True class BaseTestSuite(unittest.TestSuite): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(self, tests=()): self._tests = [] self.addTests...
dhalperi/beam
refs/heads/master
sdks/python/apache_beam/runners/worker/statesampler_fake.py
10
# # 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...
leafclick/intellij-community
refs/heads/master
python/testData/codeInsight/smartEnter/docTypeRType_after.py
83
def foo(a): """ <caret> @param a: @type a: @return: @rtype: """ pass def foo1(): """ :return : """
nrwahl2/ansible
refs/heads/devel
lib/ansible/plugins/connection/ssh.py
4
# (c) 2012, Michael DeHaan <[email protected]> # Copyright 2015 Abhijit Menon-Sen <[email protected]> # Copyright 2017 Toshio Kuratomi <[email protected]> # # 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 Lice...
wangtuanjie/airflow
refs/heads/master
airflow/operators/hive_stats_operator.py
38
from builtins import str from builtins import zip from collections import OrderedDict import json import logging from airflow.utils import AirflowException from airflow.hooks import PrestoHook, HiveMetastoreHook, MySqlHook from airflow.models import BaseOperator from airflow.utils import apply_defaults class HiveSta...
jcnelson/syndicate
refs/heads/master
old/ms/openid/test/test_extension.py
77
from openid import extension from openid import message import unittest class DummyExtension(extension.Extension): ns_uri = 'http://an.extension/' ns_alias = 'dummy' def getExtensionArgs(self): return {} class ToMessageTest(unittest.TestCase): def test_OpenID1(self): oid1_msg = messa...
almarklein/bokeh
refs/heads/master
tests/glyphs/Text.py
1
import numpy as np from bokeh.document import Document from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid from bokeh.models.glyphs import Text from bokeh.plotting import show N = 9 x = np.linspace(-2, 2, N) y = x**2 a = "abcdefghijklmnopqrstuvwxyz" text = [a[i*3:i*3+3] for i in range(N)] ...
gedaskir/qmeq
refs/heads/master
qmeq/tests/test_baths.py
1
from numpy.linalg import norm from qmeq.indexing import StateIndexing from qmeq.baths import * from qmeq.tests.test_leadstun import ParametersDoubleDotSpinful EPS = 1e-14 class ParametersDoubleDotSpinfulElPh(ParametersDoubleDotSpinful): def __init__(self): ParametersDoubleDotSpinful.__init__(self) ...
moutai/scikit-learn
refs/heads/master
sklearn/feature_selection/__init__.py
140
""" The :mod:`sklearn.feature_selection` module implements feature selection algorithms. It currently includes univariate filter selection methods and the recursive feature elimination algorithm. """ from .univariate_selection import chi2 from .univariate_selection import f_classif from .univariate_selection import f_...
stankovski/AutoRest
refs/heads/master
AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Report/setup.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 ...
Ebag333/Pyfa
refs/heads/master
eos/effects/remotehullrepair.py
1
# Not used by any item type = "projected", "active" runTime = "late" def handler(fit, module, context): if "projected" not in context: return bonus = module.getModifiedItemAttr("structureDamageAmount") duration = module.getModifiedItemAttr("duration") / 1000.0 fit.extraAttributes.increase("hul...
hernandito/SickRage
refs/heads/master
lib/hachoir_parser/game/blp.py
86
""" Blizzard BLP Image File Parser Author: Robert Xiao Creation date: July 10 2007 - BLP1 File Format http://magos.thejefffiles.com/War3ModelEditor/MagosBlpFormat.txt - BLP2 File Format (Wikipedia) http://en.wikipedia.org/wiki/.BLP - S3TC (DXT1, 3, 5) Formats http://en.wikipedia.org/wiki/S3_Texture_Compression ...
jjingrong/PONUS-1.2
refs/heads/master
venv/Lib/encodings/iso8859_5.py
593
""" Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
t0in4/django
refs/heads/master
tests/syndication_tests/feeds.py
278
from __future__ import unicode_literals from django.contrib.syndication import views from django.utils import feedgenerator from django.utils.timezone import get_fixed_timezone from .models import Article, Entry class TestRss2Feed(views.Feed): title = 'My blog' description = 'A more thorough description of ...
willthames/ansible
refs/heads/devel
lib/ansible/modules/utilities/logic/pause.py
13
# -*- mode: python -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distr...
niketanpansare/incubator-systemml
refs/heads/master
src/main/python/systemml/converters.py
5
# ------------------------------------------------------------- # # 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 unde...
itkg-dmoate/projetsynfony
refs/heads/master
vendor/doctrine/orm/docs/en/conf.py
2448
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # 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. ...
hzlf/openbroadcast
refs/heads/master
website/shop/shop_simplevariations/migrations/0003_auto__add_textoption__del_field_cartitemtextoption_price__add_field_ca.py
3
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'TextOption' db.create_table('shop_simplevariations_textoption', ( ('id', self....
pkats15/hdt_analyzer
refs/heads/master
django_test/django_venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/compat.py
2942
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # 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 # versio...
qPCR4vir/orange3
refs/heads/master
Orange/statistics/tests.py
18
import math import numpy as np import scipy def wilcoxon_rank_sum(d1, d2): # TODO Check this function!!! N1, N2 = np.sum(d1[1, :]), np.sum(d2[1, :]) ni1, ni2 = d1.shape[1], d2.shape[1] i1 = i2 = 0 R = 0 rank = 0 while i1 < ni1 and i2 < ni2: if d1[0, i1] < d2[0, i2]: R +=...
arabenjamin/scikit-learn
refs/heads/master
sklearn/dummy.py
208
# Author: Mathieu Blondel <[email protected]> # Arnaud Joly <[email protected]> # Maheshakya Wijewardena <[email protected]> # License: BSD 3 clause from __future__ import division import warnings import numpy as np import scipy.sparse as sp from .base import BaseEstimator, ClassifierMixin...
ElBell/VTDairyDB
refs/heads/master
controllers/__init__.py
1
__author__ = 'Eleonor Bart' from main import app from flask import session, g, send_from_directory, request, jsonify, render_template from flask import url_for, redirect @app.route('/') def homepage(): return render_template('homepage.html') @app.route("/site-map", methods=['GET', 'POST']) def site_map(): ...
mammique/django
refs/heads/tp_alpha
django/contrib/admin/templatetags/admin_list.py
103
from __future__ import unicode_literals import datetime from django.contrib.admin.util import (lookup_field, display_for_field, display_for_value, label_for_field) from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_VALUE, ORDER_VAR, PAGE_VAR, SEARCH_VAR) from django.contrib.admin.templatet...
gdi2290/rethinkdb
refs/heads/next
external/re2_20140111/re2/make_unicode_groups.py
121
#!/usr/bin/python # Copyright 2008 The RE2 Authors. All Rights Reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Generate C++ tables for Unicode Script and Category groups.""" import sys import unicode _header = """ // GENERATED BY make_unicode_groups...
uranusjr/django
refs/heads/master
django/contrib/auth/migrations/0004_alter_user_username_opts.py
134
from django.contrib.auth import validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth', '0003_alter_user_email_max_length'), ] # No database changes; modifies validators and error_messages (#13147). operations = [ migration...
anntzer/scipy
refs/heads/master
scipy/special/tests/test_spfun_stats.py
12
import numpy as np from numpy.testing import (assert_array_equal, assert_array_almost_equal_nulp, assert_almost_equal) from pytest import raises as assert_raises from scipy.special import gammaln, multigammaln class TestMultiGammaLn: def test1(self): # A test of the identity # Gamma_...
Jiangshangmin/mpld3
refs/heads/master
doc/sphinxext/numpy_ext/numpydoc.py
50
""" ======== numpydoc ======== Sphinx extension that handles docstrings in the Numpy standard format. [1] It will: - Convert Parameters etc. sections to field lists. - Convert See Also section to a See also entry. - Renumber references. - Extract the signature from the docstring, if it can't be determined otherwise....
duhzecca/cinder
refs/heads/master
cinder/volume/drivers/zfssa/zfssanfs.py
11
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. 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 requir...
zyingp/shadowsocks
refs/heads/master
shadowsocks/tcprelay.py
922
#!/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...
AOSPU/external_chromium_org
refs/heads/android-5.0/py3
ppapi/generators/idl_tests.py
127
#!/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. """ Test runner for IDL Generator changes """ import subprocess import sys def TestIDL(testname, args): print '\nRunning unit t...
oyente/oyente
refs/heads/master
utils.py
1
# return true if the two paths have different flows of money # later on we may want to return more meaningful output: e.g. if the concurrency changes # the amount of money or the recipient. from z3 import * from z3util import get_vars import json import mmap import os import csv import re import difflib import signal ...
denisjul/democratos
refs/heads/master
democratos/CreateYourLaws/apps.py
1
from django.apps import AppConfig class CreateyourlawsConfig(AppConfig): name = 'CreateYourLaws' def ready(self): from CreateYourLaws import signals
chouseknecht/ansible
refs/heads/devel
lib/ansible/module_utils/facts/hardware/freebsd.py
101
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
shaheemirza/pupy
refs/heads/master
pupy/modules/screenshot.py
27
# -*- coding: UTF8 -*- # -------------------------------------------------------------- # Copyright (c) 2015, Nicolas VERDIER ([email protected]) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # ...
sergei-maertens/django
refs/heads/master
django/db/backends/oracle/operations.py
3
from __future__ import unicode_literals import datetime import re import uuid from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.db.backends.utils import truncate_name from django.utils import six, timezone from django.utils.encoding import force_bytes, ...
40123148/w17b
refs/heads/master
static/Brython3.1.1-20150328-091302/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...
malcolmw/SeisPy
refs/heads/master
seispy/core/geometry.py
3
# coding=utf-8 """ This module provides basic geometric utility functions to facilitate working in different coordinate systems. """ from math import acos,\ atan2,\ cos,\ degrees,\ pi,\ radians,\ sin,\ ...
Mistobaan/tensorflow
refs/heads/master
tensorflow/contrib/tensor_forest/hybrid/python/models/k_feature_decisions_to_data_then_nn.py
189
# 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...
Kniyl/mezzanine
refs/heads/master
mezzanine/blog/models.py
30
from __future__ import unicode_literals from future.builtins import str from django.db import models from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from mezzanine.conf import settings from mezzanine.core.fields import FileField from mezzanine.core.models import Di...
tsailabSJ/circleseq
refs/heads/master
test/test_circleseq_merged.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_circleseq_merged ---------------------------------- Tests for `circleseq` module. """ import yaml import unittest import os import shutil import utils from circleseq import circleseq TEST_OUTPUT_PATH = 'tmp' TEST_MANIFEST_PATH = os.path.join('CIRCLEseq_MergedT...
Qihoo360/zeppelin-gateway
refs/heads/master
tests/s3tests/functional/test_headers.py
2
from cStringIO import StringIO import boto.connection import boto.exception import boto.s3.connection import boto.s3.acl import boto.utils import bunch import nose import operator import random import string import socket import ssl import os import re from urlparse import urlparse from boto.s3.connection import S3Co...
candy7393/VTK
refs/heads/master
ThirdParty/Twisted/twisted/mail/test/test_mail.py
26
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for large portions of L{twisted.mail}. """ import os import errno import shutil import pickle import StringIO import rfc822 import tempfile import signal from hashlib import md5 from zope.interface.verify import verifyClass from zope.i...
maropu/spark
refs/heads/master
examples/src/main/python/pi.py
27
# # 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...
bitemyapp/ganeti
refs/heads/master
test/py/ganeti.runtime_unittest.py
9
#!/usr/bin/python # # Copyright (C) 2010 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of...
myself659/xunlei-lixian
refs/heads/master
lixian_download_asyn.py
14
import asyncore import asynchat import socket import re #from cStringIO import StringIO from time import time, sleep import sys import os #asynchat.async_chat.ac_out_buffer_size = 1024*1024 class http_client(asynchat.async_chat): def __init__(self, url, headers=None, start_from=0): asynchat.async_chat.__init__(s...
toomoresuch/pysonengine
refs/heads/master
parts/google_appengine/google/net/proto2/python/internal/wire_format.py
3
#!/usr/bin/env python # # Copyright 2007 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 o...
papouso/odoo
refs/heads/8.0
addons/l10n_fr_rib/__openerp__.py
425
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Numérigraphe SARL. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
DickJC123/mxnet
refs/heads/master
docs/python_docs/python/scripts/md2ipynb.py
7
# 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...
petteyg/intellij-community
refs/heads/master
python/helpers/profiler/thrift/TMultiplexedProcessor.py
146
# # 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...
richardcs/ansible
refs/heads/devel
lib/ansible/modules/network/avi/avi_virtualservice.py
29
#!/usr/bin/python # # @author: Gaurav Rastogi ([email protected]) # Eric Anderson ([email protected]) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <[email protected]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
Bharath-J/Mezzanine
refs/heads/master
mezzanine/galleries/migrations/0002_auto_20141227_0224.py
46
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import mezzanine.core.fields class Migration(migrations.Migration): dependencies = [ ('galleries', '0001_initial'), ] operations = [ migrations.AlterField( model_name='ga...
MinimalOS/external_skia
refs/heads/lp-mr1
tools/add_codereview_message.py
68
#!/usr/bin/python2 # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Add message to codereview issue. This script takes a codereview URL or a codereview issue number as its argument and a (possibly multi-line) message on stdin. It...
kenshay/ImageScripter
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/util/doctools.py
9
import numpy as np import pandas as pd import pandas.compat as compat class TablePlotter(object): """ Layout some DataFrames in vertical/horizontal layout for explanation. Used in merging.rst """ def __init__(self, cell_width=0.37, cell_height=0.25, font_size=7.5): self.cell_width = cell_...
blacklin/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/distutils/cmd.py
97
"""distutils.cmd Provides the Command class, the base class for the command classes in the distutils.command package. """ import sys, os, re from distutils.errors import DistutilsOptionError from distutils import util, dir_util, file_util, archive_util, dep_util from distutils import log class Command: """Abstra...
taaviteska/django
refs/heads/master
tests/file_storage/test_generate_filename.py
124
import os from django.core.files.base import ContentFile from django.core.files.storage import Storage from django.db.models import FileField from django.test import SimpleTestCase class AWSS3Storage(Storage): """ Simulate an AWS S3 storage which uses Unix-like paths and allows any characters in file nam...
nirzari18/Query-Analysis-Application-on-Google-App-Engine
refs/heads/master
lib/pyasn1_modules/rfc2459.py
59
# # X.509 message syntax # # ASN.1 source from: # http://www.trl.ibm.com/projects/xml/xss4j/data/asn1/grammars/x509.asn # http://www.ietf.org/rfc/rfc2459.txt # # Sample captures from: # http://wiki.wireshark.org/SampleCaptures/ # from pyasn1.type import tag,namedtype,namedval,univ,constraint,char,useful MAX = 64 # XX...
kehao95/Wechat_LearnHelper
refs/heads/master
src/env/lib/python3.5/site-packages/werkzeug/testapp.py
364
# -*- coding: utf-8 -*- """ werkzeug.testapp ~~~~~~~~~~~~~~~~ Provide a small test application that can be used to test a WSGI server and check it for WSGI compliance. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ impo...
inscriptionweb/sslstrip2
refs/heads/master
sslstrip/URLMonitor.py
20
# URLMonitor import re import logging class URLMonitor: ''' The URL monitor maintains a set of (client, url) tuples that correspond to requests which the server is expecting over SSL. It also keeps track of secure favicon urls. ''' # Start the arms race, and end up here... javascriptTr...
jfpla/odoo
refs/heads/8.0
openerp/addons/test_exceptions/__openerp__.py
435
# -*- coding: utf-8 -*- { 'name': 'test-exceptions', 'version': '0.1', 'category': 'Tests', 'description': """A module to generate exceptions.""", 'author': 'OpenERP SA', 'maintainer': 'OpenERP SA', 'website': 'http://www.openerp.com', 'depends': ['base'], 'data': ['view.xml', 'ir.mo...
alex-march/micropython
refs/heads/master
tests/bench/var-7-instance-meth.py
102
import bench class Foo: def __init__(self): self._num = 20000000 def num(self): return self._num def test(num): o = Foo() i = 0 while i < o.num(): i += 1 bench.run(test)
AloneRoad/Inforlearn
refs/heads/1.0-rc3
django/core/management/color.py
26
""" Sets up the terminal color scheme. """ import sys from django.utils import termcolors def supports_color(): """ Returns True if the running system's terminal supports color, and False otherwise. """ unsupported_platform = (sys.platform in ('win32', 'Pocket PC')) # isatty is not always imp...
DataDog/integrations-extras
refs/heads/master
open_policy_agent/datadog_checks/__init__.py
42
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
wtmmac/p2pool
refs/heads/master
p2pool/test/util/test_pack.py
283
import unittest from p2pool.util import pack class Test(unittest.TestCase): def test_VarInt(self): t = pack.VarIntType() for i in xrange(2**20): assert t.unpack(t.pack(i)) == i for i in xrange(2**36, 2**36+25): assert t.unpack(t.pack(i)) == i
vvv1559/intellij-community
refs/heads/master
python/testData/codeInsight/controlflow/assertfalseargument.py
83
assert False, 'foo' print('unreachable 1') assert False, f() print('unreachable 2')
jtamiace/fle-home
refs/heads/master
fle_site/apps/redirects/migrations/0003_auto__add_field_redirectlogentry_url.py
4
# -*- 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 'RedirectLogEntry.url' db.add_column(u'redirects_redirectlogentry', 'url', ...
hdmetor/scikit-learn
refs/heads/master
sklearn/decomposition/truncated_svd.py
199
"""Truncated SVD for sparse matrices, aka latent semantic analysis (LSA). """ # Author: Lars Buitinck <[email protected]> # Olivier Grisel <[email protected]> # Michael Becker <[email protected]> # License: 3-clause BSD. import numpy as np import scipy.sparse as sp try: from scipy.sp...
zenoss/Community-Zenpacks
refs/heads/master
ZenPacks.chudler.GoogleAppEngine/ZenPacks/chudler/GoogleAppEngine/migrate/__init__.py
1165
# __init__.py
jordotech/sherri_satchmo
refs/heads/master
satchmo/apps/shipping/modules/tieredweight/config.py
12
import logging from django.utils.translation import ugettext_lazy as _ from livesettings import * log = logging.getLogger('tieredweight.config') from shipping.config import SHIPPING_ACTIVE SHIPPING_ACTIVE.add_choice(('shipping.modules.tieredweight', _('Tiered Weight Shipping'))) log.debug('loaded')
boundlessgeo/QGIS
refs/heads/master
tests/src/python/test_qgsfeature.py
7
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsFeature. .. note:: 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) any later version. """ __auth...
chrisnorman7/game
refs/heads/master
db/starships.py
1
"""Provides classes related to starships.""" from datetime import timedelta from sqlalchemy import Column, Float, String from attrs_sqlalchemy import attrs_sqlalchemy from .base import Base, ComponentMixin from util import percent from distance import m, ly message_length = 150 @attrs_sqlalchemy class ...
tulir/maubot
refs/heads/master
maubot/cli/cliq/__init__.py
1
from .cliq import command, option from .validators import SPDXValidator, VersionValidator, PathValidator
cupertinomiranda/binutils_new
refs/heads/tls_dev
gdb/python/lib/gdb/command/type_printers.py
40
# Type printer commands. # Copyright (C) 2010-2015 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) any late...
orymeyer/Flask-Python-GAE-Login-Registration
refs/heads/master
lib/Werkzeug-0.10.4.dist-info/flask/testsuite/test_apps/config_package_app/__init__.py
1257
import os import flask here = os.path.abspath(os.path.dirname(__file__)) app = flask.Flask(__name__)
lunixbochs/fs-uae-gles
refs/heads/master
launcher/fs_uae_launcher/fsui/wx/image.py
1
from __future__ import division from __future__ import print_function from __future__ import absolute_import import wx import pkg_resources class Image: def __init__(self, name): package, file = name.split(":", 1) stream = pkg_resources.resource_stream(package, file) image = wx....
tiankangkan/paper_plane
refs/heads/master
paper_plane/wsgi.py
1
""" WSGI config for test_of_lin 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.8/howto/deployment/wsgi/ """ import os import sys os.environ.setdefault("DJANGO_SETTINGS_MODULE", "paper_plane.settings") ...
apark263/tensorflow
refs/heads/master
tensorflow/contrib/constrained_optimization/python/test_util.py
39
# Copyright 2018 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...
SilentCircle/sentry
refs/heads/master
src/sentry/migrations/0063_auto.py
4
# -*- 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 index on 'MessageCountByMinute', fields ['date'] db.create_index('sentry_messagecountbyminute', ['d...
addappio/serving
refs/heads/develop
tensorflow_serving/servables/tensorflow/testdata/export_bad_half_plus_two.py
3
# Copyright 2016 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...
evidation-health/bokeh
refs/heads/master
examples/charts/file/dots.py
6
from collections import OrderedDict from bokeh._legacy_charts import Dot, show, output_file # create some example data xyvalues = OrderedDict( python=[2, 3, 7, 5, 26], pypy=[12, 33, 47, 15, 126], jython=[22, 43, 10, 25, 26], ) # any of the following commented are also valid Dot inputs #xyvalues = pd.Data...
defance/edx-platform
refs/heads/master
lms/djangoapps/notification_prefs/tests.py
137
import json from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied from django.http import Http404 from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_settings from mock import Mock, patch from notifica...
mjudsp/Tsallis
refs/heads/master
sklearn/covariance/empirical_covariance_.py
80
""" Maximum likelihood covariance estimator. """ # Author: Alexandre Gramfort <[email protected]> # Gael Varoquaux <[email protected]> # Virgile Fritsch <[email protected]> # # License: BSD 3 clause # avoid division truncation from __future__ import division import warnin...
TheChef1212/tardis-speech-backend
refs/heads/master
app3.py
1
#!/usr/bin/env python from __future__ import print_function from future.standard_library import install_aliases install_aliases() from urllib.parse import urlparse, urlencode from urllib.request import urlopen, Request from urllib.error import HTTPError import json import os from flask import Flask from flask impor...
jorik041/dfvfs
refs/heads/master
dfvfs/vfs/vshadow_file_entry.py
2
# -*- coding: utf-8 -*- """The Volume Shadow Snapshots (VSS) file entry implementation.""" from dfvfs.lib import date_time from dfvfs.lib import definitions from dfvfs.lib import errors from dfvfs.lib import vshadow from dfvfs.path import vshadow_path_spec from dfvfs.vfs import file_entry from dfvfs.vfs import vfs_sta...
bzbarsky/servo
refs/heads/master
tests/wpt/web-platform-tests/service-workers/service-worker/resources/request-headers.py
158
import json def main(request, response): data = {key:request.headers[key] for key,value in request.headers.iteritems()} return [("Content-Type", "application/json")], json.dumps(data)
kmonsoor/npyscreen
refs/heads/master
npyscreen/fmFileSelector.py
14
from . import fmFormMutt from . import wgmultiline from . import wggrid from . import wgautocomplete from . import utilNotify import curses import os import os.path import operator class FileCommand(wgautocomplete.Filename): def set_up_handlers(self): super(FileCommand, self).set_up_handlers() sel...
omarocegueda/dipy
refs/heads/master
doc/examples/segment_clustering_metrics.py
9
""" =========================================== Tractography Clustering - Available Metrics =========================================== This page lists available metrics that can be used by the tractography clustering framework. For every metric a brief description is provided explaining: what it does, when it's usefu...
ClaudiaSaxer/PlasoScaffolder
refs/heads/master
src/setup.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- """This is the setup file for the project.""" from setuptools import find_packages from setuptools import setup setup(name='plasoscaffolder', version='0.1', packages=find_packages(), include_package_data=True, package_data={'plasoscaffolder.bll.template...