repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
chengduoZH/Paddle | python/paddle/fluid/tests/unittests/test_squeeze2_op.py | 2 | 2134 | # Copyright (c) 2019 PaddlePaddle 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 app... | apache-2.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_bgp_service_communities_operations.py | 1 | 5134 | # 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 may ... | mit |
Qubad786/pr-code-review | gitcodereview/settings.py | 1 | 3117 | """
Django settings for gitcodereview project.
"""
import os
from os.path import abspath, dirname, join
import dj_database_url
from django.core.urlresolvers import reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)... | mit |
gao-feng/net | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
aabbox/kbengine | kbe/res/scripts/common/Lib/test/test_raise.py | 118 | 11344 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Tests for the raise statement."""
from test import support
import re
import sys
import types
import unittest
def get_tb():
try:
raise OSError()
except:
return sys.exc_info()[2]
class Cont... | lgpl-3.0 |
Lektorium-LLC/edx-platform | common/djangoapps/microsite_configuration/tests/test_logic.py | 24 | 1457 | """
Some additional unit tests for Microsite logic. The LMS covers some of the Microsite testing, this adds
some additional coverage
"""
import ddt
from mock import patch
from microsite_configuration.backends.base import BaseMicrositeBackend
from microsite_configuration.microsite import get_backend, get_value_for_org
... | agpl-3.0 |
openstack/monasca-api | monasca_api/common/repositories/metrics_repository.py | 2 | 2340 | # (C) Copyright 2014,2016 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/tests/urlpatterns_reverse/namespace_urls.py | 64 | 2555 | from django.conf.urls import include, url
from . import views
from .utils import URLObject
testobj1 = URLObject('testapp', 'test-ns1')
testobj2 = URLObject('testapp', 'test-ns2')
default_testobj = URLObject('testapp', 'testapp')
otherobj1 = URLObject('nodefault', 'other-ns1')
otherobj2 = URLObject('nodefault', 'othe... | apache-2.0 |
larroy/mxnet | ci/docker/qemu/runtime_functions.py | 6 | 4673 | #!/usr/bin/env python3
# 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
# "... | apache-2.0 |
BadrYoubiIdrissi/TIPE-Algorithme-Genetique | Source/NEAT/test.py | 1 | 2640 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 12 11:36:14 2016
@author: Badr Youbi Idrissi
"""
import pygame
import pygame.gfxdraw
import numpy as np
from pygame.locals import *
from individu import Individu
from phenotype import Phenotype
from population import Population
from datadisplay import DataDisplay
import ... | gpl-3.0 |
mvdbeek/tools-iuc | deprecated/tools/gatk2/gatk2_wrapper.py | 29 | 7403 | #!/usr/bin/env python
# David Hoover, based on gatk by Dan Blankenberg
"""
A wrapper script for running the GenomeAnalysisTK.jar commands.
"""
import optparse
import os
import shutil
import subprocess
import sys
import tempfile
from binascii import unhexlify
GALAXY_EXT_TO_GATK_EXT = { 'gatk_interval': 'intervals', 'b... | mit |
harisibrahimkv/django | tests/template_tests/syntax_tests/test_width_ratio.py | 56 | 5956 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class WidthRatioTagTests(SimpleTestCase):
libraries = {'custom': 'template_tests.templatetags.custom'}
@setup({'widthratio01': '{% widthratio a b 0 %}'})
def test_widthratio01(self):
... | bsd-3-clause |
cnsoft/kbengine-cocos2dx | kbe/res/scripts/common/Lib/sqlite3/test/hooks.py | 4 | 7346 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/hooks.py: tests for various SQLite-specific hooks
#
# Copyright (C) 2006-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for... | lgpl-3.0 |
tu-darmstadt-ros-pkg/hector_flexbe_behavior | behaviors/behavior_pathdrivemission/src/behavior_pathdrivemission/pathdrivemission_sm.py | 1 | 2883 | #!/usr/bin/env python
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] tags will be kept. ... | bsd-3-clause |
borysiasty/QGIS | python/plugins/processing/algs/qgis/KNearestConcaveHull.py | 30 | 21491 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
KNearestConcaveHull.py
----------------------
Date : November 2014
Copyright : (C) 2014 by Detlev Neumann
Dr. Neumann Consulting - Geospatial Ser... | gpl-2.0 |
gef756/scipy | scipy/interpolate/interpolate.py | 25 | 80287 | """ Classes for interpolating values.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['interp1d', 'interp2d', 'spline', 'spleval', 'splmake', 'spltopp',
'ppform', 'lagrange', 'PPoly', 'BPoly', 'RegularGridInterpolator',
'interpn']
import itertools
from numpy impo... | bsd-3-clause |
liberorbis/libernext | env/lib/python2.7/site-packages/setuptools/command/install_egg_info.py | 423 | 4001 | from distutils import log, dir_util
import os
from setuptools import Command
from setuptools.archive_util import unpack_archive
import pkg_resources
class install_egg_info(Command):
"""Install an .egg-info directory for the package"""
description = "Install an .egg-info directory for the package"
user_... | gpl-2.0 |
bobvanderlinden/machinekit | src/emc/usr_intf/axis/scripts/lintini.py | 25 | 2733 | #!/usr/bin/env python
#!/usr/bin/python
# This is a component of AXIS, a front-end for LinuxCNC
# Copyright 2004, 2005, 2006 Jeff Epler <jepler@unpythonic.net> and
# Chris Radek <chris@timeguy.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Ge... | lgpl-2.1 |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global_/hellos/__init__.py | 1 | 18060 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 |
themurph/openshift-tools | openshift/installer/vendored/openshift-ansible-3.5.28/roles/lib_openshift/src/test/unit/test_oc_process.py | 82 | 21084 | '''
Unit tests for oc process
'''
import os
import six
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylint: disable=import-error
#... | apache-2.0 |
sarvex/tensorflow | tensorflow/python/saved_model/builder.py | 37 | 1183 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
stonegithubs/odoo | addons/web/static/lib/py.js/doc/conf.py | 543 | 7829 | # -*- coding: utf-8 -*-
#
# py.js documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 9 19:36:23 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | agpl-3.0 |
pilou-/ansible | lib/ansible/modules/network/f5/bigiq_utility_license_assignment.py | 38 | 20784 | #!/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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
Metaswitch/calico-nova | nova/api/openstack/compute/plugins/v3/fping.py | 6 | 5144 | # Copyright 2011 Grid Dynamics
# Copyright 2011 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.apache.org/licenses... | apache-2.0 |
haitdai/qtbase5-inprocess-surface-compositor-remote-display | myqt/qtbase/src/3rdparty/freetype/src/tools/docmaker/formatter.py | 515 | 4962 | # Formatter (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
from sources import *
from content import *
from utils import *
# This is the base Formatter class. Its purpose is to convert
# a content processor's data into specific documents (i.e., table of
# contents, global index, and individual API... | gpl-3.0 |
woggle/mesos-old | third_party/boto-2.0b2/boto/sdb/db/sequence.py | 8 | 8168 | # Copyright (c) 2010 Chris Moyer http://coredumped.org/
#
# 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, ... | apache-2.0 |
psav/cfme_tests | cfme/dashboard.py | 4 | 16505 | # -*- coding: utf-8 -*-
import attr
import re
from cached_property import cached_property
from navmazing import NavigateToAttribute
from cfme.modeling.base import BaseCollection, BaseEntity
from cfme.utils.timeutil import parsetime
from cfme.utils.appliance.implementations.ui import navigator, CFMENavigateStep, navig... | gpl-2.0 |
javierTerry/odoo | addons/hw_escpos/escpos/exceptions.py | 170 | 2884 | """ ESC/POS Exceptions classes """
import os
class Error(Exception):
""" Base class for ESC/POS errors """
def __init__(self, msg, status=None):
Exception.__init__(self)
self.msg = msg
self.resultcode = 1
if status is not None:
self.resultcode = status
def __st... | agpl-3.0 |
GodotNativeTools/godot-cpp | binding_generator.py | 1 | 27665 | #!/usr/bin/env python
import json
# comment.
# Convenience function for using template get_node
def correct_method_name(method_list):
for method in method_list:
if method["name"] == "get_node":
method["name"] = "get_node_internal"
classes = []
def generate_bindings(path, use_template_get_n... | mit |
youprofit/kivy | kivy/modules/console.py | 23 | 34178 | # coding=utf-8
"""
Console
=======
.. versionadded:: 1.9.1
Reboot of the old inspector, designed to be modular and keep concerns separated.
It also have a addons architecture that allow you to add a button, panel, or
more in the Console itself.
.. warning::
This module works, but might fail in some cases. Pleas... | mit |
MostafaGazar/tensorflow | tensorflow/examples/tutorials/mnist/mnist_with_summaries.py | 7 | 8370 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
androidarmv6/android_external_chromium_org | chrome/common/extensions/docs/server2/link_converter.py | 25 | 2973 | #!/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.
# This script converts old-style <a> links to API docs to the new $ref links.
# See reference_resolver.py for more info on the form... | bsd-3-clause |
jmesteve/saas3 | openerp/addons_extra/account_financial_report_webkit/wizard/balance_common.py | 7 | 16829 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com)
#
# Author: Guewen Baconnier (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole resp... | agpl-3.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python3.4/test/test_ossaudiodev.py | 97 | 7216 | from test import support
support.requires('audio')
from test.support import findfile
ossaudiodev = support.import_module('ossaudiodev')
import errno
import sys
import sunau
import time
import audioop
import unittest
# Arggh, AFMT_S16_NE not defined on all platforms -- seems to be a
# fairly recent addition to OSS.
... | gpl-2.0 |
keithhamilton/blackmaas | lib/python2.7/site-packages/pip/_vendor/distlib/util.py | 163 | 49824 | #
# Copyright (C) 2012-2013 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
import... | bsd-3-clause |
liorvh/golismero | thirdparty_libs/nltk/corpus/reader/switchboard.py | 17 | 4656 | # Natural Language Toolkit: Switchboard Corpus Reader
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
import re
from nltk.tag import str2tuple
from util import *
from api import *
class Switchbo... | gpl-2.0 |
woodscn/scipy | scipy/linalg/_matfuncs_sqrtm.py | 77 | 5867 | """
Matrix square root for general matrices and for upper triangular matrices.
This module exists to avoid cyclic imports.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['sqrtm']
import numpy as np
from scipy._lib._util import _asarray_validated
# Local imports
from .misc import ... | bsd-3-clause |
Dhivyap/ansible | test/units/modules/network/fortios/test_fortios_application_rule_settings.py | 21 | 7349 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/boto/s3/resumable_download_handler.py | 17 | 15584 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | gpl-2.0 |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/site-packages/pyasn1/type/univ.py | 5 | 100158 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import math
import sys
from pyasn1 import error
from pyasn1.codec.ber import eoo
from pyasn1.compat import binary
from pyasn1.compat import integer
from pyasn1.co... | gpl-3.0 |
scvalencia/ROBOCOL_desastres | Galileo/Python/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py | 2931 | 1675 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
oliverodaa/cs184-final-proj | dwinelle/video/gen_3d.py | 1 | 1238 | #!/usr/bin/env python3
# This file is part of dwinelle-tools.
# dwinelle-tools 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.
# dwi... | mit |
gchaimovitz/CouchPotatoServer | libs/suds/mx/literal.py | 178 | 9517 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
jakobworldpeace/scikit-learn | sklearn/utils/sparsefuncs.py | 28 | 13531 | # Authors: Manoj Kumar
# Thomas Unterthiner
# Giorgio Patrini
#
# License: BSD 3 clause
import scipy.sparse as sp
import numpy as np
from .fixes import sparse_min_max, bincount
from .sparsefuncs_fast import (
csr_mean_variance_axis0 as _csr_mean_var_axis0,
csc_mean_variance_axis0 as _csc_mean... | bsd-3-clause |
Kiiv/Sick-Beard | lib/requests/packages/chardet/euckrprober.py | 236 | 1672 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
MTASZTAKI/ApertusVR | plugins/languageAPI/jsAPI/3rdParty/nodejs/10.1.0/source/deps/v8/tools/gc-nvp-trace-processor.py | 31 | 11135 | #!/usr/bin/env python
#
# Copyright 2010 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# noti... | mit |
apllicationCOM/youtube-dl-api-server | youtube_dl_server/youtube_dl/extractor/zingmp3.py | 94 | 3672 | # coding=utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class ZingMp3BaseInfoExtractor(InfoExtractor):
def _extract_item(self, item):
error_message = item.find('./errormessage').text
if error_message:
rais... | unlicense |
dosiecki/NewsBlur | utils/memcached_status.py | 19 | 1172 | import memcache
import re
import sys
from settings import CACHE_BACKEND
#gfranxman
verbose = False
if not CACHE_BACKEND.startswith( 'memcached://' ):
print "you are not configured to use memcched as your django cache backend"
else:
m = re.search( r'//(.+:\d+)', CACHE_BACKEND )
cache_host = m.group(1)
... | mit |
misty-/plugin.video.youtube | resources/lib/youtube/helper/tv.py | 26 | 1416 | __author__ = 'bromix'
from resources.lib import kodion
from resources.lib.youtube.helper import utils
from resources.lib.kodion.items.video_item import VideoItem
def my_subscriptions_to_items(provider, context, json_data):
result = []
video_id_dict = {}
items = json_data.get('items', [])
for item in... | gpl-2.0 |
fitzgen/servo | tests/wpt/web-platform-tests/html/rendering/replaced-elements/tools/gen-svgsizing-tests.py | 266 | 1985 | from string import Template
import os
import sys
template = Template("""<!DOCTYPE html>
<!-- This file is generated by $generator -->
<html>
<head>
<title>SVG sizing: <$placeholder></title>
<meta name=timeout content=long>
<script src="/resources/testharness.js"></script>
<script src="/resources/t... | mpl-2.0 |
roadmapper/ansible | test/units/modules/network/routeros/routeros_module.py | 52 | 2521 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
dukhlov/oslo.messaging | oslo_messaging/notify/logger.py | 4 | 2706 | # Copyright 2013 eNovance
#
# 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... | apache-2.0 |
Tatsh-ansible/ansible | lib/ansible/module_utils/facts/system/dns.py | 232 | 2678 | # 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 in the hope that ... | gpl-3.0 |
iwhiz/Algorist | fibonacci_dp.py | 1 | 1163 | # This function uses the dynamic programming concept, where it stores previously computed values rather
# computing it every time like in normal recursion.
import time
# This version of fibonacci uses dynamic programming concept.
# First check the normal fibonacci.py for better understanding
def fibo_dp(n: int): # ... | mit |
highweb-project/highweb-webcl-html5spec | chrome/common/extensions/docs/server2/redirector_test.py | 44 | 7508 | #!/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... | bsd-3-clause |
harisibrahimkv/django | tests/serializers/test_yaml.py | 74 | 5567 | import importlib
import unittest
from io import StringIO
from django.core import management, serializers
from django.core.serializers.base import DeserializationError
from django.test import SimpleTestCase, TestCase, TransactionTestCase
from .models import Author
from .tests import SerializersTestBase, SerializersTra... | bsd-3-clause |
openweave/openweave-core | src/test-apps/happy/tests/standalone/wdmNext/test_weave_wdm_next_one_way_subscribe_05.py | 1 | 3250 | #!/usr/bin/env python3
#
# Copyright (c) 2016-2017 Nest Labs, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | apache-2.0 |
tedye/leetcode | Python/leetcode.037.sudoku-solver.py | 1 | 2045 | class Solution(object):
def solveSudoku(self, board):
"""
:type board: List[List[str]]
:rtype: void Do not return anything, modify board in-place instead.
"""
hset = [{'1','2','3','4','5','6','7','8','9'} for _ in range(9)]
vset = [{'1','2','3','4','5','6','7','8','9'... | mit |
bymerej/mwphb | maintenance/cssjanus/csslex.py | 172 | 3719 | #!/usr/bin/python
#
# Copyright 2007 Google Inc. All Rights Reserved.
"""CSS Lexical Grammar rules.
CSS lexical grammar from http://www.w3.org/TR/CSS21/grammar.html
"""
__author__ = ['elsigh@google.com (Lindsey Simon)',
'msamuel@google.com (Mike Samuel)']
# public symbols
__all__ = [ "NEWLINE", "HEX",... | gpl-2.0 |
prark/bitcoinxt | qa/rpc-tests/receivedby.py | 140 | 7345 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listreceivedbyaddress API
from test_framework.test_framework import BitcoinTestFramework
from ... | mit |
scripteed/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/variables/filelist/gyptest-filelist-golden.py | 228 | 1584 | #!/usr/bin/env python
# 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.
"""
Test variable expansion of '<|(list.txt ...)' syntax commands.
"""
import os
import sys
import TestGyp
test = TestGyp.TestGyp(format=... | gpl-3.0 |
W-M-D/ergotelescope.org | node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_vcproj.py | 2637 | 9586 | #!/usr/bin/env python
# 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.
"""Make the format of a vcproj really pretty.
This script normalize and sort an xml. It also fetches all the properties
inside linked... | mit |
TheTypoMaster/calligra | 3rdparty/google-breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/message_test.py | 253 | 15707 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | gpl-2.0 |
endlessm/chromium-browser | third_party/catapult/third_party/Paste/tests/test_fileapp.py | 47 | 9766 | # (c) 2005 Ian Bicking, Clark C. Evans and contributors
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import time
import random
import os
import tempfile
try:
# Python 3
from email.utils import parsedate_tz, mktime_t... | bsd-3-clause |
thnkloud9/Airtime | python_apps/media-monitor/mm2/media/metadata/definitions.py | 10 | 4773 | # -*- coding: utf-8 -*-
import process as md
import re
from os.path import normpath
from ..monitor.pure import format_length, file_md5, is_airtime_recorded, \
no_extension_basename
defs_loaded = False
MAX_SIGNED_INT = 2**31-1
def is_defs_loaded():
global defs_loaded
return defs_loaded
def load_definitio... | agpl-3.0 |
CopeX/odoo | addons/sale/sale.py | 4 | 72408 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
benthomasson/ansible | lib/ansible/modules/packaging/os/pkg5.py | 7 | 4800 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014 Peter Oliver <ansible@mavit.org.uk>
#
# 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': ... | gpl-3.0 |
gauribhoite/personfinder | env/google_appengine/lib/django-1.5/django/db/models/options.py | 99 | 23148 | from __future__ import unicode_literals
import re
from bisect import bisect
from django.conf import settings
from django.db.models.related import RelatedObject
from django.db.models.fields.related import ManyToManyRel
from django.db.models.fields import AutoField, FieldDoesNotExist
from django.db.models.fields.proxy ... | apache-2.0 |
andmos/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_wait.py | 14 | 4063 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1... | gpl-3.0 |
pernici/sympy | sympy/thirdparty/pyglet/pyglet/image/codecs/gdiplus.py | 7 | 8870 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# 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... | bsd-3-clause |
kaiweifan/vse-lbaas-plugin-poc | quantum/agent/linux/daemon.py | 2 | 4218 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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/li... | apache-2.0 |
opennode/nodeconductor-paas-oracle | src/nodeconductor_paas_oracle/extension.py | 1 | 3675 | from nodeconductor.core import NodeConductorExtension
class OracleExtension(NodeConductorExtension):
class Settings:
ORACLE_TICKET_TEMPLATES = {
'provision': {
'summary': "Request for a new Oracle instance",
'details': """
Oracle DB purchase... | mit |
ingadhoc/odoo | addons/l10n_si/__openerp__.py | 430 | 1826 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright: (C) 2012 - Mentis d.o.o., Dravograd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | agpl-3.0 |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/numpy/distutils/environment.py | 248 | 2346 | from __future__ import division, absolute_import, print_function
import os
from distutils.dist import Distribution
__metaclass__ = type
class EnvironmentConfig(object):
def __init__(self, distutils_section='ALL', **kw):
self._distutils_section = distutils_section
self._conf_keys = kw
self... | mit |
pekeler/arangodb | 3rdParty/V8-4.3.61/third_party/icu/source/test/depstest/dependencies.py | 198 | 7330 | #! /usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2014, International Business Machines
# Corporation and others. All Rights Reserved.
#
# file name: dependencies.py
#
# created on: 2011may26
"""Reader module for dependency data for the ICU dependency tester.
Reads dependencies.txt and makes the data ... | apache-2.0 |
daavery/audacity | lib-src/lv2/serd/waflib/Tools/c_osx.py | 329 | 4274 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,shutil,sys,platform
from waflib import TaskGen,Task,Build,Options,Utils,Errors
from waflib.TaskGen import taskgen_method,feature,after_method,before_method
app_info=... | gpl-2.0 |
tpratama/warkop-TC | assets/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/usr/bin/env python
# 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.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | mit |
dset0x/invenio | invenio/ext/restful/pagination.py | 17 | 4908 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 CERN.
#
# Invenio 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... | gpl-2.0 |
Titan-C/sympy | sympy/utilities/tests/test_module_imports.py | 120 | 1500 | """
Checks that SymPy does not contain indirect imports.
An indirect import is importing a symbol from a module that itself imported the
symbol from elsewhere. Such a constellation makes it harder to diagnose
inter-module dependencies and import order problems, and is therefore strongly
discouraged.
(Indirect imports... | bsd-3-clause |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/django/core/files/locks.py | 725 | 3516 | """
Portable file locking utilities.
Based partially on an example by Jonathan Feignberg in the Python
Cookbook [1] (licensed under the Python Software License) and a ctypes port by
Anatoly Techtonik for Roundup [2] (license [3]).
[1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
[2] http://sourceforg... | mit |
bhilburn/gnuradio | gr-qtgui/examples/pyqt_histogram_f.py | 47 | 6683 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
edlabh/SickRage | lib/sqlalchemy/util/langhelpers.py | 75 | 37513 | # util/langhelpers.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Routines to help with the creation, loading and introspection of
modules, class... | gpl-3.0 |
maxalbert/Pytess | __private__/old_drafts/voronoi_test.py | 2 | 1200 | # voronoi test
# taken from http://rosettacode.org/wiki/Voronoi_diagram#Python
# but only puts pixels instead of storing the polygons
# here is another implementation: http://svn.osgeo.org/qgis/trunk/qgis/python/plugins/fTools/tools/voronoi.py
from PIL import Image
import random
import math
def generate_voronoi_diag... | mit |
SheffieldML/TVB | likelihoods.py | 1 | 1637 | # Copyright (c) 2014, James Hensman, Max Zwiessele
# Distributed under the terms of the GNU General public License, see LICENSE.txt
import numpy as np
from scipy.special import gamma, digamma
from scipy import stats
class student_t():
def __init__(self):
self._set_params(np.ones(2))
def _set_params(se... | gpl-3.0 |
sahiljain/catapult | third_party/gsutil/third_party/oauth2client/docs/conf.py | 17 | 1973 | # -*- coding: utf-8 -*-
#
# oauth2client documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 17 23:13:19 2014.
#
import sys
import os
# -- General configuration ------------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphi... | bsd-3-clause |
gunan/tensorflow | tensorflow/python/summary/plugin_asset_test.py | 152 | 2859 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
nirmeshk/oh-mainline | vendor/packages/html5lib/setup.py | 18 | 1301 | from setuptools import setup, find_packages
import os
long_description="""HTML parser designed to follow the HTML5
specification. The parser is designed to handle all flavours of HTML and
parses invalid documents using well-defined error handling rules compatible
with the behaviour of major desktop web browsers.
Ou... | agpl-3.0 |
drawks/ansible | lib/ansible/modules/cloud/azure/azure_rm_storageblob.py | 19 | 21434 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# 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
ANS... | gpl-3.0 |
krux/graphite-web | webapp/tests/test_whitelist.py | 1 | 3982 | import errno
import mock
import os
import pickle
from . import DATA_DIR
from django.conf import settings
from django.core.urlresolvers import reverse
from .base import TestCase
from graphite.whitelist.views import load_whitelist, save_whitelist
class WhitelistTester(TestCase):
settings.WHITELIST_FILE = os.path.... | apache-2.0 |
Runbook/runbook | src/web/monitorforms/http-post/__init__.py | 3 | 4753 | """HTTP Post Form"""
from wtforms import SelectMultipleField, TextAreaField, TextField
from wtforms.validators import DataRequired, Optional, URL, ValidationError
from ..datacenter import DatacenterCheckForm
class HeaderList(object):
"""Custom wtform validator for headers."""
def __call__(self, form, field)... | apache-2.0 |
Skycker/watermarker | setup.py | 2 | 1345 | import os
from distutils.core import setup
import watermarker
with open('pypi_doc.txt') as file:
long_description = file.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-watermarker',
version=watermarker._... | bsd-3-clause |
GenericStudent/home-assistant | homeassistant/components/climate/device_condition.py | 9 | 3833 | """Provide the device automations for Climate."""
from typing import Dict, List
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_SUPPORTED_FEATURES,
CONF_CONDITION,
CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_ID,
CONF_TYPE,
)
from homeassistant.core import HomeA... | apache-2.0 |
AlexMooney/python-pptx | pptx/parts/presentation.py | 4 | 6168 | # encoding: utf-8
"""
Presentation part, the main part in a .pptx package.
"""
from __future__ import absolute_import
from warnings import warn
from ..opc.constants import RELATIONSHIP_TYPE as RT
from ..opc.package import XmlPart
from ..opc.packuri import PackURI
from .slide import Slide
from ..util import lazyprop... | mit |
bulax41/Commands | scripts/mcast_listen.py | 1 | 2340 | #!/bin/python
import socket
import struct
import sys
import signal
import time
import datetime
import argparse
import threading
class McastSocket(socket.socket):
def __init__(self, local_port='', reuse=False):
socket.socket.__init__(self, socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
if(reuse):
... | gpl-3.0 |
asanka-code/RIOT | tests/lwip/tests/01-run.py | 24 | 9890 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Martine Lenders <mail@martine-lenders.eu>
#
# Distributed under terms of the MIT license.
from __future__ import print_function
import argparse
import os, sys
import random
import pexpect
import subprocess
import time
import types
DE... | lgpl-2.1 |
PatrikValkovic/grammpy | tests/transformations_test/RemoveEpsilonRules/Reverse/SimpleTest.py | 1 | 1825 | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 20.08.2017 16:01
:Licence MIT
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import *
from grammpy.parsers import cyk
from grammpy.transforms import ContextFree, InverseContextFree
class S(Nonterminal): pass
class A(Nonterminal): pass
c... | mit |
McIntyre-Lab/papers | newman_events_2017/python_workflow/programs/build_intron2border_junction_index.py | 1 | 5945 | #!/usr/bin/env python3
#######################################################################################################################
#
# DATE: 2017-12-15
# NAME: build_Event2Transcript_index.py
# AUTHOR: Jeremy R. B. Newman (jrbnewman@ufl.edu)
#
# DESCRIPTION: This script creates an intron-to-border junction ... | lgpl-3.0 |
jguyomard/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/generator/gypd.py | 151 | 3320 | #!/usr/bin/python
# Copyright (c) 2009 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.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp f... | bsd-3-clause |
tangfeixiong/nova | nova/db/base.py | 64 | 1342 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | apache-2.0 |
amarant/servo | tests/wpt/css-tests/tools/webdriver/webdriver/command.py | 258 | 3985 | """Dispatches requests to remote WebDriver endpoint."""
import exceptions
import httplib
import json
import urlparse
import webelement
class CommandExecutor(object):
"""Dispatches requests to remote WebDriver endpoint."""
_HEADERS = {
"User-Agent": "Python WebDriver Local End",
"Content-Type... | mpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.