repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ericholscher/pinax | refs/heads/master | pinax/apps/profiles/forms.py | 2 | from django import forms
from profiles.models import Profile
class ProfileForm(forms.ModelForm):
class Meta:
model = Profile
exclude = ('user', 'blogrss', 'timezone', 'language',
'twitter_user', 'twitter_password')
|
opennode/nodeconductor-assembly-waldur | refs/heads/develop | src/waldur_jira/migrations/0017_project_action.py | 2 | # Generated by Django 1.11.7 on 2018-05-17 09:51
from django.db import migrations, models
import waldur_core.core.fields
class Migration(migrations.Migration):
dependencies = [
('waldur_jira', '0016_project_template_null'),
]
operations = [
migrations.AddField(
model_name='p... |
fbossy/SickRage | refs/heads/master | tornado/test/log_test.py | 111 | #!/usr/bin/env python
#
# Copyright 2012 Facebook
#
# 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 a... |
mozeq/fros | refs/heads/master | src/pyfros/plugins/screencastrecordmydesktop.py | 1 | ## Copyright (C) 2013 ABRT team <abrt-devel-list@redhat.com>
## Copyright (C) 2013 Red Hat, Inc.
## 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 yo... |
wyc/django | refs/heads/master | django/contrib/gis/db/models/query.py | 224 | import warnings
from django.contrib.gis.db.models import aggregates
from django.contrib.gis.db.models.fields import (
GeometryField, LineStringField, PointField, get_srid_info,
)
from django.contrib.gis.db.models.lookups import GISLookup
from django.contrib.gis.db.models.sql import (
AreaField, DistanceField, ... |
unsiloai/syntaxnet-ops-hack | refs/heads/master | tensorflow/python/kernel_tests/priority_queue_test.py | 134 | # 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... |
bsmrstu-warriors/Moytri---The-Drone-Aider | refs/heads/master | ExtLibs/Mavlink/pymavlink/generator/lib/genxmlif/xmlifElementTree.py | 7 | #
# genxmlif, Release 0.9.0
# file: xmlifElementTree.py
#
# XML interface class to elementtree toolkit by Fredrik Lundh
#
# history:
# 2005-04-25 rl created
# 2007-05-25 rl performance optimization (caching) added, some bugfixes
# 2007-06-29 rl complete re-design, ElementExtension class introduced
# 2008-07-01 rl... |
ArcherSys/ArcherSys | refs/heads/master | Lib/site-packages/django/contrib/admin/utils.py | 66 | from __future__ import unicode_literals
import datetime
import decimal
from collections import defaultdict
from django.contrib.auth import get_permission_codename
from django.core.exceptions import FieldDoesNotExist
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db import models
from django.... |
kapilrastogi/Impala | refs/heads/cdh5-trunk | shell/ext-py/sqlparse-0.1.14/tests/test_filters.py | 45 | '''
Created on 24/03/2012
@author: piranna
'''
import unittest
from sqlparse.filters import StripWhitespace, Tokens2Unicode
from sqlparse.lexer import tokenize
class Test__StripWhitespace(unittest.TestCase):
sql = """INSERT INTO dir_entries(type)VALUES(:type);
INSERT INTO directories(inode)
... |
n0max/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptserve/wptserve/request.py | 44 | import base64
import cgi
import Cookie
import StringIO
import tempfile
from six.moves.urllib.parse import parse_qsl, urlsplit
from . import stash
from .utils import HTTPException
missing = object()
class Server(object):
"""Data about the server environment
.. attribute:: config
Environment configurat... |
rochacbruno/flask-admin | refs/heads/master | flask_admin/contrib/pymongo/view.py | 12 | import logging
import pymongo
from bson import ObjectId
from bson.errors import InvalidId
from flask import flash
from flask_admin._compat import string_types
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.model import BaseModelView
from flask_admin.actions import action
from flask_ad... |
cocoatomo/pygments-dmdl | refs/heads/master | dmdl/lexer.py | 1 | # -*- coding: utf-8 -*-
"""
Copyright 2016 cocoatomo
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 agr... |
cloud9ers/gurumate | refs/heads/master | environment/lib/python2.7/site-packages/IPython/nbformat/v3/__init__.py | 6 | """The main API for the v3 notebook format.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distribute... |
FedoraScientific/salome-hexablock | refs/heads/master | doc/test_doc/make_transformation/make_translation.py | 1 | # -*- coding: latin-1 -*-
# Copyright (C) 2009-2014 CEA/DEN, EDF R&D
#
# 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 ... |
dionyziz/ting | refs/heads/master | API/chat/tests/message/test_get_view.py | 3 | from chat.tests.message.common import *
from django_dynamic_fixture import G
class MessageViewGETTests(ChatTests):
def test_request_messages(self):
"""
When a valid request is sent the view should return
a JSON object containing messages. Each message should be
in the form {message... |
google-code-export/django-hotclub | refs/heads/master | libs/external_libs/python-openid-2.1.1/openid/test/test_openidyadis.py | 87 | import unittest
from openid.consumer.discover import \
OpenIDServiceEndpoint, OPENID_1_1_TYPE, OPENID_1_0_TYPE
from openid.yadis.services import applyFilter
XRDS_BOILERPLATE = '''\
<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds"
xmlns="xri://$xrd*($v*2.0)"
xmlns:... |
per06a/python-adsl | refs/heads/develop | adsl/search.py | 1 |
"""
Various searching, selecting and finding algorithms
"""
##### STDLIB
import sys
##### 3RD PARTY
##### PROJECT
import adsl.common
##### INIT AND DECLARATIONS
if sys.version_info.major >= 3:
xrange = range
##### CLASSES AND FUNCTIONS
def binsearch(array, elem, left=None, right=None, cmp_func=cmp):
""... |
mozilla/treeherder | refs/heads/master | tests/webapp/api/test_jobs_api.py | 2 | import datetime
import pytest
from dateutil import parser
from django.urls import reverse
from rest_framework.status import HTTP_400_BAD_REQUEST
from treeherder.model.models import Job, TextLogError
@pytest.mark.parametrize(
('offset', 'count', 'expected_num'),
[(None, None, 10), (None, 5, 5), (5, None, 6),... |
zeffii/SoundPetal | refs/heads/master | nodes/noise/noise.py | 1 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
paplorinc/intellij-community | refs/heads/master | python/testData/copyPaste/IndentTabIncrease.after.py | 75 | print "Line 2"
class Test:
def __init__(self):
print "Line 2"
print "Line 1"
|
Austin503/pyglet | refs/heads/master | pyglet/canvas/win32.py | 26 | #!/usr/bin/python
# $Id:$
from base import Display, Screen, ScreenMode, Canvas
from pyglet.libs.win32 import _kernel32, _user32, types, constants
from pyglet.libs.win32.constants import *
from pyglet.libs.win32.types import *
class Win32Display(Display):
def get_screens(self):
screens = []
... |
Phelimb/cbg | refs/heads/master | bigsi/tests/bloom/test_create_bloomfilter.py | 1 | from bigsi.bloom import generate_hashes
from bigsi.bloom import BloomFilter
def test_generate_hashes():
assert generate_hashes("ATT", 3, 25) == {2, 15, 17}
assert generate_hashes("ATT", 1, 25) == {15}
assert generate_hashes("ATT", 2, 50) == {15, 27}
def test_create_bloom():
for i in range(3):
... |
cosino/u-boot-cosino | refs/heads/u-boot-2012.10-cosino | tools/patman/command.py | 73 | # Copyright (c) 2011 The Chromium OS Authors.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# 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
# t... |
kustodian/ansible | refs/heads/devel | lib/ansible/plugins/cliconf/vyos.py | 7 | #
# (c) 2017 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 d... |
mcepl/youtube-dl | refs/heads/master | youtube_dl/extractor/amp.py | 27 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
mimetype2ext,
determine_ext,
)
class AMPIE(InfoExtractor):
# parse Akamai Adaptive Media Player feed
def _extract_feed_info(self, url):
item = se... |
CIBC-Internal/itk | refs/heads/master | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/dependencies.py | 2 | # Copyright 2014-2015 Insight Software Consortium.
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
"""
this module contains class that keeps dependency information of some
declaration
"""
from . import cpptypes
class imp... |
chaowyc/youtube-dl | refs/heads/master | youtube_dl/extractor/tubitv.py | 48 | # coding: utf-8
from __future__ import unicode_literals
import codecs
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request
)
from ..utils import (
ExtractorError,
int_or_none,
)
class TubiTvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www... |
rjschof/gem5 | refs/heads/master | src/mem/ruby/system/VIPERCoalescer.py | 21 | # Copyright (c) 2015 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must... |
Emergya/icm-openedx-educamadrid-platform-basic | refs/heads/ci | lms/djangoapps/mobile_api/social_facebook/courses/views.py | 42 | """
Views for courses info API
"""
from rest_framework import generics, status
from rest_framework.response import Response
from courseware.access import is_mobile_available_for_user
from student.models import CourseEnrollment
from lms.djangoapps.mobile_api.social_facebook.courses import serializers
from ...users.... |
blmoore/blogR | refs/heads/master | blogpy/imdb_getActors.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import imdb
import sys, time
from itertools import chain
def getActor(name, count):
"""
For a given actor, get their film list from IMDb,
seek budget, gross, release date, then double-check
they are *in* the film, THEN print to stdout.
"""
print >>sys.stderr, "(%d... |
snasoft/QtCreatorPluginsPack | refs/heads/master | Bin/3rdParty/vera/bin/lib/test/test_cl.py | 93 | #! /usr/bin/env python
"""Whimpy test script for the cl module
Roger E. Masse
"""
from test.test_support import verbose, import_module
cl = import_module('cl')
clattrs = ['ADDED_ALGORITHM_ERROR', 'ALAW', 'ALGORITHM_ID',
'ALGORITHM_VERSION', 'AUDIO', 'AWARE_ERROR', 'AWARE_MPEG_AUDIO',
'AWARE_MULTIRATE', 'AWCMP_CONS... |
ryandougherty/mwa-capstone | refs/heads/heroku | MWA_Tools/build/matplotlib/lib/mpl_examples/pylab_examples/date_index_formatter.py | 3 |
"""
When plotting daily data, a frequent request is to plot the data
ignoring skips, eg no extra spaces for weekends. This is particularly
common in financial time series, when you may have data for M-F and
not Sat, Sun and you don't want gaps in the x axis. The approach is
to simply use the integer index for the xd... |
GuessWhoSamFoo/pandas | refs/heads/master | pandas/tests/arrays/categorical/test_warnings.py | 2 | # -*- coding: utf-8 -*-
import pytest
import pandas as pd
import pandas.util.testing as tm
class TestCategoricalWarnings(object):
def test_tab_complete_warning(self, ip):
# https://github.com/pandas-dev/pandas/issues/16409
pytest.importorskip('IPython', minversion="6.0.0")
from IPython.c... |
giganoto/py_gdrive | refs/heads/master | __main__.py | 1 | from oauth2client import client
from oauth2client import tools
from oauth2client import file as g_file
import oauth2client
from apiclient import discovery
import os
import httplib2
from apiclient.http import MediaFileUpload
from mimetypes import types_map as python_dict
import pprint
pp = pprint.PrettyPrinter(indent=4)... |
florianholzapfel/home-assistant | refs/heads/dev | tests/components/media_player/test_cast.py | 22 | """The tests for the Cast Media player platform."""
# pylint: disable=protected-access
import unittest
from unittest.mock import patch
from homeassistant.components.media_player import cast
class FakeChromeCast(object):
"""A fake Chrome Cast."""
def __init__(self, host, port):
"""Initialize the fake... |
vlachoudis/sl4a | refs/heads/master | python/src/Lib/plat-irix5/GET.py | 132 | # Symbols from <gl/get.h>
from warnings import warnpy3k
warnpy3k("the GET module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
BCKBUFFER = 0x1
FRNTBUFFER = 0x2
DRAWZBUFFER = 0x4
DMRGB = 0
DMSINGLE = 1
DMDOUBLE = 2
DMRGBDOUBLE = 5
HZ30 = 0
HZ60 = 1
NTSC = 2
HDTV = 3
VGA = 4
IRIS3K = 5
PR60 = 6
PAL = 9
HZ3... |
AkA84/edx-platform | refs/heads/master | cms/djangoapps/contentstore/management/commands/create_course.py | 163 | """
Django management command to create a course in a specific modulestore
"""
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from xmodule.modulestore import ModuleStoreEnum
from contentstore.views.course import create_new_course_in_store
from contentstore.... |
AndrewSallans/osf.io | refs/heads/develop | website/addons/dropbox/tests/test_models.py | 1 | # -*- coding: utf-8 -*-
import os
import hashlib
from nose.tools import * # noqa (PEP8 asserts)
from framework.auth import Auth
from website.addons.dropbox.model import (
DropboxUserSettings, DropboxNodeSettings, DropboxFile
)
from tests.base import OsfTestCase
from tests.factories import UserFactory, ProjectFac... |
risicle/django | refs/heads/master | tests/field_subclassing/fields.py | 170 | from __future__ import unicode_literals
import json
import warnings
from django.db import models
from django.utils import six
from django.utils.deconstruct import deconstructible
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text, python_2_unicode_compatible
#... |
Gustry/QGIS | refs/heads/master | tests/src/python/test_qgsrastertransparencywidget.py | 32 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsRasterRange.
.. 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.
"""
__... |
Hyperyon/p3-labyrinthe | refs/heads/master | setup.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import labyrinth
with open('requirements.txt') as f:
requires = f.read().split('\n')
setup(
name='nz-labyrinth',
version=3.6,
packages=find_packages(),
install_requires=requires,
author='Nico Zhan',... |
SymbiFlow/python-fpga-interchange | refs/heads/master | fpga_interchange/field_cache.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
""" Provides a FieldCache which caches data ab... |
srinathv/bokeh | refs/heads/master | examples/plotting/server/simple_stream.py | 43 | # The plot server must be running. To start the server, run
# $ bokeh-server
# If you don't wish to persist the data/objects from this plot,
# then a faster backend is the "memory" backend:
# $ bokeh-server --backend=memory
# Go to http://localhost:5006/bokeh to view this plot
import time
import numpy as np
from... |
makerbot/ReplicatorG | refs/heads/master | skein_engines/skeinforge-47/fabmetheus_utilities/geometry/creation/linear_bearing_cage.py | 12 | """
Linear bearing cage.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
from fabmetheus_utilities.geometry.creation import extrude
from fabmetheus_... |
camon/Flexget | refs/heads/develop | flexget/utils/log.py | 2 | """Logging utilities"""
from __future__ import unicode_literals, division, absolute_import
import logging
import hashlib
from datetime import datetime, timedelta
from sqlalchemy import Column, Integer, String, DateTime, Index
from flexget import db_schema
from flexget import logger as f_logger
from flexget.utils.sqla... |
ratnania/pigasus | refs/heads/master | python/fem/tracelog.py | 1 | # -*- coding: UTF-8 -*-
#! /usr/bin/python
__author__="ARA"
__all__ = ['tracelog']
__date__ ="$Mai 09, 2014 10:34:00 PM$"
from . import common_obj as com
class tracelog:
def __init__(self):
self._com = com.common_obj()
def printlog(self, message, condition=True, level=0):
self._com.pyfem.pyfe... |
ceph/samba | refs/heads/ceph | buildtools/wafsamba/samba_pidl.py | 11 | # waf build tool for building IDL files with pidl
import os
import Build
from TaskGen import feature, before
from samba_utils import SET_TARGET_TYPE, TO_LIST, LOCAL_CACHE
def SAMBA_PIDL(bld, pname, source,
options='',
output_dir='.',
generate_tables=True):
'''Build a I... |
snahelou/awx | refs/heads/devel | awx/main/notifications/hipchat_backend.py | 1 | # Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
import logging
import requests
from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _
from awx.main.notifications.base import AWXBaseEmailBackend
logger = logging.getLogger('awx.main.notifications.hipchat_backend... |
sysalexis/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/unittest/test/dummy.py | 1061 | # Empty module for testing the loading of modules
|
lgarren/spack | refs/heads/develop | var/spack/repos/builtin/packages/zoltan/package.py | 3 | ##############################################################################
# Copyright (c) 2013-2017, 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... |
hsinhuang/yaly | refs/heads/master | yaly/lex.py | 1 | #!/usr/bin/env python
# coding:utf-8
"""lexical analysis"""
class Token:
"""
A token is a string of one or more characters that is significant
as a group.
"""
def __init__(self, lexical_unit, value, lineno, lexer):
assert type(lexical_unit) == str
self.__lexical_unit__ = lexical_un... |
Tao-Ma/gpdb | refs/heads/master | src/test/tinc/ext/unittest2/__init__.py | 155 | """
unittest2
unittest2 is a backport of the new features added to the unittest testing
framework in Python 2.7. It is tested to run on Python 2.4 - 2.6.
To use unittest2 instead of unittest simply replace ``import unittest`` with
``import unittest2``.
Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-2010 P... |
ondrokrc/gramps | refs/heads/master | gramps/gen/lib/citation.py | 1 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2010 Michiel D. Nauta
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... |
caioserra/apiAdwords | refs/heads/master | examples/adspygoogle/dfp/v201308/audience_segment_service/get_all_audience_segments.py | 2 | #!/usr/bin/python
#
# Copyright 2013 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... |
Simclass/EDXD_Analysis | refs/heads/master | pyxe/data_io.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 17:40:07 2015
@author: casimp
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from six import string_types, binary_type
import h5py
import os
import numpy as np
f... |
dplbsd/zcaplib | refs/heads/master | head/crypto/heimdal/lib/wind/rfc4518.py | 88 | #!/usr/local/bin/python
# -*- coding: iso-8859-1 -*-
# $Id$
# Copyright (c) 2004, 2008 Kungliga Tekniska Högskolan
# (Royal Institute of Technology, Stockholm, Sweden).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... |
llluiop/bitcoin | refs/heads/master | qa/rpc-tests/zapwallettxes.py | 6 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework import BitcoinTestFramework
from util import *
class ZapWalletTXesTest (BitcoinTestFrame... |
EricNeedham/assignment-1 | refs/heads/master | venv/lib/python2.7/copy_reg.py | 4 | /usr/lib/python2.7/copy_reg.py |
daxxi13/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/jeuxvideo.py | 25 | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
class JeuxVideoIE(InfoExtractor):
_VALID_URL = r'http://.*?\.jeuxvideo\.com/.*/(.*?)-\d+\.htm'
_TEST = {
'url': 'http://www.jeuxvideo.com/reportages-videos-jeux/0004/00046170/tearaway-pl... |
w1ll1am23/home-assistant | refs/heads/dev | tests/components/smarttub/test_sensor.py | 4 | """Test the SmartTub sensor platform."""
import pytest
@pytest.mark.parametrize(
"entity_suffix,expected_state",
[
("state", "normal"),
("flow_switch", "open"),
("ozone", "off"),
("uv", "off"),
("blowout_cycle", "inactive"),
("cleanup_cycle", "inactive"),
]... |
ppwwyyxx/tensorflow | refs/heads/master | tensorflow/lite/experimental/micro/tools/make/merge_arduino_zips.py | 23 | # Copyright 2019 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... |
mattesno1/Sick-Beard | refs/heads/master | lib/hachoir_parser/file_system/linux_swap.py | 90 | """
Linux swap file.
Documentation: Linux kernel source code, files:
- mm/swapfile.c
- include/linux/swap.h
Author: Victor Stinner
Creation date: 25 december 2006 (christmas ;-))
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (ParserError, GenericVector,
UInt32, String,
Bytes,... |
dronefly/dronefly.github.io | refs/heads/master | flask/lib/python2.7/site-packages/coverage/annotate.py | 76 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Source file annotation for coverage.py."""
import io
import os
import re
from coverage.files import flat_rootname
from coverage.misc import isolate_module
from... |
shoopio/shoop-simple-theme | refs/heads/master | shoop_simple_theme/__init__.py | 1 | # This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
"""
A Bootstrap-powered simple theme for Shoop.
"""
import shoop.apps
import shoop.xtheme
class Th... |
xoner/mate-grid | refs/heads/master | create-shotcuts.py | 1 | from subprocess import call
# Change to match mate-grid installation path
mate_grid_path = '/opt/mate-grid/mate-grid.py'
shortcuts = {
'mate-grid-move-next-mon': {
'name': 'Move window to next Monitor',
'action': 'python {} -cm'.format(mate_grid_path),
'binding': '<Shift><Mod4>Right'
}... |
UQ-UQx/edx-platform_lti | refs/heads/master | common/djangoapps/student/management/commands/create_random_users.py | 9 | """
A script to create some dummy users
"""
import uuid
from django.core.management.base import BaseCommand
from student.models import CourseEnrollment
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from student.views imp... |
h3llrais3r/Auto-Subliminal | refs/heads/master | autosubliminal/providers/__init__.py | 1054 | # coding=utf-8
|
matthiasdiener/spack | refs/heads/develop | var/spack/repos/builtin/packages/py-guidata/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... |
google-code/android-scripting | refs/heads/master | python/src/Lib/test/bad_coding2.py | 181 | #coding: utf8
print '我'
|
timokoola/finnkinotxt | refs/heads/master | requests/packages/urllib3/_collections.py | 201 | from __future__ import absolute_import
from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
... |
ymero/learn-python3 | refs/heads/master | samples/async/coroutine.py | 20 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def consumer():
r = ''
while True:
n = yield r
if not n:
return
print('[CONSUMER] Consuming %s...' % n)
r = '200 OK'
def produce(c):
c.send(None)
n = 0
while n < 5:
n = n + 1
print('[PRODUCER... |
jlward/django-authority | refs/heads/master | example/exampleapp/models.py | 10644 | from django.db import models
# Create your models here.
|
SnappleCap/oh-mainline | refs/heads/master | vendor/packages/python-otp/setup.py | 16 | #!/usr/bin/python
from distutils.core import setup
setup(name="python-otp",
version = "1.0",
description = "Python module for one-time passwords",
author = "Gustavo Niemeyer",
author_email = "niemeyer@conectiva.com",
url = "http://moin.conectiva.com.br/PythonOtp",
license = "GPL",
... |
monmaks/ckanext-ceon | refs/heads/master | ckanext/ceon/config.py | 3 | #!/usr/bin/python
# vim: set fileencoding=utf-8
from logging import getLogger
from pylons import config
from paste.deploy.converters import asbool
DOI_TEST_PREFIX = '10.5072'
DOI_ENDPOINT = 'https://mds.datacite.org'
DOI_TEST_ENDPOINT = 'https://test.datacite.org/mds'
def get_doi_prefix():
return DOI_TEST_PREF... |
dwcarder/sdn-ix-demo | refs/heads/master | exabgp-3.4.3/lib/exabgp/protocol/ip/__init__.py | 1 | # encoding: utf-8
"""
ip/__init__.py
Created by Thomas Mangin on 2010-01-15.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
import socket
from exabgp.protocol.family import AFI
from exabgp.protocol.family import SAFI
# =========================================================================== IP
#... |
uwosh/uwosh.addcard | refs/heads/master | uwosh/addcard/validators.py | 2 | #from Products.validation.interfaces import ivalidator
from Products.validation.interfaces.IValidator import IValidator
from zope.interface import implements
import xmlrpclib
import socket
webServiceBaseURL = 'http://ws.it.uwosh.edu:8080/ws/'
webService = xmlrpclib.Server(webServiceBaseURL, allow_none=1)
class Course... |
AstroPrint/AstroBox | refs/heads/master | src/ext/sockjs/tornado/transports/rawwebsocket.py | 9 | # -*- coding: utf-8 -*-
"""
sockjs.tornado.transports.rawwebsocket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Raw websocket transport implementation
"""
import logging
import socket
from sockjs.tornado import websocket, session
from sockjs.tornado.transports import base
LOG = logging.getLogger("tornado.gener... |
mhoffma/micropython | refs/heads/master | tests/basics/async_for2.py | 49 | # test waiting within "async for" aiter/anext functions
import sys
if sys.implementation.name == 'micropython':
# uPy allows normal generators to be awaitables
coroutine = lambda f: f
else:
import types
coroutine = types.coroutine
@coroutine
def f(x):
print('f start:', x)
yield x + 1
yield... |
adrienbrault/home-assistant | refs/heads/dev | tests/components/owntracks/test_device_tracker.py | 8 | """The tests for the Owntracks device tracker."""
import json
from unittest.mock import patch
import pytest
from homeassistant.components import owntracks
from homeassistant.const import STATE_NOT_HOME
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry, async_fire_mqtt_mes... |
ghchinoy/tensorflow | refs/heads/master | tensorflow/python/tpu/topology_test.py | 15 | # 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... |
krishauser/pyOptimalMotionPlanning | refs/heads/master | pomp/planners/test.py | 1 | from __future__ import print_function,division
from six import iteritems
from builtins import range
from .profiler import Profiler
import time
def testPlanner(planner,numTrials,maxTime,filename):
print("Testing planner for %d trials, %f seconds"%(numTrials,maxTime))
print("Saving to",filename)
... |
nrhine1/scikit-learn | refs/heads/master | examples/neighbors/plot_regression.py | 349 | """
============================
Nearest Neighbors regression
============================
Demonstrate the resolution of a regression problem
using a k-Nearest Neighbor and the interpolation of the
target using both barycenter and constant weights.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@... |
passiweinberger/nupic | refs/heads/master | tests/integration/nupic/opf/opf_checkpoint_test/experiments/temporal_multi_step/base.py | 62 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2012-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... |
lzimann/tgstation | refs/heads/master | tools/expand_filedir_paths.py | 166 | #!/usr/bin/env python
import re, os, sys, fnmatch
# Regex pattern to extract the directory path in a #define FILE_DIR
filedir_pattern = re.compile(r'^#define\s*FILE_DIR\s*"(.*?)"')
# Regex pattern to extract any single quoted piece of text. This can also
# match single quoted strings inside of double quote... |
jrief/djangocms-cascade | refs/heads/master | cmsplugin_cascade/render_template.py | 1 | from django.forms import MediaDefiningClass
from django.forms.fields import ChoiceField
from django.utils.translation import gettext_lazy as _
from django.template.loader import get_template, TemplateDoesNotExist
from entangled.forms import EntangledModelFormMixin
from cmsplugin_cascade import app_settings
class Rend... |
dacjames/mara-lang | refs/heads/develop | bootstrap/mara/test/test_parser.py | 1 | from .. import parser as parser_module
from .. import node as n
from programs import program_name_resolution
import pytest
# pylint: disable=W0621
# pylint: disable=C0330
xfail = pytest.mark.xfail
def maramodule(name, code):
return 'module {n} {c} end'.format(n=name, c=code)
@pytest.fixture
def parser():
... |
YanjieGao/sparrow | refs/heads/master | deploy/third_party/boto-2.1.1/boto/ec2/elb/instancestate.py | 26 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
CanalTP/navitia | refs/heads/dev | source/tyr/tyr/external_service.py | 1 | # coding: utf-8
# Copyright (c) 2001-2021, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility a... |
iamahuman/angr | refs/heads/master | angr/misc/hookset.py | 3 | """
These classes perform some python magic that we use to implement the nesting of exploration technique methods.
This process is formalized as a "hooking" of a python method - each exploration technique's methods "hooks" a method of the same name on the simulation manager class.
"""
class HookSet:
"""
A Hook... |
pombredanne/scrapy | refs/heads/master | scrapy/core/spidermw.py | 1 | """
Spider Middleware manager
See documentation in docs/topics/spider-middleware.rst
"""
import six
from twisted.python.failure import Failure
from scrapy.middleware import MiddlewareManager
from scrapy.utils.defer import mustbe_deferred
from scrapy.utils.conf import build_component_list
def _isiterable(possible_iter... |
rversteegen/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/uuid.py | 59 | r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uuid1() ... |
anryko/ansible | refs/heads/devel | lib/ansible/modules/remote_management/wakeonlan.py | 52 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Dag Wieers <dag@wieers.com>
# 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',
... |
TangHao1987/intellij-community | refs/heads/master | python/testData/paramInfo/KwdFunction.py | 83 | def foo(a, b, **c):
pass
foo(<arg1>1, <arg2>2, <arg3>x=3, <arg4>**{'y':4}, <arg5>)
|
acshan/odoo | refs/heads/8.0 | addons/website_event_sale/tests/test_ui.py | 338 | import openerp.tests
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
def test_admin(self):
self.phantom_js("/", "openerp.Tour.run('event_buy_tickets', 'test')", "openerp.Tour.tours.event_buy_tickets")
def test_demo(self):
s... |
morucci/repoxplorer | refs/heads/master | repoxplorer/index/projects.py | 1 | # Copyright 2016, Fabien Boucher
#
# 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 ... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/graph_objs/isosurface/slices/__init__.py | 10 | import sys
if sys.version_info < (3, 7):
from ._x import X
from ._y import Y
from ._z import Z
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._x.X", "._y.Y", "._z.Z"]
)
|
dostavro/dotfiles | refs/heads/master | sublime2/Packages/Package Control/package_control/downloaders/no_ca_cert_exception.py | 11 | from .downloader_exception import DownloaderException
class NoCaCertException(DownloaderException):
"""
An exception for when there is no CA cert for a domain name
"""
def __init__(self, message, domain):
self.domain = domain
super(NoCaCertException, self).__init__(message)
|
stroykova/luigi | refs/heads/master | test/contrib/dataproc_test.py | 7 | """This is an integration test for the Dataproc-luigi binding.
This test requires credentials that can access GCS & access to a bucket below.
Follow the directions in the gcloud tools to set up local credentials.
"""
import unittest
try:
import oauth2client
from luigi.contrib import dataproc
from googleap... |
fnouama/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/core/management/commands/compilemessages.py | 373 | import codecs
import os
import sys
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
def has_bom(fn):
f = open(fn, 'r')
sample = f.read(4)
return sample[:3] == '\xef\xbb\xbf' or \
sample.startswith(codecs.BOM_UTF16_LE) or \
sample.sta... |
kisna72/django | refs/heads/master | tests/template_tests/filter_tests/test_wordcount.py | 521 | from django.template.defaultfilters import wordcount
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class WordcountTests(SimpleTestCase):
@setup({'wordcount01': '{% autoescape off %}{{ a|wordcount }} {{ b|wordcount }}{% endautoescape %}'})
def ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.