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 |
|---|---|---|---|---|---|
mach6/selenium | py/test/selenium/webdriver/firefox/ff_profile_tests.py | 20 | 6070 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
0jpq0/kbengine | kbe/res/scripts/common/Lib/test/test_webbrowser.py | 118 | 5786 | import webbrowser
import unittest
import subprocess
from unittest import mock
from test import support
URL = 'http://www.example.com'
CMD_NAME = 'test'
class PopenMock(mock.MagicMock):
def poll(self):
return 0
def wait(self, seconds=None):
return 0
class CommandTestMixin:
def _test(... | lgpl-3.0 |
DESHONOR/android_kernel_huawei_g620s_Eloy | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
sgerhart/ansible | lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel_facts.py | 8 | 8095 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | mit |
PeterWangIntel/chromium-crosswalk | build/android/pylib/flag_changer.py | 38 | 5746 | # 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 logging
import pylib.android_commands
import pylib.device.device_utils
from pylib.device import device_errors
class FlagChanger(object):
"""... | bsd-3-clause |
HarryElSuzio/ShaniXBMCWork | plugin.video.dramasonline/default.py | 5 | 26701 | import urllib2,urllib,cgi, re, sys
import HTMLParser
import xbmc, xbmcgui, xbmcplugin, xbmcaddon
import urlresolver
import traceback
__addon__ = xbmcaddon.Addon()
__addonname__ = __addon__.getAddonInfo('name')
__icon__ = __addon__.getAddonInfo('icon')
addon_id = 'plugin.video.dramasonline'
selfAddon = x... | gpl-2.0 |
mavit/ansible | test/units/modules/network/f5/test_bigip_snmp_trap.py | 27 | 6591 | # -*- 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
i... | gpl-3.0 |
SublimeText/VintageEx | vex/parsers/test_cmdline.py | 1 | 25953 | import unittest
from vex.parsers import cmd_line
class ParserBase(unittest.TestCase):
def setUp(self):
self.parser = cmd_line.ParserBase("foo")
def testIsInitCorrect(self):
self.assertEqual(self.parser.source, "foo")
self.assertEqual(self.parser.c, "f")
def testCanCon... | mit |
Zaneh-/bearded-tribble-back | taiga/events/signal_handlers.py | 1 | 2001 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | agpl-3.0 |
A2109devs/lenovo_a2109a_kernel | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
allmightyspiff/softlayer-python | SoftLayer/CLI/vpn/ipsec/update.py | 3 | 3666 | """Updates an IPSEC tunnel context."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI.exceptions import CLIHalt
@click.command()
@click.argument('context_id', type=int)
@click.option('--friendly-name',
default=None,... | mit |
takahirox/three.js | utils/exporters/blender/addons/io_three/exporter/api/object.py | 33 | 19205 | import math
import mathutils
import bpy
from bpy import data, context, types
from bpy_extras.io_utils import axis_conversion
from .. import constants, logger, utilities, exceptions
from .constants import (
MESH,
EMPTY,
ARMATURE,
LAMP,
AREA,
SPOT,
SUN,
POINT,
HEMI,
CAMERA,
PER... | mit |
gamahead/nupic | tests/unit/nupic/math/lgamma_test.py | 17 | 2356 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
amburan/epoxpy | epoxpy/abc_type_epoxy_dpdfene_simulation.py | 1 | 8847 | from epoxpy.abc_type_epoxy_simulation import ABCTypeEpoxySimulation
from epoxpy.lib import A, B, C, C10, Epoxy_A_10_B_20_C10_2_Blend
import epoxpy.init as my_init
import hoomd
from hoomd import md
from hoomd import deprecated
from hoomd import variant
import mbuild as mb
import epoxpy.common as cmn
class ABCTypeEpoxy... | gpl-3.0 |
donavoncade/namebench | nb_third_party/dns/rdataset.py | 215 | 11527 | # Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
Dixon3/lammps | tools/i-pi/ipi/inputs/prng.py | 33 | 4326 | """Deals with creating the random number generator.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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-2.0 |
jainayush975/zulip | zerver/webhooks/freshdesk/tests.py | 25 | 4640 | # -*- coding: utf-8 -*-
from typing import Text
from zerver.lib.test_classes import WebhookTestCase
class FreshdeskHookTests(WebhookTestCase):
STREAM_NAME = 'freshdesk'
URL_TEMPLATE = u"/api/v1/external/freshdesk?stream={stream}"
def test_ticket_creation(self):
# type: () -> None
"""
... | apache-2.0 |
s0enke/boto | boto/services/service.py | 170 | 6632 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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 rights to use, copy, modi... | mit |
QinerTech/QinerApps | openerp/addons/website_event_questions/models/event.py | 49 | 2289 | # -*- coding: utf-8 -*-
from openerp import models, fields
class EventEvent(models.Model):
""" Override Event model to add optional questions when buying tickets. """
_inherit = 'event.event'
question_ids = fields.One2many('event.question', 'event_id', 'Questions')
general_question_ids = fields.One2... | gpl-3.0 |
jshiv/turntable | test/lib/python2.7/site-packages/numpy/core/generate_numpy_api.py | 113 | 7629 | from __future__ import division, print_function
import os
import genapi
from genapi import \
TypeApi, GlobalVarApi, FunctionApi, BoolValuesApi
import numpy_api
# use annotated api when running under cpychecker
h_template = r"""
#if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_AR... | mit |
yytang2012/linux-kvm-arm | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
losnikitos/googleads-python-lib | examples/dfp/v201411/rate_card_service/get_all_rate_cards.py | 4 | 1679 | #!/usr/bin/python
#
# 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 required b... | apache-2.0 |
skoslowski/gnuradio | gr-blocks/python/blocks/qa_multiply_matrix_xx.py | 4 | 4943 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import time
import numpy
import os
import pmt
from gnuradio import gr, gr_unittest
from gnuradio import blocks
BLOCK_LOOKUP = {
... | gpl-3.0 |
saez0pub/ansible-modules-extras | web_infrastructure/jira.py | 20 | 10280 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Steve Smith <ssmith@atlassian.com>
# Atlassian open-source approval reference OSR-76.
#
# 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 ... | gpl-3.0 |
jaw20/Crunchyroll-XML-Decoder | crunchy-xml-decoder/requests/packages/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... | gpl-2.0 |
s40523236/2016fallcp_hw | plugin/liquid_tags/gram.py | 271 | 3656 | """
Instagram Image Tag
-------------------
By `Tom Spalding <https://github.com/digitalvapor>`_
You can see a working example at `antivapor.net/instagram-tag.html <http://antivapor.net/instagram-tag.html>`_.
Based on `Liquid Image Tag <https://github.com/getpelican/pelican-plugins/blob/master/liquid_tags/img.py>`_ ... | agpl-3.0 |
MDAnalysis/mdanalysis | package/MDAnalysis/coordinates/GRO.py | 1 | 17274 | # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... | gpl-2.0 |
marc-sensenich/ansible | test/units/modules/network/f5/test_bigip_node.py | 21 | 7128 | # -*- 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 pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
Shao-Feng/crosswalk-test-suite | misc/sampleapp-android-tests/inst.apk.py | 1996 | 3186 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... | bsd-3-clause |
Foxfanmedium/python_training | OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/requests/adapters.py | 69 | 20836 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import os.path
import socket
from urllib3.poolmanager import PoolManager, proxy_from_url
from urllib3.response import HTTPResponse
from urllib3.util ... | apache-2.0 |
Kamp9/scipy | scipy/optimize/tests/test__spectral.py | 135 | 6585 | from __future__ import division, absolute_import, print_function
import itertools
import numpy as np
from numpy import exp
from numpy.testing import assert_, assert_equal
from scipy.optimize import root
def test_performance():
# Compare performance results to those listed in
# [Cheng & Li, IMA J. Num. An. ... | bsd-3-clause |
shingonoide/odoo | addons/knowledge/__openerp__.py | 261 | 1738 | # -*- coding: 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 the GNU... | agpl-3.0 |
r-o-b-b-i-e/pootle | pootle/apps/virtualfolder/migrations/0006_cleanup_vfolder_names.py | 8 | 1193 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import Counter
from django.db import migrations, models
def rename_vf(vfolder):
parts = vfolder.location.split("/")
suffix = "-".join(
[x for x
in parts
if x and x not in ["{LANG}", "{PROJ}"]])
new... | gpl-3.0 |
texastribune/tt_dailyemailblast | tt_dailyemailblast/migrations/0003_add_send_dates.py | 1 | 3294 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'DailyEmailBlast.sent_on'
db.add_column('tt_dailyemailblast_dailyemailblast', 'sent_on',
... | apache-2.0 |
leoliujie/odoo | addons/payment_ogone/controllers/main.py | 389 | 1179 | # -*- coding: utf-8 -*-
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class OgoneController(http.Controller):
_accept_url = '/payment/ogone/test/accept'
_decline_url = '/payment/ogone/test/decline'
... | agpl-3.0 |
twitchyliquid64/misc-scripts | s3tool/boto/awslambda/layer1.py | 135 | 21546 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 rights ... | mit |
dreams6/pyerpcn | pyerp/fnd/management/__init__.py | 1 | 15665 | # -*- coding: utf-8 -*-
"""
"""
from datetime import datetime, date, timedelta
from django.db.models import get_models, signals
import pyerp.fnd.api.lookup as fnd_lookup
import pyerp.fnd.function as fnd_function
import pyerp.fnd.menu as fnd_menu
import pyerp.fnd.responsibility as fnd_resp
import pyerp.fnd.api.user... | gpl-3.0 |
tomjelinek/pcs | pcs/cli/resource/parse_args.py | 3 | 9063 | from pcs.cli.common.parse_args import group_by_keywords, prepare_options
from pcs.cli.common.errors import CmdLineInputError, SEE_MAN_CHANGES
def parse_create_simple(arg_list):
groups = group_by_keywords(
arg_list,
set(["op", "meta"]),
implicit_first_group_key="options",
group_repe... | gpl-2.0 |
sopel/stackformation | tests/unit/test_json.py | 1 | 1627 | # Copyright 2013 Steffen Opel. 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. A copy of
# the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying th... | apache-2.0 |
LatencyUtils/cassandra-stress2 | pylib/cqlshlib/cqlhandling.py | 10 | 12105 | # 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 |
timberline-secondary/hackerspace | src/badges/migrations/0005_badge_initialdata.py | 1 | 4374 | # Generated by Django 2.2.12 on 2020-05-09 05:47
from django.db import migrations, transaction
from django.core.exceptions import ObjectDoesNotExist
# NOT RUN
# Can't use fixtures because load_fixtures method is janky with django-tenant-schemas
def load_initial_data(apps, schema_editor):
Badge = apps.get_model('... | gpl-3.0 |
CSnap/SGIS-backend | gis_csdt/load.py | 2 | 30371 | # This file includes functions to load basic information
# should be used from the shell
import csv
import ftplib
import json
import os
import urllib
import zipfile
from django.contrib.gis.utils import LayerMapping
from models import MapPolygon, MapElement, MapPoint, GeoCoordinates, Location, DatasetNameField, Dataset... | bsd-3-clause |
hn0/hzzapp | hzzapp.py | 1 | 10677 | #!/usr/bin/python2.7
#_*_ coding: utf-8 _*_
"""
This script is a free software and you can redistribute and/or modify it under terms of GNU General Public
License as published by the Free Software Fundation (http://www.gnu.org/copyleft/gpl.html)
Disclaimer
This script is written and distributed with good intention... | gpl-2.0 |
smikes/depot_tools | third_party/coverage/files.py | 209 | 10724 | """File wrangling."""
from coverage.backward import to_string
from coverage.misc import CoverageException
import fnmatch, os, os.path, re, sys
import ntpath, posixpath
class FileLocator(object):
"""Understand how filenames work."""
def __init__(self):
# The absolute path to our current directory.
... | bsd-3-clause |
korealerts1/sentry | src/sentry/utils/settings.py | 34 | 2668 | """
sentry.utils.imports
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import inspect
import six
import sys
from sentry.utils.imports import import_string
PACKAGES = {
'djan... | bsd-3-clause |
achals/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/sub/plain_wsh.py | 499 | 1789 | # Copyright 2009, 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 |
npinto/pytest | _pytest/config.py | 2 | 17052 | """ command line options, ini-file and conftest.py processing. """
import py
import sys, os
from _pytest.core import PluginManager
import pytest
def pytest_cmdline_parse(pluginmanager, args):
config = Config(pluginmanager)
config.parse(args)
return config
def pytest_unconfigure(config):
while 1:
... | mit |
willthames/ansible | test/units/modules/network/ios/test_ios_banner.py | 62 | 2314 | # 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 distributed in the hope that ... | gpl-3.0 |
krintoxi/NoobSec-Toolkit | NoobSecToolkit - MAC OSX/scripts/sshbackdoors/backdoors/shell/pupy/pupy/packages/windows/x86/psutil/__init__.py | 66 | 66898 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""psutil is a cross-platform library for retrieving information on
running processes and system utilization... | gpl-2.0 |
fireblock/go-ethereum | vendor/github.com/nsf/termbox-go/collect_terminfo.py | 184 | 2041 | #!/usr/bin/env python
import sys, os, subprocess
def escaped(s):
return repr(s)[1:-1]
def tput(term, name):
try:
return subprocess.check_output(['tput', '-T%s' % term, name]).decode()
except subprocess.CalledProcessError as e:
return e.output.decode()
def w(s):
if s == None:
return
sys.stdout.write(s)
... | lgpl-3.0 |
modulexcite/dotless | lib/PEG_GrammarExplorer/PEG_GrammarExplorer/PegSamples/python_2_5_2/input/adwords/awapi_python_samples_1.0.0/src/get_sites_by_topics.py | 6 | 2206 | #!/usr/bin/python
#
# Copyright 2008, 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 b... | apache-2.0 |
dsfsdgsbngfggb/odoo | addons/base_import_module/models/base_import_module.py | 344 | 2066 | import base64
from StringIO import StringIO
from io import BytesIO
from openerp.osv import osv, fields
class base_import_module(osv.TransientModel):
""" Import Module """
_name = "base.import.module"
_description = "Import Module"
_columns = {
'module_file': fields.binary('Module .ZIP file', r... | agpl-3.0 |
isard-vdi/isard | docker/stats/src/sources/hypervisor.py | 1 | 2819 | import docker
import os, time, re
from time import sleep
from lib.carbon import Carbon
from lib.flask_rethink import RethinkDB
import rethinkdb as r
import collections
import socket
c=Carbon()
dbconn=RethinkDB()
from lib.helpers import cu, execute
try:
ip_squid = socket.gethostbyname('isard-squid')
except:
... | agpl-3.0 |
shaufi/odoo | addons/base_setup/__openerp__.py | 259 | 1750 | # -*- 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 |
40223101/w17test | static/Brython3.1.3-20150514-095342/Lib/site-packages/spur.py | 291 | 5461 | #coding: utf-8
import math
# 導入數學函式後, 圓周率為 pi
# deg 為角度轉為徑度的轉換因子
deg = math.pi/180.
class Spur(object):
def __init__(self, ctx):
self.ctx = ctx
def create_line(self, x1, y1, x2, y2, width=3, fill="red"):
self.ctx.beginPath()
self.ctx.lineWidth = width
self.ctx.moveTo(x1, y1)
... | gpl-3.0 |
wufangjie/dnn | examples/test_spp.py | 1 | 2242 | import numpy as np
import theano
import theano.tensor as T
from theano import config
from dnn.utils import *
from dnn.optimizers import *
from dnn.models import *
from dnn.layers import *
from datasets import load_mnist
from dnn.preprocess import pre_process, share_datasets
from collections import OrderedDict
config... | gpl-3.0 |
Funtimezzhou/TradeBuildTools | Document/szse/Quantitative Trading/sat-ebook-and-full-source-20150618/algo-ebook-full-source-code-20150618/chapter15/snp_forecast.py | 2 | 3537 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# snp_forecast.py
from __future__ import print_function
import datetime
import pandas as pd
from sklearn.qda import QDA
from strategy import Strategy
from event import SignalEvent
from backtest import Backtest
from data import HistoricCSVDataHandler
from execution import S... | gpl-3.0 |
Endika/mitmproxy | libmproxy/models/flow.py | 1 | 4473 | from __future__ import (absolute_import, print_function, division)
import copy
import uuid
from .. import stateobject, utils, version
from .connections import ClientConnection, ServerConnection
class Error(stateobject.StateObject):
"""
An Error.
This is distinct from an protocol error response ... | mit |
petrutlucian94/nova | nova/tests/unit/test_nova_manage.py | 15 | 25388 | # Copyright 2011 OpenStack Foundation
# Copyright 2011 Ilya Alekseyev
#
# 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 |
hujiajie/chromium-crosswalk | tools/copyright_scanner/copyright_scanner.py | 10 | 16713 | # 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.
"""Utilities for scanning source files to determine code authorship.
"""
import itertools
def ForwardSlashesToOsPathSeps(input_api, path):
"""Converts fo... | bsd-3-clause |
hheimbuerger/suds-gzip | tests/builtin.py | 64 | 18063 | # 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 |
aferr/LatticeMemCtl | src/arch/sparc/SparcSystem.py | 18 | 3673 | # 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 |
hidekb/espressopp | contrib/mpi4py/mpi4py-2.0.0/test/test_p2p_buf_matched.py | 8 | 7062 | from mpi4py import MPI
import mpiunittest as unittest
import arrayimpl
class TestMessage(unittest.TestCase):
def testMessageNull(self):
null = MPI.MESSAGE_NULL
self.assertFalse(null)
null2 = MPI.Message()
self.assertEqual(null, null2)
null3 = MPI.Message(null)
self.... | gpl-3.0 |
Yelp/kafka-python | kafka/protocol/admin.py | 2 | 24226 | from __future__ import absolute_import
from kafka.protocol.api import Request, Response
from kafka.protocol.types import Array, Boolean, Bytes, Int8, Int16, Int32, Int64, Schema, String
class ApiVersionResponse_v0(Response):
API_KEY = 18
API_VERSION = 0
SCHEMA = Schema(
('error_code', Int16),
... | apache-2.0 |
netzimme/mbed-os | tools/test/config/config_test.py | 29 | 4502 | """
mbed SDK
Copyright (c) 2016 ARM Limited
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, so... | apache-2.0 |
flgiordano/netcash | +/google-cloud-sdk/lib/googlecloudsdk/core/resource/resource_transform.py | 1 | 24090 | # Copyright 2015 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 ag... | bsd-3-clause |
mheap/ansible | lib/ansible/modules/network/ios/ios_logging.py | 27 | 12057 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... | gpl-3.0 |
jonathan-beard/edx-platform | common/djangoapps/config_models/tests.py | 75 | 10300 | # -*- coding: utf-8 -*-
"""
Tests of ConfigurationModel
"""
import ddt
from django.contrib.auth.models import User
from django.db import models
from django.test import TestCase
from freezegun import freeze_time
from mock import patch
from config_models.models import ConfigurationModel
class ExampleConfig(Configurat... | agpl-3.0 |
socialplanning/opencore | opencore/listen/interfaces.py | 1 | 2189 | from zope.schema import ASCII
from zope.i18nmessageid import MessageFactory
from zope.interface import Interface
from Products.listen.interfaces.mailinglist import IMailingList
from utils import isValidPrefix
_ = MessageFactory('opencore')
class IOpenMailingList(IMailingList):
"""
Slight customizations to t... | gpl-3.0 |
Innovahn/cybex | addons/hr_holidays/tests/test_holidays_flow.py | 338 | 10513 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-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 |
wroscoe/donkey | donkeycar/config.py | 1 | 1635 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 13 21:27:44 2017
@author: wroscoe
"""
import os
import types
class Config:
def __init__(self):
pass
def from_pyfile(self, filename, silent=False):
"""
Read config class from a file.
"""
d = types.M... | mit |
eepalms/gem5-newcache | ext/ply/example/yply/ylex.py | 165 | 2198 | # lexer for yacc-grammars
#
# Author: David Beazley (dave@dabeaz.com)
# Date : October 2, 2006
import sys
sys.path.append("../..")
from ply import *
tokens = (
'LITERAL','SECTION','TOKEN','LEFT','RIGHT','PREC','START','TYPE','NONASSOC','UNION','CODE',
'ID','QLITERAL','NUMBER',
)
states = (('code','exclusiv... | bsd-3-clause |
RobberPhex/thrift | contrib/fb303/py/fb303/FacebookBase.py | 43 | 2038 | #!/usr/bin/env 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
# "L... | apache-2.0 |
joequery/django | tests/auth_tests/test_views.py | 183 | 44561 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import os
import re
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.contrib.admin.models import LogEntry
from django.contrib.auth import REDIRECT_FIELD_NAME, S... | bsd-3-clause |
seelmann/django-nonrel-gae-openid-auth | djangoappengine/tests/not_return_sets.py | 107 | 4276 | from .testmodels import FieldsWithOptionsModel, OrderedModel, SelfReferenceModel
import datetime
from django.test import TestCase
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
class NonReturnSetsTest(TestCase):
floats = [5.3, 2.6, 9.1, 1.58, 2.4]
emails = ['app-engine@scholard... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/234_test_select.py | 9 | 1647 | # Testing select module
from test.test_support import verbose
import select
import os
# test some known error conditions
try:
rfd, wfd, xfd = select.select(1, 2, 3)
except TypeError:
pass
else:
print 'expected TypeError exception not raised'
class Nope:
pass
class Almost:
def fileno(self):
... | gpl-3.0 |
eezee-it/addons-yelizariev | ir_sequence_autoreset/ir_sequence.py | 17 | 3809 | # -*- coding: utf-8 -*-
##############################################################################
#
# Auto reset sequence by year,month,day
# Copyright 2013 wangbuke <wangbuke@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | lgpl-3.0 |
JimCircadian/ansible | lib/ansible/cli/vault.py | 36 | 21273 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# 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 distributed i... | gpl-3.0 |
msimacek/fedmsg_meta_fedora_infrastructure | fedmsg_meta_fedora_infrastructure/tests/conglomerate/bodhi/test_comments.py | 3 | 7042 | import fedmsg.tests.test_meta
import arrow
class TestBodhiConglomerateCommentSameUpdate(
fedmsg.tests.test_meta.ConglomerateBase):
originals = [
{
"i": 1,
"msg": {
"agent": "hreindl",
"comment": {
"anonymous": False,
... | lgpl-2.1 |
kazukioishi/android_kernel_samsung_klte | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
ruxkor/pulp-or | src/pulp/sparse.py | 1 | 3427 | # Sparse : Python basic dictionary sparse matrix
# Copyright (c) 2007, Stuart Mitchell (s.mitchell@auckland.ac.nz)
#$Id: sparse.py 1704 2007-12-20 21:56:14Z smit023 $
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software")... | mit |
kassak/xbmc | lib/libUPnP/Neptune/Build/Targets/x86-microsoft-win32-vs2010/Build.py | 198 | 2458 | #! /usr/bin/env python
"""
Visual Studio 2010 Build Script
$Id: Build.py 309 2011-09-21 05:44:28Z soothe $
"""
import os
import sys
import getopt
import subprocess
# Setup some path stuff
try:
if environ['VISUALSTUDIO_BIN']:
VSBINDIR = environ['VISUALSTUDIO_BIN']
except NameError:
# Use default val... | gpl-2.0 |
cosmiclattes/TPBviz | torrent/lib/python2.7/site-packages/pip/_vendor/html5lib/trie/datrie.py | 1301 | 1178 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from pip._vendor.six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, te... | gpl-3.0 |
invisiblek/python-for-android | python-build/python-libs/python-twitter/twitter.py | 89 | 70251 | #!/usr/bin/python2.4
#
# Copyright 2007 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... | apache-2.0 |
b-me/django | tests/defer/models.py | 282 | 1200 | """
Tests for defer() and only().
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Secondary(models.Model):
first = models.CharField(max_length=50)
second = models.CharField(max_length=50)
@python_2_unicode_compatible
class Primary(models.Model):
name... | bsd-3-clause |
AlexCatarino/Lean | Algorithm.Python/MovingAverageCrossAlgorithm.py | 3 | 3441 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | apache-2.0 |
nitin-cherian/LifeLongLearning | Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/requests/packages/chardet/euctwfreq.py | 3133 | 34872 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
openstack/cinder | cinder/tests/unit/volume/drivers/dell_emc/sc/test_sc.py | 2 | 219744 | # Copyright (c) 2014 Dell 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 or a... | apache-2.0 |
haiyuzhu/ucore_os_lab | related_info/lab7/software-hardware-locks/x86.py | 102 | 45406 | #! /usr/bin/env python
import sys
import time
import random
from optparse import OptionParser
#
# HELPER
#
def dospace(howmuch):
for i in range(howmuch):
print '%24s' % ' ',
# useful instead of assert
def zassert(cond, str):
if cond == False:
print 'ABORT::', str
exit(1)
return
c... | gpl-2.0 |
verloop/rasa_nlu | rasa_nlu/data_router.py | 1 | 8814 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import glob
import json
import logging
import multiprocessing
import os
import tempfile
from builtins import object
from typing import Text
from rasa_nl... | apache-2.0 |
arrabito/DIRAC | tests/Integration/RequestManagementSystem/Test_Client_Req.py | 1 | 12249 | """ This is a test of the chain
ReqClient -> ReqManagerHandler -> ReqDB
It supposes that the DB is present, and that the service is running
"""
# pylint: disable=invalid-name,wrong-import-position
from DIRAC.Core.Base.Script import parseCommandLine
parseCommandLine()
import unittest
from DIRAC import gLogg... | gpl-3.0 |
KamranMackey/CloudBot | plugins/minecraft_user.py | 30 | 1871 | import re
import requests
import uuid
from cloudbot import hook
HIST_API = "http://api.fishbans.com/history/{}"
UUID_API = "http://api.goender.net/api/uuids/{}/"
def get_name(uuid):
# submit the profile request
request = requests.get(UUID_API.format(uuid))
data = request.json()
return data[uuid]
... | gpl-3.0 |
salamer/picard | picard/util/webbrowser2.py | 3 | 3934 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2006 Lukáš Lalinský
#
# 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... | gpl-2.0 |
jaredhaight/Empire | lib/modules/code_execution/invoke_shellcode.py | 8 | 5531 | import re
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Shellcode',
'Author': ['@mattifestation'],
'Description': ("Uses PowerSploit's Invoke--Shellcode to inject "
"she... | bsd-3-clause |
vicky2135/lucious | oscar/lib/python2.7/site-packages/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... | bsd-3-clause |
roijo/C-PAC_complexitytools | scripts/cpac_run.py | 3 | 1875 | #!/usr/bin/python
import sys
from os import path
def check_inputs(*pathstrs):
for pathstr in pathstrs:
if not path.exists(pathstr):
print "ERROR: input '%s' doesn't exist" % pathstr
raise SystemExit(2)
_,ext = path.splitext(pathstr)
if ext != ".yml":
pri... | bsd-3-clause |
rushlee2016/awesome-python-webapp | www/config.py | 1 | 1196 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Configuration
'''
__author__ = "lichong"
import config_default
class Dict(dict):
'''
Simple dict but support access as x.y style.
'''
def __init__(self, names=(), values=(), **kw):
super(Dict, self).__init__(**kw)
for k, v in zip(name... | gpl-2.0 |
jounex/hue | desktop/core/src/desktop/management/commands/test_windmill.py | 35 | 3922 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
dyyi/moneybook | venv/Lib/sre_parse.py | 7 | 34964 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | apache-2.0 |
nke001/attention-lvcsr | libs/Theano/theano/sandbox/cuda/fftconv.py | 1 | 23334 | import string
import numpy as np
import theano
import theano.tensor as T
from theano.sandbox.cuda import cuda_available, GpuOp
from theano.ifelse import ifelse
if cuda_available:
from theano.sandbox.cuda import (basic_ops, CudaNdarrayType,
CudaNdarray)
from theano.misc.pycuda... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.