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 |
|---|---|---|---|---|---|
# BEGIN_COPYRIGHT
#
# Copyright 2009-2015 CRS4.
#
# 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 ... | ilveroluca/pydoop | pydoop/test_support.py | Python | apache-2.0 | 3,704 |
# ====================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | owenmorris/pylucene | test/test_PositionIncrement.py | Python | apache-2.0 | 11,319 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: mec
| mecforlove/oj-web | app/utils/__init__.py | Python | apache-2.0 | 61 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | JioCloud/oslo.log | oslo_log/formatters.py | Python | apache-2.0 | 8,844 |
import imp
import logging
import os
import sys
from mock import *
from .gp_unittest import *
from gppylib.gpcatalog import GPCatalogTable
class GpCheckCatTestCase(GpTestCase):
def setUp(self):
# because gpcheckcat does not have a .py extension, we have to use imp to import it
# if we had a gpchec... | 50wu/gpdb | gpMgmt/bin/gppylib/test/unit/test_unit_gpcheckcat.py | Python | apache-2.0 | 16,180 |
import inspect
import operator
import types as pytypes
import typing as pt
from collections import OrderedDict
from collections.abc import Sequence
from llvmlite import ir as llvmir
from numba import njit
from numba.core import cgutils, errors, imputils, types, utils
from numba.core.datamodel import default_manager, m... | cpcloud/numba | numba/experimental/jitclass/base.py | Python | bsd-2-clause | 20,859 |
#!/usr/bin/python
# Copyright (c) 2010 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.
"""Wrapper around swig.
Sets the SWIG_LIB environment var to point to Lib dir
and defers control to the platform-specific swig binary... | Crystalnix/house-of-life-chromium | tools/swig/swig.py | Python | bsd-3-clause | 1,265 |
from math import *
octree_node_size = 112
def recurse(depth):
if depth == 0:
return 1
else:
return pow(8, depth) + recurse(depth - 1)
def octree_size(depth):
return recurse(depth) * octree_node_size
print("Size %d" % (octree_size(3)))
| galek/anki-3d-engine | docs/drafts/octree.py | Python | bsd-3-clause | 246 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
make-release
~~~~~~~~~~~~
Helper script that performs a release. Does pretty much everything
automatically for us.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import os
import re
from dat... | Rafiot/logbook | scripts/make-release.py | Python | bsd-3-clause | 4,069 |
from __future__ import absolute_import
import logging
import six
from datetime import timedelta
from django.utils import timezone
from sentry.models import Option
from sentry.options import default_manager
from sentry.options.manager import UnknownOption
from sentry.tasks.base import instrumented_task
ONE_HOUR = 60... | mvaled/sentry | src/sentry/tasks/options.py | Python | bsd-3-clause | 1,214 |
# -*- coding: utf-8 -*-
"Main module defining filesystem and file classes"
from __future__ import absolute_import
import ctypes
import logging
import os
import posixpath
import re
import warnings
import operator
import functools
from collections import deque
from .compatibility import FileNotFoundError, ConnectionErr... | blaze/hdfs3 | hdfs3/core.py | Python | bsd-3-clause | 34,058 |
from framework.db import models
from framework.config import config
from framework.dependency_management.dependency_resolver import BaseComponent
from framework.dependency_management.interfaces import ResourceInterface
from framework.lib.general import cprint
import os
import logging
from framework.utils import FileOpe... | sharad1126/owtf | framework/db/resource_manager.py | Python | bsd-3-clause | 3,759 |
# For these tests to run successfully, two conditions must be met:
# 1. MEDIA_URL and MEDIA_ROOT must be set in settings
# 2. The user running the tests must have read/write access to MEDIA_ROOT
# Unit tests:
from sorl.thumbnail.tests.classes import ThumbnailTest, DjangoThumbnailTest
from sorl.thumbnail.tests.template... | cuker/sorl-thumbnail-legacy | sorl/thumbnail/tests/__init__.py | Python | bsd-3-clause | 665 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
File: mag_compensation.py
Author: Tanja Baumann
Email: tanja@auterion.com
Github: https://github.com/baumanta
Description:
Computes linear coefficients for mag compensation from thrust and current
Usage:
python mag_compensation.py /path/to/log/logfile.ulg curr... | PX4/Firmware | src/modules/sensors/vehicle_magnetometer/mag_compensation/python/mag_compensation.py | Python | bsd-3-clause | 10,043 |
import os
from socket import gethostname
import time
import urllib
from uuid import getnode as getmac
import webbrowser
import httplib2 # included with oauth2client
from oauth2client.client import OAuth2WebServerFlow, TokenRevokeError
import oauth2client.file
import gmusicapi
from gmusicapi.clients.shared import _Ba... | dvirtz/gmusicapi | gmusicapi/clients/musicmanager.py | Python | bsd-3-clause | 24,772 |
# Copyright 2019 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 unittest
from . import model, signing, test_common, test_config
mock = test_common.import_mock()
# python2 support.
try:
FileNotFoundError
exce... | ric2b/Vivaldi-browser | chromium/chrome/installer/mac/signing/signing_test.py | Python | bsd-3-clause | 9,294 |
# -*- coding: utf-8 -*-
from django import VERSION as DJANGO_VERSION
from django.contrib.contenttypes.models import ContentType
from django.core.management import BaseCommand
from wagtail.wagtailcore.models import Page, Site
class Command(BaseCommand):
help = "Load Puput initial dummy data"
def handle(self... | aaloy/puput | puput/management/commands/puput_initial_data.py | Python | mit | 1,136 |
import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product({
'shape': [(3,), (3, 4)],
'dtype': [numpy.float16, numpy.float32... | rezoo/chainer | tests/chainer_tests/functions_tests/array_tests/test_flipud.py | Python | mit | 1,875 |
#!/usr/bin/python
# script find clusters of small RNA reads in the genome
# version 3 - 24-12-2013 evolution to multiprocessing
# Usage clustering.py <bowtie input> <output> <bowtie index> <clustering_distance> <minimum read number per cluster to be outputed> <collapse option> <extention value> <average_cluster_size>
#... | JuPeg/tools-artbio | unstable/local_tools/clustering4.py | Python | mit | 6,082 |
# XXX TO DO:
# - popup menu
# - support partial or total redisplay
# - key bindings (instead of quick-n-dirty bindings on Canvas):
# - up/down arrow keys to move focus around
# - ditto for page up/down, home/end
# - left/right arrows to expand/collapse & move out/in
# - more doc strings
# - add icons for ... | ktan2020/legacy-automation | win/Lib/idlelib/TreeWidget.py | Python | mit | 15,708 |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, publ... | sidzan/netforce | netforce_support/netforce_support/models/report_issue.py | Python | mit | 2,805 |
import unittest
import os
import os.path
import contextlib
import sys
import test._mock_backport as mock
import test.test_support
import ensurepip
import ensurepip._uninstall
class TestEnsurePipVersion(unittest.TestCase):
def test_returns_version(self):
self.assertEqual(ensurepip._PIP_VERSION, ensurepip... | sometallgit/AutoUploader | Python27/Lib/test/test_ensurepip.py | Python | mit | 9,313 |
import asposebarcodecloud
from asposebarcodecloud.BarcodeApi import BarcodeApi
from asposebarcodecloud.BarcodeApi import ApiException
import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
from asposestoragecloud.StorageApi import ResponseMessage
import ConfigParser
config = Config... | farooqsheikhpk/Aspose.BarCode-for-Cloud | Examples/Python/generating-saving/cloud-storage/generate-barcode-and-save-asposecloudstorage.py | Python | mit | 1,910 |
#!/usr/bin/env python
"""
Simple desktop dialogue box support for Python.
Copyright (C) 2007, 2009 Paul Boddie <paul@boddie.org.uk>
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either ver... | constantx/dotfiles | sublime3/Packages/SideBarEnhancements-st3/desktop/dialog.py | Python | mit | 17,225 |
#!/usr/bin/env python
'''
Developer script to convert yaml periodic table to json format.
Created on Nov 15, 2011
'''
from __future__ import division
import json
import ruamel.yaml as yaml
import re
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer... | czhengsci/pymatgen | dev_scripts/update_pt_data.py | Python | mit | 6,563 |
#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class libsndfile(test.test):
"""
Autotest module for testing basic functionality
of libsndfile
@author Anitha MallojiRao amalloji@in.ibm.com ##
"""
... | PoornimaNayak/autotest-client-tests | linux-tools/libsndfile/libsndfile.py | Python | gpl-2.0 | 1,253 |
#
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | xkollar/spacewalk | backend/server/rhnServer/search_notify.py | Python | gpl-2.0 | 1,394 |
# Copyright (C) 2011 One Laptop Per Child
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribu... | gusDuarte/sugar | src/jarabe/model/speech.py | Python | gpl-2.0 | 7,214 |
###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | nielsbuwen/ilastik | ilastik/shell/gui/splashScreen.py | Python | gpl-3.0 | 1,515 |
from plugins.qlprofile.qlprofile import get_profile
| MinoMino/minqlbot-plugins | plugins/qlprofile/__init__.py | Python | gpl-3.0 | 52 |
# -*- test-case-name: twisted.test.test_compat -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Compatibility module to provide backwards compatibility for useful Python
features.
This is mainly for use of internal Twisted code. We encourage you to use
the latest version of Python di... | Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/python/compat.py | Python | gpl-3.0 | 19,303 |
"""
API views for badges
"""
from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser
from opaque_keys import InvalidKeyError
from opaque_keys.edx.django.models import CourseKeyField
from opaque_keys.edx.keys import CourseKey
from rest_framework import generics
from r... | teltek/edx-platform | lms/djangoapps/badges/api/views.py | Python | agpl-3.0 | 6,051 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from os import chmod
from spack import *
class Tbl2asn(Package):
"""Tbl2asn is a command-line program that automate... | LLNL/spack | var/spack/repos/builtin/packages/tbl2asn/package.py | Python | lgpl-2.1 | 866 |
"""
A library of useful helper classes to the saxlib classes, for the
convenience of application and driver writers.
$Id: saxutils.py,v 1.35 2004/03/20 07:46:04 fdrake Exp $
"""
import os, urlparse, urllib2, types
import handler
import xmlreader
import sys, _exceptions, saxlib
try:
_StringTypes = [types.StringTy... | selfcommit/gaedav | pyxml/sax/saxutils.py | Python | lgpl-2.1 | 24,606 |
# coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
try_get,
unified_timestamp,
url_or_none,
)
class PinterestBaseIE(InfoExtractor):
... | rg3/youtube-dl | youtube_dl/extractor/pinterest.py | Python | unlicense | 7,598 |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | yencarnacion/jaikuengine | .google_appengine/google/appengine/api/modules/modules_stub.py | Python | apache-2.0 | 5,933 |
"""
Support for TP-Link routers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.tplink/
"""
import base64
from datetime import datetime
import hashlib
import logging
import re
from aiohttp.hdrs import (
ACCEPT, COOKIE, PRAGMA, REFERER... | PetePriority/home-assistant | homeassistant/components/device_tracker/tplink.py | Python | apache-2.0 | 16,061 |
"""Support for the cloud for text to speech service."""
from hass_nabucasa import Cloud
from hass_nabucasa.voice import MAP_VOICE, VoiceError
import voluptuous as vol
from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider
from .const import DOMAIN
CONF_GENDER = "gender"
SUPPORT_LANGUAGES = l... | kennedyshead/home-assistant | homeassistant/components/cloud/tts.py | Python | apache-2.0 | 2,957 |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.oslogin_v1.proto import (
common_pb2 as google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2,
)
from google.cloud.oslogin_v1.proto import (
oslogin_pb2 as google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogi... | dhermes/gcloud-python | oslogin/google/cloud/oslogin_v1/proto/oslogin_pb2_grpc.py | Python | apache-2.0 | 7,621 |
import distutils.version
try:
import greenlet
getcurrent = greenlet.greenlet.getcurrent
GreenletExit = greenlet.greenlet.GreenletExit
preserves_excinfo = (distutils.version.LooseVersion(greenlet.__version__)
>= distutils.version.LooseVersion('0.3.2'))
greenlet = greenlet.greenlet
except... | ioram7/keystone-federado-pgid2013 | build/eventlet/eventlet/support/greenlets.py | Python | apache-2.0 | 1,085 |
# dyndlg.py
# contributed by Curt Hagenlocher <chi@earthlink.net>
# Dialog Template params:
# Parameter 0 - Window caption
# Parameter 1 - Bounds (rect tuple)
# Parameter 2 - Window style
# Parameter 3 - Extended style
# Parameter 4 - Font tuple
# Parameter 5 - Menu name
# Parameter 6 - Window class
# Dialo... | zhanqxun/cv_fish | pythonwin/pywin/Demos/dyndlg.py | Python | apache-2.0 | 2,568 |
"""Config flow for the Daikin platform."""
import asyncio
import logging
from uuid import uuid4
from aiohttp import ClientError, web_exceptions
from async_timeout import timeout
from pydaikin.daikin_base import Appliance
from pydaikin.discovery import Discovery
import voluptuous as vol
from homeassistant import confi... | sander76/home-assistant | homeassistant/components/daikin/config_flow.py | Python | apache-2.0 | 4,406 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | rahulunair/nova | nova/objects/vcpu_model.py | Python | apache-2.0 | 2,317 |
"""
This module defines tensors with abstract index notation.
The abstract index notation has been first formalized by Penrose.
Tensor indices are formal objects, with a tensor type; there is no
notion of index range, it is only possible to assign the dimension,
used to trace the Kronecker delta; the dimension can be... | vipulroxx/sympy | sympy/tensor/tensor.py | Python | bsd-3-clause | 133,023 |
import six
from sqlalchemy_utils.utils import str_coercible
from .weekday import WeekDay
@str_coercible
class WeekDays(object):
def __init__(self, bit_string_or_week_days):
if isinstance(bit_string_or_week_days, six.string_types):
self._days = set()
if len(bit_string_or_week_day... | cheungpat/sqlalchemy-utils | sqlalchemy_utils/primitives/weekdays.py | Python | bsd-3-clause | 1,866 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'SavedSearch.owner'
db.add_column(
'sentry_save... | ifduyue/sentry | src/sentry/south_migrations/0310_auto__add_field_savedsearch_owner.py | Python | bsd-3-clause | 109,233 |
"""
===========================================================
A demo of K-Means clustering on the handwritten digits data
===========================================================
In this example with compare the various initialization strategies for
K-means in terms of runtime and quality of the results.
As the ... | soulmachine/scikit-learn | examples/cluster/plot_kmeans_digits.py | Python | bsd-3-clause | 4,526 |
"""Tools for spectral analysis.
"""
import numpy as np
from scipy import fft as sp_fft
from . import _signaltools
from .windows import get_window
from ._spectral import _lombscargle
from ._arraytools import const_ext, even_ext, odd_ext, zero_ext
import warnings
__all__ = ['periodogram', 'welch', 'lombscargle', 'csd'... | zerothi/scipy | scipy/signal/_spectral_py.py | Python | bsd-3-clause | 74,381 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | eunchong/build | third_party/buildbot_8_4p1/buildbot/manhole.py | Python | bsd-3-clause | 11,523 |
#!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, 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:
# 1. Redistributions of source code must retain the above copyright n... | tnadeau/pybvc | samples/sampleopenflow/demos/demo42.py | Python | bsd-3-clause | 8,783 |
"""Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including with... | phobson/seaborn | seaborn/external/six.py | Python | bsd-3-clause | 30,099 |
import sqlalchemy_utils
from babel import Locale
from wtforms import Form
from tests import MultiDict
from wtforms_alchemy import CountryField
sqlalchemy_utils.i18n.get_locale = lambda: Locale('en')
class TestCountryField(object):
field_class = CountryField
def init_form(self, **kwargs):
class Test... | quantus/wtforms-alchemy | tests/test_country_field.py | Python | bsd-3-clause | 1,170 |
"""Functions to construct sparse matrices
"""
__docformat__ = "restructuredtext en"
__all__ = [ 'spdiags', 'eye', 'identity', 'kron', 'kronsum',
'hstack', 'vstack', 'bmat', 'rand']
from warnings import warn
import numpy as np
from sputils import upcast
from csr import csr_matrix
from csc import csc_m... | lesserwhirls/scipy-cwt | scipy/sparse/construct.py | Python | bsd-3-clause | 12,885 |
from bokeh.util.deprecate import deprecated_module
deprecated_module('bokeh.properties', '0.11', 'use bokeh.core.properties instead')
del deprecated_module
from .core.properties import * # NOQA
| phobson/bokeh | bokeh/properties.py | Python | bsd-3-clause | 195 |
#!/usr/bin/env python2.7
from bioblend.galaxy import GalaxyInstance
import requests
import datetime
import argparse
requests.packages.urllib3.disable_warnings()
def parse_args():
args = argparse.ArgumentParser(description="Rename history items using a tabular file." +"\n" +
"Ex... | ARTbio/tools-artbio | scripts/helper_scripts/rename_history_items/rename_hist_items.py | Python | mit | 2,334 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | brodyberg/autorest | AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/__init__.py | Python | mit | 714 |
# 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... | sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/novaclient/tests/unit/fixture_data/availability_zones.py | Python | mit | 3,264 |
#!/usr/bin/env python
"""
C.5 Classes, Packages, and Page Styles (p176)
"""
import codecs, sys, os
from plasTeX import Command, Environment, DimenCommand, Token
from plasTeX.Logging import getLogger
# Put the plasTeX packages into the path
from plasTeX import Packages
sys.path.append(os.path.dirname(Packages.__file... | themutt/plastex | plasTeX/Base/LaTeX/Packages.py | Python | mit | 5,361 |
"""
https://webdocs.cs.ualberta.ca/~sutton/MountainCar/MountainCar1.cp
"""
import math
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
class MountainCarEnv(gym.Env):
metadata = {
'render.modes': ['human', 'rgb_array'],
'video.frames_per_second': 30
}
def... | xpharry/Udacity-DLFoudation | tutorials/reinforcement/gym/gym/envs/classic_control/mountain_car.py | Python | mit | 4,262 |
import logging
import os
import time
from urllib2 import HTTPError, URLError
from djangoappengine.boot import PROJECT_DIR
from djangoappengine.utils import appid, have_appserver
REMOTE_API_SCRIPTS = (
'$PYTHON_LIB/google/appengine/ext/remote_api/handler.py',
'google.appengine.ext.remote_api.handler.applicati... | jbking/demo-appengine-django-golang | myproject/djangoappengine/db/stubs.py | Python | mit | 7,039 |
# Touchy is Copyright (c) 2009 Chris Radek <chris@timeguy.com>
#
# Touchy 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.
#
# Touchy i... | CalvinHsu1223/LinuxCNC-EtherCAT-HAL-Driver | src/emc/usr_intf/touchy/mdi.py | Python | gpl-2.0 | 10,007 |
from funcweb.widget_validation import WidgetSchemaFactory
from funcweb.widget_automation import WidgetListFactory,RemoteFormAutomation,RemoteFormFactory
from func.overlord.client import Overlord, Minions
import socket
import func.utils
class TestClientWidgetRender(object):
minion = None
def test_all_minions(s... | dockerera/func | funcweb/funcweb/tests/test_client_rendering.py | Python | gpl-2.0 | 1,853 |
# -*- coding: utf-8 -*-
#
# CTK: Cherokee Toolkit
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2010-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the... | youprofit/webserver | admin/CTK/CTK/List.py | Python | gpl-2.0 | 3,058 |
#!/usr/bin/python
# python script to generate an overview of the staes based on the input lex file.
#
# Copyright (C) 1997-2019 by Dimitri van Heesch.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation under the terms of the GNU General Public License is hereby
# granted. No repre... | ellert/doxygen | src/scan_states.py | Python | gpl-2.0 | 1,591 |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
# Author: illuz <iilluzen[at]gmail.com>
# File: AC_dfs_n.py
# Create Date: 2015-08-16 10:15:54
# Usage: AC_dfs_n.py
# Descripton:
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left ... | yxping/leetcode | solutions/257.Binary_Tree_Paths/AC_dfs_n.py | Python | gpl-2.0 | 836 |
# (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... | a13m/ansible | v2/ansible/executor/task_executor.py | Python | gpl-3.0 | 16,471 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import locale
from col... | Avira/pootle | pootle/apps/pootle_language/models.py | Python | gpl-3.0 | 6,196 |
# (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... | rasata/ansible | test/units/vars/test_variable_manager.py | Python | gpl-3.0 | 10,563 |
from sympy import symbols, Dij, LeviCivita
x, y = symbols('x,y')
def test_Dij():
assert Dij(1, 1) == 1
assert Dij(1, 2) == 0
assert Dij(x, x) == 1
assert Dij(x**2-y**2, x**2-y**2) == 1
def test_levicivita():
assert LeviCivita(1, 2, 3) == 1
assert LeviCivita(1, 3, 2) == -1
assert LeviCivit... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/sympy/functions/special/tests/test_tensor_functions.py | Python | agpl-3.0 | 698 |
from sympy import Function, symbols, S, sqrt, rf, factorial
from sympy.solvers.recurr import rsolve, rsolve_poly, rsolve_ratio, rsolve_hyper
y = Function('y')
n, k = symbols('n,k', integer=True)
C0, C1, C2 = symbols('C0,C1,C2')
def test_rsolve_poly():
assert rsolve_poly([-1, -1, 1], 0, n) == 0
assert rsolve_p... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/sympy/solvers/tests/test_recurr.py | Python | agpl-3.0 | 3,721 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | sysadminmatmoz/ingadhoc | multi_store/__openerp__.py | Python | agpl-3.0 | 2,617 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | krafczyk/spack | var/spack/repos/builtin/packages/py-lrudict/package.py | Python | lgpl-2.1 | 1,591 |
{
'name' : 'Product status at website shop',
'version' : '1.0.1',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3',
'category' : 'Sale',
'website' : 'https://yelizariev.github.io',
'depends' : ['website_sale', 'stock'],
'data':[
'website_sale_stock_status_views.x... | Endika/website-addons | website_sale_stock_status/__openerp__.py | Python | lgpl-3.0 | 408 |
# -*- coding: utf-8 -*-
import functools
import httplib as http
import logging
import time
import bleach
from django.db.models import Q
from flask import request
from framework.auth.decorators import collect_auth
from framework.auth.decorators import must_be_logged_in
from framework.exceptions import HTTPError
from f... | erinspace/osf.io | website/search/views.py | Python | apache-2.0 | 8,117 |
# Copyright (c) 2010-2011 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | Intel-bigdata/swift | test/unit/common/test_client.py | Python | apache-2.0 | 15,155 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Base64Encode
# Returns the specified text or file as a Base64 encoded string.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");... | jordanemedlock/psychtruths | temboo/core/Library/Utilities/Encoding/Base64Encode.py | Python | apache-2.0 | 3,302 |
"""Translate python-phonenumbers PhoneNumber to/from protobuf PhoneNumber
Examples of use:
>>> import phonenumbers
>>> from phonenumbers.pb2 import phonenumber_pb2, PBToPy, PyToPB
>>> x_py = phonenumbers.PhoneNumber(country_code=44, national_number=7912345678)
>>> print x_py
Country Code: 44 National Number: 79123456... | dongguangming/python-phonenumbers | python/phonenumbers/pb2/__init__.py | Python | apache-2.0 | 2,788 |
# Copyright 2008-2014 Nokia Solutions and Networks
#
# 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 l... | eric-stanley/robotframework | src/robot/parsing/htmlreader.py | Python | apache-2.0 | 6,458 |
# 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... | Kongsea/tensorflow | tensorflow/python/keras/_impl/keras/engine/training.py | Python | apache-2.0 | 98,431 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... | citrix-openstack-build/neutron | neutron/plugins/common/constants.py | Python | apache-2.0 | 1,771 |
#!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Tests for the Timelines flow."""
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import flags
from grr.lib import test_lib
# pylint: disable=unused-import
from grr.lib.flows.general import timelines as _
# pylint: enable=unused-im... | statik/grr | lib/flows/general/timelines_test.py | Python | apache-2.0 | 1,939 |
# 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/models/object_detection/exporter.py | Python | bsd-2-clause | 13,779 |
from sympy.core.basic import Basic
from sympy import (sympify, eye, sin, cos, rot_axis1, rot_axis2,
rot_axis3, ImmutableMatrix as Matrix, Symbol)
from sympy.core.cache import cacheit
import sympy.vector
class Orienter(Basic):
"""
Super-class for all orienter classes.
"""
def rotati... | kaushik94/sympy | sympy/vector/orienters.py | Python | bsd-3-clause | 11,694 |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
import config
from install_package import InstallPackage
import os
import re
import shutil
import sys
import utils
BASENAME = "VTK"
GIT_REPO = "http://vtk.org/VTK.git"
GIT_TAG = "v5.8.0"
VTK_BASE_VERSION = "vtk-5.8"
# this... | nagyistoce/devide.johannes | install_packages/ip_vtk58.py | Python | bsd-3-clause | 9,776 |
""" Simple datasets to be used for unit tests. """
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as np
from theano.compat.six.move... | junbochen/pylearn2 | pylearn2/testing/datasets.py | Python | bsd-3-clause | 2,822 |
# -*- coding: utf-8 -*-
"""Algorithms for spectral clustering"""
# Author: Gael Varoquaux gael.varoquaux@normalesup.org
# Brian Cheung
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import check_rand... | RomainBrault/scikit-learn | sklearn/cluster/spectral.py | Python | bsd-3-clause | 19,196 |
import sys
from operator import add
from pyspark import SparkContext
if __name__ == "__main__":
if len(sys.argv) < 3:
print >> sys.stderr, \
"Usage: PythonWordCount <master> <file>"
exit(-1)
sc = SparkContext(sys.argv[1], "PythonWordCount")
lines = sc.textFile(sys.argv[2], 1)
... | koeninger/spark | python/examples/wordcount.py | Python | bsd-3-clause | 555 |
# Copyright 2021 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 googleapiclient.discovery import build
from google.oauth2 import service_account
class RealTimeReportingServer():
SCOPES = ['https://www.... | chromium/chromium | chrome/test/enterprise/e2e/connector/realtime_reporting_bce/reporting_server.py | Python | bsd-3-clause | 1,846 |
# -*- coding: utf-8 -*-
import django
SECRET_KEY = 'psst'
SITE_ID = 1
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
ROOT_URLCONF = 'allauth.urls'
if django.VERSIO... | tigeraniya/django-allauth | test_settings.py | Python | mit | 4,239 |
import os
import numpy as np
def save_weights(layers, weights_dir, epoch):
for idx in range(len(layers)):
if hasattr(layers[idx], 'W'):
layers[idx].W.save_weight(
weights_dir, 'W' + '_' + str(idx) + '_' + str(epoch))
if hasattr(layers[idx], 'W0'):
layers[id... | myt00seven/svrg | para_gpu/tools.py | Python | mit | 2,391 |
#!/bin/env python
import os, sys
def usage():
print "%s WORK_DIR [num_results]" % sys.argv[0]
sys.exit(1)
try:
work_dir = sys.argv[1]
except:
print "you must specify your DenyHosts WORK_DIR"
usage()
try:
num = int(sys.argv[2])
except:
num = 10
fname = os.path.join(work_dir, "users-inval... | mobiledayadmin/DenyHosts | scripts/restricted_from_invalid.py | Python | gpl-2.0 | 884 |
"""
Tests the ``create_dot_application`` management command.
"""
from __future__ import absolute_import, unicode_literals
from django.core.management import call_command
from django.test import TestCase
from oauth2_provider.models import get_application_model
from student.tests.factories import UserFactory
from ..cr... | ahmedaljazzar/edx-platform | openedx/core/djangoapps/oauth_dispatch/management/commands/tests/test_create_dot_application.py | Python | agpl-3.0 | 1,724 |
from coalib.bears.LocalBear import LocalBear
from coalib.results.Result import Result
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
class LineCountBear(LocalBear):
LANGUAGES = {'All'}
AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}
LICENSE = 'AGPL-3.0'... | Asnelchristian/coala-bears | bears/general/LineCountBear.py | Python | agpl-3.0 | 1,107 |
from art_helpers.instructions_helper import InstructionsHelper, InstructionsHelperException
from art_helpers.program_helper import ProgramHelper, ProgramHelperException
from art_helpers.art_robot_helper import ArtRobotArmHelper, ArtRobotHelper, UnknownRobot,\
RobotParametersNotOnParameterServer
from art_helpers.int... | robofit/ar-table-itable | art_helpers/src/art_helpers/__init__.py | Python | lgpl-2.1 | 720 |
''' Test bug 389: http://bugs.openbossa.org/show_bug.cgi?id=389'''
import sys
import unittest
from helper import UsesQApplication
from PySide import QtCore,QtGui
class BugTest(UsesQApplication):
def testCase(self):
s = QtGui.QWidget().style()
i = s.standardIcon(QtGui.QStyle.SP_TitleBarMinButton)
... | enthought/pyside | tests/QtGui/bug_389.py | Python | lgpl-2.1 | 414 |
# -*- Mode:Python -*-
##########################################################################
# #
# This file is part of AVANGO. #
# ... | jakobharlan/avango | avango-display/python/avango/display/setups/AutoStereoDisplay.py | Python | lgpl-3.0 | 2,055 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .base import * # noqa
# don't use an unicode string
localeID = 'ru_RU'
dateSep = ['-', '.']
timeSep = [':']
meridian = []
usesMeridian = False
uses24 = True
Weekdays = [
'понедельник', 'вторник', 'среда', 'четверг',
'пятница', 'суббота', 'в... | garlick/flux-core | src/bindings/python/flux/utils/parsedatetime/pdt_locales/ru_RU.py | Python | lgpl-3.0 | 4,577 |
'''OpenGL extension NV.read_depth_stencil
This module customises the behaviour of the
OpenGL.raw.GLES2.NV.read_depth_stencil to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/NV/read_depth_stencil.txt
'''
from OpenGL import platfo... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/GLES2/NV/read_depth_stencil.py | Python | lgpl-3.0 | 785 |
#-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... | NullScope/BorderlessStone | tests/setupenv_windows.py | Python | lgpl-3.0 | 4,510 |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
import urllib
from copy import deepcopy
from datetime import date
from logging import getLogger
from urlparse import urljoin
from sqlalchemy import and_
from ggrc import db
from ggrc import utils
from ggr... | plamut/ggrc-core | src/ggrc_workflows/notification/data_handler.py | Python | apache-2.0 | 14,000 |