repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
masterandrey/masterandrey.com | refs/heads/master | _includes/src/asyncio_multiprocessing.py | 1 | import asyncio
import subprocess
import random
semaphore = asyncio.Queue(maxsize=3-1) # Max 3 processes
async def worker(id):
"""
We could use more straightforward consumer-producer pattern:
* producer puts tasks into the queue
* worker waits for tasks in the queue
But for this tiny cod... |
zdszxp/gamesrc | refs/heads/master | Trdlib/src/boost_1_60_0/libs/mpl/doc/src/refmanual/refmanual.py | 59 | # Copyright (c) Aleksey Gurtovoy 2001-2009
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import fnmatch
import os
import sys
import re
import string
underlines = ['+', '/']
special_cases = [ 'inserter', '_1,_2... |
rovanleeuwen/informant | refs/heads/master | informant/__init__.py | 1 | import gettext
#: Version information (major, minor, revision[, 'dev']).
version_info = (0, 0, 2)
#: Version string 'major.minor.revision'.
version = __version__ = ".".join(map(str, version_info))
gettext.install('informant')
|
Sazzadmasud/Keystone_hash_token | refs/heads/master | keystone/openstack/common/processutils.py | 7 | # 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/LICENSE-2.0
#
# Unless req... |
josepedro/palabos_acoustic | refs/heads/master | scons/scons-local-2.1.0/SCons/Tool/aixc++.py | 21 | """SCons.Tool.aixc++
Tool-specific initialization for IBM xlC / Visual Age C++ compiler.
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... |
brianmhunt/SIWorldMap | refs/heads/master | jinja2/testsuite/lexnparse.py | 82 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.lexnparse
~~~~~~~~~~~~~~~~~~~~~~~~~~
All the unittests regarding lexing, parsing and syntax.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import sys
import unittest
from jinja2.testsuite import JinjaTestCase
... |
rversteegen/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/test/test_urllib2net.py | 51 | #!/usr/bin/env python
import unittest
from test import test_support
from test.test_urllib2 import sanepathname2url
import socket
import urllib2
import sys
import os
import mimetools
def _retry_thrice(func, exc, *args, **kwargs):
for i in range(3):
try:
return func(*args, **kwargs)
ex... |
collects/VTK | refs/heads/master | Examples/VisualizationAlgorithms/Python/probeComb.py | 27 | #!/usr/bin/env python
# This shows how to probe a dataset with a plane. The probed data is
# then contoured.
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Read data.
pl3d = vtk.vtkMultiBlockPLOT3DReader()
pl3d.SetXYZFileName(VTK_DATA_ROOT + "/Data/combxyz.bin")
pl3d.SetQFileN... |
luotao1/Paddle | refs/heads/develop | python/paddle/fluid/tests/unittests/test_fleet_base.py | 2 | # Copyright (c) 2020 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 appli... |
jkpr/pmix | refs/heads/master | tests/test_numbering.py | 1 | """Unit tests for numbering.py."""
import itertools
import unittest
import pmix.numbering as numbering
class NumberingFormatTest(unittest.TestCase):
"""Test the string format for fixed numberings."""
def match_re(self, prog, expr, match):
found = prog.match(expr)
if match:
msg =... |
supermurat/hamsi-manager | refs/heads/master | Bars/MenuBar.py | 1 | # This file is part of HamsiManager.
#
# Copyright (c) 2010 - 2015 Murat Demir <mopened@gmail.com>
#
# Hamsi Manager 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 yo... |
TeamTwisted/external_chromium_org | refs/heads/opti-5.1 | tools/perf/page_sets/blank_page.py | 43 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class BlankPage(page_module.Page):
def __init__(self... |
yongtang/tensorflow | refs/heads/master | tensorflow/lite/toco/logging/gen_html.py | 14 | # Copyright 2019 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... |
aninternetof/bremen | refs/heads/master | bremenenv/lib/python3.5/site-packages/pip/req/req_set.py | 338 | from __future__ import absolute_import
from collections import defaultdict
from itertools import chain
import logging
import os
from pip._vendor import pkg_resources
from pip._vendor import requests
from pip.compat import expanduser
from pip.download import (is_file_url, is_dir_url, is_vcs_url, url_to_path,
... |
wfx/epack | refs/heads/master | epack/utils.py | 1 | #!/usr/bin/env python
# encoding: utf-8
#
# 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 distribute... |
arista-eosplus/ansible-modules-extras | refs/heads/devel | packaging/os/macports.py | 161 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jimmy Tang <jcftang@gmail.com>
# Based on okpg (Patrick Pelletier <pp.pelletier@gmail.com>), pacman
# (Afterburn) and pkgin (Shaun Zinck) modules
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public ... |
tktrungna/leetcode | refs/heads/master | Python/longest-increasing-subsequence.py | 1 | """
QUESTION:
Given an unsorted array of integers, find the length of longest increasing subsequence.
For example,
Given [10, 9, 2, 5, 3, 7, 101, 18],
The longest increasing subsequence is [2, 3, 7, 101], therefore the length is 4. Note that there may be more than one
LIS combination, it is only necessary for you to... |
feroda/django | refs/heads/master | django/core/cache/backends/base.py | 15 | "Base Cache class."
from __future__ import unicode_literals
import time
import warnings
from django.core.exceptions import DjangoRuntimeWarning, ImproperlyConfigured
from django.utils.module_loading import import_string
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRun... |
nolanliou/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/manip_ops_test.py | 4 | # 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... |
saurabh6790/omn-app | refs/heads/master | hr/report/employee_leave_balance/employee_leave_balance.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.widgets.reportview import execute as runreport
def execute(filters=None):
if not filters: filters = {}
employee_fi... |
bzero/statsmodels | refs/heads/master | statsmodels/sandbox/tsa/examples/ex_mle_arma.py | 33 | # -*- coding: utf-8 -*-
"""
TODO: broken because of changes to arguments and import paths
fixing this needs a closer look
Created on Thu Feb 11 23:41:53 2010
Author: josef-pktd
copyright: Simplified BSD see license.txt
"""
from __future__ import print_function
import numpy as np
from numpy.testing import assert_almost... |
klusark/android_external_chromium_org | refs/heads/cm-11.0 | tools/telemetry/telemetry/core/extension_to_load.py | 29 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
from telemetry.core.chrome import crx_id
class ExtensionPathNonExistentException(Exception):
pass
class MissingPublicKeyException(Exception... |
ehashman/oh-mainline | refs/heads/master | vendor/packages/Django/django/contrib/gis/tests/__init__.py | 113 | from django.conf import settings
from django.test.simple import build_suite, DjangoTestSuiteRunner
from django.utils import unittest
from .test_geoforms import GeometryFieldTest
from .test_measure import DistanceTest, AreaTest
from .test_spatialrefsys import SpatialRefSysTest
def geo_apps(namespace=True, runtests=Fa... |
gnuhub/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/hgext/rebase.py | 90 | # rebase.py - rebasing feature for mercurial
#
# Copyright 2008 Stefano Tortarolo <stefano.tortarolo at gmail dot com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''command to move sets of revisions to a different ancestor
T... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/graph_objs/ohlc/legendgrouptitle/_font.py | 1 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "ohlc.legendgrouptitle"
_path_str = "ohlc.legendgrouptitle.font"
_valid_props = {"color", "fami... |
pranjan77/kb_cummerbund | refs/heads/master | lib/GenomeFileUtil/baseclient.py | 150 | ############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
############################################################
from __future__ import print_function
import json as _json
import requests as _requests
import random a... |
mute/elasticsearch | refs/heads/master | dev-tools/create_bwc_index_with_some_ancient_segments.py | 217 | import create_bwc_index
import logging
import os
import random
import shutil
import subprocess
import sys
import tempfile
def fetch_version(version):
logging.info('fetching ES version %s' % version)
if subprocess.call([sys.executable, os.path.join(os.path.split(sys.argv[0])[0], 'get-bwc-version.py'), version]) != ... |
jonnary/keystone | refs/heads/master | keystone/common/sql/migrate_repo/versions/046_placeholder.py | 70 | # 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... |
coderbone/SickRage | refs/heads/master | lib/bs4/tests/test_html5lib.py | 293 | """Tests to ensure that the html5lib tree builder generates good trees."""
import warnings
try:
from bs4.builder import HTML5TreeBuilder
HTML5LIB_PRESENT = True
except ImportError, e:
HTML5LIB_PRESENT = False
from bs4.element import SoupStrainer
from bs4.testing import (
HTML5TreeBuilderSmokeTest,
... |
meirwah/st2contrib | refs/heads/master | packs/hue/actions/lib/action.py | 9 | from hue import Hue
from st2actions.runners.pythonrunner import Action
class BaseAction(Action):
def __init__(self, config):
super(BaseAction, self).__init__(config)
self.hue = self._get_client()
def _get_client(self):
hue = Hue()
hue.station_ip = self.config['station_ip']
... |
CS-SI/QGIS | refs/heads/master | tests/src/python/test_provider_postgres.py | 3 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for the postgres provider.
Note: to prepare the DB, you need to run the sql files specified in
tests/testdata/provider/testdata_pg.sh
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publis... |
newswangerd/ansible | refs/heads/devel | lib/ansible/plugins/loader.py | 8 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> and others
# (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import ... |
tschijnmo/drudge | refs/heads/master | tests/su2_test.py | 1 | """Test for the SU2 drudge."""
from sympy import Rational, I, Symbol, symbols, IndexedBase
from drudge import SU2LatticeDrudge, Range
def test_su2_without_symbolic_index(spark_ctx):
"""Test SU2 lattice drudge without abstract symbolic lattice index."""
dr = SU2LatticeDrudge(spark_ctx)
p = dr.names
... |
SciencesPo/WebPo | refs/heads/master | __main__.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
site=None
if len(sys.argv) == 1:
print "Name of site is missing. usage : $ python WebPo mySite"
pass
else:
site=sys.argv[1]
sys.argv.remove(sys.argv[1])
MAIN_GFOLDER = '0BziWsJYs4XsYa0R1Z0UyYjBGcVk'
SITEMAPPING = '1G2r5JHioBuV3otbZO5KVurKfhHY5b7... |
goliveirab/odoo | refs/heads/8.0 | addons/account/wizard/account_period_close.py | 341 | # -*- 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... |
flyfei/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/distutils/command/sdist.py | 46 | """distutils.command.sdist
Implements the Distutils 'sdist' command (create a source distribution)."""
import os
import string
import sys
from types import *
from glob import glob
from warnings import warn
from distutils.core import Command
from distutils import dir_util, dep_util, file_util, archive_util
from distu... |
viewfinderco/viewfinder | refs/heads/master | backend/services/email_mgr.py | 13 | # -*- coding: utf-8 -*-
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Viewfinder email send manager.
Example::
email_mgr = EmailManager()
email_mgr.SendEmail(from=u'朋友你好 <john@doe.com>',
to='blah@blah.com',
subject='Hello friend',
text... |
biomodels/MODEL1310110034 | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
setup(name='MODEL1310110034',
version=20140916,
description='MODEL1310110034 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/MODEL1310110034',
maintainer='Stanley Gu',
maintainer_url='stanleygu@gmail.com',
packages=find_packages(... |
qisanstudio/qsapp-express | refs/heads/master | src/express/panel/account.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from flask import request, url_for, flash, redirect
from flask.ext.admin import expose
from flask.ext.admin.babel import gettext
from flask.ext.admin.actions import action
from studio.core.engines import db
from express.models.account import (... |
RiccardoPecora/MP | refs/heads/master | Lib/site-packages/scipy/stats/__init__.py | 58 | #
# stats - Statistical Functions
#
from info import __doc__
from stats import *
from distributions import *
from rv import *
from morestats import *
from kde import gaussian_kde
import mstats
#remove vonmises_cython from __all__, I don't know why it is included
__all__ = filter(lambda s:not (s.startswith('_') or s.... |
meduz/NeuroTools | refs/heads/master | examples/sfn2008/sfn_example_spike2.py | 3 | import NeuroTools.spike2.spike2channels as spike2
import pylab, numpy
"""
Example to show off some capabilities of the spike2 module
and the SpikeTrain and AnalogSignal class.
- loads content from a CED Son file which contains data from a IF-curve experiment
- then the data is processed and a IF-Curve is plotted
Per... |
srgblnch/Rijndael | refs/heads/master | gRijndael/version.py | 1 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... |
mdworks2016/work_development | refs/heads/master | Python/20_Third_Certification/venv/lib/python3.7/site-packages/pip/_vendor/urllib3/exceptions.py | 20 | from __future__ import absolute_import
from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
# Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class PoolError... |
jaingaurav/ansible | refs/heads/devel | test/units/errors/__init__.py | 267 | # (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... |
gchp/django | refs/heads/master | tests/lookup/models.py | 235 | """
The lookup API
This demonstrates features of the database API.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class Alarm(models.Model):
desc = models.CharField(max_length=100)
time = mo... |
domix/FrameworkBenchmarks | refs/heads/master | falcon/setup_pypy.py | 2 | import subprocess
import setup_util
import multiprocessing
import os
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/pypy/bin')
NCPU = multiprocessing.cpu_count()
proc = None
def start(args):
global proc
proc = subprocess.Popen([
bin_dir + "/gunicorn",
"app:app",
'-k', '... |
uglyboxer/linear_neuron | refs/heads/master | net-p3/lib/python3.5/site-packages/matplotlib/tests/test_dates.py | 9 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import map
import datetime
import warnings
import tempfile
import dateutil
try:
# mock in python 3.3+
from unittest import mock
except ImportError:
import mock
from nose.... |
GoogleCloudPlatform/PerfKitBenchmarker | refs/heads/master | perfkitbenchmarker/linux_benchmarks/gpu_pingpong_benchmark.py | 1 | # Copyright 2021 PerfKitBenchmarker 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 appli... |
savanu/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/user_prompts/accept_alert.py | 8 | from tests.support.asserts import assert_error, assert_success
def accept_alert(session):
return session.transport.send("POST", "session/{session_id}/alert/accept"
.format(session_id=session.session_id))
# 18.2 Accept Alert
def test_no_browsing_context(session, create_window):... |
altai/focus | refs/heads/master | focus/models/__init__.py | 5 | # -*- coding: utf-8 -*-
# Focus
# Copyright (C) 2010-2012 Grid Dynamics Consulting Services, Inc
# All Rights Reserved
#
# 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
# version ... |
danithaca/mxnet | refs/heads/master | python/mxnet/model.py | 4 | # pylint: disable=fixme, invalid-name, too-many-arguments, too-many-locals, too-many-lines
# pylint: disable=too-many-branches, too-many-statements
"""MXNet model module"""
from __future__ import absolute_import, print_function
import time
import logging
import warnings
from collections import namedtuple
import numpy ... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/food/generic/dish_cho_nor_hoola.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/loot/npc_loot/prop_jacket_generic.py | 85615 | import sys
def setup(core, object):
return |
mashuai/Cassandra-Research | refs/heads/trunk | pylib/cqlshlib/test/__init__.py | 146 | # 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... |
smillerpy/timeline | refs/heads/master | timeline/users/models.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.contrib.auth.models import AbstractUser
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy... |
xkcd1253/SocialNetworkforTwo | refs/heads/master | db_upgrade.py | 66 | #!flask/bin/python
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
api.upgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
print 'Current database version: ' + str(api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO))
|
DataIsTheNewBlack/Django-GestionPatrimoine | refs/heads/master | sifac_landing/admin.py | 47 | # -*- coding: utf-8 -*-
from django.contrib import admin
# Register your models here.
|
adkerr/tempest | refs/heads/netapp/akerr | tempest/api/compute/volumes/test_volumes_negative.py | 3 | # 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.apach... |
datafolklabs/cement | refs/heads/master | cement/utils/test.py | 1 | """Cement testing utilities."""
# flake8: noqa
import os
import shutil
from pytest import raises, skip
from ..core.foundation import TestApp
from ..core.exc import *
from ..utils.misc import rando
from ..utils import fs, shell
|
wenchaodudu/SNLDA | refs/heads/master | snlda.py | 1 | import numpy as np
import itertools
import pickle
from sne import update_theta
from lda import update_variables, dtm_update
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE, MDS
from sklearn.decomposition import LatentDirichletAllocation as LDA, PCA
import progressbar
import pdb
import logging
TOPIC_... |
EricNeedham/assignment-1 | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py | 190 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, fsencode, detect_encoding, ... |
csmengwan/autorest | refs/heads/master | AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/autorestdurationtestservice/models/error.py | 104 | # 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 ... |
ProfessionalIT/maxigenios-website | refs/heads/master | sdk/google_appengine/lib/django-1.3/django/conf/global_settings.py | 52 | # Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... |
acshan/odoo | refs/heads/8.0 | addons/hr_applicant_document/__init__.py | 389 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
zolegus/neon | refs/heads/master | tests/test_gradient_pool.py | 10 | # ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems 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.o... |
UOMx/edx-platform | refs/heads/master | lms/djangoapps/instructor/views/instructor_task_helpers.py | 35 | """
A collection of helper utility functions for working with instructor
tasks.
"""
import json
import logging
from util.date_utils import get_default_time_display
from bulk_email.models import CourseEmail
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from instructor_... |
nathanielvarona/airflow | refs/heads/master | tests/providers/mongo/sensors/__init__.py | 5130 | #
# 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... |
xbzbing/mitmproxy | refs/heads/master | examples/modify_querystring.py | 36 |
def request(context, flow):
q = flow.request.get_query()
if q:
q["mitmproxy"] = ["rocks"]
flow.request.set_query(q)
|
sq5bpf/osmo-tetra-sq5bpf | refs/heads/master | src/demod/python-3.7/fcdp-tetra_demod.py | 1 | #!/usr/bin/env python
import sys
import math
from gnuradio import blocks, filter, gr, audio
from gnuradio.eng_option import eng_option
from optparse import OptionParser
try:
import cqpsk
except:
from tetra_demod import cqpsk
# applies frequency translation, resampling (interpolation/decimation) and cqpsk dem... |
jamielennox/deluge | refs/heads/master | deluge/_libtorrent.py | 6 | #
# _libtorrent.py
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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 v... |
odoomrp/odoomrp-wip | refs/heads/8.0 | account_treasury_forecast_banking/models/__init__.py | 124 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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... |
mitocw/edx-platform | refs/heads/master | openedx/core/djangoapps/content/block_structure/tests/test_factory.py | 4 | """
Tests for block_structure_factory.py
"""
from django.test import TestCase
from xmodule.modulestore.exceptions import ItemNotFoundError
from ..exceptions import BlockStructureNotFound
from ..factory import BlockStructureFactory
from ..store import BlockStructureStore
from .helpers import ChildrenMapTestMixin, Mo... |
resin-io/edison-linux | refs/heads/master | tools/perf/scripts/python/sctop.py | 1996 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
yoer/hue | refs/heads/master | desktop/core/ext-py/lxml/setupinfo.py | 28 | import sys, os, os.path
from distutils.core import Extension
from distutils.errors import DistutilsOptionError
from versioninfo import get_base_dir, split_version
try:
from Cython.Distutils import build_ext as build_pyx
import Cython.Compiler.Version
CYTHON_INSTALLED = True
except ImportError:
CYTHON_I... |
1yvT0s/scrapy | refs/heads/master | scrapy/core/__init__.py | 216 | """
Scrapy core library classes and functions.
"""
|
nmayorov/scikit-learn | refs/heads/master | examples/linear_model/plot_logistic.py | 312 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logit function
=========================================================
Show in the plot is how the logistic regression would, in this
synthetic dataset, classify values as either 0 or 1,
i.e. class one or two, u... |
shannpersand/cooper-type | refs/heads/master | workshops/Python Workshop/Just/2016-06-25 CooperWest workshop day 1/19 draw nicer bounding box.py | 1 | for g in CurrentFont():
if not g.box:
continue
xMin, yMin, xMax, yMax = g.box
g.prepareUndo("draw bounding box")
pen = g.getPen()
additionalSpace = 30
pen.moveTo((xMin - additionalSpace, yMin))
pen.lineTo((xMin - additionalSpace, yMax))
pen.lineTo((xMin, yMax + addit... |
MarnuLombard/namebench | refs/heads/master | nb_third_party/jinja2/environment.py | 199 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import *
from ... |
chand3040/cloud_that | refs/heads/named-release/cypress.rc | common/lib/xmodule/xmodule/seq_module.py | 19 | import json
import logging
import warnings
from lxml import etree
from xblock.fields import Integer, Scope, Boolean
from xblock.fragment import Fragment
from pkg_resources import resource_string
from .exceptions import NotFoundError
from .fields import Date
from .mako_module import MakoModuleDescriptor
from .progres... |
le9i0nx/ansible | refs/heads/devel | test/units/template/test_template_utilities.py | 119 | # (c) 2015 Toshio Kuratomi <tkuratomi@ansible.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 later ... |
cheenwe/cheenwe.github.io | refs/heads/master | _posts/study/python/8_get_web_page.py | 2 | import socket
s = socket.socket()
host = socket.gethostname()
port = 1234
s.bind((host, port))
s.listen(5)
while True:
c, addr = s.accept()
print "Get coonect from", addr
c.send('Thanks your coonecting')
c.close() |
ricpol/quickreport | refs/heads/master | quickreport/chinook_demo/param_types.py | 1 | # -*- coding: utf8 -*-
"""Quickreport - param_types.py
Questo modulo raccoglie i tipi di parametro definiti nel progetto, da usare
in aggiunta a quelli messi a disposizione in quickreport.param_types.
Per un'idea di come definire i tipi, vedi anche quickreport.param_types.
Per ogni tipo occorre definire una class... |
barryrobison/anim-studio-tools | refs/heads/master | napalm/core/test/test.py | 5 | import sys
import napalm.core as n
import pimath as p
# globals
fileTypes = [ "nap", "xml" ]
delayLoadableFileTypes = [ "nap" ]
# helper function which returns a table containing all types that napalm uses
def createUberTable():
t = n.ObjectTable()
t[1] = 1 # this is interpreted as an int... |
JackDandy/SickGear | refs/heads/master | lib/hachoir_py3/subfile/data_rate.py | 2 | from time import time
DATARATE_UPDATE = 1.0 # Time slice (in second) for datarate computation
class DataRate:
"""
Compute average speed in bits per second of a function.
Store self.size data rates to compute good average speed.
Don't compute average before self.min_size values are computed.
"""... |
janusnic/21v-pyqt | refs/heads/master | unit_03/clock/timer6.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
class WigglyWidget(QtGui.QWidget):
def __init__(self, parent=None):
super(WigglyWidget, self).__init__(parent)
self.setBackgroundRole(QtGui.QPalette.Midlight)
self.setAutoFillBackground(True)
newFont = ... |
getKiwiCoin/KiwiCoin | refs/heads/master | share/qt/clean_mac_info_plist.py | 1 | #!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the Kiwicoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
in... |
shonenada/flask-captcha | refs/heads/master | flask_captcha/view.py | 1 | import random
try:
from cStringIO import StringIO
except ImportError:
from io import BytesIO as StringIO
from flask import Blueprint, make_response, current_app, session
from wheezy.captcha.image import captcha
from wheezy.captcha.image import background
from wheezy.captcha.image import curve
from wheezy.captc... |
romain-dartigues/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_auth.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUME... |
beckastar/django | refs/heads/master | django/contrib/gis/geos/prototypes/geom.py | 114 | from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_sized_string, check_string, check_zero)
from django.contrib.gis.geos.prototypes.threadsafe import G... |
cwyark/micropython | refs/heads/master | tests/cpydiff/core_function_unpacking.py | 21 | """
categories: Core,Functions
description: Unpacking function arguments in non-last position isn't detected as an error
cause: Unknown
workaround: The syntax below is invalid, never use it in applications.
"""
print(*(1, 2), 3)
|
newvem/pytz | refs/heads/master | pytz/zoneinfo/Pacific/Guam.py | 9 | '''tzinfo timezone information for Pacific/Guam.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Guam(DstTzInfo):
'''Pacific/Guam timezone definition. See datetime.tzinfo for details'''
zone = 'Pacific/Guam'
_utc_tra... |
fahhem/mbed-os | refs/heads/master | tools/host_tests/echo_flow_control.py | 125 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... |
VitalLabs/gcloud-python | refs/heads/master | _testing/grpc/_adapter/_c.py | 77 | # Copyright 2015 Google 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
maniackodi2016/repositorio.familiaiptv | refs/heads/master | program.plexus/resources/plexus/plexusutils/utilities.py | 33 | # -*- coding: utf-8 -*-
""" Plexus (c) 2015 enen92
This file contains common utilites
Functions:
handle_wait(time_to_wait,title,text,segunda='') -> Timer with dialog progress capabilities
getDirectorySize(directory) -> returns a directory size recursively
recursive_overwrite(src, dest,... |
tarunlnmiit/django-crispy-forms | refs/heads/dev | crispy_forms/__init__.py | 18 | # -*- coding: utf-8 -*-
__version__ = '1.5.1'
|
johankaito/fufuka | refs/heads/master | microblog/flask/venv/lib/python2.7/site-packages/pip/_vendor/packaging/_compat.py | 901 | # Copyright 2014 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
maxrosan/NS-3-support-for-OBS | refs/heads/master | bindings/python/apidefs/gcc-LP64/ns3_module_ns3wifi.py | 132 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## Register a nested module for the namespace Config
nested_module = module.add_cpp_namespace('Config')
register_types_ns3_Config(nested_module)
... |
andela-earinde/bellatrix-py | refs/heads/master | app/js/lib/lib/modules/test/test_sha.py | 137 | # Testing sha module (NIST's Secure Hash Algorithm)
# use the three examples from Federal Information Processing Standards
# Publication 180-1, Secure Hash Standard, 1995 April 17
# http://www.itl.nist.gov/div897/pubs/fip180-1.htm
import warnings
warnings.filterwarnings("ignore", "the sha module is deprecated.*",
... |
tapanpandita/pocket | refs/heads/master | setup.py | 1 | from setuptools import setup
setup(
name = "pocket", # pip install pocket
description = "api wrapper for getpocket.com",
#long_description=open('README.md', 'rt').read(),
# version
# third part for minor release
# second when api changes
# first when it becomes stable someday
version =... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/lib/python2.7/dist-packages/PIL/OleFileIO.py | 2 | ../../../../share/pyshared/PIL/OleFileIO.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.