code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
import pytest
from zeroless import (Server, Client)
class TestClientServer:
def test_server_port_property(self):
port = 1050
server = Server(port=port)
assert server.port == port
def test_client_addresses_property(self):
client = Client()
addresses = (('10.0.0.1', 156... | x8lucas8x/python-zeroless | tests/test_client_server.py | Python | lgpl-2.1 | 483 |
#!/usr/bin/python3 -u
#---- Includes ----#
from ..army_architect import Bot_blueprint, Army_blueprint
#---- General Settings ----#
army_name = "The Hungry Zombie Kittens"
army_description = "Previously these kittens ate cat food. But now they wan't to eat your freakin' soul! (And your body to of course, after they rip... | ProfessorKaos64/openlierox | share/gamedir/scripts/tools/army_patterns/hungry_zombie_kittens.py | Python | lgpl-2.1 | 2,288 |
###############################################################################
# volumina: volume slicing and editing library
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# modify it und... | jakirkham/volumina | volumina/layerwidget_plugin.py | Python | lgpl-3.0 | 3,021 |
from rez.exceptions import ReleaseVCSError
from rez.packages_ import get_developer_package
from rez.util import which
from rez.utils.system import popen
from rez.utils.logging_ import print_debug
from rez.utils.filesystem import walk_up_dirs
from pipes import quote
import subprocess
def get_release_vcs_types():
"... | cwmartin/rez | src/rez/release_vcs.py | Python | lgpl-3.0 | 8,750 |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationradiuspolicy_authenticationvserver_binding.py | Python | apache-2.0 | 5,569 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | YoshikawaMasashi/magenta | magenta/music/notebook_utils.py | Python | apache-2.0 | 1,557 |
import sys
sys.path.insert(1, "../../../")
import h2o
def ozoneKM(ip, port):
# Connect to a pre-existing cluster
# connect to localhost:54321
train = h2o.import_file(path=h2o.locate("smalldata/glm_test/ozone.csv"))
# See that the data is ready
print train.describe()
# Run KMeans
my_km = h2o.kmeans(x... | PawarPawan/h2o-v3 | h2o-py/tests/testdir_algos/kmeans/pyunit_ozoneKmeans.py | Python | apache-2.0 | 589 |
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2015-2016 Cara Vinson <ceridwenv@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
... | arju88nair/projectCulminate | venv/lib/python3.5/site-packages/astroid/raw_building.py | Python | apache-2.0 | 15,733 |
# coding:utf-8
import logging
import regex as re
import email.quoprimime
import email.base64mime
from base64 import b64encode
from flanker.mime.message import charsets, errors
log = logging.getLogger(__name__)
#deal with unfolding
foldingWhiteSpace = re.compile(r"(\n\r?|\r\n?)(\s*)")
def unfold(value):
"""
... | alex/flanker | flanker/mime/message/headers/encodedword.py | Python | apache-2.0 | 3,690 |
# 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 applicab... | derekjchow/models | research/feelvos/utils/video_input_generator.py | Python | apache-2.0 | 24,003 |
# -*- coding: utf-8 -*-
"""
twython.streaming.types
~~~~~~~~~~~~~~~~~~~~~~~
This module contains classes and methods for :class:`TwythonStreamer` to use.
"""
class TwythonStreamerTypes(object):
"""Class for different stream endpoints
Not all streaming endpoints have nested endpoints.
User Streams and S... | dakiri/splunk-app-twitter | twitter2/bin/twython/streaming/types.py | Python | apache-2.0 | 2,822 |
"""Support for Hive light devices."""
from datetime import timedelta
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
LightEntity,
)
from homeassistant.helpers.entity import DeviceInfo
import... | jawilson/home-assistant | homeassistant/components/hive/light.py | Python | apache-2.0 | 5,000 |
# Copyright 2015-2017 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | joelagnel/trappy | trappy/plotter/ILinePlot.py | Python | apache-2.0 | 11,149 |
from flask.ext.wtf import Form
from wtforms import StringField, BooleanField, PasswordField
from wtforms.validators import DataRequired
class LoginForm(Form):
email = StringField('email', validators=[DataRequired()])
password = PasswordField('password', validators=[DataRequired()])
remember_me = BooleanFie... | russorat/savage-leads | settings/models/loginForm.py | Python | apache-2.0 | 353 |
# 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... | mdrumond/tensorflow | tensorflow/contrib/eager/python/network_test.py | Python | apache-2.0 | 3,454 |
# 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... | gunan/tensorflow | tensorflow/python/keras/engine/training_dataset_test.py | Python | apache-2.0 | 21,265 |
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Erkan Ozgur Yilmaz
#
# This module is part of oyProjectManager and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
"""
Database Module
===============
This is where all the magic happens.
.. versionadded:: 0.2.0
SQLite3 Datab... | dshlai/oyprojectmanager | oyProjectManager/db/__init__.py | Python | bsd-2-clause | 5,475 |
import os, sys
###########
def verbose_print(msg):
print msg
###########
def linetrim(s):
return s.replace('\r', '').replace('\n','')
###
def sublast(s, s2):
return s[s.find(s2)+len(s2):]
def parse_package(fpath):
#p = fpath[:fpath.rfind('/')]
p = fpath
package = 'konoha'
if p.find('/konoha/') != -1:
ret... | shidasan/konoha2 | src/vm/pygenlib2.py | Python | bsd-2-clause | 8,371 |
"""
A module of classification schemes for choropleth mapping.
"""
__author__ = "Sergio J. Rey"
__all__ = ['Map_Classifier', 'quantile', 'Box_Plot', 'Equal_Interval',
'Fisher_Jenks', 'Fisher_Jenks_Sampled', 'Jenks_Caspall',
'Jenks_Caspall_Forced', 'Jenks_Caspall_Sampled',
'Max_P_Classi... | spreg-git/pysal | pysal/esda/mapclassify.py | Python | bsd-3-clause | 50,683 |
from tests.testing_framework.base_test_cases import BaseTestCase
from flexmock import flexmock
from hamcrest import *
from framework.plugin.plugin_params import PluginParams
import re
from hamcrest.library.text.stringmatches import matches_regexp
class PluginParamsTests(BaseTestCase):
def before(self):
s... | sharad1126/owtf | tests/test_cases/framework/plugin/plugin_params_tests.py | Python | bsd-3-clause | 4,663 |
"""
Floater Class: Velocity style controller for floating point values with
a label, entry (validated), and scale
"""
__all__ = ['Floater', 'FloaterWidget', 'FloaterGroup']
from direct.showbase.TkGlobal import *
from Tkinter import *
from Valuator import Valuator, VALUATOR_MINI, VALUATOR_FULL
from dir... | toontownfunserver/Panda3D-1.9.0 | direct/tkwidgets/Floater.py | Python | bsd-3-clause | 13,935 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# domains.py: module for domains of model outcomes
##
# © 2017, Chris Ferrie (csferrie@gmail.com) and
# Christopher Granade (cgranade@cgranade.com).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the... | QInfer/python-qinfer | src/qinfer/domains.py | Python | bsd-3-clause | 19,964 |
#!/usr/bin/env python
'''
Plot degree values for a given set of nodes in a simple circle plot.
'''
import numpy as np
import matplotlib.pyplot as plt
import mne
from jumeg import get_jumeg_path
from jumeg.connectivity import plot_degree_circle
import bct
orig_labels_fname = get_jumeg_path() + '/data/desikan_label_... | fboers/jumeg | examples/connectivity/plot_degree_circle.py | Python | bsd-3-clause | 694 |
#!/usr/bin/env python
# -----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------... | JWDebelius/scikit-bio | skbio/parse/sequences/tests/__init__.py | Python | bsd-3-clause | 378 |
# -*- coding: utf-8 -*-
"""Unit/Functional tests"""
from __future__ import with_statement, unicode_literals
import datetime
import os
import sys
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.views.main import ChangeList
from django.contrib.auth.models import User
from django.contrib.messa... | suziesparkle/wagtail | wagtail/vendor/django-treebeard/treebeard/tests/test_treebeard.py | Python | bsd-3-clause | 90,877 |
from django.conf import settings
from django.template import (Template, Context, TemplateDoesNotExist,
TemplateSyntaxError)
from django.utils.encoding import smart_unicode
from django.utils.hashcompat import md5_constructor
from django.views.debug import ExceptionReporter
class ImprovedExceptionReporter(ExceptionR... | dcramer/django-db-log | djangodblog/helpers.py | Python | bsd-3-clause | 9,425 |
from collections import OrderedDict
from math import sqrt
import numpy as np
import pyqtgraph as pg
from qtpy import QtWidgets
import skrf
from . import smith_chart, util
class NetworkPlotWidget(QtWidgets.QWidget):
S_VALS = OrderedDict((
("decibels", "db"),
("magnitude", "mag"),
("phase ... | temmeand/scikit-rf | qtapps/skrf_qtwidgets/networkPlotWidget.py | Python | bsd-3-clause | 14,303 |
"""
``nanshe`` package, an image processing toolkit.
===============================================================================
Overview
===============================================================================
The ``nanshe`` package is an image processing package that contains a variety
of different techn... | DudLab/nanshe | nanshe/__init__.py | Python | bsd-3-clause | 9,198 |
# 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.
from __future__ import absolute_import
import os
from telemetry.core import util
from telemetry.core import memory_cache_http_server
from telemetry.testing ... | catapult-project/catapult | telemetry/telemetry/core/memory_cache_http_server_unittest.py | Python | bsd-3-clause | 3,837 |
"""
========================================================
Hierarchical clustering (:mod:`scipy.cluster.hierarchy`)
========================================================
.. currentmodule:: scipy.cluster.hierarchy
These functions cut hierarchical clusterings into flat clusterings
or find the roots of the forest f... | witcxc/scipy | scipy/cluster/hierarchy.py | Python | bsd-3-clause | 94,372 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
from types import MappingProxyType
# THIRD PARTY
import numpy as np
import pytest
# LOCAL
from astropy.cosmology import parameters, realizations
def test_realizations_in_dir():
"""Test the realizations are in ``dir`` of :mod:`astropy.cosm... | pllim/astropy | astropy/cosmology/tests/test_parameters.py | Python | bsd-3-clause | 1,438 |
# Copyright (c) 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.
"""ResourceFinder is a helper class for finding resources given their name."""
import codecs
import os
from py_vulcanize import module
from py_vulcaniz... | endlessm/chromium-browser | third_party/catapult/common/py_vulcanize/py_vulcanize/resource_loader.py | Python | bsd-3-clause | 7,961 |
# Copyright (C) 2009-2013 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided... | drmelectronic/Despacho | usb/backend/libusb0.py | Python | bsd-3-clause | 20,780 |
"""
Provide basic components for groupby. These definitions
hold the allowlist of methods that are exposed on the
SeriesGroupBy and the DataFrameGroupBy objects.
"""
from __future__ import annotations
import dataclasses
from typing import Hashable
@dataclasses.dataclass(order=True, frozen=True)
class OutputKey:
... | rs2/pandas | pandas/core/groupby/base.py | Python | bsd-3-clause | 3,488 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
from geopy.distance import great_circle
from s2sphere import Cell, CellId, LatLng
from pokemongo_bot import inventory
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.item_list import Item
from pokemongo_bot.walkers.polyline_w... | cmezh/PokemonGo-Bot | pokemongo_bot/cell_workers/pokemon_hunter.py | Python | mit | 6,128 |
from __future__ import print_function
from .Console import * | pbmanis/acq4 | acq4/modules/Console/__init__.py | Python | mit | 60 |
import hashlib
import json
from PIL import Image
from django.http import HttpResponse
from django.shortcuts import render
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from crits.core.class_mapper import class_from_id
from crits.core.crits_mongoengine i... | Magicked/crits | crits/screenshots/handlers.py | Python | mit | 13,241 |
import sublime
if int(sublime.version()) < 3000:
import ghci
import ghcmod
import haskell_docs
import hdevtools
import sublime_haskell_common as common
import symbols
else:
import SublimeHaskell.ghci as ghci
import SublimeHaskell.ghcmod as ghcmod
import SublimeHaskell.haskell_docs a... | hcarvalhoalves/SublimeHaskell | util.py | Python | mit | 2,159 |
"""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 articles, rang... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.1/Lib/nntplib.py | Python | mit | 18,078 |
#
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | aronparsons/spacewalk | client/tools/rhncfg/config_common/utils.py | Python | gpl-2.0 | 5,530 |
from django.test import TestCase
from common.templatetags.verbose_name import verbose_name
from users.models import SystersUser
class TemplateTagsTestCase(TestCase):
def test_verbose_names(self):
"""Test verbose_name template tag"""
self.assertEqual(verbose_name(SystersUser, "homepage_url"), "Hom... | willingc/portal | systers_portal/common/tests/test_templatetags.py | Python | gpl-2.0 | 328 |
# 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
im... | mikemcdaid/getonupband | sites/all/themes/getonupband/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | Python | gpl-2.0 | 48,784 |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,shlex,shutil,traceback,errno,sys,stat
from waflib import Utils,Configure,Logs,Options,ConfigSet,Context,Errors,Build,Node
build_dir_override=None
no_climb_com... | bit-trade-one/SoundModuleAP | lib-src/lv2/sratom/waflib/Scripting.py | Python | gpl-2.0 | 10,970 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'urssus/ui/configdialog.ui'
#
# Created: Fri Feb 27 23:57:10 2009
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Dialog(object):
def setupUi(sel... | ralsina/urssus | urssus/ui/Ui_configdialog.py | Python | gpl-2.0 | 1,833 |
#!/usr/bin/env python
# Copyright (c) 2011 The WebRTC project 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 the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. ... | golden1232004/webrtc_new | tools/python_charts/webrtc/main.py | Python | gpl-3.0 | 6,301 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012 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 the Li... | JenSte/libsigrokdecode | decoders/jtag_stm32/__init__.py | Python | gpl-3.0 | 1,163 |
# 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 ... | GirlsCodePy/girlscode-coursebuilder | modules/math/math.py | Python | gpl-3.0 | 4,047 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Character ranges of letters
letters = 'a-zA-Z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u0103\u0106\u0107\
\u010c-\u010f\u0112-\u0115\u011a-\u012d\u0131\u0141\u0142\u0147\u0148\
\u0150-\u0153\u0158-\u0161\u0164\u0165\u016e-\u0171\u017d\u01... | bnjones/Mathics | mathics/core/characters.py | Python | gpl-3.0 | 43,648 |
#----------------------------------------------------------------------
# I-SIMPA (http://i-simpa.ifsttar.fr). This file is part of I-SIMPA.
#
# I-SIMPA is a GUI for 3D numerical sound propagation modelling dedicated
# to scientific acoustic simulations.
# Copyright (C) 2007-2014 - IFSTTAR - Judicael Picaut, Nicol... | Ifsttar/I-Simpa | src/python_bindings/samples/spps_conversion_resultats.py | Python | gpl-3.0 | 2,657 |
import sys
import subprocess
from .exceptions import PyperclipException
EXCEPT_MSG = """
Pyperclip could not find a copy/paste mechanism for your system.
For more information, please visit https://pyperclip.readthedocs.org """
PY2 = sys.version_info[0] == 2
text_type = str if PY2 else str
def init... | tvaddonsco/tva-release-repo | matrix/plugin.video.realizerx/resources/lib/modules/pyperclip/clipboards.py | Python | gpl-3.0 | 3,970 |
# -*- coding: utf-8 -*-
{
'name': "BestJa: Application Moderation",
'summary': "Two stage recruitment process",
'description': """
BestJa Application Moderation
=============================
Split recruitment process into two separate stages.
The first ("preliminary") stage is handled by offer moderators.
... | KrzysiekJ/bestja | addons/bestja_application_moderation/__openerp__.py | Python | agpl-3.0 | 720 |
# -*- coding: utf-8 -*-
"""
Tests for the Shopping Cart Models
"""
import datetime
from textwrap import dedent
import pytest
import pytz
from django.conf import settings
from mock import patch
import six
from six import StringIO
from six import text_type
from course_modes.models import CourseMode
from shoppingcart.... | msegado/edx-platform | lms/djangoapps/shoppingcart/tests/test_reports.py | Python | agpl-3.0 | 12,763 |
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.db.models.fields import FieldDoesNotExist
from django.core.exceptions import ImproperlyConfigured
from django.utils.timezone import now
from model_utils.managers import QueryManager... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/model_utils/models.py | Python | agpl-3.0 | 3,021 |
"""Poll module is ungraded xmodule used by students to
to do set of polls.
On the client side we show:
If student does not yet anwered - Question with set of choices.
If student have answered - Question with statistics for each answers.
"""
import cgi
import json
import logging
from copy import deepcopy
from collecti... | rationalAgent/edx-platform-custom | common/lib/xmodule/xmodule/poll_module.py | Python | agpl-3.0 | 7,481 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 NUMA Extreme Systems (www.numaes.com) for Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be use... | Jgarcia-IAS/SAT | openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/l10n_pe_ple01/report/sunat_1_1_print.py | Python | agpl-3.0 | 1,980 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyKiwisolver(PythonPackage):
"""A fast implementation of the Cassowary constraint solver""... | LLNL/spack | var/spack/repos/builtin/packages/py-kiwisolver/package.py | Python | lgpl-2.1 | 1,376 |
# Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and Tim Peters
# This module should be kept in sync with ... | lfcnassif/MultiContentViewer | release/modules/ext/libreoffice/program/python-core-3.3.0/lib/decimal.py | Python | lgpl-3.0 | 228,485 |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Test the intersection of Coords
"""
# import iris tests first so that some things can be initialised before importing any... | SciTools/iris | lib/iris/tests/test_intersect.py | Python | lgpl-3.0 | 3,364 |
"""
Support for LIFX Cloud scenes.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/scene.lifx_cloud/
"""
import asyncio
import logging
import voluptuous as vol
import aiohttp
import async_timeout
from homeassistant.components.scene import Scene
from h... | MungoRae/home-assistant | homeassistant/components/scene/lifx_cloud.py | Python | apache-2.0 | 2,931 |
# -*- coding: utf-8 -*-
"""
openload.io urlresolver plugin
Copyright (C) 2015 tknorris
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 v... | mrknow/filmkodi | script.mrknow.urlresolver/lib/urlresolver9/plugins/ol_gmu.py | Python | apache-2.0 | 2,291 |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# 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
#
# ... | kfoss/neon | neon/backends/tests/test_cc2_tensor.py | Python | apache-2.0 | 3,502 |
#
# 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... | spektom/incubator-airflow | airflow/ti_deps/deps/exec_date_after_start_date_dep.py | Python | apache-2.0 | 1,807 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Hashing analyzer."""
import unittest
from plaso.containers import analyzer_result
from plaso.analyzers import hashing_analyzer
from plaso.analyzers.hashers import manager
from tests import test_lib as shared_test_lib
from tests.analyzers.hashers import ... | joachimmetz/plaso | tests/analyzers/hashing_analyzer.py | Python | apache-2.0 | 1,661 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from nose.tools import * # noqa; PEP8 asserts
from webtest_plus import TestApp
import mock
import httplib as http
from flask import Flask
from modularodm import Q
from werkzeug.wrappers import BaseResponse
from framework import auth
from framework.auth im... | brandonPurvis/osf.io | tests/test_auth.py | Python | apache-2.0 | 13,540 |
from __future__ import absolute_import
from django.contrib.auth.models import UserManager
from django.utils.timezone import now as timezone_now
from zerver.models import UserProfile, Recipient, Subscription, Realm, Stream
import base64
import ujson
import os
import string
from six.moves import range
from typing impor... | vabs22/zulip | zerver/lib/create_user.py | Python | apache-2.0 | 3,927 |
from common_fixtures import * # NOQA
def test_link_instance_stop_start(super_client, client, context):
target1 = context.create_container(ports=['180', '122/udp'])
target2 = context.create_container(ports=['280', '222/udp'])
c = context.create_container(instanceLinks={
'target1_link': target1.id... | jimengliu/cattle | tests/integration/cattletest/core/test_link.py | Python | apache-2.0 | 7,262 |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | eatbyte/Swift | test/unit/proxy/test_sysmeta.py | Python | apache-2.0 | 15,680 |
# some modules use the old-style import: explicitly include
# the new module when the old one is referenced
hiddenimports = ["email.mime.text", "email.mime.multipart"]
| supercheetah/diceroller | pyinstaller/PyInstaller/hooks/hook-paste.exceptions.reporter.py | Python | artistic-2.0 | 169 |
"""
#;+
#; NAME:
#; galaxy.core
#; Version 1.0
#;
#; PURPOSE:
#; Core routines for galaxy analysis
#; 29-Nov-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import os, copy,... | astronomeara/xastropy-old | xastropy/galaxy/core.py | Python | bsd-3-clause | 1,859 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-12 13:25
from __future__ import unicode_literals
from django.db import migrations
from django.utils.text import slugify
def create_slugs(apps, schema_editor):
Value = apps.get_model("product", "AttributeChoiceValue")
for value in Value.objects.a... | maferelo/saleor | saleor/product/migrations/0018_auto_20161212_0725.py | Python | bsd-3-clause | 582 |
"""
sphinxit.core.constants
~~~~~~~~~~~~~~~~~~~~~~~
Defines some Sphinx-specific constants.
:copyright: (c) 2013 by Roman Semirook.
:license: BSD, see LICENSE for more details.
"""
from collections import namedtuple
RESERVED_KEYWORDS = (
'AND',
'AS',
'ASC',
'AVG',
'BEGIN',
... | abhijo89/sphinxit | sphinxit/core/constants.py | Python | bsd-3-clause | 1,436 |
# -*- coding: utf-8 -*-
"""
Provides textual descriptions for :mod:`behave.model` elements.
"""
from behave.textutil import indent
# -----------------------------------------------------------------------------
# FUNCTIONS:
# -----------------------------------------------------------------------------
def escape_ce... | WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/behave/model_describe.py | Python | bsd-3-clause | 3,364 |
#!/usr/bin/env python
# Copyright 2020 the V8 project 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 heapq
import os
import platform
import random
import signal
import subprocess
# Base dir of the build products for Release an... | youtube/cobalt | third_party/v8/tools/testrunner/testproc/util.py | Python | bsd-3-clause | 2,389 |
from django.utils.translation import gettext_lazy as _
from wagtail.admin.ui.tables import Column, StatusFlagColumn, TitleColumn
from wagtail.admin.views import generic
from wagtail.admin.viewsets.model import ModelViewSet
from wagtail.core.models import Site
from wagtail.core.permissions import site_permission_policy... | zerolab/wagtail | wagtail/sites/views.py | Python | bsd-3-clause | 1,799 |
"""Tests for Gosper's algorithm for hypergeometric summation. """
from sympy import binomial, factorial, gamma, Poly, S, simplify, sqrt, exp, log, Symbol
from sympy.abc import a, b, j, k, m, n, r, x
from sympy.concrete.gosper import gosper_normal, gosper_sum, gosper_term
def test_gosper_normal():
assert gosper_n... | hrashk/sympy | sympy/concrete/tests/test_gosper.py | Python | bsd-3-clause | 7,307 |
from __future__ import print_function, absolute_import, division
import os
import shutil
from itertools import product
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.tests.helper import assert_quantity_allclose
from astropy import units as u
from casa_formats_io import coordsy... | radio-astro-tools/spectral-cube | spectral_cube/tests/test_casafuncs.py | Python | bsd-3-clause | 9,896 |
from test_support import verify, verbose, TestFailed
from string import join
from random import random, randint
# SHIFT should match the value in longintrepr.h for best testing.
SHIFT = 15
BASE = 2 ** SHIFT
MASK = BASE - 1
# Max number of base BASE digits to use in test cases. Doubling
# this will at least quadruple... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.1/Lib/test/test_long.py | Python | mit | 8,805 |
from django.views.generic import TemplateView
# All todos view
class Home( TemplateView ):
# Set the view template
template_name = 'index.html' | pombredanne/todomvc-django | todo/views.py | Python | mit | 148 |
"""A collection of string constants.
Public module variables:
whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a ... | jameswatt2008/jameswatt2008.github.io | python/Python核心编程/网络编程/截图和代码/概述、SOCKET/多进程copy文件/test/string.py | Python | gpl-2.0 | 11,854 |
from base import *
DIR = "headerop_add2"
HEADERS = [("X-What-Rocks", "Cherokee does"),
("X-What-Sucks", "Failed QA tests"),
("X-What-Is-It", "A successful test")]
CONF = """
vserver!1!rule!2560!match = directory
vserver!1!rule!2560!match!directory = /%(DIR)s
vserver!1!rule!2560!handler = dirlis... | cherokee/webserver | qa/256-header_op-add2.py | Python | gpl-2.0 | 1,201 |
"""Add theme to config
Revision ID: 58ee75910929
Revises: 1c22ceb384a7
Create Date: 2015-08-28 15:15:47.971807
"""
# revision identifiers, used by Alembic.
revision = '58ee75910929'
down_revision = '1c22ceb384a7'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("INSERT INTO config (cat... | iseppi/zookeepr | alembic/versions/20_58ee75910929_add_theme_to_config_.py | Python | gpl-2.0 | 603 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... | mrquim/mrquimrepo | script.module.exodus/lib/resources/lib/indexers/episodes.py | Python | gpl-2.0 | 67,539 |
from .main import IMDB
def start():
return IMDB()
config = [{
'name': 'imdb',
'groups': [
{
'tab': 'automation',
'name': 'imdb_automation',
'label': 'IMDB',
'description': 'From any <strong>public</strong> IMDB watchlists. Url should be the RSS link.... | darren-rogan/CouchPotatoServer | couchpotato/core/providers/automation/imdb/__init__.py | Python | gpl-3.0 | 907 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Brian Coca <bcoca@ansible.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... | tedder/ansible-modules-core | system/systemd.py | Python | gpl-3.0 | 14,880 |
# -*- coding: utf-8 -*-
{
'name': 'Booths/Exhibitors Bridge',
'category': 'Marketing/Events',
'version': '1.0',
'summary': 'Event Booths, automatically create a sponsor.',
'description': """
Automatically create a sponsor when renting a booth.
""",
'depends': ['website_event_exhibitor', 'we... | jeremiahyan/odoo | addons/website_event_booth_exhibitor/__manifest__.py | Python | gpl-3.0 | 974 |
# -*- coding: utf-8 -*-
"""
flask.views
~~~~~~~~~~~
This module provides class-based views inspired by the ones in Django.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from .globals import request
http_method_funcs = frozenset(['get', 'post', 'head', '... | darren-rogan/CouchPotatoServer | libs/flask/views.py | Python | gpl-3.0 | 5,629 |
# -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
'''
Read content from txt file.
'''
import os, re
from calibre import prepare_string_for_xml, isbytestring
from calibre.ebooks.metadata.opf2 import OPFCreator
from cal... | yeyanchao/calibre | src/calibre/ebooks/txt/processor.py | Python | gpl-3.0 | 8,709 |
"""
# lint-amnesty, pylint: disable=django-not-configured
# lint-amnesty, pylint: disable=django-not-configured
Bookmarks module.
"""
from collections import namedtuple
DEFAULT_FIELDS = [
'id',
'course_id',
'usage_id',
'block_type',
'created',
]
OPTIONAL_FIELDS = [
'display_name',
'path'... | edx/edx-platform | openedx/core/djangoapps/bookmarks/__init__.py | Python | agpl-3.0 | 390 |
from __future__ import unicode_literals
import base64
import io
import itertools
import os
import time
import xml.etree.ElementTree as etree
from .common import FileDownloader
from .http import HttpFD
from ..utils import (
struct_pack,
struct_unpack,
compat_urlparse,
format_bytes,
encodeFilename,
... | huangciyin/youtube-dl | youtube_dl/downloader/f4m.py | Python | unlicense | 10,503 |
from cinder.exception import *
from cinder.i18n import _
class ProviderMultiVolumeError(CinderException):
msg_fmt = _("volume %(volume_id)s More than one provider_volume are found")
class ProviderMultiSnapshotError(CinderException):
msg_fmt = _("snapshot %(snapshot_id)s More than one provider_snapshot are fo... | hybrid-storage-dev/cinder-fs-111t-hybrid-cherry | volume/drivers/ec2/exception_ex.py | Python | apache-2.0 | 1,031 |
#!/usr/bin/env python
#
# Copyright 2013 The Closure Library 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
... | gregrperkins/closure-library | closure/bin/build/jscompiler_test.py | Python | apache-2.0 | 2,516 |
# Copyright (c) 2018 PaddlePaddle 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 app... | QiJune/Paddle | python/paddle/fluid/tests/unittests/test_modified_huber_loss_op.py | Python | apache-2.0 | 2,103 |
"""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 as PARENT_PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CO... | aronsky/home-assistant | homeassistant/components/cisco_ios/device_tracker.py | Python | apache-2.0 | 4,678 |
#
# 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... | mrchristine/spark-examples-dbc | src/main/python/ml/max_abs_scaler_example.py | Python | apache-2.0 | 1,515 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | awni/tensorflow | tensorflow/python/kernel_tests/softmax_op_test.py | Python | apache-2.0 | 4,506 |
import abc
import mock
import pytest
from addons.base.tests.utils import MockFolder
from django.utils import timezone
from framework.auth import Auth
from framework.exceptions import HTTPError
from nose.tools import (assert_equal, assert_false, assert_in, assert_is,
assert_is_none, assert_not_i... | binoculars/osf.io | addons/base/tests/models.py | Python | apache-2.0 | 24,742 |
__author__ = "Nitin Kumar, Rick Sherman"
__credits__ = "Jeremy Schulman"
import unittest
from nose.plugins.attrib import attr
import os
from ncclient.manager import Manager, make_device_handler
from ncclient.transport import SSHSession
from jnpr.junos import Device
from jnpr.junos.utils.fs import FS
from mock impor... | JamesNickerson/py-junos-eznc | tests/unit/utils/test_fs.py | Python | apache-2.0 | 13,790 |
from django.contrib.auth.backends import ModelBackend
from django.contrib.sites.models import Site
from socialregistration.contrib.twitter.models import TwitterProfile
class TwitterAuth(ModelBackend):
def authenticate(self, twitter_id=None):
try:
return TwitterProfile.objects.get(
... | lgapontes/django-socialregistration | socialregistration/contrib/twitter/auth.py | Python | mit | 487 |
# -*- 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 your option) any l... | KodiColdkeys/coldkeys-addons | repository/plugin.video.white.devil/resources/lib/sources/dailyrls_wp_jh.py | Python | gpl-2.0 | 6,200 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
SetRasterStyle.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
************************... | physycom/QGIS | python/plugins/processing/algs/qgis/SetRasterStyle.py | Python | gpl-2.0 | 2,755 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.