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 |
|---|---|---|---|---|---|
willrogerpereira/willbuyer | willstores/willstores/service/product.py | 1 | 3313 | from typing import List, Dict
from willstores.dao import ProductDAO
from willstores.model import Product
from willstores.errors import NoContentError, ValidationError
class ProductService(object):
"""
Services for store products:
"""
def __init__(self):
self.__productdao = ProductDAO()
... | mit |
cliftonmcintosh/openstates | openstates/la/__init__.py | 1 | 7667 | import datetime
import re
from billy.scrape.utils import url_xpath
from billy.utils.fulltext import pdfdata_to_text, text_after_line_numbers
from .bills import LABillScraper
from .legislators import LALegislatorScraper
from .committees import LACommitteeScraper
from .events import LAEventScraper
metadata = {
'name... | gpl-3.0 |
drsmith48/fdp | fdp/methods/nstxu/bes/__init__.py | 1 | 1529 | # -*- coding: utf-8 -*-
"""
Raw time-series data from BES detectors.
BES detectors generate differential signals such that "zero signal" or
"no light" corresponds to about -9.5 V. DC signal levels should be referenced
to the "zero signal" output. "No light" shots (due to failed shutters)
include 138545 and 138858.
... | mit |
anudr01d/anudr01d.github.io | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/formatters/_mapping.py | 263 | 5508 | # -*- coding: utf-8 -*-
"""
pygments.formatters._mapping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter mapping defintions. This file is generated by itself. Everytime
you change something on a builtin formatter defintion, run this script from
the formatters folder to update it.
Do not alter the FORMA... | mit |
CASIANICA/brainDecodingToolbox | braincode/prf/tfprf.py | 1 | 57805 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ['CUDA_VISIBLE_DEVICES']='0'
import numpy as np
from math import log
from scipy.misc import imresize
import tables
import tensorflow as... | bsd-3-clause |
kodiadmin/plugin.video.Stouchtone | resources/tools/netutv.py | 51 | 3134 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para netutv
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impor... | gpl-2.0 |
Kazade/NeHe-Website | django/db/backends/util.py | 151 | 4606 | import datetime
import decimal
from time import time
from django.utils.hashcompat import md5_constructor
from django.utils.log import getLogger
logger = getLogger('django.db.backends')
class CursorWrapper(object):
def __init__(self, cursor, db):
self.cursor = cursor
self.db = db
def __geta... | bsd-3-clause |
cernvm/renegade | cern-cloudinit-modules/src/usr/lib/python2.6/site-packages/cloudinit/config/cc_ganglia.py | 1 | 11684 | #################################################################################
# Author: Cristovao Cordeiro <cristovao.cordeiro@cern.ch> #
# #
# Cloud Config module for Ganglia service. Testes and working on SLC6 machines. #
# Documentation in: #
# https://twiki.cern.ch/twiki/bin/view/LCG/CloudInit... | gpl-3.0 |
truongdq/chainer | tests/chainer_tests/links_tests/connection_tests/test_inception.py | 15 | 1153 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import links
from chainer import testing
from chainer.testing import attr
class TestInception(unittest.TestCase):
in_channels = 3
out1, proj3, out3, proj5, out5, proj_pool = 3, 2, 3, 2, 3, 3
def setUp(self):
self... | mit |
pratapvardhan/scikit-image | skimage/_shared/tests/test_version_requirements.py | 8 | 1133 | """Tests for the version requirement functions.
"""
import numpy as np
from numpy.testing import assert_raises, assert_equal
import nose
from skimage._shared import version_requirements as version_req
def test_get_module_version():
assert version_req.get_module_version('numpy')
assert version_req.get_module_... | bsd-3-clause |
Argon-Zhou/django | tests/aggregation/models.py | 65 | 1412 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
friends = models.ManyToManyField('self', blank=True)
def __st... | bsd-3-clause |
percy-g2/Novathor_xperia_u8500 | 6.2.A.1.100/external/webkit/Tools/Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py | 22 | 2410 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | gpl-2.0 |
aaronsw/watchdog | vendor/rdflib-2.4.0/test/seq.py | 3 | 1505 | import unittest
from rdflib import *
from rdflib.Graph import Graph
from rdflib.StringInputSource import StringInputSource
class SeqTestCase(unittest.TestCase):
backend = 'default'
path = 'store'
def setUp(self):
store = self.store = Graph(store=self.backend)
store.open(self.path)
... | agpl-3.0 |
nuagenetworks/vspk-python | vspk/v6/nul2domain.py | 1 | 57912 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | bsd-3-clause |
bcbnz/python-rebuild | src/rebuild/widgets/results/sub.py | 1 | 8083 | # This file is part of python-rebuild, a program to assist in building
# regular expressions for Python.
# Copyright (C) 2010 Blair Bonnett
#
# python-rebuild 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, ei... | gpl-3.0 |
theo-l/django | tests/template_tests/syntax_tests/test_extends.py | 78 | 16961 | from django.template import NodeList, TemplateSyntaxError
from django.template.base import Node
from django.template.loader_tags import ExtendsNode
from django.test import SimpleTestCase
from ..utils import setup
inheritance_templates = {
'inheritance01': "1{% block first %}&{% endblock %}3{% block second %}_{% e... | bsd-3-clause |
zero-rp/miniblink49 | v8_5_7/testing/gmock/scripts/generator/cpp/ast.py | 384 | 62773 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 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... | apache-2.0 |
iakovleva/allauth-login-page | account/common_helpers/formrenderer.py | 5 | 3191 | import yattag
import markdown
import django.forms
from django.middleware import csrf
from django.utils.translation import ugettext
class Bootstrap3(object):
def __init__(self, request, form, title=None, submit=ugettext('Submit'), description=''):
self.request = request
self.form = form
se... | mit |
SymbiFlow/prjxray | fuzzers/016-clb-noutmux/generate.py | 1 | 3159 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
from prjxray.segmaker import Segmake... | isc |
miastojestnasze/wyborySam2014 | stats/models.py | 2 | 3755 | from django.db import models
class Address(models.Model):
teryt = models.IntegerField(default=0)
territory = models.CharField(max_length=7)
number_of_district = models.IntegerField(default=0)
address = models.CharField(max_length=500, default=None, null=True, blank=True)
district = models.CharFiel... | mit |
flavour/porto | controllers/appadmin.py | 3 | 11146 | # -*- coding: utf-8 -*-
"""
Application Admin Controllers
"""
import os
from shutil import rmtree
#import socket
import datetime
import copy
import gluon.contenttype
import gluon.fileutils
DEBUG = False
if DEBUG:
print >> sys.stderr, "APPADMIN: DEBUG MODE"
def _debug(m):
print >> sys.stderr, m
el... | mit |
kyoshino/bedrock | lib/l10n_utils/__init__.py | 1 | 6353 | # 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 re
from os.path import relpath, splitext
from django.conf import settings
from django.http import HttpResponseRe... | mpl-2.0 |
andreif/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 |
Arvedui/i3pystatus | i3pystatus/ngb.py | 1 | 2524 | # -*- coding: utf8 -*-
import requests
from xml.etree import ElementTree as ET
from i3pystatus import IntervalModule
from i3pystatus.core.util import internet, require
class ngb(IntervalModule):
settings = ('username', 'password')
required = ("username", "password")
def init(self):
self.inte... | mit |
kimjaejoong/nova | nova/api/openstack/compute/plugins/v3/fixed_ips.py | 21 | 4461 | # Copyright 2012 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 required by applicable law or agreed t... | apache-2.0 |
cloudbau/nova | nova/tests/servicegroup/test_mc_servicegroup.py | 3 | 8498 | # Copyright (c) 2013 Akira Yoshiyama <akirayoshiyama at gmail dot com>
#
# This is derived from test_db_servicegroup.py.
# Copyright 2012 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 t... | apache-2.0 |
leohmoraes/tablib | tablib/formats/_dbf.py | 10 | 2640 | # -*- coding: utf-8 -*-
""" Tablib - DBF Support.
"""
import tempfile
import struct
import os
from tablib.compat import StringIO
from tablib.compat import dbfpy
from tablib.compat import is_py3
if is_py3:
from tablib.packages.dbfpy3 import dbf
from tablib.packages.dbfpy3 import dbfnew
from tablib.package... | mit |
codingisacopingstrategy/aa.core | aacore/admin.py | 1 | 1731 | # This file is part of Active Archives.
# Copyright 2006-2011 the Active Archives contributors (see AUTHORS)
#
# 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 Foundation, either version 3 of the
# Li... | agpl-3.0 |
louietsai/python-for-android | python-modules/twisted/twisted/protocols/test/test_tls.py | 60 | 22247 | # Copyright (c) 2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.protocols.tls}.
"""
try:
from twisted.protocols.tls import TLSMemoryBIOProtocol, TLSMemoryBIOFactory
except ImportError:
# Skip the whole test module if it can't be imported.
skip = "pyOpenSSL 0.10 or newe... | apache-2.0 |
MarcosCommunity/odoo | addons/l10n_fr/wizard/__init__.py | 424 | 1462 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
LCBRU/reporter | reporter/uhl_reports/fast/data_quality/eq5d_not_input.py | 1 | 1560 | #!/usr/bin/env python3
from reporter.core import SqlReport, Schedule
from reporter.emailing import (
RECIPIENT_FAST_MANAGER,
RECIPIENT_FAST_ADMIN,
)
from reporter.connections import get_redcap_link
class FastEq5dNotEntered(SqlReport):
def __init__(self):
super().__init__(
... | mit |
wyom/sympy | sympy/matrices/immutable.py | 60 | 4889 | from __future__ import print_function, division
from sympy.core import Basic, Integer, Tuple, Dict, S, sympify
from sympy.core.sympify import converter as sympify_converter
from sympy.matrices.matrices import MatrixBase
from sympy.matrices.dense import DenseMatrix
from sympy.matrices.sparse import SparseMatrix, Mutab... | bsd-3-clause |
agry/NGECore2 | scripts/mobiles/talus/savage_guf_drolg.py | 2 | 1742 | 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... | lgpl-3.0 |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/scipy/_lib/decorator.py | 25 | 16044 | # ######################### LICENSE ############################ #
# Copyright (c) 2005-2015, Michele Simionato
# 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 so... | mit |
chrisndodge/edx-platform | lms/djangoapps/grades/management/commands/get_grades.py | 3 | 5520 | """
Management command to generate a list of grades for
all students that are enrolled in a course.
"""
from django.test.client import RequestFactory
from django.core.management.base import BaseCommand, CommandError
import os
from lms.djangoapps.courseware import courses
from lms.djangoapps.certificates.models import G... | agpl-3.0 |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/Contact/Coupled_Contact/Steady_State_Single_Foundation_Sysytem_Under_Tension/CoupledHardContact/n_0.5/Plot_Current.py | 12 | 3447 | #!/usr/bin/env python
#!/usr/bin/python
import h5py
from matplotlib import pylab
import matplotlib.pylab as plt
import sys
from matplotlib.font_manager import FontProperties
import math
import numpy as np
#!/usr/bin/python
import h5py
import matplotlib.pylab as plt
import matplotlib as mpl
import sys
import numpy as ... | cc0-1.0 |
kennethlove/django | tests/regressiontests/admin_util/tests.py | 6 | 9461 | from __future__ import absolute_import, unicode_literals
from datetime import datetime
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import helpers
from django.contrib.admin.util import (display_for_field, label_for_field,
lookup_field, NestedObjects)
from django.cont... | bsd-3-clause |
freedomflyer/test | lab1/delay.py | 1 | 2951 | import sys
sys.path.append('..')
from src.sim import Sim
from src import node
from src import link
from src import packet
from plotting import Plotter
from networks.network import Network
import random
class Generator(object):
def __init__(self,node,destination,load,duration):
self.node = node
... | gpl-2.0 |
laanwj/bitcoin | test/functional/feature_block.py | 8 | 66273 | #!/usr/bin/env python3
# Copyright (c) 2015-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test block processing."""
import copy
import struct
import time
from test_framework.blocktools import ... | mit |
t-abe/chainer | chainer/functions/pooling/pooling_2d.py | 2 | 2703 | import collections
import numpy
from chainer import cuda
from chainer import function
from chainer.utils import conv
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cudnn.cudnn
def _pair(x):
if isinstance(x, collections.Iterable):
return x
return (x... | mit |
airbnb/knowledge-repo | knowledge_repo/_version.py | 1 | 3047 | import os
import subprocess
__all__ = ['__author__', '__author_email__', '__version__', '__git_uri__', '__dependencies__', '__optional_dependencies__']
__author__ = "Erik Ritter (maintainer), Serena Jiang, John Bodley, Bill Ulammandakh, Naoya Kanai, Robert Chang, Dan Frank, Chetan Sharma, Matthew Wardrop"
__author_... | apache-2.0 |
wozz/electrum | lib/daemon.py | 11 | 6844 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# 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 y... | gpl-3.0 |
egtaonline/GameAnalysis | gameanalysis/fixedpoint.py | 1 | 5111 | """Module for finding fixed points of functions on a simplex"""
import numpy as np
from gameanalysis import utils
def fixed_point(func, init, **kwargs):
"""Compute an approximate fixed point of a function
Parameters
----------
func : ndarray -> ndarray
A continuous function mapping from the ... | apache-2.0 |
Southpaw-TACTIC/TACTIC | 3rd_party/python3/site-packages/cheroot/workers/threadpool.py | 3 | 9345 | """A thread-based worker pool."""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import threading
import time
import socket
from six.moves import queue
__all__ = ('WorkerThread', 'ThreadPool')
class TrueyZero:
"""Object which equals and does math like the integer 0 but... | epl-1.0 |
Mistobaan/tensorflow | tensorflow/contrib/seq2seq/python/ops/helper.py | 8 | 25992 | # 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 |
def-/commandergenius | project/jni/python/src/Lib/test/test_threading.py | 52 | 16599 | # Very rudimentary test of threading module
import test.test_support
from test.test_support import verbose
import random
import re
import sys
import threading
import thread
import time
import unittest
import weakref
# A trivial mutable counter.
class Counter(object):
def __init__(self):
self.value = 0
... | lgpl-2.1 |
vitan/hue | desktop/core/ext-py/tablib-develop/tablib/packages/xlrd/__init__.py | 64 | 72055 | # -*- coding: cp1252 -*-
__VERSION__ = "0.7.1" # 2009-05-31
# <p>Copyright © 2005-2009 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under a
# BSD-style licence.</p>
import licences
##
# <p><b>A Python module for extracting data from MS Excel spreadsheet f... | apache-2.0 |
bguillot/OpenUpgrade | addons/hw_posbox_upgrade/controllers/main.py | 45 | 4164 | # -*- coding: utf-8 -*-
import logging
import os
import time
import openerp
import openerp.addons.hw_proxy.controllers.main as hw_proxy
import threading
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
upgrade_template = """
<!DOCTY... | agpl-3.0 |
jakobharlan/avango | attic/avango-menu/python/avango/menu/layout/_CheckBoxLayouter.py | 6 | 2434 | # -*- Mode:Python -*-
##########################################################################
# #
# This file is part of AVANGO. #
# ... | lgpl-3.0 |
chokribr/invenio | invenio/modules/editor/editorext/ticket_templates/sample_ticket.py | 18 | 1178 | # Copyright (C) 2014 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 option) any later version.
#
# Invenio is distributed in the hope that it w... | gpl-2.0 |
rammstein/0install | zeroinstall/injector/gpg.py | 5 | 10931 | """
Python interface to GnuPG.
This module is used to invoke GnuPG to check the digital signatures on interfaces.
@see: L{iface_cache.PendingFeed}
"""
# Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from zeroinstall import _, logger
import subprocess
import base... | lgpl-2.1 |
vdragan1993/python-coder | src/evaluation.py | 1 | 1922 | import numpy as np
import ast
from nltk.translate import bleu_score
from prep import split_to_words
from prep import word_to_index
from prep import pad_seq
def input_vec_to_words(X_test, vocab):
sentences = []
for sentence in X_test:
sentences.append(' '.join([vocab[word] for word in sentence[::-1] if word !=... | mit |
kritsadanshon/python_koans | python2/koans/about_strings.py | 1 | 3142 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutStrings(Koan):
def test_double_quoted_strings_are_strings(self):
string = "Hello, world."
self.assertEqual(True, isinstance(string, basestring))
def test_single_quoted_strings_are_also_strings(self):
... | mit |
DavidPurcell/murano_temp | murano/tests/unit/db/test_models.py | 5 | 1390 | # Copyright (c) 2014 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 applica... | apache-2.0 |
dodobas/osm-export-tool2 | scripts/spatialite_test.py | 1 | 2353 | """
Harness for running sql commands against a spatialite db from python.
This is work in progress towards a schema translation task.
From the project directory run:
./manage.py runscript spatialite_test --settings=hot_exports.settings -v2
Depends on django-extensions.
"""
import os
import sqlite3... | bsd-3-clause |
lyw07/kolibri | kolibri/core/discovery/utils/filesystem/posix.py | 1 | 9471 | import logging
import os
import re
import shutil
import subprocess
import sys
from .constants import drivetypes
from kolibri.utils.android import on_android
logger = logging.getLogger(__name__)
# Regex parser for the output of `mount` on OSX, which contains rows that looks like:
# /dev/disk1s1 on /Volumes/HP v125w ... | mit |
joyxu/autotest | client/shared/hosts/base_classes.py | 4 | 28519 | # Copyright 2009 Google Inc. Released under the GPL v2
"""
This module defines the base classes for the Host hierarchy.
Implementation details:
You should import the "hosts" package instead of importing each type of host.
Host: a machine on which you can run programs
"""
__author__ = """
mbligh@google.com (... | gpl-2.0 |
c0defreak/python-for-android | python-modules/twisted/twisted/python/monkey.py | 61 | 2182 | # -*- test-case-name: twisted.test.test_monkey -*-
# Copyright (c) 2007 Twisted Matrix Laboratories.
# See LICENSE for details.
class MonkeyPatcher(object):
"""
Cover up attributes with new objects. Neat for monkey-patching things for
unit-testing purposes.
"""
def __init__(self, *patches):
... | apache-2.0 |
jusdng/odoo | addons/l10n_cn/__init__.py | 339 | 1061 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2007-2014 Jeff Wang(<http://jeff@osbzr.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
catapult-project/catapult-csm | systrace/systrace/output_generator_unittest.py | 5 | 4793 | #!/usr/bin/env python
# Copyright 2016 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 hashlib
import json
import os
import unittest
from systrace import decorators
from systrace import output_generator
from systr... | bsd-3-clause |
marcuskrahl/beets | beetsplug/the.py | 25 | 3265 | # This file is part of beets.
# Copyright 2015, Blemjhoo Tezoulbr <baobab@heresiarch.info>.
#
# 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 limitati... | mit |
henocdz/dotcom | PIL/ImageDraw.py | 40 | 11606 | #
# The Python Imaging Library
# $Id$
#
# drawing interface operations
#
# History:
# 1996-04-13 fl Created (experimental)
# 1996-08-07 fl Filled polygons, ellipses.
# 1996-08-13 fl Added text support
# 1998-06-28 fl Handle I and F images
# 1998-12-29 fl Added arc; use arc primitive to draw ellipses
# 1999-01... | mit |
ashwinr64/furnace-condor | 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 |
dmlc/mxnet | example/svrg_module/api_usage_example/example_api_train.py | 9 | 4418 | # 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 |
davidharrigan/django | tests/migrations/test_state.py | 86 | 44912 | from django.apps.registry import Apps
from django.contrib.contenttypes.fields import GenericForeignKey
from django.db import models
from django.db.migrations.exceptions import InvalidBasesError
from django.db.migrations.operations import (
AddField, AlterField, DeleteModel, RemoveField,
)
from django.db.migrations.... | bsd-3-clause |
rishikksh20/scikit-learn | examples/calibration/plot_calibration.py | 66 | 4795 | """
======================================
Probability calibration of classifiers
======================================
When performing classification you often want to predict not only
the class label, but also the associated probability. This probability
gives you some kind of confidence on the prediction. However,... | bsd-3-clause |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/sklearn/linear_model/logistic.py | 1 | 67834 | """
Logistic Regression
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Fabian Pedregosa <f@bianp.net>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Lars Buitinck
# Simon Wu <s8wu@uwaterloo.ca>
imp... | mit |
havt/odoo | addons/account/report/account_print_overdue.py | 380 | 3907 | # -*- 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 GNU... | agpl-3.0 |
enclose-io/compiler | current/tools/checkimports.py | 4 | 1582 | #!/usr/bin/env python
from __future__ import print_function
import glob
import io
import re
import sys
import itertools
def do_exist(file_name, lines, imported):
if not any(not re.match('using \w+::{0};'.format(imported), line) and
re.search('\\b{0}\\b'.format(imported), line) for line in lines):
p... | mit |
muntasirsyed/intellij-community | python/lib/Lib/site-packages/django/core/management/commands/createcachetable.py | 313 | 2307 | from optparse import make_option
from django.core.management.base import LabelCommand
from django.db import connections, transaction, models, DEFAULT_DB_ALIAS
class Command(LabelCommand):
help = "Creates the table needed to use the SQL cache backend."
args = "<tablename>"
label = 'tablename'
option_l... | apache-2.0 |
lcamacho/airmozilla | airmozilla/base/mozillians.py | 10 | 4469 | import logging
import urllib
import json
import requests
from django.core.cache import cache
from django.conf import settings
class BadStatusCodeError(Exception):
pass
def _fetch_users(email=None, groups=None, is_username=False):
if not getattr(settings, 'MOZILLIANS_API_KEY', None): # pragma no cover
... | bsd-3-clause |
fintech-circle/edx-platform | common/lib/capa/capa/responsetypes.py | 3 | 164436 | #
# File: courseware/capa/responsetypes.py
#
"""
Problem response evaluation. Handles checking of student responses,
of a variety of types.
Used by capa_problem.py
"""
# pylint: disable=attribute-defined-outside-init
# standard library imports
import abc
# TODO: Refactor this code and fix this issue.
import cgi
im... | agpl-3.0 |
rocket-league-replays/rocket-league-replays | rocket_league/apps/replays/management/commands/replay_hits.py | 1 | 24529 | import json
import math
import subprocess
import time
from datetime import datetime
from sys import platform
from django.conf import settings
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.core.management.base import BaseCommand
from django.utils import... | gpl-3.0 |
thenakliman/nirikshak | nirikshak/tests/unit/workers/systemd/enabled_service.py | 1 | 2312 | # Copyright 2017 <thenakliman@gmail.com>
#
# 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... | apache-2.0 |
Talkdesk/graphite-web | webapp/graphite/composer/views.py | 58 | 3906 | """Copyright 2008 Orbitz WorldWide
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | apache-2.0 |
dmccloskey/SBaaS_thermodynamics | SBaaS_thermodynamics/stage03_quantification_simulatedData_execute.py | 1 | 3280 | #SBaaS
from .stage03_quantification_simulatedData_io import stage03_quantification_simulatedData_io
from .stage03_quantification_simulation_query import stage03_quantification_simulation_query
# Dependencies from thermodynamics
from thermodynamics.thermodynamics_simulatedData import thermodynamics_simulatedData
class ... | mit |
eddiemonroe/opencog | opencog/python/utility/csv_dataset_parser.py | 34 | 5117 | import csv
import urllib2
__author__ = 'keyvan-m-sadeghi'
class _incomplete_value(object):
def __repr__(self):
return 'incomplete-value'
def _convert_to_bool(value):
if value.lower() in ('0','f','false','n','no',''):
return False
return True
INCOMPLETE_VALUE = _incomplete_value()
CONVER... | agpl-3.0 |
fake-name/IntraArchiveDeduplicator | Tests/Test_phashArch.py | 1 | 5073 |
import unittest
import scanner.logSetup as logSetup
import os.path
import pArch
# Unit testing driven by lolcat images
# AS GOD INTENDED!
class TestSequenceFunctions(unittest.TestCase):
def __init__(self, *args, **kwargs):
logSetup.initLogging()
super().__init__(*args, **kwargs)
def test_pArch_1(self):
c... | bsd-3-clause |
apache/airflow | tests/providers/google/cloud/operators/test_spanner.py | 2 | 23995 | #
# 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... | apache-2.0 |
killswitch-GUI/SimplyTemplate | Helpers/Helpers.py | 1 | 2812 | #!/usr/bin/env python
import os
import sys
import types
import string
import textwrap
import subprocess
import re
def color(string, status=True, warning=False, bold=True, blue=False, firewall=False, green=False):
"""
Change text color for the linux terminal, defaults to green.
Set "warning=True" for red.... | gpl-2.0 |
oasiswork/odoo | addons/account_analytic_analysis/account_analytic_analysis.py | 96 | 48446 | # -*- 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 GNU... | agpl-3.0 |
orospakr/peephole | examples/simple_player.py | 1 | 3525 | #!/usr/bin/env python
# it may not be an ipod, but it's a good demo!
# hunks of code stolen from Andy Wingo's (f)vumeter.py.
import pygst
import gst
import gobject
import dbus
import dbus.mainloop.glib
import logging
import sys
def iec_scale(db):
'''Returns the meter deflection percentage given a dB value.'''
... | gpl-3.0 |
kakunbsc/enigma2.1 | lib/python/Screens/ServiceScan.py | 1 | 2708 | from Screen import Screen
from Components.ServiceScan import ServiceScan as CScan
from Components.ProgressBar import ProgressBar
from Components.Label import Label
from Components.ActionMap import ActionMap
from Components.FIFOList import FIFOList
from Components.Sources.FrontendInfo import FrontendInfo
class ServiceS... | gpl-2.0 |
qliu/mhcdashboard | mhcdashboard/smart_selects/views.py | 9 | 1678 | from django.db.models import get_model
from django.http import HttpResponse
try:
import json
except ImportError:
from django.utils import simplejson as json
from smart_selects.utils import (get_keywords, sort_results, serialize_results,
get_queryset)
def filterchain(request, ... | gpl-2.0 |
askeing/servo | tests/wpt/web-platform-tests/tools/wptserve/docs/conf.py | 467 | 7855 | # -*- coding: utf-8 -*-
#
# wptserve documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 14 17:23:24 2013.
#
# 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.
#
# Al... | mpl-2.0 |
ahmed-mahran/hue | desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/big5prober.py | 2931 | 1684 | ######################## 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... | apache-2.0 |
jostep/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/models/k_feature_decisions_to_data_then_nn_test.py | 158 | 3464 | # 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 |
martinburchell/econsensus | django/econsensus/publicweb/tests/actionitems_view_test.py | 1 | 8863 | from django.utils.unittest import TestCase
from django.test.client import RequestFactory
from django.core.urlresolvers import reverse, resolve
from django.contrib.auth.models import User
from BeautifulSoup import BeautifulSoup
from waffle import Switch
from decision_test_case import DecisionTestCase
from actionitems.... | gpl-3.0 |
Juniper/tempest | tempest/api/compute/admin/test_volume_swap.py | 1 | 6168 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/sklearn/neural_network/tests/test_rbm.py | 1 | 6273 | import re
import sys
import numpy as np
from scipy.sparse import csc_matrix, csr_matrix, lil_matrix
from sklearn.datasets import load_digits
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.neural_network import BernoulliRBM
from sklearn.utils.testing import (assert_almost_equal, assert_array... | mit |
Protonotarios/3-jugs-and-more | depth-first.py | 1 | 4553 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Το πρόβλημα με τις τρεις καρδάρες
Αναζήτηση σε βάθος
"""
# Ιωάννης Πρωτονοτάριος <ioannis@protonotarios.eu>
# Εργασία για το μάθημα Ευφυή συστήματα
# 21 Μαρτίου 2016
# GNU license
k=[0,0,10]
katastaseis_poy_exoyme_e3etasei=[k]
seira_afethriwn=[2,1,0]
seira_... | gpl-3.0 |
ntoll/yotta | yotta/lib/hg_access.py | 5 | 3451 | # Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import logging
import re
# version, , represent versions and specifications, internal
import version
# access_common, , things shared between different component access modul... | apache-2.0 |
karthik-sethuraman/Snowmass-ONFOpenTransport | RI/flask_server/tapi_server/test/test_tapi_oam_controller.py | 4 | 83202 | # coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from tapi_server.models.inline_object10 import InlineObject10 # noqa: E501
from tapi_server.models.inline_object16 import InlineObject16 # noqa: E501
from tapi_server.models.inline_object21 import InlineObject21 ... | apache-2.0 |
cshallue/models | research/rebar/rebar_train.py | 9 | 6852 | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
mrquim/repository.mrquim | script.module.schism.common/lib/jsbeautifier/tests/test-perf-jsbeautifier.py | 72 | 1126 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import copy
import jsbeautifier
options = jsbeautifier.default_options()
options.wrap_line_length = 80
data = ''
data_min = ''
def beautifier_test_underscore():
jsbeautifier.beautify(data, options)
def beautifier_test_underscore_min():
jsbeautifier.beau... | gpl-2.0 |
neilhan/tensorflow | tensorflow/python/platform/benchmark.py | 14 | 11073 | # 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 |
VitalPet/account-financial-tools | account_constraints/model/account_bank_statement.py | 24 | 2979 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Joel Grand-Guillaume. Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | agpl-3.0 |
shishaochen/TensorFlow-0.8-Win | third_party/grpc/src/python/grpcio/tests/unit/framework/interfaces/__init__.py | 1496 | 1530 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | apache-2.0 |
trwhitcomb/cylc | cylc/flow/tests/test_task_events_mgr.py | 1 | 2508 | #!/usr/bin/env python3
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors.
#
# 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... | gpl-3.0 |
John-Lin/ryu | ryu/services/protocols/bgp/info_base/vpn.py | 34 | 3720 | # Copyright (C) 2014 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 appli... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.