repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
tradej/pykickstart-old | tests/commands/zerombr.py | 1 | 1629 | #
# Martin Gracik <mgracik@redhat.com>
#
# Copyright 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be use... | gpl-2.0 |
stevenmizuno/QGIS | python/plugins/processing/algs/saga/SagaAlgorithmProvider.py | 5 | 5674 | # -*- coding: utf-8 -*-
"""
***************************************************************************
SagaAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************... | gpl-2.0 |
FEniCS/dolfin | demo/undocumented/adaptive-poisson/python/demo_adaptive-poisson.py | 1 | 2889 | """This demo program solves Poisson's equation
- div grad u(x, y) = f(x, y)
on the unit square with source f given by
f(x, y) = exp(-100(x^2 + y^2))
and homogeneous Dirichlet boundary conditions.
Note that we use a simplified error indicator, ignoring
edge (jump) terms and the size of the interpolation con... | lgpl-3.0 |
egabancho/invenio-deposit | invenio_deposit/helpers.py | 7 | 2578 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your optio... | gpl-2.0 |
laborautonomo/youtube-dl | youtube_dl/extractor/ustream.py | 3 | 2504 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import (
compat_urlparse,
get_meta_content,
)
class UstreamIE(InfoExtractor):
_VALID_URL = r'https?://www\.ustream\.tv/recorded/(?P<videoID>\d+)'
IE_NAME = 'ustream'
_TEST = {
'ur... | unlicense |
Eureka22/ASM_xf | PythonD/lib/python2.4/lib-tk/tkFont.py | 4 | 6241 | #
# Tkinter
# $Id: tkFont.py,v 1.9 2004/08/20 06:19:23 loewis Exp $
#
# font wrapper
#
# written by Fredrik Lundh <fredrik@pythonware.com>, February 1998
#
# FIXME: should add 'displayof' option where relevant (actual, families,
# measure, and metrics)
#
# Copyright (c) Secret Labs AB 1998.
#
# info@pythonware.c... | gpl-2.0 |
CubicERP/geraldo | site/newsite/django_1_0/django/core/management/validation.py | 9 | 12200 | import sys
from django.core.management.color import color_style
from django.utils.itercompat import is_iterable
class ModelErrorCollection:
def __init__(self, outfile=sys.stdout):
self.errors = []
self.outfile = outfile
self.style = color_style()
def add(self, context, error):
... | lgpl-3.0 |
sahutd/youtube-dl | youtube_dl/extractor/golem.py | 186 | 2181 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
from ..utils import (
determine_ext,
)
class GolemIE(InfoExtractor):
_VALID_URL = r'^https?://video\.golem\.de/.+?/(?P<id>.+?)/'
_TEST = {
'url': 'http://video.g... | unlicense |
JioCloud/heat | heat/openstack/common/service.py | 6 | 13775 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | apache-2.0 |
follow99/django | django/contrib/admin/filters.py | 188 | 16608 | """
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.contrib.admin.op... | bsd-3-clause |
theintencity/flash-videoio | examples/django-apps/project/experts/models.py | 1 | 3541 | import datetime
from google.appengine.api import users
from google.appengine.ext import db
class User(db.Model):
name = db.StringProperty('Full Name')
account = db.UserProperty()
phone_number = db.PhoneNumberProperty('Phone Number')
address = db.PostalAddressProperty('Postal Address')
website = db.... | lgpl-3.0 |
valaxy/robotframework-selenium2library | demo/package.py | 64 | 1359 | #!/usr/bin/env python
import os, sys
from time import localtime
from zipfile import ZipFile, ZIP_DEFLATED
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
execfile(os.path.join(THIS_DIR, '..', 'src', 'Selenium2Library', 'version.py'))
FILES = {
'': ['rundemo.py'],
'login_tests': ['valid_login.txt', 'inv... | apache-2.0 |
thesilencelies/SonnetConvs | InceptionModule.py | 1 | 1790 | #implimentation of the standard inceptionnet v3 inception module in sonnet
import tensorflow as tf
import sonnet as snt
class InceptionModule(snt.AbstractModule):
def __init__(self, output_channels, name="inception_module"):
super(InceptionModule, self).__init__(name=name)
self._output_channels = output_cha... | apache-2.0 |
github-account-because-they-want-it/django | django/contrib/gis/forms/fields.py | 504 | 4316 | from __future__ import unicode_literals
from django import forms
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from django.utils.translation import ugettext_lazy as _
from .widgets import OpenLayersWidget
class GeometryField(forms.Field):
"""
This is the basic form field for a Geometry. A... | bsd-3-clause |
spectralDNS/spectralDNS | tests/test_MHD.py | 2 | 1863 | import pytest
from six.moves import reload_module
from mpi4py import MPI
from spectralDNS import config, get_solver, solve
from TGMHD import initialize, regression_test, pi
comm = MPI.COMM_WORLD
if comm.Get_size() >= 4:
params = ('uniform_slab', 'nonuniform_slab',
'uniform_pencil', 'nonuniform_penci... | lgpl-3.0 |
mail-apps/pootle | pootle/apps/staticpages/models.py | 6 | 4568 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from django.db import ... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_hub_virtual_network_connections_operations.py | 1 | 8982 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
drawquest/drawquest-web | website/compressor/js.py | 4 | 1181 | from compressor.conf import settings
from compressor.base import Compressor, SOURCE_HUNK, SOURCE_FILE
from compressor.exceptions import UncompressableFileError
class JsCompressor(Compressor):
template_name = "compressor/js.html"
template_name_inline = "compressor/js_inline.html"
def __init__(self, conten... | bsd-3-clause |
chris-chris/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/ops/training_ops.py | 134 | 11225 | # 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 |
jcrugzz/lpvisualization | django/core/mail/backends/smtp.py | 202 | 3878 | """SMTP email backend class."""
import smtplib
import socket
import threading
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.utils import DNS_NAME
from django.core.mail.message import sanitize_address
class EmailBackend(BaseEmailBackend):
"""
... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/telemetry/internal/platform/msr_server_win.py | 7 | 3273 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A server that serves MSR values over TCP. Takes a port as its sole parameter.
The reference client for this server is msr_power_monitor.MsrPowerMonitor.
... | gpl-3.0 |
dmlc/mxnet | benchmark/python/sparse/dot.py | 35 | 20888 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
YutingZhang/lmdis-rep | exp-ae-aflw-30.py | 1 | 2231 | import tensorflow as tf
import os
import sys
from copy import copy
from model.pipeline import Pipeline
from tensorflow.python import debug as tf_debug
if __name__ == "__main__":
num_keypoints = 30
patch_feature_dim = 8
decoding_levels = 5
kp_transform_loss = 1e4
recon_weight = 0.001
learni... | apache-2.0 |
mark-me/Pi-Jukebox | venv/Lib/site-packages/mutagen/_senf/_temp.py | 12 | 3282 | # -*- coding: utf-8 -*-
# Copyright 2016 Christoph Reiter
#
# 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... | agpl-3.0 |
keskinbu/Laravel-e-Commerce | vendor/mockery/mockery/docs/conf.py | 468 | 8442 | # -*- coding: utf-8 -*-
#
# Mockery Docs documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 3 14:04:26 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | gpl-3.0 |
andyzsf/django | tests/select_for_update/tests.py | 11 | 9961 | from __future__ import unicode_literals
import time
import unittest
from django.conf import settings
from django.db import transaction, connection, router
from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError
from django.test import (
TransactionTestCase, override_settings, skipIfDBFeatur... | bsd-3-clause |
mikalstill/nova | nova/virt/hyperv/pathutils.py | 4 | 8531 | # Copyright 2013 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... | apache-2.0 |
keeeener/nicki | platform/external/wpa_supplicant_8/hostapd/wps-ap-nfc.py | 5 | 7106 | #!/usr/bin/python
#
# Example nfcpy to hostapd wrapper for WPS NFC operations
# Copyright (c) 2012-2013, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import os
import sys
import time
import nfc
import nfc.ndef
import nfc.llcp
import nf... | gpl-2.0 |
svenstaro/ansible | lib/ansible/plugins/action/ops_template.py | 35 | 1776 | #
# Copyright 2015 Peter Sprygada <psprygada@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 Software Foundation, either version 3 of the License, or
# (at your option) any... | gpl-3.0 |
yukoba/sympy | sympy/vector/tests/test_printing.py | 52 | 5613 | # -*- coding: utf-8 -*-
from sympy import Integral, latex, Function
from sympy import pretty as xpretty
from sympy.vector import CoordSysCartesian, Vector, express
from sympy.abc import a, b, c
from sympy.core.compatibility import u_decode as u
from sympy.utilities.pytest import XFAIL
def pretty(expr):
"""ASCII pr... | bsd-3-clause |
q14035/pimouse_ros | scripts/motors2.py | 1 | 2178 | #!/usr/bin/env python
#encoding: utf8
import sys, rospy, math
from pimouse_ros.msg import MotorFreqs
from geometry_msgs.msg import Twist
from std_srvs.srv import Trigger, TriggerResponse
class Motor():
def __init__(self):
if not self.set_power(False): sys.exit(1)
rospy.on_shutdown(self.set_power)
self.sub_raw ... | gpl-3.0 |
Hasimir/brython | www/src/Lib/sre_parse.py | 630 | 29657 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | bsd-3-clause |
alxgu/ansible | test/units/modules/network/frr/frr_module.py | 38 | 1962 | # -*- coding: utf-8 -*-
# (c) 2019, 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
import os
import json
from units.modules.utils import AnsibleExitJson, Ans... | gpl-3.0 |
antoinecarme/pyaf | tests/perf/test_ozone_debug_perf.py | 1 | 1566 | import pandas as pd
import numpy as np
# from memory_profiler import profile
# from memprof import *
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
#get_ipython().magic('matplotlib inline')
# @memprof
def test_ozone_debug_perf():
b1 = tsds.load_ozone()
df = b1.mPastData
# df... | bsd-3-clause |
adeepkit01/networks | .waf-1.8.13-4da49748f68a49832130c7ef124357f6/waflib/Tools/python.py | 8 | 15735 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os,sys
from waflib import Utils,Options,Errors,Logs,Task,Node
from waflib.TaskGen import extension,before_method,after_method,feature
from waflib.Configure import conf
FRAG='''
#include <Pytho... | gpl-2.0 |
JackieXie168/rethinkdb | test/common/http_support/jinja2/_compat.py | 638 | 4042 | # -*- coding: utf-8 -*-
"""
jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... | apache-2.0 |
brianwoo/django-tutorial | ENV/lib/python2.7/site-packages/django/utils/autoreload.py | 19 | 10731 | # Autoreloading launcher.
# Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org).
# Some taken from Ian Bicking's Paste (http://pythonpaste.org/).
#
# Portions copyright (c) 2004, CherryPy Team (team@cherrypy.org)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with ... | gpl-3.0 |
craigcitro/gsutil | gslib/addlhelp/encoding.py | 23 | 5302 | # -*- coding: utf-8 -*-
# Copyright 2014 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 require... | apache-2.0 |
rschmidtz/cloudtunes | cloudtunes-server/cloudtunes/services/dropbox/sync.py | 14 | 3394 | import os
import datetime
from operator import itemgetter
from itertools import groupby
from celery.utils.log import get_task_logger
from cloudtunes.users.models import User
from cloudtunes.library.models import Track
from cloudtunes.worker import celery
from .id3 import get_id3
from .client import Client
from .model... | bsd-3-clause |
felixbuenemann/sentry | src/sentry/web/decorators.py | 25 | 9447 | from __future__ import absolute_import
import logging
import warnings
from functools import wraps
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import get_object_or_404
from sudo.decorators import sudo_required
from sentry.constants impo... | bsd-3-clause |
JimCircadian/ansible | lib/ansible/modules/commands/script.py | 10 | 3056 | # Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
... | gpl-3.0 |
Neil741/ryu-master | ryu/app/rest_firewall.py | 6 | 38429 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# 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 applicab... | apache-2.0 |
janocat/odoo | addons/l10n_be_intrastat/l10n_be_intrastat.py | 258 | 7828 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2014-2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
nkhuyu/seizure-prediction | ensemble.py | 2 | 9703 | #!/usr/bin/env python2.7
from multiprocessing import Pool
import sys
import numpy as np
from sklearn.metrics import roc_auc_score
from seizure_prediction.classifiers import make_svm, make_simple_lr, make_lr
from seizure_prediction.feature_selection import generate_feature_masks
from seizure_prediction.fft_bins impor... | mit |
GbalsaC/bitnamiP | lms/djangoapps/psychometrics/management/commands/init_psychometrics.py | 131 | 2392 | #!/usr/bin/python
#
# generate pyschometrics data from tracking logs and student module data
import json
from courseware.models import StudentModule
from track.models import TrackingLog
from psychometrics.models import PsychometricData
from django.conf import settings
from django.core.management.base import BaseComm... | agpl-3.0 |
panuta/django-startup | {{cookiecutter.project_slug}}/app/accounts/migrations/0001_initial.py | 2 | 2936 | # Generated by Django 2.0.2 on 2018-03-01 13:26
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_ma... | mit |
hwfwgrp/project_generator | tests/test_pgenworkspace.py | 2 | 2110 | # Copyright 2015 0xc0170
#
# 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, soft... | apache-2.0 |
ioannistsanaktsidis/invenio | modules/websubmit/lib/functions/Insert_Modify_Record.py | 26 | 2500 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at... | gpl-2.0 |
jmelett/pyFxTrader | setup.py | 2 | 4026 | #!/usr/bin/env python
import io
import os
import re
import sys
from setuptools import setup, find_packages
PACKAGE = 'trader'
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist bdist_wheel upload')
sys.exit()
class Setup(object):
@staticmethod
def read(fname, fail_silently=False):
... | mit |
wuhengzhi/chromium-crosswalk | third_party/closure_linter/closure_linter/common/simplefileflags.py | 285 | 5107 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | bsd-3-clause |
gangadhar-kadam/mtn-erpnext | manufacturing/doctype/bom/test_bom.py | 6 | 1356 | # ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# 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 yo... | agpl-3.0 |
gautam1858/tensorflow | tensorflow/python/framework/common_shapes_test.py | 76 | 9343 | # 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 |
assamite/TwatBot | tweets/reasoning.py | 1 | 4674 | '''
.. py:module:: reasoning
:platform: Unix
Reasoning object for the tweets.
'''
import logging
import traceback
logger = logging.getLogger('tweets.default')
class Reasoning():
'''Reasoning for the tweets.
Class is used to hold information about the tweet's construction, and contains
few u... | mit |
tiagofrepereira2012/tensorflow | tensorflow/compiler/tests/concat_ops_test.py | 107 | 12661 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Ashald/uwsgi | contrib/twuwsgi.py | 21 | 4220 | from twisted.internet import defer, protocol, reactor
from twisted.protocols import basic
from twisted.web2 import http, resource, responsecode, stream
import struct
class uWSGIClientResource(resource.LeafResource):
def __init__(self, app='', port=3030, host='localhost'):
resource.LeafResource.__init__(... | gpl-2.0 |
Shekharrajak/Django-facebook | docs/docs_env/Lib/UserDict.py | 117 | 5729 | """A more or less complete user-defined wrapper around dictionary objects."""
class UserDict:
def __init__(self, dict=None, **kwargs):
self.data = {}
if dict is not None:
self.update(dict)
if len(kwargs):
self.update(kwargs)
def __repr__(self): return repr(self.d... | bsd-3-clause |
elbeardmorez/quodlibet | osx_bundle/misc/list_content.py | 6 | 2493 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2015 Christoph Reiter
#
# 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 late... | gpl-2.0 |
forman/dectree | dectree/codegen.py | 1 | 21170 | import ast
from collections import OrderedDict
from io import StringIO
from typing import List, Dict, Any, Tuple, Optional
import dectree.propfuncs as propfuncs
from dectree.config import CONFIG_NAME_INPUTS_NAME, CONFIG_NAME_OUTPUTS_NAME, CONFIG_NAME_PARAMS_NAME
from .config import get_config_value, \
CONFIG_NAME_... | mit |
jounex/hue | desktop/core/ext-py/Paste-2.0.1/paste/fileapp.py | 50 | 13698 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# (c) 2005 Ian Bicking, Clark C. Evans and contributors
# This module is part of the Python Paste Project and is released under
# the MIT License: http... | apache-2.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/twisted/logger/_format.py | 12 | 8176 | # -*- test-case-name: twisted.logger.test.test_format -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tools for formatting logging events.
"""
from datetime import datetime as DateTime
from twisted.python.compat import unicode
from twisted.python.failure import Failure
from twisted.py... | mit |
rightbraindev/asyncio-redis-cluster | asyncio_redis_cluster/cursors.py | 2 | 2998 | import asyncio
from collections import deque
__all__ = (
'Cursor',
'DictCursor',
'SetCursor',
'ZCursor',
)
class Cursor:
"""
Cursor for walking through the results of a :func:`scan
<asyncio_redis.RedisProtocol.scan>` query.
"""
def __init__(self, name, scanfunc):
self._que... | bsd-2-clause |
googleapis/python-asset | scripts/readme-gen/readme_gen.py | 122 | 1722 | #!/usr/bin/env python
# Copyright 2016 Google Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
bsmrstu-warriors/Moytri---The-Drone-Aider | Lib/keyword.py | 179 | 1994 | #! /usr/bin/env python
"""Keywords (from "graminit.c")
This file is automatically generated; please don't muck it up!
To update the symbols in this file, 'cd' to the top directory of
the python source tree after building the interpreter and run:
python Lib/keyword.py
"""
__all__ = ["iskeyword", "kwlist"]
kwli... | gpl-3.0 |
ghtmtt/QGIS | tests/src/python/test_qgis_local_server.py | 45 | 6464 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for qgis_local_server.py Python test module
From build dir: ctest -R PyQgsLocalServer -V
Set the following env variables when manually running tests:
QGIS_TEST_SUITE to run specific tests (define in __main__)
QGIS_TEST_VERBOSE to output individual test summary
QGIS_TEST... | gpl-2.0 |
spadae22/odoo | addons/account/tests/test_tax.py | 449 | 1740 | from openerp.tests.common import TransactionCase
class TestTax(TransactionCase):
"""Tests for taxes (account.tax)
We don't really need at this point to link taxes to tax codes
(account.tax.code) nor to companies (base.company) to check computation
results.
"""
def setUp(self):
super(T... | agpl-3.0 |
kbrebanov/ansible | lib/ansible/modules/network/cloudengine/ce_vrf.py | 22 | 10873 | #!/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 |
nysan/yocto-autobuilder | lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/words/test/test_irc_service.py | 17 | 7167 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for IRC portions of L{twisted.words.service}.
"""
from twisted.trial import unittest
from twisted.test import proto_helpers
from twisted.words.service import InMemoryWordsRealm, IRCFactory, IRCUser
from twisted.words.protocols import ir... | gpl-2.0 |
swarna-k/MyDiary | app/models.py | 1 | 1566 | from app import db
from werkzeug import generate_password_hash, check_password_hash
class User(db.Model):
id = db.Column(db.Integer, primary_key = True)
firstname = db.Column(db.String(100))
lastname = db.Column(db.String(100))
email = db.Column(db.String(120), unique=True)
pwdhash = db.Column(db.String(5... | bsd-3-clause |
keir-rex/zipline | zipline/utils/tradingcalendar_tse.py | 24 | 10413 | #
# Copyright 2014 Quantopian, 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 wr... | apache-2.0 |
connor4312/socketIO-client | socketIO_client/__init__.py | 6 | 18043 | from .exceptions import ConnectionError, TimeoutError, PacketError
from .heartbeats import HeartbeatThread
from .logs import LoggingMixin
from .namespaces import (
EngineIONamespace, SocketIONamespace, LoggingSocketIONamespace,
find_callback)
from .parsers import (
parse_host, parse_engineIO_session,
fo... | mit |
pfnet/chainer | tests/chainerx_tests/unit_tests/routines_tests/test_connection.py | 5 | 24647 | import unittest
import chainer
from chainer import functions as F
import numpy
import pytest
import chainerx
from chainerx_tests import array_utils
from chainerx_tests import dtype_utils
from chainerx_tests import op_utils
# A special parameter object used to represent an unspecified argument.
class Unspecified(ob... | mit |
SebastianMerz/calalert | Server/venv/lib/python2.7/site-packages/jinja2/optimizer.py | 1401 | 2302 | # -*- coding: utf-8 -*-
"""
jinja2.optimizer
~~~~~~~~~~~~~~~~
The jinja optimizer is currently trying to constant fold a few expressions
and modify the AST in place so that it should be easier to evaluate it.
Because the AST does not contain all the scoping information and the
compiler has to ... | gpl-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/PyChart-1.39/demos/fillstyles.py | 6 | 1243 | #
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Pychart 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, or (at your option) any
# later version.
#
# Pychart is dis... | mit |
liqi328/rjrepaircompany | django/contrib/gis/gdal/prototypes/geom.py | 315 | 4821 | import re
from datetime import date
from ctypes import c_char, c_char_p, c_double, c_int, c_ubyte, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON
from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
from... | bsd-3-clause |
albertomurillo/ansible | lib/ansible/modules/network/aci/aci_epg_monitoring_policy.py | 27 | 6531 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... | gpl-3.0 |
omarkadry/rsa_algorithm | RSA.py | 1 | 5283 | #!/usr/bin/python
#Algoriths Project Part 1a
#Omar Kadry
#CMSC 441
#Dr. Marron
#IMPLEMENTATION NOTES
#Python's built in pow function uses Binary Exponentiation and reducing modulo n to compute modular
#exponentiation. This is the same algorithm as MODULAR-EXPONENTIATION(a,b,n) as used in the text
#For large number mutl... | mit |
delta2323/chainer | examples/imagenet/nin.py | 17 | 1296 | import chainer
import chainer.functions as F
import chainer.initializers as I
import chainer.links as L
class NIN(chainer.Chain):
"""Network-in-Network example model."""
insize = 227
def __init__(self):
super(NIN, self).__init__()
conv_init = I.HeNormal() # MSRA scaling
with s... | mit |
jonathanessen/pyFFTW | conf.py | 5 | 7610 | # -*- coding: utf-8 -*-
#
# pyFFTW documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 30 14:37:35 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | bsd-3-clause |
spinza/librenms | poller-service.py | 15 | 14406 | #! /usr/bin/env python2
"""
poller-service A service to wrap SNMP polling. It will poll up to $threads devices at a time, and will not re-poll
devices that have been polled within the last $poll_frequency seconds. It will prioritize devices based
on the last time polled. If resources a... | gpl-3.0 |
entomb/CouchPotatoServer | libs/requests/packages/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... | gpl-3.0 |
albertliangcode/DiceRoll | venv/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py | 203 | 12894 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, detect_encoding, ZipFi... | mit |
jianghaolu/AutoRest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/fixtures/acceptancetestssubscriptionidapiversion/models/error.py | 16 | 1271 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
Xperia-Nicki/android_kernel_sony_nicki | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
trevor/mailman3 | src/mailman/core/chains.py | 2 | 4764 | # Copyright (C) 2007-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | gpl-3.0 |
183amir/workrave | common/bin/create_locale.py | 9 | 1580 | # LoclaeInfo.py (c) 2006 Canonical, released under the GPL
#
# a helper class to get locale info
import string
import re
import subprocess
import gettext
from gettext import gettext as _
from xml.etree.ElementTree import ElementTree
languages = {}
countries = {}
et = ElementTree(file = "/usr/share/xml/i... | gpl-3.0 |
mprat/learningjulia | nbconvert_config.py | 1 | 7416 | from nbconvert.preprocessors import ExecutePreprocessor, Preprocessor
import numpy as np
def jekyllurl(path):
"""
Take the filepath of an image output by the ExportOutputProcessor
and convert it into a URL we can use with Jekyll
"""
return path.replace("../..", "")
def svg_filter(svg_xml):
"... | mit |
Peerunity/Peerunity | contrib/pyminer/pyminer.py | 1257 | 6438 | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
im... | mit |
KmolYuan/pyslvs | test/test_core.py | 1 | 3764 | # -*- coding: utf-8 -*-
"""Pyslvs core module test."""
__author__ = "Yuan Chang"
__copyright__ = "Copyright (C) 2016-2021"
__license__ = "AGPL"
__email__ = "pyslvs@gmail.com"
from math import sqrt, radians
from pyslvs import (
Coord, SolverSystem, pxy, ppp, plap, pllp, plpp, palp, expr_solving,
t_config, par... | agpl-3.0 |
bubbleboy14/cantools | cantools/scripts/index.py | 1 | 8655 | """
### Usage: ctindex [--mode=MODE] [--domain=DOMAIN] [--port=PORT] [--skip=SKIP]
### Options:
-h, --help show this help message and exit
-m MODE, --mode=MODE may be: 'refcount' (default - count up all foreignkey
references for sort orders and such); 'index' (assign
... | mit |
FRC-Team-3140/north-american-happiness | lib/python2.7/site-packages/jinja2/visitor.py | 1401 | 3316 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... | mit |
joelddiaz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.2.24/library/rpm_q.py | 9 | 127102 |
<!DOCTYPE html>
<html lang="en" class="">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#">
<meta charset='utf-8'>
<link crossorigin="anonymous" href="https://assets-cdn.github.com/ass... | apache-2.0 |
asajeffrey/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/setuponly.py | 32 | 2623 | from __future__ import absolute_import, division, print_function
import pytest
import sys
def pytest_addoption(parser):
group = parser.getgroup("debugconfig")
group.addoption(
"--setuponly",
"--setup-only",
action="store_true",
help="only setup fixtures, do not execute tests."... | mpl-2.0 |
vamsirajendra/nupic | tests/integration/nupic/opf/opf_checkpoint_test/experiments/non_temporal_multi_step/b/description.py | 76 | 2102 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2011-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... | agpl-3.0 |
Sentient07/scikit-learn | sklearn/tests/test_grid_search.py | 27 | 29492 | """
Testing for grid search module (sklearn.grid_search)
"""
from collections import Iterable, Sized
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.externals.six.moves import xrange
from itertools import chain, product
import pickle
import warnings
import sys
import numpy as np
import sci... | bsd-3-clause |
fpieper/py2neo | test/core/1-main/merge_test.py | 2 | 2682 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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
#
# Unle... | apache-2.0 |
mpeuster/son-emu | src/emuvim/api/openstack/openstack_dummies/keystone_dummy_api.py | 1 | 16828 | # Copyright (c) 2015 SONATA-NFV and Paderborn University
# 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 re... | apache-2.0 |
thicklizard/AwesomeSauce1_1 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
wuher/diablo | test/test_resource.py | 1 | 23625 | # -*- coding: utf-8 -*-
# test_resource.py ---
#
import json
import base64
from twisted.internet import defer, reactor
from twisted.web import server
from twisted.web.test.test_web import DummyRequest
from twisted.trial import unittest
from twisted.internet.defer import succeed
from twisted.python import log
from t... | mit |
dulems/hue | desktop/core/ext-py/guppy-0.1.10/guppy/gsl/Html.py | 37 | 15304 | #._cv_part guppy.gsl.Html
class Node2Html:
def __init__(self, mod, node=None, error_report = None, encode_name=None
):
self.mod = mod
self.valid_html40 = False
self.encode = self.mod.encode
if encode_name is None:
encode_name = self.mod.encode_name
self.encode_name = encode_name
... | apache-2.0 |
arpadpe/plover | plover/machine/keyboard.py | 1 | 4230 | # Copyright (c) 2010 Joshua Harlan Lifton.
# See LICENSE.txt for details.
"For use with a computer keyboard (preferably NKRO) as a steno machine."
from plover.machine.base import StenotypeBase
from plover.oslayer.keyboardcontrol import KeyboardCapture
class Keyboard(StenotypeBase):
"""Standard stenotype interfa... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.