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 |
|---|---|---|---|---|---|
garaud/ezhc | ezhc/_wrapper.py | 1 | 3866 |
from IPython.display import HTML, display
from _config import FULLNAME, DESCRIPTION, DEMO
from _state import State, state_HC, state_HS
class Wrapper(object):
def __init__(self, lib, path=''):
self.path = path
self.lib = lib
if lib=='highcharts':
self.state = state_HC
... | mit |
aprefontaine/TMScheduler | django/utils/_threading_local.py | 343 | 6655 | """Thread-local objects
(Note that this module provides a Python version of thread
threading.local class. Depending on the version of Python you're
using, there may be a faster one available. You should always import
the local class from threading.)
Thread-local objects support the management of thread-local dat... | bsd-3-clause |
mfazliazran/raft | thirdparty/pyamf/pyamf/__init__.py | 11 | 24004 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
U{PyAMF<http://pyamf.org>} provides Action Message Format (U{AMF
<http://en.wikipedia.org/wiki/Action_Message_Format>}) support for Python that
is compatible with the Adobe U{Flash Player
<http://en.wikipedia.org/wiki/Flash_Player>}.
@since: Octobe... | gpl-3.0 |
hkariti/mopidy | tests/dummy_audio.py | 11 | 3724 | """A dummy audio actor for use in tests.
This class implements the audio API in the simplest way possible. It is used in
tests of the core and backends.
"""
from __future__ import absolute_import, unicode_literals
import pykka
from mopidy import audio
def create_proxy(config=None, mixer=None):
return DummyAud... | apache-2.0 |
salguarnieri/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/se/forms.py | 311 | 5623 | # -*- coding: utf-8 -*-
"""
Swedish specific Form helpers
"""
import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.core.validators import EMPTY_VALUES
from django.contrib.localflavor.se.utils import (id_number_checksum,
validate_id_birthday, format_personal_id_numbe... | apache-2.0 |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/nltk/classify/util.py | 7 | 11755 | # Natural Language Toolkit: Classifier Utility Functions
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com> (minor additions)
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Utility functions and classes for classif... | apache-2.0 |
yongshengwang/builthue | desktop/core/ext-py/pyopenssl/OpenSSL/test/test_ssl.py | 81 | 71862 | # Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
"""
Unit tests for L{OpenSSL.SSL}.
"""
from gc import collect
from errno import ECONNREFUSED, EINPROGRESS, EWOULDBLOCK
from sys import platform, version_info
from socket import error, socket
from os import makedirs
from os.path import join
from unittest i... | apache-2.0 |
ruguevara/neon | neon/layers/layer.py | 7 | 24552 | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana 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.o... | apache-2.0 |
engine95/s2-gts28wifi-exynos5433 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
openfun/edx-platform | lms/djangoapps/courseware/tests/test_video_handlers.py | 32 | 35034 | # -*- coding: utf-8 -*-
"""Video xmodule tests in mongo."""
import os
import freezegun
import tempfile
import textwrap
import json
import ddt
from nose.plugins.attrib import attr
from datetime import timedelta, datetime
from webob import Request
from mock import MagicMock, Mock, patch
from xmodule.contentstore.conte... | agpl-3.0 |
drm00/beets | test/test_web.py | 25 | 4000 | """Tests for the 'web' plugin"""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
from test._common import unittest
from test import _common
import json
import beetsplug
from beets.library import Item, Album
beetsplug.__path__ = ['./beetsplug', '../beetsplug... | mit |
bcorbet/SickRage | lib/hachoir_core/field/sub_file.py | 90 | 2661 | from lib.hachoir_core.field import Bytes
from lib.hachoir_core.tools import makePrintable, humanFilesize
from lib.hachoir_core.stream import InputIOStream
class SubFile(Bytes):
"""
File stored in another file
"""
def __init__(self, parent, name, length, description=None,
parser=None, filename=None,... | gpl-3.0 |
mooster311/Gigabot | cogs/ranking.py | 1 | 1463 | from discord.ext import commands
import database
from random import randint
class Ranking:
"""Ranking"""
def __init__(self, bot):
""""Constructor for Ranking"""
self.bot = bot
@commands.command()
async def rank(self, ctx):
"""Returns the users rank"""
rank = await dat... | mit |
richo/groundstation | test/test_update_object.py | 1 | 1047 | from support.station_fixture import StationTestCase
import groundstation.objects.update_object as update_object
def assert_objects_equal(test, obj, inst1, inst2):
for member in obj.data_members:
test.assertEqual(getattr(inst1, member), getattr(inst2, member))
class TestUpdateObject(StationTestCase):
... | mit |
Abrackadabra/CloudBot | plugins/piglatin.py | 27 | 2502 | """
piglatin.py
Translates text into pig latin. Use the NLTK module to provide correct translation.
Created By:
- Luke Rogers <https://github.com/lukeroge>
Special Thanks:
- Benjamin Hoffmeyer <https://github.com/TheDoctorsLife>
- J.F. Sebastian <https://stackoverflow.com/users/4279/j-f-sebastian>
Licen... | gpl-3.0 |
topliceanu/learn | interview/test/test_careercup.py | 1 | 5999 | # -*- coding: utf-8 -*-
import unittest
from careercup import *
class TestCareerCup(unittest.TestCase):
def test_find_pairs_in_list(self):
arr = [1,2,3,4,5,6,7,8]
k = 3
l = 2
actual = find_pairs_in_list(arr, k, l)
self.assertTrue(actual, 'should have found at least one p... | mit |
Avikalp7/image-aesthetics-learning | src/ImageProcessing/HSV_extraction.py | 1 | 1291 | """
Code to go through the image dataset and save H,S,V matrices associated
"""
from scipy import misc
from PIL import Image
from skimage import color
from skimage import data
import numpy as np
import PIL
import os
# Change this to the path of a folder containing images with naming convention: "img<num>.png", eg "i... | mit |
drmrd/ansible | lib/ansible/modules/network/ios/ios_ping.py | 81 | 5865 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
LokiCoder/Sick-Beard | lib/requests/packages/chardet2/euctwfreq.py | 323 | 34864 | ######################## 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-3.0 |
delectable/DIGITS | digits/model/images/generic/job.py | 10 | 1536 | # Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
import os.path
from digits.utils import subclass, override
from ..job import ImageModelJob
# NOTE: Increment this everytime the pickled object changes
PICKLE_VERSION = 1
@subclass
class GenericImageModelJob(ImageModelJob):
"""
A Job that create... | bsd-3-clause |
armab/st2contrib | packs/orion/actions/add_node_to_ncm.py | 1 | 1677 | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | apache-2.0 |
sitexa/scipher | cfp_common.py | 2 | 2408 | class CfpCommon(object):
maxv = 0
commons = {}
@staticmethod
def register_common(common):
v = common.version()
if v > CfpCommon.maxv:
CfpCommon.maxv = v
CfpCommon.commons[common.version()] = common
@staticmethod
def get_latest_common():
... | mit |
timabbott/zulip | zerver/views/archive.py | 4 | 3287 | from typing import List, Optional
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render
from django.template import loader
from zerver.lib.avatar import get_gravatar_url
from zerver.lib.exceptions import JsonableError
from zerver.lib.response import json_success
from zerver.lib.streams... | apache-2.0 |
macs03/demo-cms | cms/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py | 91 | 6767 | """
Creates permissions for all installed apps that need permissions.
"""
from __future__ import unicode_literals
import getpass
import unicodedata
from django.contrib.auth import (models as auth_app, get_permission_codename,
get_user_model)
from django.core import exceptions
from django.core.management.base impo... | mit |
ubc/edx-platform | lms/djangoapps/discussion_api/pagination.py | 73 | 1772 | """
Discussion API pagination support
"""
from rest_framework.pagination import BasePaginationSerializer, NextPageField, PreviousPageField
class _PaginationSerializer(BasePaginationSerializer):
"""
A pagination serializer without the count field, because the Comments
Service does not return result counts
... | agpl-3.0 |
rprata/boost | libs/python/test/voidptr.py | 46 | 1114 | # Copyright Niall Douglas 2005.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
>>> from voidptr_ext import *
Check for correct conversion
>>> use(get())
Check that None is converted to a NULL ... | gpl-2.0 |
krismcfarlin/todo_angular_endpoints | endpoints_proto_datastore/ndb/utils.py | 14 | 8427 | # Copyright 2012 Google Inc. All Rights Reserved.
"""Utility module for converting NDB properties to ProtoRPC messages/fields.
In the dictionary NDB_PROPERTY_TO_PROTO, each property defined by NDB is
registered. The registry values can either be a ProtoRPC field for simple
types/properties or a custom method for conv... | lgpl-3.0 |
tarvitz/dsfp | scripts/watcher.py | 2 | 5783 | # -*- coding: utf-8 -*
""" DSFP watcher, looks for save file modifications
.. module:: watcher
:platform: Linux, Windows, MacOS X
:synopsis: watches for dark souls save file modifications and prints
any modified data in console
.. moduleauthor:: Tarvitz<tarvitz@blacklibrary.ru>
"""
from __future__ imp... | mit |
tcheehow/MissionPlanner | Lib/nntplib.py | 55 | 21762 | """An NNTP client class based on RFC 977: Network News Transfer Protocol.
Example:
>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last
Group comp.lang.python has 51 articl... | gpl-3.0 |
827992983/yue | vm/vm.py | 1 | 5656 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
#author:lijian
#date: 2016
#Copyright: free
import os
import yuelibs.utils as utils
#/usr/libexec/qemu-kvm -name CTVM -cpu Westmere,+vmx -enable-kvm -m 2048 -smp 2 -spice port=5930,disable-ticketing -vga qxl
# -net nic,vlan=0,macaddr=2c:07:00:00:00:02,model=rtl8139 -net ta... | gpl-3.0 |
zhexiao/posts-manager | vendor/bower-asset/bootstrap/test-infra/s3_cache.py | 2166 | 5734 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... | apache-2.0 |
gnulinooks/sympy | sympy/functions/elementary/piecewise.py | 1 | 7694 |
from sympy.core.basic import Basic, S
from sympy.core.function import Function, diff
from sympy.core.numbers import Number
from sympy.core.relational import Relational
from sympy.core.sympify import sympify
from sympy.utilities.decorator import deprecated
class ExprCondPair(Basic):
"""Represents an expression, c... | bsd-3-clause |
wolfskaempf/ga_statistics | lib/python2.7/site-packages/django/contrib/gis/db/backends/base/models.py | 434 | 7111 | import re
from django.contrib.gis import gdal
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class SpatialRefSysMixin(object):
"""
The SpatialRefSysMixin is a class used by the database-dependent
SpatialRefSys objects to reduce redu... | mit |
sriprasanna/django-1.3.1 | tests/modeltests/validation/test_unique.py | 51 | 6076 | import datetime
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import connection
from django.test import TestCase
from django.utils import unittest
from models import (CustomPKModel, UniqueTogetherModel, UniqueFieldsModel,
UniqueForDateModel, ModelToValidate, Po... | bsd-3-clause |
mattbierner/The-Whole-Rainbow | main.py | 1 | 2649 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from PIL import Image
import requests
import json
from TwitterAPI import TwitterAPI
# Persisted data files
ROOT = os.path.dirname(os.path.realpath(__file__))
IMAGE_FILE = os.path.join(ROOT, 'color.png')
DATA_FILE = os.path.join(ROOT, 'color.data')
INI... | mit |
kvmu/SFU-workterm | factory_analysis.py | 1 | 10770 | import ROOT
import numpy as np
import root_numpy as rootnp
import kernel
import vegas as VEGAS
import os
import re
# import matplotlib
# matplotlib.use('Agg')
# import matplotlib.pyplot as plt
from timer import timer
# Library used to lead the data in this script
ROOT.gSystem.Load('libExRootAnalysis.so') # Path not sp... | mit |
frainfreeze/studying | home/python/microblog/venv/lib/python3.5/site-packages/pip/_internal/req/req_set.py | 9 | 7007 | from __future__ import absolute_import
import logging
from collections import OrderedDict
from pip._internal.exceptions import InstallationError
from pip._internal.utils.logging import indent_log
from pip._internal.wheel import Wheel
logger = logging.getLogger(__name__)
class RequirementSet(object):
def __ini... | mit |
imperodesign/paas-tools | deis/stg/controller/api/south_migrations/0007_auto__del_flavor__del_unique_flavor_owner_id__del_layer__del_unique_la.py | 2 | 28430 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'Container', fields ['formation', 'port']
... | mit |
james-d-mitchell/libsemigroups-python-bindings | semigroups/elements.py | 1 | 18772 | '''
This module contains classes for representing elements of semigroups.
'''
# pylint: disable = no-member, protected-access, invalid-name,
# pylint: disable = too-few-public-methods
# pylint: disable = len-as-condition
import libsemigroups
class Transformation(libsemigroups.TransformationNC):
r'''
Let :math... | gpl-3.0 |
kaynfiretvguru/Eldritch | plugin.video.ex0dus/resources/lib/sources/en/onlinedizi.py | 1 | 4914 | # NEEDS FIXING
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 yo... | gpl-2.0 |
SGCreations/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/werkzeug/testsuite/__init__.py | 146 | 7756 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite
~~~~~~~~~~~~~~~~~~
Contains all test Werkzeug tests.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import re
import sys
import unittest
import shutil
import tempfile
im... | apache-2.0 |
tumbl3w33d/ansible | test/units/modules/network/fortios/test_fortios_system_snmp_sysinfo.py | 21 | 7714 | # Copyright 2019 Fortinet, 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 program is distributed in the... | gpl-3.0 |
jhallen/joe-editor | tests/pyte/charsets.py | 6 | 7502 | # -*- coding: utf-8 -*-
"""
pyte.charsets
~~~~~~~~~~~~~
This module defines ``G0`` and ``G1`` charset mappings the same way
they are defined for linux terminal, see
``linux/drivers/tty/consolemap.c`` @ http://git.kernel.org
.. note:: ``VT100_MAP`` and ``IBMPC_MAP`` were taken unchanged
... | gpl-2.0 |
csirtgadgets/py-cif-sdk-stix | cif/sdk/stix/__init__.py | 2 | 2792 | __version__ = '0.0.0a0'
import time
from stix.indicator import Indicator
from stix.core import STIXPackage, STIXHeader
from cybox.common import Hash
from cybox.objects.file_object import File
from cybox.objects.address_object import Address
import re
import pprint
pp = pprint.PrettyPrinter()
class Stix(object):
... | lgpl-3.0 |
openhatch/oh-mainline | vendor/packages/mechanize/release.py | 21 | 45151 | """%prog RELEASE_AREA [action ...]
Perform needed actions to release mechanize, doing the work in directory
RELEASE_AREA.
If no actions are given, print the tree of actions and do nothing.
This is only intended to work on Unix (unlike mechanize itself). Some of it
only works on Ubuntu 10.04 (lucid).
Warning:
* M... | agpl-3.0 |
Zumium/whereismypi | computer/whereismypi.py | 1 | 2064 | #! /usr/bin/env python3
#
# Copyright 2015 Zumium <martin007323@gmail.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 3 of the License, or
#(at your option) any later version.... | gpl-3.0 |
vokimon/menjobe | passenger_wsgi.py | 1 | 1239 | import sys, os
project = 'devsite'
python = 'python3.4'
hexversion = 0x3040000
cwd = os.path.dirname(os.path.abspath(__file__))
sys.path.append(cwd)
#Switch to new python
if sys.hexversion < hexversion : os.execl(cwd+"/env/bin/"+ python, python, *sys.argv)
#sys.path.insert(0,cwd+'/env/bin')
sys.path.insert(0,cwd+'... | agpl-3.0 |
aidanhs/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_parser.py | 451 | 3612 | from __future__ import absolute_import, division, unicode_literals
import os
import sys
import traceback
import warnings
import re
warnings.simplefilter("error")
from .support import get_data_files
from .support import TestData, convert, convertExpected, treeTypes
from html5lib import html5parser, constants
# Run t... | mpl-2.0 |
crmccreary/openerp_server | openerp/addons/auction/barcode/code39.py | 9 | 10156 | # -*- coding: utf-8 -*-
#
# Copyright (c) 1996-2000 Tyler C. Sarna <tsarna@sarna.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above co... | agpl-3.0 |
djangorussia/django-1.3-branch | tests/regressiontests/custom_managers_regress/models.py | 93 | 1056 | """
Regression tests for custom manager classes.
"""
from django.db import models
class RestrictedManager(models.Manager):
"""
A manager that filters out non-public instances.
"""
def get_query_set(self):
return super(RestrictedManager, self).get_query_set().filter(is_public=True)
class Relat... | bsd-3-clause |
simbs/edx-platform | common/lib/xmodule/xmodule/library_tools.py | 154 | 7784 | """
XBlock runtime services for LibraryContentModule
"""
from django.core.exceptions import PermissionDenied
from opaque_keys.edx.locator import LibraryLocator, LibraryUsageLocator
from search.search_engine_base import SearchEngine
from xmodule.library_content_module import ANY_CAPA_TYPE_VALUE
from xmodule.modulestore ... | agpl-3.0 |
terrycain/razer_drivers | scripts/daemon/chroma_keyboard/macro_mode_led.py | 5 | 1584 | import sys
import argparse
import openrazer.client
choices = ('get', 'on', 'off', 'flashing', 'static', 'effect_state')
parser = argparse.ArgumentParser()
parser.add_argument('action', choices=choices)
args = parser.parse_args()
device_manager = openrazer.client.DeviceManager()
keyboard = None
for device in device_... | gpl-2.0 |
mancoast/CPythonPyc_test | cpython/272_test_funcattrs.py | 117 | 12749 | from test import test_support
import types
import unittest
class FuncAttrsTest(unittest.TestCase):
def setUp(self):
class F:
def a(self):
pass
def b():
return 3
self.f = F
self.fi = F()
self.b = b
def cannot_set_attr(self, obj, na... | gpl-3.0 |
mjzffr/mozplatformqa-jenkins | sclogparse.py | 2 | 6296 | #!/usr/bin/env python
# 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/.
"""Parses the Steeplechase log"""
import dateutil.parser
import re
import json
import sys
_ano... | mpl-2.0 |
boorad/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Node/Alias.py | 61 | 4250 |
"""scons.Node.Alias
Alias nodes.
This creates a hash of global Aliases (dummy targets).
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentat... | apache-2.0 |
biolab/orange | Orange/OrangeWidgets/Prototypes/OWShuffle.py | 6 | 1310 | """
<name>Shuffle</name>
<description>Shuffle the instances in a data table</description>
"""
from OWWidget import *
import OWGUI
import random
import Orange
class OWShuffle(OWWidget):
def __init__(self, parent=None, signalManager=None, title="Suffle"):
OWWidget.__init__(self, parent, signalManager, tit... | gpl-3.0 |
broferek/ansible | lib/ansible/modules/network/netvisor/pn_ipv6security_raguard_vlan.py | 24 | 4939 | #!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# 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 |
sorenk/ansible | test/units/modules/network/f5/test_bigip_selfip.py | 18 | 6237 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks 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
import os
import json
import pytest
import sys
from nose.plugins.skip imp... | gpl-3.0 |
tanyunshi/python-docx | docx/dml/color.py | 13 | 3978 | # encoding: utf-8
"""
DrawingML objects related to color, ColorFormat being the most prominent.
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from ..enum.dml import MSO_COLOR_TYPE
from ..oxml.simpletypes import ST_HexColorAuto
from ..shared import ElementProxy
class... | mit |
PercussiveRepair/elastatus | app/admin.py | 3 | 2554 | from flask import *
from app import db
from app import auth
from app import mail
from flask.ext.mail import Message
from app.models import IPWhitelist
import ipaddr
admin = Blueprint('admin', __name__)
def sendmail(subject, content):
msg = Message(sender=current_app.config['CONFIG']['admin']['email_from'],
... | mit |
jasonliu119/PokemonGo-Bot | pokemongo_bot/test/follow_cluster_test.py | 18 | 2041 | import unittest, pickle, os
from mock import patch
from pokemongo_bot.cell_workers.follow_cluster import FollowCluster
class FollowClusterTestCase(unittest.TestCase):
@patch('pokemongo_bot.PokemonGoBot')
def testWorkAway(self, mock_pokemongo_bot):
forts_path = os.path.join(os.path.dirname(__file__), ... | mit |
JulienMcJay/eclock | windows/Python27/Lib/site-packages/pip/commands/wheel.py | 16 | 7248 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import sys
from pip.basecommand import Command
from pip.index import PackageFinder
from pip.log import logger
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import InstallRequirement, RequirementSet, parse_requirement... | gpl-2.0 |
mdublin/Brightcove-Dynamic-Ingest-App | ENV/lib/python2.7/site-packages/sqlalchemy/dialects/firebird/base.py | 9 | 27506 | # firebird/base.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
"""
.. dialect:: firebird
:name: Firebird
Firebird Dialects
-----------------
... | mit |
TeamRegular/android_kernel_samsung_kminilte | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
xifle/home-assistant | homeassistant/components/cover/garadget.py | 12 | 9001 | """
Platform for the garadget cover component.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/garadget/
"""
import logging
import voluptuous as vol
import requests
from homeassistant.components.cover import CoverDevice, PLATFORM_SCHEMA
from homeassistant... | mit |
lukecwik/incubator-beam | sdks/python/apache_beam/pipeline.py | 1 | 52710 | #
# 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 |
jaredly/codetalker | tests/parse/ignore.py | 1 | 1245 | #!/usr/bin/env python
from codetalker import pgm
from codetalker.pgm.tokens import INT, WHITE, CharToken, ID
from codetalker.pgm.special import star, plus, _or
from codetalker.pgm.errors import ParseError
class SYMBOL(CharToken):
chars = ':-'
def start(rule):
rule | (ID, ':', value)
def value(rule):
rul... | mit |
xyzz/vcmi-build | project/jni/python/src/Lib/idlelib/run.py | 51 | 11200 | import sys
import linecache
import time
import socket
import traceback
import thread
import threading
import Queue
import CallTips
import AutoComplete
import RemoteDebugger
import RemoteObjectBrowser
import StackViewer
import rpc
import __main__
LOCALHOST = '127.0.0.1'
try:
import warnings
except ImportError:
... | lgpl-2.1 |
edx/edx-enterprise | enterprise/apps.py | 1 | 1852 | # -*- coding: utf-8 -*-
"""
Enterprise Django application initialization.
"""
from django.apps import AppConfig, apps
from django.conf import settings
from enterprise.constants import USER_POST_SAVE_DISPATCH_UID
class EnterpriseConfig(AppConfig):
"""
Configuration for the enterprise Django application.
... | agpl-3.0 |
samuelhavron/heroku-buildpack-python | Python-3.4.3/Lib/test/test_html.py | 12 | 4374 | """
Tests for the html module functions.
"""
import html
import unittest
from test.support import run_unittest
class HtmlTests(unittest.TestCase):
def test_escape(self):
self.assertEqual(
html.escape('\'<script>"&foo;"</script>\''),
''<script>"&foo;"</s... | mit |
sowe9385/qiime | tests/test_colors.py | 15 | 14630 | #!/usr/bin/env python
# file test_colors.py
__author__ = "Rob Knight and Jesse Stombaugh"
__copyright__ = "Copyright 2011, The QIIME Project" # consider project name
__credits__ = ["Jesse Stombaugh"] # remember to add yourself
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Jesse Stombaugh"
__email__... | gpl-2.0 |
rnirmal/openstack-dashboard | django-openstack/django_openstack/tests/view_tests/auth_tests.py | 6 | 7839 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
gautam1858/tensorflow | tensorflow/python/saved_model/loader_impl.py | 6 | 17030 | # 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 |
williechen/DailyApp | 08/Stocks/StocksPrice.py | 1 | 2421 | import csv
import logging
import random
from StockUrllib import getFundURL
from io import StringIO
class OTCFetch():
''' OTCFetch '''
def fetch_data(self, stock_no, nowdatetime):
""" Fetch data from gretai.org.tw(OTC)
return list.
從 gretai.org.tw 下載資料,回傳格式為 csv.reader
... | lgpl-3.0 |
BehavioralInsightsTeam/edx-platform | common/djangoapps/student/tests/test_login_registration_forms.py | 9 | 8956 | """Tests for the login and registration form rendering. """
import unittest
import urllib
import ddt
from django.conf import settings
from django.urls import reverse
from mock import patch
from third_party_auth.tests.testutil import ThirdPartyAuthTestMixin
from util.testing import UrlResetMixin
from xmodule.modulesto... | agpl-3.0 |
dannydavidson/zerorpc-python | tests/test_events.py | 39 | 5196 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
phalax4/CarnotKE | jyhton/lib-python/2.7/test/test_cmd_line_script.py | 72 | 9577 | # Tests command line execution of scripts
import unittest
import os
import os.path
import test.test_support
from test.script_helper import (run_python,
temp_dir, make_script, compile_script,
assert_python_failure, make_pkg,
... | apache-2.0 |
jfantom/incubator-airflow | airflow/api/common/experimental/pool.py | 27 | 2340 | # -*- coding: utf-8 -*-
#
# 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, software
... | apache-2.0 |
jiangzhuo/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/distlib/util.py | 190 | 51230 | #
# Copyright (C) 2012-2013 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
import... | lgpl-3.0 |
tiansiyuan/zulip | zerver/management/commands/turn_off_digests.py | 113 | 1856 | from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from zerver.lib.actions import do_change_enable_digest_emails
from zerver.models import Realm, UserProfile, get_user_profile_by_email
class Command(BaseCommand):
help = """Turn off digests... | apache-2.0 |
sahilshah/gabriel | gabriel/control/ucomm_relay.py | 3 | 6123 | #!/usr/bin/env python
#
# Cloudlet Infrastructure for Mobile Computing
#
# Author: Kiryong Ha <krha@cmu.edu>
#
# Copyright (C) 2011-2013 Carnegie Mellon University
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | apache-2.0 |
dgarros/ansible | lib/ansible/modules/cloud/amazon/ec2_asg_facts.py | 6 | 14111 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
alcobar/asuswrt-merlin | release/src/router/asusnatnl/pjproject-1.12/tests/pjsua/scripts-recvfrom/231_reg_bad_fail_stale_false_nonce_changed.py | 59 | 1644 | # $Id: 231_reg_bad_fail_stale_false_nonce_changed.py 2392 2008-12-22 18:54:58Z bennylp $
import inc_sip as sip
import inc_sdp as sdp
# In this test we simulate broken server, where:
# - it wants to signal that NONCE has change
# - but it sets stale=false
# For this case pjsip will retry authentication until
# PJSIP_MA... | gpl-2.0 |
chebee7i/twitter | twitterproj/hashtags.py | 1 | 5587 | from __future__ import unicode_literals
from __future__ import division
import collections
import io
import pymongo
from operator import itemgetter
import numpy as np
from .helpers import connect
__all__ = [
'sorted_hashtags',
'sorted_hashtags_unionX',
'sorted_hashtags_unionXY',
'region_sorted_hasht... | unlicense |
amenonsen/ansible | test/units/modules/network/fortios/test_fortios_antivirus_profile.py | 21 | 12375 | # Copyright 2019 Fortinet, 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 program is distributed in the... | gpl-3.0 |
HuimingCheng/AutoGrading | learning/web_Haotian/venv/Lib/importlib/util.py | 26 | 10883 | """Utility code for constructing importers, etc."""
from . import abc
from ._bootstrap import module_from_spec
from ._bootstrap import _resolve_name
from ._bootstrap import spec_from_loader
from ._bootstrap import _find_spec
from ._bootstrap_external import MAGIC_NUMBER
from ._bootstrap_external import cache_from_sourc... | mit |
yanchen036/tensorflow | tensorflow/python/training/ftrl.py | 16 | 12154 | # 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 |
mbauskar/helpdesk-erpnext | erpnext/stock/doctype/stock_entry/stock_entry.py | 1 | 31145 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe import _
from frappe.utils import cstr, cint, flt, comma_or, getdate, nowdate
from erpnext.stock.utils ... | agpl-3.0 |
eadgarchen/tensorflow | tensorflow/contrib/timeseries/python/timeseries/model.py | 27 | 35555 | # 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 |
ngageoint/six-library | externals/coda-oss/build/build.py | 3 | 80702 | import sys, os, types, re, fnmatch, subprocess, shutil, platform, inspect
from os.path import split, isdir, isfile, exists, splitext, abspath, join, \
basename, dirname
from waflib import Options, Utils, Logs, TaskGen, Context
from waflib.Options import OptionsContext
from waflib.Configure import c... | lgpl-3.0 |
jamesgk/robofab | Lib/robofab/misc/test.py | 11 | 3528 | """
doc test requires fontTools to compare and defon to make the test font.
"""
import random
from fontTools.pens.basePen import BasePen
from fontTools.misc import arrayTools
from fontTools.misc import bezierTools
import robofab.misc.arrayTools as noNumpyArrayTools
import robofab.misc.bezierTools as noNumpyBezierToo... | bsd-3-clause |
alx-eu/django | django/dispatch/saferef.py | 218 | 10623 | """
"Safe weakrefs", originally from pyDispatcher.
Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).
"""
import traceback
import weakref
def safeRef(target, onDelete = None):
"""Return a *safe* weak reference to a callable target
target... | bsd-3-clause |
ewindisch/nova | nova/tests/fake_loadables/fake_loadable1.py | 56 | 1267 | # Copyright 2012 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 req... | apache-2.0 |
milchakov/omim | tools/python/tornado_handler.py | 4 | 3003 | from __future__ import print_function
from ResponseProvider import Payload
from ResponseProvider import ResponseProvider
from ResponseProvider import ResponseProviderMixin
from threading import Timer
import os
import threading
import tornado.ioloop
import tornado.web
import logging
class MainHandler(tornado.web.Req... | apache-2.0 |
guineawheek/nxt-python | nxt/ipsock.py | 21 | 1953 | # nxt.ipsock module -- Server socket communication with LEGO Minstorms NXT
# Copyright (C) 2011 zonedaobne, Marcus Wanner
#
# 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 t... | gpl-3.0 |
cloudbau/cinder | cinder/tests/api/v1/test_volume_metadata.py | 3 | 17429 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apach... | apache-2.0 |
alheinecke/tensorflow-xsmm | tensorflow/python/platform/sysconfig.py | 74 | 1745 | # 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 |
netfoo/volatility | volatility/plugins/imageinfo.py | 44 | 4895 | # Volatility
#
# Authors:
# Mike Auty <mike.auty@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 Foundation; either version 2 of the License, or
# (at your op... | gpl-2.0 |
GregGeoghegan/GCoin-GCN-Source | Source/share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
mhvk/baseband | baseband/guppi/base.py | 1 | 15724 | # Licensed under the GPLv3 - see LICENSE
import re
import astropy.units as u
from astropy.utils import lazyproperty
from ..helpers import sequentialfile as sf
from ..base.base import (
FileBase,
StreamReaderBase, StreamWriterBase,
FileOpener, FileInfo)
from .header import GUPPIHeader
from .payload import ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.