repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
overdev/easygl-0.1.0-alpha1 | easygl/prefabs/core.py | 1 | 4923 | # !/usr/bin/python
# -*- coding: utf-8 -*-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Jorge A. Gomes (jorgegomes83 at hotmail dot com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softwar... | mit |
abhitopia/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/multinomial_test.py | 26 | 12791 | # 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... | apache-2.0 |
tswast/google-cloud-python | speech/tests/system/gapic/v1p1beta1/test_system_speech_v1p1beta1.py | 2 | 3070 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
4eek/edx-platform | common/djangoapps/student/tests/test_bulk_email_settings.py | 113 | 5761 | """
Unit tests for email feature flag in student dashboard. Additionally tests
that bulk email is always disabled for non-Mongo backed courses, regardless
of email feature flag, and that the view is conditionally available when
Course Auth is turned on.
"""
import unittest
from django.conf import settings
from django.... | agpl-3.0 |
kubernetes-client/python | kubernetes/client/api/__init__.py | 1 | 4961 | from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from kubernetes.client.api.admissionregistration_api import AdmissionregistrationApi
from kubernetes.client.api.admissionregistration_v1_api import AdmissionregistrationV1Api
from kubernetes.client.api.admissionregistration_v1beta1_a... | apache-2.0 |
robbiet480/home-assistant | tests/components/sonarr/test_init.py | 5 | 1213 | """Tests for the Sonsrr integration."""
from homeassistant.components.sonarr.const import DOMAIN
from homeassistant.config_entries import (
ENTRY_STATE_LOADED,
ENTRY_STATE_NOT_LOADED,
ENTRY_STATE_SETUP_RETRY,
)
from homeassistant.core import HomeAssistant
from tests.components.sonarr import setup_integrati... | apache-2.0 |
pekeler/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/idlelib/SearchEngine.py | 150 | 6731 | import re
from Tkinter import *
import tkMessageBox
def get(root):
if not hasattr(root, "_searchengine"):
root._searchengine = SearchEngine(root)
# XXX This will never garbage-collect -- who cares
return root._searchengine
class SearchEngine:
def __init__(self, root):
self.root = ... | apache-2.0 |
Royce/GammaJS | support/web/urls.py | 1 | 2153 | from django.conf.urls.defaults import *
from django.http import HttpResponse, Http404
from django.conf import settings
import httplib
def validInstrumented(url):
return url.endswith('.js') and url.startswith('/gma')
def proxy(request, domain, port, debugOnly=False, add="", path="", validator=None):
if pa... | mit |
Dhiru/gstudio | gnowsys-ndf/gnowsys_ndf/ndf/urls/file.py | 3 | 1918 | from django.conf.urls import patterns, url
from django.views.generic import TemplateView
urlpatterns = patterns('gnowsys_ndf.ndf.views.file',
url(r'^[/]$', 'file', name='file'),
# url(r'^/(?P<file_id>[\w-]+)$', 'file', name='file'),
url(r'^/uploadDo... | agpl-3.0 |
pdehaye/theming-edx-platform | lms/djangoapps/courseware/tests/helpers.py | 33 | 4710 | import json
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from student.models import Registration
from django.test import TestCase
def check_for_get_code(self, code, url):
"""
Check that we got the expected code when accessing url via GET.
Returns ... | agpl-3.0 |
BackupTheBerlios/cuon-svn | cuon_server/src/cuon/Order.py | 2 | 62666 | # coding=utf-8
##Copyright (C) [2005] [Jürgen Hamel, D-32584 Löhne]
##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.
##Thi... | gpl-3.0 |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py | 762 | 3532 | import hashlib
import os
from pip._vendor.lockfile import LockFile
from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile
from ..cache import BaseCache
from ..controller import CacheController
def _secure_open_write(filename, fmode):
# We only want to write to this file, so open it in write only mode
... | mit |
ebagdasa/tempest | tools/install_venv_common.py | 27 | 5941 | # Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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 ... | apache-2.0 |
campbe13/openhatch | vendor/packages/twisted/twisted/test/test_logfile.py | 18 | 10061 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import os, time, stat, errno
from twisted.trial import unittest
from twisted.python import logfile, runtime
class LogFileTestCase(unittest.TestCase):
"""
Test the rotating log file.
"""
def setUp(self):
self.dir = self.... | agpl-3.0 |
cheery/texopic | texopic/tokenizer.py | 1 | 3796 | from collections import namedtuple
def read_file(filename):
with open(filename, 'r') as fd:
source = fd.read().decode('utf-8')
return read_string(source)
def read_string(source):
stream = Stream(source)
while stream.filled:
yield next_token(stream)
# Below, the plaintext stream is tra... | mit |
bkury/OpenPHT | addons/weather.wunderground/resources/lib/wunderground/wunderground.py | 15 | 1420 | # -*- coding: utf-8 -*-
import urllib2, base64
WAIK = 'NDEzNjBkMjFkZjFhMzczNg=='
WUNDERGROUND_URL = 'http://api.wunderground.com/api/KEY/%s/%s/q/%s.%s'
API_EXCLUDE = ['hourly10day', 'yesterday', 'planner', 'webcams', 'animatedradar', 'animatedsatellite', 'currenthurricane']
def wundergroundapi(featu... | gpl-2.0 |
mossmann/im-me | garage/garage-decode.py | 2 | 1313 | #!/usr/bin/python
# decodes 66 bit remote keyless entry signal
# pulse width modulation
# to be used with grc/usrp demodulator
import struct
data = open('/tmp/garage.out').read()
symbols = struct.unpack('B1'*len(data), data)
# one bit is encoded in a triple (three adjacent symbols)
def pwm_decode(triple):
# strip... | gpl-2.0 |
ausarbluhd/EternalLLC | scripts/mallory/src/dns/rdtypes/ANY/LOC.py | 248 | 12571 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | gpl-2.0 |
JohnReid/bioinf-utilities | python/corebio/_future/__init__.py | 1 | 2213 |
"""
Private compatability module for running under python version 2.3.
Replacement for
o string.Template -- introduced in python 2.4
o subprocess -- introduced in python 2.4
o resource_string -- introduced in pkg_resource of setuptools
o resource_stream
o resource_filename
from s... | mit |
googleapis/python-dataflow-client | google/dataflow_v1beta3/services/metrics_v1_beta3/pagers.py | 1 | 10832 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
rickmendes/ansible-modules-core | files/find.py | 5 | 12335 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ruggero Marchei <ruggero.marchei@daemonzone.net>
# (c) 2015, Brian Coca <bcoca@ansible.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
#... | gpl-3.0 |
tdtrask/ansible | test/units/parsing/vault/test_vault.py | 11 | 40963 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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 So... | gpl-3.0 |
tareqalayan/ansible | lib/ansible/modules/network/nxos/nxos_user.py | 23 | 12454 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
caveman-dick/ansible | lib/ansible/modules/cloud/azure/azure_rm_subnet.py | 29 | 11225 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANS... | gpl-3.0 |
knowsWhereHisTowelIs/pi-pyth-serv-socketio | lib/python3.5/site-packages/pip/_vendor/requests/api.py | 362 | 5794 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:para... | mit |
YOTOV-LIMITED/kuma | vendor/packages/translate/lang/dz.py | 29 | 1044 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | mpl-2.0 |
ehartsuyker/securedrop | molecule/fetch-tor-packages/tests/test_tor_packages.py | 2 | 1593 | import os
import pytest
testinfra_hosts = ['docker://tor-package-fetcher-xenial']
TOR_DOWNLOAD_DIR = "/tmp/tor-debs"
TOR_PACKAGES = [
{"name": "tor", "arch": "amd64"},
{"name": "tor-geoipdb", "arch": "all"},
]
TOR_VERSION = "0.3.5.8-1~xenial+1"
def test_tor_apt_repo(host):
"""
Ensure the upstream To... | agpl-3.0 |
jpautom/scikit-learn | examples/ensemble/plot_voting_decision_regions.py | 230 | 2386 | """
==================================================
Plot the decision boundaries of a VotingClassifier
==================================================
Plot the decision boundaries of a `VotingClassifier` for
two features of the Iris dataset.
Plot the class probabilities of the first sample in a toy dataset
pred... | bsd-3-clause |
rlutz/xorn | src/python/guile.py | 1 | 2755 | # Copyright (C) 2013-2019 Roland Lutz
#
# 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 distributed ... | gpl-2.0 |
iw3hxn/LibrERP | sale_subscriptions/models/company.py | 1 | 1296 |
##############################################################################
#
# Author: Didotech SRL
# Copyright 2015 Didotech SRL
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software... | agpl-3.0 |
jolyonb/edx-platform | openedx/core/djangoapps/user_api/migrations/0001_initial.py | 2 | 2810 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import django.core.validators
import django.utils.timezone
import model_utils.fields
from django.conf import settings
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField
class Migration(migr... | agpl-3.0 |
rpavlik/lyx-lucid-backport | lib/lyx2lyx/profiling.py | 2 | 1666 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2004 José Matos <jamatos@lyx.org>
#
# 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 ... | gpl-2.0 |
OMNIL-Infinity/volatility | volatility/win32/lsasecrets.py | 44 | 4501 | # Volatility
# Copyright (c) 2008-2013 Volatility Foundation
# Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu>
#
# This file is part of Volatility.
#
# Volatility 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... | gpl-2.0 |
lowitty/server | libsLinux/twisted/python/syslog.py | 43 | 3672 | # -*- test-case-name: twisted.python.test.test_syslog -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Classes and utility functions for integrating Twisted and syslog.
You probably want to call L{startLogging}.
"""
syslog = __import__('syslog')
from twisted.python import log
# These... | mit |
vicnet/weboob | modules/cci/pages.py | 2 | 3132 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... | lgpl-3.0 |
wangxiangyu/horizon | openstack_dashboard/test/jasmine/jasmine.py | 10 | 1736 | #
# (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 ... | apache-2.0 |
0asa/sparklingpandas | sparklingpandas/groupby.py | 2 | 9829 | """Provide wrapper around the grouped result from L{PRDD}"""
#
# 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-2.0 |
uwescience/myria-web | appengine/networkx/algorithms/tests/test_dag.py | 14 | 4524 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestDAG:
def setUp(self):
pass
def test_topological_sort1(self):
DG=nx.DiGraph()
DG.add_edges_from([(1,2),(1,3),(2,3)])
assert_equal(nx.topological_sort(DG),[1, 2, 3])
assert_equal(nx.topologica... | bsd-3-clause |
adist/drunken-sansa | openerp/addons/mail/update.py | 43 | 4693 | # -*- coding: utf-8 -*-
import datetime
import logging
import sys
import urllib
import urllib2
from openerp import pooler, SUPERUSER_ID
from openerp import release
from openerp.osv import osv
from openerp.tools.translate import _
from openerp.tools.safe_eval import safe_eval
from openerp.tools.config import config
fro... | agpl-3.0 |
wanchouchou/codecombat | scripts/devSetup/directoryController.py | 70 | 1982 | __author__ = u'schmatz'
import configuration
import os
import sys
import errors
import shutil
class DirectoryController(object):
def __init__(self,config):
assert isinstance(config,configuration.Configuration)
self.config = config
self.root_dir = self.config.system.get_current_working_direct... | mit |
renegelinas/mi-instrument | mi/instrument/seabird/sbe16plus_v2/test/test_driver.py | 3 | 56648 | """
@package mi.instrument.seabird.sbe16plus_v2.test.test_driver
@file mi/instrument/seabird/sbe16plus_v2/test/test_driver.py
@author David Everett
@brief Test cases for InstrumentDriver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/test_driver
$ bin/test_driver -u
$ bin/te... | bsd-2-clause |
Novasoft-India/OperERP-AM-Motors | openerp/addons/report_intrastat/__init__.py | 64 | 1094 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
ravippandey/xen-api | ocaml/xapi/tests/looper2.py | 38 | 1410 | #!/usr/bin/python
print "Program attempts to log into an XAPI server to fetch a list of VMs and"
print "a list of debug objects. It then chooses the first debug object, "
print "queries the int->float map and then calls the 'recycle' message using"
print "that map as an argument"
print
import getopt, sys, xapi
url =... | lgpl-2.1 |
lsst-sqre/lander | src/lander/ext/theme/_base.py | 1 | 11191 | from __future__ import annotations
import logging
import shutil
from abc import ABCMeta, abstractmethod
from pathlib import Path, PurePath, PurePosixPath
from typing import TYPE_CHECKING, Any, Dict, Iterator, Optional
from urllib.parse import urljoin
import jinja2
from lander.ext.theme._jinjaloader import ThemeTempl... | mit |
temasek/android_external_chromium | testing/gtest/test/gtest_test_utils.py | 397 | 10437 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-3-clause |
vtraag/louvain-igraph | src/__init__.py | 1 | 2743 | # -*- coding: utf-8 -*-
r""" This package implements the louvain algorithm in ``C++`` and exposes it to
python. It relies on ``(python-)igraph`` for it to function. Besides the
relative flexibility of the implementation, it also scales well, and can be run
on graphs of millions of nodes (as long as they can fit in mem... | gpl-3.0 |
Xelaadryth/Xelabot | quest/quest_segment.py | 1 | 4051 | from random import choice, random, sample
from utils.command_set import CommandSet
class QuestSegment:
def __init__(self, quest):
self.quest = quest
self.quest_manager = self.quest.quest_manager
self.channel = self.quest_manager.channel
self.channel_manager = self.channel.channel_... | mit |
astrilchuk/sd2xmltv | libschedulesdirect/common/programkeywords.py | 1 | 1350 | import logging
class ProgramKeywords(object):
def __init__(self):
self.mood = None # type: unicode
self.time_period = None # type: unicode
self.character = None # type: unicode
self.theme = None # type: unicode
self.setting = None # type: unicode
self.subj... | mit |
ARLahan/authomatic | tests/functional_tests/config-template.py | 1 | 6296 | # -*- coding: utf-8 -*-
import datetime
import constants
# Choose and configure the browser of your choice
def get_browser():
return webdriver.Chrome()
# The host and port where the tested ap shoud listen.
HOST = '127.0.0.1'
PORT = 8080
# The host alias set in the /etc/hosts file.
# The actual tests will navi... | mit |
candlewill/you-get | src/you_get/processor/join_flv.py | 31 | 10222 | #!/usr/bin/env python
import struct
from io import BytesIO
TAG_TYPE_METADATA = 18
##################################################
# AMF0
##################################################
AMF_TYPE_NUMBER = 0x00
AMF_TYPE_BOOLEAN = 0x01
AMF_TYPE_STRING = 0x02
AMF_TYPE_OBJECT = 0x03
AMF_TYPE_MOVIECLIP = 0x04
AMF_TY... | mit |
albertomr86/python-logging-rabbitmq | python_logging_rabbitmq/formatters.py | 1 | 1267 | # coding: utf-8
import logging
from socket import gethostname
from .compat import JSONEncoder
from .compat import json, text_type
class JSONFormatter(logging.Formatter):
"""
Formatter to convert LogRecord into JSON.
Thanks to: https://github.com/lobziik/rlog
"""
def __init__(self, *args, **kwargs... | mit |
Passtechsoft/TPEAlpGen | blender/release/scripts/addons_contrib/io_import_lipSync_Importer.py | 2 | 17790 | # ##### 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... | gpl-3.0 |
wolfgar/utilite | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # 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... | gpl-2.0 |
mktums/brewchecker | brewchecker/utils.py | 1 | 1783 | # coding: utf-8
import os
import time
import click
from pip.utils import rmtree
from pip.vcs.git import Git
from brewchecker.settings import settings
def echo(message=None, nl=True, err=False, _color=None):
log = settings.get('LOG')
msg = message if message else ''
if nl: # Nasty click.echo's bug =(
... | mit |
DayGitH/Python-Challenges | DailyProgrammer/DP20160401C.py | 1 | 3650 | """
[2016-04-01] Challenge #260 [Hard] Never Ending Snake
https://www.reddit.com/r/dailyprogrammer/comments/4cw095/20160401_challenge_260_hard_never_ending_snake/
# Description
Sleether Yn is a neverending snake, and like all neverending snakes, she loves drinking neverending soda and eating
baloney. She also hates w... | mit |
onceuponatimeforever/oh-mainline | vendor/packages/celery/celery/tests/test_app/__init__.py | 18 | 11401 | from __future__ import absolute_import
from __future__ import with_statement
import os
import sys
from mock import Mock
from celery import Celery
from celery import app as _app
from celery.app import defaults
from celery.app.base import BaseApp
from celery.loaders.base import BaseLoader
from celery.platforms import ... | agpl-3.0 |
andaag/scikit-learn | benchmarks/bench_tree.py | 297 | 3617 | """
To run this, you'll need to have installed.
* scikit-learn
Does two benchmarks
First, we fix a training set, increase the number of
samples to classify and plot number of classified samples as a
function of time.
In the second benchmark, we increase the number of dimensions of the
training set, classify a sam... | bsd-3-clause |
rangadi/incubator-beam | sdks/python/apache_beam/examples/complete/game/user_score_it_test.py | 6 | 3239 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
bikong2/django | tests/defer_regress/models.py | 282 | 2692 | """
Regression tests for defer() / only() behavior.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Item(models.Model):
name = models.CharField(max_length=15)
text = models.TextField(default="xyzzy")
value = models.IntegerF... | bsd-3-clause |
patricklaw/pants | src/python/pants/option/custom_types.py | 3 | 13130 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import inspect
import os
import re
from enum import Enum
from typing import Dict, Iterable, List, Pattern, Sequence
from pants.option.errors import Par... | apache-2.0 |
VitalPet/odoo | addons/l10n_cr/__openerp__.py | 170 | 3220 | # -*- encoding: utf-8 -*-
##############################################################################
#
# __openerp__.py
# l10n_cr_account
# First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.)
# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserv... | agpl-3.0 |
aperigault/ansible | lib/ansible/modules/cloud/azure/azure_rm_mariadbserver.py | 39 | 13580 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com>
# Copyright (c) 2019 Matti Ranta, (@techknowlogick)
#
# 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
AN... | gpl-3.0 |
baumartig/paperboy | mail_handler.py | 1 | 2571 | from settings_handler import settings
import os
import smtplib
import mimetypes
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email.MIMEAudio import MIMEAudio
from email.MIMEImage import MIMEImage
from email.Encoders import encode_base64
def ... | apache-2.0 |
lorin/shelllogger | sl/shelllogger.py | 1 | 4856 | """
ShellLogger: Unix shell command invocation logger
Usage: shelllogger [-s, --sanitize outfilename] <logfilename>
Upon invocation, it will spawn a new shell (either tcsh or bash, depending upon
SHELL variable).
Directory can be specified by setting (and exporting) the SHELLLOGGERDIR
environment variable to a dire... | gpl-3.0 |
Tranzystorek/servo | tests/wpt/web-platform-tests/common/large.py | 238 | 1370 | def main(request, response):
"""Code for generating large responses where the actual response data
isn't very important.
Two request parameters:
size (required): An integer number of bytes (no suffix) or kilobytes
("kb" suffix) or megabytes ("Mb" suffix).
string (optional): The... | mpl-2.0 |
openmv/micropython | tests/basics/object_new.py | 32 | 1074 | # object.__new__(cls) is the only way in Python to allocate empty
# (non-initialized) instance of class.
# See e.g. http://infohost.nmt.edu/tcc/help/pubs/python/web/new-new-method.html
# TODO: Find reference in CPython docs
try:
# If we don't expose object.__new__ (small ports), there's
# nothing to test.
o... | mit |
benschmaus/catapult | third_party/google-endpoints/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | bsd-3-clause |
twitherspoon/compose | compose/cli/verbose_proxy.py | 22 | 1770 | from __future__ import absolute_import
from __future__ import unicode_literals
import functools
import logging
import pprint
from itertools import chain
import six
def format_call(args, kwargs):
args = (repr(a) for a in args)
kwargs = ("{0!s}={1!r}".format(*item) for item in six.iteritems(kwargs))
retur... | apache-2.0 |
RetailMeNotSandbox/dart | src/python/dart/engine/emr/test/test_consume_subscription_exceptions.py | 1 | 2074 | import unittest
from test._mock_backport import Mock
from dart.engine.emr.actions.consume_subscription import consume_subscription
from dart.engine.emr.exception.exception import ActionFailedButConsumeSuccessfulException
from dart.engine.emr.steps import StepWrapper
from dart.model.action import Action, ActionData
fro... | mit |
ddamiani/pyqtgraph | pyqtgraph/opengl/items/GLAxisItem.py | 50 | 1792 | from OpenGL.GL import *
from .. GLGraphicsItem import GLGraphicsItem
from ... import QtGui
__all__ = ['GLAxisItem']
class GLAxisItem(GLGraphicsItem):
"""
**Bases:** :class:`GLGraphicsItem <pyqtgraph.opengl.GLGraphicsItem>`
Displays three lines indicating origin and orientation of local coordinate sys... | mit |
mancoast/CPythonPyc_test | cpython/264_test_subprocess.py | 52 | 30140 | import unittest
from test import test_support
import subprocess
import sys
import signal
import os
import tempfile
import time
import re
mswindows = (sys.platform == "win32")
#
# Depends on the following external programs: Python
#
if mswindows:
SETBINARY = ('import msvcrt; msvcrt.setmode(sys.stdout.fileno(), '
... | gpl-3.0 |
dougfelt/noto-emoji | add_glyphs.py | 6 | 13619 | #!/usr/bin/env python
"""Extend a ttx file with additional data.
Takes a ttx file and one or more directories containing image files named
after sequences of codepoints, extends the cmap, hmtx, GSUB, and GlyphOrder
tables in the source ttx file based on these sequences, and writes out a new
ttx file.
This can also a... | apache-2.0 |
certik/pyjamas | pgen/lib2to3/pgen2/token.py | 353 | 1244 | #! /usr/bin/env python
"""Token constants (from "token.h")."""
# Taken from Python (r53757) and modified to include some tokens
# originally monkeypatched in by pgen2.tokenize
#--start constants--
ENDMARKER = 0
NAME = 1
NUMBER = 2
STRING = 3
NEWLINE = 4
INDENT = 5
DEDENT = 6
LPAR = 7
RPAR = 8
LSQB = 9
RSQB = 10
C... | apache-2.0 |
bally12345/enigma2 | lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py | 1 | 30694 | # -*- coding: utf-8 -*-
from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.HelpMenu import HelpableScreen
from Screens.TaskView import JobView
from Components.About import about... | gpl-2.0 |
cs-au-dk/Artemis | WebKit/Tools/Scripts/webkitpy/tool/commands/abstractlocalservercommand.py | 3 | 2648 | # 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:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | gpl-3.0 |
mzizzi/ansible | lib/ansible/modules/database/postgresql/postgresql_ext.py | 64 | 6115 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | gpl-3.0 |
alexston/calibre-webserver | src/calibre/ebooks/html/to_zip.py | 9 | 4758 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import textwra... | gpl-3.0 |
sometallgit/AutoUploader | Python27/Lib/pydoc_data/topics.py | 5 | 429686 | # -*- coding: utf-8 -*-
# Autogenerated by Sphinx on Sat Dec 3 12:36:20 2016
topics = {'assert': u'\nThe "assert" statement\n**********************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, "a... | mit |
leeclemens/sunfish | test.py | 3 | 14133 | #!/usr/bin/env pypy
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import re
import time
import subprocess
import functools
import os
import signal
import argparse
import importlib
import multiprocessing
import random
import sunfish
import xboard
############################################... | gpl-3.0 |
agry/NGECore2 | scripts/mobiles/corellia/enraged_carrion_spat.py | 2 | 1564 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | lgpl-3.0 |
theguardian/headphones | lib/unidecode/x073.py | 252 | 4646 | data = (
'Sha ', # 0x00
'Li ', # 0x01
'Han ', # 0x02
'Xian ', # 0x03
'Jing ', # 0x04
'Pai ', # 0x05
'Fei ', # 0x06
'Yao ', # 0x07
'Ba ', # 0x08
'Qi ', # 0x09
'Ni ', # 0x0a
'Biao ', # 0x0b
'Yin ', # 0x0c
'Lai ', # 0x0d
'Xi ', # 0x0e
'Jian ', # 0x0f
'Qiang ', # 0x10
'Kun... | gpl-3.0 |
schleichdi2/OpenNfr_E2_Gui-6.0 | lib/python/Screens/HddPartitions.py | 2 | 10429 | from enigma import *
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Sources.List import List
from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
from Tools.LoadPixmap import LoadPixmap
from Components.Button import Button
from Components.Label import Label
fro... | gpl-2.0 |
HBehrens/feedsanitizer | django/contrib/gis/db/models/sql/query.py | 379 | 5314 | from django.db import connections
from django.db.models.query import sql
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import aggregates as gis_aggregates
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField
from django.contri... | mit |
mozilla/moztrap | tests/view/manage/cases/test_views.py | 3 | 25549 | # coding: utf-8
"""
Tests for case management views.
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from tests import case
class CasesTest(case.view.manage.ListViewTestCase,
case.view.ListFinderTests,
case.view.manage.MTModelListTests,
... | bsd-2-clause |
kkreis/espressopp | contrib/mpi4py/mpi4py-2.0.0/test/test_ctypes.py | 8 | 1689 | from mpi4py import MPI
import mpiunittest as unittest
try:
import ctypes
except ImportError:
ctypes = None
class TestCTYPES(unittest.TestCase):
objects = [
MPI.DATATYPE_NULL,
MPI.INT,
MPI.DOUBLE,
MPI.REQUEST_NULL,
MPI.INFO_NULL,
MPI.INFO_ENV,
MPI.ERR... | gpl-3.0 |
apurvbhartia/gnuradio-routing | gr-atsc/src/python/fpll.py | 15 | 2452 | #!/usr/bin/env python
#
# Copyright 2004,2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your opt... | gpl-3.0 |
zsiciarz/django | django/core/management/commands/diffsettings.py | 15 | 1940 | from django.core.management.base import BaseCommand
def module_to_dict(module, omittable=lambda k: k.startswith('_')):
"""Convert a module namespace to a Python dictionary."""
return {k: repr(v) for k, v in module.__dict__.items() if not omittable(k)}
class Command(BaseCommand):
help = """Displays diffe... | bsd-3-clause |
KaileenK/411-450 | smartComper.py | 1 | 9684 |
################### :D #################
# all available renderers must be listed here
renderers = 'Cineman Vray'
#creates script panel/options
p = nuke.Panel('Smart Comper')
p.addEnumerationPulldown('renderers', renderers)
p.addBooleanCheckBox('AutoCrop', False)
p.addBooleanCheckBox('Add Grade Nodes', False)
#brings ... | mit |
CouchPotato/CouchPotatoV1 | app/lib/cron/eta.py | 10 | 2840 | from app.config.cplog import CPLog
from app.config.db import Movie, MovieETA, Session as Db
from app.lib.cron.base import cronBase
from app.lib.provider.rss import rss
from dateutil.parser import parse
from sqlalchemy.sql.expression import or_
from urllib import urlencode
import Queue
import cherrypy
import time
import... | gpl-3.0 |
kursitet/edx-platform | common/test/acceptance/fixtures/course.py | 28 | 15265 | """
Fixture to create a course and course components (XBlocks).
"""
import mimetypes
import json
import datetime
from textwrap import dedent
from collections import namedtuple
from path import Path as path
from opaque_keys.edx.keys import CourseKey
from . import STUDIO_BASE_URL
from .base import XBlockContainerFix... | agpl-3.0 |
Zhongqilong/kbengine | kbe/res/scripts/common/Lib/idlelib/idle_test/mock_tk.py | 59 | 11544 | """Classes that replace tkinter gui objects used by an object being tested.
A gui object is anything with a master or parent paramenter, which is
typically required in spite of what the doc strings say.
"""
class Event:
'''Minimal mock with attributes for testing event handlers.
This is not a gui object, but... | lgpl-3.0 |
gravitystorm/fifengine | engine/python/fife/extensions/pychan/widgets/buttons.py | 5 | 11342 | # -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... | lgpl-2.1 |
dfolch/pysal | pysal/contrib/spatialnet/cleanNetShp.py | 20 | 4553 | """
cleanNetShp -- Tools to clean spatial Network Shapefiles.
"""
import pysal
import numpy
__author__ = "Charles R. Schmidt <schmidtc@gmail.com>"
__all__ = ['snap_verts', 'find_nodes', 'split_at_nodes']
def snap_verts(shp,tolerance=0.001,arc=True):
"""
snap_verts -- Snap verts that are within tolerance mete... | bsd-3-clause |
vrtsystems/hszinc | hszinc/version.py | 1 | 5545 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Project Haystack version definitions.
# (C) 2018 VRT Systems
#
# vim: set ts=4 sts=4 et tw=78 sw=4 si:
"""
Project Haystack Version comparison.
Project Haystack does not use a standard versioning scheme like Semantic
Versioning, rather, they have a Major.Minor scheme. This... | bsd-2-clause |
faux123/HTC_Amaze_Kernel | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
varuntiwari27/rally | rally/plugins/openstack/scenarios/fuel/utils.py | 4 | 6978 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
batxes/4Cin | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models24011.py | 2 | 17582 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
bruce3557/NTHUOJ_web | status/forms.py | 4 | 2970 | """
The MIT License (MIT)
Copyright (c) 2014 NTHUOJ team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... | mit |
Ygg01/master | domm/domm/export.py | 1 | 7317 | ##############################################################################
# Name: export.py
# Purpose: Exporter for DOMMLite parser
# Author: Daniel Fath <daniel DOT fath7 AT gmail DOT com>
# Copyright: (c) 2014 Daniel Fath <daniel DOT fath7 AT gmail DOT com>
# License: MIT License
################################... | mit |
servo/servo | tests/wpt/web-platform-tests/tools/third_party/websockets/src/websockets/client.py | 17 | 21215 | """
:mod:`websockets.client` defines the WebSocket client APIs.
"""
import asyncio
import collections.abc
import functools
import logging
import warnings
from types import TracebackType
from typing import Any, Generator, List, Optional, Sequence, Tuple, Type, cast
from .exceptions import (
InvalidHandshake,
... | mpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.