repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
realgo/luigi | refs/heads/master | test/parameter_test.py | 3 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
caot/intellij-community | refs/heads/master | python/testData/fillParagraph/docstringOneParagraph_after.py | 83 | __author__ = 'ktisha'
def foo():
"""
This is my docstring. There are many like it, but this one mine. My docstring is my best friend. it is my life. I must master it as I must master my life.
This is my docstring. There are many like it, but this one mine. My docstring is my best friend. it is my life. I
must mas... |
BrainDamage/Flexget | refs/heads/develop | flexget/plugins/filter/private_torrents.py | 11 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('priv_torrents')
class FilterPrivateTorrents(object):
"""How to handle private torrents.
private_torrents: yes|no
Example::
privat... |
pcuzner/ceph-iscsi-config | refs/heads/master | ceph_iscsi_config/gateway_object.py | 1 | #!/usr/bin/env python
import ceph_iscsi_config.settings as settings
from ceph_iscsi_config.common import Config
from ceph_iscsi_config.utils import CephiSCSIError
class GWObject(object):
def __init__(self, cfg_type, cfg_type_key, logger, control_settings):
self.control_settings = control_settings
... |
yqm/sl4a | refs/heads/master | python/src/Tools/i18n/makelocalealias.py | 52 | #!/usr/bin/env python
"""
Convert the X11 locale.alias file into a mapping dictionary suitable
for locale.py.
Written by Marc-Andre Lemburg <mal@genix.com>, 2004-12-10.
"""
import locale
# Location of the alias file
LOCALE_ALIAS = '/usr/lib/X11/locale/locale.alias'
def parse(filename):
f = open(fil... |
jasonbot/django | refs/heads/master | django/db/backends/mysql/creation.py | 193 | from django.db.backends.base.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
def sql_table_creation_suffix(self):
suffix = []
test_settings = self.connection.settings_dict['TEST']
if test_settings['CHARSET']:
suffix.append('CHARACTER SET %s' ... |
benhylau/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/win/gyptest-cl-calling-convention.py | 108 | #!/usr/bin/env python
# Copyright (c) 2014 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.
"""
Make sure calling convention setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGy... |
Allow2CEO/browser-ios | refs/heads/master | brave/node_modules/hashset-cpp/vendor/depot_tools/third_party/gsutil/gslib/commands/perfdiag.py | 51 | # Copyright 2012 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 a... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/furniture/all/shared_bestine_quest_statue.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/all/shared_bestine_quest_statue.iff"
result.attribute_tem... |
openstates/openstates.org | refs/heads/develop | people_admin/migrations/0002_deltaset_persondelta.py | 1 | # Generated by Django 2.2.16 on 2021-03-02 16:46
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_US... |
rdobson/auto-cert-kit | refs/heads/master | acktools/net/__init__.py | 2 | import random
def generate_mac():
"""
This function will generate a random MAC.
The function generates a MAC with the Xensource, Inc. OUI '00:16:3E'.
Care should be taken to ensure duplicates are not used.
"""
mac = [ 0x00, 0x16, 0x3e,
random.randint(0x00, 0x7f),
ran... |
Shrews/PyGerrit | refs/heads/master | webapp/django/contrib/gis/utils/geoip.py | 7 | """
This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R)
C API (http://www.maxmind.com/app/c). This is an alternative to the GPL
licensed Python GeoIP interface provided by MaxMind.
GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts.
For IP-based geolocation, t... |
drglove/SickRage | refs/heads/master | lib/subliminal/tasks.py | 170 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... |
captain-proton/aise | refs/heads/master | hci/exercise_8/src/main/python/main.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import random
import math
import csv
from PySide2.QtCore import Qt, Slot, Signal, QObject, QPoint
from PySide2.QtGui import QPainter, QBrush, QPen, QColor, QMouseEvent
from PySide2.QtWidgets import\
(QAction, QApplication, QMainWindow,
QStatusBar, QVBo... |
lokirius/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/turtledemo/nim.py | 65 | """ turtle-example-suite:
tdemo_nim.py
Play nim against the computer. The player
who takes the last stick is the winner.
Implements the model-view-controller
design pattern.
"""
import turtle
import random
import time
SCREENWIDTH = 640
SCREENHEIGHT = 480
MINSTICKS = 7
MAXSTICKS = 31
HUNIT = SCR... |
jackrzhang/zulip | refs/heads/master | zerver/migrations/0090_userprofile_high_contrast_mode.py | 16 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-07 15:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0089_auto_20170710_1353'),
]
operations = [
migrations.AddField(
model_name='userprofile',
... |
larvasapiens/htm-teul | refs/heads/master | Learning/SpanishTestSet.py | 1 | """
Automatically generated Test Data Set
"""
trainingData = (
(['mover', 'a', 'el', 'este'], ['mover-event', 'derecha-event']),
(['mover', 'a', 'arriba'], ['mover-event', 'arriba-event']),
(['mover', 'a', 'el', 'sur'], ['mover-event', 'abajo-event']),
(['mover', 'parala', 'izquierda'], ['mover-event',... |
keyurpatel076/MissionPlannerGit | refs/heads/master | packages/IronPython.StdLib.2.7.4/content/Lib/poplib.py | 223 | """A POP3 client class.
Based on the J. Myers POP3 draft, Jan. 96
"""
# Author: David Ascher <david_ascher@brown.edu>
# [heavily stealing from nntplib.py]
# Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97]
# String method conversion and test jig improvements by ESR, February 2001.
# Added the POP3_SSL clas... |
chrsrds/scikit-learn | refs/heads/master | sklearn/__check_build/setup.py | 113 | # Author: Virgile Fritsch <virgile.fritsch@inria.fr>
# License: BSD 3 clause
import numpy
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('__check_build', parent_package, top_path)
config.add_extension('_check_build',
... |
ashhher3/scikit-learn | refs/heads/master | sklearn/linear_model/coordinate_descent.py | 4 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Gael Varoquaux <gael.varoquaux@inria.fr>
#
# License: BSD 3 clause
import sys
import warnings
from abc import ABCMeta, abstractmethod
import n... |
roderickvd/nzbToMedia | refs/heads/master | libs/bs4/tests/test_html5lib.py | 293 | """Tests to ensure that the html5lib tree builder generates good trees."""
import warnings
try:
from bs4.builder import HTML5TreeBuilder
HTML5LIB_PRESENT = True
except ImportError, e:
HTML5LIB_PRESENT = False
from bs4.element import SoupStrainer
from bs4.testing import (
HTML5TreeBuilderSmokeTest,
... |
kanagasabapathi/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_generators.py | 49 | tutorial_tests = """
Let's try a simple generator:
>>> def f():
... yield 1
... yield 2
>>> for i in f():
... print(i)
1
2
>>> g = f()
>>> next(g)
1
>>> next(g)
2
"Falling off the end" stops the generator:
>>> next(g)
Traceback (most recent call last... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/lib/python2.7/dist-packages/papyon/gnet/proxy/abstract.py | 2 | ../../../../../../share/pyshared/papyon/gnet/proxy/abstract.py |
smiller171/ansible | refs/heads/devel | lib/ansible/playbook/included_file.py | 7 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
chaincoin/chaincoin | refs/heads/0.18 | test/functional/feature_includeconf.py | 19 | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests the includeconf argument
Verify that:
1. adding includeconf to the configuration file causes the inc... |
bnewbold/openwrt | refs/heads/rooter | scripts/dl_cleanup.py | 131 | #!/usr/bin/env python
"""
# OpenWRT download directory cleanup utility.
# Delete all but the very last version of the program tarballs.
#
# Copyright (c) 2010 Michael Buesch <mb@bu3sch.de>
"""
import sys
import os
import re
import getopt
# Commandline options
opt_dryrun = False
def parseVer_1234(match, filepath):
... |
Dexhub/MTX | refs/heads/master | ext/ply/ply/__init__.py | 838 | # PLY package
# Author: David Beazley (dave@dabeaz.com)
__all__ = ['lex','yacc']
|
JoeWoo/grpc | refs/heads/master | src/python/grpcio_test/grpc_test/_adapter/_c_test.py | 17 | # Copyright 2015, 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... |
jacobajit/ion | refs/heads/master | intranet/apps/events/notifications.py | 1 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.core.urlresolvers import reverse
from ..notifications.emails import email_send
def event_approval_request(request, event):
subject = "Event Approval Request from {}".format(event.user)
emails = [settings.APPROVAL_EMAIL]
base_url = req... |
nonsk131/USRP2016 | refs/heads/master | fitMultinest_triplet.py | 1 | import matplotlib
matplotlib.use('Agg')
from isochrones.dartmouth import Dartmouth_Isochrone
from isochrones.starmodel import StarModel
from isochrones.observation import ObservationTree
import pandas as pd
import matplotlib.pyplot as plt
import sys
#from mpi4py import MPI
#comm = MPI.COMM_WORLD
#rank = comm.Get_rank(... |
tardisgallifrey/python | refs/heads/master | hello.py | 1 | #!/usr/bin/python
print "hello world"
|
xNUTs/PTVS | refs/heads/master | Python/Tests/TestData/DjangoProjectWithSubDirectory/project/config/settings.py | 18 | # Django settings for DjangoProjectWithSubDirectory project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'orac... |
floyd-fuh/afl-crash-analyzer | refs/heads/master | AflCrashAnalyzer.py | 1 | #!/usr/bin/env python2.7
'''
AFL crash analyzer, crash triage for the American Fuzzy Lop fuzzer
Copyright (C) 2015 floyd
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 ve... |
yamt/neutron | refs/heads/master | quantum/tests/unit/metaplugin/fake_plugin.py | 7 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012, Nachi Ueno, NTT MCL, 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/L... |
pigeonflight/strider-plone | refs/heads/master | docker/appengine/lib/django-1.5/django/middleware/locale.py | 102 | "This is the locale selecting middleware that will look at accept headers"
from django.conf import settings
from django.core.urlresolvers import (is_valid_path, get_resolver,
LocaleRegexURLResolver)
from django.http import HttpResponseRedirect
from django.utils.cache import patch_... |
dongjoon-hyun/neon | refs/heads/master | setup.py | 2 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems 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
#
# ... |
PetrDlouhy/django | refs/heads/master | tests/migrations2/models.py | 560 | # Required for migration detection (#22645)
|
SanchayanMaity/gem5 | refs/heads/CS570 | src/arch/x86/isa/insts/x87/arithmetic/addition.py | 50 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
phoneguy/ardupilot | refs/heads/master | Tools/ardupilotwaf/boards.py | 5 | #!/usr/bin/env python
# encoding: utf-8
from collections import OrderedDict
import sys
import waflib
from waflib.Configure import conf
_board_classes = {}
class BoardMeta(type):
def __init__(cls, name, bases, dct):
super(BoardMeta, cls).__init__(name, bases, dct)
if 'abstract' not in cls.__dict... |
zerolab/wagtail | refs/heads/main | wagtail/bin/wagtail.py | 6 | #!/usr/bin/env python
import fileinput
import fnmatch
import os
import re
import sys
from argparse import ArgumentParser
from difflib import unified_diff
from django.core.management import ManagementUtility
CURRENT_PYTHON = sys.version_info[:2]
REQUIRED_PYTHON = (3, 5)
if CURRENT_PYTHON < REQUIRED_PYTHON:
sys.... |
arante/pyloc | refs/heads/master | microblog/flask/lib/python3.5/site-packages/sqlalchemy/sql/annotation.py | 23 | # sql/annotation.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The :class:`.Annotated` class and related routines; creates hash-equivalent
cop... |
havard024/prego | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/command/bdist_egg.py | 286 | """setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
import sys, os, marshal
from setuptools import Command
from distutils.dir_util import remove_tree, mkpath
try:
# Python 2.7 or >=3.2
from sysconfig import get_path, get_python_version
def _g... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/encodings/bz2_codec.py | 58 | """ Python 'bz2_codec' Codec - bz2 compression encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
"""
import ... |
lukeiwanski/tensorflow | refs/heads/master | tensorflow/python/framework/op_def_registry.py | 196 | # 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... |
SBillion/aegroupware | refs/heads/master | modules/djangobb_forum/markups/bbmarkup.py | 2 | import re
from django.conf import settings
from django.utils.html import escape
from django.template.defaultfilters import linebreaksbr
from django.utils.safestring import mark_safe
__all__ = ('BBCODE_RULES', 'bbcode')
#regexp for url validation from django URLField + added ftp:// and allowing spaces around
URL_RE ... |
colinmorris/char-rbm | refs/heads/master | Utils.py | 1 | import numpy as np
import time
import logging
from collections import Counter
from ShortTextCodec import NonEncodableTextException
from sklearn.preprocessing import OneHotEncoder
DEBUG_TIMING = False
# Taken from StackOverflow
def timeit(f):
if not DEBUG_TIMING:
return f
def timed(*args, **kw):
... |
TomTranter/OpenPNM | refs/heads/master | openpnm/phases/mixtures/DryAir.py | 1 | from openpnm.phases.mixtures import IdealGas, species
import openpnm.models as mods
from openpnm.utils import logging
logger = logging.getLogger(__name__)
class DryAir(IdealGas):
r"""
"""
def __init__(self, network, **kwargs):
super().__init__(network=network, components=[], **kwargs)
N2... |
jianghuaw/nova | refs/heads/master | nova/policies/instance_usage_audit_log.py | 6 | # Copyright 2016 Cloudbase Solutions Srl
# 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 r... |
goofwear/raspberry_pwn | refs/heads/master | src/pentest/revshells/encrypted_http_shell/shell.py | 5 | #!/usr/bin/python
##########################################################################################################################
#
#
# AES Encrypted Reverse HTTP Shell by:
#
# Dave Kennedy (ReL1K)
# http://www.secmaniac.com
#
####################################################################... |
Yannig/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/aireos.py | 131 | #
# (c) 2017, James Mighion <@jmighion>
#
# 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.
#
... |
Wyliodrin/wyliodrin-server | refs/heads/master | tests/localhost/servers/server3.py | 1 | # Test connection error logs
import BaseHTTPServer, SimpleHTTPServer
import SocketServer
import ssl
import os
import json
class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
l = []
def do_POST(self):
length = int(self.headers['Content-Length'])
r_json = json.loads(self.rfile.read(length).dec... |
glls/Cinnamon | refs/heads/master | files/usr/share/cinnamon/cinnamon-menu-editor/cme/util.py | 6 | # -*- coding: utf-8 -*-
# Alacarte Menu Editor - Simple fd.o Compliant Menu Editor
# Copyright (C) 2006 Travis Watkins
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either... |
bfirsh/django-old | refs/heads/master | tests/regressiontests/forms/validators.py | 50 | from unittest import TestCase
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
class TestFieldWithValidators(TestCase):
def test_all_errors_get_reported(self):
field = forms.CharField(
validators=[validators.validate_integer, valid... |
tdruez/scancode-toolkit | refs/heads/master | src/scancode/__init__.py | 3 | #
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... |
labero/kupfer | refs/heads/master | waflib/extras/relocation.py | 5 | #! /usr/bin/env python
# encoding: utf-8
"""
Waf 1.6
Try to detect if the project directory was relocated, and if it was,
change the node representing the project directory. Just call:
waf configure build
Note that if the project directory name changes, the signatures for the tasks using
files in that directory wi... |
TechnoJays/robot2015 | refs/heads/master | archive/src/driver_station/target.py | 6 | """This module describes information about vision targets."""
class Side(object):
"""Enumeration for which side of the wall a target is on."""
LEFT = 0
RIGHT = 1
UNKNOWN = 2
EITHER = 3
class Target(object):
"""Target information."""
side = None
distance = None
angle = None
is... |
ftomassetti/intellij-community | refs/heads/master | python/testData/refactoring/move/packageImport/after/src/a.py | 45382 | |
jonfaustman/django-frontend | refs/heads/master | run_tests.py | 1 | import os, sys
from django.conf import settings
import django
DIRNAME = os.path.dirname(__file__)
if django.VERSION[1] < 4:
# If the version is NOT django 4 or greater
# then remove the TZ setting.
settings.configure(
DATABASES={
'default': {
... |
t-hey/QGIS-Original | refs/heads/master | python/plugins/processing/gui/ContextAction.py | 6 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ContextAction.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... |
seann1/portfolio5 | refs/heads/master | .meteor/dev_bundle/python/Lib/test/test_StringIO.py | 84 | # Tests StringIO and cStringIO
import unittest
import StringIO
import cStringIO
import types
import array
import sys
from test import test_support
class TestGenericStringIO(unittest.TestCase):
# use a class variable MODULE to define which module is being tested
# Line of data to test as string
_line = '... |
adamtiger/tensorflow | refs/heads/master | tensorflow/python/keras/datasets/boston_housing/__init__.py | 73 | # 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... |
AppMinistry/mesos-toolbox | refs/heads/master | lib/configs/mesos_config.py | 2 | import hashlib, os, sys, time
from lib.utils import Utils
from lib.configs.defaults import Defaults
class MesosConfigMeta(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(MesosConfigMeta, cls).__call__(*args, **kwargs)
... |
jnewland/home-assistant | refs/heads/ci | tests/components/image_processing/common.py | 18 | """Collection of helper methods.
All containing methods are legacy helpers that should not be used by new
components. Instead call the service directly.
"""
from homeassistant.components.image_processing import DOMAIN, SERVICE_SCAN
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import callback
... |
BellScurry/gem5-fault-injection | refs/heads/master | ext/ply/example/yply/yparse.py | 165 | # parser for Unix yacc-based grammars
#
# Author: David Beazley (dave@dabeaz.com)
# Date : October 2, 2006
import ylex
tokens = ylex.tokens
from ply import *
tokenlist = []
preclist = []
emit_code = 1
def p_yacc(p):
'''yacc : defsection rulesection'''
def p_defsection(p):
'''defsection : definitions SEC... |
perimosocordiae/scipy | refs/heads/master | scipy/signal/tests/mpsig.py | 13 | """
Some signal functions implemented using mpmath.
"""
try:
import mpmath
except ImportError:
mpmath = None
def _prod(seq):
"""Returns the product of the elements in the sequence `seq`."""
p = 1
for elem in seq:
p *= elem
return p
def _relative_degree(z, p):
"""
Return rela... |
Versent/ansible | refs/heads/devel | test/units/playbook/test_block.py | 228 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
Antiun/yelizariev-saas | refs/heads/8.0 | saas_server/models/res_config.py | 8 | from openerp import models, fields
class SaasServerWizard(models.TransientModel):
_name = 'saas_server.config.settings'
_inherit = 'res.config.settings'
|
jiahaoliang/group-based-policy | refs/heads/lbaasv2-mitaka-pull-request | gbpservice/neutron/tests/unit/nfp/configurator/lib/test_filter.py | 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
Pretagonist/Flexget | refs/heads/develop | tests/test_pluginapi.py | 2 | from __future__ import unicode_literals, division, absolute_import
import os
import glob
import pytest
from flexget import plugin, plugins
from flexget.event import event, fire_event
class TestPluginApi(object):
"""
Contains plugin api related tests
"""
config = 'tasks: {}'
def test_unknown_pl... |
nafex/pyload | refs/heads/stable | module/plugins/accounts/MegaRapidCz.py | 6 | # -*- coding: utf-8 -*-
import re
import time
from module.plugins.internal.Account import Account
class MegaRapidCz(Account):
__name__ = "MegaRapidCz"
__type__ = "account"
__version__ = "0.38"
__status__ = "testing"
__description__ = """MegaRapid.cz account plugin"""
__license__ ... |
ahuarte47/QGIS | refs/heads/master | python/plugins/processing/algs/gdal/translate.py | 15 | # -*- coding: utf-8 -*-
"""
***************************************************************************
translate.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... |
kkoksvik/FreeCAD | refs/heads/master | src/Mod/Drawing/Init.py | 33 | # FreeCAD init script of the Image module
# (c) 2001 Juergen Riegel
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This fil... |
jjx02230808/project0223 | refs/heads/master | sklearn/neighbors/tests/test_neighbors.py | 23 | from itertools import product
import pickle
import numpy as np
from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix,
dok_matrix, lil_matrix)
from sklearn import metrics
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_scor... |
alfanugraha/LUMENS-repo | refs/heads/master | processing/DockableMirrorMap/DlgAbout.py | 2 | # -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from ui.DlgAbout_ui import Ui_DlgAbout
from DockableMirrorMap import name, description, version
import platform
try:
import resources
except ImportError:
import resources_rc
class DlgAbout(QDialog, Ui_DlgAbout):
def __init__(self, pare... |
unaizalakain/django | refs/heads/master | tests/template_tests/filter_tests/test_safe.py | 521 | from django.test import SimpleTestCase
from ..utils import setup
class SafeTests(SimpleTestCase):
@setup({'safe01': '{{ a }} -- {{ a|safe }}'})
def test_safe01(self):
output = self.engine.render_to_string('safe01', {'a': '<b>hello</b>'})
self.assertEqual(output, '<b>hello</b> -- ... |
neeasade/qutebrowser | refs/heads/master | tests/unit/browser/webkit/test_history.py | 1 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 Softwa... |
chadspratt/AveryDB | refs/heads/master | field.py | 1 | """Field stores all information about a given field.
The field object is used to represent fields from any data format and assists
with converting fields between the inputs and the output."""
##
# Copyright 2013 Chad Spratt
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this ... |
VanirAOSP/external_chromium_org | refs/heads/kk44 | third_party/tlslite/tlslite/utils/cryptomath.py | 77 | """cryptomath module
This module has basic math/crypto code."""
import os
import math
import base64
import binascii
# The sha module is deprecated in Python 2.6
try:
import sha
except ImportError:
from hashlib import sha1 as sha
# The md5 module is deprecated in Python 2.6
try:
import md5
except Import... |
chouseknecht/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_iapp_template.py | 22 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2, ... |
dghubble/pyrepo | refs/heads/master | pyrepo/hosts.py | 1 | # -*- coding: utf-8 -*-
"""
This module provides the repository Host type and common Host
objects (github_host, bitbucket_host).
"""
import re
class Host(object):
"""
Represents a host of repositories and how import_path identifiers of
repositories are mapped to the host's urls.
"""
d... |
lupyuen/RaspberryPiImage | refs/heads/master | home/pi/GrovePi/Software/Python/others/temboo/Library/Google/Gmailv2/Messages/__init__.py | 4 | from temboo.Library.Google.Gmailv2.Messages.ClearStoredHistory import ClearStoredHistory, ClearStoredHistoryInputSet, ClearStoredHistoryResultSet, ClearStoredHistoryChoreographyExecution
from temboo.Library.Google.Gmailv2.Messages.DeleteMessage import DeleteMessage, DeleteMessageInputSet, DeleteMessageResultSet, Delete... |
roxyboy/scikit-learn | refs/heads/master | benchmarks/bench_20newsgroups.py | 377 | from __future__ import print_function, division
from time import time
import argparse
import numpy as np
from sklearn.dummy import DummyClassifier
from sklearn.datasets import fetch_20newsgroups_vectorized
from sklearn.metrics import accuracy_score
from sklearn.utils.validation import check_array
from sklearn.ensemb... |
darkryder/django | refs/heads/master | tests/template_tests/filter_tests/test_upper.py | 388 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import upper
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class UpperTests(SimpleTestCase):
"""
The "upper" filter messes up entities (which a... |
pooya/disco | refs/heads/master | examples/faq/chain.py | 11 | from disco.job import Job
from disco.worker.task_io import chain_reader
class FirstJob(Job):
input = ['raw://0', 'raw://0']
@staticmethod
def map(line, params):
yield int(line) + 1, ""
class ChainJob(Job):
map_reader = staticmethod(chain_reader)
@staticmethod
def map(key_value, param... |
huongttlan/bokeh | refs/heads/master | tests/glyphs/Diamond.py | 43 |
import numpy as np
from bokeh.document import Document
from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid
from bokeh.models.markers import Diamond
from bokeh.plotting import show
N = 9
x = np.linspace(-2, 2, N)
y = x**2
sizes = np.linspace(10, 20, N)
source = ColumnDataSource(dict(x=x, ... |
glencoates/django-tastypie | refs/heads/master | tests/related_resource/api/resources.py | 16 | from django.contrib.auth.models import User
from tastypie import fields
from tastypie.resources import ModelResource
from tastypie.authorization import Authorization
from core.models import Note, MediaBit
from related_resource.models import Category, Tag, ExtraData, Taggable, TaggableTag
class UserResource(ModelResou... |
roderickm/MediaCrush | refs/heads/master | migrate.py | 2 | from mediacrush.objects import File, RedisObject
from mediacrush.database import r, _k
from mediacrush.fileutils import file_storage
from mediacrush.processing.invocation import Invocation
from mediacrush.config import _cfg, _cfgi
import sys
import json
if __name__ == '__main__':
files = File.get_all()
count ... |
yakky/django | refs/heads/master | tests/model_fields/models.py | 210 | import os
import tempfile
import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.db.models.fields.files import Imag... |
judotens/jongos | refs/heads/master | lockfile/symlinklockfile.py | 12 | from __future__ import absolute_import
import time
import os
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class SymlinkLockFile(LockBase):
"""Lock access to a file using symlink(2)."""
def __init__(self, path, threaded=True, timeout=None):
# s... |
sriharrsha/flipside.io | refs/heads/master | vendor/guzzlehttp/ringphp/docs/conf.py | 321 | import sys, os
import sphinx_rtd_theme
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
lexers['php'] = PhpLexer(startinline=True, linenos=1)
lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)
primary_domain = 'php'
extensions = []
templates_path = ['_templates']
source_... |
caveman-dick/ansible | refs/heads/devel | lib/ansible/modules/network/junos/junos_interface.py | 16 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# 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',
... |
XXMrHyde/android_external_chromium_org | refs/heads/darkkat-4.4 | third_party/pexpect/ANSI.py | 171 | """This implements an ANSI (VT100) terminal emulator as a subclass of screen.
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DIS... |
seanhennig/chor | refs/heads/master | wp-content/plugins/foliopress-wysiwyg/fckeditor/fckeditor.py | 4 | """
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.org/licenses/gpl.html... |
olist/correios | refs/heads/master | tests/__init__.py | 15 | # Copyright 2016 Osvaldo Santana Neto
#
# 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 ... |
neurotechuoft/MindType | refs/heads/master | Code/V1/src/deprecated/scripts/stream_data.py | 1 | import sys; sys.path.append('..') # help python find open_bci_v3.py relative to scripts folder
import open_bci_v3 as bci
import streamer_tcp_server
import time, timeit
from threading import Thread
# Transmit data to openvibe acquisition server, intelpolating data (well, sort of) from 250Hz to 256Hz
# Listen to new con... |
sgerhart/ansible | refs/heads/maintenance_policy_module | lib/ansible/modules/utilities/logic/async_status.py | 19 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
# 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... |
wilxsv/sinam | refs/heads/master | symfony/web/assets/js/OpenLayers-2.13.1/tests/selenium/remotecontrol/selenium.py | 254 |
"""
Copyright 2006 ThoughtWorks, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... |
narfindustries/autopsy | refs/heads/develop | InternalPythonModules/android/general.py | 4 | """
Autopsy Forensic Browser
Copyright 2016 Basis Technology Corp.
Contact: carrier <at> sleuthkit <dot> org
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/LICE... |
Kriechi/mitmproxy | refs/heads/main | mitmproxy/contrib/kaitaistruct/exif_be.py | 4 | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
from kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, BytesIO
from enum import Enum
if parse_version(ks_version) < parse_version('0.7'):
raise Excep... |
boretom/pyload-apkg | refs/heads/master | source/py-mods-prebuilt-x86-64/site-packages/PIL/FontFile.py | 40 | #
# The Python Imaging Library
# $Id$
#
# base class for raster font file parsers
#
# history:
# 1997-06-05 fl created
# 1997-08-19 fl restrict image width
#
# Copyright (c) 1997-1998 by Secret Labs AB
# Copyright (c) 1997-1998 by Fredrik Lundh
#
# See the README file for information on usage and redistribution.
#
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.