code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
from ...shareds... | jvrsantacruz/XlsxWriter | xlsxwriter/test/worksheet/test_worksheet08.py | Python | bsd-2-clause | 3,094 |
# Copyright 2022 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... | chromium/chromium | third_party/tflite_support/src/tensorflow_lite_support/python/task/processor/proto/classifications_pb2.py | Python | bsd-3-clause | 837 |
# 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 datetime
import logging
import multiprocessing
import os
import posixpath
import Queue
import re
import subprocess
import sys
impor... | TeamEOS/external_chromium_org | build/android/pylib/symbols/elf_symbolizer.py | Python | bsd-3-clause | 17,340 |
import datetime
from stream_framework.activity import Activity
from stream_framework.activity import AggregatedActivity
from stream_framework.activity import DehydratedActivity
from stream_framework.tests.utils import Pin
from stream_framework.verbs.base import Love as LoveVerb
from stream_framework.aggregators.base im... | Anislav/Stream-Framework | stream_framework/tests/activity.py | Python | bsd-3-clause | 6,026 |
##
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | ULHPC/modules | easybuild/easybuild-easyblocks/easybuild/easyblocks/c/cp2k.py | Python | mit | 31,859 |
# encoding: UTF-8
from vnshzd import ShzdApi | mumuwoyou/vnpy-master | vnpy/api/shzd/__init__.py | Python | mit | 45 |
"""Implements the upcoming event widget."""
| yongwen/makahiki | makahiki/apps/widgets/upcoming_events/__init__.py | Python | mit | 44 |
# xml.etree test for cElementTree
import doctest, sys
from test import test_support
from xml.etree import cElementTree as ET
SAMPLE_XML = """
<body>
<tag>text</tag>
<tag />
<section>
<tag>subtext</tag>
</section>
</body>
"""
SAMPLE_XML_NS = """
<body xmlns="http://effbot.org/ns">
<tag>text</tag>
<t... | zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_xml_etree_c.py | Python | epl-1.0 | 5,936 |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os,sys,imp,types,re
from waflib.Tools import ccroot
from waflib import Utils,Configure
from waflib.Logs import debug
cxx_compiler={'win32':['msvc','g++','clang++'],'cygwin':['g++'],'darwin':['... | asljivo1/802.11ah-ns3 | ns-3/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Tools/compiler_cxx.py | Python | gpl-2.0 | 1,790 |
#!/usr/bin/python
# (c) 2012, Mark Theunissen <mark.theunissen@gmail.com>
# Sponsored by Four Kitchens http://fourkitchens.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... | camradal/ansible | lib/ansible/modules/database/mysql/mysql_user.py | Python | gpl-3.0 | 23,551 |
# -*- coding: utf-8 -*-
"""
Post processing.... take 1
Created on Thu Jan 17 14:32:06 2013
@author: ran110
"""
'''
import subprocess
subprocess.call(['pip', 'install', 'h5py'])
'''
import h5py, os
import numpy as np
import fnmatch
def findFiles(starting_dir='.', pattern='Temp*h5'):
'''lo... | victortey/VEGL-Portal | scripts/postproc-h5.py | Python | gpl-3.0 | 1,896 |
"""Support for AdGuard Home sensors."""
from __future__ import annotations
from datetime import timedelta
from adguardhome import AdGuardHome, AdGuardHomeConnectionError
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCE... | jawilson/home-assistant | homeassistant/components/adguard/sensor.py | Python | apache-2.0 | 7,958 |
from numpy.testing import assert_array_equal, assert_equal, assert_raises
import numpy as np
from skimage._shared.testing import test_parallel
from skimage.draw import (set_color, line, line_aa, polygon, polygon_perimeter,
circle, circle_perimeter, circle_perimeter_aa,
... | pratapvardhan/scikit-image | skimage/draw/tests/test_draw.py | Python | bsd-3-clause | 29,321 |
#!/usr/bin/env python3
# Copyright (c) 2015-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.
"""Utilities for manipulating blocks and transactions."""
from .address import (
key_to_p2sh_p2wpkh,
... | ahmedbodi/vertcoin | test/functional/test_framework/blocktools.py | Python | mit | 8,126 |
#
# Copyright 2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" constants file """
# Kernel Namespace
KERNEL = 'kernel'
# I/O Signature (Symbols and constants)
IO_SIGNATURE = 'io_signature::'
SIGNATURE_LIST = ['makev', 'make3', 'make2', 'make'... | jdemel/gnuradio | gr-utils/blocktool/core/Constants.py | Python | gpl-3.0 | 1,460 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale_timesheet.tests.common import TestCommonSaleTimesheetNoChart
from odoo.exceptions import UserError
class TestProjectBilling(TestCommonSaleTimesheetNoChart):
""" This test suite provide checks ... | t3dev/odoo | addons/sale_timesheet/tests/test_project_billing.py | Python | gpl-3.0 | 23,191 |
#! /usr/bin/env python2
# Copyright (c) 2014 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 implementatio... | HwisooSo/gemV-update | util/hgstyle.py | Python | bsd-3-clause | 8,370 |
import warnings
import numpy as np
from numpy.testing import assert_array_almost_equal as assert_close
from numpy.testing import (assert_array_equal, assert_raises,
assert_almost_equal)
import skimage
from skimage import data
from skimage import exposure
from skimage.exposure.exposure impor... | ofgulban/scikit-image | skimage/exposure/tests/test_exposure.py | Python | bsd-3-clause | 17,192 |
#!/usr/bin/env python
import os
import sys
import pytest
from openmc import Material
from openmc.data import NATURAL_ABUNDANCE, atomic_mass
def test_element_wo():
# This test doesn't require an OpenMC run. We just need to make sure the
# element.expand() method expands elements with the proper nuclide
... | mit-crpg/openmc | tests/unit_tests/test_element_wo.py | Python | mit | 1,427 |
"""
Fake Software Secure page for use in acceptance tests.
"""
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.views.generic.base import View
from edxmako.shortcuts import render... | BehavioralInsightsTeam/edx-platform | lms/djangoapps/verify_student/tests/fake_software_secure.py | Python | agpl-3.0 | 1,684 |
"""Config flow to configure the Ambient PWS component."""
from aioambient import Client
from aioambient.errors import AmbientError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_API_KEY
from homeassistant.helpers import aiohttp_client
from .const import CONF_APP... | tchellomello/home-assistant | homeassistant/components/ambient_station/config_flow.py | Python | apache-2.0 | 2,215 |
# Copyright (C) 2011, CloudCaptive
#
# 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 i... | rafasashi/userinfuser | serverside/signup.py | Python | gpl-3.0 | 8,144 |
import unittest
from test import test_support
import os
import socket
import StringIO
import urllib2
from urllib2 import Request, OpenerDirector
try:
import ssl
except ImportError:
ssl = None
# XXX
# Request
# CacheFTPHandler (hard to write)
# parse_keqv_list, parse_http_list, HTTPDigestAuthHandler
class T... | jlspyaozhongkai/Uter | third_party_build/Python-2.7.9/lib/python2.7/test/test_urllib2.py | Python | gpl-3.0 | 54,618 |
"""SCons.Tool.javah
Tool-specific initialization for javah.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permissio... | carlos-lopez-garces/mapnik-trunk | scons/scons-local-1.2.0/SCons/Tool/javah.py | Python | lgpl-2.1 | 4,559 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from colle... | pombredanne/pants | src/python/pants/backend/jvm/tasks/jvm_dependency_check.py | Python | apache-2.0 | 11,454 |
from .provider import S3Provider # noqa
| TomBaxter/waterbutler | waterbutler/providers/s3/__init__.py | Python | apache-2.0 | 41 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Red Hat, Inc.
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://w... | sridevikoushik31/openstack | nova/db/sqlalchemy/migrate_repo/versions/154_add_shadow_tables.py | Python | apache-2.0 | 2,666 |
import re
from docutils import nodes, utils
from docutils.parsers.rst import roles
pubmed_uri_pattern = "http://www.ncbi.nlm.nih.gov/pubmed/%i"
doi_uri_pattern = "http://dx.doi.org/%s"
def pmid_reference_role(role, rawtext, text, lineno, inliner,
options={}, content=[]):
try:
pmid... | sorgerlab/belpy | doc/ext/citations.py | Python | mit | 1,373 |
#!/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... | jtyr/ansible-modules-core | network/nxos/nxos_nxapi.py | Python | gpl-3.0 | 10,922 |
#!/bin/sh
#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 ... | hanhlh/hadoop-0.20.2_FatBTree | src/contrib/hod/support/logcondense.py | Python | apache-2.0 | 7,097 |
# -*- coding: utf-8 -*-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class BillionuploadsCom(DeadHoster):
__name__ = "BillionuploadsCom"
__type__ = "hoster"
__version__ = "0.07"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?billionuploads\.com/\w{12}... | LePastis/pyload | module/plugins/hoster/BillionuploadsCom.py | Python | gpl-3.0 | 567 |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import gyp.common
import os.p... | boudewijnrempt/breakpad | src/tools/gyp/pylib/gyp/xcode_emulation.py | Python | bsd-3-clause | 41,719 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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',
... | Jorge-Rodriguez/ansible | lib/ansible/modules/network/f5/bigip_gtm_topology_record.py | Python | gpl-3.0 | 33,022 |
##########################################################################
#
# Copyright (c) 2010, Image Engine Design 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:
#
# * Redistribu... | code-google-com/cortex-vfx | test/IECoreNuke/StringUtilTest.py | Python | bsd-3-clause | 2,890 |
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.utils.encoding import force_text
class AccessMixin:
"""
Abstract CBV mixin that giv... | camilonova/django | django/contrib/auth/mixins.py | Python | bsd-3-clause | 3,861 |
# Copyright (c) 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | samsu/neutron | plugins/ml2/drivers/arista/exceptions.py | Python | apache-2.0 | 1,035 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from erpnext.regional.united_arab_emirates.setup import make_custom_fields, add_print_formats
from erpnext.setup.setup_wizard.operations.taxes_setup im... | Zlash65/erpnext | erpnext/regional/saudi_arabia/setup.py | Python | gpl-3.0 | 464 |
import unittest
import json
import logging
from mock import Mock, patch
from webob.multidict import MultiDict
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from opaque_keys.edx.locations import Location, SlashSeparatedCourseKey
from xmodule.tests import get_test_system, get_test_descr... | beni55/edx-platform | common/lib/xmodule/xmodule/tests/test_peer_grading.py | Python | agpl-3.0 | 16,222 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Stock Transfer Split Multi module for Odoo
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can... | vrenaville/stock-logistics-workflow | stock_transfer_split_multi/wizard/stock_transfer_split_multi.py | Python | agpl-3.0 | 2,813 |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off o... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/google-api-python-client/oauth2client/multistore_file.py | Python | bsd-3-clause | 10,605 |
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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 pytest
import sys
if sys.version_info < (2... | kvar/ansible | test/units/modules/network/f5/test_bigip_profile_analytics.py | Python | gpl-3.0 | 3,514 |
# -*- coding: utf-8 -*-
#
#
# Authors: Guewen Baconnier
# 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
# Licens... | damdam-s/sale-workflow | sale_payment_term_interest/model/sale_order.py | Python | agpl-3.0 | 4,591 |
def main(req, res):
return ([
(b'Cache-Control', b'no-cache, must-revalidate'),
(b'Pragma', b'no-cache'),
(b'Content-Type', b'application/javascript')],
b'echo_output = "%s";\n' % req.GET[b'msg'])
| scheib/chromium | third_party/blink/web_tests/external/wpt/service-workers/service-worker/resources/import-scripts-echo.py | Python | bsd-3-clause | 231 |
import unittest
class X(unittest.TestCase):
def test1(self):
self.assertEqual()
def test2(self):
self.assertEqual()
def test3(self):
self.assertEqual()
def test4(self):
self.assertEqual()
def test5(self):
self.assertEqual()
def test6(self):
s... | paplorinc/intellij-community | python/testData/editing/pairedParenthesesMultipleCalls.after.py | Python | apache-2.0 | 934 |
import os
import site
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings_local")
wsgidir = os.path.dirname(__file__)
for path in ['../',
'../..',
'../../apps']:
site.addsitedir(os.path.abspath(os.path.join(wsgidir, path)))
from ..theme_update import application
| muffinresearch/addons-server | services/wsgi/theme_update.py | Python | bsd-3-clause | 302 |
# 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.
from code import Code
from model import PropertyType
import cpp_util
from json_parse import OrderedDict
import schema_util
class _TypeDependency(object)... | DirtyUnicorns/android_external_chromium-org | tools/json_schema_compiler/cpp_type_generator.py | Python | bsd-3-clause | 11,425 |
#!/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.
"""This script is copied from
https://chromium.googlesource.com/infra/infra.git/+/master/bootstrap
"""
import datetime
import logg... | Teamxrtc/webrtc-streaming-node | third_party/depot_tools/testing_support/get_appengine.py | Python | mit | 4,274 |
#!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | hryamzik/ansible | lib/ansible/modules/cloud/amazon/ec2_elb_facts.py | Python | gpl-3.0 | 8,629 |
# Reads a list of urls and an old list of services and outputs the list
# of hostnames that are missing from the old list of services.
#
# List of urls can be generated from the mitro db using:
#
# psql -P tuples_only=on -c "select hostname from secrets" mitro
#
from collections import defaultdict
import json
import o... | ssgeejr/mitropm | mitro-core/tools/icons_crawler/build_update_list.py | Python | gpl-3.0 | 1,567 |
# 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... | laosiaudi/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/models/forest_to_data_then_nn_test.py | Python | apache-2.0 | 3,269 |
"""
Useful form fields for use with SQLAlchemy ORM.
"""
import operator
from wtforms import widgets
from wtforms.fields import SelectFieldBase
from wtforms.validators import ValidationError
from .tools import get_primary_key
from flask_admin._compat import text_type, string_types
from flask_admin.form import Form... | hexlism/css_platform | sleepyenv/lib/python2.7/site-packages/Flask_Admin-1.2.0-py2.7.egg/flask_admin/contrib/sqla/fields.py | Python | apache-2.0 | 8,740 |
# 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/python/ops/array_grad.py | Python | bsd-2-clause | 22,276 |
#!/usr/bin/env python
data = '../data/fm_train_real.dat'
parameter_list = [[data]]
def converter_tdistributedstochasticneighborembedding_modular(data_fname, seed=1):
try:
from modshogun import RealFeatures, TDistributedStochasticNeighborEmbedding
from modshogun import Math_init_random, CSVFile
# reproducible r... | AzamYahya/shogun | examples/undocumented/python_modular/converter_tdistributedstochasticneighborembedding_modular.py | Python | gpl-3.0 | 754 |
#! /usr/bin/env python
"""
Script to generate notebooks with output from notebooks that don't have
output.
"""
# prefer HTML over rST for now until nbconvert changes drop
OUTPUT = "html"
import os
import io
import sys
import time
import shutil
SOURCE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."... | musically-ut/statsmodels | tools/nbgenerate.py | Python | bsd-3-clause | 11,564 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
page_title = "Blog"
def get_context(context):
context.update(frappe.get_doc("Blog Settings", "Blog Settings").as_dict())
context.children = get_children()
def... | geo-poland/frappe | frappe/templates/pages/blog.py | Python | mit | 504 |
# -*- coding: utf-8 -*-
"""
Test cases related to XML Schema parsing and validation
"""
import unittest, sys, os.path
this_dir = os.path.dirname(__file__)
if this_dir not in sys.path:
sys.path.insert(0, this_dir) # needed for Py3
from common_imports import etree, BytesIO, HelperTestCase, fileInTestDir
from comm... | vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/lxml/src/lxml/tests/test_xmlschema.py | Python | gpl-2.0 | 14,290 |
# coding: utf-8
#
# Copyright 2015 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 | integrations_dev/openedx_xblock/xblock-oppia/oppia/oppia.py | Python | apache-2.0 | 4,448 |
# (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... | anryko/ansible | lib/ansible/playbook/__init__.py | Python | gpl-3.0 | 4,725 |
#=======================================================================
#
# Python Lexical Analyser
#
#
# Scanning an input stream
#
#=======================================================================
from __future__ import absolute_import
import cython
cython.declare(BOL=object, EOL=object, EOF=object, NO... | Architektor/PySnip | venv/lib/python2.7/site-packages/Cython/Plex/Scanners.py | Python | gpl-3.0 | 12,237 |
import time
import unittest
from robot.utils.asserts import assert_equals
from robot.utils.robottime import TimestampCache
class FakeTimestampCache(TimestampCache):
def __init__(self, epoch):
TimestampCache.__init__(self)
self.epoch = epoch + self.timezone_correction()
def _get_epoch(self):... | yahman72/robotframework | utest/utils/test_timestampcache.py | Python | apache-2.0 | 1,868 |
#!/usr/bin/env python
'''Testing rect map debug rendering.
You should see a checkered square grid.
Press escape or close the window to finish the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
from render_base import RenderBase
import scene2d
from scene2d.debug import gen_rect_ma... | nicememory/pie | pyglet/contrib/currently-broken/scene2d/tests/scene2d/RECT_FLAT_DEBUG.py | Python | apache-2.0 | 598 |
# -*- coding: utf-8 -*-
address_mode_def = {}
address_mode_def['S_IMPLIED'] = dict(size=1, short='sngl')
address_mode_def['S_IMMEDIATE'] = dict(size=2, short='imm')
address_mode_def['S_IMMEDIATE_WITH_MODIFIER'] = dict(size=2, short='imm')
address_mode_def['S_ACCUMULATOR'] = dict(size=1, short='acc')
address_mode_def['... | shekkbuilder/pyNES | pynes/c6502.py | Python | bsd-3-clause | 3,905 |
def get_tuple() -> tuple[str, ...]:
pass
<the_ref>get_tuple() | asedunov/intellij-community | python/testData/quickdoc/HomogeneousTuple.py | Python | apache-2.0 | 66 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""".. currentmodule:: migrate.versioning.util"""
import warnings
import logging
from decorator import decorator
from pkg_resources import EntryPoint
import six
from sqlalchemy import create_engine
from sqlalchemy.engine import Engine
from sqlalchemy.pool import StaticPool... | odubno/microblog | venv/lib/python2.7/site-packages/migrate/versioning/util/__init__.py | Python | bsd-3-clause | 5,339 |
"""The here_travel_time component."""
| jawilson/home-assistant | homeassistant/components/here_travel_time/__init__.py | Python | apache-2.0 | 38 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api, fields, models
class res_partner(models.Model):
_name = 'res.partner'
_inherit = 'res.partner'
@api.multi
def _purchase_invoice_count(self):
PurchaseOrder = self.env['pu... | vileopratama/vitech | src/addons/purchase/partner.py | Python | mit | 1,222 |
#!/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... | thaim/ansible | lib/ansible/modules/network/fortimanager/fmgr_ha.py | Python | mit | 13,484 |
#!/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... | garyjyao1/ansible | lib/ansible/modules/core/cloud/amazon/s3.py | Python | gpl-3.0 | 26,908 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | jmesteve/saas3 | openerp/addons/mail/wizard/invite.py | Python | agpl-3.0 | 5,467 |
# -*- coding: utf-8 -*-
"""
jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
Nutshell
--------
Here a small example of a Jinja2 template::
{% ... | sdoran35/hate-to-hugs | venv/lib/python3.6/site-packages/jinja2/__init__.py | Python | mit | 2,565 |
# -*- coding: utf-8 -*-
from xml.etree import ElementTree
from openerp.addons.web.controllers.main import load_actions_from_ir_values
from openerp.addons.web.http import Controller, route, request
class Board(Controller):
@route('/board/add_to_dashboard', type='json', auth='user')
def add_to_dashboard(self, m... | jmesteve/saas3 | openerp/addons/board/controllers.py | Python | agpl-3.0 | 1,981 |
# Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | rooshilp/CMPUT410Lab6 | virt_env/virt1/lib/python2.7/site-packages/django/conf/global_settings.py | Python | apache-2.0 | 23,177 |
from . import test_barcode_nomenclature
| Aravinthu/odoo | addons/barcodes/tests/__init__.py | Python | agpl-3.0 | 40 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import base_gengo_translations
| Aravinthu/odoo | addons/website_gengo/models/__init__.py | Python | agpl-3.0 | 138 |
# Copyright 2013 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
#
# Unless required by applicable law or agre... | ChinaMassClouds/copenstack-server | openstack/src/nova-2014.2/nova/openstack/common/report/views/text/header.py | Python | gpl-2.0 | 1,534 |
from django.contrib.auth.models import User
from django.http import Http404
from rest_framework import serializers
from openedx.core.djangoapps.course_groups.cohorts import is_course_cohorted
from notification_prefs import NOTIFICATION_PREF_KEY
from lang_pref import LANGUAGE_KEY
class NotifierUserSerializer(serializ... | beni55/edx-platform | lms/djangoapps/notifier_api/serializers.py | Python | agpl-3.0 | 2,661 |
# cython: infer_types=True, language_level=3, py2_import=True
#
# Cython Scanner
#
import os
import platform
import cython
cython.declare(EncodedString=object, any_string_prefix=unicode, IDENT=unicode,
print_function=object)
from Cython import Utils
from Cython.Plex.Scanners import Scanner
from Cyth... | Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/third_party/cython/src/Cython/Compiler/Scanning.py | Python | mit | 16,183 |
# Collect facts related to system service manager and init.
#
# 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) a... | Russell-IO/ansible | lib/ansible/module_utils/facts/system/service_mgr.py | Python | gpl-3.0 | 6,057 |
"""Implementaton of :class:`PythonIntegerRing` class. """
from __future__ import print_function, division
from sympy.polys.domains.integerring import IntegerRing
from sympy.polys.domains.groundtypes import (
PythonInteger, SymPyInteger, python_sqrt,
python_factorial, python_gcdex, python_gcd, python_lcm,
)
f... | wxgeo/geophar | wxgeometrie/sympy/polys/domains/pythonintegerring.py | Python | gpl-2.0 | 2,650 |
"""
XBlock runtime services for LibraryContentModule
"""
from django.core.exceptions import PermissionDenied
from opaque_keys.edx.locator import LibraryLocator, LibraryUsageLocator
from search.search_engine_base import SearchEngine
from xmodule.library_content_module import ANY_CAPA_TYPE_VALUE
from xmodule.modulestore ... | ahmadiga/min_edx | common/lib/xmodule/xmodule/library_tools.py | Python | agpl-3.0 | 7,784 |
import goocanvas
import core
import math
import pango
import gtk
class Axes(object):
def __init__(self, viz):
self.viz = viz
self.color = 0x8080C0FF
self.hlines = goocanvas.Path(parent=viz.canvas.get_root_item(), stroke_color_rgba=self.color)
self.hlines.lower(None)
self.vl... | JBonsink/GSOC-2013 | tools/ns-allinone-3.14.1/ns-3.14.1/src/visualizer/visualizer/hud.py | Python | gpl-3.0 | 5,462 |
"""
Tests for `tty`.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/tty.html
"""
# from helpers import check, check_version, run
from helpers import check_version, run
def test_version():
"""Check that we're using Boreutil's implementation."""
assert check_version("tty")
def test_missing_args(... | duckinator/boreutils | test/test_tty.py | Python | isc | 1,482 |
#! /usr/bin/env python
#
# SCons - a Software Constructor
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 ... | looooo/pivy | scons/scons.py | Python | isc | 6,018 |
class Source:
def __init__(self):
self.config = None
def set_config(self, config):
"""config should be some dict"""
self.config = config
def sync(self):
"""returns list of DSFSDF, is a coroutine"""
pass
import feedparser, pprint, asyncio, aiohttp
class FeedSource(Source):
@asyncio.coroutine
def sync(s... | brownhead/email-client | eclient/source.py | Python | isc | 1,508 |
from feedhandler.feedhandler import FeedHandler | tobbez/lys-reader | backend/feedhandler/__init__.py | Python | isc | 47 |
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from modoboa.core.models import User
from modoboa.lib.tests import ModoTestCase
from .. import factories
class PasswordSchemesTestCase(ModoTestCase):
@classmethod
def setUpTestData(cls):
"""Create test data."""
... | bearstech/modoboa | modoboa/admin/tests/test_password_schemes.py | Python | isc | 1,847 |
from django.contrib import admin
from solo.admin import SingletonModelAdmin
from exchange.models import ExchangeRates
from exchange.tasks import update_all_prices
@admin.register(ExchangeRates)
class ExchangeRatesAdmin(SingletonModelAdmin):
list_display = ['id', 'usd', 'eur']
list_editable = ['usd', 'eur'... | pmaigutyak/mp-shop | exchange/admin.py | Python | isc | 418 |
from Tkinter import *
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.autograd as autograd
from torch.autograd import Variable
master = Tk()
goal = 0
var_goal = StringVar()
GAMMA = 0.9
last_state = Variable(torch.Tensor([0,0])).unsqueeze... | alexis-jacq/signals | tools/R_DQL.py | Python | isc | 3,783 |
#!/usr/bin/env python
# encoding: UTF-8
import xbmcgui
import xbmcplugin
import sarpur
def play(url, name, live=False):
"""
Play audio or video on a given url"
:param url: Full url of the video
:param name: Stream name
"""
item = xbmcgui.ListItem(name, path=url)
if live:
item.se... | Dagur/sarpur-xbmc | plugin.video.sarpur/util/player.py | Python | mit | 412 |
def test_rbenv_exists(host):
assert host.exists("rbenv")
def test_default_ruby_version(host):
assert host.exists("ruby")
assert host.run("ruby --version").stdout.startswith('ruby 2.6.5')
| bitrise-io/osx-box-bootstrap | roles/ruby/tests/test_ruby.py | Python | mit | 200 |
from sqlalchemy import (
Boolean, Column, Date, Enum, ForeignKey, Integer, Table, Unicode, sql,
)
from great.models.core import METADATA, table
from great.models._guid import GUID
def music_table(*args, **kwargs):
args += (
Column("mbid", GUID, nullable=True, unique=True),
Column("spotify_uri... | Julian/Great | great/models/music.py | Python | mit | 1,375 |
#
import numpy as np
from numpy import linalg
import cvxopt
import cvxopt.solvers
def linear_kernel(x1, x2):
return np.dot(x1, x2)
def polynomial_kernel(x, y, p=3):
return (1 + np.dot(x, y)) ** p
def gaussian_kernel(x, y, sigma=5.0):
return np.exp(-linalg.norm(x - y) ** 2 / (2 * (sigma ** 2)))
class... | mtdx/ml-algorithms | svm/kernels.py | Python | mit | 7,886 |
import _plotly_utils.basevalidators
class YpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="ypad", parent_name="scattercarpet.marker.colorbar", **kwargs
):
super(YpadValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | plotly/python-api | packages/python/plotly/plotly/validators/scattercarpet/marker/colorbar/_ypad.py | Python | mit | 512 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import os
import re
import sys
from lib.model import nick, channel, log
def import_file(filename, parent):
_nick = {}
infile = open(filename).read().splitlines()
date = os.path.basename(filename).replace('.txt', '')
re_sentence = re.comp... | yono/tiarra_dbi_log_importer | tiarra_dbi_log_importer.py | Python | mit | 1,083 |
import unittest
import urllib2
import requests
import logging
import re
import urllib
import os
import os.path
import bz2
# Default is warning, it's to suppress requests INFO log
logging.basicConfig(format='%(message)s')
def solution():
un = 'BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M... | au9ustine/org.au9ustine.puzzles.pythonchallenge | pc/level_08.py | Python | mit | 1,670 |
if traffic_light == 'green':
pass # to implement
else:
stop()
| schmit/intro-python-course | lectures/code/control_pass.py | Python | mit | 71 |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Almar Klein
description = 'Simple Structured Data Format.'
long_description = """
Simple Structured Data Format
-----------------------------
Ssdf is a simple format for stroring structured data. It supports
seven data types, two of which are container elements:
... | bblais/Classy | classy/ssdf/setup.py | Python | mit | 1,984 |
import multiprocessing as mp
from graph import shift
from time import sleep
def count(adj_node, adj_list):
return adj_list.count(adj_node)
def loop_dfs( current_node, start_node, graph, current_path, nodes_to_faces):
if len(current_path) >= 3:
path_head_3 = current_path[-3:]
previous_three... | MICC/MICC | micc/pgraph.py | Python | mit | 3,627 |
import CCAPython.gov.cca
import logging
import time
import collections
# Configure Logging
logger = logging.getLogger('root')
def mape_k_loop(platform_component, reconfiguration_port):
"""
This is the method for the process running the monitoring loop.
"""
# Extract Contract Information
if platform_co... | jmhal/elastichpc | base/platform/malleable/__init__.py | Python | mit | 8,510 |
import unittest
from katas.kyu_8.regular_ball_super_ball import Ball
class BallTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(Ball().ball_type, 'regular')
def test_equals_2(self):
self.assertEqual(Ball('super').ball_type, 'super')
| the-zebulan/CodeWars | tests/kyu_8_tests/test_regular_ball_super_ball.py | Python | mit | 281 |