repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
nugget/home-assistant
refs/heads/dev
homeassistant/components/route53/__init__.py
3
"""Update the IP addresses of your Route53 DNS records.""" from datetime import timedelta import logging from typing import List import voluptuous as vol from homeassistant.const import CONF_DOMAIN, CONF_TTL, CONF_ZONE import homeassistant.helpers.config_validation as cv from homeassistant.helpers.event import track_...
AmadeusMop/nag-a-ramjet
refs/heads/master
test_pymysql.py
1
from collections import Counter import pymysql import getpass alphabet = ''.join(map(chr,range(ord('a'),ord('z')+1))) def to_freqs(s): c = Counter(s) return ''.join(map(str,map(c.__getitem__,alphabet))) def get_anags(s): connection = pymysql.Connect( host="nagaramjet-db.czaaw1lusahr.us-east-1.rds...
artwr/airflow
refs/heads/master
tests/operators/test_redshift_to_s3_operator.py
8
# -*- coding: utf-8 -*- # # 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 #...
eoogbe/api-client-staging
refs/heads/master
generated/python/proto-google-cloud-vision-v1/google/cloud/proto/vision/v1/text_annotation_pb2_grpc.py
460
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities
openiitbombayx/edx-platform
refs/heads/master
common/test/acceptance/pages/lms/fields.py
26
# -*- coding: utf-8 -*- """ Mixins for fields. """ from bok_choy.promise import EmptyPromise from ...tests.helpers import get_selected_option_text, select_option_by_text class FieldsMixin(object): """ Methods for testing fields in pages. """ def field(self, field_id): """ Return fiel...
meee1/ardupilotold
refs/heads/master
Tools/scripts/frame_sizes.py
351
#!/usr/bin/env python import re, sys, operator, os code_line = re.compile("^\s*\d+:/") frame_line = re.compile("^\s*\d+\s+/\* frame size = (\d+) \*/") class frame(object): def __init__(self, code, frame_size): self.code = code self.frame_size = int(frame_size) frames = [] def process_lst(filena...
benaslinjenner/chrome-app-samples
refs/heads/master
samples/push-guestbook/guestbook-srv/third_party/apiclient/__init__.py
78
__version__ = "1.0"
sbidoul/buildbot
refs/heads/master
master/buildbot/db/dbconfig.py
11
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
duramato/CouchPotatoServer
refs/heads/develop
libs/git/__init__.py
121
# Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com> # 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 li...
AlexHill/mezzanine
refs/heads/master
mezzanine/blog/__init__.py
36
""" Provides a blogging app with posts, keywords, categories and comments. Posts can be listed by month, keyword, category or author. """ from __future__ import unicode_literals from mezzanine import __version__
deschler/django-filebrowser
refs/heads/master
filebrowser/tests/test_versions.py
1
# coding: utf-8 # PYTHON IMPORTS import os import ntpath import posixpath import shutil # DJANGO IMPORTS from django.conf import settings from django.test import TestCase from django.contrib.auth.models import User from django.utils.encoding import filepath_to_uri from django.template import Context, Template, Templa...
derblub/pixelpi
refs/heads/master
modules/__init__.py
1
import thread class Module(object): def __init__(self, screen): self.screen = screen self.running = False def tick(self): raise Exception("All modules must implement tick") def run(self): while self.running: self.tick() def start(self): if self.ru...
zhukaixy/kbengine
refs/heads/master
kbe/src/lib/python/Tools/scripts/parse_html5_entities.py
67
#!/usr/bin/env python3 """ Utility for parsing HTML5 entity definitions available from: http://dev.w3.org/html5/spec/entities.json Written by Ezio Melotti and Iuliia Proskurnia. """ import os import sys import json from urllib.request import urlopen from html.entities import html5 entities_url = 'http://dev.w3...
karissa/pyeda
refs/heads/master
pyeda/boolalg/boolfunc.py
3
""" The :mod:`pyeda.boolalg.boolfunc` module implements the fundamentals of Boolean space, variables and functions. Data Types: point A dictionary of ``Variable => {0, 1}`` mappings. For example, ``{a: 0, b: 1, c: 0, d: 1}``. An N-dimensional *point* corresponds to one vertex of an N-dimensional *cube...
lcgong/sqlblock
refs/heads/master
test/test_sqltext.py
1
import pytest from sqlblock.sqltext import SQL def test_sqltext(): name, age = "abc", 28 s = SQL("[{name},{age},{age + 10}];") s += SQL(f"<{{name}},{age}>") assert len(s._segments) == 10 stmt, vals = s.get_statment() print(stmt, vals) assert stmt == '[$1,$2,$3];<$4,28>' assert vals ...
currychou/1
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/locale.py
624
def getdefaultlocale(): return __BRYTHON__.language,None def localeconv(): """ localeconv() -> dict. Returns numeric and monetary locale-specific parameters. """ # 'C' locale default values return {'grouping': [127], 'currency_symbol': '', ...
NiclasEriksen/py-towerwars
refs/heads/master
src/numpy/lib/_version.py
156
"""Utility to compare (Numpy) version strings. The NumpyVersion class allows properly comparing numpy version strings. The LooseVersion and StrictVersion classes that distutils provides don't work; they don't recognize anything like alpha/beta/rc/dev versions. """ from __future__ import division, absolute_import, pri...
DCPROGS/CVFIT
refs/heads/master
_version.py
1
__version__ = "1.0.0"
matthewbot/Kube
refs/heads/master
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...
imsplitbit/nova
refs/heads/master
nova/tests/api/openstack/common.py
25
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
dyyi/moneybook
refs/heads/master
venv/Lib/site-packages/django/contrib/gis/gdal/__init__.py
327
""" This module houses ctypes interfaces for GDAL objects. The following GDAL objects are supported: CoordTransform: Used for coordinate transformations from one spatial reference system to another. Driver: Wraps an OGR data source driver. DataSource: Wrapper for the OGR data source object, supports OGR-su...
lattwood/phantomjs
refs/heads/master
src/breakpad/src/tools/gyp/pylib/gyp/MSVSToolFile.py
138
#!/usr/bin/python2.4 # 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. """Visual Studio project reader/writer.""" import common import xml.dom import xml.dom.minidom #------------------------------------------...
rschnapka/odoo
refs/heads/7.0
addons/resource/faces/resource.py
433
#@+leo-ver=4 #@+node:@file resource.py #@@language python #@<< Copyright >> #@+node:<< Copyright >> ############################################################################ # Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free softwa...
WhySoGeeky/DroidPot
refs/heads/master
venv/lib/python2.7/site-packages/django/templatetags/cache.py
471
from __future__ import unicode_literals from django.core.cache import InvalidCacheBackendError, caches from django.core.cache.utils import make_template_fragment_key from django.template import ( Library, Node, TemplateSyntaxError, VariableDoesNotExist, ) register = Library() class CacheNode(Node): def __in...
ma314smith/home-assistant
refs/heads/dev
tests/components/sensor/test_mqtt_room.py
23
"""The tests for the MQTT room presence sensor.""" import json import datetime import unittest from unittest.mock import patch from homeassistant.bootstrap import setup_component import homeassistant.components.sensor as sensor from homeassistant.components.mqtt import (CONF_STATE_TOPIC, CONF_QOS, ...
sankhesh/VTK
refs/heads/master
Parallel/Core/Testing/Python/TestSockets.py
37
""" Driver script for testing sockets Unix only """ import os, sys, time # Fork, run server in child, client in parent pid = os.fork() if pid == 0: # exec the parent os.execv(sys.argv[1], ('-D', sys.argv[3])) else: # wait a little to make sure that the server is ready time.sleep(10) # run the c...
machado-rev/Kobocoin-Abe-Explorer
refs/heads/master
Kobocoin-Abe/base58.py
20
#!/usr/bin/env python """encode/decode base58 in the same way that Bitcoin does""" import math __b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' __b58base = len(__b58chars) def b58encode(v): """ encode v, which is a string of bytes, to base58. """ long_value = 0L for (i, c) in e...
vincentltz/ns-3-dev-git
refs/heads/master
src/fd-net-device/bindings/callbacks_list.py
144
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', ...
bestmjh47/android_kernel_kttech_e100
refs/heads/master
tools/perf/util/setup.py
4998
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
Chuban/moose
refs/heads/devel
python/peacock/tests/exodus_tab/test_CameraPlugin.py
5
#!/usr/bin/env python import sys import unittest import vtk from PyQt5 import QtWidgets from peacock.ExodusViewer.plugins.CameraPlugin import main from peacock.utils import Testing class TestCameraPlugin(Testing.PeacockImageTestCase): """ Testing for MeshControl widget. """ qapp = QtWidgets.QApplicati...
mmmicedcoffee/vexflow
refs/heads/master
site_scons/vexflow_scons.py
120
""" VexFlow / TabDiv Build Script Requires: SCons, Git, and Google Closure Compiler Copyright Mohit Cheppudira 2010 """ import os from datetime import datetime from SCons.Script import * """ Make the default zip action use the external zip command. Also add -j (--junk-paths) to the command to store only the name of ...
arokem/nipy
refs/heads/master
nipy/modalities/setup.py
3
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('modalities', parent_package, top_path) config.add_subpackage('fmr...
Ashaba/rms
refs/heads/master
rmslocalenv/lib/python2.7/site-packages/html5lib/treewalkers/_base.py
61
from __future__ import absolute_import, division, unicode_literals from six import text_type, string_types __all__ = ["DOCUMENT", "DOCTYPE", "TEXT", "ELEMENT", "COMMENT", "ENTITY", "UNKNOWN", "TreeWalker", "NonRecursiveTreeWalker"] from xml.dom import Node DOCUMENT = Node.DOCUMENT_NODE DOCTYPE = Node.DOCU...
SekoiaLab/Fastir_Collector
refs/heads/master
registry/windows2012ServerUsers.py
1
from __future__ import unicode_literals from registry.reg import _Reg class Windows2012ServerUserReg(_Reg): def __init__(self, params): _Reg.__init__(self, params) _Reg.init_win_vista_and_above(self) def csv_open_save_mru(self): super(Windows2012ServerUserReg, self)._csv_open_save_mru...
freezmeinster/avagata-site
refs/heads/dev
django/contrib/gis/tests/__init__.py
229
from django.conf import settings from django.test.simple import build_suite, DjangoTestSuiteRunner from django.utils import unittest def run_tests(*args, **kwargs): from django.test.simple import run_tests as base_run_tests return base_run_tests(*args, **kwargs) def run_gis_tests(test_labels, verbosity=1, in...
ClovisIRex/Snake-django
refs/heads/master
env/lib/python3.6/site-packages/django/contrib/admin/migrations/0002_logentry_remove_auto_add.py
331
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.utils import timezone class Migration(migrations.Migration): dependencies = [ ('admin', '0001_initial'), ] # No database changes; removes auto_add and adds default/editable. ...
opennx/nx.installer
refs/heads/master
default/channels.py
1
CHANNELS = []
palladius/gcloud
refs/heads/master
packages/gsutil/boto/boto/compat.py
79
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
laumann/servo
refs/heads/master
components/script/dom/bindings/codegen/parser/tests/test_enum.py
134
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" enum TestEnum { "", "foo", "bar" }; interface TestEnumInterface { TestEnum doFoo(boolean arg); readonly attribute TestEnum foo; }; """) results = parser.finish...
mhils/readthedocs.org
refs/heads/master
readthedocs/rtd_tests/tests/test_404.py
32
import lxml.html from django.test import TestCase from readthedocs.projects.models import Project class Testmaker(TestCase): fixtures = ["eric", "test_data"] def setUp(self): self.client.login(username='eric', password='test') self.pip = Project.objects.get(slug='pip') self.latest =...
gundalow/ansible
refs/heads/devel
test/units/module_utils/basic/test_command_nonexisting.py
21
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import sys import pytest import json import sys import pytest import subprocess import ansible.module_utils.basic from ansible.module_utils._text import to_bytes from ansible.module_utils import basic def test_run_non_existent_co...
owenson/ardupilot-sdk-python
refs/heads/master
pymavlink/generator/mavparse.py
10
#!/usr/bin/env python ''' mavlink python parse functions Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' import xml.parsers.expat, os, errno, time, sys, operator PROTOCOL_0_9 = "0.9" PROTOCOL_1_0 = "1.0" class MAVParseError(Exception): def __init__(self, message, inner_exception=Non...
daenamkim/ansible
refs/heads/devel
lib/ansible/module_utils/facts/timeout.py
135
# 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 distributed in the hope that ...
kkung/cfanalyze
refs/heads/master
cfanalyze/__main__.py
1
#!/usr/bin/env python import optparse import os import sys import logging from .fetch import Fetcher from .analyze import RefererAnalyzer, ContentTrafficAnalyzer logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) logger.addHandler(logging.StreamHandler()) def main(): parser = optparse.OptionPa...
mafiya69/sympy
refs/heads/master
sympy/polys/benchmarks/bench_galoispolys.py
97
"""Benchmarks for polynomials over Galois fields. """ from __future__ import print_function, division from sympy.polys.galoistools import gf_from_dict, gf_factor_sqf from sympy.polys.domains import ZZ from sympy import pi, nextprime from sympy.core.compatibility import range def gathen_poly(n, p, K): return gf_...
kevgathuku/compshop
refs/heads/master
manage.py
3
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.local") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
birdsarah/pyjokes
refs/heads/master
pyjokes/pyjokes.py
1
from __future__ import absolute_import import random from .jokes_en import jokes_en from .jokes_de import jokes_de from .jokes_es import jokes_es all_jokes = { 'en': jokes_en, 'de': jokes_de, 'es': jokes_es, } class LanguageNotFoundError(Exception): pass class CategoryNotFoundError(Exception): ...
d40223223/2015cdb_g6-team
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/test/test_re.py
718
# FIXME: brython: implement test.support #from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \ # cpython_only verbose = True # FIXME: brython: Not used in this module ? #import io import re # FIXME: brython: implement re.Scanner #from re import Scanner import sre_constants import sys...
PatrikKT/android_kernel_huawei_y536a1
refs/heads/cm-11.0
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
mkaluza/external_chromium_org
refs/heads/kk44
tools/telemetry/telemetry/page/actions/pinch.py
23
# 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 os from telemetry.page.actions import gesture_action from telemetry.page.actions import page_action class PinchAction(gesture_action.GestureAction): ...
Didacti/elixir
refs/heads/master
tests/test_options.py
1
""" test options """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import six from sqlalchemy import UniqueConstraint, create_engine, Column from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.exc...
lnickers2004/mongo-web-shell
refs/heads/master
webapps/configs/ivs.py
8
# Copyright 2013 10gen 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...
krafczyk/spack
refs/heads/develop
var/spack/repos/builtin/packages/vcsh/package.py
5
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
ManhIT-CMB/SpaceX-Kernel-Exynos5433
refs/heads/master
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
campbe13/openhatch
refs/heads/master
vendor/packages/Pygments/pygments/lexers/_luabuiltins.py
275
# -*- coding: utf-8 -*- """ pygments.lexers._luabuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the names and modules of lua functions It is able to re-generate itself, but for adding new functions you probably have to add some callbacks (see function module_callbacks). Do not edit th...
ychen820/microblog
refs/heads/master
y/google-cloud-sdk/platform/google_appengine/lib/django-1.4/django/contrib/comments/moderation.py
95
""" A generic comment-moderation system which allows configuration of moderation options on a per-model basis. To use, do two things: 1. Create or import a subclass of ``CommentModerator`` defining the options you want. 2. Import ``moderator`` from this module and register one or more models, passing the model...
kool79/intellij-community
refs/heads/master
python/testData/selectWord/literal/after3.py
83
x = <selection>r"hello world again"</selection>
vxvinh1511/django-social-auth
refs/heads/master
social_auth/backends/contrib/stackoverflow.py
14
from social.backends.stackoverflow import \ StackoverflowOAuth2 as StackoverflowBackend
Evervolv/android_kernel_oppo_apq8064
refs/heads/kitkat
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
jorsea/odoomrp-wip
refs/heads/8.0
sale_order_recalculate_prices/models/sale_order.py
30
# -*- encoding: utf-8 -*- ############################################################################## # # # OpenERP, Open Source Management Solution. # # ...
django-ddp/django-ddp
refs/heads/develop
dddp/migrations/0001_initial.py
3
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import dddp.models class Migration(migrations.Migration): dependencies = [ ('sessions', '0001_initial'), ('contenttypes', '0001_initial'), ] operations = [ migrations.CreateM...
kkirsche/splunk-sdk-python
refs/heads/master
docs/conf.py
2
# -*- coding: utf-8 -*- # # Splunk SDK for Python documentation build configuration file, created by # sphinx-quickstart on Fri Apr 13 12:28:15 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated...
Jaccorot/pyspider
refs/heads/master
pyspider/database/mysql/taskdb.py
73
#!/usr/bin/envutils # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-07-17 18:53:01 import re import six import time import json import mysql.connector from pyspider.libs import utils from pyspider.database.base.taskdb ...
mabushadi/dpxdt
refs/heads/master
dpxdt/server/work_queue.py
6
#!/usr/bin/env python # Copyright 2013 Brett Slatkin # # 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...
abircse06/youtube-dl
refs/heads/master
youtube_dl/extractor/vh1.py
199
from __future__ import unicode_literals from .mtv import MTVIE import re from ..utils import fix_xml_ampersands class VH1IE(MTVIE): IE_NAME = 'vh1.com' _FEED_URL = 'http://www.vh1.com/player/embed/AS3/fullepisode/rss/' _TESTS = [{ 'url': 'http://www.vh1.com/video/metal-evolution/full-episodes/pr...
jmartinm/invenio-search
refs/heads/master
invenio_search/facets/author.py
22
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2014 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...
ashuS11/librehatti_
refs/heads/master
src/librehatti/catalog/forms.py
2
from django import forms from librehatti.catalog.models import * class AddCategory(forms.Form): category_name = forms.CharField(max_length=256) categories = forms.ModelChoiceField(queryset=Category.objects.all())
brandonlee503/COMP1001-Final-Project
refs/heads/master
5 Card Poker.py
1
### #5 Card Poker #Brandon Lee """ ===Program Design=== The program consists of an implementation of the game "5 Card Poker", utilizing classes. The program utilizes a deck class to create an array of Card objects in order to simulate a realistic gaming environment with factors such as luck as well as skill. The pro...
DavidLP/home-assistant
refs/heads/dev
tests/components/homekit_controller/test_sensor.py
10
"""Basic checks for HomeKit sensor.""" from tests.components.homekit_controller.common import ( FakeService, setup_test_component) TEMPERATURE = ('temperature', 'temperature.current') HUMIDITY = ('humidity', 'relative-humidity.current') LIGHT_LEVEL = ('light', 'light-level.current') def create_temperature_sensor...
coursemdetw/2015wcm
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/binascii.py
620
"""A pure Python implementation of binascii. Rather slow and buggy in corner cases. PyPy provides an RPython version too. """ # borrowed from https://bitbucket.org/pypy/pypy/src/f2bf94943a41/lib_pypy/binascii.py class Error(Exception): pass class Done(Exception): pass class Incomplete(Exception): pass ...
Argon-Zhou/django
refs/heads/master
tests/bash_completion/tests.py
327
""" A series of tests to establish that the command-line bash completion works. """ import os import sys import unittest from django.apps import apps from django.core.management import ManagementUtility from django.test.utils import captured_stdout class BashCompletionTests(unittest.TestCase): """ Testing th...
sbesson/zeroc-ice
refs/heads/master
py/test/Ice/slicing/exceptions/run.py
1
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
ayepezv/GAD_ERP
refs/heads/master
addons/l10n_be_invoice_bba/models/__init__.py
23
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. import res_partner import account_invoice
Maccimo/intellij-community
refs/heads/master
python/testData/codeInsight/controlflow/MatchStatementClauseWithBreak.py
3
while x: match x: case 42: break y z
gilbertw/PTVS
refs/heads/master
Python/Tests/TestData/RemoveImport/ClosureReference.py
18
def f(): import something def g(): something
duducosmos/pgs4a
refs/heads/master
python-install/lib/python2.7/test/test_sha.py
137
# Testing sha module (NIST's Secure Hash Algorithm) # use the three examples from Federal Information Processing Standards # Publication 180-1, Secure Hash Standard, 1995 April 17 # http://www.itl.nist.gov/div897/pubs/fip180-1.htm import warnings warnings.filterwarnings("ignore", "the sha module is deprecated.*", ...
nan86150/ImageFusion
refs/heads/master
lib/python2.7/site-packages/mpl_toolkits/axisartist/axis_artist.py
18
""" axis_artist.py module provides axis-related artists. They are * axis line * tick lines * tick labels * axis label * grid lines The main artist class is a AxisArtist and a GridlinesCollection. The GridlinesCollection is responsible for drawing grid lines and the AxisArtist is responsible for all other artists...
Omkar20895/climate
refs/heads/master
examples/multi_model_taylor_diagram.py
5
# 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...
vipins/ccccms
refs/heads/master
env/Lib/site-packages/django/core/management/base.py
78
""" Base classes for writing management commands (named commands which can be executed through ``django-admin.py`` or ``manage.py``). """ from __future__ import with_statement import os import sys from optparse import make_option, OptionParser import traceback import django from django.core.exceptions import Imprope...
nyuszika7h/youtube-dl
refs/heads/master
youtube_dl/extractor/yandexmusic.py
8
# coding: utf-8 from __future__ import unicode_literals import re import hashlib from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, float_or_none, try_get, ) class YandexMusicBaseIE(InfoExtractor): @staticmethod def _handle_er...
awslabs/s2n
refs/heads/main
tests/integration/common/s2n_test_scenario.py
1
## # Copyright Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://aws.amazon.com/apache2.0 # # or in the "license" file accompany...
darkryder/django
refs/heads/master
tests/template_tests/filter_tests/test_truncatewords.py
235
from django.template.defaultfilters import truncatewords from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class TruncatewordsTests(SimpleTestCase): @setup({ 'truncatewords01': '{% autoescape off %}{{ a|truncatewords:"2" }} {{ b|truncatewords:...
edgedb/edgedb
refs/heads/master
tests/test_http_notebook.py
1
# # This source file is part of the EdgeDB open source project. # # Copyright 2016-present MagicStack Inc. and the EdgeDB authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
sdague/home-assistant
refs/heads/dev
homeassistant/components/insteon/__init__.py
7
"""Support for INSTEON Modems (PLM and Hub).""" import asyncio import logging from pyinsteon import async_close, async_connect, devices from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import CONF_PLATFORM, EVENT_HOMEASSISTANT_STOP from homeassistant.exceptions import ConfigEntryNotRead...
grevutiu-gabriel/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/environment_unittest.py
124
# Copyright (C) 2011 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 conditions and the f...
Lab603/PicEncyclopedias
refs/heads/master
jni-build/jni/include/tensorflow/contrib/graph_editor/reroute.py
5
# 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...
nirmeshk/oh-mainline
refs/heads/master
vendor/packages/distribute/setuptools/command/saveopts.py
167
import distutils, os from setuptools import Command from setuptools.command.setopt import edit_config, option_base class saveopts(option_base): """Save command-line options to a file""" description = "save supplied options to setup.cfg or other config file" def run(self): dist = self.distribution...
LukeMurphey/splunk-google-drive
refs/heads/master
src/bin/google_drive_app/chardet/__init__.py
270
######################## BEGIN LICENSE BLOCK ######################## # 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 your option) any later ve...
greatscottgadgets/greatfet
refs/heads/master
host/greatfet/gnuradio/i2c.py
2
# # Blocks for I2C for "software defined everything." # import ast import array import numpy as np from gnuradio import gr from greatfet import GreatFET from .block import GreatFETStreamingSource class I2CSourceBlock(GreatFETStreamingSource): """ Block that reads from an I2C device as a data source. """ ...
ProfessionalIT/maxigenios-website
refs/heads/master
sdk/google_appengine/lib/django-1.5/django/contrib/formtools/tests/wizard/namedwizardtests/tests.py
90
from __future__ import unicode_literals from django.core.urlresolvers import reverse from django.http import QueryDict from django.test import TestCase from django.contrib.auth.models import User from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.formtools.wizard.views import (NamedUrlS...
quantumlib/Cirq
refs/heads/master
cirq-core/cirq/work/sampler.py
1
# Copyright 2018 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
VAMDC/NodeSoftware
refs/heads/master
nodes/chianti/manage.py
2
#!/usr/bin/env python """ Set up the node. A first startup consists of giving the command 'python manage'. This will create an empty settings file. Copy&paste variables you want to change from settings_default.py to setup your node. Next define your models. You'll need to add the folder containing the 'models' director...
gautam1858/tensorflow
refs/heads/master
tensorflow/python/ops/signal/window_ops.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...
sabi0/intellij-community
refs/heads/master
python/testData/quickdoc/Indented.py
83
# directly in function def foo(): """<the_doc>Doc of foo. It has two lines.""" pass <the_ref>foo
Mirmik/gxx
refs/heads/master
tests/HIDE/fc11/make.py
1
#!/usr/bin/env python #coding: utf-8 from licant.modules import submodule from licant.cxx_modules import application, doit from licant.scripter import scriptq scriptq.execute("../../gxx.g.py") application("target", sources = ["main.cpp"], include_paths = ["../.."], modules = [ submodule("gxx", "posix"), su...
ahamilton55/ansible
refs/heads/devel
test/integration/targets/module_utils/module_utils/spam8/ham/__init__.py
298
eggs = 'spam8:eggs'
nakee/tora-playground
refs/heads/master
tanach/test_parser.py
1
from unittest import TestCase from dbcreator import Parser __author__ = 'nakee' class TestParser(TestCase): parser = Parser() def test_parse_big(self): print("calling function: "+self.parser.parse_verse("{{מ:אות-ג|בְּ}}")) self.assertEqual( "<big>בְּ</big>", self.parser.parse_verse("{{מ:אות-ג|בְּ}}"))...
bartvm/pylearn2
refs/heads/master
pylearn2/models/independent_multiclass_logistic.py
44
""" Multiclass-classification by taking the max over a set of one-against-rest logistic classifiers. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googleg...
ryano144/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/nestedComprehensions.py
83
def f(xs, ys): return [[(x, y) for y in ys] for x in xs]
tkf/rash
refs/heads/master
rash/model.py
1
# Copyright (C) 2013- Takafumi Arakaki # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed ...