repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
gersolar/stations | refs/heads/master | stations/tests/units/test_measurements.py | 1 | # -*- coding: utf-8 -*-
from stations.models import *
from django.test import TestCase
from datetime import datetime
import pytz
class TestMeasurements(TestCase):
fixtures = [ 'initial_data.yaml', '*']
def setUp(self):
self.finish = datetime.utcnow().replace(tzinfo=pytz.UTC)
self.mean = 60
self.between = 60... |
gomiero/PTVS | refs/heads/master | Python/Tests/TestData/Outlining/Program.py | 18 | def f():
print('hello')
print('world')
print('!')
#comment
class C:
print('hello')
print('world')
print('!')
#comment
if True:
print('hello')
print('world')
print('!')
#comment
if True:
print('hello')
print('world')
print('!')
else:
print('he... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | python/testData/mover/multiLineSelection6.py | 83 | class Test(object):
def q(self):
c = 3
<caret><selection> a = 1
b = 2
</selection> |
lizardsystem/lizard-workspace | refs/heads/master | lizard_workspace/testsettings.py | 1 | import os
from lizard_ui.settingshelper import setup_logging
from lizard_ui.settingshelper import STATICFILES_FINDERS
DEBUG = True
TEMPLATE_DEBUG = True
# SETTINGS_DIR allows media paths and so to be relative to this settings file
# instead of hardcoded to c:\only\on\my\computer.
SETTINGS_DIR = os.path.dirname(os.pa... |
rapidsms/rapidsms-core-dev | refs/heads/master | lib/rapidsms/utils.py | 7 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
import pytz
from datetime import datetime
def empty_str(in_str):
"""
Simple helper to return True if the passed
string reference is None or '' or all whitespace
"""
if in_str is not None and not isinstance(in_str, basestring):
... |
bennojoy/ansible | refs/heads/devel | plugins/inventory/apache-libcloud.py | 89 | #!/usr/bin/env python
# (c) 2013, Sebastien Goasguen <runseb@gmail.com>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... |
alexanderfefelov/nav | refs/heads/master | python/nav/models/arnold.py | 1 | #
# Copyright (C) 2012 (SD -311000) UNINETT AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV 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 Foundation.
#
# This program is distribute... |
GarySparrow/mFlaskWeb | refs/heads/master | venv/Lib/site-packages/pygments/lexers/x10.py | 25 | # -*- coding: utf-8 -*-
"""
pygments.lexers.x10
~~~~~~~~~~~~~~~~~~~
Lexers for the X10 programming language.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer
from pygments.token import T... |
mmedal/Magic_the_Slackening | refs/heads/master | magicbot/views.py | 2 | import urllib
from bs4 import BeautifulSoup
import requests
from rest_framework.exceptions import ParseError
from rest_framework.response import Response
from rest_framework.views import APIView
from aliases import CARD_ALIASES, SET_ALIASES
GATHERER_URI = 'http://gatherer.wizards.com/Handlers/Image.ashx?type=card'... |
benoitsteiner/tensorflow-opencl | refs/heads/master | tensorflow/python/ops/distributions/bernoulli.py | 37 | # 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... |
wkcn/mobula | refs/heads/master | mobula/__init__.py | 1 | from .Net import *
from .wrapper import *
|
direvus/ansible | refs/heads/devel | test/units/plugins/connection/test_network_cli.py | 5 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... |
Houzz/annoy2 | refs/heads/master | test/b_test.py | 1 | # Copyright (c) 2013 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 or agreed to in writing, s... |
aristanetworks/arista-ovs-nova | refs/heads/master | nova/api/openstack/compute/ips.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... |
luillyfe/GAE | refs/heads/master | models.py | 1 |
# -*- coding: utf-8 -*-
# Aqui reposan los modelos que utilizara la aplicacion para
# soportar cada una de sus funcionalidades
from google.appengine.ext import ndb
from google.appengine.api import users
class UserApp( ndb.Model ):
"""Modela un usuario de la aplicación."""
user = ndb.UserProperty()
name = ndb... |
gocardless/gocardless-pro-python | refs/heads/master | tests/integration/payout_items_integration_test.py | 1 | # WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#
import json
import requests
import responses
from nose.tools import (
assert_equal,
assert_is_instance,
assert_is_none,
assert_is_not_none,
assert_not_equal,
assert_raises
)
from gocardless_pro.e... |
ehsangolshani/crazy-hamster | refs/heads/master | .venv/lib/python3.5/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/requests/certs.py | 516 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests.certs
~~~~~~~~~~~~~~
This module returns the preferred default CA certificate bundle.
If you are packaging Requests, e.g., for a Linux distribution or a managed
environment, you can change the definition of where() to return a separately
packaged CA bundle.
... |
duqiao/django | refs/heads/master | tests/m2m_signals/models.py | 448 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Part(models.Model):
name = models.CharField(max_length=20)
class Meta:
ordering = ('name',)
def __str__(self):
return self.name
@python_2_unicode_compatible
cla... |
ehogan/iris | refs/heads/master | lib/iris/tests/experimental/__init__.py | 17 | # (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... |
edallison/oppia | refs/heads/develop | core/storage/email/gae_models_test.py | 1 | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
pczerkas/tempest | refs/heads/master | tempest/services/identity/v3/json/credentials_client.py | 8 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
enthought/etsproxy | refs/heads/master | enthought/traits/ui/wx/list_editor.py | 1 | # proxy module
from traitsui.wx.list_editor import *
|
DR08/mxnet | refs/heads/stable | example/warpctc/lstm_model.py | 28 | # 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... |
sdcooke/django | refs/heads/master | django/contrib/gis/gdal/prototypes/geom.py | 450 | from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal
from django.contrib.gis.gdal.prototypes.errcheck import check_envelope
from django.contrib.gis.gdal.prototypes.generation import (
const_string_... |
Geode/geonode | refs/heads/master | geonode/services/admin.py | 7 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... |
jctanner/ansible | refs/heads/devel | test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/module_utils/subpkg_with_init/mod_in_subpkg_with_init.py | 35 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
def thingtocall():
return "thingtocall in mod_in_subpkg_with_init"
|
IndraVikas/scikit-learn | refs/heads/master | examples/covariance/plot_covariance_estimation.py | 250 | """
=======================================================================
Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood
=======================================================================
When working with covariance estimation, the usual approach is to use
a maximum likelihood estimator,... |
AmrnotAmr/zato | refs/heads/master | code/zato-server/src/zato/server/service/internal/security/wss.py | 6 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
from contextlib import closing
from traceback import format_exc
from uui... |
WiproOpenSourcePractice/bdreappstore | refs/heads/develop | enu/real_time_event_detection/hadoopstream/reducer_test.py | 1 | #!/usr/bin/env python
import sys
import os
os.environ['MPLCONFIGDIR'] = "/tmp/"
import pandas as pd
import numpy as np
import commands
import pickle as p
from sklearn import svm
from sklearn.cross_validation import StratifiedKFold
from sklearn import preprocessing
from sklearn.externals import joblib
current_key = ... |
argriffing/scipy | refs/heads/master | scipy/special/tests/test_gammainc.py | 48 | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.special import gammainc
from scipy.special._testutils import FuncData
def test_line():
# Test on the line a = x where a simpler asymptotic expansion
# (analog of DLMF 8.12.15) is available.
def gammainc_line(x)... |
udrg/crazyflie-clients-python | refs/heads/develop | lib/cfclient/utils/__init__.py | 32 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... |
commonwealth-of-puerto-rico/libre | refs/heads/master | libre/apps/lock_manager/literals.py | 2 | DEFAULT_LOCK_TIMEOUT_VALUE = 30
|
MrHyde03/android_kernel_samsung_espressovzw-jb | refs/heads/jb | scripts/gcc-wrapper.py | 36 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Code Aurora Forum. 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 ... |
cl4rke/scikit-learn | refs/heads/master | doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py | 254 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess wether the opinion of the author is
positive or negative.
In this examples we will use a ... |
labsanmartin/Bika-LIMS | refs/heads/master | bika/lims/upgrade/to3038.py | 3 | from Acquisition import aq_inner
from Acquisition import aq_parent
from Products.CMFCore.utils import getToolByName
def upgrade(tool):
# Hack prevent out-of-date upgrading
# Related: PR #1484
# https://github.com/bikalabs/Bika-LIMS/pull/1484
from bika.lims.upgrade import skip_pre315
if skip_pre315... |
Softmotions/edx-platform | refs/heads/master | openedx/core/djangoapps/user_api/migrations/0001_initial.py | 114 | # -*- 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 model 'UserPreference'
db.create_table('user_api_userpreference', (
('id', self.gf('dja... |
Facetracker-project/facetracker-core | refs/heads/master | lib/youtube-dl/devscripts/gh-pages/update-sites.py | 96 | #!/usr/bin/env python3
from __future__ import unicode_literals
import sys
import os
import textwrap
# We must be able to import youtube_dl
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
import youtube_dl
def main():
with open('supportedsites.html.in', 'r', encodin... |
Aristocles/CouchPotatoServer | refs/heads/master | libs/tornado/platform/asyncio.py | 14 | """Bridges between the `asyncio` module and Tornado IOLoop.
This is a work in progress and interfaces are subject to change.
To test:
python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop
python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOMainLoop
(the tests log a f... |
DataDog/kafka-python | refs/heads/master | kafka/metrics/metrics_reporter.py | 10 | from __future__ import absolute_import
import abc
class AbstractMetricsReporter(object):
"""
An abstract class to allow things to listen as new metrics
are created so they can be reported.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def init(self, metrics):
"""
Th... |
viger/docker | refs/heads/master | proxy/proxy/code/default/gae_proxy/local/direct_handler.py | 3 | #!/usr/bin/env python
# coding:utf-8
import errno
import time
import re
import socket
import ssl
import httplib
import OpenSSL
NetWorkIOError = (socket.error, ssl.SSLError, OpenSSL.SSL.Error, OSError)
from connect_manager import https_manager
from gae_handler import return_fail_message
from google_ip import googl... |
mitsuhiko/django | refs/heads/master | tests/regressiontests/model_fields/imagefield.py | 106 | import os
import shutil
from django.core.files import File
from django.core.files.base import ContentFile
from django.core.files.images import ImageFile
from django.test import TestCase
from models import Image, Person, PersonWithHeight, PersonWithHeightAndWidth, \
PersonDimensionsFirst, PersonTwoImages, Test... |
runt18/nupic | refs/heads/master | tests/swarming/nupic/swarming/experiments/delta/permutations.py | 38 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
gcd0318/django | refs/heads/master | django/db/models/base.py | 61 | from __future__ import unicode_literals
import copy
import inspect
import warnings
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.core import checks
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned,... |
Ted1993/Flasky | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py | 1729 | from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... |
Bismarrck/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/monitored_session.py | 42 | # pylint: disable=g-bad-file-header
# 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/LICENS... |
maisim/django-localflavor | refs/heads/master | tests/test_si.py | 7 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import date
from django.test import SimpleTestCase
from localflavor.si.forms import (SIEMSOField, SIPhoneNumberField, SIPostalCodeField, SIPostalCodeSelect,
SITaxNumberField)
class SILocalFlavorTests(Sim... |
seem-sky/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_grammar.py | 68 | # Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
from test.support import run_unittest, check_syntax_error
import unittest
import sys
# testing import *
from sys import *
class TokenTests(unittest.TestCase):
def test_backslash(self):
# Backslash means line con... |
herilalaina/scikit-learn | refs/heads/master | examples/manifold/plot_mds.py | 88 | """
=========================
Multi-dimensional scaling
=========================
An illustration of the metric and non-metric MDS on generated noisy data.
The reconstructed points using the metric MDS and non metric MDS are slightly
shifted to avoid overlapping.
"""
# Author: Nelle Varoquaux <nelle.varoquaux@gmail.... |
BorgERP/borg-erp-6of3 | refs/heads/master | l10n_hr/l10n_hr_account/__openerp__.py | 1 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr_account
# Author: Goran Kliska
# mail: gkliskaATgmail.com
# Copyright (C) 2011- Slobodni programi d.o.o., Zagreb
# http:/... |
s-t-e-a-l-t-h/Eclipsing-binaries-library | refs/heads/master | objects/Observer.py | 1 | #!/usr/bin/python
# import numpy as np
import pymysql
pymysql.install_as_MySQLdb()
import MySQLdb
import objects.Function as Fn
import numpy as np
# import math as m
import sys
import globe.variables as gv
import os
import objects.Lightcurve as Lc
import objects.Iostream as Io
from objects.Timer import Timer
class ... |
SrNetoChan/Quantum-GIS | refs/heads/master | tests/src/python/test_qgstreewidgetitem.py | 45 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsTreeWidgetItem.
.. 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.
"""... |
wonwon0/StrategyIA | refs/heads/dev | ai/STA/Strategy/StrategyBook.py | 1 | # Under MIT license, see LICENSE.txt
""" Livre des stratégies. """
from typing import List
from ai.STA.Strategy.Strategy import Strategy
from ai.STA.Strategy.indiana_jones import IndianaJones
from ai.STA.Strategy.HumanControl import HumanControl
from ai.STA.Strategy.SimpleDefense import SimpleDefense
from ai.STA.Stra... |
eamontoyaa/pyCSS | refs/heads/master | examples/example02.py | 1 | '''
# Description.
This is a minimal module in order to perform a circular arc slope stability
analysis for the example number 02. #
'''
#-----------------------------------------------------------------------------#
### Add functions directory ###
import sys
sys.path += ['../functions']
#----------------... |
power12317/you-get | refs/heads/develop | src/you_get/util/log.py | 20 | #!/usr/bin/env python
# This file is Python 2 compliant.
from .. import __name__ as library_name
import os, sys
IS_ANSI_TERMINAL = os.getenv('TERM') in (
'eterm-color',
'linux',
'screen',
'vt100',
'xterm')
# ANSI escape code
# See <http://en.wikipedia.org/wiki/ANSI_escape_code>
RESET = 0
BOLD = ... |
arborh/tensorflow | refs/heads/master | tensorflow/python/util/tf_inspect_test.py | 11 | # 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... |
tillahoffmann/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/mvn_full_covariance_test.py | 41 | # 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... |
jsoref/django | refs/heads/master | tests/empty/tests.py | 537 | from django.test import TestCase
from .models import Empty
class EmptyModelTests(TestCase):
def test_empty(self):
m = Empty()
self.assertIsNone(m.id)
m.save()
Empty.objects.create()
self.assertEqual(len(Empty.objects.all()), 2)
self.assertIsNotNone(m.id)
ex... |
MattRijk/django-ecomsite | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py | 3126 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
SOKP/external_chromium_org | refs/heads/sokp-l5.1 | build/android/pylib/device/adb_wrapper.py | 36 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module wraps Android's adb tool.
This is a thin wrapper around the adb interface. Any additional complexity
should be delegated to a higher level (e... |
marcusrehm/serenata-de-amor | refs/heads/master | jarbas/core/migrations/0023_add_last_update_field_to_reimbursements.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-25 19:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0022_remove_unique_together_from_reimbursement'),
]
operations = [
... |
tylert/chirp.hg | refs/heads/master | chirp/drivers/id51.py | 2 | # Copyright 2012 Dan Smith <dsmith@danplanet.com>
#
# 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 ... |
ProfessorX/Config | refs/heads/master | .PyCharm30/system/python_stubs/-1247972723/PyQt4/QtGui/__init__/QAbstractScrollArea.py | 2 | # encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
from QFrame import QFrame
class QAbstractScrollArea(QFrame):
""" QAbstractScrollArea(QWidget parent=None) """
def addScrollBarWidget(sel... |
SINGROUP/pycp2k | refs/heads/master | pycp2k/classes/_configuration1.py | 1 | from pycp2k.inputsection import InputSection
class _configuration1(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Glb_conf = None
self.Sub_conf = None
self.Multiplicity = None
self.Charge = None
self._name = "CONFIGURATION"
self._keyword... |
pschmitt/home-assistant | refs/heads/dev | homeassistant/components/luftdaten/sensor.py | 9 | """Support for Luftdaten sensors."""
import logging
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_LATITUDE,
ATTR_LONGITUDE,
CONF_SHOW_ON_MAP,
)
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity impo... |
asnorkin/sentiment_analysis | refs/heads/master | site/lib/python2.7/site-packages/numpy/core/getlimits.py | 35 | """Machine limits for Float32 and Float64 and (long double) if available...
"""
from __future__ import division, absolute_import, print_function
__all__ = ['finfo', 'iinfo']
from .machar import MachAr
from . import numeric
from . import numerictypes as ntypes
from .numeric import array
def _frz(a):
"""fix rank-... |
MoneyPush/AlgorithmicTradingApiPython | refs/heads/master | setup.py | 2 | from setuptools import setup
setup(name='BigDataTradeAPIPy',
version='0.0.2',
description='BigDataTrade API in python',
url='https://github.com/bigdatatrade/AlgorithmicTradingApiPython',
author='Nacass Tommy',
author_email='tommy.nacass@gmail.com',
license='MIT',
packages=['bi... |
mariomosca/damnvid | refs/heads/master | dLog.py | 12 | # -*- coding: utf-8 -*-
import os, sys
import time
import traceback
from dCore import *
class DamnLog:
def __init__(self, logpath=None, stderr=True, flush=False, handleerrors=True, overrides={}):
DamnLog.instance = self
self.time = 0
self.streams = []
self.autoflush = flush
self.overrides = {}
if logpath ... |
taxpon/sverchok | refs/heads/master | old_nodes/eval_knieval.py | 4 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is distrib... |
webmasteraxe/watchman | refs/heads/master | tests/integration/touch.py | 10 | # Portable simple implementation of `touch`
import os
import sys
import errno
fname = sys.argv[1]
try:
os.utime(fname, None)
except OSError as e:
if e.errno == errno.ENOENT:
with open(fname, 'a'):
os.utime(fname, None)
else:
raise
|
JamesRaynor67/mptcp_with_machine_learning | refs/heads/master | machineLearning/ver_0.10_q-learning/rl_server_ver_0.10(q-table).py | 1 | import socket
import pandas
from time import sleep
from rl_socket import Interacter_socket
from RL_core import QLearningTable
from RL_core import extract_observation
from RL_core import action_translator
from RL_core import calculate_reward
from RL_core import apply_action
from shutil import copyfile
def IsInt(s):
... |
draios/python-sdc-client | refs/heads/master | specs/secure/policy_v1_spec.py | 1 | import json
import os
import random
from expects import expect
from mamba import before, description, after, it
from sdcclient import SdSecureClientV1
from specs import be_successful_api_call
_POLICY_NAME = "Test - Launch Suspicious Network Tool on Host"
_POLICY_DESCRIPTION = "Detect network tools launched on the ho... |
ChromiumWebApps/chromium | refs/heads/master | build/android/adb_logcat_printer.py | 27 | #!/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.
"""Shutdown adb_logcat_monitor and print accumulated logs.
To test, call './adb_logcat_printer.py <base_dir>' where
<base_dir> c... |
foglamp/FogLAMP | refs/heads/develop | python/foglamp/plugins/common/shim/south_shim.py | 1 | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
"""shim layer between Python and C++"""
import os
import importlib.util
import sys
import json
import logging
from foglamp.common import logger
from foglamp.common.common import _FOGLAMP_ROOT
from foglamp.services.core.api.p... |
flacjacket/sympy | refs/heads/master | sympy/mpmath/tests/extratest_zeta.py | 23 | from mpmath import zetazero
from timeit import default_timer as clock
def test_zetazero():
cases = [\
(399999999, 156762524.6750591511),
(241389216, 97490234.2276711795),
(526196239, 202950727.691229534),
(542964976, 209039046.578535272),
(1048449112, 388858885.231056486),
(1048449113, 3888... |
hwheeler01/comp150 | refs/heads/gh-pages | _site/examples/greet.py | 2 | """Simple example with Entry objects.
Enter your name, click the mouse, and see greetings.
"""
from graphics import *
def main():
win = GraphWin("Greeting", 300, 300)
win.yUp()
instructions = Text(Point(win.getWidth()/2, 40),
"Enter your name.\nThen click the mouse.")
instruction... |
Rewardcoin/p2ppool-SGcoin | refs/heads/master | wstools/tests/test_wstools.py | 308 | #!/usr/bin/env python
############################################################################
# Joshua R. Boverhof, David W. Robertson, LBNL
# See LBNLCopyright for copyright notice!
###########################################################################
import unittest, tarfile, os, ConfigParser
import test... |
FrankBian/kuma | refs/heads/master | vendor/packages/sqlalchemy/doc/build/testdocs.py | 7 | import sys
sys.path = ['../../lib', './lib/'] + sys.path
import os
import re
import doctest
import sqlalchemy.util as util
import sqlalchemy.log as salog
import logging
salog.default_enabled=True
rootlogger = logging.getLogger('sqlalchemy')
rootlogger.setLevel(logging.NOTSET)
class MyStream(object):
def write(sel... |
derekjchow/models | refs/heads/master | research/delf/delf/python/feature_aggregation_extractor_test.py | 2 | # Copyright 2019 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 applicab... |
krbaker/Diamond | refs/heads/master | src/collectors/ups/ups.py | 68 | # coding=utf-8
"""
This class collects data from NUT, a UPS interface for linux.
#### Dependencies
* nut/upsc to be installed, configured and running.
"""
import diamond.collector
import os
import subprocess
from diamond.collector import str_to_bool
class UPSCollector(diamond.collector.Collector):
def get_... |
indictranstech/Das_Erpnext | refs/heads/develop | erpnext/hr/doctype/employee/test_employee.py | 59 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe.utils
test_records = frappe.get_test_records('Employee')
class TestEmployee(unittest.TestCase):
def test... |
marissazhou/django | refs/heads/master | tests/utils_tests/test_datastructures.py | 262 | """
Tests for stuff in django.utils.datastructures.
"""
import copy
from django.test import SimpleTestCase
from django.utils import six
from django.utils.datastructures import (
DictWrapper, ImmutableList, MultiValueDict, MultiValueDictKeyError,
OrderedSet,
)
class OrderedSetTests(SimpleTestCase):
def ... |
ojengwa/oh-mainline | refs/heads/master | vendor/packages/python-social-auth/social/strategies/cherrypy_strategy.py | 77 | import six
import cherrypy
from social.strategies.base import BaseStrategy, BaseTemplateStrategy
class CherryPyJinja2TemplateStrategy(BaseTemplateStrategy):
def __init__(self, strategy):
self.strategy = strategy
self.env = cherrypy.tools.jinja2env
def render_template(self, tpl, context):
... |
Jorge-Rodriguez/ansible | refs/heads/devel | lib/ansible/modules/database/mysql/mysql_user.py | 3 | #!/usr/bin/python
# (c) 2012, Mark Theunissen <mark.theunissen@gmail.com>
# Sponsored by Four Kitchens http://fourkitchens.com.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_M... |
after12am/summary | refs/heads/master | summary/digest.py | 1 | # -*- coding: utf-8 -*-
import os, sys
import json
import nltk
import numpy
from pprint import pprint
N = 100 # words num
CLUSTER_THRESHOLD = 5 # distance of words
TOP_SENTENCES = 5 # summurized sentences num
def _score_sentences(sentences, important_words):
scores = []
sentence_idx = -1
for s in [nl... |
deatharrow/lge-kernel-e400 | refs/heads/master | Documentation/target/tcm_mod_builder.py | 4981 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... |
janusnic/dj-21v | refs/heads/master | unit_05/mysite/blog/admin.py | 1 | from django.contrib import admin
from .models import Category, Tag, Article
class CategoryAdmin(admin.ModelAdmin):
list_display = ('name', 'slug')
list_display_links = ('name',)
search_fields = ['name', 'slug', 'description']
prepopulated_fields = {"slug": ("name",)}
admin.site.register(Categor... |
fuhrysteve/flask-security | refs/heads/develop | tests/test_recoverable.py | 4 | # -*- coding: utf-8 -*-
"""
test_recoverable
~~~~~~~~~~~~~~~~
Recoverable functionality tests
"""
import time
import pytest
from flask import Flask
from utils import authenticate, logout
from flask_security.core import UserMixin
from flask_security.forms import LoginForm
from flask_security.signals impo... |
bdoner/SickRage | refs/heads/master | lib/hachoir_parser/file_system/__init__.py | 94 | from hachoir_parser.file_system.ext2 import EXT2_FS
from hachoir_parser.file_system.fat import FAT12, FAT16, FAT32
from hachoir_parser.file_system.mbr import MSDos_HardDrive
from hachoir_parser.file_system.ntfs import NTFS
from hachoir_parser.file_system.iso9660 import ISO9660
from hachoir_parser.file_system.reiser_fs ... |
wvolz/smartplug-monitor | refs/heads/master | multiple.py | 1 | #!/usr/bin/python
# This is the an implementation of monitoring the Lowe's Iris Smart
# Switch that I use. It will join with a switch and does NOT allow you
# to control the switch
#
# This version has been adapted to support more than one switch and will
# add a new record to my database to hold the data. Adapt it... |
uxlsl/blog | refs/heads/master | movie/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-06 13:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Movie',
... |
SmartInfrastructures/fuel-web-dev | refs/heads/master | network_checker/url_access_checker/network.py | 3 | # Copyright 2015 Mirantis, 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 ... |
IronLanguages/ironpython3 | refs/heads/master | Src/StdLib/Lib/test/test_grammar.py | 1 | # Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
from test.support import check_syntax_error
import inspect
import unittest
import sys
# testing import *
from sys import *
class TokenTests(unittest.TestCase):
def test_backslash(self):
# Backslash means line co... |
tobegit3hub/keystone_docker | refs/heads/master | keystone/tests/unit/filtering.py | 10 | # 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
#
# Unless required by applicable law or agreed to in... |
dmerejkowsky/qibuild | refs/heads/master | python/qisys/test/test_ui.py | 1 | ## Copyright (c) 2012-2015 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
""" Just some tests for ui """
import qisys.ui as ui
import pytest
def main():
ui.info(ui.red, "This is a an error message\n",
ui.re... |
minhlongdo/scipy | refs/heads/master | benchmarks/benchmarks/linalg_solve_toeplitz.py | 106 | """Benchmark the solve_toeplitz solver (Levinson recursion)
"""
from __future__ import division, absolute_import, print_function
import numpy as np
try:
import scipy.linalg
except ImportError:
pass
from .common import Benchmark
class SolveToeplitz(Benchmark):
params = (
('float64', 'complex128'... |
jopohl/urh | refs/heads/master | src/urh/simulator/SimulatorCounterAction.py | 1 | import xml.etree.ElementTree as ET
from urh.simulator.SimulatorItem import SimulatorItem
from urh.simulator.SimulatorRule import SimulatorRuleCondition
from urh.util.Formatter import Formatter
class SimulatorCounterAction(SimulatorItem):
def __init__(self):
super().__init__()
self.start = 1
... |
khchine5/lino | refs/heads/master | lino/modlib/weasyprint/__init__.py | 1 | # Copyright 2016-2017 Luc Saffre
# License: BSD (see file COPYING for details)
"""This plugins installs two build methods for generating
:doc:`printable documents </admin/printing>` using `weasyprint
<http://weasyprint.org/>`__.
Applications which use this plugin must also add `'weasyprint'` to
their :ref:`install_re... |
yongshengwang/hue | refs/heads/master | desktop/libs/libopenid/setup.py | 29 | # 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 (the
# "License"); you may not use this file ex... |
abadger/ansible | refs/heads/devel | test/integration/targets/collections/collection_root_sys/ansible_collections/testns/testcoll/plugins/modules/maskedmodule.py | 66 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
def main():
print(json.dumps(dict(changed=False, failed=True, msg='this collection should be masked by testcoll in the user content root')))
if __name__ == '__main__':
main()
|
ionutbalutoiu/ironic | refs/heads/master | ironic/common/context.py | 11 | # -*- encoding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.