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 |
|---|---|---|---|---|---|
agentr13/python-phonenumbers | python/phonenumbers/data/region_MX.py | 8 | 4158 | """Auto-generated file, do not edit by hand. MX metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_MX = PhoneMetadata(id='MX', country_code=52, international_prefix='0[09]',
general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{9,10}', possible_number_patte... | apache-2.0 |
q1ang/scikit-learn | examples/ensemble/plot_forest_importances_faces.py | 403 | 1519 | """
=================================================
Pixel importances with a parallel forest of trees
=================================================
This example shows the use of forests of trees to evaluate the importance
of the pixels in an image classification task (faces). The hotter the pixel,
the more impor... | bsd-3-clause |
bobcyw/django | django/conf/locale/pt_BR/formats.py | 504 | 1434 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = '... | bsd-3-clause |
chilleo/ALPHA | module/CalculateGeneralizedDStatisticClass.py | 1 | 11045 | from PyQt4 import QtCore
from sys import *
import os
import subprocess
# if platform == 'win32':
# path.insert(0, "../CommandLineFiles")
# elif platform == 'darwin':
# path.insert(0, "..\\CommandLineFiles")
# import CalculateGeneralizedDStatistic
import sys
from CommandLineFiles.RunDGEN import run_saved_dge... | mit |
yoki/phantomjs | src/breakpad/src/tools/gyp/test/sibling/gyptest-relocate.py | 151 | 1144 | #!/usr/bin/env 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.
"""
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('build/all.gyp', chdir='src')
test.relocate('src', 'relocate/src')
test.bu... | bsd-3-clause |
pli3/enigma2-pli | lib/python/Plugins/Extensions/DVDBurn/Process.py | 14 | 36761 | from Components.Task import Task, Job, DiskspacePrecondition, Condition, ToolExistsPrecondition
from Components.Harddisk import harddiskmanager
from Screens.MessageBox import MessageBox
import os
class png2yuvTask(Task):
def __init__(self, job, inputfile, outputfile):
Task.__init__(self, job, "Creating menu video")... | gpl-2.0 |
wolverineav/neutron | neutron/tests/fullstack/base.py | 1 | 3133 | # Copyright 2015 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... | apache-2.0 |
amenonsen/ansible | lib/ansible/modules/network/fortios/fortios_router_rip.py | 14 | 25268 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# 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 Lic... | gpl-3.0 |
rspavel/spack | var/spack/repos/builtin.mock/packages/garply/package.py | 3 | 4269 | # Copyright 2013-2020 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 spack import *
import os
import sys
class Garply(Package):
"""Toy package for testing dependencies"""
hom... | lgpl-2.1 |
foursquare/pants | tests/python/pants_test/engine/legacy/test_graph_integration.py | 1 | 5480 | # coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from pants.build_graph.address_lookup_error import AddressLookupError
fr... | apache-2.0 |
maK-/weevely3 | testsuite/test_file_enum.py | 14 | 4630 | from testfixtures import log_capture
from testsuite.base_fs import BaseFilesystem
from testsuite import config
from core.sessions import SessionURL
from core import modules
import utils
from core import messages
import subprocess
import tempfile
import os
class FileEnum(BaseFilesystem):
def setUp(self):
s... | gpl-3.0 |
yao-matrix/mLearning | kaggle/distracted_driver/app/train.py | 2 | 3468 | #!/usr/bin/env python
# coding=utf-8
import os
import cv2
import glob
import datetime
import logging
import numpy as np
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooli... | apache-2.0 |
hidenori-t/chainer | chainer/optimizer.py | 7 | 8978 | import math
import numpy
from chainer import cuda
# TODO(delta2323): Make it public function and move it to common directory.
def _sqnorm(x):
with cuda.get_device(x):
x = x.ravel()
return float(x.dot(x))
class Optimizer(object):
"""Base class of all numerical optimizers.
Optimizer i... | mit |
jayme-github/headphones | lib/unidecode/x1d6.py | 248 | 3974 | data = (
's', # 0x00
't', # 0x01
'u', # 0x02
'v', # 0x03
'w', # 0x04
'x', # 0x05
'y', # 0x06
'z', # 0x07
'A', # 0x08
'B', # 0x09
'C', # 0x0a
'D', # 0x0b
'E', # 0x0c
'F', # 0x0d
'G', # 0x0e
'H', # 0x0f
'I', # 0x10
'J', # 0x11
'K', # 0x12
'L', # 0x13
'M', # 0... | gpl-3.0 |
NixaSoftware/CVis | venv/lib/python2.7/site-packages/numpy/lib/nanfunctions.py | 11 | 50827 | """
Functions that ignore NaN.
Functions
---------
- `nanmin` -- minimum non-NaN value
- `nanmax` -- maximum non-NaN value
- `nanargmin` -- index of minimum non-NaN value
- `nanargmax` -- index of maximum non-NaN value
- `nansum` -- sum of non-NaN values
- `nanprod` -- product of non-NaN values
- `nancumsum` -- cumul... | apache-2.0 |
kevinrigney/PlaylistDatabase | ReplaceVideoUrl.py | 1 | 4628 | #!/usr/bin/env python3
# Find videos with duplicates: SELECT Track.track_name, Artist.artist_name,Track.youtube_link FROM Track JOIN Artist WHERE Track.artist_id = Artist.id GROUP BY Track.youtube_link HAVING count(*) >=2
from PlaylistDatabase import PlaylistDatabase
db = PlaylistDatabase(config_file='PlaylistData... | mit |
hwu25/AppPkg | Applications/Python/Python-2.7.2/Lib/textwrap.py | 53 | 17265 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
__revision__ = "$Id$"
import string, re
# Do the right thing with boolean values for all known Python versions
# (so this module c... | bsd-2-clause |
1st/django | django/contrib/flatpages/templatetags/flatpages.py | 472 | 3632 | from django import template
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.shortcuts import get_current_site
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
sel... | bsd-3-clause |
araisrobo/machinekit | src/hal/user_comps/hal_temp_ads7828.py | 12 | 3854 | #!/usr/bin/python
# encoding: utf-8
"""
Temperature.py
Created by Alexander Rössler on 2014-03-24.
"""
from drivers.ADS7828 import ADS7828
from fdm.r2temp import R2Temp
import argparse
import time
import sys
import hal
class Pin:
def __init__(self):
self.pin = 0
self.r2temp = None
self... | lgpl-2.1 |
tensorflow/tensorflow | tensorflow/python/keras/tests/model_subclassing_compiled_test.py | 6 | 14360 | # Copyright 2018 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 |
zhengwsh/InplusTrader_Linux | InplusTrader/backtestEngine/api/ext.py | 1 | 1329 | # -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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 ... | mit |
matt-jordan/mjmud | tests/game/commands/standard/test_standard_set.py | 1 | 2831 | #
# mjmud - The neverending MUD project
#
# Copyright (c) 2014, Matt Jordan
#
# See https://github.com/matt-jordan/mjmud for more information about the
# project. Please do not contact the maintainers of the project for information
# or assistance. The project uses Github for these purposes.
#
# This program is free so... | mit |
pselle/calibre | src/calibre/ptempfile.py | 17 | 7583 | from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
"""
Provides platform independent temporary files that persist even after
being closed.
"""
import tempfile, os, atexit
from future_builtins import map
from calibre.constants import (__version__... | gpl-3.0 |
mogoweb/webkit_for_android5.1 | webkit/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py | 15 | 3297 | # Copyright (C) 2010 Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | apache-2.0 |
javier-ruiz-b/docker-rasppi-images | raspberry-google-home/env/lib/python3.7/site-packages/requests_oauthlib/compliance_fixes/facebook.py | 6 | 1119 | from json import dumps
try:
from urlparse import parse_qsl
except ImportError:
from urllib.parse import parse_qsl
from oauthlib.common import to_unicode
def facebook_compliance_fix(session):
def _compliance_fix(r):
# if Facebook claims to be sending us json, let's trust them.
if "applica... | apache-2.0 |
mkrupcale/ansible | hacking/metadata-tool.py | 14 | 20756 | #!/usr/bin/env python
import ast
import csv
import os
import sys
from collections import defaultdict
from distutils.version import StrictVersion
from pprint import pformat, pprint
import yaml
from ansible.module_utils._text import to_text
from ansible.plugins import module_loader
# There's a few files that are not... | gpl-3.0 |
yavalvas/yav_com | build/matplotlib/doc/mpl_toolkits/axes_grid/examples/demo_parasite_axes2.py | 16 | 1208 | from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
import matplotlib.pyplot as plt
if 1:
host = host_subplot(111, axes_class=AA.Axes)
plt.subplots_adjust(right=0.75)
par1 = host.twinx()
par2 = host.twinx()
offset = 60
new_fixed_axis = par2.get_grid_helper()... | mit |
fheeger/gost | PyQtTachyEmulator.py | 1 | 14872 | import sys, random, time
from glob import glob
import numpy
from PyQt5.QtCore import QObject, QTimer, QIODevice
from PyQt5.QtWidgets import *
from PyQt5 import QtSerialPort
class TachyConnection(QObject):
def __init__(self, dev=None, baut=4800, lineend="\r\n", timeout=3, log=sys.stderr):
sup... | gpl-3.0 |
bspink/django | tests/template_tests/filter_tests/test_iriencode.py | 388 | 1603 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import iriencode, urlencode
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class IriencodeTests(SimpleTestCase):
"""
Ensure iriencode keeps safe... | bsd-3-clause |
Ecogenomics/CheckM | scripts/simMarkerGenesVsMarkerSet.py | 3 | 6013 | #!/usr/bin/env python
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License... | gpl-3.0 |
woozzu/pylearn2 | pylearn2/scripts/tests/test_print_monitor_cv.py | 48 | 1927 | """
Test print_monitor_cv.py by training on a short TrainCV YAML file and
analyzing the output pickle.
"""
import os
import tempfile
from pylearn2.config import yaml_parse
from pylearn2.scripts import print_monitor_cv
from pylearn2.testing.skip import skip_if_no_sklearn
def test_print_monitor_cv():
"""Test print... | bsd-3-clause |
jianglu/mojo | build/android/pylib/perf/surface_stats_collector.py | 47 | 6781 | # 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 Queue
import datetime
import logging
import re
import threading
from pylib import android_commands
from pylib.device import device_utils
# Log marke... | bsd-3-clause |
jaruba/chromium.src | tools/telemetry/telemetry/value/list_of_scalar_values_unittest.py | 12 | 6051 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
from telemetry import page as page_module
from telemetry import value
from telemetry.page import page_set
from telemetry.value impo... | bsd-3-clause |
Yannig/ansible | lib/ansible/modules/network/netvisor/pn_vrouterlbif.py | 29 | 10152 | #!/usr/bin/python
""" PN CLI vrouter-loopback-interface-add/remove """
#
# 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 yo... | gpl-3.0 |
edgedb/edgedb | edb/testbase/serutils.py | 1 | 2605 | # mypy: ignore-errors
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2019-present MagicStack Inc. and the EdgeDB authors.
#
# 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 ... | apache-2.0 |
openprivacy/.emacs.d | elpy/rpc-venv/lib/python3.8/site-packages/setuptools/_distutils/command/build.py | 35 | 5767 | """distutils.command.build
Implements the Distutils 'build' command."""
import sys, os
from distutils.core import Command
from distutils.errors import DistutilsOptionError
from distutils.util import get_platform
def show_compilers():
from distutils.ccompiler import show_compilers
show_compilers()
class bu... | gpl-2.0 |
dimartiro/gspread | gspread/urls.py | 41 | 2820 | # -*- coding: utf-8 -*-
"""
gspread.urls
~~~~~~~~~~~~
This module is Google API url patterns storage.
"""
import re
from .exceptions import UnsupportedFeedTypeError, UrlParameterMissing
SPREADSHEETS_SERVER = 'spreadsheets.google.com'
SPREADSHEETS_FEED_URL = 'https://%s/%s/' % (SPREADSHEETS_SERVER, 'feeds')
# G... | mit |
paulcoiffier/Mobissime-Liberta | vendor/justinrainbow/json-schema/docs/conf.py | 74 | 7837 | # -*- coding: utf-8 -*-
#
# JsonSchema documentation build configuration file, created by
# sphinx-quickstart on Sat Dec 10 15:34:44 2011.
#
# 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.
#
# ... | gpl-2.0 |
minhphung171093/OpenERP_V8 | openerp/tools/which.py | 456 | 6884 | #!/usr/bin/env python
""" Which - locate a command
* adapted from Brian Curtin's http://bugs.python.org/file15381/shutil_which.patch
* see http://bugs.python.org/issue444582
* uses ``PATHEXT`` on Windows
* searches current directory before ``PATH`` on Windows,
but not before an explicitly passed ... | agpl-3.0 |
emilroz/openmicroscopy | components/tools/OmeroWeb/omeroweb/webclient/controller/index.py | 5 | 2494 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
#
# Copyright (c) 2008-2011 University of Dundee.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License... | gpl-2.0 |
h3biomed/ansible | lib/ansible/modules/network/bigswitch/bigmon_policy.py | 44 | 6499 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ted Elhourani <ted@bigswitch.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Ansible module to manage Big Monitoring Fabric service chains
from __future__ import absolute_import, division, print_funct... | gpl-3.0 |
vortex-ape/scikit-learn | examples/bicluster/plot_bicluster_newsgroups.py | 39 | 5911 | """
================================================================
Biclustering documents with the Spectral Co-clustering algorithm
================================================================
This example demonstrates the Spectral Co-clustering algorithm on the
twenty newsgroups dataset. The 'comp.os.ms-windows... | bsd-3-clause |
Altazon97/WolfsDen | modules/twython-3.1.0/twython/streaming/types.py | 9 | 2825 | # -*- coding: utf-8 -*-
"""
twython.streaming.types
~~~~~~~~~~~~~~~~~~~~~~~
This module contains classes and methods for :class:`TwythonStreamer` to use.
"""
class TwythonStreamerTypes(object):
"""Class for different stream endpoints
Not all streaming endpoints have nested endpoints.
User Streams and S... | gpl-3.0 |
jessefeinman/FintechHackathon | venv/Lib/site-packages/setuptools/msvc.py | 89 | 37091 | """
Improved support for Microsoft Visual C++ compilers.
Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64);
Microsoft Windows SDK 7.0 (x86, x64, ia64);
Microsoft Windows SDK 6.1 (x86, x64, ia64)
Microsoft Visual C++ 10... | bsd-2-clause |
redPanther/hyperion.ng | effects/candle.py | 4 | 2098 |
# Candleflicker effect by penfold42
# Algorithm courtesy of
# https://cpldcpu.com/2013/12/08/hacking-a-candleflicker-led/
# candles can be :
# a single led number, a list of candle numbers
# "all" to flicker all the leds randomly
# "all-together" to flicker all the leds in unison
import hyperion
import time
import ... | mit |
agentfog/qiime | tests/test_parallel/test_map_reads_to_reference.py | 15 | 18488 | #!/usr/bin/env python
# File created on 07 Jul 2012
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcaporaso@gmail.com"
from ... | gpl-2.0 |
fxtentacle/phantomjs | src/qt/qtbase/util/local_database/dateconverter.py | 105 | 5318 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of the test suite of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:LGPL$
## Commercial License... | bsd-3-clause |
vicky2135/lucious | tests/integration/offer/test_availability.py | 2 | 4516 | import datetime
from decimal import Decimal as D
from django.test import TestCase
from oscar.apps.offer import models
from oscar.core.compat import get_user_model
from oscar.test.factories import (
OrderDiscountFactory, UserFactory, create_order)
User = get_user_model()
class TestAPerUserConditionalOffer(TestC... | bsd-3-clause |
sumit4iit/django-guardian | guardian/admin.py | 9 | 14646 | from django import forms
from django.conf import settings
from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from django.contrib import messages
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.core.urlresolvers import reverse
from django.shortcuts import ren... | bsd-2-clause |
gautam1858/tensorflow | tensorflow/contrib/learn/python/learn/estimators/svm.py | 42 | 9389 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
fmacias64/spyre | setup.py | 3 | 1217 | from setuptools import setup, find_packages
setup(
name='DataSpyre',
version='0.2.0',
description='Spyre makes it easy to build interactive web applications, and requires no knowledge of HTML, CSS, or Javascript.',
url='https://github.com/adamhajari/spyre',
author='Adam Hajari',
author_email='a... | mit |
mikemow/youtube-dl | youtube_dl/extractor/ellentv.py | 107 | 2708 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
)
class EllenTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:ellentv|ellentube)\.com/videos/(?P<id>[a-z0-9_-]+)'
_TEST = {
'url': 'http://www.elle... | unlicense |
xorstream/unicorn | qemu/header_gen.py | 5 | 105836 | #!/usr/bin/python
# Unicorn Emulator Engine
# By Dang Hoang Vu & Nguyen Anh Quynh
# syntax: ./header_gen.py <arm|aarch64|x86|name>
import sys
symbols = (
'arm_release',
'aarch64_tb_set_jmp_target',
'ppc_tb_set_jmp_target',
'use_idiv_instructions_rt',
'tcg_target_deposit_valid',
'helper_power_... | gpl-2.0 |
GoeGaming/lutris | lutris/runners/steam.py | 1 | 6910 | import os
import time
import subprocess
from lutris.runners.runner import Runner
from lutris.gui.dialogs import NoticeDialog
from lutris.thread import LutrisThread
from lutris.util.log import logger
from lutris.util import system
from lutris.util.steam import (get_path_from_appmanifest, read_config,
... | gpl-3.0 |
woddx/privacyidea | tests/test_lib_tokens_motp.py | 3 | 7378 | """
This test file tests the lib.tokens.spasstoken
This depends on lib.tokenclass
"""
from .base import MyTestCase
from privacyidea.lib.tokens.motptoken import MotpTokenClass
from privacyidea.lib.tokens.mOTP import mTimeOtp
from privacyidea.models import Token
from privacyidea.lib.resolver import save_resolver
from pr... | agpl-3.0 |
VisionInternet/visionLiveSDK-Python | setup.py | 1 | 1303 | # -*- coding: utf-8 -*-
##############################################################################
#
# Python visionLive API
# Copyright 2017 Vision Internet (http://www.visioninternet.com)
#
##############################################################################
from setuptools import setup, find_pac... | gpl-3.0 |
zjutjsj1004/third | boost/tools/build/src/tools/rc.py | 1 | 7483 | # Status: being ported by Steven Watanabe
# Base revision: 47077
#
# Copyright (C) Andre Hentz 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, ... | mit |
mdaus/nitro | modules/python/nitf/samples/nitf_extract.py | 2 | 2822 | #!/usr/bin/env python
"""
* =========================================================================
* This file is part of NITRO
* =========================================================================
*
* (C) Copyright 2004 - 2016, MDA Information Systems LLC
*
* NITRO is free software; you can redistribu... | lgpl-3.0 |
boorad/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/mslink.py | 61 | 10682 | """SCons.Tool.mslink
Tool-specific initialization for the Microsoft linker.
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, 2009, 2010 The SC... | apache-2.0 |
mancoast/CPythonPyc_test | fail/321_test_urllib2_localnet.py | 51 | 21528 | #!/usr/bin/env python3
import os
import email
import urllib.parse
import urllib.request
import http.server
import unittest
import hashlib
from test import support
threading = support.import_module('threading')
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
CERT_localhost = os.path.join(here... | gpl-3.0 |
lixt/lily2-gem5 | src/cpu/o3/FuncUnitConfig.py | 49 | 4259 | # Copyright (c) 2010 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 implementation of the functionality ... | bsd-3-clause |
Honry/crosswalk-test-suite | stability/stability-lowresource-android-tests/lowresource/Webapp_Operations_UnderLowDisk.py | 7 | 9653 | #!/usr/bin/env python
# coding=utf-8
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of c... | bsd-3-clause |
LucaDiStasio/thinPlyMechanics | python/preprocessor.py | 1 | 2413 | # Autogenerated with SMOP
from smop.core import *
#
##
#==============================================================================
# Copyright (c) 2016-2017 Universite de Lorraine & Lulea tekniska universitet
# Author: Luca Di Stasio <luca.distasio@gmail.com>
# <luca.distasio@ingpec.eu... | apache-2.0 |
staslev/incubator-beam | sdks/python/apache_beam/testing/test_pipeline_test.py | 9 | 4209 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
serialdoom/ansible | lib/ansible/plugins/lookup/ini.py | 4 | 4178 | # (c) 2015, Yannig Perre <yannig.perre(at)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) any late... | gpl-3.0 |
shaistaansari/django | django/contrib/staticfiles/handlers.py | 581 | 2328 | from django.conf import settings
from django.contrib.staticfiles import utils
from django.contrib.staticfiles.views import serve
from django.core.handlers.wsgi import WSGIHandler, get_path_info
from django.utils.six.moves.urllib.parse import urlparse
from django.utils.six.moves.urllib.request import url2pathname
clas... | bsd-3-clause |
dscho/hg | hgext/zeroconf/Zeroconf.py | 1 | 58442 | from __future__ import absolute_import, print_function
""" Multicast DNS Service Discovery for Python, v0.12
Copyright (C) 2003, Paul Scott-Murphy
This module provides a framework for the use of DNS Service Discovery
using IP multicast. It has been tested against the JRendezvous
implementation from <... | gpl-2.0 |
xrg/django-static-gitified | tests/urls.py | 91 | 1189 | from django.conf.urls import patterns, include
urlpatterns = patterns('',
# test_client modeltest urls
(r'^test_client/', include('modeltests.test_client.urls')),
(r'^test_client_regress/', include('regressiontests.test_client_regress.urls')),
# File upload test views
(r'^file_uploads/', include('... | bsd-3-clause |
Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/reportlab/pdfbase/_fontdata_enc_macexpert.py | 56 | 3058 | MacExpertEncoding = (None, None, None, None, None, None, None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None,
'space', 'exclamsmall', 'Hungarumlautsmall', 'centoldstyle', 'dollaroldstyle', 'dollarsuperior', '... | gpl-3.0 |
Komzpa/omim | 3party/Alohalytics/tests/googletest/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/usr/bin/env python
#
# Copyright 2008, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | apache-2.0 |
aganezov/bg | bg/distances.py | 1 | 1464 | # -*- coding: utf-8 -*-
import networkx as nx
def get_all_cycles(breakpoint_graph):
visited = set()
cycles = []
for vertex in breakpoint_graph.nodes():
if vertex in visited:
continue
try:
cycle = nx.find_cycle(breakpoint_graph.bg, vertex)
new = False
... | mit |
psf/black | src/black/numerics.py | 1 | 1843 | """
Formatting numeric literals.
"""
from blib2to3.pytree import Leaf
def format_hex(text: str) -> str:
"""
Formats a hexadecimal string like "0x12B3"
"""
before, after = text[:2], text[2:]
return f"{before}{after.upper()}"
def format_scientific_notation(text: str) -> str:
"""Formats a numer... | mit |
xcgoner/dist-mxnet | python/mxnet/autograd.py | 7 | 14381 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
prakashpp/trytond-customs-value | tests/test_product.py | 2 | 2895 | # -*- coding: utf-8 -*-
import sys
import os
import unittest
import trytond.tests.test_tryton
from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT
from trytond.transaction import Transaction
from decimal import Decimal
DIR = os.path.abspath(os.path.normpath(os.path.join(
__file__, '..', '..', '..', ... | bsd-3-clause |
ecanzonieri/pyleus | examples/apparent_temperature/apparent_temperature/wind_speed_generator.py | 9 | 1135 | from __future__ import absolute_import
import logging
from collections import namedtuple
import random
from apparent_temperature.measure_generator import MeasureGeneratorSpout
log = logging.getLogger('wind_speed_generator')
WindSpeedMeasure = namedtuple(
"WindSpeedMeasure",
"id_sensor timestamp wind_speed"... | apache-2.0 |
rorasa/KeeTerm | Crypto/SelfTest/Cipher/test_XOR.py | 119 | 2538 | # -*- coding: utf-8 -*-
#
# SelfTest/Cipher/XOR.py: Self-test for the XOR "cipher"
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to ... | mit |
madan96/sympy | sympy/solvers/tests/test_solvers.py | 2 | 69392 | from sympy import (
Abs, And, Derivative, Dummy, Eq, Float, Function, Gt, I, Integral,
LambertW, Lt, Matrix, Or, Piecewise, Poly, Q, Rational, S, Symbol,
Wild, acos, asin, atan, atanh, cos, cosh, diff, erf, erfinv, erfc,
erfcinv, exp, im, log, pi, re, sec, sin,
sinh, solve, solve_linear, sqrt, sstr,... | bsd-3-clause |
ebmdatalab/openprescribing | openprescribing/dmd/forms.py | 1 | 2175 | from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Field, ButtonHolder, Submit
from crispy_forms.bootstrap import InlineCheckboxes
obj_types_choices = [
("vtm", "VTMs"),
("vmp", "VMPs"),
("amp", "AMPs"),
("vmpp", "VMPPs"),
("ampp", "AMPPs")... | mit |
maas/maas | src/maasserver/fields.py | 1 | 29287 | # Copyright 2012-2017 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Custom model and form fields."""
__all__ = [
"CIDRField",
"EditableBinaryField",
"Field",
"HostListFormField",
"IPListFormField",
"IPv4CIDRField",
... | agpl-3.0 |
jckarter/swift | utils/swift_build_support/swift_build_support/build_graph.py | 13 | 6374 | # swift_build_support/build_graph.py ----------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | apache-2.0 |
Jgarcia-IAS/SAT | openerp/addons/account_payment/account_payment.py | 212 | 19161 | # -*- 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 |
willthames/ansible-modules-core | cloud/amazon/ec2_key.py | 26 | 7232 | #!/usr/bin/python
# -*- coding: utf-8 -*-
DOCUMENTATION = '''
---
module: ec2_key
version_added: "1.5"
short_description: maintain an ec2 key pair.
description:
- maintains ec2 key pairs. This module has a dependency on python-boto >= 2.5
options:
name:
description:
- Name of the key pair.
require... | gpl-3.0 |
davidgardenier/frbpoppy | tests/lognlogs/local.py | 1 | 1611 | """Check the log N log F slope of a local population."""
import numpy as np
import matplotlib.pyplot as plt
from frbpoppy import CosmicPopulation, Survey, SurveyPopulation
from frbpoppy.population import unpickle
from tests.convenience import plot_aa_style, rel_path
MAKE = True
if MAKE:
population = CosmicPopu... | mit |
Baumelbi/IntroPython2016 | students/crobison/session04/file_lab.py | 3 | 1359 | # Charles Robison
# 2016.10.21
# File Lab
#!/usr/bin/env python
import os
cwd = os.getcwd()
# write a program which prints the full path to all files
# in the current directory, one per line
for item in os.listdir(cwd):
print(cwd + "/" + item)
# write a program which copies a file from a source, to a
# destinat... | unlicense |
flwh/KK_mt6589_iq451 | prebuilts/python/linux-x86/2.7.5/lib/python2.7/lib2to3/btm_utils.py | 374 | 10011 | "Utility functions used by the btm_matcher module"
from . import pytree
from .pgen2 import grammar, token
from .pygram import pattern_symbols, python_symbols
syms = pattern_symbols
pysyms = python_symbols
tokens = grammar.opmap
token_labels = token
TYPE_ANY = -1
TYPE_ALTERNATIVES = -2
TYPE_GROUP = -3
class MinNode(... | gpl-2.0 |
40223121/w17 | static/Brython3.1.1-20150328-091302/Lib/_thread.py | 740 | 4879 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... | gpl-3.0 |
VanirAOSP/external_chromium_org | tools/perf/metrics/statistics_unittest.py | 23 | 6400 | # 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 unittest
import random
from metrics import statistics
def Relax(samples, iterations=10):
"""Lloyd relaxation in 1D.
Keeps the position of the ... | bsd-3-clause |
ocefpaf/cartopy | lib/cartopy/tests/crs/test_transverse_mercator.py | 1 | 4985 | # (C) British Crown Copyright 2013 - 2019, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | lgpl-3.0 |
devGregA/code | build/lib.linux-x86_64-2.7/scrapy/commands/crawl.py | 8 | 2610 | import os
from scrapy.command import ScrapyCommand
from scrapy.utils.conf import arglist_to_dict
from scrapy.exceptions import UsageError
class Command(ScrapyCommand):
requires_project = True
def syntax(self):
return "[options] <spider>"
def short_desc(self):
return "Run a spider"
... | bsd-3-clause |
edsu/tweepy | tests/test_cursors.py | 44 | 1861 | from tweepy import Cursor
from .config import create_auth
from .config import TweepyTestCase, username, use_replay, tape
import six
if six.PY3:
import unittest
else:
import unittest2 as unittest
class TweepyCursorTests(TweepyTestCase):
@tape.use_cassette('testidcursoritems.json')
def testidcursorite... | mit |
cytec/SickRage | lib/hachoir_parser/container/riff.py | 86 | 16938 | # -*- coding: UTF-8 -*-
"""
RIFF parser, able to parse:
* AVI video container
* WAV audio container
* CDA file
Documents:
- libavformat source code from ffmpeg library
http://ffmpeg.mplayerhq.hu/
- Video for Windows Programmer's Guide
http://www.opennet.ru/docs/formats/avi.txt
- What is an animated curso... | gpl-3.0 |
imply/chuu | build/android/pylib/device_stats_monitor.py | 31 | 4305 | # 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.
"""Utilities for iotop/top style profiling for android."""
import collections
import json
import os
import subprocess
import sys
import urllib
import c... | bsd-3-clause |
anryko/ansible | lib/ansible/plugins/action/nxos_file_copy.py | 9 | 22728 | #
# 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 tha... | gpl-3.0 |
lorin/umdinst | umdinst/setup/verifyperms.py | 1 | 3064 | #!/usr/bin/env python
import os
from stat import *
def parent(path):
"""Return the parent of the specified directory"""
# Remove the trailing slash, if any
if path.endswith('/'):
return os.path.dirname(path[:-1])
else:
return os.path.dirname(path)
def create_and_set_permissions(di... | bsd-3-clause |
hydraplatform/hydra-base | unittests/test_templates.py | 1 | 37663 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) Copyright 2013 to 2017 University of Manchester
#
# HydraPlatform is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or... | lgpl-3.0 |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/transformer/implementations/implementation_closed/fairseq/data/monolingual_dataset.py | 4 | 2728 | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import numpy as np
import torch
f... | apache-2.0 |
AliLozano/django-guardian | docs/conf.py | 16 | 7163 | # -*- coding: utf-8 -*-
#
# django-guardian documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 18 23:18:28 2010.
#
# 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.... | bsd-2-clause |
wooga/airflow | tests/providers/presto/hooks/test_presto.py | 5 | 4331 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
davemehringer/keplerpp | apps/plotter_mayavi.py | 1 | 10321 | # plotter_mayavi.py
# Copyright (C) 2016 David Mehringer
#
# 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 versi... | gpl-3.0 |
xchaoinfo/python | burun/0007/codes/find_keywords_in_diary.py | 78 | 1185 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Date: 13-03-15
# Author: Liang
import os
import re
# set diaries path
diaries_path = "diaries/"
diaries = os.listdir(diaries_path)
# set stop words to make informative keywords
stop_words = open("Stop Words.txt", 'r').read()
stop_words_list = stop_words.split(" ")
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.