repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
home-assistant/home-assistant
homeassistant/components/dyson/__init__.py
6
5011
"""Support for Dyson Pure Cool Link devices.""" import logging from libpurecool.dyson import DysonAccount import voluptuous as vol from homeassistant.const import CONF_DEVICES, CONF_PASSWORD, CONF_TIMEOUT, CONF_USERNAME from homeassistant.helpers import discovery import homeassistant.helpers.config_validation as cv f...
apache-2.0
hoondongkim/syntaxnet-kr
SJtoUD_POS.py
1
10446
import re import codecs import os """ [1] Main Function """ def main(): directory = os.getcwd() + '/InputDataType1' filename = 'BTHO0437.txt' filename = os.path.join(directory, filename) f = open(filename, 'r', encoding='utf-16') is_inside = False line_counter = 0 OUT_FILENAME = "OutputDat...
apache-2.0
andresriancho/boto
tests/integration/sdb/test_cert_verification.py
10
1497
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # 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 withou...
mit
markhoney/script.module.pyamf
lib/pyamf/tests/test_amf3.py
25
47302
# -*- coding: utf-8 -*- # # Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ Tests for AMF3 Implementation. @since: 0.1.0 """ import unittest import datetime import pyamf from pyamf import amf3, util, xml, python from pyamf.tests.util import ( Spam, EncoderMixIn, DecoderMixIn, ClassCacheClear...
mit
behanceops/moto
tests/test_cloudformation/test_cloudformation_stack_crud.py
4
8104
from __future__ import unicode_literals import json import boto import boto.s3 import boto.s3.key import boto.cloudformation from boto.exception import BotoServerError import sure # noqa # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises # noqa from nose.tools import...
apache-2.0
LukeHoersten/ansible
test/units/plugins/test_plugins.py
137
2968
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
codekaki/odoo
addons/crm_claim/report/__init__.py
446
1080
# -*- 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
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.4/django/contrib/gis/db/backends/oracle/introspection.py
388
1777
import cx_Oracle from django.db.backends.oracle.introspection import DatabaseIntrospection class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY, # but it is the only o...
bsd-3-clause
h3rucutu/weevely-old
core/vector.py
1
1305
import types class VectorList(list): def get_vectors_by_interpreters(self, shells): vect=[] for v in self: if v.interpreter in shells: vect.append(v) return vect def get_vector_by_name(self, name): for v in self: if ...
gpl-3.0
bancek/egradebook
src/lib/django/template/loader.py
149
8326
# Wrapper for loading templates from storage of some sort (e.g. filesystem, database). # # This uses the TEMPLATE_LOADERS setting, which is a list of loaders to use. # Each loader is expected to have this interface: # # callable(name, dirs=[]) # # name is the template name. # dirs is an optional list of directories ...
gpl-3.0
XiaodunServerGroup/medicalmooc
cms/djangoapps/contentstore/management/commands/prompt.py
70
1095
import sys def query_yes_no(question, default="yes"): """Ask a yes/no question via raw_input() and return their answer. "question" is a string that is presented to the user. "default" is the presumed answer if the user just hits <Enter>. It must be "yes" (the default), "no" or None (meaning ...
agpl-3.0
ench0/external_chromium_org_third_party_skia
tools/gen_bench_expectations_from_codereview.py
77
7832
#!/usr/bin/python # 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. """Generate new bench expectations from results of trybots on a code review.""" import collections import compare_codereview import...
bsd-3-clause
ojengwa/odoo
addons/mrp/report/bom_structure.py
297
2405
## -*- 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 GN...
agpl-3.0
sodexis/odoo
openerp/addons/base/tests/test_views.py
176
39717
# -*- encoding: utf-8 -*- from functools import partial import itertools import unittest2 from lxml import etree as ET from lxml.builder import E from psycopg2 import IntegrityError from openerp.tests import common import openerp.tools Field = E.field class ViewCase(common.TransactionCase): def setUp(self): ...
agpl-3.0
anaran/kuma
vendor/packages/translate/storage/tmx.py
24
5811
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2005-2009 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
mpl-2.0
tushart91/study-usc
Information Integration/Homework/HW1/HW1/bs4/tests/test_soup.py
15
17364
# -*- coding: utf-8 -*- """Tests of Beautiful Soup as a whole.""" import logging import unittest import sys import tempfile from bs4 import ( BeautifulSoup, BeautifulStoneSoup, ) from bs4.element import ( CharsetMetaAttributeValue, ContentMetaAttributeValue, SoupStrainer, NamespacedAttribute, ...
mit
ltilve/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/third_party/boto/tests/unit/ses/test_identity.py
100
7581
#!/usr/bin/env python # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. 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 ...
bsd-3-clause
FluidityProject/fluidity
tests/mphase_dusty_gas_shock_tube/single_phase_frozen_flow_test.py
2
2218
import pylab import numpy import shocktube import vtktools params = {'text.fontsize': 6, 'legend.fontsize': 8, 'xtick.labelsize': 8, 'ytick.labelsize': 8, 'lines.markersize': 6, 'axes.titlesize': 'small'} pylab.rcParams.update(params) filename='single_phase_frozen_flow_test...
lgpl-2.1
jswxdzc/shadowsocks
shadowsocks/encrypt.py
990
5180
#!/usr/bin/env python # # Copyright 2012-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 by applicable la...
apache-2.0
mje-nz/PX4-Firmware
integrationtests/python_src/px4_it/mavros/mavros_offboard_attctl_test.py
2
5971
#!/usr/bin/env python2 #*************************************************************************** # # Copyright (c) 2015 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: #...
bsd-3-clause
BeegorMif/HTPC-Manager
tornado/test/log_test.py
23
8344
#!/usr/bin/env python # # Copyright 2012 Facebook # # 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...
gpl-3.0
jacquesd/indico
indico/cli/shell.py
2
7727
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
EntityFXCode/arsenalsuite
cpp/lib/PyQt4/examples/graphicsview/diagramscene/diagramscene.py
15
32047
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
gpl-2.0
Anonymouslemming/ansible
lib/ansible/modules/network/cloudengine/ce_aaa_server_host.py
26
106172
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
wakatime/sublime-wakatime
packages/wakatime/packages/py27/pygments/lexers/ncl.py
4
63986
# -*- coding: utf-8 -*- """ pygments.lexers.ncl ~~~~~~~~~~~~~~~~~~~ Lexers for NCAR Command Language. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, words from pygments.token...
bsd-3-clause
tlatzko/spmcluster
.tox/clean/lib/python2.7/site-packages/wheel/pep425tags.py
220
2861
"""Generate and work with PEP 425 Compatibility Tags.""" import sys try: import sysconfig except ImportError: # pragma nocover # Python < 2.7 import distutils.sysconfig as sysconfig import distutils.util def get_abbr_impl(): """Return abbreviated implementation name.""" if hasattr(sys, 'pypy_ve...
bsd-2-clause
Azure/azure-sdk-for-python
sdk/videoanalyzer/azure-media-videoanalyzer-edge/tests/conftest.py
5
1303
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""), ...
mit
nevir/plexability
extern/depot_tools/third_party/gsutil/gslib/addlhelp/subdirs.py
51
5127
# Copyright 2012 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...
gpl-2.0
ianastewart/cwltc-admin
members/application_processor.py
1
3702
# Handle application process from datetime import datetime from members.models import Person, Membership, Subscription, TextBlock, AdultApplication from members.services import ( subscription_create, subscription_activate, subscription_create_invoiceitems, invoice_create, ) from cardless.services impo...
mit
navrasio/mxnet
example/nce-loss/toy_nce.py
27
2456
# 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
ycool/apollo
modules/tools/mobileye_viewer/view_subplot.py
4
5699
#!/usr/bin/env python ############################################################################### # Copyright 2017 The Apollo 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 ...
apache-2.0
iitis/PyLTEs
pyltes/network.py
1
9084
__author__ = 'Mariusz Slabicki, Konrad Polys' from pyltes import devices from pyltes import generator from pyltes import printer import math import random import pickle import copy class CellularNetwork: """Class describing cellular network""" def __init__(self): self.ue = [] self.bs = [] ...
mit
Innovahn/odoo.old
addons/crm/report/crm_opportunity_report.py
309
4879
# -*- 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
airbnb/kafka
tests/kafkatest/tests/client/client_compatibility_features_test.py
4
4702
# 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 use ...
apache-2.0
dvliman/jaikuengine
.google_appengine/google/appengine/_internal/django/core/management/__init__.py
23
17576
import os import sys from optparse import OptionParser, NO_DEFAULT import imp import django from google.appengine._internal.django.core.management.base import BaseCommand, CommandError, handle_default_options from google.appengine._internal.django.utils.importlib import import_module # For backwards compatibility: ge...
apache-2.0
ktrappe/seqan
util/py_lib/seqan/dox/file_mgr.py
18
4942
#!/usr/bin/env python """ Code for parsing comments from C++ files. """ import string import re class Comment(object): """Represents a comment in a file. @ivar file Back link to the File object. @ivar col, line, pos 0-based column, line, position. @ivar end_col, end_line, end_pos 0-based e...
bsd-3-clause
HridayHS/Lightning-Kernel
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
Asana/boto
boto/sts/credentials.py
153
8210
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Eucalyptus Systems, Inc. # # 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 # withou...
mit
PeterWangIntel/chromium-crosswalk
build/download_nacl_toolchains.py
43
2152
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Shim to run nacl toolchain download script only if there is a nacl dir.""" import os import shutil import sys def Main(args):...
bsd-3-clause
nikolas/lettuce
tests/integration/lib/Django-1.2.5/django/utils/numberformat.py
290
1632
from django.conf import settings from django.utils.safestring import mark_safe def format(number, decimal_sep, decimal_pos, grouping=0, thousand_sep=''): """ Gets a number (as a number or string), and returns it as a string, using formats definied as arguments: * decimal_sep: Decimal separator symbol...
gpl-3.0
mwiebe/numpy
numpy/lib/tests/test_index_tricks.py
91
11462
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import ( run_module_suite, TestCase, assert_, assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_raises ) from numpy.lib.index_tricks import ( mgrid, ndenumerate,...
bsd-3-clause
raymondxyang/tensorflow
tensorflow/contrib/keras/python/keras/models.py
4
43959
# 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
heyavery/lopenr
venv/lib/python2.7/site-packages/psycopg2/tests/__init__.py
55
2899
#!/usr/bin/env python # psycopg2 test suite # # Copyright (C) 2007-2011 Federico Di Gregorio <fog@debian.org> # # psycopg2 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 the Licen...
mit
sharifelgamal/runtimes-common
appengine/runtime_builders/builder_util.py
5
3139
#!/usr/bin/python # Copyright 2017 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 app...
apache-2.0
chugunovyar/factoryForBuild
env/lib/python2.7/site-packages/scipy/io/matlab/tests/test_mio5_utils.py
106
5604
""" Testing mio5_utils Cython module """ from __future__ import division, print_function, absolute_import import sys from io import BytesIO cStringIO = BytesIO import numpy as np from nose.tools import (assert_true, assert_equal, assert_raises) from numpy.testing import (assert_array_equal, run_module_suite) fro...
gpl-3.0
hknyldz/pisitools
pisilinux/pisilinux/db/filesldb.py
1
2686
# -*- coding: utf-8 -*- # # Copyright (C) 2014, Marcin Bojara # # 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. # # Plea...
gpl-3.0
MaxiCM/android_kernel_motorola_msm8916
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
mmoya/ansible
v2/ansible/plugins/cache/redis.py
9
3425
# (c) 2014, Brian Coca, Josh Drake, et al # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
mouton5000/DiscreteEventApplicationEditor
test/testsArithmeticExpressions/MathFunctions/testATan.py
1
2813
__author__ = 'mouton' from triggerExpressions import Evaluation from unittest import TestCase from math import pi, sqrt, atan from arithmeticExpressions import ALitteral, Func, UndefinedLitteral, SelfLitteral from database import Variable class TestAtan(TestCase): @classmethod def setUpClass(cls): i...
mit
lkhomenk/integration_tests
cfme/fixtures/qa_contact.py
3
1910
from collections import defaultdict import inspect import subprocess import re import operator from cfme.fixtures.artifactor_plugin import fire_art_test_hook from cfme.fixtures.pytest_store import store def dig_code(node): code_data = inspect.getsourcelines(node.function) lineno = code_data[1] offset = le...
gpl-2.0
htzy/bigfour
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
13
57777
# -*- coding: utf-8 -*- """ Unit tests for LMS instructor-initiated background tasks helper functions. Tests that CSV grade report generation works with unicode emails. """ import ddt from mock import Mock, patch import tempfile import unicodecsv from django.core.urlresolvers import reverse from django.test.utils im...
agpl-3.0
initOS/server-tools
super_calendar/__openerp__.py
23
2131
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) All rights reserved: # (c) 2012-2015 Agile Business Group sagl (<http://www.agilebg.com>) # Lorenzo Battistini <lorenzo.battistini@agilebg.com> # (c) 2012 D...
agpl-3.0
Bysmyyr/chromium-crosswalk
tools/cr/cr/commands/shell.py
103
1724
# 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. """A module for the shell command.""" import os import tempfile import cr class ShellCommand(cr.Command): """The implementation of the shell command. ...
bsd-3-clause
NolanBecker/aima-python
submissions/Capps/puzzles.py
18
3166
import search from math import(cos, pi) # A sample map problem Butte_map = search.UndirectedGraph(dict( Missoula=dict(Lolo=21, Philipsburg=71, Helena=111, Anaconda=94), Lolo=dict(Hamilton=40, Missoula=21), Hamilton=dict(Lolo=40, Butte=159, Sula=38), Salmon=dict(Cobalt=76, Bannack=128), DeerLodge=di...
mit
msrb/devassistant
devassistant/yaml_assistant.py
8
10770
import copy import functools import logging import os import six from devassistant import argument from devassistant import assistant_base from devassistant import exceptions from devassistant.logger import logger from devassistant import lang from devassistant import loaded_yaml from devassistant import settings fro...
gpl-2.0
meteorcloudy/tensorflow
tensorflow/compiler/tests/variable_ops_test.py
4
20990
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
resmo/ansible
lib/ansible/modules/network/asa/asa_og.py
37
30291
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2019, Ansible by Red Hat, 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', ...
gpl-3.0
wilvk/ansible
test/units/modules/network/f5/test_bigip_iapp_service.py
28
12006
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import sys from nose.plugins.skip import SkipTest i...
gpl-3.0
Affix/CouchPotatoServer
libs/pyutil/test/out_of_shape/test_zlibutil.py
106
3283
#!/usr/bin/env python import unittest from pyutil import randutil from pyutil import zlibutil class Accumulator: def __init__(self): self.buf = '' def write(self, str): self.buf += str def make_decomp(realdecomp): def decomp(str, maxlen, maxmem): d = Accumulator() reald...
gpl-3.0
eliasrg/SURF2017
code/separate/coding/PAM.py
1
2567
# Copyright (c) 2017 Elias Riedel Gรฅrding # Licensed under the MIT License from utilities import to_column_vector, int_to_bits, bits_to_int import numpy as np class Constellation: """A mapping m: โ„ค2^n โ†’ โ„^K.""" @classmethod def uniform(cls, n): "Equidistant points (K = 1)." # {-(2^n - 1...
mit
tumbl3w33d/ansible
lib/ansible/modules/network/f5/bigiq_device_discovery.py
17
39271
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2019, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
ritzk/ansible-modules-core
cloud/amazon/ec2_tag.py
28
5604
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
w1ll1am23/home-assistant
tests/components/tasmota/test_device_trigger.py
4
34702
"""The tests for MQTT device triggers.""" import copy import json from unittest.mock import patch from hatasmota.switch import TasmotaSwitchTriggerConfig import pytest import homeassistant.components.automation as automation from homeassistant.components.tasmota.const import DEFAULT_PREFIX, DOMAIN from homeassistant....
apache-2.0
ajoaoff/django
tests/admin_filters/tests.py
86
44461
from __future__ import unicode_literals import datetime from django.contrib.admin import ( AllValuesFieldListFilter, BooleanFieldListFilter, ModelAdmin, RelatedOnlyFieldListFilter, SimpleListFilter, site, ) from django.contrib.admin.views.main import ChangeList from django.contrib.auth.admin import UserAdmin ...
bsd-3-clause
Jonbean/DSSM
dssm_lstm/utils.py
8
5542
''' Author: Jon Tsai Created: May 29 2016 ''' import numpy as np import theano from time import sleep import sys def progress_bar(percent, speed): i = int(percent)/2 sys.stdout.write('\r') # the exact output you're looking for: sys.stdout.write("[%-50s] %d%% %f instances/s" % ('='*i, percent, spe...
gpl-3.0
130s/ros_buildfarm
scripts/release/create_binarydeb_install_task_generator.py
3
1840
#!/usr/bin/env python3 import argparse import sys from ros_buildfarm.argument import add_argument_arch from ros_buildfarm.argument import add_argument_binarydeb_dir from ros_buildfarm.argument import \ add_argument_distribution_repository_key_files from ros_buildfarm.argument import add_argument_distribution_repo...
apache-2.0
jroltgen/aqua-gesture-framework
samples/SampleEvent/scons-local-1.3.0/SCons/Tool/packaging/ipk.py
5
6344
"""SCons.Tool.Packaging.ipk """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without r...
gpl-3.0
abhidrona/gn-osc-custom
oscar/apps/dashboard/nav.py
2
4841
from django.core.urlresolvers import reverse, resolve, NoReverseMatch from django.core.exceptions import ImproperlyConfigured from django.conf import settings from django.http import Http404 from oscar.views.decorators import check_permissions class Node(object): def __init__(self, label, url_name=None, url_args...
bsd-3-clause
EmuxEvans/mbed
workspace_tools/host_tests/rtc_auto.py
122
2052
""" mbed SDK Copyright (c) 2011-2013 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 wr...
apache-2.0
jasonwzhy/django
tests/generic_views/test_dates.py
190
34662
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, override_settings, skipUnlessDBFeature from django.test.utils import requires_tz_support from django.utils import timezone from .models import Arti...
bsd-3-clause
suiyuan2009/tensorflow
tensorflow/python/kernel_tests/atrous_convolution_test.py
24
10435
# 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
apanju/odoo
addons/account_test/__openerp__.py
313
2078
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 CCI Connect asbl (http://www.cciconnect.be) All Rights Reserved. # Philmer <philmer@cciconnect.be> # # This progra...
agpl-3.0
ychen820/microblog
y/google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/boto/gs/acl.py
184
11457
# Copyright 2010 Google Inc. # # 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, publish, dis- # trib...
bsd-3-clause
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/tools/symsrc/source_index.py
102
8693
#!/usr/bin/env python # Copyright (c) 2011 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. """Usage: <win-path-to-pdb.pdb> This tool will take a PDB on the command line, extract the source files that were used in building ...
apache-2.0
Jailander/aaf_deployment
aaf_bringup/scripts/topic_monitor.py
3
1812
#!/usr/bin/env python # -*- coding: utf-8 -*- import rospy import rostopic from strands_emails.msg import SendEmailAction, SendEmailGoal from actionlib import SimpleActionClient import time class CheckScheduler(object): def __init__(self, name): rospy.loginfo("Starting %s ..." % name) self.topic...
mit
popazerty/dvbapp2-gui
lib/python/Plugins/SystemPlugins/IniFanSetup/plugin.py
1
3437
# -*- coding: utf-8 -*- from Screens.Screen import Screen from Components.ConfigList import ConfigListScreen from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSelection, getConfigListEntry modelist = {"0": _("Off"), "2": _("On"), "1": _("Auto")} config.plugins.FanSetup = ConfigSubsection() ...
gpl-2.0
coder-james/mxnet
example/rnn/old/lstm_bucketing.py
15
2672
# pylint: disable=C0111,too-many-arguments,too-many-instance-attributes,too-many-locals,redefined-outer-name,fixme # pylint: disable=superfluous-parens, no-member, invalid-name import sys sys.path.insert(0, "../../python") import numpy as np import mxnet as mx from lstm import lstm_unroll from bucket_io import BucketS...
apache-2.0
matrixjoeq/timus_solutions
1327/slu.py
1
2005
#!/usr/bin/python # -*- coding: utf-8 -*- ''' 1327. Fuses Time limit: 1.0 second Memory limit: 64 MB [Description] Sasha Privalov, a young programmer working in the SRITS (Scientific Research Institute for Thaumaturgy and Spellcraft), finds his job rather enjoyable. Indeed, he is the only programmer of such a wonderf...
mit
elimence/edx-platform
lms/djangoapps/courseware/features/smart-accordion.py
1
5762
#pylint: disable=C0111 #pylint: disable=W0621 from lettuce import world, step from re import sub from nose.tools import assert_equals from xmodule.modulestore.django import modulestore from common import * from logging import getLogger logger = getLogger(__name__) def check_for_errors(): e = world.browser.find_...
agpl-3.0
irit-melodi/attelo
attelo/parser/intra.py
3
35889
"""Document-level parsers that first do sentence-level parsing. An IntraInterParser applies separate parsers on edges within a sentence and then on edges across sentences. """ from __future__ import print_function from collections import defaultdict, namedtuple from abc import ABCMeta, abstractmethod from six import...
gpl-3.0
WalkingMachine/sara_commun
wm_robocup2016/src/inspection.py
1
8680
#!/usr/bin/env python import rospy import smach from smach_ros import SimpleActionState import wm_supervisor.srv from move_base_msgs.msg import MoveBaseAction from geometry_msgs.msg import PoseStamped, PoseWithCovarianceStamped import threading from std_msgs.msg import Float64, String, Bool class InitRobot(smach.Sta...
apache-2.0
tcwicklund/django
tests/gis_tests/gis_migrations/migrations/0001_initial.py
269
2465
from django.db import connection, migrations, models from ...models import models as gis_models ops = [ migrations.CreateModel( name='Neighborhood', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('name', models.C...
bsd-3-clause
eeshangarg/oh-mainline
vendor/packages/Django/django/utils/feedgenerator.py
37
15643
""" Syndication feed generation library -- used for generating RSS, etc. Sample usage: >>> from django.utils import feedgenerator >>> feed = feedgenerator.Rss201rev2Feed( ... title="Poynter E-Media Tidbits", ... link="http://www.poynter.org/column.asp?id=31", ... description="A group Weblog by the sharpes...
agpl-3.0
ltilve/ChromiumGStreamerBackend
tools/telemetry/telemetry/internal/platform/power_monitor/sysfs_power_monitor.py
6
8188
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import logging import os import re from telemetry.internal.platform import power_monitor from telemetry import decorators CPU_PATH = '/...
bsd-3-clause
ZeusWPI/Haldis
app/models/order.py
1
3454
"Script for everything Order related in the database" import typing from datetime import datetime from utils import first from hlds.definitions import location_definitions from .database import db from .user import User class Order(db.Model): "Class used for configuring the Order model in the database" id = ...
mit
brockwhittaker/zulip
zerver/tornado/event_queue.py
2
43928
# See http://zulip.readthedocs.io/en/latest/events-system.html for # high-level documentation on how this system works. from typing import cast, AbstractSet, Any, Callable, Dict, List, \ Mapping, MutableMapping, Optional, Iterable, Sequence, Set, Text, Union from mypy_extensions import TypedDict from django.utils....
apache-2.0
QuLogic/iris
lib/iris/tests/test_grib_save_rules.py
5
7119
# (C) British Crown Copyright 2010 - 2017, Met Office # # This file is part of Iris. # # Iris 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 the License, or # (at your option) any l...
gpl-3.0
pratapvardhan/pandas
pandas/tests/indexes/multi/test_integrity.py
3
9142
# -*- coding: utf-8 -*- import re import numpy as np import pandas as pd import pandas.util.testing as tm import pytest from pandas import IntervalIndex, MultiIndex, RangeIndex from pandas.compat import lrange, range from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike def test_labels_dtypes(...
bsd-3-clause
justinvforvendetta/electrum-pkb
lib/network.py
1
18396
import time import Queue import os import sys import random import traceback import socks import socket import json import util from bitcoin import * import interface from blockchain import Blockchain DEFAULT_PORTS = {'t':'50001', 's':'50002', 'h':'8081', 'g':'8082'} DEFAULT_SERVERS = { 'electrum-pkb.net': DEFA...
gpl-3.0
ROMFactory/android_external_chromium_org
chrome/common/extensions/docs/examples/apps/hello-python/oauth2/clients/imap.py
885
1685
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
bsd-3-clause
dstrohl/advanced_config_manager
AdvConfigMgr/utils/flag_manager.py
1
2469
__author__ = 'dstrohl' from AdvConfigMgr.utils.base_utils import list_in_list # =============================================================================== # Flag Manager # =============================================================================== class FlagList(object): def __init__(self): se...
gpl-2.0
synth3tk/the-blue-alliance
datafeeds/datafeed_first_elasticsearch.py
5
3210
import base64 import json import logging from google.appengine.api import urlfetch from consts.event_type import EventType from datafeeds.datafeed_base import DatafeedBase from models.event_team import EventTeam from parsers.first_elasticsearch.first_elasticsearch_event_list_parser import FIRSTElasticSearchEventLis...
mit
Jorge-Rodriguez/ansible
lib/ansible/modules/cloud/oneandone/oneandone_server.py
100
22851
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
yannickcr/Sick-Beard
autoProcessTV/sabToSickBeard.py
51
1048
#!/usr/bin/env python # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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, eithe...
gpl-3.0
vitan/hue
desktop/core/ext-py/tablib-develop/tablib/packages/odf/form.py
100
3268
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Sรธren Roug, European Environment Agency # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at you...
apache-2.0
mapillary/OpenSfM
opensfm/test/test_rig.py
1
4622
"""Test the rig module.""" import numpy as np from opensfm import pygeometry, rig, types def test_create_instances_with_patterns() -> None: # A first rig model defined as left/right/top/bottom # A complete instance instance1 = [ "12345_left.jpg", "12345_bottom.jpg", "12345_top.jpg...
bsd-2-clause
nathanielvarona/airflow
tests/providers/google/cloud/transfers/test_facebook_ads_to_gcs.py
10
2764
# 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
rohit21122012/DCASE2013
runs/2016/dnn2016med_gd_50/task3_sound_event_detection_in_real_life_audio.py
15
46699
#!/usr/bin/env python # -*- coding: utf-8 -*- # # DCASE 2016::Sound Event Detection in Real-life Audio / Baseline System import argparse import csv import math import numpy import textwrap import warnings from sklearn import mixture from src.dataset import * from src.evaluation import * from src.features import * fr...
mit
damienjones/django-crispy-forms
crispy_forms/layout_slice.py
29
6173
# -*- coding: utf-8 -*- from crispy_forms.compatibility import integer_types, string_types from crispy_forms.exceptions import DynamicError from crispy_forms.layout import Fieldset, MultiField from crispy_forms.bootstrap import Container class LayoutSlice(object): # List of layout objects that need args passed fi...
mit
mbauskar/frappe
frappe/email/doctype/email_group/email_group.py
16
3511
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import validate_email_add from frappe.model.document import Document from frappe.utils import...
mit