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 |
|---|---|---|---|---|---|
jakobabesser/pymus | pymus/test/test_transformer.py | 1 | 3040 | __author__ = 'Jakob Abesser'
import unittest
import numpy as np
import os
from ..transform.transformer import Transformer
from ..tools import Tools
class TestTransform(unittest.TestCase):
""" Unit tests for Transformer class
"""
def setUp(self):
""" Load reference data exported from Matlab """
... | mit |
nextgis/NextGIS_QGIS_open | python/plugins/processing/algs/grass7/ext/HtmlReportPostProcessor.py | 12 | 1550 | # -*- coding: utf-8 -*-
"""
***************************************************************************
HtmlReportPostProcessor.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************... | gpl-2.0 |
phoebusliang/parallel-lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/localflavor/de.py | 89 | 1847 | from django.contrib.localflavor.de.forms import (DEZipCodeField, DEStateSelect,
DEIdentityCardNumberField)
from utils import LocalFlavorTestCase
class DELocalFlavorTests(LocalFlavorTestCase):
def test_DEStateSelect(self):
f = DEStateSelect()
out = u'''<select name="states">
<option value="BW"... | gpl-3.0 |
simongoffin/website_version | addons/mrp/mrp.py | 12 | 63079 | # -*- 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 |
tobegit3hub/cinder_docker | cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py | 1 | 41162 | # (c) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
# 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/lic... | apache-2.0 |
OpusVL/odoo | addons/account_analytic_plans/wizard/__init__.py | 8 | 1049 | # -*- 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 |
lshain-android-source/external-gtest | scripts/pump.py | 603 | 23316 | #!/usr/bin/env python
#
# Copyright 2008, 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... | bsd-3-clause |
ghchinoy/tensorflow | tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py | 8 | 6761 | # 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 applicable ... | apache-2.0 |
lilydjwg/tornado | tornado/queues.py | 8 | 12289 | # Copyright 2015 The Tornado Authors
#
# 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 w... | apache-2.0 |
GaZ3ll3/numpy | numpy/core/getlimits.py | 100 | 9714 | """Machine limits for Float32 and Float64 and (long double) if available...
"""
from __future__ import division, absolute_import, print_function
__all__ = ['finfo', 'iinfo']
from .machar import MachAr
from . import numeric
from . import numerictypes as ntypes
from .numeric import array
def _frz(a):
"""fix rank-... | bsd-3-clause |
Elettronik/SickRage | lib/github/Organization.py | 44 | 28968 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Steve English <steve.english@navetas.com> #
# Copyright 2012 Vincent Jacques <vincent@vincent-ja... | gpl-3.0 |
yamt/neutron | quantum/extensions/quotasv2.py | 2 | 5192 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apac... | apache-2.0 |
BautiG/Picture | ggame/headlessdeps.py | 228 | 9672 | def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
return True
if module_exists('PIL'):
from PIL import Image
class _body(object):
def __init__(self):
self.events = {}
def appendChild(self, obj):
self... | mit |
pabloborrego93/edx-platform | openedx/core/djangoapps/api_admin/tests/test_models.py | 27 | 6282 | # pylint: disable=missing-docstring
from smtplib import SMTPException
import ddt
from django.conf import settings
from django.db import IntegrityError
from django.test import TestCase
import mock
import unittest
from microsite_configuration.tests.factories import SiteFactory
from openedx.core.djangoapps.api_admin.mod... | agpl-3.0 |
castroflavio/ryu | ryu/lib/ofp_pktinfilter.py | 9 | 1806 | # Copyright (C) 2013 Stratosphere 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 agreed to in ... | apache-2.0 |
msurovcak/martin.surovcak.cz | genpage.py | 1 | 1089 | # -*- coding: utf-8 -*-
import os, git
from jinja2 import Environment,FileSystemLoader
# Main loop
if __name__ == '__main__':
# Get history
repo = git.Repo('.')
commits = repo.log(path='me.yaml')
# Load templates
env = Environment(loader=FileSystemLoader(os.sep.join((
'template... | mit |
DejaToris/MetaphorResearch | research_tools/DbAccess.py | 1 | 1304 | import pymssql
from enum import Enum
import random
class FakeSqlCursor(object):
def execute(self, sql_query):
pass
def fetchone(self):
return [random.random()]
class FakeSqlConn(object):
def cursor(self):
return FakeSqlCursor()
class TestConnection(object):
def __enter__(s... | mit |
gopal1cloud/neutron | neutron/tests/unit/mlnx/test_rpcapi.py | 2 | 6895 | # Copyright 2013 Mellanox Technologies, Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
atosatto/ansible | lib/ansible/modules/monitoring/icinga2_feature.py | 77 | 4541 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage Icinga2 feature state
(c) 2016, Loic Blot <loic.blot@unix-experience.fr>
Sponsored by Infopro Digital. http://www.infopro-digital.com/
Sponsored by E.T.A.I. http://www.etai.fr/
This file is part of Ansible
Ansible is free software: you can redi... | gpl-3.0 |
profglavcho/ALPS.L0.MP8.V2.1_LCSH6735_65C_HZ_L_KERNEL | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
HanyuWorm/volatility | volatility/plugins/linux/check_idt.py | 44 | 2759 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
dockerera/func | func/overlord/command.py | 5 | 9246 | # -*- Mode: Python; test-case-name: test_command -*-
# vi:si:et:sw=4:sts=4:ts=4
# This file is released under the standard PSF license.
#
# from MOAP - https://thomas.apestaart.org/moap/trac
# written by Thomas Vander Stichele (thomas at apestaart dot org)
#
"""
Command class.
"""
import optparse
import sys
cl... | gpl-2.0 |
dcroc16/skunk_works | google_appengine/lib/django-1.3/tests/modeltests/m2m_through/tests.py | 90 | 12896 | from datetime import datetime
from operator import attrgetter
from django.test import TestCase
from models import Person, Group, Membership, CustomMembership, \
TestNoDefaultsOrNulls, PersonSelfRefM2M, Friendship
class M2mThroughTests(TestCase):
def setUp(self):
self.bob = Person.objects.create(name... | mit |
boddob/linux | Documentation/sphinx/cdomain.py | 146 | 5612 | # -*- coding: utf-8; mode: python -*-
# pylint: disable=W0141,C0113,C0103,C0325
u"""
cdomain
~~~~~~~
Replacement for the sphinx c-domain.
:copyright: Copyright (C) 2016 Markus Heiser
:license: GPL Version 2, June 1991 see Linux/COPYING for details.
List of customizations:
* Moved th... | gpl-2.0 |
insequent/quark | quark/plugin_modules/ip_addresses.py | 1 | 8862 | # Copyright 2013 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 |
nnethercote/servo | tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/text-decor-3/support/generate-text-emphasis-style-property-tests.py | 5 | 3700 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-style-property-011 ~ 020 which
cover all possible values of text-emphasis-style property, except none
and <string>, with horizontal writing mode. It outputs a list of all
tests it generated in the format of Mozilla reftest.... | mpl-2.0 |
TeamExodus/external_chromium_org | tools/perf/page_sets/intl_ja_zh.py | 34 | 2004 | # 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class IntlJaZhPage(page_module.Page):
def __init__(... | bsd-3-clause |
gregory80/fastFrag-utils | app_engine/fastfrag-converter/tornado/options.py | 3 | 13626 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | unlicense |
arnarb/greenhousedb | apps/taxonomy/models.py | 1 | 1884 | from django.db import models
class Family(models.Model):
name = models.CharField('Family ', max_length=100, unique=True)
date_created = models.DateTimeField('Date created ', auto_now_add=True)
date_modified = models.DateTimeField('Date modified ', auto_now=True)
def __unicode__(self):
return ... | gpl-3.0 |
revolutionaryG/androguard | demos/example_idapipe.py | 25 | 1500 | #!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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,... | apache-2.0 |
LaoZhongGu/kbengine | kbe/src/lib/python/Lib/distutils/msvccompiler.py | 140 | 23479 | """distutils.msvccompiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
"""
# Written by Perry Stoll
# hacked by Robin Becker and Thomas Heller to do a better job of
# finding DevStudio (through the registry)
import sys, os
from distutils.errors import \
... | lgpl-3.0 |
xujun10110/MITMf | core/sslstrip/DnsCache.py | 26 | 1816 | # Copyright (c) 2014-2016 Moxie Marlinspike, Marcello Salvati
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This... | gpl-3.0 |
ssimons/PyTreeEditor | src/gui/gui_helper.py | 1 | 4125 | #!/usr/bin/python
# -*- coding: utf-8*-
"""
Tree Editor.
Copyright (C) 2014 ssimons
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 ve... | gpl-2.0 |
krsjoseph/youtube-dl | youtube_dl/extractor/newgrounds.py | 150 | 1261 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
class NewgroundsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?newgrounds\.com/audio/listen/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.newgrounds.com/audio/listen/549479',
'md5': 'fe6033d2... | unlicense |
xuru/pyvisdk | pyvisdk/esxcli/handlers/ha_cli_handler_storage_core_device_detached.py | 1 | 1314 |
from pyvisdk.esxcli.executer import execute_soap
from pyvisdk.esxcli.base import Base
class StorageCoreDeviceDetached(Base):
'''
Operations pertaining to the pluggable storage architectures' detached logical devices on the system.
'''
moid = 'ha-cli-handler-storage-core-device-detached'
def list(s... | mit |
haoxli/web-testing-service | wts/tests/csp/csp_font-src_none_blocked_int-manual.py | 30 | 2712 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
response.headers.set("Content... | bsd-3-clause |
BLuu13/ISSAMemberManager | ISSA/MemberMailer/Objects/database.py | 1 | 5923 | import sqlite3
import sys
class Database(object):
'''Class to handle connection to sqlite3 database'''
def __init__(self, db_file = 'C:/Users/Stormer/Documents/Github/ISSAMemberManager/db/memberdb.sqlite3'):
self.con = sqlite3.connect(db_file)
def insert(self, fname, lname, email, phone, gradyea... | mpl-2.0 |
xuweiliang/Codelibrary | nova/policies/limits.py | 6 | 1060 | # Copyright 2016 Cloudbase Solutions Srl
# 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 r... | apache-2.0 |
andrewgailey/robogen | robogen/rgkit/backup bots/MightWinSometimes.py | 1 | 2239 | # MightWinSometimes by Hjax
# http://robotgame.org/viewrobot/6190
import rg
import operator
allyDistance = 20
enemyDistance = 10
class Robot:
def act(self, game):
bestDistance = 999
bestLoc = (0,0)
otherPlaces = rg.locs_around(self.location, filter_out=('invalid', 'obstacle'))
for ... | unlicense |
LeoTestard/qt-ubuntu-components | tests/autopilot/tavastia/tests/switch/test_switch.py | 1 | 2173 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2012 Canonical
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
"""Tests for the Switch Qml co... | lgpl-3.0 |
harisibrahimkv/django | tests/forms_tests/field_tests/test_regexfield.py | 106 | 2881 | import re
from django.forms import RegexField, ValidationError
from django.test import SimpleTestCase
class RegexFieldTest(SimpleTestCase):
def test_regexfield_1(self):
f = RegexField('^[0-9][A-F][0-9]$')
self.assertEqual('2A2', f.clean('2A2'))
self.assertEqual('3F3', f.clean('3F3'))
... | bsd-3-clause |
zenna/dreal3 | benchmarks/network/thermostat/thermostat-double-ind-p.py | 11 | 3330 |
from gen import *
##########
# shared #
##########
flow_var[0] = """
(declare-fun tau () Real)
"""
flow_dec[0] = """
(define-ode flow_1 ((= d/dt[tau] 1)))
"""
state_dec[0] = """
(declare-fun time_{0} () Real)
(declare-fun tau_{0}_0 () Real)
(declare-fun tau_{0}_t () Real)
"""
state_val[0] = """
(assert (<= 0 ... | gpl-3.0 |
googleapis/googleapis-gen | google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/services/customer_user_access_invitation_service/transports/base.py | 1 | 4479 | # -*- 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 |
adamtiger/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/models/nn.py | 190 | 1567 | # 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 |
sebrandon1/bitcoin | test/functional/p2p_disconnect_ban.py | 23 | 5318 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node disconnect and ban behavior"""
import time
from test_framework.test_framework import Bitcoin... | mit |
TudorRosca/enklave | server/backend/migrations/0057_auto_20160407_1401.py | 1 | 1329 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('backend', '0056_auto_20160406_0656'),
... | agpl-3.0 |
zavlab1/foobnix | foobnix/preferences/configs/info_panel_conf.py | 2 | 2017 | #-*- coding: utf-8 -*-
'''
Created on 29 авг. 2010
@author: ivan
'''
from foobnix.preferences.config_plugin import ConfigPlugin
from gi.repository import Gtk
from foobnix.fc.fc import FC
class InfoPanelConfig(ConfigPlugin):
name = _("Info panel")
def __init__(self, controls):
box = Gtk.Box.new(Gtk... | gpl-3.0 |
catapult-project/catapult-csm | third_party/google-endpoints/requests/packages/urllib3/util/timeout.py | 292 | 9757 | from __future__ import absolute_import
# The default socket timeout, used by httplib to indicate that no timeout was
# specified by the user
from socket import _GLOBAL_DEFAULT_TIMEOUT
import time
from ..exceptions import TimeoutStateError
# A sentinel value to indicate that no timeout was specified by the user in
# u... | bsd-3-clause |
ujdhesa/unisubs | libs/vidscraper/metasearch/sites/vimeo.py | 1 | 3342 | # Miro - an RSS based video player application
# Copyright 2009 - Participatory Culture Foundation
#
# This file is part of vidscraper.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of sour... | agpl-3.0 |
cgarrard/osgeopy-code | Chapter9/chapter9.py | 1 | 7212 | import os
import numpy as np
from osgeo import gdal
# Set this variable to your osgeopy-data directory so that the following
# examples will work without editing. We'll use the os.path.join() function
# to combine this directory and the filenames to make a complete path. Of
# course, you can type the full path to the... | mit |
josenavas/qiime | qiime/parallel/util.py | 15 | 21568 | #!/usr/bin/env python
# File created on 07 Jul 2012
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso", "Jens Reeder", "Jai Ram Rideout",
"Daniel McDonald"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__mainta... | gpl-2.0 |
agaffney/ansible | test/units/module_utils/common/test_utils.py | 97 | 1171 | # -*- coding: utf-8 -*-
# (c) 2018 Ansible Project
# 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
from ansible.module_utils.common.sys_info import get_all_subclasses
#
# Tests for get_... | gpl-3.0 |
ageron/tensorflow | tensorflow/contrib/layers/python/layers/summaries.py | 164 | 5415 | # 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 |
eduNEXT/edunext-platform | lms/djangoapps/courseware/tests/test_access.py | 4 | 36780 | # -*- coding: utf-8 -*-
"""
Test the access control framework
"""
import datetime
import itertools
import ddt
import pytz
import six
from ccx_keys.locator import CCXLocator
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.client import RequestFactory
from django.urls impo... | agpl-3.0 |
gdgellatly/OCB1 | addons/mail/controllers/main.py | 32 | 1036 | import base64
import openerp.addons.web.http as oeweb
from openerp.addons.web.controllers.main import content_disposition
import mimetypes
#----------------------------------------------------------
# Controller
#----------------------------------------------------------
class MailController(oeweb.Controller):
_cp... | agpl-3.0 |
wojtekzw/statsdaemon | stress.py | 2 | 1172 | import socket
import time
import random
import sys
import statsd
# lib - https://github.com/jsocol/
# alternative lib - https://github.com/WoLpH/python-statsd
## https://github.com/jsocol/pystatsd/blob/master/docs/reference.rst
s = statsd.StatsClient('localhost', 8125, prefix='')
#s = statsd.TCPStatsClient('localhost... | unlicense |
nimiq/moogle-project | magpie/utils/dates.py | 1 | 1201 | from time import strptime, mktime
from datetime import datetime
def twitter_date_to_solr_date(date_string):
"""
Convert a Twitter date in the format: Sun Feb 23 10:49:52 +0000 2014
to a Solr date in the format: 2014-02-23T22:37:57Z
"""
# First convert to datetime.
dt = strptime(dat... | apache-2.0 |
albertomurillo/ansible | lib/ansible/modules/network/aci/aci_contract_subject.py | 22 | 10735 | #!/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 |
vdrey/Toolbox | Python/BHP/BHP-Code/BHP-Code/Chapter8/screenshotter.py | 2 | 1100 | import win32gui
import win32ui
import win32con
import win32api
# grab a handle to the main desktop window
hdesktop = win32gui.GetDesktopWindow()
# determine the size of all monitors in pixels
width = win32api.GetSystemMetrics(win32con.SM_CXVIRTUALSCREEN)
height = win32api.GetSystemMetrics(win32con.SM_CYVIRTUALSCREEN)... | mit |
CeltonMcGrath/TACTIC | src/tactic/ui/app/project_start_wdg.py | 6 | 17175 | ###########################################################
#
# Copyright (c) 2010, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
manipopopo/tensorflow | tensorflow/contrib/data/python/ops/get_single_element.py | 5 | 3735 | # 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 |
John-Shaw/shadowsocks | shadowsocks/daemon.py | 694 | 5602 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 clowwindy
#
# 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 requi... | apache-2.0 |
codepython/restcommander | play-1.2.4/python/Lib/site-packages/win32/lib/winioctlcon.py | 21 | 33989 | ## flags, enums, guids used with DeviceIoControl from WinIoCtl.h
import pywintypes
from ntsecuritycon import FILE_READ_DATA,FILE_WRITE_DATA
def CTL_CODE(DeviceType, Function, Method, Access):
return (DeviceType << 16) | (Access << 14) | (Function << 2) | Method
def DEVICE_TYPE_FROM_CTL_CODE(ctrlCode):
return ... | apache-2.0 |
hdinsight/hue | apps/oozie/src/oozie/migrations/0020_chg_large_varchars_to_textfields.py | 37 | 24759 | # encoding: utf-8
import datetime
from django.utils.translation import ugettext as _
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.alter_column('oozie_java', 'args', self.gf('django.db.models.fields.T... | apache-2.0 |
bilalel/reveal2py | languages/default.py | 180 | 4428 | # coding: utf8
{
'!langcode!': 'en-us',
'!langname!': 'English (US)',
'%s %%(shop)': '%s %%(shop)',
'%s %%(shop[0])': '%s %%(shop[0])',
'%s %%{quark[0]}': '%s %%{quark[0]}',
'%s %%{shop[0]}': '%s %%{shop[0]}',
'%s %%{shop}': '%s %%{shop}',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
'@markmin\x01*... | apache-2.0 |
CMPUT410W15T02/CMPUT410W15-project | testenv/lib/python2.7/site-packages/django/db/backends/sqlite3/creation.py | 59 | 3682 | import os
import sys
from django.db.backends.creation import BaseDatabaseCreation
from django.utils.six.moves import input
class DatabaseCreation(BaseDatabaseCreation):
# SQLite doesn't actually support most of these types, but it "does the right
# thing" given more verbose field definitions, so leave them a... | gpl-2.0 |
domob1812/namecore | test/functional/p2p_segwit.py | 1 | 94936 | #!/usr/bin/env python3
# Copyright (c) 2016-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network."""
import math
import random
import struct
import t... | mit |
DavidNorman/tensorflow | tensorflow/python/kernel_tests/conditional_accumulator_test.py | 23 | 17624 | # 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 |
kbrebanov/ansible | test/units/modules/network/aruba/test_aruba_config.py | 3 | 7727 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/lib-tk/tkColorChooser.py | 37 | 1784 | # tk common color chooser dialogue
#
# this module provides an interface to the native color dialogue
# available in Tk 4.2 and newer.
#
# written by Fredrik Lundh, May 1997
#
# fixed initialcolor handling in August 1998
#
#
# options (all have default values):
#
# - initialcolor: color to mark as selected when dialog... | mit |
Nick-OpusVL/odoo | addons/portal/tests/test_portal.py | 198 | 14169 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
googleapis/python-speech | samples/snippets/transcribe_word_time_offsets.py | 1 | 3713 | #!/usr/bin/env python
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
leiferikb/bitpop | src/native_client_sdk/src/build_tools/tests/parse_dsc_test.py | 109 | 2483 | #!/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.
import copy
import datetime
import os
import posixpath
import subprocess
import sys
import unittest
SCRIPT_DIR = os.path.dirname(o... | gpl-3.0 |
CingHu/neutron-ustack | neutron/db/migration/alembic_migrations/versions/117643811bca_nec_delete_ofc_mapping.py | 3 | 6248 | # Copyright 2014 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
rrussell39/selenium | py/test/selenium/webdriver/common/google_one_box.py | 65 | 1582 | # 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 |
ondra-novak/chromium.src | chrome/common/extensions/docs/server2/server_instance.py | 7 | 5653 | # 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.
from api_data_source import APIDataSource
from api_list_data_source import APIListDataSource
from compiled_file_system import CompiledFileSystem
from con... | bsd-3-clause |
fitermay/intellij-community | python/lib/Lib/unittest.py | 91 | 29393 | #!/usr/bin/env python
'''
Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
Smalltalk testing framework.
This module contains the core framework classes that form the basis of
specific test cases and suites (TestCase, TestSuite etc.), and also a
text-based utility class for running the tests ... | apache-2.0 |
shanot/imp | modules/algebra/test/test_line.py | 2 | 6385 | import math
import IMP
import IMP.test
import IMP.algebra
from IMP.algebra import Vector3D as V3
class Tests(IMP.test.TestCase):
"""Tests for Line3D objects and related functions"""
def test_constructor(self):
"""Test construction of Line3D objects"""
l = IMP.algebra.Line3D()
l = IM... | gpl-3.0 |
CharlieGreenman/codeIllustrator | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | 1835 | 12124 | # 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.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | mit |
HoracioAlvarado/fwd | venv/Lib/site-packages/sqlalchemy/sql/schema.py | 27 | 145511 | # sql/schema.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The schema module provides the building blocks for database metadata.
Each element... | mit |
adoosii/edx-platform | lms/djangoapps/branding/migrations/0001_initial.py | 102 | 4789 | # -*- 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 model 'BrandingInfoConfig'
db.create_table('branding_brandinginfoconfig', (
('id', self... | agpl-3.0 |
tjanez/ansible | lib/ansible/plugins/__init__.py | 6 | 19139 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> and others
# (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
#
# 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 Pub... | gpl-3.0 |
Reagankm/KnockKnock | venv/lib/python3.4/site-packages/pip/download.py | 45 | 22491 | import cgi
import email.utils
import hashlib
import getpass
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
import pip
from pip.backwardcompat import urllib, urlparse, raw_input
from pip.exceptions import InstallationError, HashMismatch
from pip.util import (splitext, rmt... | gpl-2.0 |
vericoin/vericoin-core | qa/rpc-tests/bipdersig-p2p.py | 69 | 6594 | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, N... | mit |
lgarren/spack | lib/spack/external/jinja2/tests.py | 130 | 4428 | # -*- coding: utf-8 -*-
"""
jinja2.tests
~~~~~~~~~~~~
Jinja test functions. Used with the "is" operator.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
from collections import Mapping
from jinja2.runtime import Undefined
from jinja2._compat impor... | lgpl-2.1 |
AEDA-Solutions/matweb | backend/Database/Controllers/Escopo_disciplina.py | 1 | 1274 | from Framework.BancoDeDados import BancoDeDados
from Database.Models.Escopo_disciplina import Escopo_disciplina as ModelEscopo_disciplina
class Escopo_disciplina(object):
def pegarMultiplosEscopo_disciplina(self, condicao, valores):
escopo_disciplina = []
for escopo in BancoDeDados().consultarMultiplos("SELEC... | mit |
MatchMakedemia/MatchMakedemia | scripts/api.py | 1 | 4411 | """Connects to the orcid API, searches using a given query and puts results into database"""
# Remember to be in the right email
import orcid
from py2neo import Graph, Node, Relationship, authenticate
import sys
from keys import SECRET, db_passwd
# oew1v07's Public API key and secret. Will need to be changed if oew1v... | mit |
gibiansky/tensorflow | tensorflow/contrib/graph_editor/tests/reroute_test.py | 17 | 3599 | # 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 |
VIVAUVA/InSAR_Add-in | makeaddin.py | 3 | 1420 | import os
import re
import zipfile
current_path = os.path.dirname(os.path.abspath(__file__))
out_zip_name = os.path.join(current_path,
os.path.basename(current_path) + ".esriaddin")
BACKUP_FILE_PATTERN = re.compile(".*_addin_[0-9]+[.]py$", re.IGNORECASE)
def looks_like_a_back... | gpl-3.0 |
alanjw/GreenOpenERP-Win-X86 | python/Lib/site-packages/lxml/html/defs.py | 11 | 3801 | # FIXME: this should all be confirmed against what a DTD says
# (probably in a test; this may not match the DTD exactly, but we
# should document just how it differs).
# Data taken from http://www.w3.org/TR/html401/index/elements.html
try:
frozenset
except NameError:
from sets import Set as frozenset
empty_... | agpl-3.0 |
Nick-OpusVL/odoo | addons/gamification/wizard/grant_badge.py | 280 | 2230 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
qunying/gps | share/support/core/rectangles.py | 1 | 12518 | """
This file provides support for rectangle-mode in an editor.
In particular, it is possible to select a rectangular area,
cut it, and paste it elsewhere.
To perform a selection, use the standard selection mechanisms (e.g.
mouse+click selection, or keyboard shift+arrows).
The highlighting of the selection itself is... | gpl-3.0 |
JoeyCodinja/INFO3180PROJECT3 | lib/werkzeug/useragents.py | 317 | 5300 | # -*- coding: utf-8 -*-
"""
werkzeug.useragents
~~~~~~~~~~~~~~~~~~~
This module provides a helper to inspect user agent strings. This module
is far from complete but should work for most of the currently available
browsers.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more deta... | apache-2.0 |
PokerChichi/TidyMyKey | cve-search/db_updater.py | 1 | 2436 | #
#
# Updater script of CVE/CPE database
#
import pymongo
import shlex, subprocess
import syslog
import argparse
import time
sources = [{'name': "cpe", 'updater': "python3 db_mgmt_cpe_dictionnary.py"},{'name': "cves", 'updater': "python3 db_mgmt.py -u"},{'name': 'vfeed', 'updater': "python3 db_mgmt_vfeed.py"} , {'nam... | gpl-3.0 |
bala4901/odoo | addons/product_visible_discount/__init__.py | 433 | 1054 | ##############################################################################
#
# 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 Affero General Public L... | agpl-3.0 |
bgcngm/802Xtreem | 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 |
steynovich/ansible-modules-extras | monitoring/nagios.py | 39 | 36108 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is largely copied from the Nagios module included in the
# Func project. Original copyright follows:
#
# func-nagios - Schedule downtime and enables/disable notifications
# Copyright 2011, Red Hat, Inc.
# Tim Bielawa <tbielawa@redhat.com>
#
# This software may be ... | gpl-3.0 |
bmi-forum/bmi-pyre | pythia-0.8/packages/pyre/pyre/filesystem/Finder.py | 2 | 1070 | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~... | gpl-2.0 |
ambujone/breath-hackathon | gae/lib/PIL/PalmImagePlugin.py | 40 | 9578 | #
# The Python Imaging Library.
# $Id$
#
##
# Image plugin for Palm pixmap images (output only).
##
__version__ = "1.0"
import Image, ImageFile
_Palm8BitColormapValues = (
( 255, 255, 255 ), ( 255, 204, 255 ), ( 255, 153, 255 ), ( 255, 102, 255 ),
( 255, 51, 255 ), ( 255, 0, 255 ), ( 255, 255, 204 ), ( 2... | mit |
srimai/odoo | addons/l10n_nl/__init__.py | 424 | 1413 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 Veritos - Jan Verlaan - www.veritos.nl
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# con... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.