repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
shikigit/python-phonenumbers | python/tests/testdata/region_AE.py | 7 | 1416 | """Auto-generated file, do not edit by hand. AE metadata"""
from phonenumbers.phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AE = PhoneMetadata(id='AE', country_code=971, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{8}', possible_number... | apache-2.0 |
riodel27/Delta-Rail | node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py | 2736 | 1804 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
class Writer(object):
"""Visual Studio XML tool file writer."""
... | mit |
SlicerRt/SlicerDebuggingTools | PyDevRemoteDebug/ptvsd-4.1.3/ptvsd/_local.py | 1 | 4791 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
import sys
import time
import pydevd
from _pydevd_bundle.pydevd_comm import get_global_debugger
from ptvsd.pydevd_hooks import install
from ptvsd.runner ... | bsd-3-clause |
CallaJun/hackprince | indico/matplotlib/tests/test_style.py | 10 | 1977 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import shutil
import tempfile
from contextlib import contextmanager
import matplotlib as mpl
from matplotlib import style
from matplotlib.style.core import USER_LIBRARY_PATHS, STYLE_EXTENSION
import... | lgpl-3.0 |
shikil/sympy | bin/coverage_doctest.py | 83 | 21410 | #!/usr/bin/env python
"""
Program to test that all methods/functions have at least one example
doctest. Also checks if docstrings are imported into Sphinx. For this to
work, the Sphinx docs need to be built first. Use "cd doc; make html" to
build the Sphinx docs.
Usage:
./bin/coverage_doctest.py sympy/core
or
./... | bsd-3-clause |
myarjunar/QGIS | python/plugins/db_manager/db_plugins/spatialite/info_model.py | 71 | 2411 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
tcatut/plugin.video.youtube | resources/lib/kodion/impl/mock/mock_runner.py | 33 | 1202 | __author__ = 'bromix'
from ..abstract_provider_runner import AbstractProviderRunner
from ... import constants
from ...items import *
from ...logging import *
from ...exceptions import KodionException
class MockRunner(AbstractProviderRunner):
def __init__(self):
AbstractProviderRunner.__init__(self)
... | gpl-2.0 |
raluca-elena/empathy-cheese | tools/make-release-mail.py | 8 | 2426 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
#
# Hello. This is make-release-mail.py from the Telepathy project. It's
# designed to turn an item from a NEWS file into a mail suitable for sending
# to <telepathy@lists.freedesktop.org>. I hope that you enjoy your stay.
import sys
def extract_description(packag... | gpl-2.0 |
neutrinog/Comperio | media/ckeditor/filemanager/connectors/py/zope.py | 131 | 5685 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | bsd-3-clause |
sdague/home-assistant | homeassistant/components/gree/climate.py | 5 | 12203 | """Support for interface with a Gree climate systems."""
from datetime import timedelta
import logging
from typing import List
from greeclimate.device import (
FanSpeed,
HorizontalSwing,
Mode,
TemperatureUnits,
VerticalSwing,
)
from greeclimate.exceptions import DeviceTimeoutError
from homeassista... | apache-2.0 |
EmreAtes/spack | var/spack/repos/builtin/packages/rename/package.py | 5 | 1872 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
blablack/midimsg-lv2 | waflib/extras/proc.py | 56 | 1725 | #! /usr/bin/env python
# per rosengren 2011
from os import environ, path
from waflib import TaskGen, Utils
def options(opt):
grp = opt.add_option_group('Oracle ProC Options')
grp.add_option('--oracle_home', action='store', default=environ.get('PROC_ORACLE'), help='Path to Oracle installation home (has bin/lib)')
g... | gpl-3.0 |
hynnet/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/encodings/cp1026.py | 593 | 13369 | """ Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.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,inp... | gpl-2.0 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/tests/unit/cloudsearch2/test_document.py | 114 | 12068 | #!/usr/bin env python
from boto.cloudsearch2.domain import Domain
from boto.cloudsearch2.layer1 import CloudSearchConnection
from tests.unit import unittest, AWSMockServiceTestCase
from httpretty import HTTPretty
from mock import MagicMock
import json
from boto.cloudsearch2.document import DocumentServiceConnection
... | apache-2.0 |
TheWardoctor/Wardoctors-repo | script.module.covenant/lib/resources/lib/indexers/channels.py | 6 | 11566 | # -*- coding: utf-8 -*-
'''
Covenant Add-on
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 prog... | apache-2.0 |
ProfessorX/CIS508 | Codes/xen-4.3.1/tools/python/xen/xend/server/pciquirk.py | 42 | 6000 | from xen.xend.XendLogging import log
from xen.xend.XendError import XendError, VmError
import sys
import os.path
from xen.xend.sxp import *
from xen.util import auxbin
QUIRK_SYSFS_NODE = "/sys/bus/pci/drivers/pciback/quirks"
QUIRK_CONFIG_FILE = auxbin.xen_configdir() + "/xend-pci-quirks.sxp"
PERMISSIVE_CONFIG_FILE = a... | gpl-2.0 |
saisankargochhayat/algo_quest | leetcode/1423. Maximum Points You Can Obtain from Cards/soln.py | 1 | 1199 | # Get prefix sum array, find n-k window for which n-k is minimum.
class Solution:
def maxScore(self, cardPoints: List[int], k: int) -> int:
n = len(cardPoints)
pSum = [0] * n
pSum[0] = cardPoints[0]
for i in range(1, n):
pSum[i] = cardPoints[i] + pSum[i-1]
... | apache-2.0 |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/scipy/io/matlab/tests/test_byteordercodes.py | 126 | 1044 | ''' Tests for byteorder module '''
from __future__ import division, print_function, absolute_import
import sys
from numpy.testing import assert_raises, assert_, run_module_suite
import scipy.io.matlab.byteordercodes as sibc
def test_native():
native_is_le = sys.byteorder == 'little'
assert_(sibc.sys_is_le... | mit |
ychfan/tensorflow | tensorflow/contrib/saved_model/python/saved_model/__init__.py | 109 | 1191 | # 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 |
manish211/mase | src/stockflow.py | 9 | 2560 | from __future__ import print_function, division
import sys
sys.dont_write_bytecode = True
from ok import *
import random
r = random.random
isa = isinstance
"""
# Compartmental Modeling
## Diapers
q +-----+ r +-----+
---->| C |---->| D |--> s
^ +-----+ +-+---+
| |
+-------------... | unlicense |
ericholscher/django | tests/queryset_pickle/tests.py | 4 | 4052 | from __future__ import unicode_literals
import pickle
import datetime
from django.db import models
from django.test import TestCase
from .models import Group, Event, Happening, Container, M2MModel
class PickleabilityTestCase(TestCase):
def setUp(self):
Happening.objects.create() # make sure the default... | bsd-3-clause |
nitzmahone/ansible | lib/ansible/modules/network/avi/avi_alertconfig.py | 31 | 12195 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
termie/nova-migration-demo | nova/tests/test_localization.py | 7 | 4188 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 OpenStack 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... | apache-2.0 |
crazyAxe/tp-libvirt | libguestfs/tests/virt_part_operations.py | 4 | 6254 | import re
import os
import logging
import commands
import aexpect
from autotest.client.shared import error
from autotest.client.shared import utils
from virttest import virt_vm
from virttest import data_dir
from virttest import remote
from virttest import utils_test
from virttest import utils_misc
def test_unforma... | gpl-2.0 |
eLBati/odoo | addons/mrp/report/workcenter_load.py | 437 | 9126 | # -*- 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 |
ben-hopps/nupic | examples/opf/experiments/multistep/base/permutations_simple_3.py | 35 | 4155 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | agpl-3.0 |
mou4e/zirconium | tools/telemetry/telemetry/core/memory_cache_http_server.py | 24 | 9307 | # Copyright 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 BaseHTTPServer
from collections import namedtuple
import errno
import gzip
import mimetypes
import os
import SimpleHTTPServer
import socket
import Soc... | bsd-3-clause |
viger/docker | proxy/proxy/code/default/python27/1.0/lib/socket.py | 24 | 20615 | # Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... | mit |
Phantasus/intelmq | intelmq/bots/parsers/certeu/malicious-urls-parser.py | 5 | 1541 | from intelmq.lib.bot import Bot, sys
from intelmq.lib.message import Event
from intelmq.bots import utils
class CERTEUMaliciousURLsParserBot(Bot):
def process(self):
report = self.receive_message()
if report:
for row in report.split('\n'):
... | agpl-3.0 |
robintw/Py6S | tests/test_profiles.py | 1 | 19426 | # This file is part of Py6S.
#
# Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file.
#
# Py6S 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, o... | lgpl-3.0 |
johnnoone/json-spec | tests/test_commands.py | 1 | 4664 | """
tests.tests_cli
~~~~~~~~~~~~~~~
"""
import pytest
from subprocess import Popen, PIPE
from jsonspec import cli
import json
from . import move_cwd
def runner(cmd, args, success, result):
try:
args = cmd.parse_args(args)
response = cmd(args)
if not success:
raise Exc... | bsd-3-clause |
vbextreme/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/charsetprober.py | 3127 | 1902 | ######################## 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... | lgpl-2.1 |
mxOBS/deb-pkg_trusty_chromium-browser | native_client/pnacl/driver/shelltools.py | 8 | 2070 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client 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 driver_log import Log
import types
######################################################################
#
# Shell Utiliti... | bsd-3-clause |
Wojtechnology/Muzit | StreetMuse/lib/python2.7/site-packages/pip/commands/install.py | 23 | 15982 | from __future__ import absolute_import
import logging
import operator
import os
import tempfile
import shutil
import warnings
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.locations import build_prefix, virtualenv_no_global, distutils_scheme
from pip.basecommand import Command
fr... | apache-2.0 |
tjanez/ansible | lib/ansible/modules/database/postgresql/postgresql_user.py | 16 | 29093 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
janusnic/dj-21v | unit_13/mysite/userprofiles/models.py | 6 | 1261 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
import os.path
from django.contrib.auth.models import User
from django.db.models.signals import post_save
def get_image_path(instance, filename):
return os.path.join('avatars', str(instance.id), filename)
# Create your mode... | mit |
andymason/istheansweryes | lib/werkzeug/local.py | 310 | 14094 | # -*- coding: utf-8 -*-
"""
werkzeug.local
~~~~~~~~~~~~~~
This module implements context-local objects.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrapper
from werkzeug.wsgi import ClosingIt... | apache-2.0 |
pandeyop/rally | tests/unit/test_api.py | 2 | 15566 | # Copyright 2013: Mirantis 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 |
GodBlessPP/W17test_2nd_1 | static/Brython3.1.1-20150328-091302/Lib/xml/sax/xmlreader.py | 824 | 12612 | """An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. """
from . import handler
from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException
# ===== XMLREADER =====
class XMLReader:
"""Interface for reading an XML document using callbacks.
XMLReade... | gpl-3.0 |
keishi/chromium | third_party/tlslite/tlslite/integration/IMAP4_TLS.py | 87 | 5132 | """TLS Lite + imaplib."""
import socket
from imaplib import IMAP4
from tlslite.TLSConnection import TLSConnection
from tlslite.integration.ClientHelper import ClientHelper
# IMAP TLS PORT
IMAP4_TLS_PORT = 993
class IMAP4_TLS(IMAP4, ClientHelper):
"""This class extends L{imaplib.IMAP4} with TLS support."""
d... | bsd-3-clause |
mixman/djangodev | django/core/urlresolvers.py | 2 | 20163 | """
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
import re
from threading import local
from django.http import Http40... | bsd-3-clause |
AustinRoy7/Pomodoro-timer | venv/Lib/site-packages/pip/_vendor/distlib/database.py | 129 | 49671 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""PEP 376 implementation."""
from __future__ import unicode_literals
import base64
import codecs
import contextlib
import hashlib
import logging
import os
import posixpath
import sys
import z... | mit |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_elements/creation.py | 1 | 1903 | """
Boolean geometry utilities.
"""
from __future__ import absolute_import
from fabmetheus_utilities.geometry.geometry_utilities import evaluate
from fabmetheus_utilities import archive
__author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
__credits__ = 'Art of Illusion <http://www.artofillusion.org/>'
__date__ =... | agpl-3.0 |
asajeffrey/servo | tests/wpt/web-platform-tests/tools/ci/run_tc.py | 3 | 15963 | #!/usr/bin/env python
"""Wrapper script for running jobs in Taskcluster
This is intended for running test jobs in Taskcluster. The script
takes a two positional arguments which are the name of the test job
and the script to actually run.
The name of the test job is used to determine whether the script should be run
... | mpl-2.0 |
olenz/espresso | src/core/gen_featureconfig.py | 15 | 3808 | # Copyright (C) 2013,2014 The ESPResSo project
# Copyright (C) 2012 Olaf Lenz
#
# This file is part of ESPResSo.
#
# ESPResSo 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... | gpl-3.0 |
gppg1994/Machine_Learning | Mail_Check/Main.py | 1 | 1521 | '''This automation helps you to automatically sign in to yahoo mail
without a single mouse/keyboard stroke. To run this piece of code successfully,
you need to have an existing yahoo account'''
from selenium import webdriver
import time
from Configure import Configure
def if_exists(idstr):
try:
el... | gpl-3.0 |
lucdom/xCrawler | xcrawler/http/urls/url_splitter.py | 2 | 1036 |
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
class UrlSplitter(object):
"""Splits an url into smaller parts.
"""
def __init__(self):
pass
def parse_url(self, url):
parsed_url = urlparse(url)
return parsed_url
def get_p... | gpl-2.0 |
anybox/anybox.recipe.odoo | anybox/recipe/odoo/vcs/tests/test_bzr.py | 1 | 21368 | """VCS tests: Bazaar."""
import os
import subprocess
from zc.buildout import UserError
from ..testing import COMMIT_USER_FULL
from ..testing import VcsTestCase
from ..bzr import BzrBranch
from ..bzr import working_directory_keeper
from ..base import UpdateError
from ..base import CloneError
class BzrBaseTestCase(Vcs... | agpl-3.0 |
spencerjanssen/Flexget | tests/test_content_size.py | 21 | 4079 | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase, with_filecopy
class TestTorrentSize(FlexGetBase):
__yaml__ = """
tasks:
test_min:
mock:
- {title: 'test', file: 'test_min.torrent'}
accept_all: yes
... | mit |
jmcarp/django | django/core/cache/backends/locmem.py | 586 | 4287 | "Thread-safe in-memory cache backend."
import time
from contextlib import contextmanager
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.utils.synch import RWLock
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
# Global in-memor... | bsd-3-clause |
PXke/invenio | invenio/modules/tickets/testsuite/test_system_rt.py | 4 | 2576 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 2013 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
## License, or (at your opt... | gpl-2.0 |
rex-xxx/mt6572_x201 | external/antlr/antlr-3.4/runtime/Python/tests/t006lexer.py | 17 | 1762 | import antlr3
import testbase
import unittest
class t006lexer(testbase.ANTLRTest):
def setUp(self):
self.compileGrammar()
def lexerClass(self, base):
class TLexer(base):
def emitErrorMessage(self, msg):
# report errors to /dev/null
p... | gpl-2.0 |
ep1cman/workload-automation | wlauto/result_processors/sqlite.py | 9 | 7395 | # Copyright 2013-2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | apache-2.0 |
ulfalizer/Kconfiglib | examples/find_symbol.py | 1 | 3437 | # Prints all menu nodes that reference a given symbol any of their properties
# or property conditions, along with their parent menu nodes.
#
# Usage:
#
# $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/examples/find_symbol.py SCRIPT_ARG=<name>
#
# Example output for SCRIPT_ARG=X86:
#
# Found 470 locations that... | isc |
elingg/tensorflow | tensorflow/python/training/rmsprop.py | 30 | 6746 | # 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 |
otherness-space/myProject002 | my_project_002/lib/python2.7/site-packages/django/core/files/uploadhandler.py | 19 | 7259 | """
Base file upload handler classes, and the built-in concrete subclasses
"""
from __future__ import unicode_literals
from io import BytesIO
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.uploadedfile import TemporaryUploadedFile, InMemoryUploadedFile... | mit |
wdsgyj/google-breakpad-mirror | src/third_party/protobuf/protobuf/gtest/test/gtest_output_test.py | 227 | 11601 | #!/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 |
ampax/edx-platform | lms/djangoapps/course_wiki/settings.py | 260 | 1247 | """
These callables are used by django-wiki to check various permissions
a user has on an article.
"""
from course_wiki.utils import user_is_article_course_staff
def CAN_DELETE(article, user): # pylint: disable=invalid-name
"""Is user allowed to soft-delete article?"""
return _is_staff_for_article(article, ... | agpl-3.0 |
LazoCoder/Pokemon-Terminal | tests/test_broken.py | 1 | 1183 | #!/usr/bin/env python3
# To run the tests, use: python3 -m pytest --capture=sys
from pokemonterminal.database import Database
from tests.test_utils import expected_len
def broken_test_extra_length(region_name='extra'):
assert len(Database().get_extra()) == expected_len(region_name)
def broken_test_kanto_lengt... | gpl-3.0 |
timj/scons | test/MSVS/vs-7.1-clean.py | 5 | 3586 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... | mit |
CFIS-Octarine/octarine | src/daomop/wcs.py | 1 | 12869 | import warnings
from copy import deepcopy
from astropy.units import Quantity
import math
from astropy import wcs as astropy_wcs
from astropy import units
import numpy
import logging
__author__ = "David Rusk <drusk@uvic.ca>"
PI180 = 57.2957795130823208767981548141052
class WCS(astropy_wcs.WCS):
def __init__(self, ... | gpl-3.0 |
wilsoc5/pywinauto | pywinauto/unittests/test_findwindows.py | 19 | 2644 | # GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# 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... | lgpl-2.1 |
afrubin/FQRead | docs/conf.py | 1 | 8421 | # -*- coding: utf-8 -*-
#
# FQRead documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 6 13:49:02 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | mit |
googleapis/java-bigquery | synth.py | 1 | 1127 | # Copyright 2019 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 agreed to in writing, s... | apache-2.0 |
DominoTree/servo | tests/wpt/web-platform-tests/webdriver/tests/execute_async_script/execute_async.py | 22 | 1774 | import pytest
from webdriver.transport import Response
from tests.support.asserts import assert_error, assert_success
def execute_async_script(session, script, args=None):
if args is None:
args = []
body = {"script": script, "args": args}
return session.transport.send(
"POST", "/session... | mpl-2.0 |
anurag-ks/eden | modules/ClimateDataPortal/add_table.py | 53 | 1568 |
ClimateDataPortal = local_import("ClimateDataPortal")
def show_usage():
sys.stderr.write("""Usage:
%(command)s sample_type parameter_name units field_type date_mapping gridsize
parameter_name: a unique name for the table e.g. "Rainfall" "Max Temp"
field_type: any postgres numeric field type e.g. real... | mit |
fengxiaoiie/volatility | volatility/plugins/privileges.py | 12 | 8306 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2012, 2013 Cem Gurkok <cemgurkok@gmail.com>
#
# 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 ... | gpl-2.0 |
Lorquas/subscription-manager | .tito/lib/rhsmtagger.py | 2 | 2389 | import os
import six
from tito.tagger.main import VersionTagger
from tito.common import info_out, debug, replace_version, run_command
class MultiPythonPackageVersionTagger(VersionTagger):
def __init__(self, config=None, *args, **kwargs):
super(MultiPythonPackageVersionTagger, self).__init__(config=config... | gpl-2.0 |
mosra/m.css | plugins/m/link.py | 1 | 2187 | #
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019, 2020 Vladimír Vondruš <mosra@centrum.cz>
#
# 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, inc... | mit |
dagwieers/ansible | lib/ansible/modules/cloud/google/gcp_storage_bucket.py | 1 | 44498 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
TheModMaker/shaka-player | build/check.py | 1 | 6755 | #!/usr/bin/env python
#
# Copyright 2016 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 requir... | apache-2.0 |
adykstra/mne-python | examples/connectivity/plot_mne_inverse_envelope_correlation_volume.py | 4 | 4053 | """
====================================================
Compute envelope correlations in volume source space
====================================================
Compute envelope correlations of orthogonalized activity [1]_ [2]_ in source
space using resting state CTF data in a volume source space.
"""
# Authors: Er... | bsd-3-clause |
ContributeToScience/participant-booking-app | booking/core/ip2geo/__init__.py | 1 | 10628 | import math
import mmap
import gzip
import os
import codecs
import pytz
import const
from util import ip2long
from timezone import time_zone_by_country_and_region
MMAP_CACHE = const.MMAP_CACHE
MEMORY_CACHE = const.MEMORY_CACHE
STANDARD = const.STANDARD
class GeoIPError(Exception):
pass
class GeoIPMetaclass(t... | gpl-2.0 |
ridfrustum/lettuce | tests/integration/lib/Django-1.2.5/tests/modeltests/one_to_one/models.py | 91 | 1408 | """
10. One-to-one relationships
To define a one-to-one relationship, use ``OneToOneField()``.
In this example, a ``Place`` optionally can be a ``Restaurant``.
"""
from django.db import models, transaction, IntegrityError
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.Cha... | gpl-3.0 |
chubbymaggie/pwndbg | pwndbg/commands/reload.py | 4 | 1216 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import imp
import os
import sys
import types
import gdb
import pwndbg
import pwndbg.commands
import pwndbg.events
import p... | mit |
VirusTotal/vt-graph-api | tests/test_search.py | 1 | 25999 | """Test search VTGraph methods."""
import pytest
import six
import vt_graph_api
try:
from unittest.mock import call
from unittest.mock import Mock
import urllib.parse as urlparse
except ImportError:
from mock import call
from mock import Mock
import urlparse
test_graph = vt_graph_api.VTGraph(
"Dumm... | apache-2.0 |
2014cdag2/w17x1 | static/Brython3.1.3-20150514-095342/Lib/reprlib.py | 923 | 5110 | """Redo the builtin repr() (representation) but with limits on most sizes."""
__all__ = ["Repr", "repr", "recursive_repr"]
import builtins
from itertools import islice
try:
from _thread import get_ident
except ImportError:
from _dummy_thread import get_ident
def recursive_repr(fillvalue='...'):
'Decorato... | agpl-3.0 |
rhattersley/cartopy | lib/cartopy/tests/mpl/test_ticker.py | 3 | 8574 | # (C) British Crown Copyright 2014 - 2017, Met Office
#
# This file is part of cartopy.
#
# cartopy 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)... | lgpl-3.0 |
ivand58/ardupilot | Tools/LogAnalyzer/tests/TestThrust.py | 261 | 3454 | from LogAnalyzer import Test,TestResult
import DataflashLog
class TestThrust(Test):
'''test for sufficient thrust (copter only for now)'''
def __init__(self):
Test.__init__(self)
self.name = "Thrust"
def run(self, logdata, verbose):
self.result = TestResult()
self... | gpl-3.0 |
le9i0nx/ansible | lib/ansible/modules/system/sefcontext.py | 56 | 7940 | #!/usr/bin/python
# (c) 2016, 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.1',
'status': ['... | gpl-3.0 |
kernelhackx/kernel_hammerhead | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
NewpTone/stacklab-nova | debian/tmp/usr/lib/python2.7/dist-packages/nova/tests/test_xenapi.py | 3 | 120664 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix Systems, 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/L... | apache-2.0 |
afein/docker-microservice | service/service.py | 1 | 3362 | from flask import Flask, request, abort
import os
import time
import random
import requests
app = Flask("microservice")
service_name = os.environ["SERVICE_NAME"]
log = open("/var/log/micro/" + service_name + ".log", "w+")
requestID_counter = 1
def busy_wait(seconds):
dt = time.strptime(str(seconds), "%S")
... | apache-2.0 |
dnozay/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/localflavor/ca.py | 40 | 3333 | from django.contrib.localflavor.ca.forms import (CAPostalCodeField,
CAPhoneNumberField, CAProvinceField, CAProvinceSelect,
CASocialInsuranceNumberField)
from utils import LocalFlavorTestCase
class CALocalFlavorTests(LocalFlavorTestCase):
def test_CAProvinceSelect(self):
f = CAProvinceSele... | gpl-3.0 |
ntts-clo/ryu | ryu/controller/mac_to_network.py | 53 | 1960 | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | apache-2.0 |
sk413025/twitter-sent-dnn | test_numpy_embedding.py | 4 | 1183 | import theano
import numpy as np
from dcnn import WordEmbeddingLayer
from dcnn_train import WordEmbeddingLayer as TheanoWordEmbeddingLayer
from test_util import assert_matrix_eq
########### NUMPY ###########
vocab_size, embed_dm = 10, 5
embeddings = np.random.rand(vocab_size, embed_dm)
sents = np.asarray(np.random.ran... | mit |
clems71/pogle | pyassimp/structs.py | 1 | 34579 | #-*- coding: UTF-8 -*-
from ctypes import POINTER, c_void_p, c_int, c_uint, c_char, c_float, Structure, c_char_p, c_double, c_ubyte, c_size_t, c_uint32
class Vector2D(Structure):
"""
See 'aiVector2D.h' for details.
"""
_fields_ = [
("x", c_float),("y", c_float),
]
class Matrix... | mit |
gzamboni/sdnResilience | loxi/of11/action.py | 1 | 47031 | # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... | gpl-2.0 |
r888888888/models | swivel/text2bin.py | 23 | 2485 | #!/usr/bin/env python
#
# Copyright 2016 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 |
SCOAP3/invenio | invenio/modules/authors/errors.py | 19 | 1059 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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
# License, or (at your option) any later... | gpl-2.0 |
gibiansky/tensorflow | tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_test.py | 30 | 2249 | # encoding: utf-8
# 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 r... | apache-2.0 |
justincassidy/ThinkStats2 | code/hinc_soln.py | 67 | 4296 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import numpy as np
import pandas
import hinc
import thinkplot
import thinkstats2
""... | gpl-3.0 |
jakeharding/repo-health | repo_health/gh_issues/serializers/GhIssueStatsSerializer.py | 1 | 4835 | """
GhIssueStatsSerializer.py - (C) Copyright - 2017
This software is copyrighted to contributors listed in CONTRIBUTIONS.md.
SPDX-License-Identifier: MIT
Author(s) of this file:
J. Harding
Serializer for issue stats of a GitHub repo.
"""
import datetime
from rest_framework import serializers as s
from ..models i... | mit |
pozdnyakov/chromium-crosswalk | tools/git/mass-rename.py | 3 | 1235 | #!/usr/bin/env python
# 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.
"""
mass-rename: update source files (gyp lists, #includes) to reflect
a rename. Expects "git diff --cached -M" to list a bunch of ren... | bsd-3-clause |
kvite/astridclone | actionbarsherlock/plugins/maps/update.py | 15 | 1364 | #!/usr/bin/env python
import os
import re
dir_maps_base = os.path.dirname(os.path.realpath(__file__))
dir_repo_base = os.path.dirname(os.path.dirname(dir_maps_base))
dir_lib_base = os.path.join(dir_repo_base, 'library')
path_to_source_activity = 'src/android/support/v4/app/FragmentActivity.java'.split('/')
path_to_... | gpl-3.0 |
wanghongjuan/crosswalk-test-suite | misc/sampleapp-android-tests/sampleapp/webgl_uninstall.py | 1 | 2600 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
yhilpisch/dx | dx/plot.py | 1 | 5805 | #
# DX Analytics
# Helper Function for Plotting
# dx_plot.py
#
# DX Analytics is a financial analytics library, mainly for
# derviatives modeling and pricing by Monte Carlo simulation
#
# (c) Dr. Yves J. Hilpisch
# The Python Quants GmbH
#
# This program is free software: you can redistribute it and/or modify
# it unde... | agpl-3.0 |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_4_0_0/models/range.py | 1 | 1470 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Range) on 2019-05-07.
# 2019, SMART Health IT.
from . import element
class Range(element.Element):
""" Set of values bounded by low and high.
A set of ordered Quantities defi... | bsd-3-clause |
jarvys/django-1.7-jdb | django/contrib/admin/tests.py | 301 | 6166 | import os
from unittest import SkipTest
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.utils.module_loading import import_string
from django.utils.translation import ugettext as _
class AdminSeleniumWebDriverTestCase(StaticLiveServerTestCase):
available_apps = [
'dja... | bsd-3-clause |
benthomasson/ansible | lib/ansible/utils/module_docs_fragments/aruba.py | 131 | 2742 | #
# (c) 2017, James Mighion <@jmighion>
#
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.