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 |
|---|---|---|---|---|---|
kikokubo/Sick-Beard-TPB | lib/subliminal/services/subswiki.py | 19 | 5234 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | gpl-3.0 |
minimalparts/Tutorials | RLcafe/caffe.py | 1 | 3150 | import numpy as np
import random
environment = {
0: [('buongiorno',[[1,0,1]]),('un caffè',[[7,0,1]])],
1: [('un caffè',[[2,0,0.8],[12,-2,0.2]])],
2: [('per favore',[[3,0,1]]),('EOS',[[5,-2,0.9],[6,-1,0.1]])],
3: [('EOS',[[4,-1,1]])],
7: [('per favore',[[8,0,1]]),('EOS',[[9,-3,1]])],
8: [('EOS',[[10,-2,0.9],[11,-... | mit |
deepankverma/badges.mozilla.org | badger/printing.py | 7 | 7357 | #!/usr/bin/env python
"""Quick and dirty render-to-PDF for badge award claim codes"""
import logging
import math
import urllib
import urllib2
try:
from cStringIO import cStringIO as StringIO
except ImportError:
from StringIO import StringIO
from reportlab.pdfgen import canvas
from reportlab.lib import pagesiz... | bsd-3-clause |
leighpauls/k2cro4 | chrome/test/functional/media/media_jerky.py | 78 | 8162 | #!/usr/bin/env python
# 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.
"""Jerkiness performance test for video playback.
Uses jerky tool, (http://go/jerky), to record a jerkiness metric for videos
sens... | bsd-3-clause |
IGITUGraz/spore-nest-module | examples/lever_press_showcase/python/snn_utils/comm/serializer.py | 3 | 1288 | import ast
import logging
logger = logging.getLogger(__name__)
SERIALIZERS = {}
class Serializer(object):
def _serialize(self, obj):
raise NotImplementedError()
def serialize(self, obj):
try:
return self._serialize(obj)
except Exception as e:
logging.exceptio... | gpl-2.0 |
zahari/samba | python/samba/netcmd/dsacl.py | 51 | 7548 | # Manipulate ACLs on directory objects
#
# Copyright (C) Nadezhda Ivanova <nivanova@samba.org> 2010
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at yo... | gpl-3.0 |
andresriancho/kombu | docs/_ext/applyxrefs.py | 31 | 2136 | """Adds xref targets to the top of files."""
import sys
import os
testing = False
DONT_TOUCH = ('./index.txt', )
def target_name(fn):
if fn.endswith('.txt'):
fn = fn[:-4]
return '_' + fn.lstrip('./').replace('/', '-')
def process_file(fn, lines):
lines.insert(0, '\n')
lines.insert(0, '.. ... | bsd-3-clause |
bhilburn/gnuradio | gr-fft/python/fft/qa_fft.py | 24 | 10709 | #!/usr/bin/env python
#
# Copyright 2008,2010,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... | gpl-3.0 |
8u1a/plaso | tests/hashers/manager.py | 3 | 2808 | # -*- coding: utf-8 -*-
"""Tests for the hasher manager."""
import unittest
from plaso.hashers import interface
from plaso.hashers import manager
class TestHasher(interface.BaseHasher):
"""A dummy test hasher."""
NAME = u'testhash'
def Update(self, data):
return
def GetBinaryDigest(self):
# Chose... | apache-2.0 |
ILoveSlam97/SlamBeta | Repository/plugin.video.Metalhead/plugintools.py | 19 | 18074 | # -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Plugin Tools v1.0.8
#---------------------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Based on code from youtube, parsedom and pelisalacarta addon... | unlicense |
sanyaade-mobiledev/mic | mic/imager/fs.py | 2 | 3495 | #!/usr/bin/python -tt
#
# Copyright (c) 2011 Intel, 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; version 2 of the License
#
# This program is distributed in the hope that it will be us... | gpl-2.0 |
ptisserand/ansible | lib/ansible/modules/cloud/vmware/vmware_datastore_maintenancemode.py | 15 | 7694 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ty... | gpl-3.0 |
ctismer/pyfilesystem | fs/tests/test_zipfs.py | 14 | 6104 | """
fs.tests.test_zipfs: testcases for the ZipFS class
"""
import unittest
import os
import random
import zipfile
import tempfile
import shutil
import fs.tests
from fs.path import *
from fs import zipfs
from six import PY3, b
class TestReadZipFS(unittest.TestCase):
def setUp(self):
self.temp_file... | bsd-3-clause |
mortonjt/scipy | scipy/signal/wavelets.py | 23 | 10483 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.dual import eig
from scipy.special import comb
from scipy import linspace, pi, exp
from scipy.signal import convolve
__all__ = ['daub', 'qmf', 'cascade', 'morlet', 'ricker', 'cwt']
def daub(p):
"""
The coefficient... | bsd-3-clause |
mkret2/root | main/python/rootcp.py | 28 | 1890 | #!/usr/bin/env @python@
# ROOT command line tools: rootcp
# Author: Julien Ripoche
# Mail: julien.ripoche@u-psud.fr
# Date: 20/08/15
"""Command line to copy objects from ROOT files into an other"""
import cmdLineUtils
import sys
# Help strings
COMMAND_HELP = "Copy objects from ROOT files into an other"
EPILOG = ""... | lgpl-2.1 |
intervigilium/android_kernel_samsung_klte | 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 |
davidhdz/crits | crits/samples/views.py | 2 | 29710 | import json
from django import forms
from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from crits.core import for... | mit |
b0ttl3z/SickRage | lib/oauthlib/oauth1/rfc5849/__init__.py | 9 | 15234 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth1.rfc5849
~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for signing and checking OAuth 1.0 RFC 5849 requests.
"""
from __future__ import absolute_import, unicode_literals
import base64
import hashlib
import logging
log = logging.getLogger(__name__)
i... | gpl-3.0 |
Proggie02/TestRepo | django/contrib/admin/templatetags/admin_list.py | 103 | 15888 | from __future__ import unicode_literals
import datetime
from django.contrib.admin.util import (lookup_field, display_for_field,
display_for_value, label_for_field)
from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_VALUE,
ORDER_VAR, PAGE_VAR, SEARCH_VAR)
from django.contrib.admin.templatet... | bsd-3-clause |
2prime/DeepLab | NMResNet/init.py | 1 | 2336 | '''
MSRA INIT
net parameter initialization.
He K, Zhang X, Ren S, et al.
Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification,
arxiv:1502.01852
Reference:http://damon.studio/2017/06/11/WeightsInitialization/
'''
import torch.nn as nn
import torch.nn.init as init
'''
usage:
class... | mit |
natefoo/ansible-modules-extras | monitoring/datadog_monitor.py | 11 | 10737 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Sebastian Kornehl <sebastian.kornehl@asideas.de>
#
# 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 versi... | gpl-3.0 |
broadinstitute/cms | cms/power/power_func.py | 1 | 8625 | ## functions for analyzing empirical/simulated CMS output
## last updated 09.14.2017 vitti@broadinstitute.org
import matplotlib as mp
mp.use('agg')
import matplotlib.pyplot as plt
import numpy as np
import math
from scipy.stats import percentileofscore
###################
## DEFINE SCORES ##
###################
def... | bsd-2-clause |
vmg/hg-stable | hgext/patchbomb.py | 1 | 21405 | # 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 ... | gpl-2.0 |
pyKun/rally | rally/plugins/openstack/scenarios/mistral/workbooks.py | 3 | 2321 | # Copyright 2015: Mirantis 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 b... | apache-2.0 |
richardbeare/ITK | Examples/RegistrationITKv4/ImageRegistration4.py | 2 | 4883 | #==========================================================================
#
# Copyright NumFOCUS
#
# 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/l... | apache-2.0 |
yugang/crosswalk-test-suite | webapi/tct-2dtransforms-css3-tests/inst.wgt.py | 136 | 6856 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | bsd-3-clause |
gengue/django | tests/shortcuts/tests.py | 199 | 5776 | from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.test.utils import require_jinja2
from django.utils.deprecation import RemovedInDjango110Warning
@override_settings(
ROOT_URLCONF='shortcuts.urls',
)
class ShortcutTests(SimpleTestCase):
def test_render_to_response(self):
... | bsd-3-clause |
matthiasdiener/spack | var/spack/repos/builtin/packages/fontsproto/package.py | 5 | 1619 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
turbokongen/home-assistant | tests/auth/mfa_modules/test_notify.py | 7 | 15343 | """Test the HMAC-based One Time Password (MFA) auth module."""
import asyncio
from unittest.mock import patch
from homeassistant import data_entry_flow
from homeassistant.auth import auth_manager_from_config, models as auth_models
from homeassistant.auth.mfa_modules import auth_mfa_module_from_config
from homeassistan... | apache-2.0 |
gavrieltal/opencog | opencog/python/pln_old/examples/tuffy/smokes/smokes_agent.py | 23 | 5365 | """
PLN representation of the "smokes" sample from Tuffy Markov Logic Networks
More details on this sample are available here:
https://github.com/opencog/opencog/tree/master/opencog/python/pln_old/examples/tuffy/smokes
https://github.com/cosmoharrigan/tuffy/tree/master/samples/smoke
http://hazy.cs.wisc.edu/hazy/tuffy/... | agpl-3.0 |
ibinti/intellij-community | python/testData/MockSdk3.4/python_stubs/sys.py | 24 | 18084 | # encoding: utf-8
# module sys
# from (built-in)
# by generator 1.138
"""
This module provides access to some objects used or maintained by the
interpreter and to functions that interact strongly with the interpreter.
Dynamic objects:
argv -- command line arguments; argv[0] is the script pathname if known
path -- mod... | apache-2.0 |
mstriemer/addons-server | src/olympia/versions/views.py | 3 | 7730 | import os
from django import http
from django.db.transaction import non_atomic_requests
from django.shortcuts import get_object_or_404, redirect
import caching.base as caching
import commonware.log
from mobility.decorators import mobile_template
from olympia import amo
from olympia.amo.urlresolvers import reverse
fr... | bsd-3-clause |
LiZoRN/Charlotte | extra_apps/xadmin/plugins/passwords.py | 17 | 4680 | # coding=utf-8
from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm
from django.contrib.auth.tokens import default_token_generator
from django.contrib.auth.views import password_reset_confirm
from django.template.response import TemplateResponse
from django.utils.translation import ugettext as _
fr... | gpl-3.0 |
geosohh/AnimeTorr | animetorr/manager/log.py | 1 | 7132 | # -*- coding: utf-8 -*-
"""
Log window.
"""
__author__ = 'Sohhla'
import os
from PyQt4 import QtGui, QtCore
from qt.log import Ui_Dialog as Ui_Log
from shared import constant
# TODO: Works, but waaaaaay too slow to load
class LogUpdater(QtCore.QObject):
"""
Updates the [Log window].
"""
finish = Qt... | gpl-2.0 |
metno/gridpp | tests/neighbourhood_quantile_fast_test.py | 1 | 5647 | from __future__ import print_function
import unittest
import gridpp
import numpy as np
lats = [60, 60, 60, 60, 60, 70]
lons = [10,10.1,10.2,10.3,10.4, 10]
"""Simple check
20 21 22 23 24
15 16 17 18 19
10 11 12 13 nan
5 6 7 nan 9
0 1 2 3 4
"""
values = np.reshape(range(25), [5, 5]).astype(float)
values[1, 3] ... | gpl-2.0 |
sajeeshcs/nested_quota_final | nova/tests/unit/api/openstack/compute/contrib/test_extended_server_attributes.py | 4 | 4989 | # Copyright 2011 OpenStack Foundation
# 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 |
vshtanko/scikit-learn | examples/applications/plot_prediction_latency.py | 234 | 11277 | """
==================
Prediction Latency
==================
This is an example showing the prediction latency of various scikit-learn
estimators.
The goal is to measure the latency one can expect when doing predictions
either in bulk or atomic (i.e. one by one) mode.
The plots represent the distribution of the pred... | bsd-3-clause |
Fenixin/yogom | tryengine/fontrenderer.py | 1 | 8186 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of TryEngine.
#
# 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 o... | gpl-3.0 |
dreamsxin/kbengine | kbe/res/scripts/common/Lib/encodings/iso2022_jp_2004.py | 816 | 1073 | #
# iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_2004')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class I... | lgpl-3.0 |
airfrog/okws | test/regtest/cases/52.py | 5 | 1952 |
##-----------------------------------------------------------------------
desc_fmt = "test configuration variables (%s)"
##-----------------------------------------------------------------------
filedata="""
{$
key = 1;
if (key) { hidden = "hidden"; }
foo = [ 1, [ "bar", 4, [ "biz" ] ] ];
baz = [ 10... | gpl-2.0 |
40223101/w16b_test | static/Brython3.1.1-20150328-091302/Lib/subprocess.py | 728 | 67282 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.
r"""subprocess - Subpr... | agpl-3.0 |
atila1974/AK-OnePlusOne-CAF | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
WangKaimin/sublime-evernote | lib/pygments/lexers/_phpbuiltins.py | 10 | 122176 | # -*- coding: utf-8 -*-
"""
pygments.lexers._phpbuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file loads the function names and their modules from the
php webpage and generates itself.
Do not alter the MODULES dict by hand!
WARNING: the generation transfers quite much data over your
... | mit |
kgn/cssutils | src/cssutils/tokenize2.py | 1 | 9735 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""New CSS Tokenizer (a generator)
"""
__all__ = ['Tokenizer', 'CSSProductions']
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from cssproductions import *
from helper import normalize
import itertools
import re
_TOKENIZER_CACHE = {}
class Tokeni... | gpl-3.0 |
tashaxe/Red-DiscordBot | lib/youtube_dl/extractor/wsj.py | 7 | 4311 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
float_or_none,
unified_strdate,
)
class WSJIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
https?://video-api\.wsj\.com/api-vid... | gpl-3.0 |
MrPablozOne/kaira | ptp/ptp.py | 2 | 2770 | #!/usr/bin/env python
import sys
import traceback
import argparse
import ConfigParser
import base.paths
config = ConfigParser.RawConfigParser()
if not config.read(base.paths.KAIRA_CONFIG_INI):
print "File '{0}' was not found.".format(
base.paths.KAIRA_CONFIG_INI)
print "See 'docs/userguide.txt' the fo... | gpl-3.0 |
hongbin/magnum | magnum/tests/unit/api/controllers/v1/test_node.py | 2 | 12856 | # 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
# distr... | apache-2.0 |
googleapis/python-dataproc | google/cloud/dataproc_v1/types/__init__.py | 1 | 5250 | # -*- 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 |
slevenhagen/odoo | addons/l10n_pl/__init__.py | 340 | 1155 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# l10n_pl module improved for Poland
# by Grzegorz Grzelak grzegorz.g... | agpl-3.0 |
poiesisconsulting/openerp-restaurant | survey/__openerp__.py | 64 | 2413 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
eduNEXT/edx-platform | openedx/core/djangoapps/header_control/decorators.py | 9 | 1972 | """
Middleware decorator for removing headers.
"""
from functools import wraps
from openedx.core.djangoapps.header_control import force_header_for_response, remove_headers_from_response
def remove_headers(*headers):
"""
Decorator that removes specific headers from the response.
Usage:
@remove_h... | agpl-3.0 |
startcode/apollo | modules/tools/prediction/mlp_train/merge_h5.py | 1 | 2643 | #!/usr/bin/env python
###############################################################################
# Copyright 2018 The Apollo 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 ... | apache-2.0 |
pomegranited/edx-platform | common/djangoapps/student/tests/test_recent_enrollments.py | 19 | 7863 | """
Tests for the recently enrolled messaging within the Dashboard.
"""
import datetime
from django.conf import settings
from django.core.urlresolvers import reverse
from opaque_keys.edx import locator
from pytz import UTC
import unittest
import ddt
from shoppingcart.models import DonationConfiguration
from student.te... | agpl-3.0 |
memetalk/memetalk | stuff/py/pycore/core_vmem.py | 2 | 1411 | import pyutils
from pycompiler import comp_vmemory
from pyutils import bits
from . import utils
from pdb import set_trace as br
class CoreVirtualMemory(comp_vmemory.CompVirtualMemory):
def index_for(self, name):
return self.base + self.index[name]
def external_names(self):
return sorted(set(se... | bsd-2-clause |
theoryno3/pylearn2 | pylearn2/scripts/datasets/download_mnist.py | 44 | 1282 | from __future__ import print_function
import os
import urllib
import gzip
assert 'PYLEARN2_DATA_PATH' in os.environ, "PYLEARN2_DATA_PATH not defined"
mnist_path = os.path.join(os.environ['PYLEARN2_DATA_PATH'], "mnist")
if not os.path.isdir(mnist_path):
print("creating path: " + mnist_path)
os.makedirs(mnist_p... | bsd-3-clause |
SteveViss/readthedocs.org | readthedocs/rtd_tests/tests/test_post_commit_hooks.py | 26 | 9028 | from django.test import TestCase
import json
import logging
from readthedocs.projects.models import Project
from readthedocs.projects import tasks
log = logging.getLogger(__name__)
class GitLabWebHookTest(TestCase):
fixtures = ["eric", "test_data"]
def tearDown(self):
tasks.update_docs = self.old_b... | mit |
cargabsj175/android_kernel_alcatel_4012a | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
beni55/viewfinder | marketing/tornado/platform/common.py | 66 | 3342 | """Lowest-common-denominator implementations of platform functionality."""
from __future__ import absolute_import, division, print_function, with_statement
import errno
import socket
from tornado.platform import interface
class Waker(interface.Waker):
"""Create an OS independent asynchronous pipe.
For use ... | apache-2.0 |
mattdr/gsutil | gslib/cloud_api_helper.py | 12 | 2264 | # -*- coding: utf-8 -*-
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
mingderwang/angr | angr/analyses/cfg_base.py | 6 | 7560 | import networkx
import logging
from ..errors import AngrCFGError
l = logging.getLogger(name="angr.cfg_base")
class CFGBase(object):
def __init__(self, project, context_sensitivity_level):
self._project = project
# Initialization
self._graph = None
self._nodes = None
self.... | bsd-2-clause |
Ken69267/config-stuff | .vim/eclim/autoload/eclim/python/rope/refactor/inline.py | 12 | 23048 | import re
import rope.base.exceptions
import rope.refactor.functionutils
from rope.base import (pynames, pyobjects, codeanalyze,
taskhandle, evaluate, worder, utils)
from rope.base.change import ChangeSet, ChangeContents
from rope.refactor import (occurrences, rename, sourceutils,
... | mit |
twitter/heron | integration_test/src/python/integration_test/topology/one_spout_multi_tasks/one_spout_multi_tasks.py | 2 | 1572 | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# 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 Apach... | apache-2.0 |
hrishioa/Aviato | flask/Lib/site-packages/nltk/sem/hole.py | 10 | 13942 | # Natural Language Toolkit: Logic
#
# Author: Peter Wang
# Updated by: Dan Garrette <dhgarrette@gmail.com>
#
# Copyright (C) 2001-2015 NLTK Project
# URL: <http://nltk.org>
# For license information, see LICENSE.TXT
"""
An implementation of the Hole Semantics model, following Blackburn and Bos,
Representation and ... | gpl-2.0 |
webbhorn/Arduino-Switch-Controller | arduino/arduino.py | 1 | 2214 | #!/usr/bin/env python
import serial, time
class Arduino(object):
__OUTPUT_PINS = -1
def __init__(self, port, baudrate=9600):
self.serial = serial.Serial(port, baudrate)
def __str__(self):
return "Arduino is on port %s at %d baudrate" %(self.serial.port, self.serial.baudrate)
def ou... | mit |
dyoung418/tensorflow | tensorflow/contrib/model_pruning/python/layers/rnn_cells.py | 35 | 13971 | # 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 |
dancingdan/tensorflow | tensorflow/python/layers/base_test.py | 11 | 22650 | # 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 |
suiyuan2009/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/models/forest_to_data_then_nn.py | 190 | 1972 | # 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 |
nvie/python-mode | pymode/libs/pylama/lint/pylama_pylint/logilab/common/compat.py | 38 | 7757 | # pylint: disable=E0601,W0622,W0611
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU L... | lgpl-3.0 |
NikolaYolov/invenio_backup | modules/bibformat/lib/elements/bfe_client_info.py | 10 | 1913 | ## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any ... | gpl-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Doc/tools/extensions/c_annotations.py | 20 | 4063 | # -*- coding: utf-8 -*-
"""
c_annotations.py
~~~~~~~~~~~~~~~~
Supports annotations for C API elements:
* reference count annotations for C API functions. Based on
refcount.py and anno-api.py in the old Python documentation tools.
* stable API annotations
Usage: Set the `refcount_file`... | mit |
jkenn99/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/lint_test_expectations_unittest.py | 122 | 6074 | # Copyright (C) 2012 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 |
dhruvagarwal/django | django/core/checks/compatibility/django_1_8_0.py | 286 | 1052 | from __future__ import unicode_literals
from django.conf import global_settings, settings
from .. import Tags, Warning, register
@register(Tags.compatibility)
def check_duplicate_template_settings(app_configs, **kwargs):
if settings.TEMPLATES:
values = [
'TEMPLATE_DIRS',
'ALLOWED... | bsd-3-clause |
catterer/wget | testenv/conf/server_files.py | 21 | 1088 | from conf import hook
""" Pre-Test Hook: ServerFiles
This hook is used to define a set of files on the server's virtual filesystem.
server_files is expected to be dictionary that maps filenames to their
contents. In the future, this can be used to add additional metadata to the
files using the WgetFile class too.
Thi... | gpl-3.0 |
rodrigocaldas/trabalho_programacao_web | modules/requests/packages/chardet/sbcsgroupprober.py | 2936 | 3291 | ######################## 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... | mit |
ZobairAlijan/osf.io | scripts/consistency/find_bad_registrations.py | 64 | 1244 | """
"""
from website.app import init_app
from website import models
from framework import Q
app = init_app()
known_schemas = [
'Open-Ended_Registration',
'OSF-Standard_Pre-Data_Collection_Registration',
'Replication_Recipe_(Brandt_et_al__!dot!__,_2013):_Pre-Registration',
'Replication_Recipe_(Brandt... | apache-2.0 |
lordB8r/polls | ENV/lib/python2.7/site-packages/django/db/backends/mysql/base.py | 78 | 21158 | """
MySQL database backend for Django.
Requires MySQLdb: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Database
except ImportError as e:
from django.core.exceptions import ImproperlyConfigur... | mit |
jimmycallin/master-thesis | architectures/conll16st-v34-focused-rnns/v34/train.py | 1 | 11478 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=C0103,W0621
"""
Train the discourse relation sense classifier (CoNLL16st).
"""
__author__ = "GW [http://gw.tnode.com/] <gw.2016@tnode.com>"
__license__ = "GPLv3+"
import argparse
import codecs
import json
import logging
import os
import sys
from keras.mod... | mit |
daniponi/django | django/contrib/sessions/base_session.py | 348 | 1623 | """
This module allows importing AbstractBaseSession even
when django.contrib.sessions is not in INSTALLED_APPS.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
class BaseSes... | bsd-3-clause |
clouserw/zamboni | mkt/websites/views.py | 1 | 1959 | from django.db.transaction import non_atomic_requests
from rest_framework.generics import ListAPIView
from rest_framework.permissions import AllowAny
from mkt.api.authentication import (RestOAuthAuthentication,
RestSharedSecretAuthentication)
from mkt.api.base import CORSMixin, Mar... | bsd-3-clause |
annarev/tensorflow | tensorflow/python/distribute/step_fn.py | 18 | 4196 | # 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 |
bearicc/004 | venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py | 215 | 10101 | '''SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested wi... | gpl-3.0 |
rizumu/bootmachine | bootmachine/management/__init__.py | 1 | 3322 | # (c) 2008-2011 James Tauber and contributors; written for Pinax (http://pinaxproject.com)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
import os
import sys
import bootmachine
BOOTMACHINE_COMMAND_DIR = os.path.join(
os.path.dirname(bootmachine.__file__), "management", "com... | mit |
huzaifafaruqui/Movies-Website | lmdb/lmdb/urls.py | 2 | 1672 | """lmdb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based ... | mit |
geigerj/api-client-staging | generated/python/gapic-google-cloud-language-v1beta1/setup.py | 3 | 1541 | """A setup module for the GAPIC Language library.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
import sys
install_requires = [
'googleapis-common-protos>=1.3.5, <2.0.0dev',
'google-gax>=0.14.1, <0.15.0dev',... | bsd-3-clause |
gilneidp/FinalProject | ALL_FILES/pox/lib/packet/packet_utils.py | 45 | 3744 | # Copyright 2011,2012 James McCauley
# Copyright 2008 (C) Nicira, 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 ... | mit |
DiCarloLab-Delft/PycQED_py3 | pycqed/utilities/pulse_scheme.py | 1 | 5469 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches
def new_pulse_fig(figsize):
'''
Open a new figure and configure it to plot pulse schemes.
'''
fig, ax = plt.subplots(1, 1, figsize=figsize, frameon=False)
ax.axis('off')
fig.subplots_adjust(bottom=0, top=1, left=0, ri... | mit |
matmutant/sl4a | python-build/python-libs/gdata/tests/gdata_tests/spreadsheet_test.py | 92 | 17488 | #!/usr/bin/python
#
# Copyright (C) 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
#
# Unless required by applicable law ... | apache-2.0 |
madsmtm/fbchat | docs/conf.py | 2 | 5415 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# fbchat documentation build configuration file, created by
# sphinx-quickstart on Thu May 25 15:43:01 2017.
#
# 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
# aut... | bsd-3-clause |
oxtopus/nupic | tests/unit/nupic/algorithms/anomaly_likelihood_jeff_test.py | 15 | 9030 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and condi... | gpl-3.0 |
farodin91/servo | tests/wpt/harness/wptrunner/tests/test_hosts.py | 137 | 1658 | # 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 unittest
import sys
from cStringIO import StringIO
sys.path.insert(0, "..")
import hosts
class HostsTest(unit... | mpl-2.0 |
TheWiseLion/pykhet | tests/game_tests.py | 1 | 5304 | import unittest
from pykhet.components.types import MoveType, Move, TeamColor, Orientation
from pykhet.components.types import Position
from pykhet.games.game_types import ClassicGame
class TestClassicGames(unittest.TestCase):
def setUp(self):
self.game = ClassicGame()
def tearDown(self):
s... | mit |
jtyuan/racetrack | src/cpu/o3/O3Checker.py | 69 | 1724 | # Copyright (c) 2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
takeshineshiro/heat | heat/common/timeutils.py | 1 | 2831 | #
# 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 |
Off-By-1/Py3D | Renderer.py | 2 | 9789 | __author__ = 'Zander'
from pygame import gfxdraw
from Vector2 import Vector2
from Vector4 import Vector4
from Vector3 import Vector3
from Matrix4 import Matrix4
import math, pygame
import numpy as np
class Renderer:
def __init__(self, screen, width, height, scale=1):
self.width = width
self.heig... | mit |
DogDogGoose/ptab | ptab/core.py | 1 | 15266 | import sys
import requests
import requests_cache
import string
import unicodedata
import json
import shutil
import os
import re
import pprint
import pathvalidate
import ptab.cgi
#
# PTAB API
#
baseURL = 'https://developer.uspto.gov/ptab-api'
docsURL = 'https://developer.uspto.gov/ptab-api/documents'
trialsURL = 'htt... | lgpl-3.0 |
umich-brcf-bioinf/Connor | test/command_validator_test.py | 1 | 38546 | #pylint: disable=invalid-name, too-few-public-methods, too-many-public-methods
#pylint: disable=protected-access, missing-docstring, too-many-locals
#pylint: disable=too-many-arguments
#pylint: disable=deprecated-method
from __future__ import print_function, absolute_import, division
from argparse import Namespace
imp... | apache-2.0 |
laumann/servo | tests/wpt/web-platform-tests/tools/webdriver/webdriver/searchcontext.py | 251 | 2153 | """WebDriver element location functionality."""
class SearchContext(object):
"""Abstract class that provides the core element location functionality."""
def find_element_by_css(self, selector):
"""Find the first element matching a css selector."""
return self._find_element('css selector', sele... | mpl-2.0 |
google/makerspace-auth | software/authbox/tests/test_api.py | 2 | 3914 | # Copyright 2018 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 |
gwtaylor/pyautodiff | autodiff/optimize.py | 2 | 3699 | """
SciPy-based function optimization
"""
import numpy as np
import scipy
from autodiff.symbolic import VectorArg
import autodiff.utils as utils
__all__ = ['fmin_cg', 'fmin_ncg', 'fmin_l_bfgs_b']
def fmin_cg(fn, init_args=None, init_kwargs=None, **scipy_kwargs):
"""
Minimize a scalar valued function using ... | bsd-3-clause |
jwlawson/tensorflow | tensorflow/contrib/lite/testing/generate_examples.py | 3 | 50876 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.