repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ARCCN/elt | refs/heads/master | server/utility/start_db_server.py | 1 | from ext.debugger.elt.database import DatabaseServer
import time
server = DatabaseServer()
while not server.closed:
time.sleep(0.1)
|
SivilTaram/edx-platform | refs/heads/master | cms/djangoapps/contentstore/tests/test_libraries.py | 82 | """
Content library unit tests that require the CMS runtime.
"""
from django.test.utils import override_settings
from contentstore.tests.utils import AjaxEnabledTestClient, parse_json
from contentstore.utils import reverse_url, reverse_usage_url, reverse_library_url
from contentstore.views.item import _duplicate_item
f... |
jmartinm/inspire-next | refs/heads/master | inspire/modules/citations/config.py | 2 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014, 2015 CERN.
#
# INSPIRE 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... |
pandaforks/tido-rainbow | refs/heads/master | src/.ycm_extra_conf.py | 1 | import os
project_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
cxx_flags = [
"-std=c++11",
"-Werror",
"-pedantic",
"-Wall",
"-Wextra",
"-Weffc++",
"-Wold-style-cast",
"-Woverloaded-virtual",
"-Wsign-promo",
"-I" + os.path.join(project_path, "src"),
"-I" + os.path.join(pro... |
darshanthaker/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/matplotlib/collections.py | 69 | """
Classes for the efficient drawing of large collections of objects that
share most properties, e.g. a large number of line segments or
polygons.
The classes are not meant to be as flexible as their single element
counterparts (e.g. you may not be able to select all line styles) but
they are meant to be fast for com... |
alsrgv/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/sparse_serialization_ops_test.py | 35 | # 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... |
ABaldwinHunter/django-clone-classic | refs/heads/master | tests/check_framework/test_model_field_deprecation.py | 322 | from django.core import checks
from django.db import models
from django.test import SimpleTestCase
from .tests import IsolateModelsMixin
class TestDeprecatedField(IsolateModelsMixin, SimpleTestCase):
def test_default_details(self):
class MyField(models.Field):
system_check_deprecated_details ... |
tarzan0820/odoo | refs/heads/8.0 | addons/lunch/wizard/lunch_order.py | 440 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
mozman/ezdxf | refs/heads/master | src/ezdxf/entities/subentity.py | 1 | # Copyright (c) 2020, Manfred Moitzi
# License: MIT License
from typing import TYPE_CHECKING, Iterable, Callable, List, Optional
from ezdxf.entities import factory, DXFGraphic, SeqEnd, DXFEntity
from ezdxf.lldxf import const
if TYPE_CHECKING:
from ezdxf.eztypes import DXFEntity, EntityDB, Drawing
__all__ = ['ent... |
caiocsalvador/whats_the_craic | refs/heads/master | lib/python3.4/site-packages/pip/_vendor/cachecontrol/adapter.py | 469 | import functools
from pip._vendor.requests.adapters import HTTPAdapter
from .controller import CacheController
from .cache import DictCache
from .filewrapper import CallbackFileWrapper
class CacheControlAdapter(HTTPAdapter):
invalidating_methods = set(['PUT', 'DELETE'])
def __init__(self, cache=None,
... |
tlatzko/spmcluster | refs/heads/master | .tox/clean/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py | 469 | import functools
from pip._vendor.requests.adapters import HTTPAdapter
from .controller import CacheController
from .cache import DictCache
from .filewrapper import CallbackFileWrapper
class CacheControlAdapter(HTTPAdapter):
invalidating_methods = set(['PUT', 'DELETE'])
def __init__(self, cache=None,
... |
westinedu/wrgroups | refs/heads/master | django/template/loaders/app_directories.py | 229 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.u... |
Forrestburgundy/Pi-Mission-Control | refs/heads/master | screens/trains/nationalrail.py | 4 | """This script demonstrates how to use BeautifulSoup to retrieve information
from a website and turn it into a structure that can then be used by other
python codes.
Please note, scraping data from the National Rail website is against their
terms and conditions. As such, this code should not be incorporated into any
p... |
savi-dev/horizon | refs/heads/master | horizon/dashboards/syspanel/services/tables.py | 6 | import logging
from django import template
from django.utils.translation import ugettext_lazy as _
from horizon import tables
LOG = logging.getLogger(__name__)
class ServiceFilterAction(tables.FilterAction):
def filter(self, table, services, filter_string):
q = filter_string.lower()
def comp(... |
javaos74/neutron | refs/heads/master | neutron/agent/linux/keepalived.py | 15 | # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
indykish/servo | refs/heads/master | tests/wpt/web-platform-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... |
jjmleiro/hue | refs/heads/master | desktop/core/ext-py/pyasn1-0.1.8/pyasn1/codec/cer/decoder.py | 261 | # CER decoder
from pyasn1.type import univ
from pyasn1.codec.ber import decoder
from pyasn1.compat.octets import oct2int
from pyasn1 import error
class BooleanDecoder(decoder.AbstractSimpleDecoder):
protoComponent = univ.Boolean(0)
def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, length,
... |
loveson821/UMS | refs/heads/master | UMS/UMS/urls.py | 1 | from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from djrill import DjrillAdminSite
admin.site = DjrillAdmin... |
squadran2003/PYTHON-DIRECTORY-WATCHER | refs/heads/master | lib/python3.5/site-packages/pip/_vendor/lockfile/__init__.py | 475 | """
lockfile.py - Platform-independent advisory file locks.
Requires Python 2.5 unless you apply 2.4.diff
Locking is done on a per-thread basis instead of a per-process basis.
Usage:
>>> lock = LockFile('somefile')
>>> try:
... lock.acquire()
... except AlreadyLocked:
... print 'somefile', 'is locked already... |
justjake/ear | refs/heads/master | ear/g2p.py | 1 | import os
import subprocess
import re
from config import data_path, tmp_path, G014B2B_FST
TEMP_FILENAME = tmp_path('g2ptemp')
PHONE_MATCH = re.compile(r'<s> (.*) </s>')
def parseLine(line):
return PHONE_MATCH.search(line).group(1)
def parseOutput(output):
return PHONE_MATCH.findall(output)
def translat... |
colbypalmer/cp-blog | refs/heads/master | blog/forms.py | 1 | from django import forms
from models import BlogEntry
from epiceditor.widgets import AdminEpicEditorWidget
class BlogEntryAdminForm(forms.ModelForm):
body_markdown = forms.CharField(
widget=AdminEpicEditorWidget(themes={'editor': 'epic-light.css', 'preview': 'github.css'}))
class Meta:
model ... |
bobisme/odoo | refs/heads/sp-8.0 | addons/web_kanban_gauge/__openerp__.py | 428 | {
'name': 'Gauge Widget for Kanban',
'category': 'Hidden',
'description': """
This widget allows to display gauges using justgage library.
""",
'version': '1.0',
'depends': ['web_kanban'],
'data' : [
'views/web_kanban_gauge.xml',
],
'qweb': [
],
'auto_install': True,
}
|
marcelomiky/PythonCodes | refs/heads/master | Intro ML Semcomp/semcomp17_ml/venv/lib/python3.5/site-packages/pip/vcs/git.py | 340 | from __future__ import absolute_import
import logging
import tempfile
import os.path
from pip.compat import samefile
from pip.exceptions import BadCommand
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
from pip._vendor.packaging.versio... |
NaturalGIS/naturalgis_qgis | refs/heads/master | python/plugins/processing/algs/gdal/polygonize.py | 16 | # -*- coding: utf-8 -*-
"""
***************************************************************************
polygonize.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************************... |
zkraime/osf.io | refs/heads/develop | scripts/migrate_was_invited.py | 5 | #!/usr/bin/env python
# encoding: utf-8
import sys
import logging
from modularodm import Q
from website import models
from website.app import init_app
from scripts import utils as scripts_utils
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def is_invited(user):
query = (
... |
patsissons/Flexget | refs/heads/develop | flexget/plugins/filter/crossmatch.py | 24 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('crossmatch')
class CrossMatch(object):
"""
Perform action based on item on current task and other inputs.
Example::
crossmatch:
... |
laxdog/poloniexlendingbot | refs/heads/master | modules/Configuration.py | 1 | # coding=utf-8
from ConfigParser import SafeConfigParser
import json
from decimal import Decimal
config = SafeConfigParser()
Data = None
FULL_LIST = ['STR', 'BTC', 'BTS', 'CLAM', 'DOGE', 'DASH', 'LTC', 'MAID', 'XMR', 'XRP', 'ETH', 'FCT']
# This module is the middleman between the bot and a SafeConfigParser object, so ... |
lee-b/katchtv | refs/heads/master | code/thirdparty/ptvbittorrent/spewout.py | 11 |
# This file created for Debian because btdownloadcurses can't
# find btdownloadheadless because we rename it.
def print_spew(spew):
s = StringIO()
s.write('\n\n\n')
for c in spew:
s.write('%20s ' % c['ip'])
if c['initiation'] == 'local':
s.write('l')
else:
... |
tersmitten/ansible | refs/heads/devel | test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/modules/ping.py | 18 | #!/usr/bin/env python
import json
def main():
print(json.dumps(dict(changed=False, source='user')))
if __name__ == '__main__':
main()
|
Br3nda/libfitbit | refs/heads/master | python/fitbit.py | 1 | #!/usr/bin/env python
#################################################################
# python fitbit object
# By Kyle Machulis <kyle@nonpolynomial.com>
# http://www.nonpolynomial.com
#
# Distributed as part of the libfitbit project
#
# Repo: http://www.github.com/qdot/libfitbit
#
# Licensed under the BSD License, as... |
adamtiger/tensorflow | refs/heads/master | tensorflow/contrib/training/python/training/bucket_ops_test.py | 73 | # 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... |
lakshmi-kannan/st2 | refs/heads/master | contrib/runners/local_runner/local_runner.py | 3 | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... |
jamslevy/gsoc | refs/heads/master | app/soc/logic/mail_dispatcher.py | 1 | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange 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... |
supersven/intellij-community | refs/heads/master | python/testData/mover/multiLineSelection1_afterDown.py | 166 | class Test(object):
def q(self):
c = 3
<selection> a = 1
b = 2
<caret></selection> |
lesina/labs2016 | refs/heads/master | contests_1sem/5/C.py | 1 | time, day = input().split(" ")
time = time.split(":")
if day[0] == "p":
if time[0] == "12":
print(int(time[0]), ":", time[1], sep = "")
else:
print(int(time[0])+12, ":", time[1], sep = "")
else:
if time[0] == "12":
print("0", int(time[0])-12, ":", time[1], sep = "")
elif (len(time[0]) == 1):
print("0", int(... |
brian-l/django-1.4.10 | refs/heads/master | django/contrib/gis/tests/geoapp/feeds.py | 308 | from __future__ import absolute_import
from django.contrib.gis import feeds
from .models import City
class TestGeoRSS1(feeds.Feed):
link = '/city/'
title = 'Test GeoDjango Cities'
def items(self):
return City.objects.all()
def item_link(self, item):
return '/city/%s/' % item.pk
... |
wkcn/mobula | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
setup(
name = 'mobula',
version = '1.0.1',
description = 'A Lightweight & Flexible Deep Learning (Neural Network) Framework in Python',
author = 'wkcn',
author_email = 'wkcn@live.cn',
url = 'https://github.com/wkcn/mobula',
... |
briancappello/flask-react-spa | refs/heads/master | tests/security/views/test_logout.py | 1 | import pytest
from flask import url_for
from flask_security import current_user, AnonymousUser
@pytest.mark.usefixtures('user')
class TestLogout:
def test_html_logout(self, client):
client.login_user()
r = client.get(url_for('security.logout'))
assert r.status_code == 302
assert r.... |
tebwa/codejam-commandline | refs/heads/master | lib/multipart_data.py | 20 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright 2011 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 re... |
shakamunyi/ansible | refs/heads/devel | lib/ansible/inventory/dir.py | 73 | # (c) 2013, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2014, Serge van Ginderachter <serge@vanginderachter.be>
#
# 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, ... |
magopian/olympia | refs/heads/master | apps/users/admin.py | 13 | from django.contrib import admin, messages
from django.db.utils import IntegrityError
from django.shortcuts import render
from access.admin import GroupUserInline
from .models import UserProfile, BlacklistedName, BlacklistedEmailDomain
from . import forms
class UserAdmin(admin.ModelAdmin):
list_display = ('__uni... |
bertucho/epic-movie-quotes-quiz | refs/heads/master | dialogos/build/scrapy/build/lib/scrapy/downloadermiddlewares/httpcache.py | 11 | from email.utils import formatdate
from scrapy import signals
from scrapy.exceptions import NotConfigured, IgnoreRequest
from scrapy.utils.misc import load_object
class HttpCacheMiddleware(object):
def __init__(self, settings, stats):
if not settings.getbool('HTTPCACHE_ENABLED'):
raise NotCon... |
drxaero/calibre | refs/heads/master | src/calibre/gui2/tweak_book/editor/image.py | 10 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import sys
from functools import partial
from PyQt5.Qt import (
QMainWi... |
aboganas/frappe | refs/heads/develop | frappe/patches/v6_2/rename_backup_manager.py | 44 | import frappe
def execute():
unset = False
frappe.reload_doc("integrations", "doctype", "dropbox_backup")
dropbox_backup = frappe.get_doc("Dropbox Backup", "Dropbox Backup")
for df in dropbox_backup.meta.fields:
value = frappe.db.get_single_value("Backup Manager", df.fieldname)
if value:
if df.fieldname=="... |
DaveBackus/Data_Bootcamp | refs/heads/master | website/publish_site.py | 1 | #! /usr/bin/env python
#
# This file is part of the ghp-import package released under
# the Tumbolia Public License. See the LICENSE file for more
# information.
import errno
import optparse as op
import os
import subprocess as sp
import sys
import time
import unicodedata
__usage__ = "%prog [OPTIONS] DIRECTORY"
if ... |
AccelAI/accel.ai | refs/heads/master | flask-aws/lib/python2.7/site-packages/docutils/writers/manpage.py | 113 | # -*- coding: utf-8 -*-
# $Id: manpage.py 7628 2013-03-09 10:19:35Z grubert $
# Author: Engelbert Gruber <grubert@users.sourceforge.net>
# Copyright: This module is put into the public domain.
"""
Simple man page writer for reStructuredText.
Man pages (short for "manual pages") contain system documentation on unix-li... |
WillieMaddox/scipy | refs/heads/master | scipy/sparse/linalg/isolve/tests/test_lsmr.py | 72 | """
Copyright (C) 2010 David Fong and Michael Saunders
Distributed under the same license as Scipy
Testing Code for LSMR.
03 Jun 2010: First version release with lsmr.py
David Chin-lung Fong clfong@stanford.edu
Institute for Computational and Mathematical Engineering
Stanford University
Michael Saunders ... |
dchilds7/Deysha-Star-Formation | refs/heads/master | examples/tutorial/visuals/T05_viewer_location.py | 17 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... |
seanwestfall/django | refs/heads/master | django/core/handlers/base.py | 234 | from __future__ import unicode_literals
import logging
import sys
import types
import warnings
from django import http
from django.conf import settings
from django.core import signals, urlresolvers
from django.core.exceptions import (
MiddlewareNotUsed, PermissionDenied, SuspiciousOperation,
)
from django.db impo... |
fedorpatlin/ansible | refs/heads/devel | lib/ansible/modules/system/aix_inittab.py | 26 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Joris Weijters <joris.weijters@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... |
mdjurfeldt/nest-simulator | refs/heads/master | pynest/nest/tests/test_sp/test_all.py | 5 | # -*- coding: utf-8 -*-
#
# test_all.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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
# ... |
rakshify/News_Recommender | refs/heads/master | policy/linUCB.py | 2 | """
linUCB.py
Janbaanz Launde
Apr 2, 2017
"""
from policy import Policy
from math import sqrt
import numpy as np
class LinUCB(Policy):
"""
LinUCB, as per Li, Chu, Langford, Schapire 2012
"""
def __init__(self, contexts, alpha=.01):
super(LinUCB, self).__init__(contexts)
self.name = 'Li... |
t11e/django | refs/heads/master | tests/regressiontests/context_processors/models.py | 431 | # Models file for tests to run.
|
redreamality/thefuck | refs/heads/master | tests/rules/test_git_add.py | 16 | import pytest
from thefuck.rules.git_add import match, get_new_command
from tests.utils import Command
@pytest.fixture
def did_not_match(target, did_you_forget=True):
error = ("error: pathspec '{}' did not match any "
"file(s) known to git.".format(target))
if did_you_forget:
error = ("{}... |
vileopratama/vitech | refs/heads/master | src/addons/sale_expense/tests/test_sale_expense.py | 42 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.addons.sale.tests.test_sale_common import TestSale
class TestSaleExpense(TestSale):
def test_sale_expense(self):
""" Test the behaviour of sales orders when managing expenses """
# creat... |
openstack/manila | refs/heads/master | manila/scheduler/drivers/base.py | 1 | # Copyright (c) 2010 OpenStack, LLC.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wit... |
hustlzp/eve | refs/heads/develop | eve/tests/test_settings.py | 8 | # -*- coding: utf-8 -*-
import copy
MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_USERNAME = MONGO1_USERNAME = 'test_user'
MONGO_PASSWORD = MONGO1_PASSWORD = 'test_pw'
MONGO_DBNAME, MONGO1_DBNAME = 'eve_test', 'eve_test1'
ID_FIELD = '_id'
RESOURCE_METHODS = ['GET', 'POST', 'DELETE']
ITEM_METHODS = ['GET', 'PATCH... |
colinnewell/odoo | refs/heads/8.0 | addons/account/report/account_financial_report.py | 380 | ##############################################################################
#
# 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 Affero General Public L... |
hlange/LogSoCR | refs/heads/master | .waf/waflib/Build.py | 1 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2016 (ita)
"""
Classes related to the build phase (build, clean, install, step, etc)
The inheritance tree is the following:
"""
import os, sys, errno, re, shutil, stat
try:
import cPickle
except ImportError:
import pickle as cPickle
from waflib import No... |
ptkool/spark | refs/heads/master | examples/src/main/python/ml/random_forest_classifier_example.py | 122 | #
# 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... |
crosswalk-project/chromium-crosswalk-efl | refs/heads/efl/crosswalk-10/39.0.2171.19 | tools/telemetry/telemetry/core/platform/power_monitor/__init__.py | 69 | # 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.
from telemetry.core import exceptions
class PowerMonitor(object):
"""A power profiler.
Provides an interface to register power consumption during a te... |
BerkeleyAutomation/rlpy | refs/heads/master | examples/cartpole_orig/kifdd_triangle.py | 4 | """
Cart-pole balancing with continuous / Kernelized iFDD
"""
from rlpy.Domains.FiniteTrackCartPole import FiniteCartPoleBalanceOriginal, FiniteCartPoleBalanceModern
from rlpy.Agents import SARSA, Q_LEARNING
from rlpy.Representations import *
from rlpy.Policies import eGreedy
from rlpy.Experiments import Experiment
imp... |
slightlymadphoenix/activityPointsApp | refs/heads/master | activitypoints/lib/python3.5/site-packages/django/contrib/admin/sites.py | 45 | from functools import update_wrapper
from weakref import WeakSet
from django.apps import apps
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured
from django.db.models.base import ModelBase
from django.http imp... |
phihag/adhocracy | refs/heads/develop | src/adhocracy/migration/versions/052_unique_email.py | 4 | from migrate.changeset.constraint import UniqueConstraint
from datetime import datetime
from sqlalchemy import MetaData
from sqlalchemy import Column, ForeignKey, Table
from sqlalchemy import Boolean, DateTime, Integer, Unicode, String, UnicodeText
metadata = MetaData()
user_table = Table('user', metadata,
Colu... |
WSID/crank-system | refs/heads/master | tests/python/base/test_advgraph.py | 1 | #!/usr/bin/python
# Copyright (C) 2015, WSID
# 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, publ... |
jcoady9/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/multiprocessing/pool.py | 45 | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# 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. Redist... |
sergeneren/anima | refs/heads/master | anima/env/mayaEnv/vertigo.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2012-2015, Anima Istanbul
#
# This module is part of anima-tools and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
"""Sets up a vertigo setup in the camera
"""
import pymel.core as pm
vertigo_attr_name = "vertigo_loc"
vertigo_global_att... |
CLOUGH/info3180-project-3 | refs/heads/master | lib/werkzeug/contrib/fixers.py | 464 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.fixers
~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module includes various helpers that fix bugs in web servers. They may
be necessary for some versions of a buggy web server but not others. We try
to stay updated with the status of the bug... |
dbentley/pants | refs/heads/master | src/python/pants/build_graph/build_file_parser.py | 10 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... |
tuxxi/OpenBurn | refs/heads/master | openburn/core/grain.py | 1 | from abc import abstractmethod
from math import pi
from openburn.core.propellant import OpenBurnPropellant
from openburn.object import OpenBurnObject
class OpenBurnGrain(OpenBurnObject):
"""Base class of all propellant segments.
The segment is cylindrical with a 2D port shape extruded through the entire leng... |
thomas-schmid-ubnt/avocado | refs/heads/master | avocado/core/varianter.py | 1 | # 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 distributed in the hope that it will be useful,
# bu... |
gvalentine/pyqtgraph | refs/heads/develop | pyqtgraph/graphicsItems/LinearRegionItem.py | 38 | from ..Qt import QtGui, QtCore
from .UIGraphicsItem import UIGraphicsItem
from .InfiniteLine import InfiniteLine
from .. import functions as fn
from .. import debug as debug
__all__ = ['LinearRegionItem']
class LinearRegionItem(UIGraphicsItem):
"""
**Bases:** :class:`UIGraphicsItem <pyqtgraph.UIGraphicsItem>`... |
CyanogenMod/android_kernel_google_msm | refs/heads/cm-14.1 | tools/perf/python/twatch.py | 7370 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
CJ-Wright/pyIID | refs/heads/master | pyiid/tests/test_sim/__init__.py | 20 | __author__ = 'christopher'
|
CI-WATER/django-tethys_compute | refs/heads/master | tethys_compute/apps.py | 1 | from django.apps import AppConfig
class TethysComputeConfig(AppConfig):
name = 'tethys_compute'
verbose_name = 'Tethys Compute'
|
NeCTAR-RC/horizon | refs/heads/nectar/stein | openstack_dashboard/dashboards/project/backups/forms.py | 2 | # 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, software
# distributed under t... |
ZhangXinNan/tensorflow | refs/heads/master | tensorflow/contrib/sparsemax/python/ops/sparsemax_loss.py | 22 | # 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... |
urwen/urscrape | refs/heads/master | csm.py | 1 | import os
import sys
import re
import html
import html2text
from urscrape import urscrape
class Scraper(urscrape.UrScrape):
def __init__(self, debug=False, verbose=False):
urscrape.UrScrape.__init__(self, debug=debug, verbose=verbose)
self.cachedir = '/db/csm'
self.refetch_seconds = 7 * 24 ... |
jmschrei/scikit-learn | refs/heads/master | sklearn/feature_selection/univariate_selection.py | 19 | """Univariate features selection."""
# Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay.
# L. Buitinck, A. Joly
# License: BSD 3 clause
import numpy as np
import warnings
from scipy import special, stats
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..prepr... |
osantana/wsgitest | refs/heads/master | tests/test_server.py | 1 | # coding: utf-8
from unittest import TestCase
try:
from urllib.parse import urljoin
except ImportError:
# noinspection PyUnresolvedReferences
from urlparse import urljoin
import requests
from requests import ConnectionError
from werkzeug.wrappers import Request, Response
from wsgitest import WSGITest... |
florian-dacosta/OpenUpgrade | refs/heads/master | addons/account_sequence/account_sequence.py | 39 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
germs-lab/RefSoil | refs/heads/master | get_refsoil_16s/check_duplicated_16s.py | 2 | #!/usr/bin/python
#usage: python check_duplicated_16s.py RefSoil_v1_chromosome.txt merged16s.fa
import sys
# read chromosome list
chdic = {}
rlist = open(sys.argv[1])
for line in rlist:
splt = line.strip().split(',')
if (len(splt)==1):
chdic[splt[0]]="null"
else:
temp = ""
for i in... |
lecaoquochung/ddnb.django | refs/heads/master | django/contrib/gis/tests/geoapp/models.py | 75 | from django.contrib.gis.db import models
from django.contrib.gis.tests.utils import mysql, spatialite
from django.utils.encoding import python_2_unicode_compatible
# MySQL spatial indices can't handle NULL geometries.
null_flag = not mysql
@python_2_unicode_compatible
class NamedModel(models.Model):
name = model... |
eteq/bokeh | refs/heads/master | sphinx/source/docs/tutorials/exercises/image.py | 23 | from __future__ import division
import numpy as np
from bokeh.plotting import figure, output_file, show, VBox
# NOTE: if you do have numba installed, uncomment out this import,
# and the 'autojit' lines below (the example will run more quickly).
#from numba import autojit
# These functions generate the Mandelbrot s... |
BT-jmichaud/bank-statement-reconcile | refs/heads/8.0 | __unported__/account_statement_transactionid_import/__openerp__.py | 14 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joel Grand-Guillaume
# Copyright 2011-2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... |
callumhogsden/ausbot | refs/heads/master | plugins/gcalc.py | 24 | from util import hook, http
@hook.command
def calc(inp):
'''.calc <term> -- returns Google Calculator result'''
h = http.get_html('http://www.google.com/search', q=inp)
m = h.xpath('//h2[@class="r"]/text()')
if not m:
return "could not calculate " + inp
res = ' '.join(m[0].split())
... |
hippke/communication | refs/heads/master | part2_figure_2_distance_a.py | 1 | import numpy
import matplotlib.patches as patches
from scipy.optimize import minimize
from astropy.constants import c, G, M_sun, R_sun, au
from matplotlib import pyplot as plt
def d_critical(frequency):
"""Returns focal distance as function of frequency [GHz],
for gravity + plasma"""
def distance_min(... |
pforret/python-for-android | refs/heads/master | python-build/python-libs/gdata/build/lib/gdata/analytics/__init__.py | 261 | #!/usr/bin/python
#
# Original Copyright (C) 2006 Google Inc.
# Refactored in 2009 to work for Google Analytics by Sal Uryasev at Juice 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
#
... |
pplatek/odoo | refs/heads/8.0 | addons/base_gengo/__init__.py | 377 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Openerp sa (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
geekboxzone/lollipop_external_chromium_org_tools_grit | refs/heads/geekbox | grit/gather/igoogle_strings_unittest.py | 60 | #!/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.
'''Unit tests for grit.gather.igoogle_strings'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os... |
tarunbhardwaj/nereid-cms | refs/heads/master | tests/test_cms.py | 2 | # -*- coding: utf-8 -*-
'''
nereid_cms test_cms
'''
import unittest
import trytond.tests.test_tryton
from trytond.tests.test_tryton import POOL, USER, DB_NAME, CONTEXT, \
test_view, test_depends
from nereid.testing import NereidTestCase
from trytond.transaction import Transaction
class TestCMS(NereidTestC... |
carlos-ferras/Sequence-ToolKit | refs/heads/master | controller/genrep/dialogs/association_colors.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from PyQt5 import QtWidgets, QtGui, QtCore
from functools import partial
from controller.dialogs.colors import Colors
class AssociationColors(Colors):
show_error_message = QtCore.pyqtSignal(str)
def __init__(self, paren... |
stefanfoulis/django-cms | refs/heads/develop | cms/south_migrations/0007_apphook_longer.py | 1680 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... |
jimbojr/linux | refs/heads/rpi-4.4.y | tools/perf/scripts/python/call-graph-from-postgresql.py | 758 | #!/usr/bin/python2
# call-graph-from-postgresql.py: create call-graph from postgresql database
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free So... |
DoubleNegativeVisualEffects/gaffer | refs/heads/master | python/GafferTest/BoxPlugTest.py | 4 | ##########################################################################
#
# Copyright (c) 2013, 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:
#
# * Red... |
aliyun/aliyun-oss-python-sdk | refs/heads/master | tests/test_crypto_multipart.py | 1 | # -*- coding: utf-8 -*-
from .common import *
import oss2
from oss2 import models
class TestCryptoMultipart(OssTestCase):
def test_crypto_init_multipart_with_out_data_size(self):
crypto_bucket = random.choice([self.rsa_crypto_bucket, self.kms_crypto_bucket])
key = self.random_key()
# upl... |
KarlTDebiec/westpa | refs/heads/master | src/westext/wess/ProbAdjust.py | 4 | # Copyright (C) 2013 Joshua L. Adelman
#
# This file is part of WESTPA.
#
# WESTPA 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.
#
# ... |
alcarney/camel | refs/heads/master | core/models.py | 1 | # -*- coding: utf-8 -*-
from django.db import models
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from mptt.models import MPTTModel, TreeForeignKey
# these should be moved to settings.py
ACADEMIC_YEARS = (
('2014-15', '2014-15'),
('2015-16', '2015-16'),
('2016-1... |
lucafavatella/intellij-community | refs/heads/cli-wip | python/testData/codeInsight/controlflow/augassignment.py | 83 | aaa = 123
aaa += bbb * ccc |
odicraig/kodi2odi | refs/heads/master | addons/plugin.video.cartoons8/requests/packages/chardet/sjisprober.py | 1776 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.