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 |
|---|---|---|---|---|---|
agry/NGECore2 | scripts/mobiles/dathomir/mutant_ baz_nitch.py | 2 | 1585 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | lgpl-3.0 |
CYBERBUGJR/Diamond | src/collectors/snmpraw/snmpraw.py | 56 | 6074 | # coding=utf-8
"""
The SNMPRawCollector is designed for collecting data from SNMP-enables devices,
using a set of specified OIDs
#### Configuration
Below is an example configuration for the SNMPRawCollector. The collector
can collect data any number of devices by adding configuration sections
under the *devices* hea... | mit |
lfrdm/medpy | tests/filter_/LabelImageStatistics.py | 2 | 8480 | """Unittest for the label image statistics class."""
# build-in modules
import unittest
# third-party modules
import scipy
from scipy import stats
# path changes
# own modules
from medpy.filter import LabelImageStatistics
# information
__author__ = "Oskar Maier"
__version__ = "r0.1.1, 2011-12-29"
__email__ = "osk... | gpl-3.0 |
Jusedawg/SickRage | lib/guessit/test/test_yml.py | 18 | 10503 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=no-self-use, pointless-statement, missing-docstring, invalid-name
import logging
# io.open supports encoding= in python 2.7
from io import open # pylint: disable=redefined-builtin
import os
import yaml
import six
import babelfish
import pytest
from re... | gpl-3.0 |
Microvellum/Fluid-Designer | win64-vc/2.78/scripts/startup/bl_ui/properties_physics_fluid.py | 2 | 10739 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is distrib... | gpl-3.0 |
klmitch/glance | glance/db/sqlalchemy/migrate_repo/schema.py | 3 | 3251 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
jlanga/exon_finder | tests/custom_assertions.py | 2 | 5708 | #!/usr/bin/env python3
"""
tests.custom_assertions.py: custom assertions for unit tests:
- assertEqualListOfSeqrecords: check if a list of seqrecords have:
- the same length
- the same id
- the same sequence
- assertEqualSpliceGraphs: check if two splice graphs:
- are isomorphic with nx.is_isomorphic
... | mit |
kosz85/django | tests/staticfiles_tests/test_management.py | 33 | 18449 | import codecs
import datetime
import os
import shutil
import tempfile
import unittest
from io import StringIO
from unittest import mock
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.contrib.staticfiles import storage
from django.contrib.staticfiles.management.command... | bsd-3-clause |
nullie/python-hemi | tests/test_interoperability.py | 2 | 1426 | # -*- coding: utf-8 -*-
import hemi
def test_pass_back():
ctx = hemi.Context()
obj = ctx.eval("({1: 3})")
func = ctx.eval("(function(o) { return o[1] + 3 })")
val = func(obj)
assert val == 6
func2 = ctx.eval("(function(f) { return f({1: 5}) + 2 })")
val = func2(func)
assert val ... | bsd-3-clause |
JuBzzz/PyImageScripts | Scripts/labeler.py | 1 | 13464 | import tkinter as tk
from tkinter import ttk
from PIL import ImageFont, ImageDraw, Image
from matplotlib import font_manager
from ._helper import *
import os
DEFAULT_FONTS = ["Arial", "Helvetica", "Times New Roman", "Times",
"Courier New", "Verdana"]
MIN_FONT = 1
MAX_FONT = 10000
WHITE = (255, 255, 25... | mit |
ChugR/qpid-dispatch | tests/system_tests_http2.py | 3 | 31067 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
mitsuhiko/django | tests/modeltests/files/tests.py | 3 | 4515 | from __future__ import with_statement
import shutil
import sys
import tempfile
from django.core.cache import cache
from django.core.files import File
from django.core.files.base import ContentFile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from models import Storag... | bsd-3-clause |
MSK61/processorsim | src/sim_services/__init__.py | 1 | 22669 | # -*- coding: utf-8 -*-
"""sim_services package"""
############################################################
#
# Copyright 2017, 2019, 2020, 2021 Mohammed El-Afifi
# This file is part of processorSim.
#
# processorSim is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Ge... | lgpl-3.0 |
jokerfr9/DragonsKernel_Kylessopen | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
sorenk/ansible | lib/ansible/modules/packaging/os/portage.py | 43 | 14682 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, William L Thomson Jr
# (c) 2013, Yap Sok Ann
# Written by Yap Sok Ann <sokann@gmail.com>
# Modified by William L. Thomson Jr. <wlt@o-sinc.com>
# Based on apt module written by Matthew Williams <matthew@flowroute.com>
#
# GNU General Public License v3.0+ (see COPYIN... | gpl-3.0 |
mstojcevich/pyFlash | robot.py | 2 | 3695 | import wpilib
from subsystem.drivetrain import DriveTrain
from handlers.autonomous import AutonHandler
from threading import Timer
from subsystem.lifter import Lifter
from oi import OI
TEST_BENCH = False # Whether we're using the test chassis
class FlashRobot(wpilib.IterativeRobot):
def robotInit(self):
... | mit |
deepesch/scikit-learn | sklearn/datasets/svmlight_format.py | 114 | 15826 | """This module implements a loader and dumper for the svmlight format
This format is a text-based format, with one sample per line. It does
not store zero valued features hence is suitable for sparse dataset.
The first element of each line can be used to store a target variable to
predict.
This format is used as the... | bsd-3-clause |
glneo/gnuradio-davisaf | grc/base/ParseXML.py | 35 | 3369 | """
Copyright 2008 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 ... | gpl-3.0 |
bhargav2408/python-for-android | python3-alpha/python3-src/Lib/encodings/cp1253.py | 272 | 13094 | """ Python Character Mapping Codec cp1253 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | apache-2.0 |
nwchandler/ansible | contrib/inventory/stacki.py | 78 | 6285 | #!/usr/bin/env python
# Copyright (c) 2016, Hugh Ma <hugh.ma@flextronics.com>
#
# This module 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 v... | gpl-3.0 |
bourreauEric/or-tools | examples/python/data/nonogram_regular/nonogram_gondola.py | 74 | 2187 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 |
akhilpm/Masters-Project | kpcaWithTreeFS/mnistKPCA.py | 1 | 3216 | '''
KPCA based feature engineering for MNIST handwritten digits classification
Author : Akhil P M
Kernel used : Arc-cosine Kernel
'''
import numpy as np
import matplotlib.pyplot as plt
import time
from sklearn import svm, datasets
from sklearn.decomposition import PCA, KernelPCA
from sklearn.datasets.mldata import fet... | mit |
gunan/tensorflow | tensorflow/python/util/tf_should_use.py | 3 | 8568 | # 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 |
zxjzxj9/FlaskBoard | web/lib/python2.7/site-packages/click/testing.py | 68 | 11004 | import os
import sys
import shutil
import tempfile
import contextlib
from ._compat import iteritems, PY2
# If someone wants to vendor click, we want to ensure the
# correct package is discovered. Ideally we could use a
# relative import here but unfortunately Python does not
# support that.
clickpkg = sys.modules[_... | apache-2.0 |
dgarage/bc2 | contrib/linearize/linearize-data.py | 105 | 10081 | #!/usr/bin/env python3
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import print... | mit |
OuterDeepSpace/OuterDeepSpace | libs/server/ige/Scheduler.py | 3 | 6619 | #
# Copyright 2001 - 2007 Ludek Smid [http://www.ospace.net/]
#
# This file is part of Outer Space.
#
# Outer Space 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
# (... | gpl-2.0 |
brianjmiller/TinCanPython | tincan/documents/activity_profile_document.py | 6 | 2456 | # Copyright 2014 Rustici Software
#
# 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... | apache-2.0 |
circleback/sensu-community-plugins | plugins/openstack/neutron/check_neutron-api.py | 49 | 2449 | #!/usr/bin/env python
#
# Check OpenStack Neutron API Status
# ===
#
# Dependencies
# -----------
# - python-neutronclient and related libraries
#
# Performs API query to determine 'alive' status of the
# Neutron API.
#
# Author: Mike Dorman <mdorman@godaddy.com>
# Significantly based on neutron-agent-status.py by
# Br... | mit |
RafaelTorrealba/odoo | addons/mrp_operations/mrp_operations.py | 193 | 27173 | # -*- 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 |
yl565/statsmodels | statsmodels/graphics/_regressionplots_doc.py | 31 | 3795 | _plot_added_variable_doc = """\
Create an added variable plot for a fitted regression model.
Parameters
----------
%(extra_params_doc)sfocus_exog : int or string
The column index of exog, or a variable name, indicating the
variable whose role in the regression is to be assessed.
res... | bsd-3-clause |
pekeler/arangodb | 3rdParty/V8-4.3.61/build/gyp/test/actions/src/subdir1/counter.py | 261 | 1107 | #!/usr/bin/env python
# Copyright (c) 2010 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.
import sys
import time
output = sys.argv[1]
persistoutput = "%s.persist" % sys.argv[1]
count = 0
try:
count = open(persistoutput, 'r').r... | apache-2.0 |
giggsey/SickRage | sickbeard/providers/frenchtorrentdb.py | 7 | 10668 | # Authors: Yannick Croissant <yannick.croissant@gmail.com>
# adaur <adaur.underground@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | gpl-3.0 |
yury-s/v8-inspector | Source/chrome/testing/gtest/test/gtest_xml_test_utils.py | 1815 | 8876 | #!/usr/bin/env python
#
# Copyright 2006, 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 |
jaruba/chromium.src | tools/telemetry/telemetry/image_processing/screen_finder_unittest.py | 12 | 15808 | # 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 copy
import math
import os
import unittest
from telemetry.core import util
from telemetry.util import external_modules
try:
np = external_modules.... | bsd-3-clause |
dongguangming/youtube-dl | youtube_dl/extractor/gamestar.py | 123 | 2627 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
str_to_int,
unified_strdate,
)
class GameStarIE(InfoExtractor):
_VALID_URL = r'http://www\.gamestar\.de/videos/.*,(?P<id>[0-9]+)\.html'
_TEST... | unlicense |
bmbouter/kombu | kombu/tests/async/http/test_curl.py | 8 | 5130 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from kombu.async.http.curl import READ, WRITE, CurlClient
from kombu.tests.case import (
HubCase, Mock, call, patch, case_no_pypy, case_requires, set_module_symbol,
)
@case_no_pypy
@case_requires('pycurl')
class test_CurlClient(HubCase):
class ... | bsd-3-clause |
coolceph/gtest | test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# 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... | bsd-3-clause |
kelvintaywl/tasty.py | recipe/base.py | 1 | 1576 | # -*- coding: utf-8 -*-
class Recipe(object):
INGREDIENTS = {}
COOKING_TIME = 30 # minutes
def __init__(self, portion=1, steps=[], notes=""):
self.portion = portion
self.ingredients = self.__class__.INGREDIENTS
if self.portion > 1:
for key, value in self.ingredients.... | mit |
ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorflow/contrib/learn/python/learn/estimators/estimator.py | 14 | 62939 | # 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... | mit |
grammarly/browser-extensions | generate/lib/validictory/validator.py | 5 | 22200 | import re
import sys
import copy
from datetime import datetime
import warnings
from collections import Mapping, Container
import json
if sys.version_info[0] == 3:
_str_type = str
else:
_str_type = basestring
# if given in properties in a schema, will be used to match against any non-explicit properties found
... | bsd-3-clause |
jonathonwalz/ansible | lib/ansible/plugins/action/wait_for_connection.py | 91 | 4468 | # (c) 2017, Dag Wieers <dag@wieers.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 Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... | gpl-3.0 |
sourabhv/python-koans-solutions | python3/koans/about_exceptions.py | 1 | 1883 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutExceptions(Koan):
class MySpecialError(RuntimeError):
pass
def test_exceptions_inherit_from_exception(self):
mro = self.MySpecialError.mro()
self.assertEqual('RuntimeError', mro[1].__name__)
se... | mit |
Lessig2016/pledgeservice | lib/validictory/validator.py | 11 | 26100 | import re
import sys
import copy
import socket
from datetime import datetime
from decimal import Decimal
from collections import Mapping, Container
if sys.version_info[0] == 3:
_str_type = str
_int_types = (int,)
else:
_str_type = basestring
_int_types = (int, long)
class SchemaError(ValueError):
... | agpl-3.0 |
shlomozippel/ansible | plugins/inventory/cobbler.py | 8 | 4294 | #!/usr/bin/python
"""
Cobbler 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.
To use this,... | gpl-3.0 |
amohanta/thug | src/DOM/Sidebar.py | 9 | 1718 | #!/usr/bin/env python
#
# Sidebar.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; w... | gpl-2.0 |
vipul-sharma20/oh-mainline | mysite/customs/views.py | 15 | 14664 | # This file is part of OpenHatch.
# Copyright (C) 2010, 2011 Jack Grigg
# Copyright (C) 2009 OpenHatch, Inc.
#
# 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 Free Software Foundation, either version 3 of the Lice... | agpl-3.0 |
colinbrislawn/bioconda-recipes | recipes/phylip/phylip.py | 48 | 8900 | #!/usr/bin/env python
#
# Wrapper script for phylip program when installed from
# bioconda. Adapted from shell scripts provided in the biolbuilds
# conda recipe by Cheng H. Lee.
import sys
import os
import subprocess
def main():
print("running main")
print(sys.argv)
bindir = get_script_path(sys.argv[0])
... | mit |
eeshangarg/oh-mainline | mysite/missions/pipvirtualenv/forms.py | 15 | 1104 | # This file is part of OpenHatch.
#
# 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 Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distribut... | agpl-3.0 |
globau/servo | tests/wpt/css-tests/tools/pytest/testing/test_assertion.py | 170 | 19078 | # -*- coding: utf-8 -*-
import sys
import textwrap
import _pytest.assertion as plugin
import _pytest._code
import py
import pytest
from _pytest.assertion import reinterpret
from _pytest.assertion import util
PY3 = sys.version_info >= (3, 0)
@pytest.fixture
def mock_config():
class Config(object):
verbos... | mpl-2.0 |
behnamm/cs244b_project | bindings/python/testutil.py | 20 | 6313 | # Copyright (c) 2010 Stanford University
#
# Permission to use, copy, modify, and distribute this software 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 "AS IS" AND THE AUTHOR(S) DISCLAIM ... | isc |
xutian/avocado-vt | virttest/libvirt_version.py | 4 | 1889 | """
Shared code for tests that need to get the libvirt version
"""
import re
import logging
from avocado.utils import process
from virttest.compat_52lts import decode_to_text
def version_compare(major, minor, update, session=None):
"""
Determine/use the current libvirt library version on the system
and ... | gpl-2.0 |
sony/nnabla | python/src/nnabla/utils/converter/nnabla/importer.py | 1 | 6376 | # Copyright 2018,2019,2020,2021 Sony 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 a... | apache-2.0 |
betrisey/home-assistant | homeassistant/components/sensor/yahoo_finance.py | 1 | 3591 | """
Currency exchange rate support that comes from Yahoo Finance.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.yahoo_finance/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.sensor impor... | mit |
jdf/processing.py | testing/resources/test_loadthings.py | 2 | 1157 | helloworld = loadStrings("strings.txt")
assert helloworld[0] == 'hello'
assert helloworld[1] == 'world'
helloworld = loadStrings(createReader("strings.txt"))
assert helloworld[0] == 'hello'
assert helloworld[1] == 'world'
expected = 'hello\nworld\n'
for i, c in enumerate(loadBytes("strings.txt")):
assert c == ord... | apache-2.0 |
tillahoffmann/tensorflow | tensorflow/python/training/saver_large_partitioned_variable_test.py | 141 | 2261 | # 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 |
martinburchell/econsensus | django/econsensus/publicweb/config.py | 4 | 1857 | #Configuration for django-livesettings.
#http://django-livesettings.readthedocs.org
#pylint: disable=E1102
# '_ is not callable'
from livesettings import config_register, ConfigurationGroup, StringValue, \
BooleanValue, PasswordValue, IntegerValue
from django.utils.translation import ugettext_lazy as _
RECE... | gpl-3.0 |
laysakura/chainer | tests/chainer_tests/functions_tests/activation_tests/test_lstm.py | 16 | 4559 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
def _sigmoid(x):
return 1 / (1 + numpy.exp(-x))
class TestLSTM(unittest.TestC... | mit |
coursemdetw/2014c2 | wsgi/static/reeborg/src/libraries/brython/Lib/subprocess.py | 11 | 16440 | """subprocess - Subprocesses with accessible I/O streams
This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes. This module
intends to replace several other, older modules and functions, like:
os.system
os.spawn*
os.popen*
popen2.*
commands.*
Information... | gpl-2.0 |
craynot/django | tests/gis_tests/geoapp/test_feeds.py | 292 | 4194 | from __future__ import unicode_literals
from xml.dom import minidom
from django.conf import settings
from django.contrib.sites.models import Site
from django.test import (
TestCase, modify_settings, override_settings, skipUnlessDBFeature,
)
from .models import City
@modify_settings(INSTALLED_APPS={'append': 'd... | bsd-3-clause |
jcftang/ansible-modules-extras | monitoring/logicmonitor.py | 21 | 76208 | #!/usr/bin/python
"""LogicMonitor Ansible module for managing Collectors, Hosts and Hostgroups
Copyright (C) 2015 LogicMonitor
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 ver... | gpl-3.0 |
tinchoss/Python_Android | python/src/Lib/idlelib/textView.py | 72 | 3246 | """Simple text browser for IDLE
"""
from Tkinter import *
import tkMessageBox
class TextViewer(Toplevel):
"""A simple text viewer dialog for IDLE
"""
def __init__(self, parent, title, text):
"""Show the given text in a scrollable window with a 'close' button
"""
Toplevel.__init_... | apache-2.0 |
Gurupradeep/Remy-in-ns3 | bindings/python/rad_util.py | 212 | 26013 | # Copyright (c) 2007 RADLogic
#
# 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, modify, merge, publish, distribut... | gpl-2.0 |
baloan/qsocket | test/test_qsocket.py | 1 | 6703 | #!/usr/bin/python3.5
# encoding: utf8
"""qsocket test suite"""
import threading
import multiprocessing as mp
from time import sleep
import unittest
import time
from qsocket import QSocket, Listener, create_qsocket
class Echo(QSocket):
def __init__(self, socket):
QSocket.__init__(self, socket)
def... | mit |
kbrebanov/ansible | lib/ansible/modules/cloud/google/gce.py | 7 | 28171 | #!/usr/bin/python
# Copyright 2013 Google 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
mitocw/edx-platform | common/djangoapps/util/organizations_helpers.py | 4 | 3343 | """
Utility library for working with the edx-organizations app
"""
from django.conf import settings
from django.db.utils import DatabaseError
def add_organization(organization_data):
"""
Client API operation adapter/wrapper
"""
if not organizations_enabled():
return None
from organizatio... | agpl-3.0 |
chjw8016/GreenOdoo7-haibao | openerp/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py | 53 | 2739 | # -*- 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... | mit |
kapamaroo/MPD-plasma-client | contents/code/settings.py | 1 | 2848 | # -*- coding: utf-8 -*-
#
# This file is part of MPD-plasma-client
# MPD-plasma-client it simply mpd-server client written on python
#
# Copyright (C) 2010 Vladimir Krylov <memnek@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public... | gpl-3.0 |
geometalab/osmaxx | tests/conversion/view_test.py | 2 | 4771 | import pytest
from rest_framework.reverse import reverse
from osmaxx.conversion import status
authenticated_access_urls = [
reverse('clipping_area-list'),
reverse('conversion_job-list'),
reverse('conversion_parametrization-list'),
]
@pytest.fixture(params=authenticated_access_urls)
def access_url(reques... | mit |
geome-mitbbs/QTS_Research | Trade_Algo.py | 1 | 7950 | try:
from . import Portfolio
from . import Data_API
from .Quant_Indicators import *
except:
import Portfolio
import Data_API
from Quant_Indicators import *
class Trade_Algo:
def __init__(self,command=None):
self.command = command
if not self.safety_check():
... | mit |
valkyriesavage/invenio | modules/bibexport/lib/bibexport.py | 17 | 5945 | ## -*- mode: python; coding: utf-8; -*-
##
## This file is part of Invenio.
## Copyright (C) 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## Li... | gpl-2.0 |
kriswuollett/grpc | src/python/grpcio_tests/tests/unit/_from_grpc_import_star.py | 38 | 1752 | # Copyright 2016, 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... | bsd-3-clause |
vmax-feihu/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/config.py | 56 | 1420 | # -*- 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... | apache-2.0 |
maxkoryukov/route4me-python-sdk | setup.py | 1 | 2522 | # -*- coding: utf-8 -*-
import os
from setuptools import setup
from setuptools import find_packages
from VERSION import PROJECT
from VERSION import COPYRIGHT
from VERSION import AUTHOR
from VERSION import TITLE
from VERSION import LICENSE
from VERSION import RELEASE_STRING
cwd = os.path.dirname(__file__)
def read_... | isc |
mrquim/mrquimrepo | plugin.video.poseidon/resources/lib/modules/sources.py | 4 | 51579 | # -*- coding: utf-8 -*-
'''
Poseidon Add-on
Copyright (C) 2017 Poseidon
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) a... | gpl-2.0 |
Mu5tank05/Walter | plugins/lastfm.py | 18 | 8457 | from datetime import datetime
import requests
from sqlalchemy import Table, Column, PrimaryKeyConstraint, String
from cloudbot import hook
from cloudbot.util import timeformat, web, database
api_url = "http://ws.audioscrobbler.com/2.0/?format=json"
table = Table(
"lastfm",
database.metadata,
Column('ni... | gpl-3.0 |
pmquang/FuzzLabs | tools/mp3_embed_image.py | 7 | 4620 | #!/usr/bin/python
# ====================================================================================
# apt-get install python-mutagen
# ====================================================================================
# Mutagen has same issues with the save() function or, I just could not figure out
# how to do... | gpl-2.0 |
dmonner/tweater | py/nltk/cluster/kmeans.py | 4 | 7550 | # Natural Language Toolkit: K-Means Clusterer
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
import numpy
import random
from api import *
from util import *
class KMeansClusterer(VectorSpaceClusterer):
"... | gpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.0/Lib/binhex.py | 2 | 13890 | """Macintosh binhex compression/decompression.
easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
"""
#
# Jack Jansen, CWI, August 1995.
#
# The module is supposed to be as compatible as possible. Especially the
# easy interface should work "as expected" on any platform.
# XXX... | mit |
sachitanandpandey/sos_spandey | sos/plugins/mongodb.py | 5 | 1538 | # Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# ... | gpl-2.0 |
Bysmyyr/chromium-crosswalk | tools/telemetry/third_party/gsutilz/third_party/boto/boto/ec2/volumestatus.py | 181 | 6329 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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... | bsd-3-clause |
shsingh/ansible | lib/ansible/modules/system/crypttab.py | 23 | 11164 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Steve <yo@groks.org>
# 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',
... | gpl-3.0 |
synthicity/urbansim | urbansim/utils/sampling.py | 4 | 7852 | import math
import numpy as np
import pandas as pd
def get_probs(data, prob_column=None):
"""
Checks for presence of a probability column and returns the result
as a numpy array. If the probabilities are weights (i.e. they don't
sum to 1), then this will be recalculated.
Parameters
----------... | bsd-3-clause |
bt3gl/Neat-Problems-in-Python-and-Flask | Version-Control/src/metadata.py | 1 | 4151 | #!/usr/bin/env python
__author__ = "Mari Wahl"
__email__ = "marina.w4hl@gmail.com"
__description__= "Builds the metadata for our version control."
import datetime
import sys
import os
import system_operations
from constants import BACKUP_DIR, CONTEND_DIR, OLD_VERSIONS_DIR
"""
print the HEAD file
"""
def pr... | mit |
CSC-ORG/Dynamic-Dashboard-2015 | engine/lib/python2.7/site-packages/django/conf/locale/it/formats.py | 82 | 2094 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
TIME_FO... | mit |
40223135/40223135w17 | static/Brython3.1.1-20150328-091302/Lib/datetime.py | 628 | 75044 | """Concrete date/time and related types.
See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
"""
import time as _time
import math as _math
def _cmp(x, y):
return 0 if x == y else 1 if x > y else -1
MINYEAR = 1
MAXYEAR = 9999
_MAXORDINAL = 3652059 # date.max.toordinal()... | gpl-3.0 |
agrista/odoo-saas | addons/stock_account/res_config.py | 315 | 2277 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
dancingdan/tensorflow | tensorflow/python/kernel_tests/random/multinomial_op_big_test.py | 86 | 3462 | # 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 |
veger/ansible | lib/ansible/modules/storage/netapp/na_ontap_svm_options.py | 59 | 5200 | #!/usr/bin/python
# (c) 2018, NetApp, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
HyperBaton/ansible | lib/ansible/modules/network/dellos9/dellos9_facts.py | 27 | 17598 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# Copyright (c) 2016 Dell 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
ANSIBLE_METADATA = {'metadata_versio... | gpl-3.0 |
dcos/dcos | packages/dcos-integration-test/extra/test_etcd.py | 1 | 1236 | import json
import uuid
import pytest
from dcos_test_utils.enterprise import EnterpriseApiSession
from dcos_test_utils.etcd import EtcdCtl, is_enterprise
class TestEtcdctlOpen:
def test_fetching_members(self, dcos_api_session: EnterpriseApiSession) -> None:
if is_enterprise:
pytest.skip("not ... | apache-2.0 |
hyperized/ansible | lib/ansible/modules/network/aci/mso_schema_template.py | 25 | 6776 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ve... | gpl-3.0 |
tiagochiavericosta/edx-platform | common/djangoapps/student/migrations/0003_auto__add_usertestgroup.py | 188 | 8942 | # encoding: 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 'UserTestGroup'
db.create_table('student_usertestgroup', (
('id', self.gf('django.db.m... | agpl-3.0 |
2014c2g14/2014c2 | w2/static/Brython2.0.0-20140209-164925/Lib/xml/sax/_exceptions.py | 359 | 4785 | """Different kinds of SAX Exceptions"""
import sys
if sys.platform[:4] == "java":
from java.lang import Exception
del sys
# ===== SAXEXCEPTION =====
class SAXException(Exception):
"""Encapsulate an XML error or warning. This class can contain
basic error or warning information from either the XML parser o... | gpl-2.0 |
wildjan/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py | 743 | 1141 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from ... | apache-2.0 |
aleksandra-tarkowska/django | django/db/migrations/autodetector.py | 1 | 45238 | from __future__ import unicode_literals
import re
import datetime
from django.utils import six
from django.db import models
from django.conf import settings
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.questioner import MigrationQuestioner
... | bsd-3-clause |
Immortalin/python-for-android | python3-alpha/python3-src/Lib/distutils/tests/test_check.py | 47 | 3541 | """Tests for distutils.command.check."""
import unittest
from test.support import run_unittest
from distutils.command.check import check, HAS_DOCUTILS
from distutils.tests import support
from distutils.errors import DistutilsSetupError
class CheckTestCase(support.LoggingSilencer,
support.TempdirMa... | apache-2.0 |
hezuoguang/ZGVL | WLServer/site-packages/django/contrib/sessions/backends/base.py | 104 | 10902 | from __future__ import unicode_literals
import base64
from datetime import datetime, timedelta
import logging
import string
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.utils.crypto import constant_time_compare
from django.utils.crypto import get_random_string
fr... | apache-2.0 |
hadesbox/luigi | test/hadoop_test.py | 2 | 11156 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
lihui7115/ChromiumGStreamerBackend | third_party/protobuf/python/google/protobuf/internal/message_test.py | 224 | 22295 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
MicroTrustRepos/microkernel | src/l4/pkg/python/contrib/Lib/idlelib/macosxSupport.py | 2 | 4656 | """
A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application).
"""
import sys
import Tkinter
def runningAsOSXApp():
"""
Returns True if Python is running from within an app on OSX.
If so, assume that Python was built with Aqua Tcl/Tk rather... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.