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 |
|---|---|---|---|---|---|
tchellomello/home-assistant | homeassistant/components/izone/config_flow.py | 16 | 1219 | """Config flow for izone."""
import asyncio
import logging
from async_timeout import timeout
from homeassistant import config_entries
from homeassistant.helpers import config_entry_flow
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import DISPATCH_CONTROLLER_DISCOVERED, IZONE, TI... | apache-2.0 |
xlzdew/seleniumpr | py/selenium/webdriver/chrome/webdriver.py | 21 | 3050 | #!/usr/bin/python
#
# Copyright 2011-2013 Software freedom conservancy
#
# 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 |
kytos/kytos | kytos/core/exceptions.py | 1 | 3168 | """Kytos Core-Defined Exceptions."""
class KytosCoreException(Exception):
"""Exception thrown when KytosCore is broken."""
def __str__(self):
"""Return message of KytosCoreException."""
return 'KytosCore exception: ' + super().__str__()
class KytosSwitchOfflineException(Exception):
"""E... | mit |
AndreyKedo/My_project_blog | node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # 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.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | gpl-3.0 |
CSC-ORG/Dynamic-Dashboard-2015 | engine/lib/python2.7/site-packages/django/contrib/gis/utils/layermapping.py | 61 | 27125 | # LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
http://geodjango.org/docs/layermapping.html
"""
impo... | mit |
djeo94/CouchPotatoServer | CouchPotato.py | 51 | 4616 | #!/usr/bin/env python
from __future__ import print_function
from logging import handlers
from os.path import dirname
import logging
import os
import select
import signal
import socket
import subprocess
import sys
import traceback
# Root path
base_path = dirname(os.path.abspath(__file__))
# Insert local directories in... | gpl-3.0 |
kynikos/wiki-scripts | ws/parser_helpers/encodings.py | 1 | 7478 | #! /usr/bin/env python3
import string
import re
import unicodedata
__all__ = ["encode", "decode", "dotencode", "urlencode", "urldecode", "queryencode", "querydecode"]
def encode(str_, escape_char="%", encode_chars="", skip_chars="", special_map=None, charset="utf-8", errors="strict"):
"""
Generalized impleme... | gpl-3.0 |
anditto/bitcoin | test/functional/wallet_reorgsrestore.py | 28 | 4745 | #!/usr/bin/env python3
# Copyright (c) 2019-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test tx status in case of reorgs while wallet being shutdown.
Wallet txn status rely on block connect... | mit |
fhaoquan/kbengine | kbe/res/scripts/common/Lib/test/test_set.py | 72 | 63693 | import unittest
from test import support
import gc
import weakref
import operator
import copy
import pickle
from random import randrange, shuffle
import sys
import warnings
import collections
import collections.abc
class PassThru(Exception):
pass
def check_pass_thru():
raise PassThru
yield 1
class BadCmp... | lgpl-3.0 |
postla/OpenNFR-E2 | lib/python/Screens/Rc.py | 1 | 2807 | from Components.Pixmap import MovingPixmap, MultiPixmap
from Tools.Directories import resolveFilename, SCOPE_SKIN
from xml.etree.ElementTree import ElementTree
from Components.config import config, ConfigInteger
from Components.RcModel import rc_model
from boxbranding import getBrandOEM
config.misc.rcused = ConfigInte... | gpl-2.0 |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/indexes/datetimes/test_scalar_compat.py | 2 | 12251 | """
Tests for DatetimeIndex methods behaving like their Timestamp counterparts
"""
from datetime import datetime
import numpy as np
import pytest
from pandas._libs.tslibs.np_datetime import OutOfBoundsDatetime
import pandas as pd
from pandas import DatetimeIndex, Timestamp, date_range
import pandas.util.testing as t... | apache-2.0 |
SimonGriffioen/pascal | PASCAL/external/networkx/readwrite/nx_shp.py | 24 | 8543 | """
*********
Shapefile
*********
Generates a networkx.DiGraph from point and line shapefiles.
"The Esri Shapefile or simply a shapefile is a popular geospatial vector
data format for geographic information systems software. It is developed
and regulated by Esri as a (mostly) open specification for data
interoperabil... | gpl-2.0 |
mfx9/MolarisTools | MolarisTools/QMMM/QMCallerORCA.py | 2 | 5536 | #-------------------------------------------------------------------------------
# . File : QMCallerORCA.py
# . Program : MolarisTools
# . Copyright : USC, Mikolaj Feliks (2015-2018)
# . License : GNU GPL v3.0 (http://www.gnu.org/licenses/gpl-3.0.en.html)
#------------------------------------------------... | gpl-3.0 |
mrshirts/InterMol | intermol/forces/lj_c_pair_type.py | 2 | 1591 | import parmed.unit as units
from intermol.decorators import accepts_compatible_units
from intermol.forces.abstract_pair_type import AbstractPairType
class LjCPairType(AbstractPairType):
__slots__ = ['C6', 'C12', 'scaleLJ', 'scaleQQ', 'long']
@accepts_compatible_units(None, None,
... | mit |
thoreg/satchmo | satchmo/apps/payment/modules/giftcertificate/tests.py | 12 | 4097 | from decimal import Decimal
from django.contrib.sites.models import Site
from django.test import TestCase
from keyedcache import cache_delete
from l10n.models import Country
from livesettings import config_value
from models import *
from product.models import Product
from satchmo_store.contact.models import AddressBook... | bsd-3-clause |
cjevning/tripping-octo-shame | retrieve_metadata.py | 1 | 8091 | import os
import eyed3
import re
import sys
import urllib
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import NoSuchElementException
from... | mit |
wearpants/osf.io | scripts/tests/test_migrate_presentation_service.py | 60 | 2854 | from tests.base import OsfTestCase
from tests.factories import UserFactory, ProjectFactory, UnconfirmedUserFactory
from framework.auth import Auth
from scripts.migrate_presentation_service import (
do_migration, get_targets, migrate_project_contributed
)
class TestMigrateManualMergedUser(OsfTestCase):
def te... | apache-2.0 |
bahamas10/Viridian | AmpacheTools/xmlparse.py | 2 | 3942 | #!/usr/bin/env python
#
# Copyright (c) 2012, Dave Eddy <dave@daveeddy.com>
# 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
#... | bsd-3-clause |
esikachev/scenario | sahara/plugins/mapr/versions/v4_0_1_mrv2/version_handler.py | 1 | 2104 | # Copyright (c) 2015, MapR Technologies
#
# 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... | apache-2.0 |
anorfleet/turntable | test/lib/python2.7/site-packages/scipy/cluster/setup.py | 71 | 1216 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import sys
if sys.version_info[0] >= 3:
DEFINE_MACROS = [("SCIPY_PY3K", None)]
else:
DEFINE_MACROS = []
def configuration(parent_package='', top_path=None):
from numpy.distutils.system_info import get_info
from nu... | mit |
ychfan/tensorflow | tensorflow/python/kernel_tests/segment_reduction_ops_test.py | 13 | 28505 | # 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 |
anksp21/Community-Zenpacks | ZenPacks.community.HPMon/ZenPacks/community/HPMon/modeler/plugins/community/snmp/HPExpansionCardMap.py | 2 | 2624 | ################################################################################
#
# This program is part of the HPMon Zenpack for Zenoss.
# Copyright (C) 2008 Egor Puzanov.
#
# This program can be used under the GNU General Public License version 2
# You can find full information here: http://www.zenoss.com/oss
#
####... | gpl-2.0 |
dudonwai/dudonsblog | Lib/site-packages/django/middleware/gzip.py | 478 | 1831 | import re
from django.utils.cache import patch_vary_headers
from django.utils.text import compress_sequence, compress_string
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(object):
"""
This middleware compresses content if the browser allows gzip compression.
It sets the Vary header acco... | mit |
gmalecha/loop-to-sat | loop.py | 1 | 6779 | #!/usr/bin/python
#
# This program converts a infinity game board into an smt2 formula.
# Use --help to get a description of the arguments. The input file
# uses the following symbols:
#
# - '0' represents a blank
# - '1' represents one connection
# - '|' represents a line
# - 'L' represents an angle connector
# - 'T' ... | mit |
suhe/odoo | addons/website_mail_channel/models/mail_channel.py | 30 | 1083 | # -*- coding: utf-8 -*-
from openerp import api
from openerp.osv import osv
from openerp.tools.safe_eval import safe_eval as eval
from openerp.addons.website.models.website import slug
class MailGroup(osv.Model):
_inherit = 'mail.channel'
@api.cr_uid_ids_context
def message_get_email_values(self, cr, ui... | gpl-3.0 |
amirrpp/django-oscar | src/oscar/apps/payment/abstract_models.py | 32 | 11209 | from decimal import Decimal
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from oscar.core.utils import get_default_currency
from oscar.core.compat import AUTH_USER_MODEL
from oscar.templatetags.currency_filters import... | bsd-3-clause |
dymkowsk/mantid | scripts/test/SANS/gui_logic/run_tab_presenter_test.py | 1 | 13302 |
from __future__ import (absolute_import, division, print_function)
import unittest
import sys
import mantid
from mantid.kernel import config
from mantid.kernel import PropertyManagerDataService
from sans.gui_logic.presenter.run_tab_presenter import RunTabPresenter
from sans.common.enums import (SANSFacility, Reduct... | gpl-3.0 |
leppa/home-assistant | homeassistant/components/roku/media_player.py | 2 | 6134 | """Support for the Roku media player."""
import logging
import requests.exceptions
from roku import Roku
from homeassistant.components.media_player import MediaPlayerDevice
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MOVIE,
SUPPORT_NEXT_TRACK,
SUPPORT_PLAY,
SUPPORT_PLAY_MEDIA,... | apache-2.0 |
yanlookwatchsee/odoo_management_script | dpsync.py | 1 | 1203 | #!/usr/bin/python
import subprocess as sp
import os
from dropbox import client, rest, session
class DpClient:
def login(self):
self.DP_PASS_FILE = '/home/ubuntu/.dropboxpass'
with open(self.DP_PASS_FILE) as f:
l = f.read().split()
self.app_key, self.app_secret = l[0], l[1]
self.flow = client.DropboxOAuth... | apache-2.0 |
vinayan3/clpricehistory | django/conf/__init__.py | 146 | 6707 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import os
import re
import time # Needed for Windows
import... | bsd-3-clause |
Webstr-framework/webstr | webstr/core/config.py | 1 | 1347 | """
Central configuration module of webstr selenium tests.
This module provides configuration options along with default values and
function to redefine values.
"""
# Copyright 2016 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | apache-2.0 |
madscientist42/gnome15 | src/plugins/voip-teamspeak3/ts3/__init__.py | 8 | 7766 | # Gnome15 - Suite of tools for the Logitech G series keyboards and headsets
# Copyright (C) 2012 Brett Smith <tanktarta@blueyonder.co.uk>
#
# 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, e... | gpl-3.0 |
brijeshkesariya/odoo | addons/l10n_vn/__openerp__.py | 342 | 1697 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved.
#
# This program is free software: you can redistribute it and/or... | agpl-3.0 |
avneesh91/django | django/contrib/gis/gdal/datasource.py | 32 | 4577 | """
DataSource is a wrapper for the OGR Data Source object, which provides
an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
GDAL-supported data source. For example, a SHP file or a
TIGER/Line... | bsd-3-clause |
idea4bsd/idea4bsd | python/lib/Lib/site-packages/django/views/csrf.py | 289 | 3834 | from django.http import HttpResponseForbidden
from django.template import Context, Template
from django.conf import settings
# We include the template inline since we need to be able to reliably display
# this error message, especially for the sake of developers, and there isn't any
# other way of making it available ... | apache-2.0 |
MQQiang/kbengine | kbe/res/scripts/common/Lib/idlelib/WindowList.py | 153 | 2472 | from tkinter import *
class WindowList:
def __init__(self):
self.dict = {}
self.callbacks = []
def add(self, window):
window.after_idle(self.call_callbacks)
self.dict[str(window)] = window
def delete(self, window):
try:
del self.dict[str(window)]
... | lgpl-3.0 |
felipenaselva/felipe.repository | script.module.placenta/lib/resources/lib/sources/en/to_be_fixed/needsfixing/pubfilmonline.py | 1 | 4457 | # -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @tantrumdev wrote this file. As long as you retain this notice you
# can do whatever you want wit... | gpl-2.0 |
ryfeus/lambda-packs | Tensorflow/source/tensorflow/python/estimator/training.py | 2 | 31332 | # 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... | mit |
s20121035/rk3288_android5.1_repo | external/chromium_org/native_client_sdk/src/tools/tests/fix_deps_test.py | 104 | 2807 | #!/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.
import os
import sys
import tempfile
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.d... | gpl-3.0 |
CoderBotOrg/coderbotsrv | server/lib/cryptography/hazmat/bindings/commoncrypto/common_digest.py | 15 | 1598 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <CommonCrypto/CommonDigest.h>
"""
TYPES = """
ty... | gpl-3.0 |
0k/OpenUpgrade | addons/account/project/wizard/account_analytic_inverted_balance_report.py | 378 | 2045 | # -*- 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 |
ianyh/heroku-buildpack-python-opencv | vendor/pip-1.5.4/pip/_vendor/requests/compat.py | 571 | 2556 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.x
is_py31 =... | mit |
kgilmo/penning_artiq | artiq/frontend/artiq_client.py | 1 | 10078 | #!/usr/bin/env python3
import argparse
import logging
import time
import asyncio
import sys
from operator import itemgetter
from dateutil.parser import parse as parse_date
from prettytable import PrettyTable
from artiq.protocols.pc_rpc import Client
from artiq.protocols.sync_struct import Subscriber
from artiq.proto... | gpl-3.0 |
nicky-ji/edx-nicky | common/djangoapps/track/migrations/0002_auto__add_field_trackinglog_host__chg_field_trackinglog_event_type__ch.py | 189 | 2486 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TrackingLog.host'
db.add_column('track_trackinglog', 'host',
self.gf('... | agpl-3.0 |
luca76/QGIS | python/plugins/processing/script/scripts/Chainage.py | 2 | 1141 | ##[Example scripts]=group
##lines=vector
##distance=number 1
##startpoint=number 0
##endpoint=number 0
##output=output vector
from qgis.core import *
from PyQt4.QtCore import *
from processing.core.VectorWriter import VectorWriter
def create_points(feat):
geom = feat.geometry()
length = geom.length()
cur... | gpl-2.0 |
cheehieu/bitcoin | qa/rpc-tests/test_framework/netutil.py | 328 | 4562 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Linux network utilities
import sys
import socket
import fcntl
import struct
import array
import os
import bi... | mit |
simongoffin/my_odoo_tutorial | openerp/workflow/__init__.py | 378 | 3793 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 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 |
m2ware/ControlSocket | src/tinyxml/setversion.py | 33 | 2478 | # Python program to set the version.
##############################################
import re
import sys
def fileProcess( name, lineFunction ):
filestream = open( name, 'r' )
if filestream.closed:
print( "file " + name + " not open." )
return
output = ""
print( "--- Processing " + name + " -----... | mit |
crishoj/got-your-back | googleapiclient/errors.py | 57 | 3622 | # 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 ... | apache-2.0 |
CentroGeo/geonode | geonode/geoapps/api/serializers.py | 2 | 5333 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2020 OSGeo
#
# 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 ... | gpl-3.0 |
mathwuyue/sdn-d2d | tests/unit/module_load_test.py | 46 | 1777 | #!/usr/bin/env python
#
# Copyright 2011-2012 Andreas Wundsam
#
# 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 applic... | apache-2.0 |
daoluan/decode-Django | Django-1.5.1/django/contrib/gis/admin/options.py | 112 | 5554 | from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.gdal import OGRGeomType
from django.contrib.gis.db import models
class GeoModelAdmin(ModelAdmin):
"""
The administration options class for Geographic models. Map settings
may be... | gpl-2.0 |
godfather1103/WeiboRobot | python27/1.0/lib/test/test_curses.py | 44 | 9518 | #
# Test script for the curses module
#
# This script doesn't actually display anything very coherent. but it
# does call every method and function.
#
# Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(),
# init_color()
# Only called, not tested: getmouse(), ungetmouse()
#
import sys, tempfile, os
... | gpl-3.0 |
peterfroehlich/lightblue-0.4 | src/series60/_lightblue.py | 36 | 14171 | # Copyright (c) 2009 Bea Lam. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue 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 l... | gpl-3.0 |
fatcloud/PyCV-time | challanges/shape-challenge/find_arrows/find_arrows.py | 3 | 2877 |
import cv2
import numpy as np
from webcam_gui import webcam_gui
def angle(p1, p2, p3):
v1 = p1 - p2
v2 = p3 - p2
v1 = v1.astype(float)
v2 = v2.astype(float)
v1 = v1 / np.sqrt(np.dot(v1, v1))
v2 = v2 / np.sqrt(np.dot(v2, v2))
return np.degrees(np.arccos(np.dot(v1, v2)))
def isArrow(he... | mit |
odoo-brazil/PySPED | pysped/nfe/leiaute/conscad_101.py | 4 | 12584 | # -*- coding: utf-8 -*-
#
# PySPED - Python libraries to deal with Brazil's SPED Project
#
# Copyright (C) 2010-2012
# Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Library General Public Lic... | lgpl-2.1 |
fplll/strategizer | strategize.py | 1 | 11203 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
u"""
Find BKZ reduction strategies using timing experiments.
.. moduleauthor:: Martin R. Albrecht <fplll-devel@googlegroups.com>
.. moduleauthor:: Léo Ducas <fplll-devel@googlegroups.com>
.. moduleauthor:: Marc Stevens <fplll-devel@googlegroups.com>
"""
# We use multi... | gpl-3.0 |
mahendra-r/edx-platform | cms/djangoapps/contentstore/features/common.py | 42 | 12769 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
import os
from lettuce import world, step
from nose.tools import assert_true, assert_in # pylint: disable=no-name-in-module
from django.conf import settings
from student.roles import CourseStaffRole, CourseInstructorRole, GlobalStaff
from stu... | agpl-3.0 |
fortes/Rfugee | lib/requests-2.7.0-py2.7.egg/requests/packages/urllib3/exceptions.py | 487 | 4374 |
## Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class PoolError(HTTPError):
"Base exception for errors caused within a pool."
def __init__(self, pool, message):
self.pool ... | mit |
krzysz00/rust | src/etc/check-sanitycheck.py | 37 | 1805 | #!/usr/bin/env python
#
# Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice... | apache-2.0 |
mahak/nova | nova/tests/functional/test_login.py | 25 | 1128 | # Copyright 2011 Justin Santa Barbara
# 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 |
msabramo/PyHamcrest | tests/hamcrest_unit_test/collection/is_empty_test.py | 2 | 1798 | from __future__ import absolute_import
from hamcrest.library.collection.is_empty import *
from hamcrest_unit_test.matcher_test import MatcherTest
from .sequencemixin import GeneratorForm, SequenceForm
__author__ = "Chris Rose"
__copyright__ = "Copyright 2012 hamcrest.org"
__license__ = "BSD, see License.txt"
class ... | bsd-3-clause |
nthiep/global-ssh-server | lib/python2.7/site-packages/rest_framework/pagination.py | 8 | 26998 | # coding: utf-8
"""
Pagination serializers determine the structure of the output that should
be used for paginated responses.
"""
from __future__ import unicode_literals
from base64 import b64encode, b64decode
from collections import namedtuple
from django.core.paginator import InvalidPage, Paginator as DjangoPaginator... | agpl-3.0 |
agjohnson/readthedocs.org | readthedocs/rtd_tests/tests/test_sync_versions.py | 2 | 8267 | import json
from django.test import TestCase
from builds.models import Version
from builds.constants import STABLE
from projects.models import Project
class TestSyncVersions(TestCase):
fixtures = ["eric", "test_data"]
def setUp(self):
self.client.login(username='eric', password='test')
self... | mit |
zhhf/charging | charging/plugins/cisco/network_plugin.py | 5 | 6800 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Cisco Systems, 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... | apache-2.0 |
daoluan/decode-Django | Django-1.5.1/django/contrib/auth/tests/context_processors.py | 96 | 6747 | import os
from django.conf import global_settings
from django.contrib.auth import authenticate
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.context_processors impo... | gpl-2.0 |
Godiyos/python-for-android | python3-alpha/python3-src/Tools/scripts/ifdef.py | 48 | 3718 | #! /usr/bin/env python3
# Selectively preprocess #ifdef / #ifndef statements.
# Usage:
# ifdef [-Dname] ... [-Uname] ... [file] ...
#
# This scans the file(s), looking for #ifdef and #ifndef preprocessor
# commands that test for one of the names mentioned in the -D and -U
# options. On standard output it writes a cop... | apache-2.0 |
sestrella/ansible | test/units/module_utils/network/ftd/test_configuration.py | 19 | 25072 | # Copyright (c) 2018 Cisco and/or its affiliates.
#
# 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 v... | gpl-3.0 |
axinging/sky_engine | build/android/pylib/uirobot/uirobot_test_instance.py | 42 | 2064 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import json
import logging
from pylib import constants
from pylib.base import test_instance
from pylib.utils import apk_helper
class UirobotTestI... | bsd-3-clause |
albertomurillo/ansible | lib/ansible/modules/cloud/vultr/vultr_account_facts.py | 28 | 3335 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
Kast0rTr0y/ansible | lib/ansible/modules/storage/netapp/na_cdot_svm.py | 15 | 8677 | #!/usr/bin/python
# (c) 2017, NetApp, Inc
#
# 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 |
saimn/astropy | astropy/coordinates/attributes.py | 3 | 18234 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# Dependencies
import numpy as np
# Project
from astropy import units as u
from astropy.utils import ShapedLikeNDArray
__all__ = ['Attribute', 'TimeAttribute', 'QuantityAttribute',
'EarthLocationAttribute', 'Coordinat... | bsd-3-clause |
Cinntax/home-assistant | tests/components/input_select/test_init.py | 4 | 8756 | """The tests for the Input select component."""
# pylint: disable=protected-access
import asyncio
from homeassistant.loader import bind_hass
from homeassistant.components.input_select import (
ATTR_OPTION,
ATTR_OPTIONS,
DOMAIN,
SERVICE_SET_OPTIONS,
SERVICE_SELECT_NEXT,
SERVICE_SELECT_OPTION,
... | apache-2.0 |
sbrunner/openlayers | tests/selenium/remotecontrol/selenium.py | 254 | 69389 |
"""
Copyright 2006 ThoughtWorks, 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 writing, sof... | bsd-2-clause |
draperjames/bokeh | bokeh/plotting/figure.py | 3 | 18251 | from __future__ import absolute_import, print_function
import logging
logger = logging.getLogger(__name__)
from six import string_types
from ..core.properties import Auto, Either, Enum, Float, Int, Seq, Instance, String, Tuple
from ..core.enums import HorizontalLocation, VerticalLocation
from ..models import Plot
fr... | bsd-3-clause |
fayf/pyload | module/plugins/hooks/Captcha9Kw.py | 13 | 9806 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import re
import time
from base64 import b64encode
from module.network.HTTPRequest import BadHeader
from module.plugins.internal.Hook import Hook, threaded
class Captcha9Kw(Hook):
__name__ = "Captcha9Kw"
__type__ = "hook"
__version__ ... | gpl-3.0 |
zenefits/selenium | py/test/selenium/webdriver/common/utils.py | 68 | 2155 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
skurochkin/selenium | py/selenium/webdriver/common/by.py | 69 | 1275 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
adaxi/couchpotato | libs/tmdb3/tmdb_api.py | 14 | 33019 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: tmdb_api.py Simple-to-use Python interface to TMDB's API v3
# Python Library
# Author: Raymond Wagner
# Purpose: This Python library is intended to provide a series of classes
# and methods for search and retrieval of text metada... | gpl-3.0 |
awalls-cx18/gnuradio | gr-vocoder/python/vocoder/cvsd.py | 6 | 3765 | #!/usr/bin/env python
#
# Copyright 2007,2011 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 optio... | gpl-3.0 |
tverlaan/ansible-modules-core | source_control/git.py | 47 | 30762 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (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... | gpl-3.0 |
MichaelMraka/hawkey | tests/python/tests/test_advisory.py | 3 | 3068 | #
# Copyright (C) 2014 Red Hat, Inc.
#
# Licensed under the GNU Lesser General Public License Version 2.1
#
# 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 Lic... | lgpl-2.1 |
jag1g13/lammps | tools/i-pi/ipi/inputs/prng.py | 33 | 4326 | """Deals with creating the random number generator.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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 ... | gpl-2.0 |
eunchong/build | scripts/slave/bot_update.py | 1 | 62497 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(hinoka): Use logging.
import cStringIO
import codecs
import collections
import copy
import ctypes
import json
import optparse
i... | bsd-3-clause |
ingadhoc/odoo-addons | base_currency_inverse_rate/models/res_currency.py | 7 | 1413 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields, api
import log... | agpl-3.0 |
dancingdan/tensorflow | tensorflow/python/data/experimental/ops/resampling.py | 13 | 11963 | # 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 |
cctaylor/googleads-python-lib | examples/dfa/v1_20/create_content_category.py | 4 | 1709 | #!/usr/bin/python
#
# 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 b... | apache-2.0 |
torchingloom/edx-platform | common/lib/xmodule/xmodule/modulestore/xml_importer.py | 2 | 36277 | import logging
import os
import mimetypes
from path import path
import json
from .xml import XMLModuleStore, ImportSystem, ParentTracker
from xmodule.modulestore import Location
from xblock.runtime import KvsFieldData, DictKeyValueStore
from xmodule.x_module import XModuleDescriptor
from xblock.fields import Scope, Re... | agpl-3.0 |
DavidNorman/tensorflow | tensorflow/lite/python/convert_saved_model.py | 17 | 7669 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
AtonLerin/pymel | pymel/core/rendering.py | 8 | 4108 | """Functions related to rendering"""
import pymel.util as _util
import pymel.internal.factories as _factories
import general as _general
import language as _language
import pymel.internal.pmcmds as cmds
def shadingNode(*args, **kwargs):
res = cmds.shadingNode(*args, **kwargs)
if res is not None:
retu... | bsd-3-clause |
byakuinss/spark | python/pyspark/mllib/stat/_statistics.py | 66 | 13383 | #
# 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 |
atmchrispark/linux-at91 | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
openvapour/ryu | ryu/app/ofctl_rest.py | 10 | 26827 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
hmgaudecker/econ-project-templates | docs/bld/example/python/python_example/.mywaflib/waflib/extras/pytest.py | 53 | 8289 | #! /usr/bin/env python
# encoding: utf-8
# Calle Rosenquist, 2016-2018 (xbreak)
"""
Provides Python unit test support using :py:class:`waflib.Tools.waf_unit_test.utest`
task via the **pytest** feature.
To use pytest the following is needed:
1. Load `pytest` and the dependency `waf_unit_test` tools.
2. Create a task ... | bsd-3-clause |
again4you/retext | ReText/tablemode.py | 3 | 5647 | # This file is part of ReText
# Copyright: 2014 Maurice van der Pot
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
... | gpl-3.0 |
curiosityio/taiga-docker | taiga-back/taiga-back/tests/integration/test_webhooks_tasks.py | 1 | 10425 | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Anler Hernández <hello@anler.me>
# This ... | mit |
diverted247/signer | libs/xhtml2pdf/xhtml2pdf/w3c/css.py | 25 | 28101 | #!/usr/bin/env python
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##~ Copyright (C) 2002-2004 TechGame Networks, LLC.
##~
##~ This library is free software; you can redistribute it and/or
##~ modify it under the terms of the BSD style License as found in the
##~ LICENSE file included with this distribution.... | mit |
zachriggle/idapython | pywraps/sidc.py | 15 | 15035 | # ----------------------------------------------------------------------
#
# Misc constants
#
UA_MAXOP = 6
# ----------------------------------------------------------------------
# instruc_t related constants
#
# instruc_t.feature
#
CF_STOP = 0x00001 # Instruction doesn't pass execution to the next in... | bsd-3-clause |
tryton/webdav | protocol.py | 1 | 21510 | # This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import SocketServer
import socket
import BaseHTTPServer
import urlparse
import time
import urllib
import logging
from threading import local, Thread
import xml.dom.minidom
impo... | gpl-3.0 |
chrxr/wagtail | wagtail/contrib/wagtailapi/tests/test_pages.py | 7 | 28976 | from __future__ import absolute_import, unicode_literals
import collections
import json
import mock
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from wagtail.contrib.wagtailapi import signal_handlers
from wagtail.tests.demosite import m... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.