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 |
|---|---|---|---|---|---|
mhils/colorama | colorama/initialise.py | 3 | 1669 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = None
orig_stderr = None
wrapped_stdout = None
wrapped_stderr = None
atexit_done = False
def reset_all():
AnsiToWin32(orig_stdout).reset_all()
def init(autor... | bsd-3-clause |
pschmitt/home-assistant | tests/components/onvif/test_config_flow.py | 6 | 18909 | """Test ONVIF config flow."""
from onvif.exceptions import ONVIFError
from zeep.exceptions import Fault
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.onvif import config_flow
from tests.async_mock import AsyncMock, MagicMock, patch
from tests.common import MockConfigEntry
UR... | apache-2.0 |
tonybaloney/st2 | st2actions/tests/integration/test_resultstracker.py | 1 | 13359 | import eventlet
import mock
import st2actions.resultstracker.resultstracker as results_tracker
from st2common.constants import action as action_constants
from st2common.exceptions.db import StackStormDBObjectNotFoundError
from st2common.persistence.action import Action
from st2common.persistence.executionstate import ... | apache-2.0 |
mdeger/nest-simulator | pynest/nest/tests/test_sp/test_disconnect.py | 2 | 3941 | # -*- coding: utf-8 -*-
#
# test_disconnect.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | gpl-2.0 |
nagyistoce/OpenBird | cocos2d/plugin/tools/toolsForGame/modifyClassPath.py | 255 | 1712 | import sys, string, os
from xml.etree import ElementTree as ET
from xml.dom import minidom
classPathFile = sys.argv[1]
pluginStr = sys.argv[2]
pluginsDir = sys.argv[3]
def getLibElement(pathAttr):
ret = ET.Element('classpathentry')
ret.set('exported', 'true')
ret.set('kind', 'lib')
ret.set('path', pat... | mit |
drxaero/calibre | src/calibre/library/add_to_library.py | 14 | 4793 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from hashlib import sha1
from calibre.ebooks import BOOK_EXTENSIONS
def find_folders_under(root, db, add_root=... | gpl-3.0 |
smiller171/ansible-modules-core | cloud/openstack/os_ironic.py | 128 | 12857 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2014, Hewlett-Packard Development Company, L.P.
#
# This module 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 optio... | gpl-3.0 |
freedomtan/tensorflow | tensorflow/python/tpu/tpu_outside_compilation_test.py | 2 | 22688 | # Copyright 2020 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 |
atomictom/WiseGuy | old_sequential_nn.py | 1 | 3808 | # Neural Network
# -- nn.py
#
# @package NeuralNetwork
import Queue
import random
import math
import time
import threading
NUM_THREADS = 1
NUM_TESTS = 100
NUM_INPUTS = 50
NUM_HIDDEN = 30
NUM_OUTPUTS = 50
USE_BACKPROPOGATE = True
OUTPUTS = []
# test_input = [ .0, .3, .6, .2, .8 ]
class Node:
def __init__(self):... | gpl-3.0 |
zubair-arbi/edx-platform | lms/djangoapps/instructor/management/commands/openended_post.py | 86 | 4626 | """
Command to manually re-post open ended submissions to the grader.
"""
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from optparse import make_option
from xmodule.modulestore.django import modulestore
from opaque_keys.edx.locations import SlashSeparatedCourseKey
fro... | agpl-3.0 |
Comunitea/alimentacion | budget_product/__openerp__.py | 2 | 1471 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved
# $Marta Vázquez Rodríguez$ <marta@pexego.es>
#
# This program is free software: you can redistribute it and/or modify
# it unde... | agpl-3.0 |
azurvii/godot | tools/addheader/addheader.py | 23 | 2980 | header="""\
/*************************************************************************/
/* $filename */
/*************************************************************************/
/* This file is part of: */
/* ... | mit |
javiergarridomellado/Empresa_django | devcodela/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/chardistribution.py | 2755 | 9226 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | gpl-2.0 |
eclipse-ease-addons/engines | jython/org.jython/Lib/StringIO.py | 146 | 10662 | r"""File-like objects that read from or write to a string buffer.
This implements (nearly) all stdio methods.
f = StringIO() # ready for writing
f = StringIO(buf) # ready for reading
f.close() # explicitly release resources held
flag = f.isatty() # always false
pos = f.tell() # get current pos... | epl-1.0 |
columbia/libtrack | libtrack/elfmod/vstruct/defs/windows/win_6_1_i386/ntdll.py | 18 | 180159 | # Version: 6.1
# Architecture: i386
import vstruct
from vstruct.primitives import *
KPROCESS_STATE = v_enum()
KPROCESS_STATE.ProcessInMemory = 0
KPROCESS_STATE.ProcessOutOfMemory = 1
KPROCESS_STATE.ProcessInTransition = 2
KPROCESS_STATE.ProcessOutTransition = 3
KPROCESS_STATE.ProcessInSwap = 4
KPROCESS_STAT... | apache-2.0 |
openstack/monasca-persister | monasca_persister/repositories/influxdb/abstract_repository.py | 1 | 3517 | # (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
#
# 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 appli... | apache-2.0 |
hsmade/expenses | expenses/migrations/0001_initial.py | 1 | 3009 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Deposit',
fields=[
('id', models.AutoField(verb... | gpl-2.0 |
golden1232004/webrtc_new | chromium/src/base/PRESUBMIT.py | 69 | 1740 | # Copyright (c) 2012 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.
"""Chromium presubmit script for src/base.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit... | gpl-3.0 |
sinkuri256/python-for-android | python-build/python-libs/gdata/tests/atom_tests/mock_server_test.py | 128 | 3776 | #!/usr/bin/python
#
# Copyright (C) 2008 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 ... | apache-2.0 |
Microvellum/Fluid-Designer | win64-vc/2.78/Python/bin/2.78/scripts/addons/oscurart_tools/oscurart_render.py | 1 | 16832 | # ##### 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 |
iismd17/scikit-learn | sklearn/feature_selection/tests/test_chi2.py | 221 | 2398 | """
Tests for chi2, currently the only feature selection function designed
specifically to work with sparse matrices.
"""
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
import scipy.stats
from sklearn.feature_selection import SelectKBest, chi2
from sklearn.feature_selection.univariate_selection im... | bsd-3-clause |
fajran/tempel | src/tempel/settings.py | 1 | 3006 | DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'tempel.db'
DATABASE_USER = ''
DATABASE_PASSWORD = ''
DATABASE_HOST = ''
DATABASE_PORT = ''
TIME_ZONE = 'Asia/Jakarta'
LANGUAGE_CODE = 'en'
SITE_ID = 1
USE_I18N = False
import os
MEDIA_ROOT = os.path.j... | agpl-3.0 |
UNR-AERIAL/scikit-learn | sklearn/cluster/birch.py | 207 | 22706 | # Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Joel Nothman <joel.nothman@gmail.com>
# License: BSD 3 clause
from __future__ import division
import warnings
import numpy as np
from scipy import sparse
from math import sqrt
fro... | bsd-3-clause |
dvliman/jaikuengine | .google_appengine/lib/antlr3/antlr3/extras.py | 113 | 1913 | """ @package antlr3.dottreegenerator
@brief ANTLR3 runtime package, tree module
This module contains all support classes for AST construction and tree parsers.
"""
# begin[licence]
#
# [The "BSD licence"]
# Copyright (c) 2005-2008 Terence Parr
# All rights reserved.
#
# Redistribution and use in source and binary fo... | apache-2.0 |
jaywreddy/django | django/db/migrations/loader.py | 89 | 17105 | from __future__ import unicode_literals
import os
import sys
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.db.migrations.graph import MigrationGraph
from django.db.migrations.recorder import MigrationRecorder
from django.utils import six
from .exception... | bsd-3-clause |
fabsx00/chucky-old | tools/functionAnomaly/Ranker.py | 1 | 1907 | import pickle
from scipy.spatial.distance import squareform
import os
from mlutils.anomalyDetection.anomalyCalculator import AnomalyCalculator
from RankingEntry import RankingEntry
class Ranker:
def __init__(self, projectRoot):
self.projectRoot = projectRoot
def loadTermDocMatrix(self):
... | gpl-3.0 |
alma-siwon/Solid_Kernel-GPROJ | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
CzechHackathon2014/juice-my-device | jmd/web/views.py | 1 | 2699 | from django.shortcuts import render
from places.forms import LocationForm
# Create your views here.
def home(request, tmpl='web/home.html'):
data = {}
loc_form = LocationForm(request.POST or None)
data['locaction_form'] = loc_form
return render(request, tmpl, data)
# from django.conf import setting... | mit |
SebastianFM/SebastianFM-kernel | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
movmov/cc | vendor/Twisted-10.0.0/doc/core/examples/wxacceptance.py | 4 | 3227 | # Copyright (c) 2001-2006 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Acceptance tests for wxreactor.
Please test on Linux, Win32 and OS X:
1. Startup event is called at startup.
2. Scheduled event is called after 2 seconds.
3. Shutdown takes 3 seconds, both when quiting from menu and when closing
... | apache-2.0 |
florentx/OpenUpgrade | addons/account_analytic_default/__init__.py | 445 | 1087 | # -*- 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 |
raildo/nova | nova/api/openstack/compute/legacy_v2/contrib/baremetal_nodes.py | 60 | 6552 | # Copyright (c) 2013 NTT DOCOMO, 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 requ... | apache-2.0 |
tschaume/pymatgen | pymatgen/core/periodic_table.py | 1 | 49560 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""Module contains classes presenting Element and Specie (Element + oxidation state) and PeriodicTable."""
import re
import json
import warnings
from io import open
from pathlib import Path
from enum import En... | mit |
bgris/ODL_bgris | examples/ufunc_ops/ufunc_composition.py | 1 | 1121 | """Examples of using the ufunc (Universal Function) functionals in ODL.
Here we demonstrate how the functionals can be composed with other operators
and functionals in order to achieve more complicated functions.
We create the L2-norm squared in two ways, first using the built in
L2NormSquared functional, and also by... | gpl-3.0 |
NewEvolution/python-webapp | pythonapp/settings.py | 1 | 3002 | """
Django settings for pythonapp project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pa... | mit |
yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_service_principals.py | 3 | 3950 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | mit |
indrajitr/ansible | test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/main.py | 1 | 106596 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Matt Martz <matt@sivel.net>
# Copyright (C) 2015 Rackspace US, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of ... | gpl-3.0 |
updownlife/multipleK | dependencies/biopython-1.65/Tests/test_GACrossover.py | 1 | 18105 | #!/usr/bin/env python
"""Tests different Genetic Algorithm crossover classes.
"""
# standard library
import unittest
# biopython
from Bio.Seq import MutableSeq
from Bio.Alphabet import SingleLetterAlphabet
# local stuff
from Bio.GA.Organism import Organism
from Bio.GA.Crossover.General import SafeFitnessCrossover
fro... | gpl-2.0 |
mbauskar/omnitech-frappe | frappe/website/doctype/web_form/test_web_form.py | 49 | 2083 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.website.render import build_page
from frappe.website.doctype.web_form.web_form import accept
test_records = frappe.get_test_records('Web Form')
cla... | mit |
angelapper/edx-platform | openedx/core/djangoapps/user_api/models.py | 8 | 4529 | """
Django ORM model specifications for the User API application
"""
from django.contrib.auth.models import User
from django.core.validators import RegexValidator
from django.db import models
from django.db.models.signals import post_delete, post_save, pre_save
from django.dispatch import receiver
from model_utils.mode... | agpl-3.0 |
Titan-C/scikit-learn | examples/cluster/plot_ward_structured_vs_unstructured.py | 1 | 3369 | """
===========================================================
Hierarchical clustering: structured vs unstructured ward
===========================================================
Example builds a swiss roll dataset and runs
hierarchical clustering on their position.
For more information, see :ref:`hierarchical_clus... | bsd-3-clause |
petebachant/PXL | pxl/tests/test_fdiff.py | 1 | 1436 | from __future__ import division, print_function
from .. import fdiff
from ..fdiff import *
import matplotlib.pyplot as plt
import pandas as pd
import os
import numpy as np
from uncertainties import unumpy
plot = False
def test_second_order_diff():
"""Test `second_order_diff`."""
# Create a non-equally space... | gpl-3.0 |
csitarichie/boost_msm_bare_metal | boost/tools/build/v2/test/BoostBuild.py | 2 | 32715 | # Copyright 2002-2005 Vladimir Prus.
# Copyright 2002-2003 Dave Abrahams.
# Copyright 2006 Rene Rivera.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import TestCmd
import copy
import fnmatch
import gl... | gpl-2.0 |
Lightmatter/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/django/contrib/gis/tests/utils.py | 55 | 1854 | from unittest import skip
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
def no_backend(test_func, backend):
"Use this decorator to disable test on specified backend."
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend:
@skip("This test is skipped on... | mit |
meyerson/luigi | test/date_interval_test.py | 28 | 5628 | # -*- 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... | apache-2.0 |
jemmyw/ansible | lib/ansible/inventory/__init__.py | 9 | 26005 | # (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... | gpl-3.0 |
kvar/ansible | lib/ansible/modules/network/aci/mso_user.py | 24 | 6792 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ve... | gpl-3.0 |
bgaunt/openEcslent | engine/squadAI.py | 2 | 3788 | #---------------------------------------------------------------------------
# Copyright 2010, 2011 Sushil J. Louis and Christopher E. Miles,
# Evolutionary Computing Systems Laboratory, Department of Computer Science
# and Engineering, University of Nevada, Reno.
#
# This file is part of OpenECSLENT
#
# OpenECS... | gpl-3.0 |
qwefi/nova | nova/db/api.py | 1 | 59796 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (t... | apache-2.0 |
leereilly/django-1 | django/contrib/gis/tests/test_spatialrefsys.py | 88 | 6775 | from django.db import connection
from django.contrib.gis.gdal import GDAL_VERSION
from django.contrib.gis.tests.utils import no_mysql, oracle, postgis, spatialite
from django.utils import unittest
test_srs = ({'srid' : 4326,
'auth_name' : ('EPSG', True),
'auth_srid' : 4326,
'srt... | bsd-3-clause |
kchodorow/tensorflow | tensorflow/contrib/input_pipeline/python/ops/input_pipeline_ops.py | 20 | 4041 | # 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 |
damienstanton/nanodegree | selfdriving_vehicle/openpilot/common/logging_extra.py | 3 | 3596 | import os
import sys
import copy
import json
import socket
import logging
from threading import local
from collections import OrderedDict
from contextlib import contextmanager
class SwagFormatter(logging.Formatter):
def __init__(self, swaglogger):
logging.Formatter.__init__(self, None, '%a %b %d %H:%M:%S %Z %Y')... | mit |
jdinuncio/ansible-modules-extras | cloud/amazon/kinesis_stream.py | 48 | 35149 | #!/usr/bin/python
#
# This is a free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This Ansible library is distributed in the hope that i... | gpl-3.0 |
chhsiao1981/f6a_tw_crawler | f6a_tw_crawler/main.py | 1 | 2575 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from f6a_tw_crawler.constants import *
import gevent.monkey; gevent.monkey.patch_all()
from bottle import Bottle, request, response, route, run, post, get, static_file, redirect, HTTPError, view, template
import random
import math
import base64
import time
import ujson ... | mit |
mikeboers/PyAV | scratchpad/resource_use.py | 2 | 1645 | from __future__ import division, print_function
from __future__ import division
import argparse
import resource
import gc
import av
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--count', type=int, default=5)
parser.add_argument('-f', '--frames', type=int, default=100)
parser.add_argument('--print',... | bsd-3-clause |
xwolf12/django | django/contrib/auth/password_validation.py | 229 | 7041 | from __future__ import unicode_literals
import gzip
import os
import re
from difflib import SequenceMatcher
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.utils import lru_cache
from django.utils._os import upath
from django.utils.encoding import ... | bsd-3-clause |
gangadhar-kadam/latestchurcherp | erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py | 6 | 3508 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, os, json
from frappe.utils import cstr
from unidecode import unidecode
def create_charts(chart_name, company):
chart = get_chart(chart_... | agpl-3.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env32/lib/python2.7/site-packages/pycparser/ply/ctokens.py | 197 | 3177 | # ----------------------------------------------------------------------
# ctokens.py
#
# Token specifications for symbols in ANSI C and C++. This file is
# meant to be used as a library in other tokenizers.
# ----------------------------------------------------------------------
# Reserved words
tokens = [
# Li... | gpl-2.0 |
JT5D/scikit-learn | examples/linear_model/lasso_dense_vs_sparse_data.py | 13 | 1862 | """
==============================
Lasso on dense and sparse data
==============================
We show that linear_model.Lasso provides the same results for dense and sparse
data and that in the case of sparse data the speed is improved.
"""
print(__doc__)
from time import time
from scipy import sparse
from scipy ... | bsd-3-clause |
storm-computers/odoo | addons/base_setup/base_setup.py | 40 | 4478 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
import cgi
from openerp import tools
from openerp.osv import fields, osv
from openerp.tools.translate import _
from lxml import etree
# Specify Your Terminology will move to 'partner' module
class specify_pa... | agpl-3.0 |
ClovisIRex/Snake-django | env/lib/python3.6/site-packages/wheel/install.py | 472 | 18070 | """
Operations on existing wheel files, including basic installation.
"""
# XXX see patched pip to install
import sys
import warnings
import os.path
import re
import zipfile
import hashlib
import csv
import shutil
try:
_big_number = sys.maxsize
except NameError:
_big_number = sys.maxint
from wheel.decorato... | mit |
SofiaReis/django-cms | cms/test_utils/testcases.py | 18 | 15647 | # -*- coding: utf-8 -*-
import json
import sys
import warnings
from cms.utils.compat import DJANGO_1_6
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser, Permission
from django.contrib.sites.models import Site
from django.core.cache imp... | bsd-3-clause |
chouseknecht/ansible | test/integration/targets/rel_plugin_loading/subdir/inventory_plugins/notyaml.py | 90 | 6837 | # Copyright (c) 2017 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
DOCUMENTATION = '''
inventory: yaml
version_added: "2.4"
short_description: Uses a speci... | gpl-3.0 |
sparkslabs/kamaelia | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Apps/GSOCPaint/Slider.py | 6 | 11209 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, ... | apache-2.0 |
rapilabs/django | django/contrib/gis/management/commands/ogrinspect.py | 369 | 5760 | import argparse
from django.contrib.gis import gdal
from django.core.management.base import BaseCommand, CommandError
from django.utils.inspect import get_func_args
class LayerOptionAction(argparse.Action):
"""
Custom argparse action for the `ogrinspect` `layer_key` keyword option
which may be an integer... | bsd-3-clause |
Erotemic/local | git_tools/git_xadd.py | 1 | 4330 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Adds and commits a change to a local branch (but not the current one)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import git
# import sys
class CheckoutContext(object):
def __init__(self, repo):
self.repo = repo
... | gpl-3.0 |
lidiamcfreitas/FenixScheduleMaker | ScheduleMaker/brython/www/src/Lib/sys.py | 3 | 5180 | # hack to return special attributes
from _sys import *
_getframe = Getframe
from javascript import JSObject
from browser import window
brython_debug_mode = __BRYTHON__.debug
argv = ['__main__']
base_exec_prefix = __BRYTHON__.brython_path
base_prefix = __BRYTHON__.brython_path
builtin_module_names=__BRYTHON__.buil... | bsd-2-clause |
GenericStudent/home-assistant | tests/components/tplink/test_init.py | 10 | 9057 | """Tests for the TP-Link component."""
from typing import Any, Dict
from unittest.mock import MagicMock, patch
from pyHS100 import SmartBulb, SmartDevice, SmartDeviceException, SmartPlug
import pytest
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import tplink
from homeassist... | apache-2.0 |
veg/idepi | examples/bnab/helpers/tabulate_validation.py | 3 | 1967 | import json, sys, csv, argparse, operator, re
from math import sqrt
neut = re.compile ('^[^_]+\_([0-9\.]+).*$')
parser = argparse.ArgumentParser(
description='tabulate validation results for the bNab example')
parser.add_argument (
'-j', '--json',
type=argparse.FileType('r'),
help='IDEPI prediction f... | gpl-3.0 |
simone-campagna/daikon | zirkon/macros.py | 2 | 7197 | # -*- coding: utf-8 -*-
#
# Copyright 2013 Simone Campagna
#
# 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... | apache-2.0 |
TimothyVandenbrande/ansible-modules-extras | network/a10/a10_server.py | 15 | 11060 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage A10 Networks slb server objects
(c) 2014, Mischa Peters <mpeters@a10networks.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
th... | gpl-3.0 |
mavit/ansible | lib/ansible/module_utils/api.py | 103 | 4446 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
kalahbrown/HueBigSQL | desktop/core/ext-py/Django-1.6.10/tests/contenttypes_tests/tests.py | 58 | 2131 | from __future__ import absolute_import, unicode_literals
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from .models import Author, Article
class ContentTypesViewsTests(TestCase):
fixtures = ['testdata.json']
urls = 'contenttypes_tests.urls'
def test_shortcut... | apache-2.0 |
cstipkovic/spidermonkey-research | python/bitstring/test/test_bitstring.py | 4 | 3077 | #!/usr/bin/env python
"""
Module-level unit tests.
"""
import unittest
import sys
sys.path.insert(0, '..')
import bitstring
import copy
class ModuleData(unittest.TestCase):
def testVersion(self):
self.assertEqual(bitstring.__version__, '3.1.3')
def testAll(self):
exported = ['ConstBitArray',... | mpl-2.0 |
gregoil/rotest | tests/api/resource_control/test_lock_resources.py | 1 | 8138 | """Basic unittests for the server resource control operations."""
from __future__ import absolute_import
from functools import partial
from six.moves import http_client
from django.contrib.auth.models import User
from django.test import Client, TransactionTestCase
from rotest.management.models import DemoComplexReso... | mit |
rlaboiss/pelican-plugins | photos/photos.py | 6 | 23576 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import json
import logging
import multiprocessing
import os
import pprint
import re
import sys
from pelican.generators import ArticlesGenerator
from pelican.generators import PagesGenerator
from pelican.settings import DE... | agpl-3.0 |
ukanga/SickRage | lib/unidecode/x070.py | 252 | 4693 | data = (
'You ', # 0x00
'Yang ', # 0x01
'Lu ', # 0x02
'Si ', # 0x03
'Jie ', # 0x04
'Ying ', # 0x05
'Du ', # 0x06
'Wang ', # 0x07
'Hui ', # 0x08
'Xie ', # 0x09
'Pan ', # 0x0a
'Shen ', # 0x0b
'Biao ', # 0x0c
'Chan ', # 0x0d
'Mo ', # 0x0e
'Liu ', # 0x0f
'Jian ', # 0x10
'P... | gpl-3.0 |
gfreed/android_external_chromium-org | tools/telemetry/telemetry/core/chrome/inspector_timeline_unittest.py | 26 | 1242 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
from telemetry.core import util
from telemetry.core.chrome import inspector_timeline
from telemetry.unittest import tab_test_case
class Inspec... | bsd-3-clause |
bfontaine/web-pp | pp/unidecode/x033.py | 222 | 4556 | data = (
'apartment', # 0x00
'alpha', # 0x01
'ampere', # 0x02
'are', # 0x03
'inning', # 0x04
'inch', # 0x05
'won', # 0x06
'escudo', # 0x07
'acre', # 0x08
'ounce', # 0x09
'ohm', # 0x0a
'kai-ri', # 0x0b
'carat', # 0x0c
'calorie', # 0x0d
'gallon', # 0x0e
'gamma', # 0x0f
'gig... | mit |
Lh4cKg/sl4a | python/src/Tools/bgen/bgen/bgenModule.py | 48 | 2748 | from bgenOutput import *
from bgenGeneratorGroup import GeneratorGroup
class Module(GeneratorGroup):
def __init__(self, name, prefix = None,
includestuff = None,
finalstuff = None,
initstuff = None,
variablestuff = None,
longname = None):
Ge... | apache-2.0 |
signed/intellij-community | python/testData/highlighting/assignmentTargets.py | 59 | 1299 | # fail
<error descr="Can't assign to function call">int(1)</error> = 1
<error descr="Can't assign to literal">12</error> = 1
<error descr="Can't assign to operator">1 + 21</error> = 12
result = <error descr="Can't assign to operator">a < c and c</error> = 4
<error descr="Can't assign to ()">()</error> = 123
<error... | apache-2.0 |
eLBati/odoo | addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py | 112 | 14182 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c):
#
# 2005 pyopenoffice.py Martin Simon (http://www.bezirksreiter.de)
# 2005 Fabien Pinckaers, TINY SPRL. (http://tiny.be)
#
# This program is free software: you can redistribute it and/or ... | agpl-3.0 |
wdzhou/mantid | docs/sphinxext/mantiddoc/directives/interface.py | 3 | 5142 | from mantiddoc.directives.base import BaseDirective #pylint: disable=unused-import
import os
class InterfaceDirective(BaseDirective):
"""
Adds a screenshot of the custom interface
It requires a SCREENSHOTS_DIR environment variable to be set to the
directory where a screenshot should be generated. If ... | gpl-3.0 |
avanov/django | django/core/serializers/base.py | 13 | 6726 | """
Module for abstract serializer/unserializer base classes.
"""
from django.db import models
from django.utils import six
class SerializerDoesNotExist(KeyError):
"""The requested serializer was not found."""
pass
class SerializationError(Exception):
"""Something bad happened during serialization."""
... | bsd-3-clause |
tquizzle/Sick-Beard | lib/requests/packages/oauthlib/oauth1/rfc5849/utils.py | 74 | 3015 | # -*- coding: utf-8 -*-
"""
oauthlib.utils
~~~~~~~~~~~~~~
This module contains utility methods used by various parts of the OAuth
spec.
"""
import string
import urllib2
from oauthlib.common import quote, unquote
UNICODE_ASCII_CHARACTER_SET = (string.ascii_letters.decode('ascii') +
string.digits.decode('ascii')... | gpl-3.0 |
loli/sklearn-ensembletrees | examples/plot_rfe_with_cross_validation.py | 24 | 1384 | """
===================================================
Recursive feature elimination with cross-validation
===================================================
A recursive feature elimination example with automatic tuning of the
number of features selected with cross-validation.
"""
print(__doc__)
from sklearn.svm im... | bsd-3-clause |
mabrowning/codechallenge | model/problem.py | 2 | 2733 | from time import strptime
from problem_attempt import ProblemAttempt
class Problem(object):
def __init__(self, data_mgr):
self.data_mgr = data_mgr
self.attempts = [] # list of ProblemAttempt
self.prob_id = ''
self.name = ''
self.description = ''
self.problem_file = ''
self.low_score_is_best = True ... | mit |
YACOWS/opps | opps/containers/migrations/0003_auto__del_field_containerboxcontainers_short_title.py | 5 | 19445 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'ContainerBoxContainers.sho... | mit |
nthien/zulip | zerver/management/commands/enqueue_file.py | 115 | 1715 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.lib.queue import queue_json_publish
import sys
import ujson
def error(*args):
raise Exception('We cannot enqueue because settings.USING_RABBITMQ is False.')
class Command(BaseCommand):
help = """Read JSON... | apache-2.0 |
tpo/ansible | lib/ansible/template/native_helpers.py | 2 | 2650 | # Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ast import literal_eval
from itertools import islice, chain
i... | gpl-3.0 |
askeing/fxos-certsuite | mcts/securitysuite/suite.py | 3 | 7333 | # -*- encoding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import logging
import argparse
import traceback
from mozdevice import DeviceManage... | mpl-2.0 |
cbolumar/android_kernel_samsung_a3ultexx | 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 |
googleapis/gapic-generator-python | tests/integration/goldens/redis/google/cloud/redis_v1/__init__.py | 2 | 2037 | # -*- 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 |
py4a/peewee | playhouse/tests/test_reflection.py | 13 | 15908 | import os
import re
from peewee import *
from peewee import create_model_tables
from peewee import drop_model_tables
from peewee import mysql
from peewee import print_
from playhouse.reflection import *
from playhouse.tests.base import database_initializer
from playhouse.tests.base import PeeweeTestCase
sqlite_db = ... | mit |
jendap/tensorflow | tensorflow/contrib/labeled_tensor/python/ops/core.py | 35 | 38058 | # 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 |
slevenhagen/odoo-npg | openerp/modules/graph.py | 260 | 7763 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
liosha2007/temporary-groupdocs-python-sdk | groupdocs/models/SignatureContactResponse.py | 1 | 1166 | #!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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... | apache-2.0 |
wbsavage/shinken | shinken/log.py | 1 | 8631 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you c... | agpl-3.0 |
junhuac/MQUIC | src/tools/perf/page_sets/page_cycler/intl1.py | 22 | 4322 | # 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.
from telemetry.page import page as page_module
from telemetry import story
class Intl1Page(page_module.Page):
def __init__(self, url, page_set):
super... | mit |
pierg75/pier-sosreport | sos/plugins/cman.py | 2 | 2301 | # 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 in the hope that it will be useful,
# but... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.