repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
djs55/sm | drivers/HBASR.py | 8 | 10540 | #!/usr/bin/python
#
# Copyright (C) Citrix Systems Inc.
#
# This program 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; version 2.1 only.
#
# This program is distributed in the hope that it will be u... | lgpl-2.1 |
clairetang6/bokeh | sphinx/source/docs/user_guide/source_examples/tools_hover_custom_tooltip.py | 25 | 1514 | from bokeh.plotting import figure, output_file, show, ColumnDataSource
from bokeh.models import HoverTool
output_file("toolbar.html")
source = ColumnDataSource(
data=dict(
x=[1, 2, 3, 4, 5],
y=[2, 5, 8, 2, 7],
desc=['A', 'b', 'C', 'd', 'E'],
imgs = [
... | bsd-3-clause |
quantmind/pulsar | examples/httpbin/manage.py | 1 | 13827 | '''Pulsar HTTP test application::
python manage.py
Implementation
======================
.. autoclass:: HttpBin
:members:
:member-order: bysource
Server Hooks
===================
This example shows how to use
:ref:`server hooks <setting-section-application-hooks>` to log each request
.. automodule:: exa... | bsd-3-clause |
kobejean/tensorflow | tensorflow/python/layers/convolutional.py | 9 | 65368 | # 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 |
cryptickp/libcloud | libcloud/compute/drivers/opennebula.py | 49 | 43600 | # Copyright 2002-2009, Distributed Systems Architecture Group, Universidad
# Complutense de Madrid (dsa-research.org)
#
# 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 ... | apache-2.0 |
mattbernst/polyhartree | adapters/mopac7.py | 1 | 11941 | # -*- coding:utf-8 mode:python; tab-width:4; indent-tabs-mode:nil; py-indent-offset:4 -*-
import hashlib
import uuid
import cpinterface
import geoprep
import sharedutilities
class Mopac7Job(cpinterface.Job):
def __init__(self, *args, **kw):
super(Mopac7Job, self).__init__(*args, **kw)
self.backend... | gpl-3.0 |
uxbal/python_intro_ga | exercises/mimic.py | 208 | 2995 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... | gpl-2.0 |
jayme-github/beets | test/test_autotag.py | 1 | 36300 | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... | mit |
scholer/cadnano2.5 | cadnano/fileio/lattice.py | 2 | 17050 | """
"""
from math import ceil, floor, sqrt
import random
from typing import (
List,
Tuple
)
from cadnano.cntypes import (
Vec2T
)
root3 = 1.732051
class HoneycombDnaPart(object):
"""
SCAF_LOW = [[1, 11], [8, 18], [4, 15]]
SCAF_HIGH = [[2, 12], [9, 19], [5, 16]]
STAP_LOW = [[6, 16], [3, 13... | mit |
yanchen036/tensorflow | tensorflow/contrib/distribute/python/input_ops.py | 14 | 6158 | # 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 |
smartstudy/project_cron | project_cron/utils/processutil.py | 1 | 1524 | import os
from subprocess import Popen, PIPE
from project_cron.utils import logutil
def call(command, cwd=None):
_install_package_if_not_exists(command)
logutil.info('Execute', ' '.join(command))
popen = Popen(command, stdout=PIPE, stderr=PIPE, env=_get_env(), cwd=cwd)
out, err = popen.communicate()
... | mit |
inactivist/django-endless-pagination | endless_pagination/paginator.py | 3 | 3565 | from math import ceil
from django.core.paginator import Paginator, Page, EmptyPage, PageNotAnInteger
class CustomPage(Page):
def start_index(self):
# Special case, return zero if no items.
if self.paginator.count == 0:
return 0
elif self.number == 1:
return 1
... | mit |
benob/chainer | chainer/functions/loss/softmax_cross_entropy.py | 2 | 7313 | import numpy
import six
import chainer
from chainer import cuda
from chainer import function
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cudnn.cudnn
_algorithm = libcudnn.CUDNN_SOFTMAX_LOG
_mode = libcudnn.CUDNN_SOFTMAX_MODE_CHANNEL
_cudnn_version = l... | mit |
haveal/googleads-python-lib | examples/dfp/v201411/placement_service/get_placements_by_statement.py | 4 | 1866 | #!/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 |
drawks/ansible | lib/ansible/plugins/doc_fragments/shell_common.py | 79 | 1833 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# common shelldocumentation fragment
DOCUMENTATION = """
options:
remote_tmp:
description:
- Temporary directory to use on targets whe... | gpl-3.0 |
atheendra/access_keys | keystone/tests/test_cache.py | 5 | 9945 | # Copyright 2013 Metacloud
#
# 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, s... | apache-2.0 |
sunny-wyb/xen-4.1.2 | dist/install/usr/lib/python2.7/site-packages/xen/sv/DomInfo.py | 46 | 9486 | from xen.xend.XendClient import server
from xen.xend import PrettyPrint
from xen.sv.HTMLBase import HTMLBase
from xen.sv.util import *
from xen.sv.GenTabbed import *
from xen.sv.Wizard import *
DEBUG=1
class DomInfo( GenTabbed ):
def __init__( self, urlWriter ):
self.dom = 0;
... | gpl-2.0 |
poondog/kangaroo-m7-mkIII | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
cliqz/socorro | socorro/external/postgresql/base.py | 9 | 15867 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""Deprecated by socorro/external/postgresql/service_base.py"""
import contextlib
import logging
import psycopg2
from... | mpl-2.0 |
yongtang/tensorflow | tensorflow/lite/testing/op_tests/zeros_like.py | 17 | 2455 | # 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 |
yingyun001/ovirt-engine | packaging/setup/plugins/ovirt-engine-common/base/core/reconfigure.py | 8 | 2950 | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2014-2015 Red Hat, 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
#
# Unl... | apache-2.0 |
bcorbet/SickRage | lib/sqlalchemy/schema.py | 75 | 1103 | # schema.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Compatiblity namespace for sqlalchemy.sql.schema and related.
"""
from .sql.base import... | gpl-3.0 |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/extended_link/tlvs/tlv/adjacency_sid/state/__init__.py | 1 | 52369 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 |
jlaunonen/kirppu | kirppu/migrations/0002_add_itemtype.py | 1 | 2253 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('kirppu', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='UIText',
... | mit |
doubi-workshop/grpc | src/python/grpcio_test/grpc_test/beta/_beta_features_test.py | 6 | 8586 | # Copyright 2015, 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 of conditions and the f... | bsd-3-clause |
samuknet/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/handshake/_base.py | 652 | 6143 | # Copyright 2012, 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 of conditions and the f... | mpl-2.0 |
DaniilLeksin/theblog | env/lib/python2.7/site-packages/django/conf/locale/de_CH/formats.py | 82 | 1451 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DA... | gpl-2.0 |
k21/buck | test/com/facebook/buck/testutil/integration/project_workspace.py | 7 | 3058 | # Copyright 2016-present Facebook, 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 i... | apache-2.0 |
kashif/scikit-learn | doc/tutorial/text_analytics/skeletons/exercise_01_language_train_model.py | 25 | 2004 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... | bsd-3-clause |
dinau/micropython | tests/basics/struct1.py | 8 | 3085 | try:
import ustruct as struct
except:
import struct
print(struct.calcsize("<bI"))
print(struct.unpack("<bI", b"\x80\0\0\x01\0"))
print(struct.calcsize(">bI"))
print(struct.unpack(">bI", b"\x80\0\0\x01\0"))
# 32-bit little-endian specific
#print(struct.unpack("bI", b"\x80\xaa\x55\xaa\0\0\x01\0"))
print(struct.... | mit |
johndpope/tensorflow | tensorflow/contrib/bayesflow/__init__.py | 57 | 1871 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
tensorflow/privacy | tensorflow_privacy/privacy/estimators/dnn.py | 1 | 2340 | # Copyright 2020, The TensorFlow 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 agreed t... | apache-2.0 |
someorz/spark | dev/github_jira_sync.py | 52 | 5299 | #!/usr/bin/env python
#
# 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 "Li... | apache-2.0 |
kevinthesun/mxnet | python/mxnet/gluon/loss.py | 2 | 15374 | # 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 u... | apache-2.0 |
xushiwei/nova | nova/console/vmrc.py | 4 | 4521 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# htt... | apache-2.0 |
mrquim/mrquimrepo | repo/script.module.youtube.dl/lib/youtube_dl/extractor/cultureunplugged.py | 64 | 2508 | from __future__ import unicode_literals
import re
import time
from .common import InfoExtractor
from ..utils import (
int_or_none,
HEADRequest,
)
class CultureUnpluggedIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?cultureunplugged\.com/documentary/watch-online/play/(?P<id>\d+)(?:/(?P<display_id>[... | gpl-2.0 |
pbaesse/Sissens | lib/python2.7/site-packages/pip/commands/install.py | 323 | 17412 | from __future__ import absolute_import
import logging
import operator
import os
import tempfile
import shutil
import warnings
try:
import wheel
except ImportError:
wheel = None
from pip.req import RequirementSet
from pip.basecommand import RequirementCommand
from pip.locations import virtualenv_no_global, dis... | gpl-3.0 |
josircg/raizcidadanista | raizcidadanista/filebrowser/widgets.py | 19 | 3611 | # coding: utf-8
# DJANGO IMPORTS
from django.template.loader import render_to_string
from django.forms.widgets import ClearableFileInput as DjangoClearableFileInput
from django.forms.widgets import CheckboxInput
from django.utils.translation import ugettext_lazy
from django.utils.safestring import mark_safe
# FILEBRO... | gpl-3.0 |
leedm777/sensu-community-plugins | plugins/openstack/neutron/check_neutron-api.py | 49 | 2449 | #!/usr/bin/env python
#
# Check OpenStack Neutron API Status
# ===
#
# Dependencies
# -----------
# - python-neutronclient and related libraries
#
# Performs API query to determine 'alive' status of the
# Neutron API.
#
# Author: Mike Dorman <mdorman@godaddy.com>
# Significantly based on neutron-agent-status.py by
# Br... | mit |
aaltay/beam | learning/katas/python/Common Transforms/Filter/ParDo/task.py | 6 | 1130 | # 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"); y... | apache-2.0 |
duncan-brown/pycbc | pycbc/frame/losc.py | 5 | 4995 | # Copyright (C) 2017 Alex Nitz
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the ... | gpl-3.0 |
koparasy/gemfi | util/streamline/m5stats2streamline.py | 6 | 42738 | #!/usr/bin/env python
# Copyright (c) 2012 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation... | bsd-3-clause |
MarsCarl/ucore_lab | related_info/lab7/semaphore_condition/thr-ex1.py | 48 | 1026 | #!/bin/env python
# -*- coding: utf-8 -*-
#filename: peartest.py
import threading, signal
is_exit = False
def doStress(i, cc):
global is_exit
idx = i
while not is_exit:
if (idx < 10000000):
print "thread[%d]: idx=%d"%(i, idx)
idx = idx + cc
else:
brea... | gpl-2.0 |
vnsofthe/odoo-dev | addons/account_budget/__init__.py | 444 | 1097 | # -*- 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 |
zhaodelong/django | tests/null_queries/tests.py | 290 | 2928 | from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Choice, Inner, OuterA, OuterB, Poll
class NullQueriesTests(TestCase):
def test_none_as_null(self):
"""
Regression test for the use of None as a query value.... | bsd-3-clause |
Lujeni/ansible | test/units/modules/network/slxos/test_slxos_l2_interface.py | 38 | 5752 | #
# (c) 2018 Extreme Networks 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.
#
# Ans... | gpl-3.0 |
sonaht/ansible | lib/ansible/modules/cloud/vmware/vmware_local_user_manager.py | 70 | 6582 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright IBM Corp. 2016
# Author(s): Andreas Nafpliotis <nafpliot@de.ibm.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 Found... | gpl-3.0 |
SOKP/external_chromium_org | tools/deep_memory_profiler/subcommands/expand.py | 26 | 5501 | # Copyright 2013 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 logging
import sys
from lib.policy import PolicySet
from lib.subcommand import SubCommand
LOGGER = logging.getLogger('dmprof')
class ExpandComman... | bsd-3-clause |
rcbops/quantum-buildpackage | quantum/plugins/cisco/common/cisco_constants.py | 3 | 4307 | """
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 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.ap... | apache-2.0 |
koenbok/Cactus | cactus/bootstrap/archive.py | 5 | 1280 | #coding:utf-8
import os
import shutil
import tarfile
import zipfile
from six.moves import urllib
class Folder(object):
def __init__(self, from_path):
self.from_path = from_path
def extractall(self, path):
os.rmdir(path)
shutil.copytree(self.from_path, path)
def close(self):
... | bsd-3-clause |
jspargo/AneMo | django/lib/python2.7/site-packages/django/contrib/gis/tests/relatedapp/tests.py | 43 | 15237 | from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql, oracle, no_mysql, no_oracle, no_spatialite
from django.test import TestCase
if HAS_GEOS:
from django.contrib.gis.db.models import ... | gpl-2.0 |
foss-transportationmodeling/rettina-server | .env/lib/python2.7/site-packages/migrate/changeset/databases/oracle.py | 140 | 3655 | """
Oracle database specific implementations of changeset classes.
"""
import sqlalchemy as sa
from sqlalchemy.databases import oracle as sa_base
from migrate import exceptions
from migrate.changeset import ansisql
OracleSchemaGenerator = sa_base.OracleDDLCompiler
class OracleColumnGenerator(OracleSchemaGenerat... | apache-2.0 |
DirtyPiece/dancestudio | Build/Tools/Python27/Lib/xml/dom/domreg.py | 238 | 3478 | """Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom."""
from xml.dom.minicompat import * # isinstance, StringTypes
# This is a list of well-known implementations. Well-known names
# sho... | mit |
plotly/python-api | packages/python/plotly/plotly/graph_objs/histogram2d/_stream.py | 2 | 4158 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "histogram2d"
_path_str = "histogram2d.stream"
_valid_props = {"maxpoints", "token"}
# m... | mit |
cpennington/edx-platform | openedx/core/djangoapps/bookmarks/tests/test_models.py | 4 | 20788 | """
Tests for Bookmarks models.
"""
import datetime
from contextlib import contextmanager
import ddt
import mock
import pytz
from freezegun import freeze_time
from opaque_keys.edx.keys import UsageKey
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
from six import text_type
from six.moves import... | agpl-3.0 |
caosmo/pip | pip/_vendor/cachecontrol/heuristics.py | 374 | 4053 | import calendar
import time
from email.utils import formatdate, parsedate, parsedate_tz
from datetime import datetime, timedelta
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
def expire_after(delta, date=None):
date = date or datetime.now()
return date + delta
def datetime_to_header(dt):
return formatdate(c... | mit |
persandstrom/home-assistant | homeassistant/components/climate/sensibo.py | 1 | 12148 | """
Support for Sensibo wifi-enabled home thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.sensibo/
"""
import asyncio
import logging
import aiohttp
import async_timeout
import voluptuous as vol
from homeassistant.const import (
... | apache-2.0 |
spcui/avocado-vt | virttest/libvirt_vm.py | 5 | 98194 | """
Utility classes and functions to handle Virtual Machine creation using libvirt.
:copyright: 2011 Red Hat Inc.
"""
import time
import string
import os
import logging
import fcntl
import re
import shutil
import tempfile
import platform
from avocado.utils import process
from avocado.utils import crypto
from avocado... | gpl-2.0 |
narasimhan-v/avocado-misc-tests-1 | generic/htx_test.py | 4 | 7655 | #!/usr/bin/env python
# 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 is distributed in the hope that ... | gpl-2.0 |
isyippee/nova | nova/api/openstack/compute/floating_ip_dns.py | 32 | 10231 | # Copyright 2011 Andrew Bogott for the Wikimedia 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 requi... | apache-2.0 |
nikkitan/bitcoin | test/functional/feature_pruning.py | 4 | 20906 | #!/usr/bin/env python3
# Copyright (c) 2014-2019 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 the pruning code.
WARNING:
This test uses 4GB of disk space.
This test takes 30 mins or more (up ... | mit |
Pablo126/SSBW | Tarea4/tarea4/lib/python3.5/site-packages/wheel/pkginfo.py | 565 | 1225 | """Tools for reading and writing PKG-INFO / METADATA without caring
about the encoding."""
from email.parser import Parser
try:
unicode
_PY3 = False
except NameError:
_PY3 = True
if not _PY3:
from email.generator import Generator
def read_pkg_info_bytes(bytestr):
return Parser().pars... | gpl-3.0 |
ShoRit/shipping-costs-sample | v2/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... | apache-2.0 |
trenton3983/Doing_Math_with_Python | chapter6/solutions/sierpinski.py | 2 | 1545 | '''
sierpinski.py
Draw Sierpinski Triangle
'''
import random
import matplotlib.pyplot as plt
def transformation_1(p):
x = p[0]
y = p[1]
x1 = 0.5*x
y1 = 0.5*y
return x1, y1
def transformation_2(p):
x = p[0]
y = p[1]
x1 = 0.5*x + 0.5
y1 = 0.5*y + 0.5
return x1, y1
def transform... | mit |
haiyangd/Gelatin | src/Gelatin/generator/Builder.py | 2 | 3593 | # Copyright (C) 2010 Samuel Abels.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; wi... | gpl-2.0 |
MaizerGomes/youtube-dl | youtube_dl/extractor/nfl.py | 76 | 6197 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
remove_end,
)
class NFLIE(InfoExtractor):
IE_NAME = 'nfl.com'
_VALID_URL = r'''(?x)htt... | unlicense |
bratsche/Neutron-Drive | google_appengine/lib/django_1_2/tests/regressiontests/syndication/tests.py | 39 | 14191 | import datetime
from django.contrib.syndication import feeds, views
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.utils import tzinfo
from django.utils.feedgenerator import rfc2822_date, rfc3339_date
from models import Entry
from xml.dom import minidom
try:
se... | bsd-3-clause |
gurneyalex/OpenUpgrade | openerp/report/render/rml2html/rml2html.py | 438 | 15438 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2005, Fabien Pinckaers, UCL, FSA
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | agpl-3.0 |
OaklandPeters/sublp | sublp/test_invoke.py | 1 | 1863 | """
Opener tests - opens SublimeText
Do not run with standard unittests.
"""
import os
import unittest
from . import dispatch_cases
from . import dispatcher
from . import support
# Set correct directory for testing
file_dir = support.normalize_path(os.path.split(__file__)[0])
if not os.getcwd() == file_dir:
os.ch... | mit |
shsingh/ansible | test/units/modules/network/fortios/test_fortios_system_pppoe_interface.py | 21 | 13357 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
osrg/ryu | ryu/lib/packet/gre.py | 7 | 7978 | # Copyright (C) 2016 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 |
nik-hil/ODL-REST-PythonSDK | ODL/restapi.py | 1 | 3597 | import requests
import json
import logging
from requests.auth import HTTPBasicAuth
#TODO: implement logger
class RestAPI():
"""Intialize the variable with default values
Use this object to use rest api
"""
def __init__(self, **kwargs):
'''Pass a dict with following default vari... | mit |
kcpawan/django | tests/template_tests/filter_tests/test_slice.py | 428 | 1317 | from django.template.defaultfilters import slice_filter
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class SliceTests(SimpleTestCase):
@setup({'slice01': '{{ a|slice:"1:3" }} {{ b|slice:"1:3" }}'})
def test_slice01(self):
output = sel... | bsd-3-clause |
antoan2/incubator-mxnet | python/mxnet/gluon/parameter.py | 2 | 25058 | # 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 u... | apache-2.0 |
Ninad998/deepstylometry-python | fyp/StyloNeuralML.py | 1 | 3975 | #!/usr/bin/python
# -*- coding: utf-8 -*-
def getResults(authorList = None, doc_id = None, algo = None, chunk_size = 1000, level = 'word',
glove = '../glove/', samples = 300, dimensions = 200, dropout = 0.5):
if (authorList is None) or (doc_id is None) or (algo is None) or (doc_id == 0):
... | mit |
0asa/scikit-learn | sklearn/utils/validation.py | 2 | 17489 | """Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
from ..externals ... | bsd-3-clause |
imiolek-ireneusz/pysiogame | i18n/custom/word_lists/ru_di.py | 1 | 21101 | # -*- coding: utf-8 -*-
# This is a list of words used by the word builder and word maze games and possibly
# other games built in the future.
# These words are mainly most commonly used words in Russian
# In each sub-list in the list di first number is a number of words in the sublist
# to avoid counting it every tim... | gpl-3.0 |
AnhellO/DAS_Sistemas | Ene-Jun-2021/delabra-salinas-brandon-emmanuel/Examen/Primer Parcial/Ejercicio 4/cajero.py | 1 | 2443 | from abc import ABCMeta, abstractstaticmethod
# en la función next sucesor establecemos al siguiente sucesor dentro de la cadena
#la sifuiente función el evento de la cadena
class CajeroHandler(metaclass=ABCMeta):
@abstractstaticmethod
def next_succesor(next):
@abstractstaticmethod
def handle(... | mit |
amyvmiwei/chromium | tools/site_compare/utils/browser_iterate.py | 6 | 5863 | #!/usr/bin/python2.4
# Copyright (c) 2006-2008 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.
"""Utility to use a browser to visit multiple URLs.
Prerequisites:
1. The command_line package from tools/site_compare
2. ... | bsd-3-clause |
etiennekruger/phantomjs-qt5 | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/api_implementation.py | 262 | 2804 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
matthaywardwebdesign/rethinkdb | test/rql_test/connections/http_support/werkzeug/wrappers.py | 146 | 76379 | # -*- coding: utf-8 -*-
"""
werkzeug.wrappers
~~~~~~~~~~~~~~~~~
The wrappers are simple request and response objects which you can
subclass to do whatever you want them to do. The request object contains
the information transmitted by the client (webbrowser) and the response
object contains al... | agpl-3.0 |
suncycheng/intellij-community | python/helpers/coveragepy/coverage/config.py | 39 | 12763 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Config file for coverage.py"""
import collections
import os
import re
import sys
from coverage.backward import configparser, iitems, string_class
from coverage... | apache-2.0 |
CiscoSystems/networking-cisco | networking_cisco/plugins/ml2/drivers/cisco/apic/apic_topology.py | 2 | 12550 | # Copyright (c) 2014 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.org/licenses/LICENSE-2.0
#
# Unless re... | apache-2.0 |
deniclab/pyto_seg_slurm | segmentation/batch_mito_seg.py | 1 | 1273 | import os
import sys
sys.path.append('/n/denic_lab/Users/nweir/python_packages/')
import argparse
from pyto_segmenter import MitoSegment
parser = argparse.ArgumentParser(description = 'Segment mitochondria from \
images and return pickled objects.')
parser.add_argument('-d', '--img_d... | mit |
ziggear/shadowsocks | shadowsocks/shell.py | 270 | 12676 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 |
ak-67/ZeroNet | src/Test/TestWeb.py | 2 | 3893 | import urllib
import pytest
try:
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import staleness_of
from selenium.common.exceptions import NoSuchElementException
except:
pass
class WaitForPageLoad(object):
def __init__(self, browser):
... | gpl-2.0 |
bobmyhill/burnman | tests/test_seismic.py | 7 | 2377 | from __future__ import absolute_import
import unittest
import os
import sys
sys.path.insert(1, os.path.abspath('..'))
import warnings
import burnman
from burnman import minerals
from burnman import seismic
from util import BurnManTest
class test_seismic(BurnManTest):
def test_internal_depth_list(self):
... | gpl-2.0 |
patilsangram/erpnext | erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.py | 21 | 2174 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
from frappe.utils import nowdate, getdate
from erpnext.ass... | gpl-3.0 |
zerobatu/edx-platform | common/djangoapps/embargo/forms.py | 55 | 3038 | """
Defines forms for providing validation of embargo admin details.
"""
from django import forms
from django.utils.translation import ugettext as _
import ipaddr
from xmodule.modulestore.django import modulestore
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from embargo.models... | agpl-3.0 |
dev-elixir/hx_wt88047 | tools/perf/util/setup.py | 2079 | 1438 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
michaelhotss/googletest | scripts/upload.py | 2511 | 51024 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | bsd-3-clause |
jamesylgan/szechuantech | python-scripts/six.py | 172 | 30888 | # Copyright (c) 2010-2017 Benjamin Peterson
#
# 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, publi... | mit |
wevoice/wesub | apps/webdriver_testing/pages/site_pages/auth_page.py | 5 | 1209 | #!/usr/bin/env python
import time
from webdriver_testing.pages.site_pages import UnisubsPage
class AuthPage(UnisubsPage):
"""
Unisubs page contains common web elements found across
all Universal Subtitles pages. Every new page class is derived from
UnisubsPage so that every child class can have acc... | agpl-3.0 |
McrRaspJam/Workshops | 004_Picamera_Pythonimaging/3-gradients/7_multi.py | 2 | 1144 |
#import libraries
import picamera
from time import sleep
from PIL import Image
#set up the camera
camera = picamera.PiCamera()
try:
#capture at maximum resolution (~5MP)
camera.resolution = (1280, 720)
camera.framerate = 60
camera.vflip = True
camera.hflip = True
camera.start_preview()
#allow camera to AWB
... | cc0-1.0 |
angdraug/nova | nova/cmd/network.py | 15 | 2418 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
gioman/QGIS | python/plugins/processing/algs/gdal/GridInvDist.py | 1 | 5580 | # -*- coding: utf-8 -*-
"""
***************************************************************************
GridInvDist.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*************... | gpl-2.0 |
JerryXia/fastgoagent | goagent/server/uploader/google/appengine/tools/adaptive_thread_pool.py | 13 | 14123 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | mit |
hkariti/ansible | lib/ansible/modules/cloud/google/gce.py | 16 | 28171 | #!/usr/bin/python
# Copyright 2013 Google Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
zedr/django | tests/utils_tests/test_ipv6.py | 67 | 2831 | from __future__ import unicode_literals
import unittest
from django.utils.ipv6 import is_valid_ipv6_address, clean_ipv6_address
class TestUtilsIPv6(unittest.TestCase):
def test_validates_correct_plain_address(self):
self.assertTrue(is_valid_ipv6_address('fe80::223:6cff:fe8a:2e8a'))
self.assertT... | bsd-3-clause |
KDD-OpenSource/fexum | features/tests/test_tasks.py | 1 | 15890 | from os import stat
from time import time
from unittest.mock import patch, call
import SharedArray as sa
from django.test import TestCase
from features.models import Feature, Bin, Dataset, Slice, Redundancy, Relevancy, \
Spectrogram
from features.models import ResultCalculationMap, Calculation
from features.tasks ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.