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 |
|---|---|---|---|---|---|
tboyce021/home-assistant | homeassistant/components/zwave/lock.py | 16 | 13338 | """Support for Z-Wave door locks."""
import logging
import voluptuous as vol
from homeassistant.components.lock import DOMAIN, LockEntity
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import ZW... | apache-2.0 |
benjaminbrinkman/open-ad-platform | .venv/lib/python3.4/site-packages/pbr/hooks/backwards.py | 95 | 1176 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# Unles... | mit |
ourui/libdispath-linux | thirdparty/click/examples/aliases/aliases.py | 44 | 3103 | import os
import click
try:
import ConfigParser as configparser
except ImportError:
import configparser
class Config(object):
"""The config in this example only holds aliases."""
def __init__(self):
self.path = os.getcwd()
self.aliases = {}
def read_config(self, filename):
... | apache-2.0 |
yetu/repotools | third_party/gsutil/oauth2_plugin/__init__.py | 51 | 1121 | # Copyright 2011 Google Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge,... | bsd-3-clause |
DavidNorman/tensorflow | tensorflow/python/keras/utils/io_utils.py | 2 | 5574 | # 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 |
mirkospasic/hobbit_snb_datagen | test/validateStudyAt.py | 1 | 1728 |
import sys, os
import glob
if( len(sys.argv) == 1):
print("Validates the correctness of the studyAt graph.")
print("Usage: validateStudyAt <dir>")
study_at_files = glob.glob(sys.argv[1]+'/person_studyAt_organization_?_?.csv')
organization_files = glob.glob(sys.argv[1]+'/organisation_?_?.csv')
update_stream_... | gpl-3.0 |
krieger-od/nwjs_chromium.src | tools/perf/measurements/polymer_load.py | 9 | 1324 | # 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 telemetry.page import page
from telemetry.page import page_test
from telemetry.value import scalar
class PageForPolymerLoad(page.Page):
def __init_... | bsd-3-clause |
kursitet/edx-platform | common/test/acceptance/tests/lms/test_library.py | 22 | 13611 | # -*- coding: utf-8 -*-
"""
End-to-end tests for LibraryContent block in LMS
"""
import ddt
import textwrap
from nose.plugins.attrib import attr
from ..helpers import UniqueCourseTest, TestWithSearchIndexMixin
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.studio.overview import CourseOutlinePage
fro... | agpl-3.0 |
byt3bl33d3r/Veil-Evasion | modules/payloads/go/meterpreter/rev_http.py | 2 | 4912 | """
Custom-written pure go meterpreter/reverse_http stager.
Module built by @b00stfr3ak44
"""
from modules.common import shellcode
from modules.common import helpers
from random import randint
class Payload:
def __init__(self):
# required options
self.description = "pure windows/meterpreter/... | gpl-3.0 |
espadrine/opera | chromium/src/third_party/tlslite/tlslite/integration/HTTPTLSConnection.py | 87 | 6655 | """TLS Lite + httplib."""
import socket
import httplib
from tlslite.TLSConnection import TLSConnection
from tlslite.integration.ClientHelper import ClientHelper
class HTTPBaseTLSConnection(httplib.HTTPConnection):
"""This abstract class provides a framework for adding TLS support
to httplib."""
default_... | bsd-3-clause |
hojel/youtube-dl | youtube_dl/extractor/radiofrance.py | 163 | 2089 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class RadioFranceIE(InfoExtractor):
_VALID_URL = r'^https?://maison\.radiofrance\.fr/radiovisions/(?P<id>[^?#]+)'
IE_NAME = 'radiofrance'
_TEST = {
'url': 'http://maison.radiofrance.fr/radiovisio... | unlicense |
python-script/core-scripts | ispy/ispy.py | 1 | 6485 | #!/usr/bin/env python
from __future__ import print_function
from optparse import OptionParser
from logging import getLogger, error
import subprocess
import sys
from sys import stdout, stderr, exit
from ptrace import PtraceError
from ptrace.debugger import (
PtraceDebugger, Application,
ProcessExit, ProcessSign... | gpl-2.0 |
jonparrott/oauth2client | tests/test_jwt.py | 21 | 12308 | # 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 |
ramcn/demo3 | venv/lib/python3.4/site-packages/django/views/decorators/http.py | 61 | 7464 | """
Decorators for views based on HTTP headers.
"""
import logging
from calendar import timegm
from functools import wraps
from django.http import (
HttpResponse, HttpResponseNotAllowed, HttpResponseNotModified,
)
from django.middleware.http import ConditionalGetMiddleware
from django.utils.decorators import avai... | mit |
theilgaard/PythonCode | SimpleTurtleParser/SimpleTurtleParser.py | 1 | 1555 | import fileinput
import sys
import os.path
from turtle import *
''' SIMPLE TURTLE PARSER
# == Parses files of the following format ==
P 2 # select pen 2
D # pen down
W 2 # draw went 2cm
N 1 # then north 1
E 2 # then east 2
S 1 # then back south
U # pen up
# ===========================================
'... | gpl-2.0 |
stackforge/solum | solum/objects/sqlalchemy/migration/alembic_migrations/versions/40df542e345_create_app_table.py | 3 | 2132 | # Copyright 2014 - Rackspace
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
tadashi-aikawa/gemini | jumeaux/logger.py | 1 | 2539 | # -*- coding:utf-8 -*-
from owlmixin import OwlEnum
import sys
import logging.config
class Color:
BLACK = '\033[30m'
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
BLUE = '\033[34m'
PURPLE = '\033[35m'
CYAN = '\033[36m'
WHITE = '\033[37m'
END = '\033[0m'
BOLD = '\038... | mit |
elijah513/scikit-learn | examples/cluster/plot_kmeans_assumptions.py | 270 | 2040 | """
====================================
Demonstration of k-means assumptions
====================================
This example is meant to illustrate situations where k-means will produce
unintuitive and possibly unexpected clusters. In the first three plots, the
input data does not conform to some implicit assumptio... | bsd-3-clause |
zhumengyuan/kallithea | kallithea/model/scm.py | 2 | 32603 | # -*- coding: utf-8 -*-
# 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 hope that... | gpl-3.0 |
jan-rybizki/Chempy | Chempy/plot_mcmc.py | 1 | 25245 | import numpy as np
import matplotlib.pyplot as plt
import os
from . import localpath
def restructure_chain(directory , parameter_names = [r'$\alpha_\mathrm{IMF}$',r'$\log_{10}\left(\mathrm{N}_\mathrm{Ia}\right)$',r'$\log_{10}\left(\tau_\mathrm{Ia}\right)$',r'$\log_{10}\left(\mathrm{SFE}\right)$',r'$\log_{10}\left(\mat... | mit |
jeremiahmarks/sl4a | python-build/python-libs/gdata/src/gdata/Crypto/PublicKey/RSA.py | 228 | 6974 | #
# RSA.py : RSA encryption/decryption
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness for use or... | apache-2.0 |
HybridF5/tempest | tempest/api/hybrid_cloud/volume/admin/test_multi_backend.py | 2 | 6972 | # 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
# d... | apache-2.0 |
koyuawsmbrtn/eclock | windows/kivy/kivy/input/providers/probesysfs.py | 9 | 7246 | '''
Auto Create Input Provider Config Entry for Available MT Hardware (linux only).
===============================================================================
Thanks to Marc Tardif for the probing code, taken from scan-for-mt-device.
The device discovery is done by this provider. However, the reading of
input ca... | gpl-2.0 |
bbozhev/flask-test | flask/lib/python2.7/site-packages/migrate/tests/versioning/test_util.py | 75 | 4248 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from sqlalchemy import *
from migrate.exceptions import MigrateDeprecationWarning
from migrate.tests import fixture
from migrate.tests.fixture.warnings import catch_warnings
from migrate.versioning.util import *
from migrate.versioning import api
import warnin... | mit |
adelina-t/neutron | neutron/tests/unit/core_extensions/test_qos.py | 24 | 8610 | # Copyright (c) 2015 Red Hat 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... | apache-2.0 |
dharmabumstead/ansible | lib/ansible/modules/windows/win_eventlog.py | 24 | 4923 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {... | gpl-3.0 |
zarboz/XBMC-PVR-mac | tools/darwin/depends/samba/samba-3.6.6/source3/stf/comfychair.py | 82 | 13520 | #! /usr/bin/env python
# Copyright (C) 2002, 2003 by Martin Pool <mbp@samba.org>
# Copyright (C) 2003 by Tim Potter <tpot@samba.org>
#
# 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 ve... | gpl-2.0 |
NotLeet/n0tb0t | tests/integration_tests/tester-config.py | 4 | 2147 | from inspect import getsourcefile
import os.path
from src.service import Service
current_path = os.path.abspath(getsourcefile(lambda: 0))
current_dir = os.path.dirname(current_path)
data_dir = os.path.join(current_dir, 'DataAndLogs')
service = Service.TWITCH # Pick an available option from the Service enum.
servic... | gpl-3.0 |
jopohl/urh | src/urh/controller/dialogs/AdvancedModulationOptionsDialog.py | 1 | 1455 | from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt
from PyQt5.QtWidgets import QDialog
from urh.ui.ui_advanced_modulation_settings import Ui_DialogAdvancedModSettings
class AdvancedModulationOptionsDialog(QDialog):
pause_threshold_edited = pyqtSignal(int)
message_length_divisor_edited = pyqtSignal(int)
d... | gpl-3.0 |
ph4r05/PJSIP | pjsip-apps/src/pygui/log.py | 27 | 3628 | # $Id$
#
# pjsua Python GUI Demo
#
# Copyright (C)2013 Teluu Inc. (http://www.teluu.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 2 of the License, or
# (at your option) ... | gpl-2.0 |
blueburningcoder/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/widgets.py | 69 | 40833 | """
GUI Neutral widgets
All of these widgets require you to predefine an Axes instance and
pass that as the first arg. matplotlib doesn't try to be too smart in
layout -- you have to figure out how wide and tall you want your Axes
to be to accommodate your widget.
"""
import numpy as np
from mlab import dist
from p... | agpl-3.0 |
kdmurray91/khmer | tests/test_graph.py | 1 | 9433 | #
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2015. It is licensed under
# the three-clause BSD license; see LICENSE.
# Contact: khmer-project@idyll.org
#
import khmer
import screed
import khmer_tst_utils as utils
from nose.plugins.attrib imp... | bsd-3-clause |
JonasWallin/logisticnormal | logisticnormal/utils/gammad.py | 1 | 1176 | '''
Created on Jul 3, 2014
@author: jonaswallin
'''
from __future__ import division
import scipy.special as sps
import numpy as np
import time
class ln_gamma_d(object):
"""
lookup table for ln( \Gamma_d)
"""
def __init__(self, d=None):
self.res = {}
self.d = d
def __call__... | gpl-3.0 |
robcore/machinex_kernelv2 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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.
#
# This program i... | gpl-2.0 |
e-q/scipy | scipy/special/tests/test_cdflib.py | 8 | 12411 | """
Test cdflib functions versus mpmath, if available.
The following functions still need tests:
- ncfdtr
- ncfdtri
- ncfdtridfn
- ncfdtridfd
- ncfdtrinc
- nbdtrik
- nbdtrin
- nrdtrimn
- nrdtrisd
- pdtrik
- nctdtr
- nctdtrit
- nctdtridf
- nctdtrinc
"""
import itertools
import numpy as np
from numpy.testing import a... | bsd-3-clause |
alanjw/GreenOpenERP-Win-X86 | openerp/addons/base_status/__init__.py | 61 | 1087 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP SA (<http://openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
40439221/2017springcd_hw | plugin/render_math/pelican_mathjax_markdown_extension.py | 348 | 6929 | # -*- coding: utf-8 -*-
"""
Pelican Mathjax Markdown Extension
==================================
An extension for the Python Markdown module that enables
the Pelican python blog to process mathjax. This extension
gives Pelican the ability to use Mathjax as a "first class
citizen" of the blog
"""
import markdown
from... | agpl-3.0 |
danielchatfield/shreddi.es | libs/werkzeug/testsuite/datastructures.py | 145 | 28212 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.datastructures
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the functionality of the provided Werkzeug
datastructures.
TODO:
- FileMultiDict
- Immutable types undertested
- Split up dict tests
:copyright: (c) 2014 by Armin Ronacher.... | artistic-2.0 |
quimaguirre/diana | diana/toolbox/parse_do.py | 1 | 2529 | import OBO
def main():
disease_ontology_file = "../../data/ontology/doid.obo"
icd_to_mesh_ids = get_icd_to_mesh_ids(disease_ontology_file, id_type="ICD9CM")
return
def get_icd_to_mesh_ids(disease_ontology_file, id_type="ICD9CM"):
"""
id_type: ICD9CM | ICD10CM
"""
name_to_id, id_to_mesh_id... | mit |
bubanoid/cit_presentation | init_db.py | 1 | 2834 | # Initialize database.
from cit import create_app
from cit.db import db
from mixer.backend.sqlalchemy import Mixer
from mixer.backend.flask import mixer
from cit.auth.models import User
from cit.organizations.models import Organization
from cit.issues.models import Issue, Photo
from cit.comments.models import Comment
i... | gpl-3.0 |
lensvol/slowclap | slowclap/models.py | 1 | 2725 | #coding: utf-8
from django.db import models, transaction
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.core.cache import cache
class ActionBlock(models.Model):
name = models.CharField(max_length=255,
verbose_name=u'Название',
... | mit |
StephaneP/volatility | volatility/plugins/timeliner.py | 44 | 21319 | # Volatility
# Copyright (C) 2008-2013 Volatility Foundation
# Copyright (C) 2011 Jamie Levy (Gleeda) <jamie.levy@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 Softw... | gpl-2.0 |
openstack/neutron-lib | neutron_lib/api/definitions/external_net.py | 1 | 1642 | # Copyright (c) 2013 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... | apache-2.0 |
b0ttl3z/SickRage | lib/chardet/sbcharsetprober.py | 269 | 5657 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
andrewshadura/omim | 3party/Alohalytics/tests/googletest/test/gtest_output_test.py | 496 | 12051 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | apache-2.0 |
ntiufalara/openerp7 | openerp/addons/account_budget/account_budget.py | 8 | 9401 | # -*- 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... | mit |
huzq/scikit-learn | examples/linear_model/plot_ransac.py | 103 | 1797 | """
===========================================
Robust linear model estimation using RANSAC
===========================================
In this example we see how to robustly fit a linear model to faulty data using
the RANSAC algorithm.
"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn import ... | bsd-3-clause |
onyb/dune | core/backends/UNIX.py | 1 | 3186 | import os
from core.api import API
from core.api.Status import Status
from core.api.settings import _Config as Config # TODO: Need to switch to proper config (Dev / Prod)
from core.backends.IUnikernelBackend import IUnikernelBackend
from core.utils.Executor import Executor
from core.utils.Time import get_current_loca... | apache-2.0 |
ibm-research-ireland/sparkoscope | examples/src/main/python/streaming/flume_wordcount.py | 83 | 2032 | #
# 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 |
zhangh43/incubator-hawq | tools/bin/gppylib/test/regress/test_regress_gpexpand.py | 30 | 9249 | #!/usr/bin/env python
import unittest2 as unittest
import os, socket
from gppylib.commands.base import Command, ExecutionError
from gppylib.commands.gp import GpStart
from gppylib.db import dbconn
class GpExpandTestCase(unittest.TestCase):
EXPANSION_INPUT_FILE = 'test_expand.input'
GP_COMMAND_FAULT_POIN... | apache-2.0 |
esc/pip | tests/lib/git_submodule_helpers.py | 58 | 2960 | from __future__ import absolute_import
import textwrap
def _create_test_package_submodule(env):
env.scratch_path.join("version_pkg_submodule").mkdir()
submodule_path = env.scratch_path / 'version_pkg_submodule'
env.run('touch', 'testfile', cwd=submodule_path)
env.run('git', 'init', cwd=submodule_path... | mit |
Vassy/odoo | addons/stock/report/stock_graph.py | 112 | 4517 | # -*- 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 |
40123248/w17b_test | static/Brython3.1.0-20150301-090019/Lib/functools.py | 730 | 13596 | """functools.py - Tools for working with functions and callable objects
"""
# Python module wrapper for _functools C module
# to allow utilities written in Python to be added
# to the functools module.
# Written by Nick Coghlan <ncoghlan at gmail.com>
# and Raymond Hettinger <python at rcn.com>
# Copyright (C) 2006-2... | gpl-3.0 |
Novasoft-India/OperERP-AM-Motors | openerp/addons/point_of_sale/wizard/__init__.py | 61 | 1327 | # -*- 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... | agpl-3.0 |
pombredanne/pylearn2 | pylearn2/sandbox/rnn/costs/gradient_clipping.py | 44 | 2169 | """
Implements gradient clipping as a cost wrapper.
"""
from functools import wraps
from theano.compat import six
from theano import tensor
from pylearn2.compat import OrderedDict
from pylearn2.costs.cost import Cost
from pylearn2.utils import is_iterable
from pylearn2.utils import py_number_types
class GradientCli... | bsd-3-clause |
dwightgunning/django | django/contrib/sessions/base_session.py | 348 | 1623 | """
This module allows importing AbstractBaseSession even
when django.contrib.sessions is not in INSTALLED_APPS.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
class BaseSes... | bsd-3-clause |
oinopion/django | tests/update/tests.py | 325 | 5121 | from __future__ import unicode_literals
from django.test import TestCase
from .models import A, B, D, Bar, DataPoint, Foo, RelatedPoint
class SimpleTest(TestCase):
def setUp(self):
self.a1 = A.objects.create()
self.a2 = A.objects.create()
for x in range(20):
B.objects.create(... | bsd-3-clause |
cjlucas/rtorrent-python | rtorrent/rpc/caller.py | 2 | 1932 | from rtorrent.rpc.call import RPCCall
from rtorrent.rpc.result import RPCResult
from rtorrent.rpc.method import RPCMethod
import xmlrpc.client
class RPCCaller(object):
def __init__(self, context):
self.context = context
self.calls = []
self.available_methods = None
def add(self, *arg... | mit |
lingmann/dcos | packages/dcos-integration-test/extra/test_endpoints.py | 4 | 11474 | import ipaddress
import urllib.parse
import bs4
import pytest
from requests.exceptions import ConnectionError
from retrying import retry
from test_helpers import expanded_config
def test_if_dcos_ui_is_up(dcos_api_session):
r = dcos_api_session.get('/')
assert r.status_code == 200
assert len(r.text) > 1... | apache-2.0 |
qwertyjune/BethSaidaBible | venv/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/geom.py | 79 | 4718 | from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal
from django.contrib.gis.gdal.prototypes.errcheck import check_envelope
from django.contrib.gis.gdal.prototypes.generation import (const_string_output... | gpl-3.0 |
Intel-tensorflow/tensorflow | tensorflow/python/framework/composite_tensor_test.py | 18 | 16889 | # Copyright 2019 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 |
15Dkatz/pants | tests/python/pants_test/ivy/test_bootstrapper.py | 12 | 1447 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import uni... | apache-2.0 |
martynovp/edx-platform | lms/djangoapps/foldit/migrations/0001_initial.py | 114 | 7559 | # -*- 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 model 'Score'
db.create_table('foldit_score', (
('id', self.gf('django.db.models.fields... | agpl-3.0 |
prasadtalasila/IRCLogParser | test/integration-test/test_lib/test_analysis/test_network.py | 1 | 6882 | import unittest
from lib.analysis import network
import networkx as nx
import lib.util as util
import lib.config as config
import os, mock
import StringIO
import sys
from networkx.algorithms.components.connected import connected_components
from numpy.testing import assert_array_equal
class NetworkIntegrationTest(unit... | gpl-3.0 |
matternet/ardupilot | Tools/autotest/common.py | 32 | 9718 | from __future__ import print_function
import math
import time
from pymavlink import mavwp
from pysim import util
# a list of pexpect objects to read while waiting for
# messages. This keeps the output to stdout flowing
expect_list = []
def expect_list_clear():
"""clear the expect list."""
global expect_lis... | gpl-3.0 |
conejoninja/plugin.video.pelisalacarta | platformcode/xbmc/launcher.py | 6 | 29964 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# tvalacarta
# XBMC Launcher (xbmc / xbmc-dharma / boxee)
# http://blog.tvalacarta.info/plugin-xbmc/
#------------------------------------------------------------
import urllib, urllib2
import os,sys
from core import logger
from co... | gpl-3.0 |
kubernetes-client/python | kubernetes/client/models/v1_api_resource.py | 1 | 13876 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | apache-2.0 |
luistorresm/odoo | addons/hr_evaluation/hr_evaluation.py | 210 | 19168 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
ioram7/keystone-federado-pgid2013 | keystone/contrib/mapping/controllers.py | 3 | 27218 | import uuid
from keystone.openstack.common import jsonutils
from keystone import identity
from keystone import auth
from keystone import exception
from keystone.common import dependency
from keystone.common import controller
from keystone.common import manager
from keystone.common import logging
from keystone import c... | apache-2.0 |
xeroc/uptick | setup.py | 1 | 1183 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import sys
__version__ = "0.2.6"
assert sys.version_info[0] == 3, "Uptick requires Python > 3"
setup(
name="uptick",
version=__version__,
description="Command line tool to interface with the BitShares network",
long_descripti... | mit |
Gr1N/scheduler | scheduler/schedulermenu.py | 1 | 2874 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012 Grishko Nikita <grin.minsk at gmail dot com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, inclu... | mit |
quickresolve/accel.ai | flask-aws/lib/python2.7/site-packages/wheel/install.py | 472 | 18070 | """
Operations on existing wheel files, including basic installation.
"""
# XXX see patched pip to install
import sys
import warnings
import os.path
import re
import zipfile
import hashlib
import csv
import shutil
try:
_big_number = sys.maxsize
except NameError:
_big_number = sys.maxint
from wheel.decorato... | mit |
xNovax/SickRage | lib/concurrent/futures/_base.py | 104 | 20830 | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
from __future__ import with_statement
import logging
import threading
import time
from concurrent.futures._compat import reraise
try:
from collections import namedtuple
except ImportError:
from concurrent.fu... | gpl-3.0 |
richardcs/ansible | lib/ansible/plugins/connection/podman.py | 33 | 5845 | # Based on the buildah connection plugin
# Copyright (c) 2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Connection plugin to interact with existing podman containers.
# https://github.com/containers/libpod
#
# Written by: Tomas Tomecek (https://gi... | gpl-3.0 |
cosenal/waterbutler | tests/core/streams/test_base64encodestream.py | 6 | 1443 | import pytest
import base64
import functools
from unittest import mock
from tests.utils import async
from waterbutler.core import streams
class TestBase64Stream:
@async
def test_doesnt_crash_with_none(self):
stream = streams.Base64EncodeStream(streams.StringStream(b''))
data = yield from st... | apache-2.0 |
mhdella/scikit-learn | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 408 | 8061 | import re
import inspect
import textwrap
import pydoc
from .docscrape import NumpyDocString
from .docscrape import FunctionDoc
from .docscrape import ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config=None):
config = {} if config is None else config
self.use_plots... | bsd-3-clause |
unseenlaser/python-for-android | python3-alpha/python3-src/Lib/test/test_pep292.py | 55 | 9217 | # Copyright (C) 2004 Python Software Foundation
# Author: barry@python.org (Barry Warsaw)
# License: http://www.opensource.org/licenses/PythonSoftFoundation.php
import unittest
from string import Template
class Bag:
pass
class Mapping:
def __getitem__(self, name):
obj = self
for part in name... | apache-2.0 |
zenoss/Community-Zenpacks | ZenPacks.ZenSystems.Juniper/ZenPacks/ZenSystems/Juniper/interfaces.py | 3 | 15516 | ##########################################################################
# Author: Jane Curry, jane.curry@skills-1st.co.uk
# Date: February 16th, 2011
# Revised:
#
# interfaces.py for Juniper ZenPack
#
# This program can be used under the GNU General Public License version 2
# You can f... | gpl-2.0 |
Technologicat/python-wlsqm | examples/expertsolver_example.py | 1 | 6402 | # -*- coding: utf-8 -*-
"""A minimal usage example for ExpertSolver.
JJ 2017-03-28
"""
from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.spatial.ckdtree
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d
import wlsqm
def project_onto_regular_grid_2D... | bsd-2-clause |
GehenHe/Recognize-Face-on-Android | tensorflow/python/framework/ops.py | 9 | 154227 | # 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 |
marmarek/anaconda | pyanaconda/ui/gui/xkl_wrapper.py | 3 | 15164 | #
# Copyright (C) 2012-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it wi... | gpl-2.0 |
linuxmint/mint4win | src/openpgp/sap/api.py | 8 | 55296 | """Main implementation functions
Status:
- string functions 95%, awaiting polish and more use
- instance functions 90%, pending packet/message class overhaul
- documentation 80%, waiting for usage/demos
- tests 60%, need more tests for failure, attacks, and stress
Deliteral-izing
---------------
Deliteral-iz... | gpl-2.0 |
mateoqac/unqTip | gui/views/boardPrint/boardViewer.py | 2 | 15241 | from PyQt4 import QtGui
from PyQt4 import QtCore
from board import *
import sys
import os
import resources
from parseXML import ParseXML
import gui
from gui.errorWindow import *
from xml.etree.ElementTree import ParseError
from commons.utils import root_path, clothing_for_file_exists, clothing_dir_for_file
class Board... | gpl-3.0 |
oknalv/serkisplugin | ui/gui.py | 1 | 1934 | import bpy
from ..controller.controller import Controller
class InputFields(bpy.types.PropertyGroup):
InputFileName = bpy.props.StringProperty(name="", subtype="FILE_PATH", default="")
FPS = bpy.props.FloatProperty(name="FPS", default=0.0, options={'HIDDEN'})
ManualFPS = bpy.props.BoolProperty(name="Set ... | mit |
cristian99garcia/gmail-activity | redactor.py | 1 | 17075 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016, Cristian García <cristian99garcia@gmail.com>
#
# self 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 3 of th... | gpl-3.0 |
hangoutsbot/hangups | hangups/ui/__main__.py | 5 | 34629 | """Reference chat client for hangups."""
import appdirs
import asyncio
import configargparse
import logging
import os
import sys
import urwid
import readlike
import hangups
from hangups.ui.notify import Notifier
from hangups.ui.utils import get_conv_name
LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(mess... | mit |
tomfotherby/tower-cli | tests/test_conf.py | 1 | 3746 | # Copyright 2015, Ansible, Inc.
# Luke Sneeringer <lsneeringer@ansible.com>
#
# 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 requi... | apache-2.0 |
jralls/gramps | gramps/plugins/tool/verify.py | 3 | 69208 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2011 Paul Franklin
#
# This program is free software; you can redistribute it and/or modify
# it under the terms o... | gpl-2.0 |
hicknhack-software/buildbot-inplace-config | buildbot_inplace/setup_build.py | 1 | 1880 | """ Buildbot inplace config
(C) Copyright 2015 HicknHack Software GmbH
The original code can be found at:
https://github.com/hicknhack-software/buildbot-inplace-config
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... | apache-2.0 |
tensorflow/text | tensorflow_text/python/ops/hub_module_splitter.py | 1 | 7855 | # coding=utf-8
# Copyright 2021 TF.Text Authors.
#
# 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... | apache-2.0 |
studio666/cjdns | node_build/dependencies/libuv/build/gyp/test/win/linker-flags/update_pgd.py | 133 | 1213 | #!/usr/bin/env python
# Copyright (c) 2013 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 optparse import OptionParser
import glob
import os
import subprocess
parser = OptionParser()
parser.add_option('--exe', dest='exe')
pa... | gpl-3.0 |
khertan/ownNotes | python/markdown/postprocessors.py | 2 | 3381 | """
POST-PROCESSORS
=============================================================================
Markdown also allows post-processors, which are similar to preprocessors in
that they need to implement a "run" method. However, they are run after core
processing.
"""
import re
import util
import odict
... | gpl-3.0 |
Qalthos/ansible | lib/ansible/plugins/doc_fragments/oracle.py | 8 | 4834 | class ModuleDocFragment(object):
DOCUMENTATION = """
requirements:
- "python >= 2.7"
- Python SDK for Oracle Cloud Infrastructure U(https://oracle-cloud-infrastructure-python-sdk.readthedocs.io)
notes:
- For OCI python sdk configuration, please refer to
U(https://oracle-cl... | gpl-3.0 |
thelinuxkid/pygeocode | setup.py | 1 | 1384 | #!/usr/bin/python
from setuptools import setup, find_packages
import os
EXTRAS_REQUIRES = dict(
test=[
'fudge>=1.0.3',
'nose>=1.1.2',
],
)
for k,v in EXTRAS_REQUIRES.iteritems():
if k == 'test':
continue
EXTRAS_REQUIRES['test'] += v
# Pypi package documentation
root = ... | mit |
southpawtech/TACTIC-DEV | 3rd_party/CherryPy/cherrypy/test/test_encoding.py | 6 | 15068 | from cherrypy.test import test
test.prefer_parent_path()
import gzip
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from httplib import IncompleteRead
import sys
import cherrypy
europoundUnicode = u'\x80\xa3'
sing = u"\u6bdb\u6cfd\u4e1c: Sing, Little Birdie?"
sing8 = si... | epl-1.0 |
gangliao/Paddle | paddle/gserver/tests/sequence_rnn_multi_unequalength_inputs.py | 13 | 2432 | #edit-mode: -*- python -*-
# Copyright (c) 2016 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
#
... | apache-2.0 |
yelizariev/account-financial-tools | account_credit_control/__openerp__.py | 17 | 1938 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi, Guewen Baconnier
# Copyright 2012-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... | agpl-3.0 |
ds-hwang/chromium-crosswalk | third_party/google_input_tools/third_party/closure_library/closure/bin/build/source_test.py | 103 | 3128 | #!/usr/bin/env python
#
# Copyright 2010 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
... | bsd-3-clause |
bastir85/django-chartit | chartit_tests/validation/models.py | 4 | 4454 | from django.db import models
class Author(models.Model):
first_name = models.CharField(max_length=50, db_column='first_name')
last_name = models.CharField(max_length=50, db_column='last_name')
def __unicode__(self):
return '%s %s' %(self.first_name, self.last_name)
clas... | bsd-2-clause |
foursquare/pants | contrib/node/tests/python/pants_test/contrib/node/subsystems/test_node_distribution.py | 1 | 3633 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import os
import unittest
from pants.util.process_handler import subprocess
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.