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 |
|---|---|---|---|---|---|
Spiderlover/Toontown | toontown/toon/GroupPanel.py | 3 | 18185 | from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.nametag import NametagGlobals
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.showbase import DirectObject
from toontown.toon import T... | mit |
CubicERP/odoo | addons/product_margin/__init__.py | 444 | 1092 | # -*- 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... | agpl-3.0 |
coolman565/blu_two | makeMKV/model/enum/line_type.py | 1 | 1040 | from enum import Enum
class Type(Enum):
MSG = 0 # Message output
PRGC = 1 # Current progress title
PRGT = 2 # Total progress title
PRGV = 3 # Progress bar values for current and total progress
DRV = 4 # Drive scan messages
TCOUNT = 5 # Disc information - Title count
CINFO = 6 # Disc... | mit |
scotthartbti/android_external_chromium_org | third_party/bintrees/bintrees/bintree.py | 156 | 4928 | #!/usr/bin/env python
#coding:utf-8
# Author: mozman
# Purpose: binary tree module
# Created: 28.04.2010
# Copyright (c) 2010-2013 by Manfred Moitzi
# License: MIT License
from __future__ import absolute_import
from .treemixin import TreeMixin
__all__ = ['BinaryTree']
class Node(object):
""" Internal object, ... | bsd-3-clause |
josben/django-guardian | guardian/tests/shortcuts_test.py | 37 | 28550 | from __future__ import unicode_literals
import warnings
from django.contrib.contenttypes.models import ContentType
from django.db.models.query import QuerySet
from django.test import TestCase
from guardian.shortcuts import get_perms_for_model
from guardian.core import ObjectPermissionChecker
from guardian.compat imp... | bsd-2-clause |
bl4ckic3/polygraph | polygraph/worm_gen/apache_host.py | 2 | 3070 | # Polygraph (release 0.1)
# Signature generation algorithms for polymorphic worms
#
# Copyright (c) 2004-2005, Intel Corporation
# All Rights Reserved
#
# This software is distributed under the terms of the Eclipse Public
# License, Version 1.0 which can be found in the file named LICENSE.
# ANY ... | epl-1.0 |
yavalvas/yav_com | build/matplotlib/lib/matplotlib/axes/_base.py | 1 | 114520 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import xrange
import itertools
import warnings
import math
from operator import itemgetter
import numpy as np
from numpy import ma
import matplotlib
rcParams = matplotlib.rcParams
... | mit |
adit-chandra/tensorflow | tensorflow/python/data/experimental/kernel_tests/serialization/unbatch_dataset_serialization_test.py | 13 | 2055 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
andela-earinde/bellatrix-py | app/js/lib/lib/modules/distutils/filelist.py | 175 | 12689 | """distutils.filelist
Provides the FileList class, used for poking about the filesystem
and building lists of files.
"""
__revision__ = "$Id$"
import os, re
import fnmatch
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsInternalError
from distutils import log
cl... | mit |
testmana2/profitpy | profit/workbench/centraltabs.py | 18 | 5790 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase
# Distributed under the terms of the GNU General Public License v2
# Author: Troy Melhase <troy@gci.net>
from functools import partial
from sys import platform
from PyQt4.QtCore import Qt
from PyQt4.QtGui import QIcon, QStandardItem
from pr... | gpl-2.0 |
CedricGoby/rpi-capture-webcam | rpi-capture-webcam.py | 1 | 2885 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Description : Capture d'images par webcam et envoi vers une base MySQL
# Licence : GPL-3+
# Langage : Python 2
# Auteur : Cédric Goby
# Versioning : https://github.com/CedricGoby/rpi-capture-webcam
# Importation des modules nécessaires
import sys
import os
import grovep... | gpl-3.0 |
bbbenja/SickRage | lib/unidecode/x0fd.py | 252 | 3764 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | gpl-3.0 |
myfleetingtime/spark2.11_bingo | examples/src/main/python/mllib/standard_scaler_example.py | 95 | 1849 | #
# 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 us... | apache-2.0 |
hkawasaki/kawasaki-aio8-0 | cms/envs/dev_with_worker.py | 148 | 1153 | """
This config file follows the dev enviroment, but adds the
requirement of a celery worker running in the background to process
celery tasks.
The worker can be executed using:
django_admin.py celery worker
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from bas... | agpl-3.0 |
MikeVasmer/GreenGraphCoursework | greengraph/command.py | 1 | 1649 | from argparse import ArgumentParser
from matplotlib import pyplot as plt
from graph import Greengraph
def process():
parser = ArgumentParser(
description="Produce graph quantifying the amount of green land between two locations")
parser.add_argument("--start", nargs="+",
help="... | mit |
littleyang/oh-my-zsh | plugins/git-prompt/gitstatus.py | 343 | 2372 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from subprocess import Popen, PIPE
import re
# change those symbols to whatever you prefer
symbols = {
'ahead of': '↑',
'behind': '↓',
'staged': '♦',
'changed': '‣',
'untracked': '…',
'clean': '⚡',
'unmerged': '≠',
'sha1': ':'
}
output, err... | mit |
alexdglover/shill-isms | venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py | 326 | 6536 | import base64
import io
import json
import zlib
from pip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle, text_type
def _b64_encode_bytes(b):
return base64.b64encode(b).decode("ascii")
def _b64_encode_str(s):
return _b64_encode_bytes(s.encode("utf8"))
def ... | mit |
MungoRae/home-assistant | homeassistant/components/notify/twilio_call.py | 21 | 1977 | """
Twilio Call platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.twilio_call/
"""
import logging
import urllib
import voluptuous as vol
from homeassistant.components.twilio import DATA_TWILIO
import homeassistant.hel... | apache-2.0 |
surdupetru/android_kernel_huawei_g620s | scripts/build-all.py | 236 | 11419 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. 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
# ... | gpl-2.0 |
brijeshkesariya/odoo | addons/l10n_ec/__openerp__.py | 260 | 1695 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010-2012 Cristian Salamea Gnuthink Software Labs Cia. Ltda
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | agpl-3.0 |
liyu1990/tensorflow | tensorflow/g3doc/tutorials/word2vec/word2vec_basic.py | 4 | 7859 | from __future__ import print_function
import tensorflow.python.platform
import collections
import math
import numpy as np
import os
import random
import tensorflow as tf
import urllib
import zipfile
# Step 1: Download the data.
url = 'http://mattmahoney.net/dc/'
def maybe_download(filename, expected_bytes):
"""Dow... | apache-2.0 |
nin042/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py | 122 | 4889 | # Copyright (C) 2011 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 |
GNOME/dasher | Testing/gtest/scripts/fuse_gtest_files.py | 314 | 8813 | #!/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... | gpl-2.0 |
quinot/ansible-modules-core | files/assemble.py | 79 | 8158 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Stephen Fromm <sfromm@gmail.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 Lice... | gpl-3.0 |
SNoiraud/gramps | gramps/gui/filters/sidebar/_sidebarfilter.py | 4 | 9904 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2010 Nick Hall
#
# 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 v... | gpl-2.0 |
wouwei/PiLapse | picam/picamEnv/Lib/site-packages/werkzeug/utils.py | 345 | 22972 | # -*- coding: utf-8 -*-
"""
werkzeug.utils
~~~~~~~~~~~~~~
This module implements various utilities for WSGI applications. Most of
them are used by the request and response wrappers but especially for
middleware development it makes sense to use them without the wrappers.
:copyright: (c) 2014 ... | apache-2.0 |
Spiderlover/Toontown | toontown/catalog/CatalogHouseItem.py | 1 | 2070 | from toontown.catalog.CatalogItem import CatalogItem
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.estate import HouseGlobals
class CatalogHouseItem(CatalogItem):
def makeNewItem(self, houseType):
self.houseType = houseType
CatalogItem.makeN... | mit |
JakeBrand/CMPUT410-E4 | lab4/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/vcs/mercurial.py | 93 | 5817 | import os
import tempfile
import re
import sys
from pip import call_subprocess
from pip.util import display_path, rmtree
from pip.log import logger
from pip.vcs import vcs, VersionControl
from pip.download import path_to_url2
from pip.backwardcompat import ConfigParser
class Mercurial(VersionControl):
name = 'hg'... | apache-2.0 |
ohmini/thaifoodapi | lib/rest_framework/negotiation.py | 20 | 4084 | """
Content negotiation deals with selecting an appropriate renderer given the
incoming request. Typically this will be based on the request's Accept header.
"""
from __future__ import unicode_literals
from django.http import Http404
from rest_framework import HTTP_HEADER_ENCODING, exceptions
from rest_framework.set... | bsd-3-clause |
MontpellierRessourcesImagerie/openmicroscopy | components/tools/OmeroPy/test/unit/clitest/test_download.py | 15 | 1551 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# 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;... | gpl-2.0 |
hickford/youtube-dl | youtube_dl/extractor/xuite.py | 44 | 5378 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
parse_iso8601,
parse_duration,
)
class XuiteIE(InfoExtractor):
IE_DESC = '隨意窩Xuite影音'
_REGEX_BASE... | unlicense |
joopert/home-assistant | tests/components/websocket_api/test_auth.py | 2 | 5798 | """Test auth of websocket API."""
from unittest.mock import patch
from homeassistant.components.websocket_api.const import (
URL,
SIGNAL_WEBSOCKET_CONNECTED,
SIGNAL_WEBSOCKET_DISCONNECTED,
)
from homeassistant.components.websocket_api.auth import (
TYPE_AUTH,
TYPE_AUTH_INVALID,
TYPE_AUTH_OK,
... | apache-2.0 |
SemanticComputing/python-arpa-linker | arpa_linker/arpa.py | 1 | 35935 | """
A module for linking resources to an RDF graph with an [ARPA](https://github.com/jiemakel/arpa) service.
## Requirements<a name="requirements"></a>
Python 3, [RDFLib](http://rdflib.readthedocs.org/en/latest/) and [Requests](http://docs.python-requests.org/en/latest/)
If you want to see a progress bar, you'll need... | mit |
webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/boto/ec2/autoscale/activity.py | 57 | 3059 | # Copyright (c) 2009-2011 Reza Lotun http://reza.lotun.name/
#
# 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, mod... | gpl-2.0 |
succhiello/ansible-playbook-wrapper | ansible_playbook_wrapper/command/play.py | 1 | 1511 | # -*- coding: utf-8 -*-
from __future__ import print_function
import json
import subprocess
from argparse import REMAINDER
import ansible.utils
class PlayCommand(object):
ARGUMENT_INFO = [
(
['-e', '--extra-vars'],
{
'default': '',
'help': 'comm... | mit |
mathstuf/ninja | bootstrap.py | 2 | 2555 | #!/usr/bin/env python
# Copyright 2011 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 |
sss/calibre-at-bzr | src/calibre/gui2/preferences/main.py | 3 | 14070 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import textwrap
from functools import partial
from collections import OrderedDict
from PyQt4.Qt import (QMainWindow, Qt, Q... | gpl-3.0 |
esosn/euler | 47.py | 1 | 1253 | import time
import math
from functions import prime_sieve
from array import array
times = []
times.append(time.clock())
# brute force, generating a list of 4-factors and checking for runs
# or composites and checking the factors was really, really slow :(
runsize = 4
limit = 1000000
primes = prime_sieve(1000)
def ha... | mit |
teltek/edx-platform | openedx/core/djangoapps/user_api/course_tag/api.py | 4 | 3455 | """
A service-like user_info interface. Could be made into an http API later, but for now
just in-process. Exposes global and per-course key-value pairs for users.
Implementation note:
Stores global metadata using the UserPreference model, and per-course metadata using the
UserCourseTag model.
"""
from collections ... | agpl-3.0 |
dsfsdgsbngfggb/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 |
edxzw/edx-platform | common/test/acceptance/tests/studio/test_studio_settings_certificates.py | 24 | 12265 | """
Acceptance tests for Studio's Setting pages
"""
import re
import uuid
from .base_studio_test import StudioCourseTest
from ...pages.studio.settings_certificates import CertificatesPage
from ...pages.studio.settings_advanced import AdvancedSettingsPage
class CertificatesTest(StudioCourseTest):
"""
Tests for... | agpl-3.0 |
jamespacileo/django-france | tests/regressiontests/views/tests/debug.py | 50 | 6467 | import inspect
import sys
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase, RequestFactory
from django.core.urlresolvers import reverse
from django.template import TemplateSyntaxError
from django.views.debug import ExceptionReporter
from r... | bsd-3-clause |
alistairlow/tensorflow | tensorflow/python/grappler/cluster_test.py | 8 | 3424 | # 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 |
smartdata-x/robots | pylib/Twisted/twisted/trial/test/test_pyunitcompat.py | 31 | 8688 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import division, absolute_import
import sys
import traceback
from zope.interface import implementer
from twisted.python.compat import _PY3
from twisted.python.failure import Failure
from twisted.trial.unittest import Synchronous... | apache-2.0 |
tszym/ansible | lib/ansible/modules/cloud/vmware/vsphere_copy.py | 8 | 6193 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2015 Dag Wieers <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_version': '1.0',
... | gpl-3.0 |
uw-it-aca/bridge-sis-provisioner | sis_provisioner/tests/account_managers/test_hrp_bridge.py | 1 | 1308 | from django.test import TransactionTestCase
from sis_provisioner.dao.hrp import get_worker_updates
from sis_provisioner.account_managers.bridge_worker import BridgeWorker
from sis_provisioner.account_managers.hrp_bridge import HrpBridgeLoader
from sis_provisioner.tests import (
fdao_hrp_override, fdao_pws_override,... | apache-2.0 |
aleksandr-bakanov/astropy | astropy/table/tests/test_table.py | 3 | 93707 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import gc
import sys
import copy
from io import StringIO
from collections import OrderedDict
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from astropy.io import fits
from astropy.... | bsd-3-clause |
richard-shepherd/monopyly | tests/test_ten_pound_fine_or_take_a_chance.py | 1 | 1254 | from monopyly import *
from testing_utils import *
def test_ten_pound_fine_or_take_a_chance():
'''
Tests the "Take a £10 fine or take a Chance" card.
'''
# A player who pays the fine...
class PlayerWhoPaysFine(DefaultPlayerAI):
def pay_ten_pounds_or_take_a_chance(self, game_state, player)... | mit |
xiandiancloud/edx-platform | lms/djangoapps/courseware/tests/test_courses.py | 28 | 7744 | # -*- coding: utf-8 -*-
"""
Tests for course access
"""
import mock
from django.test.utils import override_settings
from student.tests.factories import UserFactory
import xmodule.modulestore.django as store_django
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import Module... | agpl-3.0 |
mozilla/zamboni | mkt/websites/management/commands/import_websites_from_csv.py | 4 | 15837 | import collections
import csv
import random
from operator import itemgetter
from optparse import make_option
from os.path import basename, splitext
from django.core.management.base import BaseCommand, CommandError
from django.core.validators import URLValidator, ValidationError
from django.db.transaction import atomic... | bsd-3-clause |
SymbiFlow/sphinxcontrib-session | setup.py | 1 | 1365 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = (
open(os.path.join(here, 'README.rst')).read()
)
install_requires = [
'Sphinx',
'pygments',
]
setup_requires = [
]
tests_require = [
]
setup(
... | apache-2.0 |
wfxiang08/Nuitka | nuitka/codegen/ModuleCodes.py | 1 | 5346 | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | apache-2.0 |
vikas-parashar/zulip | zerver/tests/test_urls.py | 27 | 1474 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import django.core.urlresolvers
from django.test import TestCase
import importlib
from zproject import urls
class URLResolutionTest(TestCase):
def check_function_exists(self, module_name, view):
# type: (s... | apache-2.0 |
Intel-Corporation/tensorflow | tensorflow/contrib/distributions/python/ops/wishart.py | 15 | 27943 | # 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 |
jyotsna1820/django | django/http/request.py | 49 | 20098 | from __future__ import unicode_literals
import copy
import os
import re
import sys
from io import BytesIO
from itertools import chain
from pprint import pformat
from django.conf import settings
from django.core import signing
from django.core.exceptions import DisallowedHost, ImproperlyConfigured
from django.core.fil... | bsd-3-clause |
yury-s/v8-inspector | Source/chrome/tools/telemetry/telemetry/internal/actions/tap.py | 29 | 2694 | # Copyright 2013 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 os
from telemetry.internal.actions import page_action
class TapAction(page_action.PageAction):
def __init__(self, selector=None, text=None, eleme... | bsd-3-clause |
rworkman/blueman | blueman/plugins/manager/Notes.py | 1 | 1894 | import datetime
from gettext import bind_textdomain_codeset
from tempfile import NamedTemporaryFile
from blueman.Functions import create_menuitem, launch, UI_PATH
from blueman.plugins.ManagerPlugin import ManagerPlugin
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
def send_note_cb(dialog,... | gpl-3.0 |
brianhornsby/script.similartracks | resources/lib/kodisettings.py | 1 | 2008 | #/*
# *
# * SimilarTracks for Kodi.
# *
# * Copyright (C) 2015 Brian Hornsby
# *
# * 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) an... | gpl-3.0 |
agry/NGECore2 | scripts/mobiles/dathomir/nightsister_sentry.py | 2 | 2020 | 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 |
brotich/CP2-bucket-list-api | migrations/env.py | 557 | 2883 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config ... | mit |
linsalrob/PyFBA | PyFBA/gapfill/roles.py | 2 | 1970 | import sys
import PyFBA
def suggest_from_roles(roles_file, reactions, threshold=0, verbose=False):
"""
Identify a set of reactions that we should add based on a roles file.
We assume that the roles file has the format: [role, probability] separated by tabs. We make no assumption about
where you got ... | mit |
csutherl/sos | sos/plugins/apparmor.py | 12 | 1415 | # Copyright (c) 2012 Adam Stokes <adam.stokes@canonical.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.
# This pro... | gpl-2.0 |
Timmenem/micropython | tests/thread/stress_aes.py | 26 | 8843 | # Stress test for threads using AES encryption routines.
#
# AES was chosen because it is integer based and inplace so doesn't use the
# heap. It is therefore a good test of raw performance and correctness of the
# VM/runtime. It can be used to measure threading performance (concurrency is
# in principle possible) an... | mit |
camilortte/RecomendadorUD | apps/externals/recommends/management/commands/recommends_precompute.py | 3 | 1706 | from django.core.management.base import BaseCommand
from recommends.tasks import recommends_precompute
from datetime import datetime
import dateutil.relativedelta
from optparse import make_option
import warnings
class Command(BaseCommand):
help = 'Calculate recommendations and similarities based on ratings'
... | mit |
haveal/googleads-python-lib | examples/adwords/v201506/remarketing/add_audience.py | 4 | 3357 | #!/usr/bin/python
#
# 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 b... | apache-2.0 |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/scipy/optimize/_basinhopping.py | 17 | 26053 | """
basinhopping: The basinhopping global optimization algorithm
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import cos, sin
import scipy.optimize
import collections
__all__ = ['basinhopping']
class Storage(object):
"""
Class used to store the lowest en... | mit |
shepdelacreme/ansible | lib/ansible/modules/cloud/amazon/rds_snapshot_facts.py | 32 | 12499 | #!/usr/bin/python
# Copyright (c) 2014-2017 Ansible Project
# Copyright (c) 2017, 2018 Will Thames
# Copyright (c) 2017, 2018 Michael De La Rue
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'co... | gpl-3.0 |
sudheesh001/oh-mainline | vendor/packages/html5lib/html5lib/treewalkers/soup.py | 106 | 2423 | import re
import gettext
_ = gettext.gettext
from BeautifulSoup import BeautifulSoup, Declaration, Comment, Tag
from html5lib.constants import namespaces
import _base
class TreeWalker(_base.NonRecursiveTreeWalker):
doctype_regexp = re.compile(
r'DOCTYPE\s+(?P<name>[^\s]*)(\s*PUBLIC\s*"(?P<publicId>.*)"\s*... | agpl-3.0 |
Geoportail-Luxembourg/qgis-pag-plugin | widgets/about/about_dialog.py | 1 | 2723 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
CreateProjectDialog
A QGIS plugin
Gestion de Plans d'Aménagement Général du Grand-Duché de Luxembourg
-------------------
begin ... | mit |
HarborYuan/cashier | env/Lib/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py | 1776 | 6840 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
kwilliams-mo/iris | docs/iris/src/sphinxext/generate_package_rst.py | 2 | 7208 | # (C) British Crown Copyright 2010 - 2013, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
ehirt/odoo | addons/stock/wizard/make_procurement_product.py | 29 | 6099 | # -*- 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 |
Lh4cKg/sl4a | python/src/Lib/plat-beos5/IN.py | 74 | 8406 | # Generated by h2py from /boot/develop/headers/be/net/netinet/in.h
# Included from socket.h
# Included from BeBuild.h
B_BEOS_VERSION_4 = 0x0400
B_BEOS_VERSION_4_5 = 0x0450
B_BEOS_VERSION_5 = 0x0500
B_BEOS_VERSION = B_BEOS_VERSION_5
B_BEOS_VERSION_MAUI = B_BEOS_VERSION_5
_PR2_COMPATIBLE_ = 1
_PR3_COMPATIBLE_ = 1
_R4_C... | apache-2.0 |
strk/QGIS | tests/src/python/test_qgszonalstatistics.py | 34 | 5614 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsZonalStatistics.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
""... | gpl-2.0 |
simongibbons/numpy | numpy/ma/tests/test_mrecords.py | 12 | 19870 | # pylint: disable-msg=W0611, W0612, W0511,R0201
"""Tests suite for mrecords.
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
"""
import numpy as np
import numpy.ma as ma
from numpy import recarray
from numpy.ma import masked, nomask
from numpy.testing import temppath
from numpy.core.records import (... | bsd-3-clause |
liberorbis/libernext | env/lib/python2.7/site-packages/kombu/transport/__init__.py | 15 | 3713 | """
kombu.transport
===============
Built-in transports.
"""
from __future__ import absolute_import
from kombu.five import string_t
from kombu.syn import _detect_environment
from kombu.utils import symbol_by_name
def supports_librabbitmq():
if _detect_environment() == 'default':
try:
import... | gpl-2.0 |
atosatto/ansible | lib/ansible/plugins/shell/powershell.py | 26 | 46097 | # (c) 2014, Chris Church <chris@ninemoreminutes.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 lat... | gpl-3.0 |
Fusion-Rom/android_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/thirdparty/coverage/xmlreport.py | 67 | 5682 | """XML reporting for coverage.py"""
import os, sys, time
import xml.dom.minidom
from coverage import __url__, __version__
from coverage.backward import sorted # pylint: disable=W0622
from coverage.report import Reporter
def rate(hit, num):
"""Return the fraction of `hit`/`num`, as a string."""
ret... | bsd-3-clause |
mationic/pyload | module/plugins/accounts/NowVideoSx.py | 6 | 1576 | # -*- coding: utf-8 -*-
import re
import time
from module.plugins.internal.Account import Account
class NowVideoSx(Account):
__name__ = "NowVideoSx"
__type__ = "account"
__version__ = "0.06"
__status__ = "testing"
__description__ = """NowVideo.at account plugin"""
__license__ = "... | gpl-3.0 |
ApuliaSoftware/odoo | addons/l10n_hn/__openerp__.py | 343 | 2260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009-2010 Salvatore Josué Trimarchi Pinto <salvatore@trigluu.com>
# (http://trigluu.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | agpl-3.0 |
janewangfb/spark | python/pyspark/sql/utils.py | 50 | 4000 | #
# 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 us... | apache-2.0 |
GinnyN/towerofdimensions-django | tests/modeltests/validation/test_unique.py | 26 | 5935 | from __future__ import with_statement, absolute_import
import datetime
from django.core.exceptions import ValidationError
from django.test import TestCase
from django.utils import unittest
from .models import (CustomPKModel, UniqueTogetherModel, UniqueFieldsModel,
UniqueForDateModel, ModelToValidate, Post, Flexi... | bsd-3-clause |
tibnor/kartverket2osm | src/removeExcessiveNodes.py | 1 | 1516 | import sys
from nodes2nodeList import nodes2nodeList
from offsetDistance import openOsm,getOffsetDistance
from math import fabs
def removeExcessiveNodes(fileName, fileNameOut,cutoffDistance):
f = openOsm(fileName)
nodes = nodes2nodeList(f.findall("node"))
ways = f.findall("way")
removeNodes = {}
... | gpl-2.0 |
MQQiang/kbengine | kbe/src/lib/python/Lib/idlelib/ObjectBrowser.py | 86 | 3975 | # XXX TO DO:
# - popup menu
# - support partial or total redisplay
# - more doc strings
# - tooltips
# object browser
# XXX TO DO:
# - for classes/modules, add "open source" to object browser
import re
from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas
from reprlib import Repr
myrepr = Repr()
myrep... | lgpl-3.0 |
google/skia | tools/skp/page_sets/skia_mozilla_tablet.py | 8 | 1173 | # 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.
# pylint: disable=W0401,W0614
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
clas... | bsd-3-clause |
FusionSP/external_chromium_org_third_party_skia | gm/rebaseline_server/results_test.py | 89 | 2848 | #!/usr/bin/python
"""
Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Test results.py
"""
# Imports from within Skia
import base_unittest
import results
class ResultsTest(base_unittest.TestCase):
def test_ignore_builder(self):
""... | bsd-3-clause |
Maximilian-Reuter/SickRage-1 | lib/validators/i18n/fi.py | 28 | 2214 | import re
from validators.utils import validator
business_id_pattern = re.compile(r'^[0-9]{7}-[0-9]$')
ssn_checkmarks = '0123456789ABCDEFHJKLMNPRSTUVWXY'
ssn_pattern = re.compile(
r"""^
(?P<date>([0-2]\d|3[01])
(0\d|1[012])
(\d{{2}}))
[A+-]
(?P<serial>(\d{{3}}))
(?P<checksum>[{checkmarks}]... | gpl-3.0 |
ncos/checkq | tflow_model.py | 1 | 2879 | #!/usr/bin/python
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
import cv2
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
sess = tf.InteractiveSession()
def draw_batches(batches):
for i, batch in enumerate(batches):
cv2.namedWindow... | mit |
stackdio/stackdio-python-client | stackdio/client/image.py | 2 | 1479 | # -*- coding: utf-8 -*-
# Copyright 2014, Digital Reasoning
#
# 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 |
dr0pz0ne/sibble | test/units/utils/test_shlex.py | 174 | 1291 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 vers... | gpl-3.0 |
willdavidc/piel | catkin_ws/src/piel/scripts/venv/lib/python2.7/site-packages/pip/vcs/subversion.py | 343 | 9350 | from __future__ import absolute_import
import logging
import os
import re
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.index import Link
from pip.utils import rmtree, display_path
from pip.utils.logging import indent_log
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile... | mit |
klonage/nlt-gcs | Lib/calendar.py | 53 | 23815 | """Calendar printing functions
Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday)."""
import sys
i... | gpl-3.0 |
django-nonrel/django-nonrel | django/views/generic/list_detail.py | 229 | 5577 | from django.template import loader, RequestContext
from django.http import Http404, HttpResponse
from django.core.xheaders import populate_xheaders
from django.core.paginator import Paginator, InvalidPage
from django.core.exceptions import ObjectDoesNotExist
import warnings
warnings.warn(
'Function-based generic v... | bsd-3-clause |
loongson-community/EFI-MIPS | ToolKit/cmds/python/Lib/test/test_zipfile.py | 15 | 3605 | # We can test part of the module without zlib.
try:
import zlib
except ImportError:
zlib = None
import zipfile, os, unittest
from StringIO import StringIO
from tempfile import TemporaryFile
from test.test_support import TESTFN, run_unittest
TESTFN2 = TESTFN + "2"
class TestsWithSourceFile(unittest.TestCase... | bsd-3-clause |
Djabbz/scikit-learn | sklearn/feature_extraction/image.py | 263 | 17600 | """
The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to
extract features from images.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Olivier Grisel
# Vlad Niculae
# License: BSD 3 clause
fro... | bsd-3-clause |
gram526/VTK | IO/NetCDF/Testing/Python/NetCDFCFSphericalCoords.py | 20 | 1675 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# This test checks netCDF reader. It uses the CF convention.
# Open the file.
reader = vtk.vtkNetCDFCFReader()
reader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/tos_O1_2001-2002.nc... | bsd-3-clause |
JohnathonNow/fbchat | fbchat/client.py | 2 | 20548 | # -*- coding: UTF-8 -*-
"""
fbchat
~~~~~~
Facebook Chat (Messenger) for Python
:copyright: (c) 2015 by Taehoon Kim.
:copyright: (c) 2015-2016 by PidgeyL.
:license: BSD, see LICENSE for more details.
"""
import requests
import json
from uuid import uuid1
from random import random, choice... | bsd-3-clause |
80vs90/libsaas | libsaas/services/recurly/coupons.py | 4 | 1102 | from libsaas import http, parsers
from libsaas.services import base
from . import resource
class CouponsBase(resource.RecurlyResource):
path = 'coupons'
def update(self, *args, **kwargs):
raise base.MethodNotSupported()
class Coupons(CouponsBase):
def delete(self, *args, **kwargs):
r... | mit |
tux-00/ansible | test/units/contrib/inventory/test_vmware_inventory.py | 20 | 3493 | import json
import os
import pickle
import unittest
import sys
try:
from vmware_inventory import VMWareInventory
except ImportError:
from nose.plugins.skip import SkipTest
raise SkipTest("test_vmware_inventory.py requires the python module 'vmware_inventory'")
# contrib's dirstruct doesn't contain __init_... | gpl-3.0 |
Cue/eventlet | eventlet/twistedutil/protocol.py | 15 | 13149 | """Basic twisted protocols converted to synchronous mode"""
import sys
from twisted.internet.protocol import Protocol as twistedProtocol
from twisted.internet.error import ConnectionDone
from twisted.internet.protocol import Factory, ClientFactory
from twisted.internet import main
from twisted.python import failure
fr... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.