repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
sunils34/buffer-django-nonrel | django/utils/crypto.py | 245 | 1443 | """
Django's standard crypto functions and utilities.
"""
import hmac
from django.conf import settings
from django.utils.hashcompat import sha_constructor, sha_hmac
def salted_hmac(key_salt, value, secret=None):
"""
Returns the HMAC-SHA1 of 'value', using a key generated from key_salt and a
secret (which... | bsd-3-clause |
shwinpiocess/mongo | requests/packages/__init__.py | 838 | 1384 | '''
Debian and other distributions "unbundle" requests' vendored dependencies, and
rewrite all imports to use the global versions of ``urllib3`` and ``chardet``.
The problem with this is that not only requests itself imports those
dependencies, but third-party code outside of the distros' control too.
In reaction to t... | apache-2.0 |
dgoedkoop/QGIS | tests/src/python/test_db_manager_gpkg.py | 17 | 24869 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for the DBManager GPKG plugin
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later versi... | gpl-2.0 |
Spinkelben/remote-radio | radio_api/main.py | 1 | 3419 | from flask import Flask, abort, request, jsonify
from redis import Redis, RedisError
from message_pb2 import Request, Response
import os
import socket
import logging
import json
redis = Redis(host="redis", port=6379, db=0, socket_connect_timeout=2, socket_timeout=2)
app = Flask(__name__)
def play_station(station):
... | mit |
UrusTeam/android_ndk_toolchain_cross | lib/python2.7/ctypes/macholib/dylib.py | 268 | 2041 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
Generic dylib path manipulation
"""
import re
__all__ = ['dylib_info']
DYLIB_RE = re.compile(r"""(?x... | gpl-2.0 |
rezoo/chainer | chainer/functions/pooling/average_pooling_nd_kernel.py | 13 | 1310 | from chainer.functions.pooling import pooling_nd_kernel
class AveragePoolingNDKernelForward(pooling_nd_kernel.PoolingNDKernelForward):
def name(self):
# avg_pool_{N}d_fwd
return 'avg'
def in_params(self):
# 2D: raw T in, int32 d_0, int32 d_1, int32 out_0, int32 out_1,
# i... | mit |
sergey-shandar/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/StorageManagementClient/fixtures/acceptancetestsstoragemanagementclient/storage_management_client.py | 6 | 3926 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
smnitro555/ESWegarden | raspibot/lib/python2.7/site-packages/pip/commands/uninstall.py | 798 | 2884 | from __future__ import absolute_import
import pip
from pip.wheel import WheelCache
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
"""
Uninstall packages.
pip is a... | gpl-3.0 |
nott/next.filmfest.by | cpm_data/migrations/0009_film.py | 2 | 9214 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-12-10 22:48
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('submissions', '0001_initia... | unlicense |
satishgoda/pipe2py | tests/pypipelines/pipe_125e9fe8bb5f84526d21bebfec3ad116.py | 6 | 3594 | # Pipe pipe_125e9fe8bb5f84526d21bebfec3ad116 generated by pipe2py
from pipe2py import Context
from pipe2py.modules.pipeforever import pipe_forever
from pipe2py.modules.pipetextinput import pipe_textinput
from pipe2py.modules.pipeitembuilder import pipe_itembuilder
from pipe2py.modules.pipeurlbuilder import pipe_urlbui... | gpl-2.0 |
bioinformatics-ua/catalogue | emif/questionnaire/imports.py | 2 | 26425 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/
#
# 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 vers... | gpl-3.0 |
indigo-dc/im | IM/UnixHTTPAdapter.py | 2 | 2982 | # IM - Infrastructure Manager
# Copyright (C) 2011 - GRyCAP - Universitat Politecnica de Valencia
#
# 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... | gpl-3.0 |
pritamsamadder048/libforensics | unittests/tests/dec/splitraw.py | 13 | 4378 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics 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 the License, or
# (at your option) any later ver... | lgpl-3.0 |
awangga/csvfromdbf | dbfread/codepages.py | 8 | 3069 | # Table from dbf.py by Ethan Furman
codepages = {
0x00: ('ascii', "plain ol' ascii"),
0x01: ('cp437', 'U.S. MS-DOS'),
0x02: ('cp850', 'International MS-DOS'),
0x03: ('cp1252', 'Windows ANSI'),
0x04: ('mac_roman', 'Standard Macintosh'),
0x08: ('cp865', 'Danish OEM'),
0x09: ('cp437', 'Dutch OE... | agpl-3.0 |
songfj/calibre | src/cherrypy/process/plugins.py | 81 | 25628 | """Site services for use with a Web Site Process Bus."""
import os
import re
import signal as _signal
import sys
import time
import threading
from cherrypy._cpcompat import basestring, get_daemon, get_thread_ident, ntob, set
# _module__file__base is used by Autoreload to make
# absolute any filenames retrieved from ... | gpl-3.0 |
BigBrother1984/android_external_chromium_org | tools/find_runtime_symbols/proc_maps.py | 32 | 3642 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
_MAPS_PATTERN = re.compile(
r'^([a-f0-9]+)-([a-f0-9]+)\s+(.)(.)(.)(.)\s+([a-f0-9]+)\s+(\S+):(\S+)\s+'
r'(\d+)\s*(.*)$', re.IGNORECASE... | bsd-3-clause |
yigitguler/django | django/core/management/commands/runfcgi.py | 120 | 1073 | import argparse
import warnings
from django.core.management.base import BaseCommand
from django.utils.deprecation import RemovedInDjango19Warning
class Command(BaseCommand):
help = "Runs this project as a FastCGI application. Requires flup."
def add_arguments(self, parser):
parser.add_argument('args... | bsd-3-clause |
eugeneai/icc.studprogs | src/icc/studprogs/uctotokenizer.py | 1 | 6739 | #!/usr/bin/env python3
import ucto
from pkg_resources import resource_filename
settingsfile = resource_filename("icc.studprogs", "etc/tokconfig-generic")
def join(lexems,
only=[],
filter=[],
decor=("", ""),
with_type=False,
no_symbols=False,
subst={}):
"""Joi... | gpl-3.0 |
glogiotatidis/snippets-service | snippets/base/admin/fields.py | 2 | 9200 | from django.core.exceptions import ValidationError
from django.forms import (ChoiceField, ModelChoiceField,
ModelMultipleChoiceField, MultipleChoiceField,
MultiValueField)
from snippets.base.models import Addon, TargetedCountry
from .widgets import JEXLMultiWidget
... | mpl-2.0 |
domesticduck/MenuConciergeServer | vendor/bundle/ruby/2.0.0/gems/libv8-3.16.14.3/vendor/gyp/test/win/gyptest-cl-function-level-linking.py | 332 | 1595 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure function-level linking setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = Te... | apache-2.0 |
rynomster/django | tests/null_fk/tests.py | 352 | 2982 | from __future__ import unicode_literals
from django.db.models import Q
from django.test import TestCase
from .models import (
Comment, Forum, Item, Post, PropertyValue, SystemDetails, SystemInfo,
)
class NullFkTests(TestCase):
def test_null_fk(self):
d = SystemDetails.objects.create(details='First ... | bsd-3-clause |
anaderi/lhcb_trigger_ml | hep_ml/experiments/gradient_boosting.py | 1 | 20009 | from __future__ import division, print_function
import copy
import numbers
import numpy
import pandas
from scipy.special import expit, logit
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.ensemble._gradient_boosting import _random_sample_mask
from sklearn.ensemble.gradient_boosting import LossFu... | mit |
cloudera/Impala | tests/query_test/test_spilling.py | 1 | 5425 | # 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 |
PeterPetrik/QGIS | tests/src/python/test_qgsprojectrelationmanager.py | 30 | 2685 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsRelationManager
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""... | gpl-2.0 |
juniwang/open-hackathon | open-hackathon-server/src/hackathon/__init__.py | 2 | 9919 | # -*- coding: utf-8 -*-
"""
This file is covered by the LICENSING file in the root of this project.
"""
from werkzeug.exceptions import HTTPException
__author__ = 'Junbo Wang'
__version__ = '2.0'
from flask import Flask
from flask_restful import Api
from flask_cors import CORS
from datetime import timedelta
from ha... | mit |
nickvandewiele/RMG-Py | rmgpy/qm/main.py | 4 | 11154 | #!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2012 Prof. Richard H. West (r.west@neu.edu),
# Prof. William H. Green (whgreen@mit.edu)
# ... | mit |
tsdmgz/ansible | contrib/inventory/collins.py | 46 | 18031 | #!/usr/bin/env python
"""
Collins external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
Collins ... | gpl-3.0 |
sonofatailor/django-oscar | tests/_site/myauth/models.py | 5 | 1632 | # -*- coding: utf-8 -*-
import re
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.core import validators
from django.contrib.auth.models import BaseUserManager
from oscar.apps.customer.abstract_models import AbstractUser
class CustomUserManager(BaseUserManager):
... | bsd-3-clause |
nebril/fuel-web | fuel_upgrade_system/fuel_package_updates/fuel_package_updates/fuel_package_updates.py | 2 | 26310 | #!/usr/bin/env python
# Copyright 2015 Mirantis, 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... | apache-2.0 |
sgerhart/ansible | test/units/modules/network/f5/test_bigip_service_policy.py | 4 | 4329 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest... | mit |
KontorConsulting/odoo | openerp/addons/test_inherits/tests/test_inherits.py | 266 | 1066 | # -*- coding: utf-8 -*-
from openerp.tests import common
class test_inherits(common.TransactionCase):
def test_create_3_levels_inherits(self):
""" Check that we can create an inherits on 3 levels """
pallet = self.env['test.pallet'].create({
'name': 'B',
'field_in_box': 'b... | agpl-3.0 |
mahak/ansible | lib/ansible/modules/template.py | 24 | 2515 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This is a virtual module that is entirely implemented as an action plugin and runs on the controller
from __future__ import absolute_import, ... | gpl-3.0 |
lokirius/python-for-android | python3-alpha/python3-src/Lib/lib2to3/pgen2/grammar.py | 54 | 5379 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... | apache-2.0 |
alikins/ansible | lib/ansible/modules/windows/win_mapped_drive.py | 15 | 2819 | #!/usr/bin/python
# This file is part of Ansible
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub, actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1... | gpl-3.0 |
sjev/ibpy | ib/ext/EWrapper.py | 8 | 6194 | #!/usr/bin/env python
""" generated source for module EWrapper """
#
# Original file copyright original author(s).
# This file copyright Troy Melhase, troy@gci.net.
#
# WARNING: all changes to this file will be lost.
from abc import ABCMeta, abstractmethod
from ib.ext.AnyWrapper import AnyWrapper
#
# * EWrapper.java... | bsd-3-clause |
gaddman/ansible | lib/ansible/modules/network/aci/aci_config_snapshot.py | 2 | 9775 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
mazaclub/mazabot-core | plugins/Nickometer/test.py | 19 | 1870 | ###
# Copyright (c) 2005, aafshar@gmail.com
# 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 condit... | bsd-3-clause |
caronc/nzb-subliminal | Subliminal/guessit/transfo/guess_filetype.py | 6 | 11007 | #!/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 |
TheMOOCAgency/edx-platform | lms/djangoapps/course_blocks/management/commands/tests/test_generate_course_blocks.py | 22 | 4170 | """
Tests for generate_course_blocks management command.
"""
from django.core.management.base import CommandError
from mock import patch
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ... | agpl-3.0 |
smikes/node-gyp | gyp/pylib/gyp/generator/android.py | 106 | 44050 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | mit |
plotly/plotly.py | packages/python/plotly/plotly/graph_objs/ohlc/decreasing/_line.py | 2 | 7009 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "ohlc.decreasing"
_path_str = "ohlc.decreasing.line"
_valid_props = {"color", "dash", "width"}
... | mit |
andela-osule/django-bucketlist-application | functional_tests/test_signed_in_users.py | 1 | 2126 | # -*- coding: utf-8 -*-
from selenium import webdriver
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
from django.utils.decorators import classonlymethod
from django.contrib.auth.models import User
class HomeSigninUserTest(LiveServerTestCase):
"""This TestSuite tests funct... | gpl-2.0 |
wf4ever/ro-manager | src/rocommand/test/TestAnnotationUtils.py | 1 | 35802 | #!/usr/bin/python
"""
Module to test RO manager annotation support utilities
See: http://www.wf4ever-project.org/wiki/display/docs/RO+management+tool
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2011-2013, University of Oxford"
__license__ = "MIT (http://opensource.org/licenses/... | mit |
Inboxen/Inboxen | inboxen/async_messages/messages.py | 1 | 1160 | from django.contrib.messages import constants
from . import message_user
"""
Mimic the django.contrib.messages API
"""
def debug(user, message):
"""
Adds a message with the ``DEBUG`` level.
:param user: User instance
:param message: Message to show
"""
message_user(user, message, constants.... | agpl-3.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/setuptools/sandbox.py | 259 | 13925 | import os
import sys
import tempfile
import operator
import functools
import itertools
import re
import contextlib
import pickle
import pkg_resources
if sys.platform.startswith('java'):
import org.python.modules.posix.PosixModule as _os
else:
_os = sys.modules[os.name]
try:
_file = file
except NameError:
... | bsd-3-clause |
sadleader/odoo | addons/mass_mailing/wizard/test_mailing.py | 148 | 1994 | # -*- coding: utf-8 -*-
from openerp import tools
from openerp.osv import osv, fields
class TestMassMailing(osv.TransientModel):
_name = 'mail.mass_mailing.test'
_description = 'Sample Mail Wizard'
_columns = {
'email_to': fields.char('Recipients', required=True,
help='Comma-separate... | agpl-3.0 |
OpenEdgeComputing/elijah-provisioning | elijah/provisioning/progressbar.py | 2 | 2057 | import sys
class ProgressBar(object):
def __init__(self, start=0, end=10, width=12, fill='=', blank='.',
format='[%(fill)s>%(blank)s] %(progress)s%%',
incremental=True, **kwargs):
super(ProgressBar, self).__init__()
self.start = start
self.end = end
self.w... | apache-2.0 |
837468220/python-for-android | python3-alpha/python3-src/Lib/ctypes/test/test_cast.py | 53 | 3222 | from ctypes import *
import unittest
import sys
class Test(unittest.TestCase):
def test_array2pointer(self):
array = (c_int * 3)(42, 17, 2)
# casting an array to a pointer works.
ptr = cast(array, POINTER(c_int))
self.assertEqual([ptr[i] for i in range(3)], [42, 17, 2])
i... | apache-2.0 |
kalliope-project/kalliope | kalliope/core/RestAPI/views/synapses_views.py | 1 | 16365 | import logging
import os
import time
from flask import jsonify, Blueprint
from flask import request
from werkzeug.utils import secure_filename
from kalliope import Utils
from kalliope.core.ConfigurationManager import BrainLoader, SettingEditor
from kalliope.core.ConfigurationManager.ConfigurationChecker import Kallio... | gpl-3.0 |
TrossSoftwareAndTech/webvt | lib/node-v7.2.0/deps/v8/tools/ignition/linux_perf_bytecode_annotate_test.py | 28 | 2253 | # Copyright 2016 the V8 project 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 StringIO
import unittest
import linux_perf_bytecode_annotate as bytecode_annotate
PERF_SCRIPT_OUTPUT = """
# This line is a comment
# This should ... | gpl-3.0 |
kwailamchan/programming-languages | cpp/deeplearning/caffe/examples/pycaffe/caffenet.py | 37 | 2112 | from __future__ import print_function
from caffe import layers as L, params as P, to_proto
from caffe.proto import caffe_pb2
# helper function for common structures
def conv_relu(bottom, ks, nout, stride=1, pad=0, group=1):
conv = L.Convolution(bottom, kernel_size=ks, stride=stride,
... | mit |
kalahbrown/HueBigSQL | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Hash/MD5.py | 123 | 2863 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | apache-2.0 |
moijes12/oh-mainline | vendor/packages/scrapy/scrapy/contrib/memdebug.py | 19 | 1354 | """
MemoryDebugger extension
See documentation in docs/topics/extensions.rst
"""
import gc
from scrapy.xlib.pydispatch import dispatcher
from scrapy import signals
from scrapy.exceptions import NotConfigured
from scrapy.conf import settings
from scrapy.stats import stats
from scrapy.utils.trackref import live_refs
... | agpl-3.0 |
Kamik423/uni_plan | plan/plan/lib64/python3.4/site-packages/wheel/test/test_wheelfile.py | 327 | 4585 | import os
import wheel.install
import wheel.archive
import hashlib
try:
from StringIO import StringIO
except ImportError:
from io import BytesIO as StringIO
import codecs
import zipfile
import pytest
import shutil
import tempfile
from contextlib import contextmanager
@contextmanager
def environ(key, value):
... | apache-2.0 |
jag1g13/lammps | tools/eff/lmp2radii.py | 54 | 3001 | #!/usr/local/bin/python-2.5/bin/python
Info="""
Module name: lmp2radii.py
Author: (c) Andres Jaramillo-Botero
California Institute of Technology
ajaramil@wag.caltech.edu
Project: pEFF
Version: August 2009
Extracts the electron radii from a lammps trajectory dump of style custom:
dump 1 all custom period dump_fi... | gpl-2.0 |
cloudbau/nova | nova/scheduler/filters/json_filter.py | 24 | 4784 | # Copyright (c) 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 ... | apache-2.0 |
nicolargo/intellij-community | python/lib/Lib/distutils/tests/support.py | 147 | 1277 | """Support code for distutils test cases."""
import shutil
import tempfile
from distutils import log
class LoggingSilencer(object):
def setUp(self):
super(LoggingSilencer, self).setUp()
self.threshold = log.set_threshold(log.FATAL)
def tearDown(self):
log.set_threshold(self.thresho... | apache-2.0 |
codename13/kylessopen-3.4-port | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
mbauskar/helpdesk-erpnext | erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py | 96 | 2099 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import getdate, cint
import calendar
def execute(filters=None):
# key yyyy-mm
new_customers_in =... | agpl-3.0 |
JackKelly/neuralnilm_prototype | scripts/e385.py | 4 | 6024 | from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | mit |
kaixinjxq/crosswalk-test-suite | tools/allpairs-plus/metacomm/combinatorics/pairs_storage.py | 31 | 1569 | from combinatorics import xuniqueCombinations
class node:
def __init__(self, id):
self.id = id
self.counter = 0
self.in_ = set()
self.out = set()
def __str__(self):
return str(self.__dict__)
def key(items):
return "->".join([x.id for x in items])... | bsd-3-clause |
mementum/metaframe | docs/conf.py | 1 | 8339 | # -*- coding: utf-8 -*-
#
# metaframe documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 23 13:28:32 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | gpl-3.0 |
ChanChiChoi/scikit-learn | examples/neighbors/plot_classification.py | 287 | 1790 | """
================================
Nearest Neighbors Classification
================================
Sample usage of Nearest Neighbors classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColorm... | bsd-3-clause |
vainotuisk/icecreamratings | ENV/lib/python2.7/site-packages/setuptools/package_index.py | 301 | 38760 | """PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
from functools import wraps
from pkg_resources import (
CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST,
require, Environment, find_distributions, safe_name, s... | bsd-3-clause |
Depado/starmato-admin | setup.py | 1 | 1305 | import os
from setuptools import setup, find_packages
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='starmato-admin',
version='0.2.1',
packages=find_packages(),
package_data={
'starmato.admin': [
... | mit |
pmarques/ansible | test/lib/ansible_test/_internal/commands/integration/cloud/acme.py | 13 | 2405 | """ACME plugin for integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ....config import (
IntegrationConfig,
)
from ....containers import (
run_support_container,
)
from . import (
CloudEnvironment,
CloudEnvironmentConfig,
... | gpl-3.0 |
Nirvedh/CoarseCoherence | src/arch/x86/isa/insts/x87/arithmetic/__init__.py | 91 | 2486 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
adsabs/ADSDeploy | ADSDeploy/tests/test_unit/test_webapp.py | 1 | 6070 | """
Test utilities
"""
import hmac
import json
import mock
import hashlib
import unittest
from flask.ext.testing import TestCase
from ADSDeploy.webapp import app
from ADSDeploy.webapp.models import db, Deployment
from ADSDeploy.webapp.views import GithubListener
from stub_data.stub_webapp import github_payload, paylo... | gpl-3.0 |
naousse/odoo | addons/account/account_analytic_line.py | 304 | 7914 | # -*- 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 |
TheMocheeze/HS13-Arctic-Station | bot/D_help.py | 67 | 5811 | #As new commands are added, update this.
# Last updated: 8.3.2011
# Updated 12.3.2011:
# - Added the missing help data for Version
# - Imported CORE_DATA to get the name.
# - Tidied some commands up a bit.
# - Replaced all "Bot"s with the Skibot's current name.
from CORE_DATA import Name
everything = {"8ball":"[8ball... | agpl-3.0 |
phoebusliang/parallel-lettuce | tests/integration/lib/Django-1.3/django/contrib/auth/tests/basic.py | 154 | 3632 | from django.test import TestCase
from django.contrib.auth.models import User, AnonymousUser
from django.core.management import call_command
from StringIO import StringIO
class BasicTestCase(TestCase):
def test_user(self):
"Check that users can be created and can set their password"
u = User.objects... | gpl-3.0 |
suneeshtr/persona | node_modules/l/node_modules/hook.io/node_modules/npm/node_modules/node-gyp/gyp/test/variables/filelist/gyptest-filelist.py | 102 | 1583 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Test variable expansion of '<|(list.txt ...)' syntax commands.
"""
import os
import sys
import TestGyp
test = TestGyp.TestGyp(format=... | gpl-2.0 |
guyskk/flask-restaction | tests/test_cli.py | 1 | 1613 | import requests
from unittest import mock
from flask_restaction.cli import parse_meta, resjs, main
def test_url_prefix():
url = "http://127.0.0.1:5000"
meta = requests.get(url, headers={'Accept': 'application/json'}).json()
url_prefix, __, __ = parse_meta(meta)
assert url_prefix == ""
def test_resjs... | mit |
icomms/wqmanager | reportlab/graphics/barcode/widgets.py | 6 | 14421 | #copyright ReportLab Europe Limited. 2000-2006
#see license.txt for license details
__version__=''' $Id: widgets.py 3086 2007-05-22 13:10:34Z rgbecker $ '''
__all__= (
'BarcodeI2of5',
'BarcodeCode128',
'BarcodeStandard93',
'BarcodeExtended93',
'BarcodeStandard39',
'Barcod... | bsd-3-clause |
vipul-sharma20/oh-mainline | vendor/packages/Django/django/contrib/localflavor/in_/forms.py | 101 | 3911 | """
India-specific Form helpers.
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.in_.in_states import STATES_NORMALIZED, STATE_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field,... | agpl-3.0 |
a-tal/EsiPy | test/mock.py | 1 | 6095 | # -*- encoding: utf-8 -*-
from __future__ import absolute_import
import datetime
import httmock
def make_expire_time_str():
""" Generate a date string for the Expires header
RFC 7231 format (always GMT datetime)
"""
date = datetime.datetime.utcnow()
date += datetime.timedelta(days=1)
... | bsd-3-clause |
pwmarcz/django | django/core/management/commands/compilemessages.py | 26 | 4687 | from __future__ import unicode_literals
import codecs
import glob
import os
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import find_command, popen_wrapper
from django.utils._os import npath, upath
def has_bom(fn):
with open(fn, 'rb') as f:
sample =... | bsd-3-clause |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/scipy/weave/examples/swig2_example.py | 100 | 1596 | """Simple example to show how to use weave.inline on SWIG2 wrapped
objects. SWIG2 refers to SWIG versions >= 1.3.
To run this example you must build the trivial SWIG2 extension called
swig2_ext. To do this you need to do something like this::
$ swig -c++ -python -I. -o swig2_ext_wrap.cxx swig2_ext.i
$ g++ -Wall ... | gpl-3.0 |
alanwj/django-crispy-forms | crispy_forms/templatetags/crispy_forms_field.py | 14 | 5493 | try:
from itertools import izip
except ImportError:
izip = zip
from django import forms
from django import template
from django.template import loader, Context
from django.conf import settings
from crispy_forms.utils import TEMPLATE_PACK, get_template_pack
register = template.Library()
@register.filter
def... | mit |
guettli/django | tests/middleware_exceptions/tests.py | 24 | 6903 | from django.conf import settings
from django.core.exceptions import MiddlewareNotUsed
from django.test import RequestFactory, SimpleTestCase, override_settings
from django.test.utils import patch_logger
from . import middleware as mw
@override_settings(ROOT_URLCONF='middleware_exceptions.urls')
class MiddlewareTests... | bsd-3-clause |
Adel-Magebinary/odoo | addons/account_asset/wizard/__init__.py | 445 | 1122 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
alianmohammad/pd-gem5 | util/checkpoint-tester.py | 63 | 5044 | #! /usr/bin/env python
# Copyright (c) 2010 Advanced Micro Devices, 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,... | bsd-3-clause |
AutorestCI/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/deployment_extended.py | 2 | 1325 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
aavidad/grx-asistencia | usuarios_win.py | 1 | 11812 | from __future__ import with_statement
from fabric.api import settings, abort, run, env, sudo, local, get , put, hosts
from fabric.contrib.console import confirm
from gi.repository import Gtk
import os,tablabel,subprocess
import time
class Mensaje(Gtk.MessageDialog):
def __init__(self, texto):
Gtk.MessageDia... | gpl-3.0 |
hoosteeno/kuma | vendor/packages/translate/storage/subtitles.py | 24 | 7442 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2009 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | mpl-2.0 |
bretthandrews/flexCE | flexCE/fileio/pickle_io.py | 1 | 2232 | """Pickle and unpickle simulation output.
Save and reload entire simulation object from pickle files.
"""
from __future__ import print_function, division, absolute_import
import os
import pickle
def pickle_read(filename):
"""Read pickle file.
Args:
filename (str): name of pickle file.
Returns... | mit |
iocoop/beancount | src/python/beancount/query/query_execute_test.py | 1 | 27719 | __author__ = "Martin Blais <blais@furius.ca>"
import datetime
import io
import unittest
import textwrap
from beancount.core.number import D
from beancount.core.number import Decimal
from beancount.core import inventory
from beancount.query import query_parser
from beancount.query import query_compile as qc
from beanc... | gpl-2.0 |
darktears/chromium-crosswalk | tools/telemetry/telemetry/benchmark_unittest.py | 8 | 5320 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import unittest
from telemetry import android
from telemetry import benchmark
from telemetry.testing import options_for_unittests
from telem... | bsd-3-clause |
hdeling/sofa | applications/plugins/Compliant/examples/knee/mapping.py | 11 | 5038 | '''easy python mappings'''
import numpy as np
import script
import path
import tool
class Script(script.Controller):
def __new__(cls, node, instance):
res = script.Controller.__new__(cls, node)
res.instance = instance
# callbacks
res.cb = []
return res
... | lgpl-2.1 |
goddardl/cortex | test/IECore/ops/splineInput/splineInput-1.py | 12 | 2469 | ##########################################################################
#
# Copyright (c) 2009-2010, Image Engine Design 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:
#
# * Redis... | bsd-3-clause |
rolandmansilla/microblog | flask/lib/python2.7/site-packages/pip/_vendor/html5lib/inputstream.py | 435 | 31665 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from pip._vendor.six.moves import http_client
import codecs
import re
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .constants import encodings, ReparseException
from . import util... | bsd-3-clause |
joelcan/tools-eth-contract-dev | pyethereum/pyethereum/opcodes.py | 1 | 3118 | # schema: [opcode, ins, outs, memuses, gas]
#
# memuses are written as an array of (start, len) pairs; values less than
# zero are taken as stackarg indices and values zero or greater are taken
# as literals
opcodes = {
0x00: ['STOP', 0, 0, 0],
0x01: ['ADD', 2, 1, 1],
0x02: ['MUL', 2, 1, 1],
0x03: ['SU... | mit |
pytorch/fairseq | fairseq/tasks/legacy_masked_lm.py | 1 | 5010 | # 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.
import itertools
import logging
import os
import numpy as np
from fairseq import tokenizer, utils
from fairseq.data import ConcatDataset, Dic... | mit |
groschovskiy/lerigos_music | Server/API/lib/google/logging/type/log_severity_pb2.py | 2 | 3168 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/logging/type/log_severity.proto
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
... | apache-2.0 |
ivelum/djangoql | test_project/core/views.py | 1 | 1236 | import json
from django.contrib.auth.models import Group, User
from django.shortcuts import render
from django.views.decorators.http import require_GET
from djangoql.exceptions import DjangoQLError
from djangoql.queryset import apply_search
from djangoql.schema import DjangoQLSchema
from djangoql.serializers import D... | mit |
leohmoraes/tablib | tablib/packages/odf/form.py | 100 | 3268 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library 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 2.1 of the License, or (at you... | mit |
csrocha/OpenUpgrade | addons/gamification/tests/test_challenge.py | 386 | 5133 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
dracorpg/python-ivi | ivi/agilent/agilentMSOX3024A.py | 6 | 1695 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the... | mit |
mohamed--abdel-maksoud/chromium.src | third_party/tlslite/tlslite/utils/openssl_aes.py | 202 | 1944 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""OpenSSL/M2Crypto AES implementation."""
from .cryptomath import *
from .aes import *
if m2cryptoLoaded:
def new(key, mode, IV):
return OpenSSL_AES(key, mode, IV)
class OpenSSL_AES(AES):
def ... | bsd-3-clause |
qwefi/nova | plugins/xenserver/networking/etc/xensource/scripts/vif_rules.py | 14 | 4895 | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-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
#... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.