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 |
|---|---|---|---|---|---|
lzambella/Qyoutube-dl | youtube_dl/extractor/cracked.py | 170 | 3213 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
str_to_int,
)
class CrackedIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?cracked\.com/video_(?P<id>\d+)_[\da-z-]+\.html'
_TESTS = [{
'url': 'http://www.cracked.com/... | gpl-3.0 |
AuthorityFX/afx-nuke-plugins | menu.py | 1 | 2860 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2012-2016, Ryan P. Wilson
#
# Authority FX, Inc.
# www.authorityfx.com
afx_plugin... | mpl-2.0 |
simonpf/root | main/python/rootmkdir.py | 31 | 1220 | #!/usr/bin/env @python@
# ROOT command line tools: rootmkdir
# Author: Julien Ripoche
# Mail: julien.ripoche@u-psud.fr
# Date: 20/08/15
"""Command line to add directories in ROOT files"""
import cmdLineUtils
import sys
# Help strings
COMMAND_HELP = "Add directories in ROOT files"
PARENT_HELP = "make parent directo... | lgpl-2.1 |
martinbuc/missionplanner | packages/IronPython.StdLib.2.7.4/content/Lib/markupbase.py | 60 | 14742 | """Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the HTMLParser and sgmllib
modules (indirectly, for htmllib as well). It has no documented
public API and should not be used directly.
"""
import re
_declname_match = re.compile(r'[a-zA-Z]... | gpl-3.0 |
mapr/hue | desktop/core/ext-py/pyformance-0.3.2/pyformance/meters/timer.py | 33 | 3423 | import time
try:
from blinker import Namespace
except ImportError:
Namespace = None
from .histogram import Histogram, DEFAULT_SIZE, DEFAULT_ALPHA
from .meter import Meter
if Namespace is not None:
timer_signals = Namespace()
call_too_long = timer_signals.signal("call_too_long")
else:
call_too_long ... | apache-2.0 |
andalexo/bgv | scripts/encore_ctrl.py | 1 | 28418 | from __future__ import print_function, division
import sys
from logging import getLogger
from argparse import (ArgumentParser, RawDescriptionHelpFormatter,
ArgumentDefaultsHelpFormatter, ArgumentTypeError)
from os.path import isfile
from csv import reader
try:
import encoreio
except ImportEr... | mit |
FabriceSalvaire/PyValentina | Patro/GraphicEngine/Painter/MplPainter.py | 1 | 4266 | ####################################################################################################
#
# Patro - A Python library to make patterns for fashion design
# Copyright (C) 2017 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | gpl-3.0 |
morphis/home-assistant | homeassistant/components/camera/synology.py | 2 | 8436 | """
Support for Synology Surveillance Station Cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.synology/
"""
import asyncio
import logging
import voluptuous as vol
import aiohttp
import async_timeout
from homeassistant.cons... | apache-2.0 |
ormnv/os_final_project | django/contrib/sitemaps/tests/urls/http.py | 97 | 1691 | from datetime import datetime
from django.conf.urls import patterns, url
from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap, views
from django.contrib.auth.models import User
from django.views.decorators.cache import cache_page
from django.contrib.sitemaps.tests.base import TestModel
class ... | bsd-3-clause |
pilou-/ansible-modules-core | system/cron.py | 39 | 17136 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2012, Dane Summers <dsummers@pinedesk.biz>
# (c) 2013, Mike Grozak <mike.grozak@gmail.com>
# (c) 2013, Patrick Callahan <pmc@patrickcallahan.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms o... | gpl-3.0 |
mahak/nova | nova/tests/unit/api/openstack/compute/test_pause_server.py | 3 | 2270 | # Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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 ... | apache-2.0 |
jonyroda97/redbot-amigosprovaveis | lib/raven/contrib/bottle/utils.py | 25 | 1045 | """
raven.contrib.bottle.utils
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
from raven.utils.compat import _urlparse
from raven.utils.wsgi import get_header... | gpl-3.0 |
paulo-raca/ESP8266-Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/chardistribution.py | 168 | 9153 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | lgpl-2.1 |
uraplutonium/adtree-py | src/SampleNets.py | 1 | 2456 | '''SampleNets.py
Test data for developing the SIGMA Editor.
'''
# Here is the example Bayes net used in lecture.
from BayesNetNode import *
from BayesUpdating import *
mynet = BayesNet("Test Net")
nodeA = Node('A', 'Accident', 400, 160)
nodeB = Node('B', 'Barb Late', 300, 300)
nodeC = Node('C', 'Chris Late', 500,... | gpl-2.0 |
EDUlib/edx-platform | lms/djangoapps/branding/__init__.py | 8 | 2643 | """
EdX Branding package.
Provides a way to retrieve "branded" parts of the site.
This module provides functions to retrieve basic branded parts
such as the site visible courses, university name and logo.
"""
from django.conf import settings
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.s... | agpl-3.0 |
jvkops/django | django/utils/termcolors.py | 260 | 7480 | """
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink... | bsd-3-clause |
TNT-Samuel/Coding-Projects | DNS Server/Source - Copy/Lib/site-packages/wheel/install.py | 8 | 18989 | """
Operations on existing wheel files, including basic installation.
"""
# XXX see patched pip to install
from __future__ import print_function
import csv
import hashlib
import os.path
import re
import shutil
import sys
import warnings
import zipfile
from . import signatures
from .paths import get_install_paths
fro... | gpl-3.0 |
openNSS/enigma2 | lib/python/Screens/LocationBox.py | 2 | 17782 | #
# Generic Screen to select a path/filename combination
#
# GUI (Screens)
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox
from Screens.HelpMenu import HelpableScreen
from Screens.ChoiceBox import ChoiceBox
# Generic
from Tools.BoundFunction import bou... | gpl-2.0 |
flacjacket/sympy | sympy/printing/tests/test_conventions.py | 13 | 1648 | from sympy import symbols
from sympy.printing.conventions import split_super_sub
def test_super_sub():
assert split_super_sub("beta_13_2") == ("beta", [], ["13","2"])
assert split_super_sub("beta_132_20") == ("beta", [], ["132","20"])
assert split_super_sub("beta_13") == ("beta", [], ["13"])
assert spl... | bsd-3-clause |
d4nielcosta/djangoembed | oembed/tests/tests/utils.py | 4 | 5061 | from django.contrib.sites.models import Site
from oembed.tests.tests.base import BaseOEmbedTestCase
from oembed.utils import size_to_nearest, relative_to_full, load_class, cleaned_sites, scale
class OEmbedUtilsTestCase(BaseOEmbedTestCase):
def test_size_to_nearest(self):
sizes = ((100, 100), (200, 200), (... | mit |
vrs01/mopidy | mopidy/internal/log.py | 4 | 6536 | from __future__ import absolute_import, unicode_literals
import logging
import logging.config
import logging.handlers
import platform
LOG_LEVELS = {
-1: dict(root=logging.ERROR, mopidy=logging.WARNING),
0: dict(root=logging.ERROR, mopidy=logging.INFO),
1: dict(root=logging.WARNING, mopidy=logging.DEBUG),... | apache-2.0 |
zhenzhai/edx-platform | openedx/core/lib/block_structure/block_structure.py | 1 | 27423 | """
Module with family of classes for block structures.
BlockStructure - responsible for block existence and relations.
BlockStructureBlockData - responsible for block & transformer data.
BlockStructureModulestoreData - responsible for xBlock data.
The following internal data structures are implemented:
... | agpl-3.0 |
jhjguxin/PyCDC | Karrigell-2.3.5/LocalizedRequestHandler.py | 1 | 5228 | import os
import sys
import traceback
import k_config
import k_translation
class LocalizedRequestHandler:
current_language="" # current language
accepted_languages=[]
forbiddenListMsg="Directory list forbidden"
fileNotFoundMsg="File not found"
def install_translations(self):
# translatio... | gpl-3.0 |
theatlantic/jinja2-template-cache | jinja2cache/tplcache.py | 1 | 1825 | """
Template Caching framework (just like regular caching, only for templates!)
"""
import collections
import copy
from django.core.cache import get_cache, parse_backend_uri
# jinja2.bccache.MemcachedBytecodeCache also works with redis
from jinja2.bccache import MemcachedBytecodeCache
from .settings import JINJA2_CAC... | bsd-2-clause |
scw/global-threats-model | Projections/reproject_laea.py | 1 | 3319 | # ---------------------------------------------------------------------------
# reproject_laea.py
# Shaun Walbridge, 5.22.2006 <walbridge@nceas.ucsb.edu>
# Usage: reproject_laea <input_layer>
# ---------------------------------------------------------------------------
# Import system modules
import sys, strin... | apache-2.0 |
hamiltont/CouchPotatoServer | libs/sqlalchemy/orm/query.py | 18 | 129214 | # orm/query.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The Query class and support.
Defines the :class:`.Query` class, the central
construct... | gpl-3.0 |
archf/ansible | lib/ansible/modules/cloud/google/gce.py | 25 | 28262 | #!/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 |
femmerling/backyard | gardener/help_operations.py | 1 | 1910 | def help():
# This lists the commands used by the db_tools.py.
print '\nThe general usage pattern of the tool is ./yard [options] [extra parameters]\n'
print 'The following are the available options:\n'
print ' blow or b : Run the production web server'
print ' downgrade or d : Down... | mit |
thestick613/python-thundercache | setup.py | 1 | 2605 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
fro... | bsd-2-clause |
MemeticParadigm/TensorFlow | tensorflow/python/kernel_tests/summary_ops_test.py | 5 | 2841 | """Tests for summary ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.python.platform
import tensorflow as tf
class SummaryOpsTest(tf.test.TestCase):
def _AsSummary(self, s):
summ = tf.Summary()
summ.ParseFromString(s)
... | apache-2.0 |
CryptoManiac/p2pool | p2pool/bitcoin/getwork.py | 267 | 2912 | '''
Representation of a getwork request/reply
'''
from __future__ import division
from . import data as bitcoin_data
from . import sha256
from p2pool.util import pack
def _swap4(s):
if len(s) % 4:
raise ValueError()
return ''.join(s[x:x+4][::-1] for x in xrange(0, len(s), 4))
class BlockAttempt(obje... | gpl-3.0 |
mosaic-cloud/mosaic-distribution-dependencies | dependencies/nodejs/0.10.32/tools/install.py | 2 | 5957 | #!/usr/bin/env python
import errno
try:
import json
except ImportError:
import simplejson as json
import os
import re
import shutil
import sys
# set at init time
dst_dir = None
node_prefix = None # dst_dir without DESTDIR prefix
target_defaults = None
variables = None
def abspath(*args):
path = os.path.join(... | apache-2.0 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/trace.py | 153 | 29890 | #!/usr/bin/env python
# portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
# err... reserved and offered to the public under the terms of the
# Python 2.2 license.
# Author: Zooko O'Whielacronx
# http://zooko.com/
# mailto:zooko@zooko.com
#
# Copyright 2000, Mojam Media, Inc., all rights reserv... | gpl-2.0 |
ict-felix/stack | core/lib/am/credentials/src/manager/manager.py | 3 | 3065 | from ambase.src.abstract.classes.credentialmanagerbase import CredentialManagerBase
from credentials.src.trust.auth import Auth
from credentials.src.trust.credential import Credential
from credentials.src.trust.abaccredential import ABACCredential
from ambase.src.ambase.exceptions import ApiErrorException
from ambase.s... | apache-2.0 |
nicolargo/intellij-community | python/helpers/python-skeletons/decimal.py | 70 | 1905 | """Skeleton for 'decimal' stdlib module."""
import decimal
def getcontext():
"""Returns this thread's context.
:rtype: decimal.Context
"""
return decimal.Context()
def setcontext(context):
"""Set this thread's context to context.
:type context: decimal.Context
:rtype: None
"""
... | apache-2.0 |
manyio/cmapi | cmxDeploy.py | 1 | 74074 | #!/usr/bin/env python
#
__author__ = 'Michalis'
__version__ = '0.11.1923'
import socket
import re
import urllib2
from optparse import OptionParser
import hashlib
import os
import sys
import random
from cm_api.api_client import ApiResource, ApiException
from cm_api.endpoints.hosts import *
from cm_api.endpoints.servic... | apache-2.0 |
AnotherIvan/calibre | src/calibre/ebooks/azw4/reader.py | 21 | 1349 | # -*- coding: utf-8 -*-
'''
Read content from azw4 file.
azw4 is essentially a PDF stuffed into a MOBI container.
'''
__license__ = 'GPL v3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
import re
from calibre.ebooks.pdb.formatreader import FormatRe... | gpl-3.0 |
jonasrothfuss/DeepEpisodicMemory | data_prep/storeDatasetToNumpy.py | 1 | 5259 | """Stores a dataset into numpy ndarray format"""
import numpy as np
import cv2
import warnings
import glob
from math import floor
# --- Flags/Declarations and I/O ---
train = False
cap = cv2.VideoCapture()
equallyDistributed = True #do you want to have equally distributed step sizes between images? -> True
allFiles =... | mit |
demon-ru/iml-crm | openerp/report/render/rml2html/rml2html.py | 438 | 15438 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2005, Fabien Pinckaers, UCL, FSA
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | agpl-3.0 |
Just-D/chromium-1 | tools/telemetry/third_party/gsutilz/third_party/gcs-oauth2-boto-plugin/gcs_oauth2_boto_plugin/test_oauth2_client.py | 31 | 12450 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause |
kastriothaliti/techstitution | venv/lib/python2.7/site-packages/wtforms/fields/core.py | 75 | 33637 | from __future__ import unicode_literals
import datetime
import decimal
import itertools
from wtforms import widgets
from wtforms.compat import text_type, izip
from wtforms.i18n import DummyTranslations
from wtforms.validators import StopValidation
from wtforms.utils import unset_value
__all__ = (
'BooleanField'... | gpl-3.0 |
mociepka/saleor | saleor/userprofile/models.py | 1 | 6427 | from __future__ import unicode_literals
from django.contrib.auth.hashers import (check_password, make_password,
is_password_usable)
from django.contrib.auth.models import BaseUserManager, PermissionsMixin
from django.db import models
from django.forms.models import model_to_dic... | bsd-3-clause |
dcousens/bitcoin | contrib/testgen/base58.py | 47 | 3004 | # Copyright (c) 2012 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
... | mit |
HyperionROM/android_external_chromium | testing/gtest/test/gtest_catch_exceptions_test.py | 414 | 9312 | #!/usr/bin/env python
#
# Copyright 2010 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 o... | bsd-3-clause |
nkgilley/home-assistant | homeassistant/components/cisco_ios/device_tracker.py | 16 | 4667 | """Support for Cisco IOS Routers."""
import logging
import re
from pexpect import pxssh
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
import homeass... | apache-2.0 |
gptech/ansible | lib/ansible/modules/windows/win_iis_webbinding.py | 78 | 3417 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
#
# 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 t... | gpl-3.0 |
sunqb/oa_qian | flask/Lib/site-packages/sqlalchemy/ext/instrumentation.py | 56 | 14646 | """Extensible class instrumentation.
The :mod:`sqlalchemy.ext.instrumentation` package provides for alternate
systems of class instrumentation within the ORM. Class instrumentation
refers to how the ORM places attributes on the class which maintain
data and track changes to that data, as well as event hooks installed... | apache-2.0 |
grepme/CMPUT410Lab01 | virt_env/virt1/lib/python2.7/site-packages/SQLAlchemy-0.9.8-py2.7-linux-x86_64.egg/sqlalchemy/util/_collections.py | 23 | 25071 | # util/_collections.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Collection classes and helpers."""
from __future__ import absolute_import
i... | apache-2.0 |
Juniper/contrail-dev-controller | src/config/svc-monitor/svc_monitor/tests/test_init.py | 3 | 3194 | import logging
import mock
import unittest
from mock import patch
from svc_monitor.svc_monitor import SvcMonitor
from pysandesh.sandesh_base import Sandesh
from vnc_api.vnc_api import ServiceInstance, ServiceInstanceType
from vnc_api.vnc_api import ServiceScaleOutType
from vnc_api.vnc_api import ServiceTemplate, Ser... | apache-2.0 |
pypot/scikit-learn | sklearn/metrics/tests/test_regression.py | 272 | 6066 | from __future__ import division, print_function
import numpy as np
from itertools import product
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.... | bsd-3-clause |
yati-sagade/RyDyrect | django/contrib/messages/storage/__init__.py | 393 | 1183 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_storage(import_path):
"""
Imports the message storage class described by import_path, where
import_path is the full Python path to the class.
"""
try:
... | bsd-3-clause |
sonaht/ansible | lib/ansible/playbook/base.py | 18 | 23568 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) an... | gpl-3.0 |
gregdek/ansible-modules-core | cloud/openstack/_quantum_floating_ip_associate.py | 146 | 8239 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.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 ... | gpl-3.0 |
glatard/nipype | nipype/interfaces/slicer/registration/tests/test_auto_ACPCTransform.py | 9 | 1177 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.slicer.registration.specialized import ACPCTransform
def test_ACPCTransform_inputs():
input_map = dict(acpc=dict(argstr='--acpc %s...',
),
args=dict(argstr='%s',
),
debugSwitch=dict(... | bsd-3-clause |
wreckJ/intellij-community | python/lib/Lib/encodings/cp437.py | 593 | 34820 | """ Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.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_map)
def decode(self,input,errors='strict... | apache-2.0 |
anumaa/trak | trak.py | 1 | 8214 | #!/usr/bin/python
from tkinter import *
from tkinter import ttk
import pickle
import atexit
import os.path
from datetime import date, timedelta
import time
from project import *
#from task import *
DATASTORAGE = 'trak.p'
class Trak(Frame):
def __init__(self, parent, project):
Frame.__init__(self, parent)
... | gpl-3.0 |
dannyperry571/theapprentice | script.module.requests/lib/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-2.0 |
smileytechguy/sample_projects | product_in_a_grid/python/product_in_a_grid.py | 1 | 2677 | grid = [
[ 8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],
[49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],
[81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65],
[52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, ... | mit |
google/nixysa | third_party/ply-3.1/test/lex_closure.py | 174 | 1119 | # -----------------------------------------------------------------------------
# lex_closure.py
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = (
'NAME','NUMBER',
'PLUS','MINUS',... | apache-2.0 |
HybridF5/jacket | jacket/tests/storage/unit/scheduler/test_filter_scheduler.py | 1 | 22468 | # 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 |
mdj2/django | tests/utils_tests/test_termcolors.py | 60 | 7696 | from django.utils import unittest
from django.utils.termcolors import (parse_color_setting, PALETTES,
DEFAULT_PALETTE, LIGHT_PALETTE, DARK_PALETTE, NOCOLOR_PALETTE, colorize)
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEqual(parse_color_setting(''), PALETTES[DEFAU... | bsd-3-clause |
frouty/odoo_oph | addons/decimal_precision/__init__.py | 450 | 1128 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
mikebd/splunk-elasticsearch | search-elasticsearch/bin/splunklib/searchcommands/streaming_command.py | 7 | 5069 | # Copyright 2011-2014 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | apache-2.0 |
angr/angr | angr/protos/primitives_pb2.py | 1 | 32951 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: protos/primitives.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as... | bsd-2-clause |
jkyeung/XlsxWriter | xlsxwriter/test/comparison/test_escapes06.py | 1 | 1175 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
svleeuwen/sortedm2m-filter-horizontal-widget | example_project/example_project/settings.py | 1 | 3297 | """
Django settings for example_project project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
imp... | bsd-3-clause |
pacogomez/pyvcloud | tests/vcd_catalog_setup.py | 1 | 1193 | import os
import unittest
import yaml
from pyvcloud.vcd.client import BasicLoginCredentials
from pyvcloud.vcd.client import Client
from pyvcloud.vcd.org import Org
from pyvcloud.vcd.test import TestCase
class TestCatalogSetup(TestCase):
def test_create_catalog(self):
logged_in_org = self.client.get_org()
... | apache-2.0 |
shiitakeo/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/langbulgarianmodel.py | 2965 | 12784 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | lgpl-2.1 |
krisbbb/Experiments | kivy-experiments/SignQuiz/main.py | 1 | 1861 | import kivy
kivy.require('1.2.0')
from sys import argv
from os.path import dirname, join
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.behaviors import ButtonBehavior
from kivy.properties import ObjectProper... | mit |
leonerd/libsigrokdecode | decoders/spiflash/pd.py | 2 | 14609 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2011-2015 Uwe Hermann <uwe@hermann-uwe.de>
##
## 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 t... | gpl-3.0 |
teamjamon/alfredo-python-sdk | tests/cli/tests_cli.py | 1 | 3817 | import sys
import uuid
from os.path import basename
from unittest.case import TestCase
import ruamel.yaml as yaml
from alfredo import cli
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
class AlfredoCLITest(TestCase):
def setUp(self):
self.email = "%s@example.com"... | lgpl-2.1 |
iglpdc/nipype | nipype/interfaces/slicer/tests/test_auto_LabelMapSmoothing.py | 12 | 1342 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..surface import LabelMapSmoothing
def test_LabelMapSmoothing_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
gaussianSigma=dict(argstr='--gaussian... | bsd-3-clause |
ryfeus/lambda-packs | Keras_tensorflow/source/numpy/tests/test_ctypeslib.py | 87 | 4097 | from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.ctypeslib import ndpointer, load_library
from numpy.distutils.misc_util import get_shared_lib_extension
from numpy.testing import TestCase, run_module_suite, dec
try:
cdll = load_library('multiarray', np.cor... | mit |
davidyezsetz/kuma | vendor/packages/logilab-common/xmlrpcutils.py | 6 | 5091 | # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | mpl-2.0 |
40023154/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/xml/sax/_exceptions.py | 625 | 4885 | """Different kinds of SAX Exceptions"""
#in brython the 4 lines below causes an $globals['Exception'] error
#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 con... | gpl-2.0 |
XVPCoin/vaporcoin | contrib/bitrpc/bitrpc.py | 21 | 9153 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access... | mit |
kmoocdev2/edx-platform | lms/djangoapps/lms_migration/management/commands/manage_course_groups.py | 20 | 2092 | #!/usr/bin/python
#
# File: manage_course_groups
#
# interactively list and edit membership in course staff and instructor groups
import re
from django.contrib.auth.models import Group, User
from django.core.management.base import BaseCommand
#----------------------------------------------------------------------... | agpl-3.0 |
aljoscha/shot-o-matic | vendor/tornado-0.2/build/lib.linux-x86_64-2.6/tornado/s3server.py | 20 | 9592 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause |
marcinn/json-rpc-server | setup.py | 1 | 1124 | import os
from setuptools import setup, find_packages
with open(
os.path.join(os.path.dirname(__file__), 'README.md'),
encoding='utf-8'
) as fh:
long_description = fh.read()
setup(name='damn-simple-jsonrpc-server',
version='0.4.4.post1',
description='Damn simple, framework-agnostic JSON-RPC ... | bsd-2-clause |
terryyin/linkchecker | third_party/dnspython/dns/exception.py | 101 | 1318 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-2.0 |
js0701/chromium-crosswalk | tools/grit/grit/lazy_re.py | 63 | 1518 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''In GRIT, we used to compile a lot of regular expressions at parse
time. Since many of them never get used, we use lazy_re to co... | bsd-3-clause |
hexuotzo/khufu | postblog/postdouban.py | 1 | 1513 | #encoding: utf-8
from twill import *
import random
import cmemcache as memcache
import pycabinet
import cjson
def removetext(text):
text=text.encode("utf8")
text=text.replace("-育儿早教-中国早教网","")
text=text.replace("-怀孕胎教-中国早教网","")
text=text.replace("-新闻资讯-中国早教网","")
text=text.replace("-中国早教网","")
... | bsd-2-clause |
danieldresser/cortex | test/IECoreHoudini/FromHoudiniPointsConverter.py | 4 | 39834 | ##########################################################################
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Copyright (c) 2010-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary ... | bsd-3-clause |
googleapis/googleapis-gen | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/click_view_service/transports/base.py | 1 | 3680 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
krichter722/gdb | gdb/python/lib/gdb/__init__.py | 52 | 4609 | # Copyright (C) 2010-2015 Free Software Foundation, Inc.
# 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 progr... | gpl-2.0 |
chand3040/cloud_that | cms/djangoapps/contentstore/tests/test_core_caching.py | 140 | 1766 | from cache_toolbox.core import get_cached_content, set_cached_content, del_cached_content
from opaque_keys.edx.locations import Location
from django.test import TestCase
class Content(object):
"""
Mock cached content
"""
def __init__(self, location, content):
self.location = location
s... | agpl-3.0 |
v1bri/gnuradio | docs/doxygen/swig_doc.py | 47 | 11654 | #
# Copyright 2010-2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... | gpl-3.0 |
ohio813/pyflag | utilities/fuse_loopback_subsystem.py | 7 | 5552 | """ This is a fuse driver that makes an IO subsystem mountable through the standard linux loopback driver. This allows users to mount say an encase image directly through the loopback driver.
See pyflag_fuse.py for more details about fuse, and how to install it.
This program should be invoked as root to mount the fus... | gpl-2.0 |
marcelocure/django | tests/admin_views/test_adminsite.py | 247 | 2992 | from __future__ import unicode_literals
import datetime
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.test.client import RequestFactory
from .mo... | bsd-3-clause |
suiyuan2009/tensorflow | tensorflow/contrib/factorization/python/ops/gmm_ops_test.py | 53 | 7705 | # 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 |
wulczer/ansible | lib/ansible/runner/connection_plugins/local.py | 22 | 5141 | # (c) 2012, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) any lat... | gpl-3.0 |
dotnet/llilc | utils/make_package.py | 7 | 3243 | #!/usr/bin/env python
import sys
import argparse
import os
import subprocess
import platform
import io
import string
try:
# For Python >= 3.0
from urllib.request import urlopen
except ImportError:
# For Python < 3.0
from urllib2 import urlopen
import shutil
import stat
def run(args):
nugetFolder = ... | mit |
gdgellatly/OCB1 | addons/event_moodle/__init__.py | 54 | 1067 | # -*- 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 |
Maximilian-Reuter/SickRage | lib/guessit/transfo/split_path_components.py | 28 | 2614 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
mlperf/training_results_v0.7 | Intel/benchmarks/minigo/8-nodes-32s-cpx-tensorflow/player_interface.py | 4 | 3742 | # Copyright 2018 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, ... | apache-2.0 |
TansyArron/pants | src/python/pants/backend/android/android_config_util.py | 32 | 2173 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import tex... | apache-2.0 |
ChloeTigre/pyiwa | varints.py | 1 | 2435 | # comes from dowski
# gotta ask him what his copyright is
# modification by Chloe Desoutter <chloe.desoutter@atasta.net>
"""Encode and decode VARINTs in Python
Just wrote this while trying to understand exactly how VARINTs work. Maybe
someone else will find this useful too.
Here's where I was reading about VARINTs:
... | mit |
eliethesaiyan/ML_tryout | logistic-gradient-descent.py | 1 | 1082 | import numpy as np
import math
height = np.random.uniform(low=150.0, high=205.0, size=(40,))
print("height", height)
weight = np.random.uniform(low=40.0, high=100.0, size=(40,))
print("Weight", weight)
y = np.random.randint(2, size=(40,))
print("labels",y)
cost, dw1, dw2, db, lr, w1, w2, b = 0, 0, 0, 0, 0.01, 0, 0, 1... | unlicense |
MoritzS/django | tests/known_related_objects/tests.py | 27 | 6384 | from django.test import TestCase
from .models import Organiser, Pool, PoolStyle, Tournament
class ExistingRelatedInstancesTests(TestCase):
@classmethod
def setUpTestData(cls):
cls.t1 = Tournament.objects.create(name='Tourney 1')
cls.t2 = Tournament.objects.create(name='Tourney 2')
cl... | bsd-3-clause |
unixz/line-max | setup.py | 22 | 2329 | # -*- coding: utf-8 -*-
"""
Line -- May the LINE be with you...
=========================================
If you're reading this code, you should know what LINE is.
Just play. Have fun. Enjoy the LINE!
```````````````````````````
::
>>> from line import Client
Links
`````
* `GitHub repository <http://github.c... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.