repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
kklmn/xrt | refs/heads/master | examples/withRaycing/03_LaueMono/__init__.py | 1 | # -*- coding: utf-8 -*-
r"""
Laue Monochromator
------------------
Bending of a single crystal Laue Monochromator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Files in ``\examples\withRaycing\03_LaueMono``
This example shows the reflectivity of a bent 200-µm-thick Si111 Laue crystal
at various bending radii and en... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/beautifulsoup4-4.3.2/bs4/builder/_htmlparser.py | 412 | """Use the HTMLParser library to parse HTML files that aren't too bad."""
__all__ = [
'HTMLParserTreeBuilder',
]
from HTMLParser import (
HTMLParser,
HTMLParseError,
)
import sys
import warnings
# Starting in Python 3.2, the HTMLParser constructor takes a 'strict'
# argument, which we'd like to s... |
mythmon/kitsune | refs/heads/master | tests/pages/desktop/login_page.py | 6 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from pages.desktop.base import Base
from selenium.webdriver.common.by import By
class LoginPage(Base):
"""
... |
chongdashu/pidayjam2015 | refs/heads/master | cgi-bin/pypi-roulette.py | 1 | import math
import random
from random import shuffle
pi_string = str(math.pi)
pi_numbers = [int(s) for s in pi_string if s.isdigit()]
def roulette_one(feature):
numbers = pi_numbers[:]
n = random.sample(numbers, 1)[0]
print "%s %s" %(n,feature)
def roulette_all(features):
f = random.sample(features, len(fea... |
nesterione/scikit-learn | refs/heads/master | sklearn/decomposition/base.py | 313 | """Principal Component Analysis Base Classes"""
# Author: Alexandre Gramfort <[email protected]>
# Olivier Grisel <[email protected]>
# Mathieu Blondel <[email protected]>
# Denis A. Engemann <[email protected]>
# Kyle Kastner <[email protected]>
#
# Licen... |
scalable-networks/ext | refs/heads/master | gnuradio-3.7.0.1/gr-filter/examples/gr_filtdes_live_upd.py | 11 | #!/usr/bin/env python
#
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# ... |
fnp/wolnelektury | refs/heads/master | src/push/migrations/0001_initial.py | 1 | # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
... |
wfxiang08/django185 | refs/heads/master | django/contrib/postgres/operations.py | 111 | from django.contrib.postgres.signals import register_hstore_handler
from django.db.migrations.operations.base import Operation
class CreateExtension(Operation):
reversible = True
def __init__(self, name):
self.name = name
def state_forwards(self, app_label, state):
pass
def database... |
jkbradley/spark | refs/heads/master | examples/src/main/python/mllib/latent_dirichlet_allocation_example.py | 128 | #
# 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... |
mkmelin/bedrock | refs/heads/master | tests/pages/firefox/channel/ios.py | 8 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from pages.firefox.base import FirefoxBasePage
class ChannelIOSPage(Firef... |
hazrpg/calibre | refs/heads/master | src/calibre/gui2/preferences/template_functions.py | 14 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <[email protected]>'
__docformat__ = 'restructuredtext en'
import json, traceback
from PyQt5.Qt import QDialogButtonBox
from calibre.gui2 import error_dialog, warning_dialog
from ... |
aidear/zfbui | refs/heads/master | public/assets/tools/ant/bin/runant.py | 124 | #!/usr/bin/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 "Licen... |
andrei4ka/fuel-web-redhat | refs/heads/master | fuel_agent/fuel_agent/utils/partition_utils.py | 1 | # Copyright 2014 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 agreed to in writing... |
googleapis/python-assured-workloads | refs/heads/master | scripts/fixup_assuredworkloads_v1beta1_keywords.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 o... |
jola5/aptly | refs/heads/master | system/t04_mirror/show.py | 11 | from lib import BaseTest
import re
class ShowMirror1Test(BaseTest):
"""
show mirror: regular mirror
"""
fixtureCmds = ["aptly mirror create --ignore-signatures mirror1 http://mirror.yandex.ru/debian/ wheezy"]
runCmd = "aptly mirror show mirror1"
class ShowMirror2Test(BaseTest):
"""
show ... |
lozadaOmr/ansible-admin | refs/heads/development | src/ansible/migrations/0008_playbook_directory.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-16 14:30
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ansible', '0007_auto_20170516_1410'),
]
operations = [
migrations.AddField(... |
rosmo/ansible | refs/heads/devel | test/units/modules/network/onyx/onyx_module.py | 52 | # (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 dis... |
zengenti/ansible | refs/heads/devel | lib/ansible/modules/cloud/atomic/atomic_image.py | 25 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... |
GEMScienceTools/rmtk | refs/heads/master | tests/vulnerability/tests_TO_BE_CHANGED/NSP/fragility_process/test_spo2ida_method.py | 4 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
"""
Created on Thu May 29 11:29:32 2014
@author: chiaracasotto
"""
# Clear existing variables
def clearall():
all = [var for var in globals() if var[0] != "_"]
for var in all:
del globals()[var]
clearall()
import pandas as pd
import nump... |
clicksaswat/ns-3-dev | refs/heads/master | src/sixlowpan/bindings/modulegen__gcc_ILP32.py | 38 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
np/alot | refs/heads/master | alot/db/envelope.py | 1 | # Copyright (C) 2011-2012 Patrick Totzke <[email protected]>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import os
import email
import re
import glob
import email.charset as charset
charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-... |
vipulkanade/EventbriteDjango | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py | 2374 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... |
bigdawg-istc/bigdawg | refs/heads/master | provisions/cluster_setup/accumulo-data/bdsetup/thrift/server/TServer.py | 50 | #
# 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... |
cogniteev/pyonedrive | refs/heads/master | tests/auth_test.py | 1 | """ Authentication tests
"""
import unittest
import mock
from pyonedrive import LiveAuth
import requests
class AuthTestCase(unittest.TestCase):
def setUp(self):
self.auth = LiveAuth('id', 'secret', 'scope', 'redirect')
def test_generate_code_url(self):
url = self.auth.generate_oauth_initia... |
thecut/thecut-stripe | refs/heads/master | thecut/stripe/querysets.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import models
class KnownFieldMixin(object):
def _get_known_field_value(self, field_name):
"""
If queryset was called on concrete model (like account.charges.all())
this method can be used to g... |
biomodels/MODEL1172501439 | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
setup(name='MODEL1172501439',
version=20140916,
description='MODEL1172501439 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/MODEL1172501439',
maintainer='Stanley Gu',
maintainer_url='[email protected]',
packages=find_packages(... |
polyaxon/polyaxon | refs/heads/master | sdks/python/http_client/v1/polyaxon_sdk/models/v1_spark_replica.py | 1 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... |
LordDamionDevil/Lony | refs/heads/master | lib/youtube_dl/extractor/snotr.py | 64 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
parse_filesize,
str_to_int,
)
class SnotrIE(InfoExtractor):
_VALID_URL = r'http?://(?:www\.)?snotr\.com/video/(?P<id>\d+)/([\w]+)'
_TESTS = [{
'url': ... |
sdotter/GPE-5.1.0 | refs/heads/master | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <[email protected]>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
ponyii/The-favorite-pocket-world-of-Nebuchadnezzar-III-The-Rhino-in-exile | refs/heads/master | game/player.py | 1 | import world_map.cell_and_map_classes as cell_and_map_classes
import local_settings, visualization, helpers
import units_and_buildings.unit_classes as U_classes
from units_and_buildings.function_argument_requirer import function_argument_requirer
import constants as CONST
from globals import G
class player_ma... |
westinedu/sovleit | refs/heads/master | django/contrib/formtools/tests/urls.py | 245 | """
This is a URLconf to be loaded by tests.py. Add any URLs needed for tests only.
"""
from django.conf.urls.defaults import *
from django.contrib.formtools.tests import *
urlpatterns = patterns('',
(r'^test1/', TestFormPreview(TestForm)),
(r'^test2/', UserSecuredFormPre... |
JGrippo/YACS | refs/heads/master | courses/south_migrations/0001_initial.py | 2 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Semester'
db.create_table('courses_semester', (
('id', self.gf('django.db.mode... |
dario61081/koalixcrm | refs/heads/master | koalixcrm/crm/factories/factory_payment_reminder.py | 2 | # -*- coding: utf-8 -*-
from koalixcrm.crm.models import PaymentReminder
from koalixcrm.crm.factories.factory_sales_document import StandardSalesDocumentFactory
class StandardPaymentReminderFactory(StandardSalesDocumentFactory):
class Meta:
model = PaymentReminder
payable_until = "2018-05-20"
pa... |
pyecs/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_request.py | 299 | import os
import unittest
import urllib2
import json
import time
import wptserve
from base import TestUsingServer, doc_root
class TestInputFile(TestUsingServer):
def test_seek(self):
@wptserve.handlers.handler
def handler(request, response):
rv = []
f = request.raw_input
... |
Pablo126/SSBW | refs/heads/master | Entrega1/lib/python3.5/site-packages/django/core/servers/basehttp.py | 44 | """
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
from __f... |
robinandeer/puzzle | refs/heads/master | puzzle/plugins/gemini/mixins/variant.py | 1 | import logging
from gemini import GeminiQuery
from puzzle.plugins import BaseVariantMixin
from puzzle.plugins.constants import Results
from puzzle.models import (Compound, Variant, Gene, Genotype, Transcript,)
from puzzle.utils import (get_most_severe_consequence, get_omim_number,
get_cytob... |
QuickSander/CouchPotatoServer | refs/heads/master | libs/pyasn1/__init__.py | 193 | import sys
# http://www.python.org/dev/peps/pep-0396/
__version__ = '0.1.7'
if sys.version_info[:2] < (2, 4):
raise RuntimeError('PyASN1 requires Python 2.4 or later')
|
Sri0405/pattern | refs/heads/master | examples/01-web/08-wiktionary.py | 21 | import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.web import Wiktionary, DOM
from pattern.db import csv, pd
# This example retrieves male and female given names from Wiktionary (http://en.wiktionary.org).
# It then trains a classifier that can predict the gender of u... |
hainm/numpy | refs/heads/master | numpy/distutils/setup.py | 263 | #!/usr/bin/env python
from __future__ import division, print_function
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('distutils', parent_package, top_path)
config.add_subpackage('command')
config.add_subpackage('fcompiler')... |
furbrain/Coherence | refs/heads/maintain/0.6.x | coherence/backends/banshee_storage.py | 3 | # -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2009, Philippe Normand <[email protected]>
"""
TODO:
- podcasts
"""
from twisted.internet import reactor, defer, task
from coherence.extern import db_row
from coherence.upnp.core import DIDLLite
... |
haveal/googleads-python-lib | refs/heads/master | examples/dfp/v201502/creative_service/update_creatives.py | 4 | #!/usr/bin/python
#
# Copyright 2015 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... |
soarpenguin/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_datacenters_facts.py | 45 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... |
cloudify-cosmo/cloudify-plugin-installer-plugin | refs/heads/master | plugin_installer/extract_package_name.py | 6 | """
hack-ish script to extract the name field from a python package
should be called with the directory containing setup.py as the first argument
"""
if __name__ == '__main__':
import setuptools
import sys
from os import path
root_dir = sys.argv[1]
# patch for setuptools.py that prints the package ... |
theodoregoetz/wernher | refs/heads/master | sandbox/KRPC Test2.py | 1 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
%run -i '../Common.ipynb'
import krpc
# <codecell>
conn = krpc.connect(name='laptop2', address='192.168.1.2')
ksc = conn.space_center
vessel = ksc.active_vessel
obt = vessel.orbit
ap = vessel.auto_pilot
con = vessel.control
# <codecell>
def torque(v... |
enthought/etsproxy | refs/heads/master | enthought/traits/ui/wx/themed_text_editor.py | 1 | # proxy module
from traitsui.wx.themed_text_editor import *
|
amirgeva/codebrowser | refs/heads/master | browsestack.py | 1 | from PySide import QtCore
from PySide import QtGui
import sys
class BrowseStack(QtGui.QDockWidget):
def __init__(self,parent=None):
super(BrowseStack,self).__init__(parent)
self.stacklist=QtGui.QListView()
self.items=[]
self.setWidget(self.stacklist)
def updateItems(se... |
5y/flask | refs/heads/master | flask/cli.py | 1 | # -*- coding: utf-8 -*-
"""
flask.run
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock
from contextlib import contextmanager
import click
from .... |
Elettronik/SickRage | refs/heads/master | lib/hachoir_core/field/static_field_set.py | 93 | from hachoir_core.field import FieldSet, ParserError
class StaticFieldSet(FieldSet):
"""
Static field set: format class attribute is a tuple of all fields
in syntax like:
format = (
(TYPE1, ARG1, ARG2, ...),
(TYPE2, ARG1, ARG2, ..., {KEY1=VALUE1, ...}),
...
)
... |
zartata/ZeroNet | refs/heads/master | src/util/SocksProxy.py | 14 | import socket
from lib.PySocks import socks
def create_connection(address, timeout=None, source_address=None):
sock = socks.socksocket()
sock.connect(address)
return sock
# Dns queries using the proxy
def getaddrinfo(*args):
return [(socket.AF_INET, socket.SOCK_STREAM, 6, '', (args[0], args[1]))]
... |
karthik339/Agni | refs/heads/master | MainDemo/flask/lib/python2.7/site-packages/sqlalchemy/exc.py | 17 | # sqlalchemy/exc.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Exceptions used with SQLAlchemy.
The base exception class is :class:`.SQLAlchemy... |
gboudreau/CouchPotato | refs/heads/master | library/sqlalchemy/dialects/postgresql/psycopg2.py | 17 | """Support for the PostgreSQL database via the psycopg2 driver.
Driver
------
The psycopg2 driver is supported, available at http://pypi.python.org/pypi/psycopg2/ .
The dialect has several behaviors which are specifically tailored towards compatibility
with this module.
Note that psycopg1 is **not** supported.
Un... |
shuggiefisher/django-on-google-app-engine-base | refs/heads/master | django/utils/unittest/util.py | 751 | """Various utility functions."""
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
return result[:_MAX_LENGTH] + ' [truncated]...'... |
apuckey/thrift-0.9.1 | refs/heads/master | lib/py/src/transport/TTransport.py | 105 | #
# 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... |
google/material-design-icons | refs/heads/master | update/venv/lib/python3.9/site-packages/chardet/langrussianmodel.py | 13 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
# 0: Negative
RUSSIAN_LANG_MODEL = {
37: { # 'А'
37: 0, # 'А'
44: 1, # 'Б'
33: 1, # 'В'
46: 1, # 'Г'
41: 1, # 'Д'
... |
brython-dev/brython | refs/heads/master | www/src/Lib/encodings/cp875.py | 37 | """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def deco... |
xuegang/gpdb | refs/heads/master | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/filerep/Filerep_Resync/schema/genSchema.py | 6 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... |
optiv-labs/talus_client | refs/heads/master | talus_client/cmds/corpus.py | 1 | #!/usr/bin/env python
# encoding: utf-8
import argparse
import arrow
import cmd
import glob
import json
import os
import shlex
import sys
from tabulate import tabulate
import textwrap
from talus_client.cmds import TalusCmdBase
import talus_client.api
import talus_client.errors
from talus_client.models import *
class... |
taiansu/arguman.org | refs/heads/master | web/premises/migrations/0009_merge.py | 7 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('premises', '0008_auto_20141023_0133'),
('premises', '0008_auto_20141022_1951'),
]
operations = [
]
|
hendradarwin/ITK | refs/heads/master | Wrapping/Generators/Python/Tests/template.py | 11 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... |
shinsterneck/pdns | refs/heads/feature-geosql-backend | regression-tests.recursor-dnssec/test_NTA.py | 9 | import dns
from recursortests import RecursorTest
class testSimple(RecursorTest):
_confdir = 'NTA'
_config_template = """dnssec=validate"""
_lua_config_file = """addNTA("bogus.example")
addNTA('secure.optout.example', 'Should be Insecure, even with DS configured')
addTA('secure.optout.example', '64215 13 ... |
persandstrom/home-assistant | refs/heads/master | homeassistant/components/cover/myq.py | 1 | """
Support for MyQ-Enabled Garage Doors.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/cover.myq/
"""
import logging
import voluptuous as vol
from homeassistant.components.cover import (
CoverDevice, SUPPORT_CLOSE, SUPPORT_OPEN)
from homeassistant.c... |
ging/horizon | refs/heads/master | openstack_dashboard/dashboards/admin/hypervisors/tests.py | 3 | # Copyright 2013 B1 Systems GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
hudl/Tyr | refs/heads/master | tyr/servers/iis/__init__.py | 1 | from node import IISNode
|
sloww/cntslinkgit | refs/heads/master | app_printer/migrations/0005_auto_20150531_1544.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('app_printer', '0004_auto_20150531_0104'),
]
operations = [
migrations.AlterField(
model_name='printer',
... |
dkubiak789/odoo | refs/heads/8.0 | addons/report/tests/__init__.py | 456 | import test_reports
|
mgedmin/ansible | refs/heads/devel | lib/ansible/plugins/callback/default.py | 9 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
Andriy963/e-olimp.com | refs/heads/master | 1482.py | 2 | an,am = [int(x) for x in input().split()]
A = [[int(x) for x in input().split()] for i in range(an)]
bn,bm = [int(x) for x in input().split()]
B = [[int(x) for x in input().split()] for i in range(bn)]
if am == bn:
C = [[str(sum(A[i][g]*B[g][j] for g in range(am))) for j in range(bm)] for i in range(an)]
prin... |
kazcw/bitcoin | refs/heads/master | test/functional/mempool_accept.py | 11 | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool acceptance of raw transactions."""
from io import BytesIO
from test_framework.test_framework i... |
adit-chandra/tensorflow | refs/heads/master | tensorflow/python/autograph/pyct/errors.py | 20 | # 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... |
CollinsIchigo/hdx_2 | refs/heads/master | venv/lib/python2.7/site-packages/requests/packages/chardet/universaldetector.py | 1775 | ######################## 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... |
oceanobservatories/mi-instrument | refs/heads/master | mi/dataset/driver/dosta_abcdjm/ctdbp_p/dcl/dosta_abcdjm_ctdbp_p_dcl_telemetered_driver.py | 7 | #!/usr/bin/env python
"""
@package mi.dataset.driver.ctdbp_p.dcl
@file mi-dataset/mi/dataset/driver/dosta_abcdjm/ctdbp_p/dcl/dosta_abcdjm_ctdbp_p_dcl_telemetered_driver.py
@author Jeff Roy
@brief Driver for the dosta_abcdjm attached to the ctdbp_p_dcl instrument (Telemetered Data)
Release notes:
Initial Release
"""
... |
kantel/processingpy | refs/heads/master | sketches/shaunsim5/grass.py | 2 | # coding=utf-8
from config import Settings
s = Settings()
class Grass():
def __init__(self, x, y, sz):
self.x = x
self.y = y
self.energy = 5
self.eaten = False
self.sz = sz
def update(self):
noStroke()
if self.eaten:
if random(1000)... |
johscheuer/calico-docker | refs/heads/master | calico_containers/calico_ctl/node.py | 3 | # Copyright 2015 Metaswitch Networks
#
# 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 w... |
tchaari/android_kernel_samsung_crespo | refs/heads/kk4.4 | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
brianwoo/django-tutorial | refs/heads/master | build/Django/build/lib.linux-x86_64-2.7/django/contrib/gis/geos/error.py | 326 | """
This module houses the GEOS exceptions, specifically, GEOSException and
GEOSGeometryIndexError.
"""
class GEOSException(Exception):
"The base GEOS exception, indicates a GEOS-related error."
pass
class GEOSIndexError(GEOSException, KeyError):
"""
This exception is raised when an invalid index ... |
pilou-/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2017-2018, Ansible Project
# 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__ = ... |
m3wolf/xanespy | refs/heads/master | tests/mpi_spectrum_fit.py | 1 | #!/usr/bin/env python
"""A script to launch spectrum fitting for all the pixels of a XANES
Frameset. This script should be launched with `mpiexec
mpi_spectrum_fit.py` to make proper use of parallel processing."""
import logging
logging.basicConfig(level=logging.DEBUG)
import os
import xanespy as xp
HDF_FILE = '/tm... |
wikkiewikkie/elizabeth | refs/heads/master | tests/test_data/test_datetime.py | 1 | # -*- coding: utf-8 -*-
import datetime
import re
from ._patterns import STR_REGEX
def test_str(dt):
assert re.match(STR_REGEX, str(dt))
def test_year(dt):
result = dt.year(minimum=2000, maximum=2016)
assert result >= 2000
assert result <= 2016
def test_day_of_month(dt):
result = dt.day_of_mo... |
alexus37/AugmentedRealityChess | refs/heads/master | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/GL/AMD/conservative_depth.py | 9 | '''OpenGL extension AMD.conservative_depth
This module customises the behaviour of the
OpenGL.raw.GL.AMD.conservative_depth to provide a more
Python-friendly API
Overview (from the spec)
There is a common optimization for hardware accelerated implementation of
OpenGL which relies on an early depth test to be ru... |
vovanbo/django-oscar | refs/heads/master | tests/unit/voucher/model_tests.py | 44 | import datetime
from decimal import Decimal as D
from django.test import TestCase
from django.core import exceptions
from django.utils.timezone import utc
from oscar.apps.voucher.models import Voucher
from oscar.core.compat import get_user_model
from oscar.test.factories import OrderFactory, UserFactory, VoucherFacto... |
salamer/django | refs/heads/master | tests/forms_tests/tests/test_formsets.py | 163 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.forms import (
CharField, DateField, FileField, Form, IntegerField, SplitDateTimeField,
ValidationError, formsets,
)
from django.forms.formsets import BaseFormSet, formset_factory
from django.forms.utils import ErrorLi... |
DecipherOne/Troglodyte | refs/heads/master | Trog Build Dependencies/Python26/Lib/test/test_imgfile.py | 150 | #! /usr/bin/env python
"""Simple test script for imgfile.c
Roger E. Masse
"""
from test.test_support import verbose, unlink, findfile, import_module
imgfile = import_module('imgfile', deprecated=True)
import uu
def testimage(name):
"""Run through the imgfile's battery of possible methods
on the image... |
dd00/commandergenius | refs/heads/dd00 | project/jni/python/src/Lib/test/test_imgfile.py | 150 | #! /usr/bin/env python
"""Simple test script for imgfile.c
Roger E. Masse
"""
from test.test_support import verbose, unlink, findfile, import_module
imgfile = import_module('imgfile', deprecated=True)
import uu
def testimage(name):
"""Run through the imgfile's battery of possible methods
on the image... |
izhukov/ansible | refs/heads/devel | v2/ansible/playbook/vars_file.py | 7690 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
mgoulish/qpid-dispatch | refs/heads/master | python/qpid_dispatch_internal/compat/ordereddict.py | 6 | #
# 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... |
tylertian/Openstack | refs/heads/master | openstack F/nova/nova/tests/scheduler/test_host_filters.py | 5 | # 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/licenses/LICENSE-2.0
#
# Unless required ... |
thinkle/gourmet | refs/heads/master | gourmet/plugins/email_plugin/__init__.py | 1 | from . import emailer_plugin
plugins = [emailer_plugin.EmailRecipePlugin]
|
sangwon03/TizenRT | refs/heads/master | external/iotivity/iotivity_1.2-rel/extlibs/gtest/gtest-1.7.0/test/gtest_shuffle_test.py | 3023 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... |
sosy-lab/benchexec | refs/heads/master | benchexec/intel_cpu_energy.py | 3 | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import collections
import logging
import os
import subprocess
import signal
import re
from... |
MwanzanFelipe/rockletonfortune | refs/heads/master | lib/django/core/management/commands/dumpdata.py | 305 | from collections import OrderedDict
from django.apps import apps
from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, router
class Command(BaseCommand):
help = ("Output the contents of the database as a fixture of the given ... |
nguyenfilip/subscription-manager | refs/heads/master | src/subscription_manager/gui/mysubstab.py | 1 | #
# Copyright (c) 2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... |
rubienr/network-monitoring | refs/heads/master | data_vis/views.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import time
from collections import OrderedDict
import speedtest_cli as speedtest
from django.db.models import Max, Min
from django.shortcuts import render
from django.shortcuts import render_to_response
from django.template.context impor... |
unreal666/outwiker | refs/heads/master | plugins/source/source/pygments/lexers/varnish.py | 6 | # -*- coding: utf-8 -*-
"""
pygments.lexers.varnish
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Varnish configuration
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups, using, this, \
... |
yongshengwang/hue | refs/heads/master | build/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py | 1775 | ######################## 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... |
ActiveState/code | refs/heads/master | recipes/Python/577262_AreCurve_using_Monte_Carlo/recipe-577262.py | 1 | # Calculating area under the curve using Monte Carlo method
# FB - 201006137
import math
import random
# define any function here!
def f(x):
return math.sqrt(1.0 - x * x)
# define any xmin-xmax interval here! (xmin < xmax)
xmin = -1.0
xmax = 1.0
# find ymin-ymax
numSteps = 1000000 # bigger the better but slower... |
cyc805/FTRerouting | refs/heads/master | src/virtual-net-device/bindings/callbacks_list.py | 127 | callback_classes = [
['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', ... |
yasoob/PythonRSSReader | refs/heads/master | venv/lib/python2.7/dist-packages/twisted/python/deprecate.py | 13 | # -*- test-case-name: twisted.python.test.test_deprecate -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Deprecation framework for Twisted.
To mark a method or function as being deprecated do this::
from twisted.python.versions import Version
from twisted.python.deprecate impo... |
joel-airspring/Diamond | refs/heads/master | src/diamond/handler/queue.py | 21 | # coding=utf-8
"""
This is a meta handler to act as a shim for the new threading model. Please
do not try to use it as a normal handler
"""
from Handler import Handler
class QueueHandler(Handler):
def __init__(self, config=None, queue=None, log=None):
# Initialize Handler
Handler.__init__(self, ... |
danilito19/django | refs/heads/master | tests/admin_ordering/models.py | 147 | # -*- coding: utf-8 -*-
from django.contrib import admin
from django.db import models
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
rank = models.IntegerField()
class Meta:
ordering = ('name',)
class Song(models.Model):
band = models.ForeignK... |
vinhqdang/MOOC | refs/heads/master | projecteuler/17 number letter counts/solve.py | 1 | # http://stackoverflow.com/questions/8982163/how-do-i-tell-python-to-convert-integers-into-words
import sys
delimiter = "" #use for this problem
def handel_upto_99(number):
predef={0:"zero",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine",10:"ten",11:"eleven",12:"twelve",13:"thirte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.