repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
atvcaptain/enigma2 | refs/heads/6.5 | lib/python/Components/Converter/VfdDisplay.py | 1 | from __future__ import absolute_import
from datetime import datetime
from Components.Converter.Poll import Poll
from Components.Converter.Converter import Converter
from Components.Element import cached
class VfdDisplay(Poll, Converter, object):
def __init__(self, type):
Converter.__init__(self, type)
Poll.__in... |
mm1ke/portage | refs/heads/master | pym/portage/util/_async/PipeReaderBlockingIO.py | 12 | # Copyright 2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
try:
import threading
except ImportError:
# dummy_threading will not suffice
threading = None
from portage import os
from _emerge.AbstractPollTask import AbstractPollTask
class PipeReaderBlockingIO(AbstractPollTa... |
proxysh/Safejumper-for-Desktop | refs/heads/master | buildlinux/env64/lib/python2.7/site-packages/twisted/trial/test/detests.py | 16 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for Deferred handling by L{twisted.trial.unittest.TestCase}.
"""
from __future__ import division, absolute_import
from twisted.trial import unittest
from twisted.internet import defer, threads, reactor
from twisted.trial.util import su... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Source/Python/Lib/python27/test/test_shlex.py | 180 | # -*- coding: iso-8859-1 -*-
import unittest
import shlex
from test import test_support
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
# The original test data set was from shellwords, by Hartmut Goebel.
data = r"""x|x|
foo bar|foo|bar|
foo bar|foo|bar|
foo bar |foo... |
andrewguy9/safeoutput | refs/heads/master | safeoutput/__init__.py | 1 | import argparse
import logging
import sys
from builtins import object
from os import rename
from os.path import abspath, dirname
from tempfile import NamedTemporaryFile
LOG = logging.getLogger(__name__)
def open(dst=None, mode="w"):
if dst:
fd = NamedTemporaryFile(dir=dirname(abspath(dst)), mode=mode)
... |
qedi-r/home-assistant | refs/heads/dev | tests/components/smartthings/test_switch.py | 5 | """
Test for the SmartThings switch platform.
The only mocking required is of the underlying SmartThings API object so
real HTTP calls are not initiated during testing.
"""
from pysmartthings import Attribute, Capability
from homeassistant.components.smartthings import switch
from homeassistant.components.smartthings... |
EmadMokhtar/Django | refs/heads/master | tests/select_related/tests.py | 67 | from django.core.exceptions import FieldError
from django.test import SimpleTestCase, TestCase
from .models import (
Bookmark, Domain, Family, Genus, HybridSpecies, Kingdom, Klass, Order,
Phylum, Pizza, Species, TaggedItem,
)
class SelectRelatedTests(TestCase):
@classmethod
def create_tree(cls, stri... |
RMKD/networkx | refs/heads/master | networkx/algorithms/centrality/tests/test_degree_centrality.py | 101 | """
Unit tests for degree centrality.
"""
from nose.tools import *
import networkx as nx
class TestDegreeCentrality:
def __init__(self):
self.K = nx.krackhardt_kite_graph()
self.P3 = nx.path_graph(3)
self.K5 = nx.complete_graph(5)
F = nx.Graph() # Florentine families
... |
dgladkov/django | refs/heads/master | tests/logging_tests/logconfig.py | 609 | import logging
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
class MyHandler(logging.Handler):
def __init__(self):
logging.Handler.__init__(self)
self.config = settings.LOGGING
class MyEmailBackend(BaseEmailBackend):
def send_messages(self, ema... |
evanma92/routeh | refs/heads/master | flask/lib/python2.7/site-packages/whoosh/util/text.py | 96 | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... |
XueqingLin/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/dataframe/transforms/boolean_mask.py | 10 | # 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... |
nickgashkov/virtualspace | refs/heads/dev | virtualspace/utils/models/__init__.py | 13 | # Copyright (c) 2017 Nick Gashkov
#
# Distributed under MIT License. See LICENSE file for details.
|
googleapis/python-redis | refs/heads/master | tests/unit/gapic/redis_v1beta1/test_cloud_redis.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
sangwook236/SWDT | refs/heads/master | sw_dev/python/ext/test/database/leveldb_main.py | 1 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import json
import numpy as np
#import caffe
import leveldb
def write_to_db_example(use_caffe_datum=False):
N = 1000
X = np.zeros((N, 3, 32, 32), dtype=np.uint8)
y = np.zeros(N, dtype=np.int64)
leveldb_dir_path = './myleveldb'
db = leveldb.LevelDB(leveldb_dir_path, ... |
viswimmer1/PythonGenerator | refs/heads/master | data/python_files/29981338/image.py | 1 | import subprocess as sp
import os
import logging
import time
import glob
from lowleveltools import *
from inject import inject as injectIntoRootDisk
_logger = logging.getLogger('image')
def createDiskImages(vg, id, rootSize, swapSize, dataSize, source):
try:
t0 = time.time()
rootDisk = '{0}_roo... |
mattvonrocketstein/smash | refs/heads/master | smashlib/ipy3x/utils/tokenutil.py | 1 | """Token-related utilities"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import, print_function
from collections import namedtuple
from io import StringIO
from keyword import iskeyword
from . import tokenize2
from .py3compat i... |
apophys/freeipa | refs/heads/master | ipaserver/dnssec/keysyncer.py | 1 | #
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
import logging
import ldap.dn
import os
import dns.name
from ipaplatform.paths import paths
from ipapython import ipautil
from ipaserver.dnssec.syncrepl import SyncReplConsumer
from ipaserver.dnssec.odsmgr import ODSMgr
from ipaserver.dnssec.bi... |
palmerjh/iEBE | refs/heads/master | PlayGround/job-2/iSS/for_paraview/lib152/StructuredPoints.py | 9 | #!/usr/bin/env python
"""
Copyright 2001 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the LGPL. See http://www.fsf.org
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Revision: 1.1 $
$Date:... |
liukaijv/XlsxWriter | refs/heads/master | xlsxwriter/test/comparison/test_format11.py | 8 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
jwren/intellij-community | refs/heads/master | python/testData/formatter/wrapTuple.py | 87 | abracadabra, abracadabra, abracadabra, abracadabra, abracadabra, abracadabra, abracadabra, abracadabra, abracadabra, abracadabra, abracadabra, abracadabra, abracadabra, abracadabra = [] |
wikimedia/integration-jenkins-job-builder | refs/heads/master | jenkins_jobs/modules/hipchat_notif.py | 2 | # Copyright 2012 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 applicable law... |
rapicastillo/event-etl-bsd | refs/heads/master | events_etl/migrations/0002_auto_20181008_1754.py | 1 | # Generated by Django 2.0 on 2018-10-08 17:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('events_etl', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Campaign',
... |
BurtBiel/autorest | refs/heads/master | AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/models/salmon.py | 4 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/command_lib/app/output_helpers.py | 3 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
joerg-krause/upmpdcli | refs/heads/master | rdpl2stream/RamPlaylistDecoder.py | 2 | ##########################################################################
# Copyright 2009 Carlos Ribeiro
#
# This file is part of Radio Tray
#
# Radio Tray 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, eit... |
JNRowe/toolz | refs/heads/master | setup.py | 3 | #!/usr/bin/env python
from os.path import exists
from setuptools import setup
import toolz
setup(name='toolz',
version=toolz.__version__,
description='List processing tools and functional utilities',
url='http://github.com/pytoolz/toolz/',
author='https://raw.github.com/pytoolz/toolz/master/AU... |
nthiep/global-ssh-server | refs/heads/master | lib/python2.7/site-packages/django/forms/formsets.py | 79 | from __future__ import absolute_import, unicode_literals
from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import IntegerField, BooleanField
from django.forms.util import ErrorList
from django.forms.widgets import Media, HiddenInput
from django.utils.encoding imp... |
10clouds/edx-platform | refs/heads/dev | lms/djangoapps/teams/urls.py | 129 | """Defines the URL routes for this app."""
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from .views import TeamsDashboardView
urlpatterns = patterns(
'teams.views',
url(r"^/$", login_required(TeamsDashboardView.as_view()), name="teams_dashboard")
)
|
gangadhar-kadam/adb-erp | refs/heads/master | stock/doctype/batch/batch.py | 483 | # ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# 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 yo... |
WillisXChen/django-oscar | refs/heads/master | oscar/lib/python2.7/site-packages/requests/packages/chardet/jpcntx.py | 1776 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... |
hoangt/ScaffCC | refs/heads/master | clang/bindings/python/tests/cindex/test_type.py | 5 | from clang.cindex import CursorKind
from clang.cindex import TypeKind
from nose.tools import raises
from .util import get_cursor
from .util import get_tu
kInput = """\
typedef int I;
struct teststruct {
int a;
I b;
long c;
unsigned long d;
signed long e;
const int f;
int *g;
int ***h;
};
"""
def te... |
pprivulet/DataScience | refs/heads/master | stock/stock.py | 1 | #/usr/bin/python
import urllib2
import pymongo as pm
import traceback
stockfile = open('code.bak','r')
client = pm.MongoClient("localhost",27017)
db = client.stockdb
stocks = db.stockName
stockRecord = db.stockRecord
termList = ['today_open_price', 'yesterday_close_price', 'current_price', 'today_highest', 'today_low... |
koparasy/faultinjection-gem5 | refs/heads/master | src/cpu/IntrControl.py | 19 | # Copyright (c) 2005-2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... |
elkingtonmcb/h2o-2 | refs/heads/master | py/testdir_single_jvm/test_parse_multi_header_single_fvec.py | 9 | import unittest, time, sys, random, os
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i
import h2o_browse as h2b
# for test debug
HEADER = True
dataRowsWithHeader = 0
# Don't write headerData if None (for non-header files)
# Don't write data if rowCount is None
def write_syn_dataset(csv... |
gojira/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/statistical_testing_test.py | 39 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
clslabMSU/clustGUI | refs/heads/master | resultOP.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 29 13:08:52 2017
@author: thy1995
"""
import numpy as np
def table_result (result, x_axis, y_axis):
result = np.concatenate((x_axis, result), axis = 0)
result = np.concatenate((result, np.transpose(y_axis)), axis = 1)
return result |
kaiweifan/neutron | refs/heads/vip5 | neutron/tests/unit/test_api_api_common.py | 24 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 Intel Corporation.
# 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.apa... |
jk1/intellij-community | refs/heads/master | python/testData/inspections/UnresolvedRefNoCreateFunction.py | 80 | <error descr="Unresolved reference 'my_ref'">my_<caret>ref</error>.do_smth(1, 2) |
ms-iot/python | refs/heads/develop | cpython/Lib/dummy_threading.py | 210 | """Faux ``threading`` version using ``dummy_thread`` instead of ``thread``.
The module ``_dummy_threading`` is added to ``sys.modules`` in order
to not have ``threading`` considered imported. Had ``threading`` been
directly imported it would have made all subsequent imports succeed
regardless of whether ``_thread`` w... |
MichalMaM/ella | refs/heads/master | test_ella/test_utils/test_installedapps.py | 6 | import sys
from ella.utils.installedapps import call_modules, app_modules_loaded
from nose import tools
def test_module_loaded_and_signal_fired():
call_modules(('loadme',))
tools.assert_true('test_ella.test_app.loadme' in sys.modules)
loadme = sys.modules['test_ella.test_app.loadme']
tools.assert_e... |
patrickstocklin/chattR | refs/heads/master | lib/python2.7/site-packages/textblob/en/__init__.py | 18 | # -*- coding: utf-8 -*-
'''This file is based on pattern.en. See the bundled NOTICE file for
license information.
'''
from __future__ import absolute_import
import os
from textblob._text import (Parser as _Parser, Sentiment as _Sentiment, Lexicon,
WORD, POS, CHUNK, PNP, PENN, UNIVERSAL, Spelling)
from textblob.co... |
michalliu/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/distutils/command/check.py | 98 | """distutils.command.check
Implements the Distutils 'check' command.
"""
__revision__ = "$Id$"
from distutils.core import Command
from distutils.dist import PKG_INFO_ENCODING
from distutils.errors import DistutilsSetupError
try:
# docutils is installed
from docutils.utils import Reporter
from docutils.pa... |
morissette/devopsdays-hackathon-2016 | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/sax.py | 1835 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... |
byndcivilization/toy-infrastructure | refs/heads/master | flask-app/venv/lib/python3.6/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... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/draft_schematic/clothing/shared_clothing_ith_hat_casual_03.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_ith_hat_casual_03.iff"
result.att... |
HSC-Users/hscTools | refs/heads/master | bick/python/meeus.py | 1 | #!/usr/bin/env python
import numpy as np
import inspect
RAD = np.pi/180.0
DEG = 180.0/np.pi
JD2000 = 2451545.00
def JCentury (JD):
return (JD - JD2000)/36525.0
def T2JD(T):
return 36525.0*T + JD2000
def eclipticObliquity (JD, debug=False):
T = JCentury(JD)
U = T / 100.0
correction = - 4680.93 ... |
divio/django-tinymce | refs/heads/master | setup.py | 8 | #!/usr/bin/env python
from distutils.core import setup
import metadata
app_name = metadata.name
version = metadata.version
setup(
name = "django-%s" % app_name,
version = version,
packages = [app_name, '%s.templatetags' % app_name],
package_data = {app_name: ['templates/tinymce/*']},
author = "... |
vicky2135/lucious | refs/heads/master | oscar/lib/python2.7/site-packages/phonenumbers/data/region_CF.py | 1 | """Auto-generated file, do not edit by hand. CF metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_CF = PhoneMetadata(id='CF', country_code=236, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[278]\\d{7}', possible_number_pattern='\... |
ckaestne/CIDE | refs/heads/master | CIDE_Language_Python-test/testfiles/chunk.py | 9 | """Simple class to read IFF chunks.
An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
Format)) has the following structure:
+----------------+
| ID (4 bytes) |
+----------------+
| size (4 bytes) |
+----------------+
| data |
| ... |
+----------------+
The ID is a 4-byte s... |
abhikumar22/MYBLOG | refs/heads/master | blg/Lib/encodings/mac_greek.py | 272 | """ Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,err... |
mszewczy/odoo | refs/heads/8.0 | openerp/addons/test_documentation_examples/delegation.py | 366 | # -*- coding: utf-8 -*-
from openerp import models, fields
class Child0(models.Model):
_name = 'delegation.child0'
field_0 = fields.Integer()
class Child1(models.Model):
_name = 'delegation.child1'
field_1 = fields.Integer()
class Delegating(models.Model):
_name = 'delegation.parent'
_inh... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.0/Lib/idlelib/AutoComplete.py | 1 | """AutoComplete.py - An IDLE extension for automatically completing names.
This extension can complete either attribute names of file names. It can pop
a window with all available names, for the user to select from.
"""
import os
import sys
import string
from idlelib.configHandler import idleConf
# This string inclu... |
resmo/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_clusterclouddetails.py | 28 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... |
kennedyshead/home-assistant | refs/heads/dev | tests/components/lock/test_significant_change.py | 7 | """Test the Lock significant change platform."""
from homeassistant.components.lock.significant_change import (
async_check_significant_change,
)
async def test_significant_change():
"""Detect Lock significant changes."""
old_attrs = {"attr_1": "a"}
new_attrs = {"attr_1": "b"}
assert (
as... |
arcade-lab/tia-infrastructure | refs/heads/master | tools/parameters/core_parameters.py | 1 | """
Classes and utilities for encapsulating physical constraints of target hardware and simulator.
"""
import sys
import numpy as np
from assembly.instruction import Op, SourceType, DestinationType
from parameters.exception import ParametrizationException
class CoreParameters:
"""
Parameters for the physic... |
alexryndin/ambari | refs/heads/branch-adh-1.5 | ambari-server/src/test/python/custom_actions/test_ru_set_all.py | 1 | # !/usr/bin/env python
'''
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"... |
bloomer1/incubator-zeppelin | refs/heads/master | spark/src/main/resources/python/zeppelin_pyspark.py | 10 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
samirasnoun/django_cms_gallery_image | refs/heads/master | cms/test_utils/util/menu_extender.py | 35 | # -*- coding: utf-8 -*-
from menus.base import NavigationNode
from menus.menu_pool import menu_pool
from cms.menu_bases import CMSAttachMenu
class TestMenu(CMSAttachMenu):
name = "test menu"
def get_nodes(self, request):
nodes = []
n = NavigationNode('sample root page', "/", 1)
n2... |
rhyolight/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/matplotlib/cm.py | 70 | """
This module contains the instantiations of color mapping classes
"""
import numpy as np
from numpy import ma
import matplotlib as mpl
import matplotlib.colors as colors
import matplotlib.cbook as cbook
from matplotlib._cm import *
def get_cmap(name=None, lut=None):
"""
Get a colormap instance, defaultin... |
jepler/linuxcnc-mirror | refs/heads/master | tests/mdi-while-queuebuster-waitflag/test-ui.py | 5 | #!/usr/bin/env python
import linuxcnc, hal
import sys
# Initialization
c = linuxcnc.command()
s = linuxcnc.stat()
c.state(linuxcnc.STATE_ESTOP_RESET)
c.state(linuxcnc.STATE_ON)
c.mode(linuxcnc.MODE_MDI)
c.mdi('(print,pre 1)')
c.mdi('(print,pre 2)')
c.mdi('M400')
c.mdi('(print,post 1)')
c.mdi('(print,post 2)')
c.mdi(... |
storpipfugl/airflow | refs/heads/master | airflow/migrations/versions/1507a7289a2f_create_is_encrypted.py | 37 | """create is_encrypted
Revision ID: 1507a7289a2f
Revises: e3a246e0dc1
Create Date: 2015-08-18 18:57:51.927315
"""
# revision identifiers, used by Alembic.
revision = '1507a7289a2f'
down_revision = 'e3a246e0dc1'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.eng... |
nclsHart/glances | refs/heads/master | glances/exports/glances_csv.py | 1 | # -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>
#
# Glances 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 Lic... |
snnn/tensorflow | refs/heads/master | tensorflow/python/estimator/export/export.py | 6 | # 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... |
westinedu/newertrends | refs/heads/master | zinnia/management/commands/feed2zinnia.py | 2 | """Feed to Zinnia command module"""
import os
import sys
from urllib2 import urlopen
from datetime import datetime
from optparse import make_option
from django.conf import settings
from django.utils import timezone
from django.core.files import File
from django.utils.text import Truncator
from django.utils.html import... |
kawamon/hue | refs/heads/master | desktop/core/ext-py/Paste-2.0.1/tests/test_auth/test_auth_digest.py | 47 | # (c) 2005 Clark C. Evans
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from paste.auth.digest import *
from paste.wsgilib import raw_interactive
from paste.httpexceptions import *
from paste.httpheaders import AUTHORIZATIO... |
ravindrapanda/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/graph_actions.py | 76 | # 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... |
GalaxyTab4/android_kernel_samsung_millet | refs/heads/millet | 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... |
maestrano/odoo | refs/heads/master | addons/account_bank_statement_extensions/wizard/confirm_statement_line.py | 381 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... |
igraph/python-igraph | refs/heads/master | tests/test_conversion.py | 1 | import random
import unittest
from igraph import Graph, Matrix
class DirectedUndirectedTests(unittest.TestCase):
def testToUndirected(self):
graph = Graph([(0, 1), (0, 2), (1, 0)], directed=True)
graph2 = graph.copy()
graph2.to_undirected(mode=False)
self.assertTrue(graph2.vcount... |
ormnv/os_final_project | refs/heads/master | django/core/management/commands/validate.py | 239 | from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
help = "Validates all installed models."
requires_model_validation = False
def handle_noargs(self, **options):
self.validate(display_num_errors=True)
|
zoincoin/zoin | refs/heads/master | share/qt/make_spinner.py | 4415 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... |
IanBoyanZhang/MVP | refs/heads/master | server/config/twitterstream.py | 2 | import oauth2 as oauth
import urllib2 as urllib
from credentials import *
# See assignment1.html instructions or README for how to get these credentials
_debug = 0
oauth_token = oauth.Token(key=access_token_key, secret=access_token_secret)
oauth_consumer = oauth.Consumer(key=api_key, secret=api_secret)
signature_... |
marco-hoyer/cfn-sphere | refs/heads/master | src/main/python/cfn_sphere/util.py | 2 | import json
import logging
import os
import time
from functools import wraps
import yaml
from dateutil import parser
from git import Repo, InvalidGitRepositoryError
from prettytable import PrettyTable
from six.moves.urllib import request as urllib2
from cfn_sphere.exceptions import CfnSphereException, CfnSphereBotoEr... |
initbrain/intelwiz | refs/heads/master | intelwiz/core/flowchart/Terminal.py | 2 | # -*- coding: utf-8 -*-
from pyqtgraph.Qt import QtCore, QtGui
import weakref
from pyqtgraph.graphicsItems.GraphicsObject import GraphicsObject
import pyqtgraph.functions as fn
from pyqtgraph.Point import Point
#from PySide import QtCore, QtGui
from .eq import *
class Terminal(object):
def __init__(self, node, nam... |
eltonsantos/django | refs/heads/master | tests/unmanaged_models/__init__.py | 45382 | |
MSusik/invenio | refs/heads/master | invenio/modules/upgrader/upgrades/invenio_2012_11_15_bibdocfile_model.py | 3 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 2013 CERN.
##
## Invenio 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 opt... |
HalcyonChimera/osf.io | refs/heads/develop | addons/onedrive/apps.py | 14 | from addons.base.apps import BaseAddonAppConfig, generic_root_folder
onedrive_root_folder = generic_root_folder('onedrive')
class OneDriveAddonAppConfig(BaseAddonAppConfig):
name = 'addons.onedrive'
label = 'addons_onedrive'
full_name = 'OneDrive'
short_name = 'onedrive'
owners = ['user', 'node']... |
drnextgis/mapproxy | refs/heads/master | mapproxy/test/unit/test_config.py | 6 | # This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... |
liyitest/rr | refs/heads/master | horizon/exceptions.py | 17 | # Copyright 2012 Nebula, 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 agree... |
Zelgadis87/Sick-Beard | refs/heads/master | lib/enzyme/core.py | 180 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Thomas Schueppel <stain@acm.org>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
#
# This file is part of enzyme.
#
# enzyme is free software; you can redistribute it and/or mod... |
darktears/chromium-crosswalk | refs/heads/master | chrome/test/mini_installer/process_verifier.py | 125 | # 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.
import chrome_helper
import verifier
class ProcessVerifier(verifier.Verifier):
"""Verifies that the running processes match the expectation dictionaries.... |
mhoffma/micropython | refs/heads/master | tests/basics/bytes_gen.py | 116 | # construct a bytes object from a generator
def gen():
for i in range(4):
yield i
print(bytes(gen()))
|
chuangWu/linux | refs/heads/master | scripts/gdb/linux/dmesg.py | 630 | #
# gdb helper commands and functions for Linux kernel debugging
#
# kernel log buffer dump
#
# Copyright (c) Siemens AG, 2011, 2012
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import utils
class LxDmesg(gdb.Command... |
kylerichardson/metron | refs/heads/master | metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/management_ui_commands.py | 7 | #!/usr/bin/env python
"""
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");... |
solvcon/solvcon | refs/heads/master | setup.py | 2 | # -*- coding: UTF-8 -*-
#
# Copyright (c) 2008, Yung-Yu Chen <yyc@solvcon.net>
#
# 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 copyrigh... |
robbiet480/home-assistant | refs/heads/dev | homeassistant/components/huawei_lte/const.py | 5 | """Huawei LTE constants."""
DOMAIN = "huawei_lte"
DEFAULT_DEVICE_NAME = "LTE"
DEFAULT_NOTIFY_SERVICE_NAME = DOMAIN
UPDATE_SIGNAL = f"{DOMAIN}_update"
UPDATE_OPTIONS_SIGNAL = f"{DOMAIN}_options_update"
CONNECTION_TIMEOUT = 10
NOTIFY_SUPPRESS_TIMEOUT = 30
SERVICE_CLEAR_TRAFFIC_STATISTICS = "clear_traffic_statistics"... |
kuno/ansible | refs/heads/devel | lib/ansible/runner/connection_plugins/ssh.py | 1 | # (c) 2012, Michael DeHaan <michael.dehaan@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 your option) any lat... |
lstorchi/pca_fit | refs/heads/master | utilities/reader_and.py | 1 | import numpy
import math
import sys
import re
from scipy import stats
####################################################################
def file_len(fname):
with open(fname) as f:
for i, l in enumerate(f):
pass
return i + 1
####################################################################
f... |
asadziach/tensorflow | refs/heads/pedestrian_detection_walabot_tf | tensorflow/tools/docker/simple_console.py | 603 | # 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... |
mitchrule/Miscellaneous | refs/heads/master | Django_Project/django/Lib/site-packages/wheel/test/test_install.py | 109 | # Test wheel.
# The file has the following contents:
# hello.pyd
# hello/hello.py
# hello/__init__.py
# test-1.0.data/data/hello.dat
# test-1.0.data/headers/hello.dat
# test-1.0.data/scripts/hello.sh
# test-1.0.dist-info/WHEEL
# test-1.0.dist-info/METADATA
# test-1.0.dist-info/RECORD
# The root is PLA... |
pvagner/orca | refs/heads/master | test/keystrokes/firefox/html_struct_nav_blockquote.py | 1 | #!/usr/bin/python
"""Test of structural navigation by blockquote."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(KeyComboAction("<Control>Home"))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("q"))
sequence.append(utils.AssertPresentationAc... |
haldun/bookmarks | refs/heads/master | importer.py | 1 | import datetime
import hashlib
import logging
from lxml import etree
from pymongo.objectid import ObjectId
from bson.dbref import DBRef
class Importer(object):
def __init__(self, db, owner, contents):
self.db = db
self.owner = owner
self.contents = contents
def import_bookmarks(self):
collection =... |
gltn/stdm | refs/heads/master | stdm/third_party/migrate/versioning/schemadiff.py | 78 | """
Schema differencing support.
"""
import logging
import sqlalchemy
from sqlalchemy.types import Float
log = logging.getLogger(__name__)
def getDiffOfModelAgainstDatabase(metadata, engine, excludeTables=None):
"""
Return differences of model against database.
:return: object which will evaluate to... |
drpaneas/linuxed.gr | refs/heads/master | lib/python2.7/site-packages/paramiko/ecdsakey.py | 3 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... |
qt911025/pw_module_system | refs/heads/pw | module_sounds.py | 2 | from header_sounds import *
# Many of these sound entries are hard coded into the engine, and should not be removed; to disable them, empty the sound file list.
# Add your own sounds just before the animation sounds group, or before sounds_end.
sounds = [
("click", sf_2d|sf_priority_9|sf_vol_3, ["drum_3.ogg"]),
("t... |
jeremiedecock/snippets | refs/heads/master | python/time/process_time.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Jérémie DECOCK (http://www.jdhp.org)
# See: https://docs.python.org/3/library/time.html#time.process_time
# http://stackoverflow.com/questions/7370801/measure-time-elapsed-in-python
import time
initial_time = time.process_time()
#do some stuf... |
chirilo/kuma | refs/heads/master | vendor/packages/pygments/formatters/rtf.py | 73 | # -*- coding: utf-8 -*-
"""
pygments.formatters.rtf
~~~~~~~~~~~~~~~~~~~~~~~
A formatter that generates RTF files.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_i... |
qbilius/streams | refs/heads/master | streams/parallel.py | 1 | import sys, subprocess, time, glob, os, random, string, pickle
import inspect, argparse, threading, signal, ast
import tqdm
import dill
# from joblib import Parallel, delayed
import multiprocessing
import numpy as np
import pandas
COMPUTED = os.environ.get('COMPUTED', '')
class Parallel(object):
def __init__(... |
procrastinatio/mapproxy | refs/heads/master | mapproxy/util/async.py | 5 | # This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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... |
googleads/googleads-dfa-reporting-samples | refs/heads/master | python/v3_5/configure_dynamic_asset_selection.py | 3 | #!/usr/bin/python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.