repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
julien78910/CouchPotatoServer | refs/heads/develop | libs/CodernityDB/debug_stuff.py | 44 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.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/L... |
cerndb/storage-api | refs/heads/master | storage_api/extensions/tests/test_storage.py | 1 | from storage_api.extensions.storage import (DummyStorage,
NetappStorage) # noqa
import uuid
import functools
import os
from unittest import mock
from contextlib import contextmanager
import pytest
import netapp.api
DEFAULT_VOLUME_SIZE = 30000000
def id_from_vol(v, backe... |
pavelkuchin/tracktrains | refs/heads/master | profiles/migrations/0002_auto_20150509_1528.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('profiles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='t... |
MakersF/cassiopeia | refs/heads/master | cassiopeia/type/core/champion.py | 1 | import cassiopeia.riotapi
import cassiopeia.type.core.common
import cassiopeia.type.dto.champion
@cassiopeia.type.core.common.inheritdocs
class ChampionStatus(cassiopeia.type.core.common.CassiopeiaObject):
dto_type = cassiopeia.type.dto.champion.Champion
def __str__(self):
return "Status ({champ})".f... |
benoitsteiner/tensorflow-opencl | refs/heads/master | tensorflow/python/ops/matmul_benchmark_test.py | 33 | # 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... |
gem/oq-engine | refs/heads/master | openquake/hazardlib/tests/scalerel/__init__.py | 7 | # The Hazard Library
# Copyright (C) 2012-2021 GEM Foundation
#
# 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.
#... |
ojengwa/oh-mainline | refs/heads/master | vendor/packages/gdata/src/gdata/docs/__init__.py | 263 | #!/usr/bin/python
#
# Copyright 2009 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 b... |
eugenejen/AutobahnPython | refs/heads/master | examples/twisted/wamp1/pubsub/loadlatency/client.py | 17 | ###############################################################################
##
## Copyright (C) 2013-2014 Tavendo GmbH
##
## 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
##
## h... |
deepmind/deepmind-research | refs/heads/master | side_effects_penalties/results_summary.py | 1 | # Copyright 2019 DeepMind Technologies Limited.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
zhimingxie/grpc | refs/heads/master | src/python/grpcio/grpc/framework/foundation/abandonment.py | 47 | # Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
mitchelljkotler/django | refs/heads/master | tests/auth_tests/test_auth_backends.py | 200 | from __future__ import unicode_literals
from datetime import date
from django.contrib.auth import (
BACKEND_SESSION_KEY, SESSION_KEY, authenticate, get_user,
)
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.hashers import MD5PasswordHasher
from django.contrib.auth.models import Ano... |
caterinaurban/Lyra | refs/heads/master | src/lyra/unittests/numerical/interval/forward/indexing3/counting2.py | 1 |
D: Dict[str, List[int]] = {'a': [1], 'b': [1, 2], 'c': [1, 2, 3]}
# FINAL: D -> "a"@[1, 1], "b"@[1, 2], "c"@[1, 3], _@⊥; keys(D) -> 0@[-inf, inf], _@⊥; len(D) -> [3, 3]; values(D) -> 0@[1, 1], _@[2, 3]
|
tgsd96/gargnotes | refs/heads/master | venv/lib/python2.7/site-packages/django/http/utils.py | 134 | """
Functions that modify an HTTP request or response in some way.
"""
# This group of functions are run as part of the response handling, after
# everything else, including all response middleware. Think of them as
# "compulsory response middleware". Be careful about what goes here, because
# it's a little fiddly to ... |
erwilan/ansible | refs/heads/devel | contrib/inventory/nsot.py | 117 | #!/usr/bin/env python
'''
nsot
====
Ansible Dynamic Inventory to pull hosts from NSoT, a flexible CMDB by Dropbox
Features
--------
* Define host groups in form of NSoT device attribute criteria
* All parameters defined by the spec as of 2015-09-05 are supported.
+ ``--list``: Returns JSON hash of host groups -... |
eckucukoglu/arm-linux-gnueabihf | refs/heads/master | arm-linux-gnueabihf/libc/usr/lib/python2.7/unittest/test/test_setups.py | 153 | import sys
from cStringIO import StringIO
import unittest
def resultFactory(*_):
return unittest.TestResult()
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=StringIO())
def ru... |
talenhao/ServiceConnectEvolution | refs/heads/master | serconevo/netgraph/__init__.py | 1 | # -*- coding: UTF-8 -*-
"""
# ******************************************************
# * author: "Talen Hao(天飞)<[email protected]>" *
# ******************************************************
"""
# todo ok 127.0.0.1 connect 127.0.0.1
# todo ok drop ip map
# todo ok process None:None raddr
import traceback
import ... |
mattpap/sympy-polys | refs/heads/master | sympy/functions/elementary/tests/test_integers.py | 9 | from sympy import Symbol, floor, nan, oo, E, symbols, ceiling, pi, Rational, \
Real, I, sin, exp, log, factorial
from sympy.utilities.pytest import XFAIL
def test_floor():
x = Symbol('x')
y = Symbol('y', real=True)
k, n = symbols('kn', integer=True)
assert floor(nan) == nan
assert floor... |
hynnet/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/copy.py | 253 | """Generic (shallow and deep) copying operations.
Interface summary:
import copy
x = copy.copy(y) # make a shallow copy of y
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relev... |
rdebroiz/presto | refs/heads/master | pipeline.py | 1 | import logging
from pprint import pformat
import path
import networkx as nx
from settings import FAIL, ENDCBOLD, PRESTO_GRAPH_FILENAME, BOLD, ENDC
from node import Root
class PipelineError(Exception):
pass
class PipelineCyclicError(PipelineError):
pass
class PipelineDependenceError(PipelineError):
pa... |
unifycore/pcp-sdn | refs/heads/master | pcp_sdn_source/pcp_sdn/tests/test_pcpmessage.py | 1 | import unittest
from ..pcp import pcpmessage
#===============================================================================
class TestPcpMessage(unittest.TestCase):
def setUp(self):
self.pcp_client_ip = "192.168.1.1"
self.pcp_fields_request_map_common = {
'version': 2,
'message_type'... |
patriciolobos/desa8 | refs/heads/master | openerp/addons/product/report/__init__.py | 452 | # -*- 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... |
glaubitz/fs-uae-debian | refs/heads/master | launcher/OpenGL/WGL/EXT/pbuffer.py | 8 | '''OpenGL extension EXT.pbuffer
This module customises the behaviour of the
OpenGL.raw.WGL.EXT.pbuffer to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/EXT/pbuffer.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL... |
robert-kisteleki/ripe-atlas-tools | refs/heads/master | tests/renderers/ssl_consistency.py | 2 | # Copyright (c) 2015 RIPE NCC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the h... |
kadamski/func | refs/heads/master | func/overlord/base_command.py | 2 | #!/usr/bin/python
"""
Copyright 2008, Red Hat, Inc
Adrian Likins <[email protected]>
also see AUTHORS
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Softw... |
fernandog/Medusa | refs/heads/optimized | ext/github/RateLimit.py | 1 | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <[email protected]> #
# Copyright 2014 Vincent Jacques <vincent@vincent-ja... |
tommyip/zulip | refs/heads/master | zilencer/forms.py | 70 | from django import forms
class EnterpriseToSForm(forms.Form):
full_name = forms.CharField(max_length=100)
company = forms.CharField(max_length=100)
terms = forms.BooleanField(required=True)
|
TravelModellingGroup/TMGToolbox | refs/heads/dev-1.8 | TMGToolbox/src/XTMF_internal/return_boardings_and_WAW.py | 1 | #---LICENSE----------------------
'''
Copyright 2015 Travel Modelling Group, Department of Civil Engineering, University of Toronto
This file is part of the TMG Toolbox.
The TMG Toolbox is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... |
VimVincent/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/scene.py | 124 | import os
from .. import constants, logger
from . import (
base_classes,
texture,
material,
geometry,
object as object_,
utilities,
io,
api
)
class Scene(base_classes.BaseScene):
"""Class that handles the contruction of a Three scene"""
_defaults = {
constants.METADATA:... |
ArcherSys/ArcherSys | refs/heads/master | Lib/site-packages/tornado/test/options_test.py | 81 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, with_statement
import datetime
import os
import sys
from tornado.options import OptionParser, Error
from tornado.util import basestring_type
from tornado.test.util import unittest
try:
from cStringIO import StringIO # pyth... |
lento/cortex | refs/heads/master | test/IECore/FileSequenceVectorParameter.py | 12 | ##########################################################################
#
# Copyright (c) 2008, Image Engine Design 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:
#
# * Redistribu... |
liberorbis/libernext | refs/heads/master | env/lib/python2.7/site-packages/celery/events/__init__.py | 8 | # -*- coding: utf-8 -*-
"""
celery.events
~~~~~~~~~~~~~
Events is a stream of messages sent for certain actions occurring
in the worker (and clients if :setting:`CELERY_SEND_TASK_SENT_EVENT`
is enabled), used for monitoring purposes.
"""
from __future__ import absolute_import
import os
import tim... |
hexid/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/actions/gyptest-errors.py | 147 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies behavior for different action configuration errors:
exit status of 1, and the expected error message must be in stderr.
""... |
hohe/scikit-rf | refs/heads/develop | doc/sphinxext/comment_eater.py | 6 | from cStringIO import StringIO
import compiler
import inspect
import textwrap
import tokenize
from compiler_unparse import unparse
class Comment(object):
""" A comment block.
"""
is_comment = True
def __init__(self, start_lineno, end_lineno, text):
# int : The first line number in the block. ... |
msmbuilder/msmbuilder | refs/heads/master | msmbuilder/preprocessing/base.py | 6 | # Author: Carlos Xavier Hernandez <[email protected]>
# Contributors:
# Copyright (c) 2016, Stanford University and the Authors
# All rights reserved.
from __future__ import print_function, division, absolute_import
import numpy as np
import collections
from ..base import BaseEstimator
from ..utils import check_iter_o... |
tempbottle/kbengine | refs/heads/master | kbe/src/lib/python/Lib/ctypes/test/test_frombuffer.py | 70 | from ctypes import *
import array
import gc
import unittest
class X(Structure):
_fields_ = [("c_int", c_int)]
init_called = False
def __init__(self):
self._init_called = True
class Test(unittest.TestCase):
def test_fom_buffer(self):
a = array.array("i", range(16))
x = (c_int * ... |
zulip/zulip | refs/heads/master | zerver/tests/test_home.py | 1 | import calendar
import urllib
from datetime import timedelta
from typing import Any
from unittest.mock import patch
import orjson
import pytz
from django.conf import settings
from django.http import HttpResponse
from django.utils.timezone import now as timezone_now
from corporate.models import Customer, CustomerPlan
... |
by46/recipe | refs/heads/master | recipe/__main__.py | 1 | from recipe.main import main
main()
|
sigvef/elma | refs/heads/master | elma/utils.py | 1 | try:
bytes('A', 'latin1')
except TypeError:
bytes = lambda a, b: a # noqa
chr = lambda a: a if type(a) == str else chr(a) # noqa
def null_padded(string, length):
"""
Force a string to a given length by right-padding it with zero-bytes,
clipping the initial string if neccessary.
"""
r... |
seann1/portfolio5 | refs/heads/master | .meteor/dev_bundle/python/Lib/idlelib/FileList.py | 123 | import os
from Tkinter import *
import tkMessageBox
class FileList:
# N.B. this import overridden in PyShellFileList.
from idlelib.EditorWindow import EditorWindow
def __init__(self, root):
self.root = root
self.dict = {}
self.inversedict = {}
self.vars = {} # For EditorW... |
ddico/server-tools | refs/heads/8.0 | dead_mans_switch_server/__openerp__.py | 21 | # -*- coding: utf-8 -*-
# © 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Dead man's switch (server)",
"version": "8.0.1.0.0",
"author": "Therp BV,Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Monitoring",
"... |
abramhindle/UnnaturalCodeFork | refs/heads/master | python/testdata/launchpad/lib/lp/translations/browser/hastranslationimports.py | 1 | # Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Browser view for IHasTranslationImports."""
__metaclass__ = type
__all__ = [
'HasTranslationImportsView',
]
import datetime
import pytz
import simplejson
from z3c.pt... |
paplorinc/intellij-community | refs/heads/master | python/testData/refactoring/move/referenceToClassWithNewInMovedSymbol/after/src/classFile.py | 62 | from collections import namedtuple
class Pipeline(namedtuple('_Pipeline', 'name')):
def __new__(cls, name):
return super(Pipeline, cls).__new__(cls, name)
def __init__(self, name):
pass
|
sam81/pychoacoustics | refs/heads/master | pychoacoustics/default_experiments/sig_detect_multi.py | 1 | # -*- coding: utf-8 -*-
"""
Measure d' for the detection of a pure tone in a Yes/No task.
The available fields are:
- Frequency (Hz) :
The frequency of the pure tone signal
- Duration (ms) :
Tone duration (excluding ramps), in ms
- Ramps (ms) :
Duration of each ramp, in ms
- Level (dB SPL):
Level of ... |
ric2b/Vivaldi-browser | refs/heads/master | chromium/third_party/blink/tools/blinkpy/web_tests/models/test_configuration_unittest.py | 2 | # Copyright (C) 2011 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 ... |
hwu25/AppPkg | refs/heads/trunk | Applications/Python/Python-2.7.2/Lib/encodings/cp875.py | 93 | """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.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 deco... |
nrego/westpa | refs/heads/master | lib/examples/stringmethodexamples/examples/DicksonRingPotential/analysis/calculate_distribution.py | 2 | import numpy as np
import h5py
import argparse
import sys
import os
import west
pcoord_dtype = np.float32
nbins = 100
print '-----------------------'
print os.path.basename(__file__)
print '-----------------------'
env = os.environ
for k in env:
if 'WEST' in k:
print k, env[k]
parser = argparse.Argumen... |
dylanlesko/youtube-dl | refs/heads/master | youtube_dl/extractor/quickvid.py | 113 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
from ..utils import (
determine_ext,
int_or_none,
)
class QuickVidIE(InfoExtractor):
_VALID_URL = r'https?://(www\.)?quickvid\.org/watch\.php\?v=(?P<id>[a-zA-Z_0-9-]+)'
_... |
jbgastineau/cxphasing | refs/heads/master | cxphasing/__init__.py | 1 | __all__ = ["CXData", "CXData2", "CXParams", "CXPhasing", "CXPhasing2", "CXFileReader", "CXUtils"]
import cxparams
from cxparams import CXParams
from CXFileReader import CXFileReader
from CXData import CXData
from CXData import CXModal
from CXPhasing import CXPhasing
import CXUtils as CXU
|
debugger06/MiroX | refs/heads/master | resources/devices/android.py | 3 | from miro import app
from miro import prefs
from miro.devices import DeviceInfo, MultipleDeviceInfo
from miro.gtcache import gettext as _
defaults = {
'audio_conversion': 'mp3',
'container_types': 'mp3 wav asf isom ogg mpeg avi'.split(),
'audio_types': 'mp* wmav* aac pcm* vorbis'.split(),
'video_types'... |
samdesbois/Symfony_tuto | refs/heads/master | vendor/doctrine/orm/docs/en/_exts/configurationblock.py | 2577 | #Copyright (c) 2010 Fabien Potencier
#
#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, modify, merge, publish, distrib... |
savoirfairelinux/mod-booster-snmp | refs/heads/master | module/module.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2014:
# Thibault Cohen, [email protected]
#
# This file is part of SNMP Booster Shinken Module.
#
# Shinken 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 ... |
trabucayre/gnuradio | refs/heads/master | gr-qtgui/python/qtgui/dialgauge.py | 9 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
from PyQt5.QtWidgets import QFrame, QHBoxLayout, QVBoxLayout, QLabel
from PyQt5.QtGui import QPainter, QColor, QPen, QFont, QFo... |
adam-pawluczuk/pysorter | refs/heads/master | tests/TestCase.py | 1 | # coding=utf-8
class TestCase(object):
def test_sort_imports(self):
source = (
u'import logging\n'
u'from security import login_required\n'
u'from services import vehicle_service\n'
u'from services import company_service\n'
u'from models.commissi... |
andrewleech/script.module.raven | refs/heads/master | lib/raven/scripts/__init__.py | 42 | """
raven.scripts
~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
|
vrenaville/ngo-addons-backport | refs/heads/master | addons/l10n_be/wizard/l10n_be_vat_intra.py | 25 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Adapted by Noviat to
# - make the 'mand_id' field optional
# - support Noviat tax code scheme
#... |
overflowsecurity/enumerator | refs/heads/master | enumerator.py | 1 | #!/usr/bin/python
""" Author: Maleus
Usage: ./enumerator.py <ip>
Date: 7.28.14
Made for Kali Linux, not tested on other distros.
"""
import sys
import os
import nmap
import ftplib
import subprocess
if len(sys.argv) != 2:
print "Usage ./enumerator.py <ip>"
sys.exit(1)
IP = sys.argv[1] # IP address
HOME = os.environ['HO... |
IronLanguages/ironpython3 | refs/heads/master | Src/StdLib/Lib/test/test_fnmatch.py | 173 | """Test cases for the fnmatch module."""
from test import support
import unittest
from fnmatch import fnmatch, fnmatchcase, translate, filter
class FnmatchTestCase(unittest.TestCase):
def check_match(self, filename, pattern, should_match=1, fn=fnmatch):
if should_match:
self.assertTrue(fn(fi... |
r0ro/pyopenssl | refs/heads/master | tests/test_tsafe.py | 4 | # Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
"""
Unit tests for :py:obj:`OpenSSL.tsafe`.
"""
from OpenSSL.SSL import TLSv1_METHOD, Context
from OpenSSL.tsafe import Connection
from .util import TestCase
class ConnectionTest(TestCase):
"""
Tests for :py:obj:`OpenSSL.tsafe.Connection`.
... |
msg4real/pygooglevoice | refs/heads/master | examples/parse_sms.py | 38 | #
#SMS test via Google Voice
#
#John Nagle
# [email protected]
#
from googlevoice import Voice
import sys
import BeautifulSoup
def extractsms(htmlsms) :
"""
extractsms -- extract SMS messages from BeautifulSoup tree of Google Voice SMS HTML.
Output is a list of dictionaries, one per me... |
DDEFISHER/servo | refs/heads/master | tests/wpt/css-tests/tools/html5lib/html5lib/html5parser.py | 423 | from __future__ import absolute_import, division, unicode_literals
from six import with_metaclass
import types
from . import inputstream
from . import tokenizer
from . import treebuilders
from .treebuilders._base import Marker
from . import utils
from . import constants
from .constants import spaceCharacters, ascii... |
justinlulejian/fah-gae | refs/heads/master | lib/flask/testsuite/helpers.py | 146 | # -*- coding: utf-8 -*-
"""
flask.testsuite.helpers
~~~~~~~~~~~~~~~~~~~~~~~
Various helpers.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import flask
import unittest
from logging import StreamHandler
from flask.testsuite import FlaskTestCase,... |
mikedelong/aarhus | refs/heads/master | demos/clusters_from_topics.py | 1 | # http://stats.stackexchange.com/questions/28904/how-to-cluster-lda-lsi-topics-generated-by-gensim
# coding:utf-8
import cPickle as pickle
import glob
import logging
import os
import scipy
import scipy.sparse
import string
import sys
import time
from collections import defaultdict
import gensim.matutils
import gensim... |
shahankhatch/scikit-learn | refs/heads/master | examples/covariance/plot_sparse_cov.py | 300 | """
======================================
Sparse inverse covariance estimation
======================================
Using the GraphLasso estimator to learn a covariance and sparse precision
from a small number of samples.
To estimate a probabilistic model (e.g. a Gaussian model), estimating the
precision matrix, t... |
Snazz2001/BDA_py_demos | refs/heads/master | demos_ch2/demo2_2.py | 19 | """Bayesian data analysis, 3rd ed
Chapter 2, demo 2
Illustrate the effect of a prior. Comparison of posterior distributions with
different parameter values for Beta prior distribution.
"""
import numpy as np
from scipy.stats import beta
import matplotlib.pyplot as plt
# Edit default plot settings (colours from co... |
madsmpedersen/MMPE | refs/heads/master | functions/__init__.py | 1 | d = None
d = dir()
from .process_exec import pexec
from .inspect_ext import class_list, argument_string
from .deep_coding import deep_encode, to_str, deep_decode, to_bytes
from .exe_std_err import ExeStdErr
from .exe_std_out import ExeStdOut
__all__ = [m for m in set(dir()) - set(d)]
|
Lucasgscruz/harpia | refs/heads/master | harpia/bpGUI/laplace.py | 2 | # -*- coding: utf-8 -*-
# [HARPIA PROJECT]
#
#
# S2i - Intelligent Industrial Systems
# DAS - Automation and Systems Department
# UFSC - Federal University of Santa Catarina
# Copyright: 2006 - 2007 Luis Carlos Dill Junges ([email protected]), Clovis Peruchi Scotti ([email protected]),
# Guilh... |
openstack/python-barbicanclient | refs/heads/master | barbicanclient/v1/acls.py | 1 | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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... |
mitodl/open-discussions | refs/heads/master | search/constants.py | 1 | """ Constants for search """
from channels.constants import POST_TYPE, COMMENT_TYPE
ALIAS_ALL_INDICES = "all"
PROFILE_TYPE = "profile"
COURSE_TYPE = "course"
RESOURCE_FILE_TYPE = "resourcefile"
PROGRAM_TYPE = "program"
USER_LIST_TYPE = "userlist"
LEARNING_PATH_TYPE = "learningpath"
VIDEO_TYPE = "video"
PODCAST_TYPE = ... |
magosil86/ruffus | refs/heads/master | doc/images/web_front_page.py | 7 | #!/usr/bin/env python
"""
test2.py
[--log_file PATH]
[--verbose]
"""
################################################################################
#
# test2
#
#
# Copyright (c) 7/16/2010 Leo Goodstadt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this so... |
agiliopadua/lammps | refs/heads/master | examples/ASPHERE/tri/tri.srd.viz.py | 49 | # Pizza.py viz of triangle + SRD output
d = dump("dump1.atom.srd dump2.atom.srd")
t = tdump("dump1.tri.srd dump2.tri.srd")
t.map(1,"id",2,"type",
3,"corner1x",4,"corner1y",5,"corner1z",
6,"corner2x",7,"corner2y",8,"corner2z",
9,"corner3x",10,"corner3y",11,"corner3z")
d.extra(t)
g = gl(d)
g.arad(1,0.... |
hazemalsaied/IdenSys | refs/heads/master | Src/corpus.py | 1 | import operator
import os
from param import FeatParams, XPParams, Paths
import logging
class Corpus:
"""
a class used to encapsulate all the information of the corpus
"""
mweTokenDic, mweDictionary, mwtDictionary, mwtDictionaryWithSent = {}, {}, {}, {}
def __init__(self, langName):
... |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v21/tests/test_runner/test_debug_sql.py | 76 | import unittest
from io import StringIO
from django.db import connection
from django.test import TestCase
from django.test.runner import DiscoverRunner
from .models import Person
@unittest.skipUnless(connection.vendor == 'sqlite', 'Only run on sqlite so we can check output SQL.')
class TestDebugSQL(unittest.TestCas... |
bowang/tensorflow | refs/heads/master | tensorflow/contrib/layers/python/layers/initializers_test.py | 111 | # 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... |
prakxys/flask | refs/heads/master | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py | 355 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from gettext import gettext
_ = gettext
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
... |
twz915/django-minicms | refs/heads/master | DjangoUeditor/utils.py | 1 | # -*- coding: utf-8 -*-
# 文件大小类
from django.utils import six
if six.PY3:
long = int
class FileSize():
SIZE_UNIT = {
"Byte": 1, "KB": 1024, "MB": 1048576,
"GB": 1073741824, "TB": 1099511627776
}
def __init__(self, size):
self.size = long(FileSize.Format(size))
... |
mSenyor/sl4a | refs/heads/master | python/src/Mac/BuildScript/build-installer.py | 22 | #!/usr/bin/python
"""
This script is used to build the "official unofficial" universal build on
Mac OS X. It requires Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK to do its
work. 64-bit or four-way universal builds require at least OS X 10.5 and
the 10.5 SDK.
Please ensure that this script keeps working with Python 2.3... |
kubow/HAC | refs/heads/master | System/UI74AJ.py | 1 | #!/usr/bin/python3
from appJar import gui
from OS74 import FileSystemObject
from DB74 import DataBaseObject
from Template import SQL
def opt_changed():
result_set = db_obj.return_many('SELECT * FROM {0};'.format(app.getOptionBox("optionbox")))
first_columns = [record[0] for record in result_set]
app.clear... |
QinerTech/QinerApps | refs/heads/master | openerp/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py | 46 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp.exceptions import UserError
class hr_timesheet_current_open(osv.osv_memory):
_name = 'hr.timesheet.current.open'
... |
richard-willowit/odoo | refs/heads/master | addons/website_twitter/controllers/main.py | 34 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
from odoo import _
from odoo import http
from odoo.http import request
class Twitter(http.Controller):
@http.route(['/twitter_reload'], type='json', auth="user", website=True)
def twitter_reload(sel... |
dalduba/pythonqt | refs/heads/master | examples/PyGettingStarted/GettingStarted.py | 20 | from PythonQt import *
# set the title of the group box, accessing the title property
box.title = 'PythonQt Example'
# set the html content of the QTextBrowser
box.browser.html = 'Hello <b>Qt</b>!'
# set the title of the button
box.button1.text = 'Append Text'
# set the text of the line edit
box.edit.text = '42'
... |
britcey/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/urpmi.py | 71 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2013, Philippe Makowski
# Written by Philippe Makowski <[email protected]>
# Based on apt module written by Matthew Williams <[email protected]>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pub... |
rgom/Pydev | refs/heads/development | plugins/org.python.pydev.refactoring/tests/python/typeinference/import.py | 9 |
import import_package.bar
import import_package.foo
import import_package.baz as baz_alias
from import_package.qux import Qux
from import_package.quux import Quux as Xuuq
from import_package import sub_package
baz_alias ## type baz
import_package ## type import_package
sub_package ## type sub_package
import_package.f... |
cogeorg/BlackRhino | refs/heads/master | examples/firesales_SA/networkx/readwrite/pajek.py | 22 | """
*****
Pajek
*****
Read graphs in Pajek format.
This implementation handles directed and undirected graphs including
those with self loops and parallel edges.
Format
------
See http://vlado.fmf.uni-lj.si/pub/networks/pajek/doc/draweps.htm
for format information.
"""
# Copyright (C) 2008-2011 by
# Aric Hag... |
wd5/jangr | refs/heads/master | django/contrib/gis/gdal/__init__.py | 397 | """
This module houses ctypes interfaces for GDAL objects. The following GDAL
objects are supported:
CoordTransform: Used for coordinate transformations from one spatial
reference system to another.
Driver: Wraps an OGR data source driver.
DataSource: Wrapper for the OGR data source object, supports
OGR-... |
Comunitea/l10n-spain | refs/heads/8.0 | l10n_es_aeat/models/aeat_report.py | 7 | # -*- coding: utf-8 -*-
# © 2004-2011 - Pexego Sistemas Informáticos - Luis Manuel Angueira Blanco
# © 2013 - Acysos S.L. - Ignacio Ibeas (Migración a v7)
# © 2014-2016 - Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models, ap... |
FireWRT/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/host/lib/python2.7/test/test_epoll.py | 45 | # Copyright (c) 2001-2006 Twisted Matrix Laboratories.
#
# 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, modify, m... |
fengren/python_koans | refs/heads/master | python3/koans/about_attribute_access.py | 104 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Partially based on AboutMessagePassing in the Ruby Koans
#
from runner.koan import *
class AboutAttributeAccess(Koan):
class TypicalObject:
pass
def test_calling_undefined_functions_normally_results_in_errors(self):
typical = self.TypicalObj... |
LiveZenLK/CeygateERP | refs/heads/master | addons/l10n_be_invoice_bba/partner.py | 47 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
from openerp.osv import fields, osv
import time
from openerp.tools.translate import _
class res_partner(osv.osv):
""" add field to indicat... |
artemsok/sockeye | refs/heads/master | sockeye_contrib/autopilot/test.py | 1 | #!/usr/bin/env python3
# Copyright 2018 Amazon.com, Inc. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or i... |
hisaharu/ryu | refs/heads/master | ryu/lib/sockopt.py | 38 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... |
controlzee/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/api/light.py | 195 | from bpy import data, types
from .. import utilities, logger
def _lamp(func):
"""
:param func:
"""
def inner(name, *args, **kwargs):
"""
:param name:
:param *args:
:param **kwargs:
"""
if isinstance(name, types.Lamp):
lamp = name
... |
gandalfcode/gandalf | refs/heads/master | examples/example12.py | 1 | #==============================================================================
# example12.py
# Plot particle quantities in an alternative coordinate system.
#==============================================================================
from gandalf.analysis.facade import *
from matplotlib.colors import LogNorm
# Cr... |
nikitabiradar/student_registration | refs/heads/master | janastu/lib/python2.7/encodings/shift_jisx0213.py | 816 | #
# shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213
#
# Written by Hye-Shik Chang <[email protected]>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('shift_jisx0213')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEnc... |
mirestrepo/voxels-at-lems | refs/heads/master | registration_eval/perturb/reg3d_main_pert.py | 1 | #!/usr/bin/env python
# encoding: utf-8
"""
Author: Isabel Restrepo
A script that encapsulates all steps to evaluate
3d-registration algorithms in the PVM under camera perturbation errors
September 12, 2012
"""
import os, sys, argparse
#set up enviroment
CONFIGURATION= "Release";
sys.path.append("/Projects/vxl/bin/" ... |
mitar/django | refs/heads/master | tests/modeltests/properties/tests.py | 126 | from __future__ import absolute_import
from django.test import TestCase
from .models import Person
class PropertyTests(TestCase):
def setUp(self):
self.a = Person(first_name='John', last_name='Lennon')
self.a.save()
def test_getter(self):
self.assertEqual(self.a.full_name, 'John Le... |
kazukioishi/android_kernel_samsung_klte | refs/heads/cm-12.1 | tools/perf/util/setup.py | 4998 | #!/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... |
mindnervestech/mnrp | refs/heads/master | openerp/__init__.py | 100 | # -*- 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 GNU... |
ar4s/django | refs/heads/master | tests/template_tests/test_parser.py | 3 | """
Testing some internals of the template processing. These are *not* examples to be copied in user code.
"""
from __future__ import unicode_literals
from unittest import TestCase
from django.template import (TokenParser, FilterExpression, Parser, Variable,
Template, TemplateSyntaxError, Library)
from django.tes... |
OmarIthawi/edx-platform | refs/heads/master | lms/djangoapps/open_ended_grading/staff_grading.py | 192 | """
LMS part of instructor grading:
- views + ajax handling
- calls the instructor grading service
"""
import logging
log = logging.getLogger(__name__)
class StaffGrading(object):
"""
Wrap up functionality for staff grading of submissions--interface exposes get_html, ajax views.
"""
def __init__(s... |
armstrong/armstrong.esi | refs/heads/master | example/hello/tests.py | 1940 | """
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.