code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. # All rights reserved. """Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line o...
timm/timmnix
pypy3-v5.5.0-linux64/lib-python/3/lib2to3/pgen2/tokenize.py
Python
mit
19,320
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # 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 you...
beernarrd/gramps
gramps/gen/filters/rules/family/_regexpfathername.py
Python
gpl-2.0
1,866
# SPDX-License-Identifier: GPL-2.0+ # Copyright 2018 Google, Inc # Written by Simon Glass <sjg@chromium.org> # # Holds and modifies the state information held by binman # import hashlib import re from dtoc import fdt import os from patman import tools from patman import tout # Records the device-tree files known to ...
CTSRD-CHERI/u-boot
tools/binman/state.py
Python
gpl-2.0
12,809
import locale from .output import Output from .config import Config from .tracer import AsyncronousTracer, SyncronousTracer from .exceptions import PyCallGraphException class PyCallGraph(object): def __init__(self, output=None, config=None): '''output can be a single Output instance or an iterable with m...
Teino1978-Corp/pycallgraph
pycallgraph/pycallgraph.py
Python
gpl-2.0
2,634
""" This module defines the following constants: *InputText options* * BGUI_INPUT_NONE = 0 * BGUI_INPUT_SELECT_ALL = 1 * BGUI_INPUT_DEFAULT = BGUI_INPUT_NONE """ from .widget import Widget, WeakMethod, BGUI_DEFAULT, BGUI_CENTERY, \ BGUI_NO_FOCUS, BGUI_MOUSE_ACTIVE, BGUI_MOUSE_CLICK, BGUI_MOUSE_RELEASE, \ BGUI_...
folkrav/rts-b51
src/projectX/bgui/text_input.py
Python
gpl-3.0
15,841
# Copyright (C) 2012 Thomas "stacks" Birn (@stacksth) # # 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...
0x00ach/zer0m0n
signatures/sniffer_winpcap.py
Python
gpl-3.0
1,246
# (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...
Xowap/ansible
lib/ansible/constants.py
Python
gpl-3.0
16,541
#!/usr/bin/python # -*- 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) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUM...
marratj/ansible
lib/ansible/modules/network/f5/bigip_partition.py
Python
gpl-3.0
10,561
# A script to migrate old keen analytics to a new collection, generate in-between points for choppy # data, or a little of both import os import csv import copy import pytz import logging import argparse import datetime from dateutil.parser import parse from keen.client import KeenClient from website.settings import ...
pattisdr/osf.io
scripts/analytics/migrate_analytics.py
Python
apache-2.0
20,106
#!/usr/bin/env python3 # # Copyright (c) 2020 Intel Corporation. # # SPDX-License-Identifier: Apache-2.0 """ Script to parse CTF data and print to the screen in a custom and colorful format. Generate trace using samples/subsys/tracing for example: west build -b qemu_x86 samples/subsys/tracing -t run \ -- -...
zephyrproject-rtos/zephyr
scripts/tracing/parse_ctf.py
Python
apache-2.0
4,911
# 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 # distributed under t...
coreycb/horizon
openstack_dashboard/dashboards/project/images/utils.py
Python
apache-2.0
3,845
from __future__ import print_function, absolute_import, division import numpy as np from numba.cuda.testing import unittest from numba import cuda import operator class TestOperatorModule(unittest.TestCase): """ Test if operator module is supported by the CUDA target. """ def operator_template(self, ...
stefanseefeld/numba
numba/cuda/tests/cudapy/test_operator.py
Python
bsd-2-clause
899
""" Twisted integration ------------------- This module provides a very simple way to integrate your tests with the Twisted_ event loop. You must import this module *before* importing anything from Twisted itself! Example:: from nose.twistedtools import reactor, deferred @deferred() def test_resolve(): ...
dbbhattacharya/kitsune
vendor/packages/nose/nose/twistedtools.py
Python
bsd-3-clause
5,391
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import optparse import quote import sys import unittest verbose = False # Wrapped versions of the functions that we're testing, ...
tierney/mustached-bear
tools/quote_test.py
Python
bsd-3-clause
5,459
import sys tests=[ ("testExecs/testReaction.exe","",{}), ("python","test_list.py",{'dir':'Wrap'}), ] longTests=[ ] if __name__=='__main__': import sys from rdkit import TestRunner failed,tests = TestRunner.RunScript('test_list.py',0,1) sys.exit(len(failed))
soerendip42/rdkit
Code/GraphMol/ChemReactions/test_list.py
Python
bsd-3-clause
279
import logging import os from gym import error logger = logging.getLogger(__name__)
xpharry/Udacity-DLFoudation
tutorials/reinforcement/gym/gym/scoreboard/client/__init__.py
Python
mit
86
LIKES={ 'l': '369239383222810', 'm': '369239343222814', 's': '369239263222822' } LIKES['large'] = LIKES['l'] LIKES['medium'] =LIKES['m'] LIKES['small'] = LIKES['s']
litobro/fbbot
fbchat/stickers.py
Python
mit
177
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-01-05 03:11 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency...
tyagow/AdvancingTheBlog
src/posts/migrations/0002_post_user.py
Python
mit
633
# Copyright (C) 2007-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 WARRANT...
gnperumal/exscript
src/Exscript/util/template.py
Python
gpl-2.0
6,513
import ocl import camvtk import time import vtk import datetime import math if __name__ == "__main__": print ocl.revision() myscreen = camvtk.VTKScreen() #stl = camvtk.STLSurf("../../stl/demo.stl") stl = camvtk.STLSurf("../../stl/gnu_tux_mod.stl") myscreen.addActor(stl) stl.SetWirefra...
tectronics/opencamlib
scripts/waterline/waterline_1_tux.py
Python
gpl-3.0
2,586
# -*- coding: utf-8 -*- # # ***** BEGIN GPL LICENSE BLOCK ***** # # -------------------------------------------------------------------------- # Blender 2.5 Extensions Framework # -------------------------------------------------------------------------- # # Authors: # Doug Hammond # # This program is free software; yo...
Microvellum/Fluid-Designer
win64-vc/2.78/Python/bin/2.78/scripts/addons/modules/extensions_framework/validate.py
Python
gpl-3.0
6,509
# -*- coding: utf-8 -*- # © 2016 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import hr_employee
VitalPet/hr
hr_employee_reference/models/__init__.py
Python
agpl-3.0
152
"""Support for FutureNow Ethernet unit outputs as Lights.""" import logging import voluptuous as vol from homeassistant.const import ( CONF_NAME, CONF_HOST, CONF_PORT, CONF_DEVICES) from homeassistant.components.light import ( ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light, PLATFORM_SCHEMA) import homeassist...
MartinHjelmare/home-assistant
homeassistant/components/futurenow/light.py
Python
apache-2.0
3,852
""" Copyright (2010-2014) INCUBAID BVBA 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, so...
openvstorage/arakoon
src/client/python/__init__.py
Python
apache-2.0
572
# # This module is a pure Python version of pypy.module.struct. # It is only imported if the vastly faster pypy.module.struct is not # compiled in. For now we keep this version for reference and # because pypy.module.struct is not ootype-backend-friendly yet. # """Functions to convert between Python values and C stru...
google/grumpy
third_party/pypy/_struct.py
Python
apache-2.0
12,831
# Generated by Django 1.10.5 on 2017-02-15 06:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0053_emailchangestatus'), ] operations = [ migrations.AddField( model_name='realm', name='icon_source', ...
showell/zulip
zerver/migrations/0054_realm_icon.py
Python
apache-2.0
674
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 compli...
salv-orlando/MyRepo
nova/tests/api/ec2/test_middleware.py
Python
apache-2.0
4,748
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 Isaku Yamahata <yamahata at valinux co jp> # # 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://...
tashaband/RYU295
ryu/tests/integrated/vrrp_common.py
Python
apache-2.0
8,658
from collections import namedtuple import sqlite3 # make a basic Link class Link = namedtuple('Link', ['id', 'submitter_id', 'submitted_time', 'votes', 'title', 'url']) # list of Links to work with links = [ Link(0, 60398, 1334014208.0, 109, "C overtakes Java as the No. 1 progr...
gusyussh/learntosolveit
languages/python/software_engineering_sqlite3.py
Python
bsd-3-clause
6,193
from django.contrib.messages import constants from django.contrib.messages.storage.fallback import ( CookieStorage, FallbackStorage, ) from django.test import SimpleTestCase from .base import BaseTests from .test_cookie import set_cookie_data, stored_cookie_messages_count from .test_session import set_session_data...
frishberg/django
tests/messages_tests/test_fallback.py
Python
bsd-3-clause
6,536
""" Test the pipeline module. """ import numpy as np from scipy import sparse from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regex from sklearn.utils.testing import assert_raise_message from sklearn.utils.testing import assert...
potash/scikit-learn
sklearn/tests/test_pipeline.py
Python
bsd-3-clause
24,571
# class generated by DeVIDE::createDeVIDEModuleFromVTKObject from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase import vtk class vtkHierarchicalDataSetGeometryFilter(SimpleVTKClassModuleBase): def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__( self, module_manag...
nagyistoce/devide
modules/vtk_basic/vtkHierarchicalDataSetGeometryFilter.py
Python
bsd-3-clause
536
import base64 import os import time from gluon import portalocker from gluon.admin import apath from gluon.fileutils import read_file # ########################################################### # ## make sure administrator is on localhost or https # ########################################################### http_h...
pouyana/teireader
webui/applications/admin/models/access.py
Python
mit
5,924
# -*- coding: utf-8 -*- """ Created on Tues Jun 23 16:32:27 2015 @author: boland help for interesections function came from: http://stackoverflow.com/questions/29465468\ python-intersection-point-of-two-great-circles-lat-long CODE DESCRIPTION: The following python script takes a set of four lat-lon coordinates and r...
boland1992/SeisSuite
seissuite/spacing/greatcircle_intersect.py
Python
gpl-3.0
2,983
# -*- 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...
addition-it-solutions/project-all
addons/account_check_writing/report/check_print.py
Python
agpl-3.0
2,876
# -*- 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...
steedos/odoo7
openerp/addons/point_of_sale/point_of_sale.py
Python
agpl-3.0
67,731
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.account.controllers.portal import PortalAccount from odoo.http import request class PortalAccount(PortalAccount): def _invoice_get_page_view_values(self, invoice, access_token, **kwargs): ...
ygol/odoo
addons/account_payment/controllers/portal.py
Python
agpl-3.0
1,661
# -*- coding: utf-8 -*- # # # OpenERP, Open Source Management Solution # This module copyright (C) 2016 Clear ICT Solutions (<info@clearict.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
Clear-ICT/odoo-addons
content_cleanup_stock_landed_costs/__init__.py
Python
agpl-3.0
881
# 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...
Bulochkin/tensorflow_pack
tensorflow/contrib/keras/python/keras/callbacks.py
Python
apache-2.0
36,338
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ...styles import Styles from ...format import Format class TestWriteXf(unittest.TestCa...
jvrsantacruz/XlsxWriter
xlsxwriter/test/styles/test_write_xf.py
Python
bsd-2-clause
16,206
# Copyright 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. import tempfile import unittest from .log import * from .parsed_trace_events import * class TraceTest(unittest.TestCase): def __init__(self, *args): ...
natduca/py_trace_event
trace_event_impl/trace_test.py
Python
bsd-3-clause
1,133
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.exceptions import ( ...
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/cryptography/hazmat/primitives/cmac.py
Python
bsd-3-clause
2,221
# -*- 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...
crmccreary/openerp_server
openerp/addons/hr_timesheet/hr_timesheet.py
Python
agpl-3.0
8,348
# Author: Leonardo Pistone # Copyright 2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any la...
NovaPointGroup/purchase-workflow
purchase_all_shipments/__openerp__.py
Python
agpl-3.0
978
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm def write_syn_libsvm_dataset(csvPathname, rowCount, colCount, SEED): r1 = random.Random(SEED) dsf = open(csvPathname, "w+") for i in range(rowCount): rowDa...
vbelakov/h2o
py/testdir_single_jvm/test_GLM2_many_cols_libsvm.py
Python
apache-2.0
2,663
from .Child import Child from .Node import Node # noqa: I201 STMT_NODES = [ # continue-stmt -> 'continue' label? ';'? Node('ContinueStmt', kind='Stmt', children=[ Child('ContinueKeyword', kind='ContinueToken'), Child('Label', kind='IdentifierToken', is_opt...
apple/swift
utils/gyb_syntax_support/StmtNodes.py
Python
apache-2.0
14,850
"""The tests for the Yamaha Media player platform.""" from unittest.mock import MagicMock, PropertyMock, call, patch import pytest import homeassistant.components.media_player as mp from homeassistant.components.yamaha import media_player as yamaha from homeassistant.components.yamaha.const import DOMAIN from homeass...
aronsky/home-assistant
tests/components/yamaha/test_media_player.py
Python
apache-2.0
5,828
from stream_framework.tests.feeds.base import TestBaseFeed, implementation from stream_framework.feeds.redis import RedisFeed from stream_framework.activity import Activity from stream_framework.utils import datetime_to_epoch class CustomActivity(Activity): @property def serialization_id(self): ''' ...
Anislav/Stream-Framework
stream_framework/tests/feeds/redis.py
Python
bsd-3-clause
1,712
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2009-2013 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt pytest fixtures used as defined in conftest.py: - gatewaywrapper - author_testimg """ import omero import Ice from omero.gateway.sc...
tp81/openmicroscopy
components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py
Python
gpl-2.0
8,597
import sys from snf_django.management import utils # Use backported unittest functionality if Python < 2.7 try: import unittest2 as unittest except ImportError: if sys.version_info < (2, 7): raise Exception("The unittest2 package is required for Python < 2.7") import unittest class ParseFiltersTe...
allmende/synnefo
snf-django-lib/snf_django/management/tests.py
Python
gpl-3.0
977
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # 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....
Sodki/ansible
lib/ansible/plugins/filter/core.py
Python
gpl-3.0
17,081
# -*- coding: utf-8 -*- from openerp import fields, models, api class crm_leads_dry_run(models.TransientModel): _name = "crm.leads.dry.run" lead_id = fields.Many2one('crm.lead', string='Lead', required=True) team_id = fields.Many2one('crm.team', string='SaleTeam', required=True, oldname='section_id') ...
addition-it-solutions/project-all
addons/website_crm_score/models/leads_dry_run.py
Python
agpl-3.0
1,257
#-*- coding: utf-8 -*- from openerp.osv import fields, osv, orm class project_isssue_solution(osv.osv): """ Note """ _inherit = 'project.issue.solution' _columns = { 'product_ids': fields.many2many('product.product', 'project_issue_solution_product_rel', 'solution_id','product_id', string='Products')...
adhoc-dev/odoo-addons
project_issue_solutions_product/project_issue_solution.py
Python
agpl-3.0
403
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt origin = 'lower' #origin = 'upper' delta = 0.025 x = y = np.arange(-3.0, 3.01, delta) X, Y = np.meshgrid(x, y) Z1 = plt.mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) Z2 = plt.mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1) Z = 10 * (Z1 - Z2) nr,...
radiasoft/radtrack
radtrack/plot/contourf_demo.py
Python
apache-2.0
3,308
from website.settings import DOMAIN as OSF_DOMAIN from website.settings import OSF_SUPPORT_EMAIL from osf.models import OSFUser from furl import furl def serialize_comment(comment): reports = [ serialize_report(user, report) for user, report in comment.reports.items() ] author_abs_url = fu...
pattisdr/osf.io
admin/spam/serializers.py
Python
apache-2.0
1,208
#!/usr/bin/env python3 # 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. '''Unit tests for node_io.FileNode''' from __future__ import print_function import os import sys import unittest if __name__ ==...
chromium/chromium
tools/grit/grit/node/node_io_unittest.py
Python
bsd-3-clause
6,562
#!/usr/bin/env python # Copyright (c) 2006 Damien Miller <djm@mindrot.org> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED ...
com4/py-editdist
test.py
Python
isc
1,856
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'DiffDialog.ui' # # Created: Tue Aug 30 12:04:37 2011 # by: PyQt4 UI code generator 4.8.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attr...
basicScandal/raft
ui/DiffDialog.py
Python
gpl-3.0
4,244
from gwpy.plotter import FrequencySeriesPlot plot = FrequencySeriesPlot(whiteasd, dispasd, sep=True, sharex=True, label=None)
gwpy/gwpy.github.io
docs/v0.5/examples/timeseries/filter-4.py
Python
gpl-3.0
125
from cx_Oracle import CLOB from django.contrib.gis.db.backends.adapter import WKTAdapter class OracleSpatialAdapter(WKTAdapter): input_size = CLOB
hunch/hunch-gift-app
django/contrib/gis/db/backends/oracle/adapter.py
Python
mit
157
""" Python Character Mapping Codec generated from 'hp_roman8.txt' with gencodec.py. Based on data from ftp://dkuug.dk/i18n/charmaps/HP-ROMAN8 (Keld Simonsen) Original source: LaserJet IIP Printer User's Manual HP part no 33471-90901, Hewlet-Packard, June 1989. """#" import codecs ### Codec APIs class ...
xbmc/atv2
xbmc/lib/libPython/Python/Lib/encodings/hp_roman8.py
Python
gpl-2.0
6,840
# -*- coding: utf-8 -*- """ *************************************************************************** lasduplicate.py --------------------- Date : September 2013 Copyright : (C) 2013 by Martin Isenburg Email : martin near rapidlasso point com ************...
jarped/QGIS
python/plugins/processing/algs/lidar/lastools/lasduplicate.py
Python
gpl-2.0
3,468
# -*- coding: utf-8 -*- from module.plugins.internal.MultiHook import MultiHook class SmoozedComHook(MultiHook): __name__ = "SmoozedComHook" __type__ = "hook" __version__ = "0.04" __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" ...
fayf/pyload
module/plugins/hooks/SmoozedComHook.py
Python
gpl-3.0
876
# Copyright (c) 2008 Mikeal Rogers # # 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 agre...
synergeticsedx/deployment-wipro
common/djangoapps/edxmako/shortcuts.py
Python
agpl-3.0
7,383
"""Helpers to execute scripts.""" import logging from contextlib import suppress from itertools import islice from typing import Optional, Sequence import voluptuous as vol from homeassistant.core import HomeAssistant, Context, callback from homeassistant.const import CONF_CONDITION, CONF_TIMEOUT from homeassistant ...
MartinHjelmare/home-assistant
homeassistant/helpers/script.py
Python
apache-2.0
12,633
""" This module exposes Home Assistant via Zeroconf. For more details about this component, please refer to the documentation at https://home-assistant.io/components/zeroconf/ """ import logging import socket import voluptuous as vol from homeassistant import util from homeassistant.const import (EVENT_HOMEASSISTANT...
MungoRae/home-assistant
homeassistant/components/zeroconf.py
Python
apache-2.0
1,636
# -*- encoding: utf-8 -*- """ sleekxmpp.plugins.base ~~~~~~~~~~~~~~~~~~~~~~ This module provides XMPP functionality that is specific to client connections. Part of SleekXMPP: The Sleek XMPP Library :copyright: (c) 2012 Nathanael C. Fritz :license: MIT, see LICENSE for more details """ i...
danielvdao/facebookMacBot
venv/lib/python2.7/site-packages/sleekxmpp/plugins/base.py
Python
mit
12,142
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from . import account_invoice # vim:expandtab:smar...
sysadminmatmoz/ingadhoc
account_invoice_commercial/__init__.py
Python
agpl-3.0
366
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et # $Id: test_multi.py,v 1.10 2005/03/11 13:24:45 kjetilja Exp $ import pycurl m = pycurl.CurlMulti() m.handles = [] c1 = pycurl.Curl() c2 = pycurl.Curl() c1.setopt(c1.URL, 'http://curl.haxx.se') c2.setopt(c2.URL, 'http://cnn.com') c2.setopt(c2.FOLLOWLOCA...
blite/python-curl
tests/test_multi.py
Python
lgpl-2.1
676
"""Tests for the login flow.""" from . import async_setup_auth from tests.async_mock import patch from tests.common import CLIENT_ID, CLIENT_REDIRECT_URI async def test_fetch_auth_providers(hass, aiohttp_client): """Test fetching auth providers.""" client = await async_setup_auth(hass, aiohttp_client) re...
nkgilley/home-assistant
tests/components/auth/test_login_flow.py
Python
apache-2.0
3,442
# -*- coding: utf-8 -*- { 'name': 'test-import-export', 'version': '0.1', 'category': 'Tests', 'description': """A module to test import/export.""", 'author': 'OpenERP SA', 'maintainer': 'OpenERP SA', 'website': 'http://www.openerp.com', 'depends': ['base'], 'data': ['ir.model.access...
addition-it-solutions/project-all
openerp/addons/test_impex/__openerp__.py
Python
agpl-3.0
382
# 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...
drpngx/tensorflow
tensorflow/contrib/data/python/kernel_tests/serialization/tf_record_dataset_serialization_test.py
Python
apache-2.0
3,947
""" This module implements the TextResponse class which adds encoding handling and discovering (through HTTP headers) to base Response class. See documentation in docs/topics/request-response.rst """ from w3lib.encoding import html_to_unicode, resolve_encoding, \ html_body_declared_encoding, http_content_type_enc...
emschorsch/scrapy
scrapy/http/response/text.py
Python
bsd-3-clause
3,212
#!/usr/bin/env python3 # Copyright (c) 2014-2016 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 -alertnotify option.""" import os import time from test_framework.test_framework import Bitco...
21E14/bitcoin
test/functional/forknotify.py
Python
mit
2,125
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
kaffeel/oppia
extensions/rich_text_components/Image/Image.py
Python
apache-2.0
2,465
from __future__ import unicode_literals import frappe, unittest from werkzeug.wrappers import Request from werkzeug.test import EnvironBuilder from frappe.website import render def set_request(**kwargs): builder = EnvironBuilder(**kwargs) frappe.local.request = Request(builder.get_environ()) class TestWebsite(uni...
maxtorete/frappe
frappe/tests/test_website.py
Python
mit
649
""" Component that connects to a Nuimo device over Bluetooth LE. For more details about this component, please refer to the documentation at https://home-assistant.io/components/nuimo_controller/ """ import logging import threading import time import voluptuous as vol import homeassistant.helpers.config_validation as ...
xifle/home-assistant
homeassistant/components/nuimo_controller.py
Python
mit
5,699
# 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 ...
Akrog/cinder
cinder/tests/__init__.py
Python
apache-2.0
1,435
#!/usr/bin/env python import puka import sys client = puka.Client("amqp://localhost/") promise = client.connect() client.wait(promise) promise = client.exchange_declare(exchange='direct_logs', type='direct') client.wait(promise) promise = client.queue_declare(exclusive=True) queue_name = client.wait(promise)['queue...
fams/rabbitmq-tutorials
python-puka/receive_logs_direct.py
Python
apache-2.0
902
from django import forms from tower import ugettext_lazy as _lazy from kitsune.forums.models import Thread, Post from kitsune.sumo.form_fields import StrippedCharField MSG_TITLE_REQUIRED = _lazy(u'Please provide a title.') MSG_TITLE_SHORT = _lazy( u'Your title is too short (%(show_value)s characters). It must b...
orvi2014/kitsune
kitsune/forums/forms.py
Python
bsd-3-clause
3,129
''' ''' from __future__ import absolute_import, print_function from ...exceptions import ProtocolError from ..message import Message from . import register import logging log = logging.getLogger(__name__) @register class push_doc_1(Message): ''' ''' msgtype = 'PUSH-DOC' revision = 1 def __in...
htygithub/bokeh
bokeh/server/protocol/messages/push_doc.py
Python
bsd-3-clause
847
def migrate_up(manager): raise Exception('migrate.py should be migrating directly to schema 51 ' 'instead of running migration 1...') def migrate_down(manager): manager.execute_script(DROP_DB_SQL) DROP_DB_SQL = """\ DROP TABLE IF EXISTS `acl_groups`; DROP TABLE IF EXISTS `acl_groups_host...
nacc/autotest
frontend/migrations/001_initial_db.py
Python
gpl-2.0
650
"""Test lazymod.py""" import sys import unittest from capa.safe_exec.lazymod import LazyModule class ModuleIsolation(object): """ Manage changes to sys.modules so that we can roll back imported modules. Create this object, it will snapshot the currently imported modules. When you call `clean_up()`,...
angelapper/edx-platform
common/lib/capa/capa/safe_exec/tests/test_lazymod.py
Python
agpl-3.0
2,041
# 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...
npuichigo/ttsflow
third_party/tensorflow/tensorflow/contrib/keras/python/keras/layers/noise.py
Python
apache-2.0
5,875
NAME = 'logcrypto' CFLAGS = [] LDFLAGS = [] LIBS = [] GCC_LIST = ['logcrypto']
goal/uwsgi
plugins/logcrypto/uwsgiplugin.py
Python
gpl-2.0
80
from __future__ import absolute_import from . import mod
Chilledheart/chromium
tools/telemetry/third_party/modulegraph/modulegraph_tests/testpkg-relimport/pkg/relative.py
Python
bsd-3-clause
57
import unittest from cStringIO import StringIO from ..backends import static # There aren't many tests here because it turns out to be way more convenient to # use test_serializer for the majority of cases class TestStatic(unittest.TestCase): def compile(self, input_text, input_data): return static.com...
youtube/cobalt
third_party/web_platform_tests/tools/wptrunner/wptrunner/wptmanifest/tests/test_static.py
Python
bsd-3-clause
2,576
# -*- coding: utf-8 -*- """ *************************************************************************** GridInverseDistanceNearestNeighbor.py --------------------- Date : September 2017 Copyright : (C) 2017 by Alexander Bruy Email : alexander dot bruy at gm...
uclaros/QGIS
python/plugins/processing/algs/gdal/GridInverseDistanceNearestNeighbor.py
Python
gpl-2.0
9,771
from django.conf import settings from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated MySQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated ag...
AloneRoad/Inforlearn
vendor/django/db/backends/mysql/creation.py
Python
apache-2.0
2,925
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, api, fields from odoo.tools.translate import _ class StockPicking(models.Model): _inherit = 'stock.picking' website_id = fields.Many2one('website', related='sale_id.website_id', string...
ddico/odoo
addons/website_sale_stock/models/stock_picking.py
Python
agpl-3.0
467
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt #!/usr/bin/python # This script is for cleaning up of all data from system including # all transactions and masters (excludes default masters). # Basically after running this file, syste...
saurabh6790/test-med-app
utilities/cleanup_data.py
Python
agpl-3.0
6,503
from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404 from wagtail.wagtailcore.models import Page, PageViewRestriction from wagtail.wagtailadmin.forms import PageViewRestrictionForm from wagtail.wagtailadmin.modal_workflow import render_modal_workflow def set_privacy(requ...
mephizzle/wagtail
wagtail/wagtailadmin/views/page_privacy.py
Python
bsd-3-clause
3,072
# coding: utf-8 """ Unit tests of context.py. """ from datetime import datetime import unittest from pystache.context import _NOT_FOUND, _get_value, KeyNotFoundError, ContextStack from pystache.tests.common import AssertIsMixin, AssertStringMixin, AssertExceptionMixin, Attachable class SimpleObject(object): "...
zzeleznick/zDjango
venv/lib/python2.7/site-packages/pystache/tests/test_context.py
Python
mit
14,750
import win32api, win32security import win32con, ntsecuritycon, winnt import os temp_dir=win32api.GetTempPath() fname=win32api.GetTempFileName(temp_dir,'rsk')[0] print fname ## file can't exist os.remove(fname) ## enable backup and restore privs required_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE...
JulienMcJay/eclock
windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/Demos/RegRestoreKey.py
Python
gpl-2.0
1,832
#!/usr/bin/env python # 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 json import unittest from compiled_file_system import CompiledFileSystem from object_store_creator import ObjectStoreCreator fr...
s20121035/rk3288_android5.1_repo
external/chromium_org/chrome/common/extensions/docs/server2/redirector_test.py
Python
gpl-3.0
7,651
""" uritemplate.api =============== This module contains the very simple API provided by uritemplate. """ from uritemplate.template import URITemplate def expand(uri, var_dict=None, **kwargs): """Expand the template with the given parameters. :param str uri: The templated URI to expand :param dict var...
ido-ran/ran-smart-frame2
web/server/lib/uritemplate/api.py
Python
mit
1,911
class B(object): attr = 'baz' __slots__ = ['f', 'b'] class C(B): __slots__ = ['attr', 'bar'] C.attr = 'spam' print(C.attr) c = C() <warning descr="'C' object attribute 'attr' is read-only">c.attr</warning> = 'spam' print(c.attr)
michaelgallacher/intellij-community
python/testData/inspections/PyPropertyAccessInspection/inheritedClassAttrAssignmentAndOwnWithAttrAndInheritedSlots.py
Python
apache-2.0
243
#! /usr/bin/env python # (Force the script to use the latest build.) # # test_parser.py import parser, traceback _numFailed = 0 def testChunk(t, fileName): global _numFailed print '----', fileName, try: ast = parser.suite(t) tup = parser.ast2tuple(ast) # this discards the first ...
xbmc/xbmc-antiquated
xbmc/lib/libPython/Python/Demo/parser/test_parser.py
Python
gpl-2.0
1,193
# 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 os from telemetry.page.actions import page_action class TapAction(page_action.PageAction): def __init__(self, selector=None, text=None, element_f...
7kbird/chrome
tools/telemetry/telemetry/page/actions/tap.py
Python
bsd-3-clause
2,540
"""Tests for the input_boolean component."""
fbradyirl/home-assistant
tests/components/input_boolean/__init__.py
Python
apache-2.0
45