repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jspan/Open-Knesset | refs/heads/master | agendas/urls.py | 8 | #encoding: UTF-8
from django.conf.urls import url, patterns, include
from django.utils.translation import ugettext
from django.views.generic.base import TemplateView
from models import Agenda
from views import AgendaListView
from views import AgendaDetailView
from views import AgendaMkDetailView
from views import Agen... |
uchuugaka/WebSocket-for-Python | refs/heads/master | test/test_messaging.py | 10 | # -*- coding: utf-8 -*-
import os
import unittest
from ws4py.framing import Frame, \
OPCODE_CONTINUATION, OPCODE_TEXT, \
OPCODE_BINARY, OPCODE_CLOSE, OPCODE_PING, OPCODE_PONG
from ws4py.messaging import *
from ws4py.compat import *
class WSMessagingTest(unittest.TestCase):
def test_bytearray_text_messag... |
paulbodean88/automation-design-patterns | refs/heads/master | src/factory/pages/search.py | 1 | """
Description: search functionality
@author: Paul Bodean
@date: 10/08/2017
"""
from typing import Union
from selenium.webdriver import Chrome, Firefox
class Search(object):
"""
Search page methods implementation
"""
SEARCH_CONTAINER = '//*[@id="masthead-search-term"]'
SEARCH_BUTTON = '//*[@id="... |
RunningLight/machinekit | refs/heads/master | src/emc/usr_intf/axis/scripts/mdi.py | 27 | #!/usr/bin/env python
# This is a component of AXIS, a front-end for LinuxCNC
# Copyright 2004, 2005, 2006 Jeff Epler <jepler@unpythonic.net>
#
# 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... |
mce35/agocontrol | refs/heads/master | devices/ipx800/agoipx800.py | 1 | #! /usr/bin/python
# -*- coding: utf-8 -*-
# IPX800 relay board client
# http://gce-electronics.com
# copyright (c) 2013 tang
import sys
import os
import agoclient
import threading
import time
import logging
from pyipx800v3 import Ipx800v3
from qpid.datatypes import uuid4
import json
DEVICEMAPFILE = os.path.join(ag... |
dparlevliet/zelenka-report-storage | refs/heads/master | server-db/twisted/trial/test/test_assertions.py | 8 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for assertions provided by C{SynchronousTestCase} and C{TestCase},
provided by L{twisted.trial.unittest}.
L{TestFailureTests} demonstrates that L{SynchronousTestCase.fail} works, so that
is the only method on C{twisted.trial.unittest.Sy... |
moijes12/oh-mainline | refs/heads/master | mysite/account/forms.py | 9 | # This file is part of OpenHatch.
# Copyright (C) 2010 Parker Phinney
# Copyright (C) 2009, 2010 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the ... |
mikel-egana-aranguren/SADI-Galaxy-Docker | refs/heads/master | galaxy-dist/lib/galaxy/tools/actions/metadata.py | 1 | from __init__ import ToolAction
from galaxy.datatypes.metadata import JobExternalOutputMetadataWrapper
from galaxy.util.odict import odict
from galaxy.util.json import dumps
import logging
log = logging.getLogger( __name__ )
class SetMetadataToolAction( ToolAction ):
"""Tool action used for setting external metad... |
grischa/cmsplugin-filer | refs/heads/develop | src/cmsplugin_filer_video/migrations/0001_initial.py | 13 | # 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 'FilerVideo'
db.create_table('cmsplugin_filervideo', (
('cmsplugin_ptr', self.g... |
andrewyoung1991/abjad | refs/heads/master | abjad/tools/agenttools/test/test_agenttools_MutationAgent_respell_with_sharps.py | 2 | # -*- encoding: utf-8 -*-
from abjad import *
def test_agenttools_MutationAgent_respell_with_sharps_01():
note = Note(('df', 4), 4)
mutate(note).respell_with_sharps()
assert note.written_pitch == NamedPitch('cs', 4)
def test_agenttools_MutationAgent_respell_with_sharps_02():
chord = Chord([('df',... |
CdavM/bts | refs/heads/master | private/export.py | 1 | #! /usr/bin/env python
import subprocess
print("Connecting to the server database...")
try:
text = subprocess.check_output("meteor mongo --url purple.meteor.com", shell=True)
print("Successfully connected.")
except:
print("Connection failed.")
print("Exiting script.")
exit()
client_value = text[10:25]
password_... |
Pexego/alimentacion | refs/heads/7.0 | stock_location_templates/stock_location_templates.py | 2 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved
# $Marta Vázquez Rodríguez$ <marta@pexego.es>
#
# This program is free software: you can redistribute it and/or modify
# it unde... |
Eficent/odoomrp-wip | refs/heads/8.0 | product_variants_no_automatic_creation/tests/test_product_variants.py | 10 | # -*- coding: utf-8 -*-
# © 2016 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp.tests.common import TransactionCase
class TestProductVariant(TransactionCase):
def setUp(self):
super(TestProductVariant, self).setUp()
self.tmpl_model = s... |
yangsensen/Crawler | refs/heads/master | X500/pymongo/message.py | 18 | # Copyright 2009-2014 MongoDB, 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 writin... |
JDShu/SCOPE | refs/heads/master | askbot/conf/markup.py | 6 | """
Settings that modify processing of user text input
"""
from askbot.conf.settings_wrapper import settings
from askbot.conf.super_groups import DATA_AND_FORMATTING
from askbot.deps.livesettings import ConfigurationGroup
from askbot.deps.livesettings import BooleanValue, StringValue, LongStringValue
from askbot impor... |
lokirius/python-for-android | refs/heads/master | python-build/python-libs/gdata/build/lib/atom/auth.py | 297 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 required by... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/tcg/series7/decorative_atst_chair.py | 85615 | import sys
def setup(core, object):
return |
kcpawan/django | refs/heads/master | tests/bash_completion/management/commands/test_command.py | 378 | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("--list", action="store_true", dest="list",
help="Print all options")
def handle(self, *args, **options):
pass
|
openworm/PyOpenWorm | refs/heads/dev | tests/RDFLibTest.py | 2 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import unittest
import rdflib
class RDFLibTest(unittest.TestCase):
"""'Learning tests' for RDFLib, our backend library that interfaces with the database as an RDF graph."""
@classmethod
def setUpClass(cls):
cls.ns = {"ns1" : "http://... |
trombastic/PyScada | refs/heads/master | pyscada/export/migrations/0008_auto_20161124_1003.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-24 10:03
from __future__ import unicode_literals
from django.db import migrations
from pytz import UTC
from datetime import datetime
def convert_unixtime_float_to_datetime(apps,schema_editor):
ExportTask = apps.get_model("export","ExportTask")
... |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v22/tests/db_functions/math/test_ceil.py | 57 | import math
from decimal import Decimal
from django.db.models import DecimalField
from django.db.models.functions import Ceil
from django.test import TestCase
from django.test.utils import register_lookup
from ..models import DecimalModel, FloatModel, IntegerModel
class CeilTests(TestCase):
def test_null(self)... |
tectronics/bfpy | refs/heads/master | src/bfpy/__init__.py | 5 | #!/usr/bin/env python
# -*- coding: latin-1; py-indent-offset:4 -*-
################################################################################
#
# This file is part of BfPy
#
# BfPy is a Python library to communicate with the Betfair Betting Exchange
# Copyright (C) 2010 Daniel Rodriguez (aka Daniel Rodriksson)
... |
spring01/libPSI | refs/heads/master | lib/python/qcdb/dbproc.py | 1 | #
#@BEGIN LICENSE
#
# PSI4: an ab initio quantum chemistry software package
#
# 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 ver... |
kontron/robotframework-ipmilibrary | refs/heads/master | src/IpmiLibrary/sdr.py | 1 | # Copyright 2014 Kontron Europe 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 agreed to in w... |
kxliugang/edx-platform | refs/heads/master | lms/djangoapps/certificates/management/commands/ungenerated_certs.py | 73 | """
Management command to find all students that need certificates for
courses that have finished, and put their cert requests on the queue.
"""
import logging
import datetime
from pytz import UTC
from django.core.management.base import BaseCommand, CommandError
from certificates.models import certificate_status_for_st... |
craigcitro/pydatalab | refs/heads/master | legacy_tests/stackdriver/monitoring/__init__.py | 90 | # 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 by applicable law or agreed ... |
cnsoft/kbengine-cocos2dx | refs/heads/cocos2dx-cnsoft | kbe/src/lib/python/Mac/Tools/Doc/setup.py | 48 | # Build and install an Apple Help Viewer compatible version of the Python
# documentation into the framework.
# Code by Bill Fancher, with some modifications by Jack Jansen.
#
# You must run this as a two-step process
# 1. python setupDocs.py build
# 2. Wait for Apple Help Indexing Tool to finish
# 3. python setupDocs.... |
hehongliang/tensorflow | refs/heads/master | tensorflow/compiler/tests/reduce_window_test.py | 22 | # 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... |
pombredanne/happyboom | refs/heads/master | happyboom/test/common.py | 1 | from Queue import Empty as Queue_Empty
from contextlib import contextmanager
from happyboom.client.async_client import AsyncClient
from happyboom.common.network import DEFAULT_HOST, DEFAULT_PORT
def getAsyncResponses(client):
responses = []
while True:
try:
response = client.async_responses... |
chrisism/plugin.program.advanced.emulator.launcher | refs/heads/master | tests/utils_kodi_test.py | 1 | import unittest, mock, os, sys
from mock import *
from fakes import *
import xbmcaddon
from resources.utils import *
from resources.constants import *
class Test_utils_kodi_tests(unittest.TestCase):
ROOT_DIR = ''
TEST_DIR = ''
TEST_ASSETS_DIR = ''
@classmethod
def setUpClass(cls):
... |
bdelliott/wordgame | refs/heads/master | web/django/contrib/localflavor/id/forms.py | 311 | """
ID-specific Form helpers
"""
import re
import time
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
postcode_re = re.compil... |
trueblue2704/AskMeAnything | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/requests/packages/__init__.py | 1849 | from __future__ import absolute_import
from . import urllib3
|
sankalpg/Essentia_tonicDebug_TEMP | refs/heads/master | test/src/unittest/highlevel/test_gaiatransform.py | 10 | #!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), e... |
rec/BiblioPixel | refs/heads/dev | test/bibliopixel/control/extractor_test.py | 2 | import collections, fractions, unittest
from bibliopixel.control import extractor
KEYS_BY_TYPE = {
'note_on': ('channel', 'type', 'note', 'velocity'),
'control_change': ('channel', 'type', 'control', 'value'),
'pitchwheel': ('channel', 'type', 'pitch'),
}
NORMALIZERS = {
'pitch': lambda x: fractions.F... |
mehdy/py-trello | refs/heads/master | trello/label.py | 1 | # -*- coding: utf-8 -*-
from __future__ import with_statement, print_function, absolute_import
class Label(object):
"""
Class representing a Trello Label.
"""
def __init__(self, client, label_id, name, color=""):
self.client = client
self.id = label_id
self.name = name
... |
BrainTech/pre-pisak | refs/heads/master | modules/book.py | 1 | #!/bin/env python2.7
# -*- coding: utf-8 -*-
# This file is part of AT-Platform.
#
# AT-Platform 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 late... |
MSeifert04/astropy | refs/heads/master | astropy/io/fits/header.py | 3 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import collections
import copy
import itertools
import re
import warnings
from .card import Card, _pad, KEYWORD_LENGTH, UNDEFINED
from .file import _File
from .util import (encode_ascii, decode_ascii, fileobj_closed,
fileobj_is_binary, ... |
rduivenvoorde/QGIS | refs/heads/master | tests/src/python/test_core_additions.py | 5 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for core additions
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__a... |
waldyrious/GraphUI | refs/heads/master | old/fnf/code/DisjointSets.py | 6 | class DisjointSets(object):
def __init__(self):
self.sets = []
def _set_of(self, item):
for s in self.sets:
for s_item in s:
if item == s_item:
return s
return None
def set_of(self, item):
s = self._set_of(item)
if s i... |
bundgus/python-playground | refs/heads/master | json-playground/flatten-json-gist.py | 1 | # https://gist.github.com/higarmi/6708779
import json
"""
example: The following JSON document:
{"maps":[{"id1":"blabla","iscategorical1":"0", "perro":[{"dog1": "1", "dog2": "2"}]},{"id2":"blabla","iscategorical2":"0"}],
"masks":{"id":"valore"},
"om_points":"value",
"parameters":{"id":"valore"}}
will have the followi... |
khalibartan/Antidote-DM | refs/heads/master | Antidotes DM/youtube_dl/extractor/mdr.py | 5 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
determine_ext,
int_or_none,
parse_duration,
parse_iso8601,
xpath_text,
)
class MDRIE(InfoExtractor):
IE_DESC = 'MDR.DE and KiKA'
_VALID_URL ... |
supriyasingh01/github_basics | refs/heads/master | Internetworking Distributed Project/finalProject/ovs/pox-master/pox/web/webmessenger.py | 6 | # Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... |
sergiocorato/server-tools | refs/heads/8.0 | base_user_reset_access/tests/test_base_user_reset_access.py | 21 | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of base_user_reset_access,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# base_user_reset_access is free software:
# you can redistribute it an... |
TeachAtTUM/edx-platform | refs/heads/master | lms/djangoapps/support/urls.py | 2 | """
URLs for the student support app.
"""
from django.conf.urls import url
from lms.djangoapps.support.views.contact_us import ContactUsView
from support.views.certificate import CertificatesSupportView
from support.views.course_entitlements import EntitlementSupportView
from support.views.enrollments import Enrollmen... |
girving/tensorflow | refs/heads/master | tensorflow/contrib/nccl/python/ops/nccl_dependency_test.py | 18 | # 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... |
thx0701/HexFiend | refs/heads/master | documentation_tools/build_documentation.py | 4 | #!/usr/bin/env python
import sys, os, subprocess, distutils.spawn
env = os.getenv
norm = os.path.normpath
src_root = env("SOURCE_ROOT")
if src_root == None:
# We've gotta figure it out ourselves
script_path = norm(os.getcwd() + '/' + sys.argv[0])
src_root = os.path.dirname(os.path.dirname(script_path))
... |
maoy/zknova | refs/heads/zk-servicegroup | nova/api/openstack/compute/contrib/floating_ips_bulk.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 IBM
# 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/LI... |
EricCline/CEM_inc | refs/heads/master | env/lib/python2.7/site-packages/south/management/commands/testserver.py | 169 | from django.core.management.commands import testserver
from south.management.commands import patch_for_test_db_setup
class Command(testserver.Command):
def handle(self, *args, **kwargs):
patch_for_test_db_setup()
super(Command, self).handle(*args, **kwargs)
|
louietsai/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_locale.py | 46 | from test.support import run_unittest, verbose
from platform import linux_distribution
import unittest
import locale
import sys
import codecs
enUS_locale = None
def get_enUS_locale():
global enUS_locale
if sys.platform == 'darwin':
import os
tlocs = ("en_US.UTF-8", "en_US.ISO8859-1", "en_US")
... |
elky/django | refs/heads/master | tests/gis_tests/geoapp/tests.py | 5 | import tempfile
from io import StringIO
from django.contrib.gis import gdal
from django.contrib.gis.db.models import Extent, MakeLine, Union, functions
from django.contrib.gis.geos import (
GeometryCollection, GEOSGeometry, LinearRing, LineString, MultiLineString,
MultiPoint, MultiPolygon, Point, Polygon, from... |
JamesLinEngineer/RKMC | refs/heads/Jarvis | addons/script.module.urlresolver/lib/urlresolver/plugins/lib/jsunpack.py | 67 | """
urlresolver XBMC Addon
Copyright (C) 2013 Bstrdsmkr
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.... |
MontiniCristian/IsChat | refs/heads/master | Server/IsServer.py | 1 | """
Written by:
Montini Cristian: montinicristian@gmail.com
Uberti Davide: ubertidavide@gmail.com
For any question contact us via mail.
"""
import os
import socket
import threading
from time import sleep
banner = '''
______
\ / _____ _____
... |
X-dark/Flexget | refs/heads/master | flexget/plugins/urlrewrite_serienjunkies.py | 8 | from __future__ import unicode_literals, division, absolute_import
import re
import logging
from flexget import plugin
from flexget.event import event
from flexget.plugins.plugin_urlrewriting import UrlRewritingError
from flexget.utils import requests
from flexget.utils.soup import get_soup
log = logging.getLogger('s... |
mrozekma/Sprint | refs/heads/master | handlers/users.py | 1 | from __future__ import division
from base64 import b64encode, b64decode
from datetime import datetime
from imghdr import what as imgtype
from itertools import groupby
from StringIO import StringIO
from rorn.Box import SuccessBox, ErrorBox
from rorn.Session import delay, undelay
from Settings import settings
from User... |
Moobusy/learnpython | refs/heads/master | config.py | 1 | # -*- coding: utf-8 -*-
class Config:
DEBUG = False
TESTING = False
class DevelopmentConfig(Config):
DEBUG = True
TESTING = True
MONGODB_SETTINGS = {
'db': 'docer',
'host': '127.0.0.1',
'port': 27017
} |
pbrazdil/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/subdirectory/gyptest-SYMROOT-default.py | 399 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies building a target and a subsidiary dependent target from a
.gyp file in a subdirectory, without specifying an explicit output b... |
MrSwiss/SpockBot | refs/heads/master | spock/mcmap/smpmap.py | 2 | """
Used for storing map data
Chunks are packed in X, Z, Y order
The array walks down X, every 16 elements you enter a new Z-level
ex.
[0] - [15] are X = 0-15, Z = 0, Y = 0
[16] - [31] are X = 0-15, Z = 1, Y = 0
and so on
Every 256 elements you enter a new Y-level
ex.
[0]-[255] are X = 0-15, Z = 0-15, Y = 0
[256]-[51... |
tragiclifestories/django | refs/heads/master | django/contrib/humanize/templatetags/humanize.py | 526 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
from datetime import date, datetime
from decimal import Decimal
from django import template
from django.conf import settings
from django.template import defaultfilters
from django.utils.encoding import force_text
from django.utils.formats imp... |
bulv1ne/django-utils | refs/heads/master | utils/pipeline_compilers.py | 1 | from functools import lru_cache
import sass
from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
from pipeline.compilers import CompilerBase
from .sass_functions.svg_to_data_uri import svg_to_data_uri
def svg_to_data_uri_(file_):
return svg_to_data_uri(file_, get_include_p... |
ashutrix03/inteygrate_flaskapp-master | refs/heads/master | build/lib/yowsup/layers/protocol_notifications/layer.py | 62 | from yowsup.layers import YowLayer, YowLayerEvent, YowProtocolLayer
from .protocolentities import *
from yowsup.layers.protocol_acks.protocolentities import OutgoingAckProtocolEntity
class YowNotificationsProtocolLayer(YowProtocolLayer):
def __init__(self):
handleMap = {
"notification": (self.r... |
micropython/micropython | refs/heads/master | tests/float/cmath_fun.py | 10 | # test the functions imported from cmath
try:
from cmath import *
except ImportError:
print("SKIP")
raise SystemExit
# make sure these constants exist in cmath
print("%.5g" % e)
print("%.5g" % pi)
test_values_non_zero = []
base_values = (0.0, 0.5, 1.2345, 10.0)
for r in base_values:
for i in base_val... |
krisys/django | refs/heads/master | tests/auth_tests/test_models.py | 15 | from django.conf.global_settings import PASSWORD_HASHERS
from django.contrib.auth import get_user_model
from django.contrib.auth.hashers import get_hasher
from django.contrib.auth.models import (
AbstractUser, Group, Permission, User, UserManager,
)
from django.contrib.contenttypes.models import ContentType
from dj... |
mavit/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/dpkg_selections.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: 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__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
alesnav/p2ptv-pi | refs/heads/master | acestream/ACEStream/Core/Overlay/OverlayApps.py | 4 | #Embedded file name: ACEStream\Core\Overlay\OverlayApps.pyo
from MetadataHandler import MetadataHandler
from threading import Lock
from threading import currentThread
from time import time
from traceback import print_exc
import sys
from ACEStream.Core.BitTornado.BT1.MessageID import *
from ACEStream.Core.BuddyCast.budd... |
snowzjx/ns3-buffer-management | refs/heads/master | src/visualizer/visualizer/ipython_view.py | 100 | """
Backend to the console plugin.
@author: Eitan Isaacson
@organization: IBM Corporation
@copyright: Copyright (c) 2007 IBM Corporation
@license: BSD
All rights reserved. This program and the accompanying materials are made
available under the terms of the BSD which accompanies this distribution, and
is available ... |
vicenteneto/online-judge-solutions | refs/heads/master | URI/1-Beginner/1144.py | 1 | # -*- coding: utf-8 -*-
for i in range(1, int(raw_input()) + 1):
ii = i ** 2
iii = i ** 3
print '%d %d %d' % (i, ii, iii)
print '%d %d %d' % (i, ii + 1, iii + 1)
|
streambuf/interactive_site_qa | refs/heads/master | manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "askmoiseev.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
xtiankisutsa/MARA_Framework | refs/heads/master | tools/decompilers/Krakatau/Krakatau/java/throws.py | 4 | from ..ssa import objtypes
from . import ast
# A simple throws declaration inferrer that only considers throw statements within the method
# this is mostly just useful to make sure the ExceptionHandlers test compiles
def _visit_statement(env, stmt):
if isinstance(stmt, ast.ThrowStatement):
return stmt.ex... |
enitihas/SAC-Website | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py | 203 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, detect_encoding, ZipFi... |
retomerz/intellij-community | refs/heads/master | python/testData/formatter/twoLinesBetweenTopLevelFunctions_after.py | 83 | class D:
pass
def foo():
pass
def bar():
pass
class C:
pass
|
networkn3rd/ncclient | refs/heads/master | examples/nc07.py | 27 | #! /usr/bin/env python2.6
#
# Delete a list of existing users from the running configuration using
# edit-config and the candidate datastore protected by a lock.
#
# $ ./nc07.py broccoli bob alice
import sys, os, warnings
warnings.simplefilter("ignore", DeprecationWarning)
from ncclient import manager
template = """... |
the-engine-room/replication-sprint-02 | refs/heads/master | crowdataapp/migrations/0016_auto__add_field_documentsetfieldentry_valid.py | 1 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'DocumentSetFieldEntry.valid'
db.add_column(u'crowdataapp_documentsetfieldentry', 'valid',
... |
kasioumis/invenio | refs/heads/master | invenio/legacy/websubmit/functions/Ask_For_Record_Details_Confirmation.py | 13 | # This file is part of Invenio.
# Copyright (C) 2008, 2010, 2011 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 option) any later version.
#
# ... |
saradbowman/osf.io | refs/heads/develop | addons/base/views.py | 2 | import datetime
from rest_framework import status as http_status
import os
import uuid
import markupsafe
from future.moves.urllib.parse import quote
from django.utils import timezone
from flask import make_response
from flask import redirect
from flask import request
import furl
import jwe
import jwt
import waffle
fro... |
CospanDesign/sdb | refs/heads/master | sdb/tools/generate.py | 1 | # this file is part of SDB.
#
# SDB 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.
#
# SDB is distributed in the hope that it will be ... |
biodrone/plex-desk | refs/heads/master | desk/flask/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py | 1777 | ######################## 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... |
cursesun/scrapy | refs/heads/master | tests/test_utils_misc/__init__.py | 151 | import sys
import os
import unittest
from scrapy.item import Item, Field
from scrapy.utils.misc import load_object, arg_to_iter, walk_modules
__doctests__ = ['scrapy.utils.misc']
class UtilsMiscTestCase(unittest.TestCase):
def test_load_object(self):
obj = load_object('scrapy.utils.misc.load_object')
... |
go-bears/Final-Project | refs/heads/master | weblogo-3.4_rd/corebio/matrix.py | 1 |
# Copyright (c) 2005 Gavin E. Crooks
# Copyright (c) 2006 John Gilman
# This software is distributed under the MIT Open Source License.
# <http://www.opensource.org/licenses/mit-license.html>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated docu... |
tooreht/django-jsonsuit | refs/heads/master | jsonsuit/app_settings.py | 1 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def check_theme(name):
if name in AVAILABLE_THEMES:
return name
else:
raise ImproperlyConfigured(
'JSONSUIT_WIDGET_THEME must be one of {}'.format(
', '.join(AVAILABLE_THEMES)))... |
izonder/intellij-community | refs/heads/master | python/testData/inspections/PyNumpyType/Empty.py | 69 | def empty(shape, dtype=None, order='C'): # real signature unknown; restored from __doc__
"""
empty(shape, dtype=float, order='C')
Return a new array of given shape and type, without initializing entries.
Parameters
----------
shape : int or tuple of int
Shape of the... |
home-assistant/home-assistant | refs/heads/dev | tests/components/startca/test_sensor.py | 14 | """Tests for the Start.ca sensor platform."""
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.startca.sensor import StartcaData
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
DATA_GIGABYTES,
HTTP_NOT_FOUND,
PERCENTAGE,
)
from homeassistant.helpers.aio... |
nemesisdesign/django | refs/heads/master | tests/swappable_models/tests.py | 16 | from __future__ import unicode_literals
from swappable_models.models import Article
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core import management
from django.test import TestCase, override_settings
from django.utils.six import StringIO
... |
jimkmc/micropython | refs/heads/master | tests/basics/dict_iterator.py | 118 | d = {1: 2, 3: 4}
els = []
for i in d:
els.append((i, d[i]))
print(sorted(els))
|
jbzdak/pygenie | refs/heads/master | pygenie/__init__.py | 1 | __author__ = 'jb'
from pygenie.pygenie import PYGenieObj, open_cam_source, SourceType, OpenFlags
from pygenie.lib.params import ParamAlias, PARAM_GENERATOR, SampleDescription, EnergyCalibration |
tuxis-ie/pdns | refs/heads/master | regression-tests.recursor-dnssec/test_DNS64.py | 4 | import dns
import os
from recursortests import RecursorTest
class DNS64RecursorTest(RecursorTest):
_auth_zones = {
'8': {'threads': 1,
'zones': ['ROOT']}
}
_confdir = 'DNS64'
_config_template = """
auth-zones=example.dns64=configs/%s/example.dns64.zone
auth-zones+=in-ad... |
tompecina/legal | refs/heads/master | legal/sir/migrations/0005_auto_20161009_0304.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-09 03:04
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sir', '0004_auto_20161009_0217'),
]
operations = [
... |
x2Ident/x2Ident | refs/heads/master | mitmproxy/test/mitmproxy/console/test_palettes.py | 2 | import mitmproxy.console.palettes as palettes
from .. import tutils
@tutils.skip_appveyor
class TestPalette:
def test_helptext(self):
for i in palettes.palettes.values():
assert i.palette(False)
for i in palettes.palettes.values():
assert i.palette(True)
|
ActiveState/code | refs/heads/master | recipes/Python/578935_Garden_Requirements_Calculator/recipe-578935.py | 1 | '''
9-16-2014
Ethan D. Hann
Garden Requirements Calculator
'''
import math
#This program will take input from the user to determine the amount of gardening materials needed
print("Garden Requirements Calculator")
print("ALL UNITS ENTERED ARE ASSUMED TO BE IN FEET")
print("____________________________________________... |
timj/scons | refs/heads/master | src/test_pychecker.py | 1 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... |
stoq/stoq-server | refs/heads/master | stoqserver/lib/duplicatibackup.py | 1 | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Copyright (C) 2020 Stoq Tecnologia <http://www.stoq.com.br>
# All rights reserved
#
# This program 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;... |
hejuna/bite-project | refs/heads/master | deps/gdata-python-client/src/gdata/test_data.py | 103 | #!/usr/bin/python
#
# Copyright (C) 2006 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 required by applicable law ... |
DXCanas/content-curation | refs/heads/develop | contentcuration/contentcuration/migrations/0060_merge.py | 5 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-04-03 17:45
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0059_auto_20170402_1504'),
('contentcuration', '0059_merge'),
('c... |
rue89-tech/edx-platform | refs/heads/master | lms/envs/cms/microsite_test.py | 110 | """
This is a localdev test for the Microsite processing pipeline
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
# Pylint gets confused by path.py instances, which report themselves ... |
legoater/skiboot | refs/heads/master | external/xscom-utils/adu_scoms.py | 1 | #!/usr/bin/python
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# Python library for in-band SCom access
# (based on xscom-utils from OPAL firmware)
#
# Copyright 2018 IBM Corp.
import os, sys, struct, getopt
class XSCom(object):
def __init__(self):
self.name = "xscom"
self.base = "/sys/kernel/debu... |
chansource/brother | refs/heads/master | quokka/modules/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
jopohl/urh | refs/heads/master | src/urh/awre/MessageTypeBuilder.py | 1 | from urh.signalprocessing.ChecksumLabel import ChecksumLabel
from urh.signalprocessing.FieldType import FieldType
from urh.signalprocessing.MessageType import MessageType
from urh.signalprocessing.ProtocoLabel import ProtocolLabel
class MessageTypeBuilder(object):
def __init__(self, name: str):
self.name... |
heimdalerp/heimdalerp | refs/heads/master | persons/views.py | 2 | from persons import models, serializers
from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet
class PhysicalAddressViewSet(ReadOnlyModelViewSet):
queryset = models.PhysicalAddress.objects.all()
serializer_class = serializers.PhysicalAddressSerializer
class CompanyViewSet(ModelViewSet):
... |
jounex/hue | refs/heads/master | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/config.py | 56 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library 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 (at you... |
flypy/flypy | refs/heads/master | flypy/lib/arrays/vectorize.py | 1 | # -*- coding: utf-8 -*-
"""
flypy.vectorize().
"""
from __future__ import print_function, division, absolute_import
from flypy import sjit, jit, typeof, parse
from .ndarrayobject import NDArray, Dimension, EmptyDim
from flypy.runtime.obj.core import head, tail, NoneType, Type
import numpy as np
#===---------------... |
StefanRijnhart/odoomrp-wip | refs/heads/8.0 | mrp_production_real_costs/models/mrp_production.py | 4 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.