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 |
|---|---|---|---|---|---|
bendudson/BOUT | tools/pylib/post_bout/pb_nonlinear.py | 2 | 3020 | #some function to plot nonlinear stuff
from pb_corral import LinRes
from ListDict import ListDictKey, ListDictFilt
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib.artist as artist
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt
import matplotlib.patche... | gpl-3.0 |
tectronics/peepdf | aespython/key_expander.py | 43 | 4141 | #!/usr/bin/env python
"""
AES Key Expansion.
Expands 128, 192, or 256 bit key for use with AES
Running this file as __main__ will result in a self-test of the algorithm.
Algorithm per NIST FIPS-197 http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
Copyright (c) 2010, Adam Newman http://www.caller9.com/
L... | gpl-3.0 |
kemalakyol48/python-for-android | python-modules/twisted/twisted/web/error.py | 52 | 7408 | # -*- test-case-name: twisted.web.test.test_error -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Exception definitions for L{twisted.web}.
"""
import operator, warnings
from twisted.web import http
class Error(Exception):
"""
A basic HTTP error.
@type status:... | apache-2.0 |
Wesalius/EloBot | pywikibot/data/api.py | 1 | 135569 | # -*- coding: utf-8 -*-
"""Interface to Mediawiki's api.php."""
#
# (C) Pywikibot team, 2007-2018
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
import datetime
import hashlib
import inspect
import json
import os
import pprint
import re
import traceback
... | gpl-3.0 |
chris-chris/tensorflow | tensorflow/contrib/keras/python/keras/datasets/reuters.py | 16 | 4441 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
hurrinico/account-invoice-reporting | __unported__/invoice_print_report_balance_payment/report/__init__.py | 11 | 1034 | # -*- encoding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it un... | agpl-3.0 |
KohlsTechnology/ansible | test/units/modules/network/iosxr/test_iosxr_facts.py | 23 | 3398 | # (c) 2016 Red Hat Inc.
#
# 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 dis... | gpl-3.0 |
DMLoy/ECommerceBasic | lib/python2.7/site-packages/django/db/models/fields/subclassing.py | 227 | 1815 | """
Convenience routines for creating non-trivial Field subclasses, as well as
backwards compatibility utilities.
Add SubfieldBase as the metaclass for your Field subclass, implement
to_python() and the other necessary methods and everything will work
seamlessly.
"""
class SubfieldBase(type):
"""
A metaclass ... | mit |
vitor-alves/pixel-canvas-bot | packages/chardet/universaldetector.py | 244 | 12485 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
Antiun/bank-statement-reconcile | account_bank_statement_period_from_line_date/model/__init__.py | 10 | 1258 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Therp BV - http://therp.nl.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# cons... | agpl-3.0 |
FrodeSolheim/fs-uae-launcher | launcher/fswidgets2/flexlayout.py | 1 | 11729 | from typing import Optional, Tuple
from typing_extensions import Literal
from fsui.common.layout import Layout
from fswidgets.widget import Widget
# from autologging import traced
TOP = 0
RIGHT = 1
BOTTOM = 2
LEFT = 3
# @traced
class FlexLayout(Layout):
def __init__(self, parent=None):
self.children =... | gpl-2.0 |
etalab/udata | udata/core/organization/models.py | 1 | 7965 | from datetime import datetime
from itertools import chain
from blinker import Signal
from flask import url_for
from mongoengine.signals import pre_save, post_save
from werkzeug import cached_property
from elasticsearch_dsl import Integer, Object
from udata.core.storages import avatars, default_image_basename
from uda... | agpl-3.0 |
theshteves/tweet-the-wolf | pips/pycparser/ply/ctokens.py | 363 | 3170 | # ----------------------------------------------------------------------
# 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... | mit |
Eficent/odoomrp-wip | mrp_byproduct_operations/models/mrp_production.py | 29 | 1817 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Daniel Campos (danielcampos@avanzosc.es) Date: 29/09/2014
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publi... | agpl-3.0 |
auready/django | scripts/manage_translations.py | 44 | 7112 | #!/usr/bin/env python
#
# This python file contains utility scripts to manage Django translations.
# It has to be run inside the django git root directory.
#
# The following commands are available:
#
# * update_catalogs: check for new strings in core and contrib catalogs, and
# output how much string... | bsd-3-clause |
emilk/sproxel | distro/common/lib/calendar.py | 53 | 23815 | """Calendar printing functions
Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday)."""
import sys
i... | bsd-3-clause |
Plain-Andy-legacy/android_external_chromium_org | third_party/markdown/extensions/codehilite.py | 109 | 10820 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | bsd-3-clause |
kronicz/ecommerce-2 | lib/python2.7/site-packages/django/contrib/sessions/backends/cached_db.py | 45 | 2897 | """
Cached, database-backed sessions.
"""
import logging
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.core.cache import caches
from django.core.exceptions import SuspiciousOperation
from django.utils import timezone
from django.utils.encoding imp... | mit |
gbalme/Anacoinda | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
g-k/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/mock.py | 465 | 6715 | # Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
pwhelan/djshouts | django/contrib/messages/storage/__init__.py | 393 | 1183 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_storage(import_path):
"""
Imports the message storage class described by import_path, where
import_path is the full Python path to the class.
"""
try:
... | bsd-3-clause |
epiphyte/freeradius | mods-config/python/tests/user_user1.py | 1 | 1087 | """User with admin and dev and various macs."""
import users.__config__ as __config__
import users.common as common
normal = __config__.Assignment()
normal.macs = [common.VALID_MAC]
normal.password = "3011966157.3832116431|1152195262.2761726061|160098348.1521412198|2651066.3518708095|955852492.2571409067|2745761716.393... | mit |
Chilledheart/chromium | tools/telemetry/third_party/pyserial/serial/serialwin32.py | 147 | 18260 | #! python
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# serial driver for win32
# see __init__.py
#
# (C) 2001-2011 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
#
# Initial patch to use ctypes by Giovanni Bajo <rasky@develer.com>
import ctypes
f... | bsd-3-clause |
trishantofficial/Footyy | src/Footyy/Competition.py | 1 | 1660 |
class Competition:
def __init__(self, competition):
self.id = competition['id']
self.caption = competition['caption']
self.league = competition['league']
self.year = competition['year']
self.currentMatchday = competition['currentMatchday']
self.currentMatchda... | mit |
wooga/airflow | tests/operators/test_subdag_operator.py | 1 | 11697 | #
# 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 |
hwkns/django-ajax-selects | example/example/lookups.py | 6 | 6205 |
from django.db.models import Q
from django.utils.html import escape
from example.models import Person, Group, Song
from ajax_select import LookupChannel
class PersonLookup(LookupChannel):
model = Person
def get_query(self, q, request):
return Person.objects.filter(Q(name__icontains=q) | Q(email__is... | gpl-3.0 |
argonemyth/sentry | tests/sentry/api/endpoints/test_team_project_index.py | 23 | 1513 | from django.core.urlresolvers import reverse
from sentry.models import Project
from sentry.testutils import APITestCase
class TeamProjectIndexTest(APITestCase):
def test_simple(self):
self.login_as(user=self.user)
team = self.create_team(slug='baz')
project_1 = self.create_project(team=tea... | bsd-3-clause |
thanm/devel-scripts | gcc-crosscompiler-build.py | 1 | 13226 | #!/usr/bin/python3
"""Configure and/or build a GCC cross compiler.
Utilities for configuring and building a GCC cross compiler.
Assumption here is that "." (the directory we're invoked from)
contains the top-level download of gcc (either from a tar file or from
svn/git). The script will populate this directory with th... | apache-2.0 |
viniciusgama/blog_gae | django/contrib/gis/utils/wkt.py | 419 | 1846 | """
Utilities for manipulating Geometry WKT.
"""
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated to that number:
>>> pnt =... | bsd-3-clause |
JoelEager/pyTanks.Player | clientLogic/wsClient.py | 1 | 2652 | """
Starts up the asyncio tasks and handles the websocket io logic
"""
import asyncio
import websockets
import socket
from . import clientData, clock
from .logging import logPrint
import config
async def __sendTask(websocket):
"""
Send messages to the server as they are appended to the outgoing queue
"""... | mit |
timkrentz/SunTracker | IMU/VTK-6.2.0/ThirdParty/Twisted/twisted/words/iwords.py | 2 | 8801 | # -*- test-case-name: twisted.words.test -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from zope.interface import Interface, Attribute, implements
class IProtocolPlugin(Interface):
"""Interface for plugins providing an interface to a Words service
"""
name = Attrib... | mit |
kubeflow/kfserving | python/kfserving/test/test_v1alpha2_py_torch_spec.py | 1 | 1454 | # Copyright 2020 kubeflow.org.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
Cactuslegs/audacity-of-nope | lib-src/lv2/sratom/waflib/Tools/ldc2.py | 330 | 1029 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import sys
from waflib.Tools import ar,d
from waflib.Configure import conf
@conf
def find_ldc2(conf):
conf.find_program(['ldc2'],var='D')
out=conf.cmd_and_log([conf.env.D,'-... | gpl-2.0 |
GovReady/govready-q | controls/models.py | 1 | 51157 | from pathlib import Path
import os
import json
import auto_prefetch
from django.db import models
from django.db.models import Count
from django.utils.functional import cached_property
from guardian.shortcuts import (assign_perm, get_objects_for_user,
get_perms_for_model, get_user_perms,
... | gpl-3.0 |
Affix/CouchPotatoServer | libs/guessit/transfo/guess_idnumber.py | 102 | 2224 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
chirilo/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/handlers/activebots.py | 128 | 2680 | # 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 ... | bsd-3-clause |
GrotheFAF/client | src/vault/luaparser.py | 3 | 12907 | """
lua data parser by Raging_Squirrel
to parse lua file, initialize the class with path to the file
call parse method to extract the data you need
the 1st parameter is a dictionary which represents search and data mapping
keys: 'parent>name:command' - where to search
values: 'destination:alias' - how to map f... | gpl-3.0 |
ecanzonieri/pyleus | examples/top_urls/top_urls/requests_generator.py | 9 | 1367 | from __future__ import absolute_import
import logging
from random import choice
import time
try:
import simplejson as json
_ = json # pyflakes
except ImportError:
import json
from pyleus.storm import Spout
log = logging.getLogger('requests_generator')
FIRST = (
"www.ninjacorp.com",
"www.ninja... | apache-2.0 |
spcui/avocado-vt | virttest/utils_test/libguestfs.py | 9 | 31980 | import re
import os
import logging
import commands
from avocado.core import exceptions
from avocado.utils import process
from .. import virsh, virt_vm, libvirt_vm, data_dir
from .. import utils_net, xml_utils
from .. import utils_libguestfs as lgf
from .. import qemu_storage
from ..libvirt_xml import vm_xml, xcepts
... | gpl-2.0 |
nwjs/chromium.src | tools/android/generate_java_test/generate_java_test.py | 3 | 11091 | #!/usr/bin/python
# Copyright 2019 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.
'''
This script helps to generate Java instrumentation tests and/or Unit test
(robolectric) for new feature Other than that, it helps to add... | bsd-3-clause |
ankit01ojha/coala-bears | bears/python/PyUnusedCodeBear.py | 4 | 2221 | import autoflake
from coalib.bears.LocalBear import LocalBear
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.bearlib.aspects import map_setting_to_aspect
from coalib.bearlib.aspects.Redundancy import... | agpl-3.0 |
Frikanalen/frikanalen | packages/utils/prom-check-video-stream/audio_analysis.py | 1 | 1088 | import re
import subprocess
import logging
import ffmpeg
logging.basicConfig(level=logging.INFO, format='%(message)s')
logger = logging.getLogger(__file__)
logger.setLevel(logging.INFO)
def _logged_popen(cmd_line, *args, **kwargs):
logger.debug('Running command: {}'.format(subprocess.list2cmdline(cmd_line)))
... | lgpl-3.0 |
JohnyEngine/CNC | deprecated/heekspython/examples/example.py | 1 | 5212 | import HeeksPython as cad
import math
beam_width = 2.0;
beam_height = 2.0;
beam_thickness = .25;
bend_radius = 20.0;
line_length = 40*12.0;
dead_zone_width = 3*12.0;
top_overhang = 1.1;
bottom_overhang = 4.1;
side_overhang = 1.0;
gripper_thickness = .5;
beam_clearance = .1;
rail_height = 1;
bearing_clearance = .25... | apache-2.0 |
alzamer2/Crunchyroll-XML-Decoder | crunchy-xml-decoder/unidecode/x013.py | 252 | 4247 | data = (
'ja', # 0x00
'ju', # 0x01
'ji', # 0x02
'jaa', # 0x03
'jee', # 0x04
'je', # 0x05
'jo', # 0x06
'jwa', # 0x07
'ga', # 0x08
'gu', # 0x09
'gi', # 0x0a
'gaa', # 0x0b
'gee', # 0x0c
'ge', # 0x0d
'go', # 0x0e
'[?]', # 0x0f
'gwa', # 0x10
'[?]', # 0x11
'gwi', # 0x1... | gpl-2.0 |
jaimesanz/suds-webpay | suds/store.py | 204 | 18425 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | lgpl-3.0 |
zaro0508/jenkinsapi | jenkinsapi_tests/unittests/test_jenkins.py | 6 | 19097 | import mock
# To run unittests on python 2.6 please use unittest2 library
try:
import unittest2 as unittest
except ImportError:
import unittest
from jenkinsapi.plugins import Plugins
from jenkinsapi.utils.requester import Requester
from jenkinsapi.jenkins import Jenkins, JenkinsBase, Job
from jenkinsapi.custom... | mit |
huaweiswitch/neutron | neutron/tests/unit/ml2/drivers/test_bigswitch_mech.py | 6 | 9148 | # Copyright 2014 Big Switch Networks, 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 appl... | apache-2.0 |
radianbaskoro/mathdoku-solver | test/SolverTest.py | 1 | 4890 | '''
MathDoku solver unit tests.
@author: Radian Baskoro
'''
import unittest
from mathdokusolver.Solver import *
class SolverTest(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
'''
Initialization tests
'''
def testInitialization(self):
i = '3 2... | apache-2.0 |
souravsingh/sympy | sympy/physics/mechanics/linearize.py | 62 | 15341 | from __future__ import print_function, division
__all__ = ['Linearizer']
from sympy import Matrix, eye, zeros, Dummy
from sympy.utilities.iterables import flatten
from sympy.physics.vector import dynamicsymbols
from sympy.physics.mechanics.functions import msubs
import collections
class Linearizer(object):
"""T... | bsd-3-clause |
dyoung418/tensorflow | tensorflow/contrib/kernel_methods/python/mappers/random_fourier_features.py | 82 | 6616 | # 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 |
inessadl/kinect-2-libras | Kinect2Libras/KinectFingerTracking/Lib/lib2to3/fixes/fix_ws_comma.py | 334 | 1095 | """Fixer that changes 'a ,b' into 'a, b'.
This also changes '{a :b}' into '{a: b}', but does not touch other
uses of colons. It does not touch other uses of whitespace.
"""
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
class FixWsComma(fixer_base.BaseFix):
explicit = True # The use... | apache-2.0 |
codekaki/odoo | addons/hr_payroll/__openerp__.py | 56 | 2526 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
sgino209/LPR | Code/Python/KNN_training/convert.py | 2 | 8324 | # !/usr/bin/python
# (c) Shahar Gino, June-2017, sgino209@gmail.com
from sys import exit, argv
from getopt import getopt, GetoptError
from numpy import loadtxt, savetxt, float32, empty
from os import path, mkdir, chdir, system, listdir
from cv2 import imread, imwrite, cvtColor, COLOR_RGB2GRAY
__version__ = "1.0"
# P... | apache-2.0 |
mgedmin/ansible | lib/ansible/modules/network/nxos/nxos_snmp_contact.py | 25 | 12059 | #!/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 |
fabianp/scikit-learn | sklearn/utils/arpack.py | 265 | 64837 | """
This contains a copy of the future version of
scipy.sparse.linalg.eigen.arpack.eigsh
It's an upgraded wrapper of the ARPACK library which
allows the use of shift-invert mode for symmetric matrices.
Find a few eigenvectors and eigenvalues of a matrix.
Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/
"""
#... | bsd-3-clause |
akshaybabloo/Car-ND | Project_4/old_old_process/helper.py | 1 | 24062 | import cv2
import numpy as np
from scipy import signal
def abs_sobel_thresh(img, orient='x', sobel_kernel=3, thresh=(0, 255)):
# Apply the following steps to img
# 1) Convert to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
# 2) Take the derivative in x or y given orient = 'x' or 'y'
if o... | mit |
ar7z1/ansible | lib/ansible/module_utils/network/routeros/routeros.py | 35 | 5356 | # 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 |
kouk/django-registration-1.5 | registration/backends/default/__init__.py | 3 | 5422 | from django.conf import settings
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from django.contrib.auth import get_user_model
from registration import signals
from registration.forms import RegistrationForm
from registration.models import RegistrationProfile
user_mod... | bsd-3-clause |
wareash/linux-xylon | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
twisted/sine | sine/sipserver.py | 2 | 14957 | import time
from zope.interface import implements
from twisted.python.util import sibpath
from twisted.internet import reactor, defer
from twisted.python.components import registerAdapter
from twisted.application.service import IService, Service
from twisted.cred.portal import Portal
from nevow import athena, tags
... | mit |
stafur/pyTRUST | pycoin/pycoin/wallet/SQLite3Wallet.py | 2 | 5493 | from threading import RLock
from pycoin.convention.tx_fee import TX_FEE_PER_THOUSAND_BYTES
from pycoin.tx.tx_utils import create_tx, sign_tx
DUST = 0
class SQLite3Wallet(object):
def __init__(self, keychain, persistence, desired_spendable_count=None):
self.keychain = keychain
self.persistence =... | apache-2.0 |
andnovar/kivy | examples/container/main.py | 25 | 1681 | # -*- coding: utf-8 -*-
'''
Container Example
==============
This example shows how to add a container to our screen.
A container is simply an empty place on the screen which
could be filled with any other content from a .kv file.
'''
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout impor... | mit |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/setuptools/command/bdist_egg.py | 46 | 17441 | """setuptools.command.bdist_egg
Build .egg distributions"""
from distutils.errors import DistutilsSetupError
from distutils.dir_util import remove_tree, mkpath
from distutils import log
from types import CodeType
import sys
import os
import textwrap
import marshal
from setuptools.extern import six
from pkg_resource... | mit |
Abhin33t/ann_minor | Normalization_module.py | 1 | 2715 | __author__ = 'Abhineet Saxena'
"""
Indian Liver Patient Database: Dataset Normalization Program
"""
def minMax(listvar_recs, list_indices):
#print 'Entered minMax'
len_list = len(list_indices)
max_list = [-999999999.0]*len_list
min_list = [999999999.0]*len_list
for iter_rec in listvar_recs:
... | gpl-2.0 |
Intel-Corporation/tensorflow | tensorflow/contrib/ignite/python/ops/igfs_op_loader.py | 15 | 1057 | # Copyright 2018 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 |
BjoernT/python-openstackclient | openstackclient/volume/v1/volume_type.py | 2 | 6823 | # Copyright 2012-2013 OpenStack Foundation
#
# 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 la... | apache-2.0 |
kadircet/CENG | 783/HW1/cs231n/classifiers/k_nearest_neighbor.py | 1 | 7277 | import numpy as np
class KNearestNeighbor:
""" a kNN classifier with L2 distance """
def __init__(self):
pass
def train(self, X, y):
"""
Train the classifier. For k-nearest neighbors this is just
memorizing the training data.
Input:
X - A num_train x dimension array where each row is ... | gpl-3.0 |
gis3w/geoscopio_search | __init__.py | 1 | 1505 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
GeoscopioSearch
A QGIS plugin
desc
-------------------
begin : 2016-07-14
copyright : (C) 2016 by Walter lore... | gpl-2.0 |
campbe13/openhatch | vendor/packages/celery/celery/utils/dispatch/saferef.py | 18 | 10808 | # -*- coding: utf-8 -*-
"""
"Safe weakrefs", originally from pyDispatcher.
Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).
"""
from __future__ import absolute_import
import weakref
import traceback
def safe_ref(target, on_delete=None):
""... | agpl-3.0 |
durden/tablib | tablib/packages/xlwt3/UnicodeUtils.py | 46 | 3408 | '''
From BIFF8 on, strings are always stored using UTF-16LE text encoding. The
character array is a sequence of 16-bit values4. Additionally it is
possible to use a compressed format, which omits the high bytes of all
characters, if they are all zero.
The following tables describe the standard form... | mit |
kennethreitz/bpwatch | logplex/packages/requests/packages/charade/utf8prober.py | 205 | 2728 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
... | mit |
hfp/libxsmm | samples/deeplearning/sparse_training/fairseq/fairseq/optim/fp16_optimizer.py | 1 | 15441 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from itertools import chain
import torch
from fairseq import optim, utils
from .dynamic_loss_scaler import DynamicLossScaler
class _FP16O... | bsd-3-clause |
proxysh/Safejumper-for-Mac | buildmac/Resources/env/lib/python2.7/site-packages/twisted/names/test/test_examples.py | 13 | 5349 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.names} example scripts.
"""
from __future__ import absolute_import, division
import sys
from twisted.python.filepath import FilePath
from twisted.trial.unittest import SkipTest, TestCase
from twisted.python.compat import... | gpl-2.0 |
adambyram/bite-project-mod | tools/bugs/server/appengine/providers/services.py | 17 | 3225 | # Copyright 2011 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 |
rspavel/spack | var/spack/repos/builtin/packages/llvm-amdgpu/package.py | 1 | 1464 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class LlvmAmdgpu(CMakePackage):
"""Toolkit for the construction of highly optimized compilers,
... | lgpl-2.1 |
tecnovert/particl-core | test/functional/p2p_blockfilters.py | 21 | 9776 | #!/usr/bin/env python3
# Copyright (c) 2019-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.
"""Tests NODE_COMPACT_FILTERS (BIP 157/158).
Tests that a node configured with -blockfilterindex and -pee... | mit |
pambot/SMSBeds | lib/mechanize/_html.py | 132 | 20888 | """HTML handling.
Copyright 2003-2006 John J. Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it under
the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt
included with the distribution).
"""
import codecs
import copy
import htmlentitydefs
import re
import _sgml... | gpl-2.0 |
shackra/thomas-aquinas | summa/framegrabber.py | 1 | 7377 | # coding: utf-8
# Copyright (c) 2013 Jorge Javier Araya Navarro <jorgean@lavabit.org>
#
# This file is free software: you may copy, redistribute 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... | bsd-3-clause |
Lujeni/ansible | lib/ansible/modules/network/check_point/cp_mgmt_vpn_community_star.py | 20 | 9225 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point Firewall (c) 2019
#
# 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 o... | gpl-3.0 |
ccs-bio/melanoma-transcriptomics | 5_visualizations/mappings.py | 1 | 6068 | #!/usr/bin/python
# coding: utf-8
# ---------------------------------------------------------------------------------------------------------------------
#
# Center for Computational Science
# http://www.ccs.miami.edu/
# University of Miami
#
... | gpl-3.0 |
guildai/guild | guild/external/pip/_internal/locations.py | 9 | 6301 | """Locations where we look for configs, install stuff, etc"""
from __future__ import absolute_import
import os
import os.path
import platform
import site
import sys
import sysconfig
from distutils import sysconfig as distutils_sysconfig
from distutils.command.install import SCHEME_KEYS # type: ignore
from pip._inter... | apache-2.0 |
gangadhar-kadam/laganerp | erpnext/setup/doctype/company/company.py | 31 | 15343 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, os
from frappe import _
from frappe.utils import cint
import frappe.defaults
from frappe.model.document import Document
class Comp... | agpl-3.0 |
crtynes/zookeeper | src/contrib/zkpython/src/test/acl_test.py | 148 | 4421 | #!/usr/bin/python
#
# 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
# "Lic... | apache-2.0 |
fvpolpeta/devide | modules/filters/selectConnectedComponents.py | 7 | 4550 | from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtk
import vtkdevide
class selectConnectedComponents(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, mo... | bsd-3-clause |
mattclay/ansible-modules-core | windows/win_get_url.py | 15 | 4075 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Paul Durivage <paul.durivage@rackspace.com>, and others
#
# 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, eithe... | gpl-3.0 |
TeamTwisted/external_chromium_org | tools/deep_memory_profiler/visualizer/app.py | 99 | 3094 | # Copyright 2013 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.
# This file is expected to be used under another directory to use,
# so we disable checking import path of GAE tools from this directory.
# pylint: disable=F... | bsd-3-clause |
madscatt/zazzie_1.5 | trunk/sassie/simulate/energy/readparam.py | 3 | 2948 | '''
SASSIE: Copyright (C) 2011 Joseph E. Curtis, Ph.D.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | gpl-3.0 |
matematik7/STM | stm/image.py | 1 | 14538 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------
# stm/image.py
#
# Image representation, contains functions for image manipulation.
# ----------------------------------------------------------------
# copyright (c) 2015 - Domen Ipavec
# Distributed unde... | mit |
luca76/QGIS | python/plugins/db_manager/db_model.py | 6 | 16244 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
openstack/heat | heat_integrationtests/functional/test_keystone_user_with_domain.py | 1 | 5524 | # 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 |
cstipkovic/spidermonkey-research | js/src/build_OPT.OBJ/_virtualenv/lib/python2.7/site-packages/pip/req/req_uninstall.py | 510 | 6897 | from __future__ import absolute_import
import logging
import os
import tempfile
from pip.compat import uses_pycache, WINDOWS, cache_from_source
from pip.exceptions import UninstallationError
from pip.utils import rmtree, ask, is_local, renames, normalize_path
from pip.utils.logging import indent_log
logger = loggin... | mpl-2.0 |
zasdfgbnm/tensorflow | tensorflow/python/kernel_tests/constant_op_eager_test.py | 24 | 20248 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
NazarethCollege/heweb2017-devops-presentation | sites/tweetheat/src/backend/vendor/src/github.com/youtube/vitess/test/vtctld_test.py | 6 | 6789 | #!/usr/bin/env python
# Copyright 2017 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... | mit |
Soya93/Extract-Refactoring | plugins/hg4idea/testData/bin/hgext/patchbomb.py | 90 | 21409 | # patchbomb.py - sending Mercurial changesets as patch emails
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''command to send changesets as (a series of) patch ... | apache-2.0 |
senttech/Cura | cura/Layer.py | 2 | 4379 | from .LayerPolygon import LayerPolygon
from UM.Math.Vector import Vector
from UM.Mesh.MeshBuilder import MeshBuilder
import numpy
class Layer:
def __init__(self, layer_id):
self._id = layer_id
self._height = 0.0
self._thickness = 0.0
self._polygons = []
self._element_count... | agpl-3.0 |
leeseuljeong/leeseulstack_neutron | neutron/server/__init__.py | 8 | 2236 | #!/usr/bin/env python
# Copyright 2011 VMware, 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
#
#... | apache-2.0 |
pychess/pychess | lib/pychess/Variants/asymmetricrandom.py | 2 | 4139 | # AsymmetricRandom Chess
import random
from pychess.Utils.const import VARIANTS_SHUFFLE, ASYMMETRICRANDOMCHESS
from pychess.Utils.Board import Board
class AsymmetricRandomBoard(Board):
variant = ASYMMETRICRANDOMCHESS
__desc__ = \
_("FICS wild/4: http://www.freechess.org/Help/HelpFiles/wild.html\n" +... | gpl-3.0 |
atareao/nautilus-printit | src/printit/printdialog.py | 1 | 22530 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of nautilus-pdf-tools
#
# Copyright (C) 2012-2015 Lorenzo Carbonell
# lorenzo.carbonell.cerezo@gmail.com
#
# 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 F... | gpl-3.0 |
flingone/frameworks_base_cmds_remoted | libs/boost/tools/build/test/core_multifile_actions.py | 6 | 4172 | #!/usr/bin/python
# Copyright 2013 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Tests that actions that produce multiple targets are handled
# correctly. The rules are as follows:
#
# - If a... | apache-2.0 |
valtech-mooc/edx-platform | cms/djangoapps/contentstore/views/course.py | 7 | 75285 | """
Views related to operations on course objects
"""
from django.shortcuts import redirect
import json
import random
import string # pylint: disable=deprecated-module
import logging
from django.utils.translation import ugettext as _
import django.utils
from django.contrib.auth.decorators import login_required
from dj... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.