repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
nosix/PyCraft
refs/heads/master
src/pycraft/service/primitive/values/motion.py
1
# -*- coding: utf8 -*- from pycraft.common import ImmutableMeta from pycraft.common.util import put_in_range, put_in_border class Motion(metaclass=ImmutableMeta): """Entity の動き eid : 個体識別子 pos : 位置 yaw : 体の水平方向(度) head_yaw : 頭の水平方向(度) pitch : 頭の垂直方向(度) """ properties = 'eid pos ...
HiSPARC/station-software
refs/heads/master
user/updater/Downloader.py
1
from urllib import urlretrieve import re import logging import checkFiles logger = logging.getLogger('updater.downloader') class Downloader(object): """Download available updates""" def downloadUpdate(self, location, URL): """Download an update :param location: local path where to store t...
ginolhac/tutorials
refs/heads/devel
python/basics/example3/numpy_compare.py
2
import numpy as np import random import timeit import math import sys if __name__ == '__main__': numpy_version = np.__version__.split('.')[1] lens = range(10, 300, 10) np_time = [] for l in lens: rands = [random.random() for _ in range(0, l)] numpy_rands = np.array(rands) exec...
frederica07/Dragon_Programming_Process
refs/heads/master
PyOpenGL-3.0.2/OpenGL/raw/GL/SGIX/texture_add_env.py
1
'''Autogenerated by get_gl_extensions script, do not edit!''' from OpenGL import platform as _p from OpenGL.GL import glget EXTENSION_NAME = 'GL_SGIX_texture_add_env' _p.unpack_constants( """GL_TEXTURE_ENV_BIAS_SGIX 0x80BE""", globals()) def glInitTextureAddEnvSGIX(): '''Return boolean indicating whether this ext...
mkauf/AutobahnTestSuite
refs/heads/master
autobahntestsuite/autobahntestsuite/case/case9_9_1.py
3
# coding=utf-8 ############################################################################### ## ## Copyright (C) 2011-2014 Tavendo GmbH ## ## 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...
Scalr/pecha
refs/heads/master
scalrctl/commands/farm.py
2
__author__ = 'Dmitriy Korsakov' __doc__ = 'Farm management' import json import copy from scalrctl import commands from scalrctl import click from scalrctl import request, settings class FarmTerminate(commands.SimplifiedAction): epilog = "Example: scalr-ctl farms terminate --farmId <ID> --force" post_temp...
localwiki/localwiki-backend-server
refs/heads/master
localwiki/crap_comments/models.py
3
from pages.plugins import register, insert_text_before from pages.widgets import register_editor_plugin def comments(elem, context=None): title = elem.text before = '{%% comments "%s" %%} %s' % (title, elem.tail or '') insert_text_before(before, elem) elem.getparent().remove(elem) register('comments',...
SurfasJones/djcmsrc3
refs/heads/master
venv/lib/python2.7/site-packages/sekizai/data.py
8
class SekizaiList(list): """ A sekizai namespace in a template. """ def __init__(self, namespace): self._namespace = namespace super(SekizaiList, self).__init__() def append(self, obj): """ When content gets added, run the filters for this namespace. """ ...
xiangshouding/nv
refs/heads/master
node/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/modeline.py
135
# -*- coding: utf-8 -*- """ pygments.modeline ~~~~~~~~~~~~~~~~~ A simple modeline parser (based on pymodeline). :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re __all__ = ['get_filetype_from_buffer'] modeline_re = re.compil...
osrg/ryu
refs/heads/master
ryu/services/protocols/zebra/db/__init__.py
5
# Copyright (C) 2017 Nippon Telegraph and Telephone Corporation. # # 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...
multipath-tcp/mptcp-analysis-scripts
refs/heads/master
scripts_graph/initial_subflow_data_handover_cdf.py
1
#! /usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 Quentin De Coninck # # 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...
jumpstarter-io/neutron
refs/heads/master
neutron/tests/unit/ml2/drivers/mech_sriov/test_mech_sriov_nic_switch.py
12
# Copyright 2014 Mellanox Technologies, Ltd # # 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 t...
chongtianfeiyu/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test_source_encoding.py
67
# -*- coding: koi8-r -*- import unittest from test.support import TESTFN, unlink, unload import importlib import os import sys import subprocess class SourceEncodingTest(unittest.TestCase): def test_pep263(self): self.assertEqual( "ðÉÔÏÎ".encode("utf-8"), b'\xd0\x9f\xd0\xb8\xd1\x8...
milq/milq
refs/heads/master
learn/prog/03/03.py
5
# CONDITIONALS # COMPARISON OPERATORS a = 5 b = 3 z = a == b # Equal to Result: False z = a != b # Not equal to Result: True z = a > b # Greater than Result: True z = a >= b # Greater than or equal to Result: True z = ...
andersonresende/django
refs/heads/master
django/conf/locale/nn/formats.py
197
# -*- 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 = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
jahrome/viper
refs/heads/master
modules/pymacho/MachOSection.py
3
# encoding: utf-8 """ Copyright 2013 Jérémie BOUTOILLE 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 distri...
jhuntwork/pacman
refs/heads/master
test/pacman/tests/provision004.py
27
self.description = "-S literal with provision of same name installed" sp = pmpkg("provision", "1.0-2") sp.provides = ["literal"] sp.conflicts = ["literal"] self.addpkg2db("sync", sp) sp = pmpkg("literal", "1.0-2") self.addpkg2db("sync2", sp) lp = pmpkg("provision") lp.provides = ["literal"] lp.conflicts = ["literal"...
sebbrudzinski/modules
refs/heads/master
docs/source/conf.py
3
# -*- coding: utf-8 -*- # # MOTECH Modules documentation build configuration file, created by # sphinx-quickstart on Thu Apr 17 11:19:58 2014. # # 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...
slohse/ansible
refs/heads/devel
lib/ansible/modules/network/avi/avi_customipamdnsprofile.py
20
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ANSIB...
lucperkins/heron
refs/heads/master
heron/tools/ui/src/python/handlers/common/consts.py
1
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright 2016 Twitter. 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...
CYBAI/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/websockets/compliance/test_client.py
17
import json import logging import urllib.parse import asyncio import websockets logging.basicConfig(level=logging.WARNING) # Uncomment this line to make only websockets more verbose. # logging.getLogger('websockets').setLevel(logging.DEBUG) SERVER = "ws://127.0.0.1:8642" AGENT = "websockets" async def get_case_...
shawncaojob/LC
refs/heads/master
PY/543_diameter_of_binary_tree.py
1
# 543. Diameter of Binary Tree Add to List # DescriptionHintsSubmissionsSolutions # Total Accepted: 13092 # Total Submissions: 30666 # Difficulty: Easy # Contributors: # nagasupreeth # Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the lon...
DhiaEddineSaidi/python-social-auth
refs/heads/master
examples/flask_me_example/models/__init__.py
58
from flask_me_example.models import user from social.apps.flask_app.me import models
maverickhuenlam/blog
refs/heads/master
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/borland.py
364
# -*- coding: utf-8 -*- """ pygments.styles.borland ~~~~~~~~~~~~~~~~~~~~~~~ Style similar to the style used in the Borland IDEs. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token impo...
tomo-otsuka/normalize
refs/heads/master
normalize/property/meta.py
1
# # This file is a part of the normalize python library # # normalize is free software: you can redistribute it and/or modify # it under the terms of the MIT License. # # normalize is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FI...
hydroshare/hydroshare
refs/heads/develop
hs_rest_api/resources/file_metadata.py
1
import os from django.core.exceptions import ObjectDoesNotExist from rest_framework.response import Response from rest_framework import generics from rest_framework import serializers from rest_framework.exceptions import APIException, NotFound from hs_core.models import ResourceFile from hs_rest_api.permissions im...
karthik339/Agni
refs/heads/master
MainDemo/flask/lib/python2.7/site-packages/flask/testsuite/subclassing.py
57
# -*- coding: utf-8 -*- """ flask.testsuite.subclassing ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Test that certain behavior of flask can be customized by subclasses. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from StringIO import St...
Sutto/cloud-custodian
refs/heads/master
c7n/ufuncs/logsub.py
11
# Copyright 2016-2017 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
superdesk/liveblog
refs/heads/master
server/gunicorn_config.py
15
import os import multiprocessing bind = '0.0.0.0:%s' % os.environ.get('PORT', '5000') workers = int(os.environ.get('WEB_CONCURRENCY', multiprocessing.cpu_count() * 2 + 1)) accesslog = '-' access_log_format = '%(m)s %(U)s status=%(s)s time=%(T)ss size=%(B)sb' reload = 'SUPERDESK_RELOAD' in os.environ timeout = int(...
petteyg/intellij-community
refs/heads/master
python/testData/inspections/PyNumpyType/NominalType.py
79
def cond(x, p=None): """ Compute the condition number of a matrix. This function is capable of returning the condition number using one of seven different norms, depending on the value of `p` (see Parameters below). Parameters ---------- x : (M, N) array_like The matrix whose ...
srh/rethinkdb
refs/heads/next
drivers/java/convert_protofile.py
12
'''Converts the protobuf file into proto_basic.json''' import codecs import json import re from collections import OrderedDict def convert_protofile(proto_filename, proto_json_filename): with open(proto_filename) as ql2: proto = Proto2Dict(ql2)() with codecs.open(proto_json_filename, "w") as pb: ...
40423149/2016fallcadp_hw
refs/heads/gh-pages
plugin/render_math/pelican_mathjax_markdown_extension.py
348
# -*- coding: utf-8 -*- """ Pelican Mathjax Markdown Extension ================================== An extension for the Python Markdown module that enables the Pelican python blog to process mathjax. This extension gives Pelican the ability to use Mathjax as a "first class citizen" of the blog """ import markdown from...
marckuz/django
refs/heads/master
tests/admin_widgets/models.py
227
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible class MyFileField(models.FileField): pass @python_2_unicode_compatible class Member(models.Model): name = models.CharField(max_lengt...
rohanp/scikit-learn
refs/heads/master
sklearn/ensemble/tests/test_weight_boosting.py
58
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_array_equal, assert_array_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal, assert_true from sklearn.utils.testing import assert_raises...
kkdd/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32com/olectl.py
35
"""Constants used by COM Controls Hand created version of OLECTL.H constants. """ import winerror FACILITY_CONTROL = 0xa def MAKE_SCODE(sev, fac, code): return int((long(-sev)<<31) | ((fac)<<16) | ((code))) def STD_CTL_SCODE(n): return MAKE_SCODE(winerror.SEVERITY_ERROR, FACILITY_CONTROL, n) CTL_E_ILLEGALFUNC...
zhuochenKIDD/tornado
refs/heads/master
tornado/wsgi.py
127
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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...
JDSchmitzMedia/pydev
refs/heads/master
pysrc/tests/samples/nested_dir/nested3/non_test_file.py
432
""" i am a python file with no tests """ pass
Seagate/swift
refs/heads/master
swift/cli/ringbuilder.py
3
#! /usr/bin/env python # Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
googleapis/googleapis-gen
refs/heads/master
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/campaign_bid_modifier_service/transports/__init__.py
5
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
ze-phyr-us/redis-py
refs/heads/master
tests/test_pipeline.py
50
from __future__ import with_statement import pytest import redis from redis._compat import b, u, unichr, unicode class TestPipeline(object): def test_pipeline(self, r): with r.pipeline() as pipe: pipe.set('a', 'a1').get('a').zadd('z', z1=1).zadd('z', z2=4) pipe.zincrby('z', 'z1')....
ujdhesa/unisubs
refs/heads/staging
apps/videos/migrations/0019_update_youtube_title.py
1
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from videos.models import VIDEO_TYPE_YOUTUBE from videos.types.youtube import yt_service from gdata.service import RequestError class Migration(DataMigration): def forwards(self, orm): ...
zhuwenping/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/distutils/archive_util.py
55
"""distutils.archive_util Utility functions for creating archive files (tarballs, zip files, that sort of thing).""" import os from warnings import warn import sys try: import zipfile except ImportError: zipfile = None from distutils.errors import DistutilsExecError from distutils.spawn import spawn from d...
Calebzor/service.history
refs/heads/master
default.py
1
import os import sys import xbmc import time import xbmcaddon __addon__ = xbmcaddon.Addon() __cwd__ = xbmc.translatePath(__addon__.getAddonInfo('path')).decode("utf-8") __resource__ = xbmc.translatePath(os.path.join(__cwd__, 'resources')).decode("utf-8") __settings__ = xbmcaddon.Addon("service.history") Path = __se...
adhoc-dev/odoo-infrastructure
refs/heads/8.0
infrastructure_contract/database.py
5
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, fields, api, _ from op...
Glottotopia/aagd
refs/heads/master
moin/local/moin/build/lib.linux-x86_64-2.6/MoinMoin/support/werkzeug/exceptions.py
2
# -*- coding: utf-8 -*- """ werkzeug.exceptions ~~~~~~~~~~~~~~~~~~~ This module implements a number of Python exceptions you can raise from within your views to trigger a standard non-200 response. Usage Example ------------- :: from werkzeug.wrappers import BaseRe...
lithint/odoo-saas-tools
refs/heads/master
saas_portal/models/wizard.py
4
# -*- coding: utf-8 -*- import requests import werkzeug import datetime import simplejson import openerp from openerp.addons.saas_utils import connector, database from openerp.addons.web.http import request from openerp.tools import config from openerp import models, fields, api, SUPERUSER_ID from openerp import http ...
detectlanguage/detectlanguage-python
refs/heads/master
tests/test_api.py
1
# -*- coding: utf-8 -*- from . import utils from nose.tools import * import detectlanguage import os class TestApi(utils.TestCase): def setUp(self): detectlanguage.configuration.api_key = os.environ['DETECTLANGUAGE_API_KEY'] def test_simple_detect(self): result = detectlanguage.simple_detect("Hello world") ...
shepdelacreme/ansible
refs/heads/devel
lib/ansible/plugins/callback/osx_say.py
33
# (c) 2012, Michael DeHaan, <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' ...
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/_models_py3.py
1
# 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 ...
FKlama/unshac.py
refs/heads/master
env.py
1
#!/usr/bin/python # # Project Name: unshac.py # File: env.py # Author: Frederik Klama # License: GPL v3 (see included LICENSE file) # # This script is supposed to unify the shell environment on several machines, # while still allowing for individual differences on each machine # import os import...
cernvm/cernvm-appliance-agent
refs/heads/master
dist/usr/libexec/cernvm-appliance-agent/cgi-bin/toolkit/Adapter.py
1
import subprocess import sys import os if 'MY_HOME' not in os.environ: os.environ['MY_HOME']='/usr/libexec/cernvm-appliance-agent' sys.path.append(os.environ['MY_HOME']+'/cgi-bin') from HTMLPageGenerator import * from BlueprintDesigner import * import string import cgi def cleanUpStringList(strList): i=0 w...
openstack/neutron-lib
refs/heads/master
neutron_lib/tests/unit/api/definitions/test_bgpvpn_routes_control.py
1
# # 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 # ...
nhquiroz/hacker-rank
refs/heads/master
python/introduction/hello-world.py
86
print("Hello World!")
40223145c2g18/40223145
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/unittest/suite.py
748
"""TestSuite""" import sys from . import case from . import util __unittest = True def _call_if_exists(parent, attr): func = getattr(parent, attr, lambda: None) func() class BaseTestSuite(object): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(se...
bytedance/fedlearner
refs/heads/master
web_console_v2/api/test/fedlearner_webconsole/setting/apis_test.py
1
# Copyright 2021 The FedLearner 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...
dvitme/odoomrp-wip
refs/heads/8.0
stock_quant_merge/__openerp__.py
14
# -*- 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...
SwagColoredKitteh/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/sslutils/__init__.py
463
import openssl import pregenerated from base import NoSSLEnvironment from openssl import OpenSSLEnvironment from pregenerated import PregeneratedSSLEnvironment environments = {"none": NoSSLEnvironment, "openssl": OpenSSLEnvironment, "pregenerated": PregeneratedSSLEnvironment}
karthikbadam/karthikbadam.github.io
refs/heads/master
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/input_test.py
1841
#!/usr/bin/env python # Copyright 2013 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. """Unit tests for the input.py file.""" import gyp.input import unittest import sys class TestFindCycles(unittest.TestCase): def setUp(self...
gcd0318/django
refs/heads/master
tests/gis_tests/inspectapp/models.py
302
from ..models import models class AllOGRFields(models.Model): f_decimal = models.FloatField() f_float = models.FloatField() f_int = models.IntegerField() f_char = models.CharField(max_length=10) f_date = models.DateField() f_datetime = models.DateTimeField() f_time = models.TimeField() ...
bashrc/zeronet-debian
refs/heads/master
src/src/lib/rsa/core.py
214
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # Unl...
danieljaouen/ansible
refs/heads/devel
lib/ansible/modules/cloud/misc/helm.py
14
#!/usr/bin/python # (c) 2016, Flavio Percoco <flavio@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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'sta...
sterlingbaldwin/esgf-pyclient
refs/heads/master
test/cache_urllib2.py
2
""" A Cache for HTTP requests for use when unittesting. Courtesy of Staffan Malmgren <staffan@tomtebo.org> http://code.activestate.com/recipes/491261/ Some simplifications applied. """ import urllib2 import httplib import os import StringIO from hashlib import md5 def install_cache(cache_dir): h = CacheHandler...
DDEFISHER/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pytest/_pytest/__init__.py
165
# __version__ = '2.9.1'
vprime/puuuu
refs/heads/master
env/lib/python2.7/site-packages/django/utils/ipv6.py
113
# This code was mostly based on ipaddr-py # Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/ # Licensed under the Apache License, Version 2.0 (the "License"). from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from django.utils.six.moves import xrang...
mdworks2016/work_development
refs/heads/master
Python/05_FirstPython/Chapter8_ThirdParty/fpython_develop/lib/python3.7/site-packages/pip/_vendor/chardet/langthaimodel.py
269
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
kamyu104/LeetCode
refs/heads/master
Python/distribute-candies.py
2
# Time: O(n) # Space: O(n) # Given an integer array with even length, where different numbers # in this array represent different kinds of candies. # Each number means one candy of the corresponding kind. # You need to distribute these candies equally in number to brother and sister. # Return the maximum number of ki...
dietrichc/streamline-ppc-reports
refs/heads/master
examples/dfp/v201411/publisher_query_language_service/get_line_items_named_like.py
4
#!/usr/bin/python # # Copyright 2014 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 b...
lpantano/seqcluster
refs/heads/master
seqcluster/stats.py
1
import os import pysam import logging import json from seqcluster.libs.inputs import parse_ma_file from seqcluster.libs.sam2bed import makeBED from collections import defaultdict, Counter logger = logging.getLogger('stats') def stats(args): """Create stats from the analysis """ logger.info("Reading seque...
imsplitbit/nova
refs/heads/master
nova/db/sqlalchemy/migrate_repo/versions/__init__.py
78
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
IDNoise/NoiseIDE
refs/heads/master
NoiseIDEPython/idn_erlang_completer.py
1
__author__ = 'Yaroslav' import os import wx from idn_config import Config from idn_cache import ErlangCache, Function, Record, ExportedType, Macros from idn_colorschema import ColorSchema from idn_erlang_constats import TYPE_MODULE, TYPE_HRL from idn_token import ErlangTokenizer, ErlangTokenType from idn_utils import ...
liqueur/jieba
refs/heads/master
test/test_whoosh.py
64
# -*- coding: UTF-8 -*- from __future__ import unicode_literals import sys,os sys.path.append("../") from whoosh.index import create_in,open_dir from whoosh.fields import * from whoosh.qparser import QueryParser from jieba.analyse import ChineseAnalyzer analyzer = ChineseAnalyzer() schema = Schema(title=TEXT(stored=...
cbertinato/pandas
refs/heads/master
pandas/tests/indexing/test_indexing_engines.py
1
import numpy as np from pandas._libs import algos as libalgos, index as libindex import pandas.util.testing as tm class TestNumericEngine: def test_is_monotonic(self, numeric_indexing_engine_type_and_dtype): engine_type, dtype = numeric_indexing_engine_type_and_dtype num = 1000 arr = np....
amrdraz/kodr
refs/heads/master
app/brython/www/src/Lib/multiprocessing/process.py
694
# # Module providing the `Process` class which emulates `threading.Thread` # # multiprocessing/process.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = ['Process', 'current_process', 'active_children'] # # Imports # import os import sys import signal import itert...
esatterwhite/django-tastypie
refs/heads/master
tests/content_gfk/tests/resources.py
31
from django.test import TestCase from tastypie.exceptions import NotFound from tastypie.contrib.contenttypes.resources import GenericResource from content_gfk.api.resources import NoteResource, DefinitionResource class GenericResourceTestCase(TestCase): def setUp(self): self.resource = GenericResource([N...
piotroxp/scibibscan
refs/heads/master
scib/lib/python3.6/site-packages/pip/utils/packaging.py
343
from __future__ import absolute_import from email.parser import FeedParser import logging import sys from pip._vendor.packaging import specifiers from pip._vendor.packaging import version from pip._vendor import pkg_resources from pip import exceptions logger = logging.getLogger(__name__) def check_requires_pyth...
gcd0318/django
refs/heads/master
tests/aggregation_regress/models.py
75
# -*- coding: utf-8 -*- from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Mode...
nwpointer/proj3-ajax
refs/heads/master
CONFIG.py
2
""" Configuration of syllabus server. Edit to fit development or deployment environment. """ import random ### My local development environment PORT=5000 DEBUG = True ### On ix.cs.uoregon.edu #PORT=random.randint(5000,8000) #DEBUG = False # Because it's unsafe to run outside localhost
CMUSV-VisTrails/WorkflowRecommendation
refs/heads/master
vistrails/db/versions/v0_6_0/domain/id_scope.py
2
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
anbangr/trusted-nova
refs/heads/master
nova/ipv6/__init__.py
20
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
FactoryBoy/factory_boy
refs/heads/master
examples/django_demo/generic_foreignkey/migrations/0001_initial.py
1
import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ] operations = [ migrations.CreateModel( name='TaggedItem', fie...
twbarber/pygooglevoice
refs/heads/master
examples/voicemail.py
39
from googlevoice import Voice,util voice = Voice() voice.login() for message in voice.voicemail().messages: util.print_(message)
JasonGross/mozjs
refs/heads/master
media/webrtc/trunk/tools/gyp/test/defines/gyptest-defines-env-regyp.py
74
#!/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. """ Verifies build of an executable with C++ define specified by a gyp define, and the use of the environment during regeneration when the g...
wegostudio/wego
refs/heads/master
wego-docs/source/wego_theme/__init__.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Vimalkumar Velayudhan' __email__ = 'vimalkumarvelayudhan@gmail.com' __version__ = '1.3.2' import os.path pkg_dir = os.path.abspath(os.path.dirname(__file__)) theme_path = os.path.split(pkg_dir)[0]
thespooler/nss
refs/heads/master
external_tests/google_test/gtest/test/gtest_throw_on_failure_test.py
2917
#!/usr/bin/env python # # Copyright 2009, 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...
alexfeng/InternationalizationScript-iOS
refs/heads/master
InternationalScriptDemo/exportExcelDemoV2.0/xlwt-1.1.2/examples/xlwt_easyxf_simple_demo.py
45
# Write an XLS file with a single worksheet, containing # a heading row and some rows of data. import xlwt import datetime ezxf = xlwt.easyxf def write_xls(file_name, sheet_name, headings, data, heading_xf, data_xfs): book = xlwt.Workbook() sheet = book.add_sheet(sheet_name) rowx = 0 for colx, value ...
denys-duchier/Scolar
refs/heads/master
ZAbsences.py
1
# -*- mode: python -*- # -*- coding: iso8859-15 -*- ############################################################################## # # Gestion scolarite IUT # # Copyright (c) 2001 - 2013 Emmanuel Viennet. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the term...
zen/solar
refs/heads/master
examples/compiled-resources/example-compiled-resources.py
3
#!/usr/bin/env python """ To run this code, first compile the resources with solar resource compile_all NOTE: this script might be outdated, the idea is just to show how compiled resources work. """ import click import json import requests import sys import time from solar.core import actions from solar.core...
clejeu03/EWP
refs/heads/master
view/sketchViewModule/SketchWidget.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from PySide import QtGui, QtCore class SketchWidget (QtGui.QFrame): def __init__(self): super(SketchWidget, self).__init__() self.setMinimumWidth(100) self.setMinimumHeight(30) #For the style sheet self.setObjectName("sketch"...
12AngryMen/votca-scripts
refs/heads/master
lib/__tools__.py
2
import lxml.etree as lxml import argparse import sys import sqlite3 import os import errno import time def XmlParser(optionfile,entry=False): parser=lxml.XMLParser(remove_comments=True) tree = lxml.parse(optionfile,parser) root = tree.getroot() if entry != False: return root.find(entry) e...
jbernhard/hic
refs/heads/master
hic/flow.py
2
# -*- coding: utf-8 -*- from __future__ import division import collections import warnings import numpy as np __all__ = 'qn', 'Cumulant', 'Sampler' def qn(phi, *n): """ Calculate the complex flow vector `Q_n`. :param array-like phi: Azimuthal angles. :param int n: One or more harmonics to calcul...
GregGeoghegan/GCoin-GCN-Source
refs/heads/master
Source/contrib/qt_translations.py
4110
#!/usr/bin/env python # Helpful little script that spits out a comma-separated list of # language codes for Qt icons that should be included # in binary bitcoin distributions import glob import os import re import sys if len(sys.argv) != 3: sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.arg...
lonetwin/opencore
refs/heads/master
opencore/models/rdbms.py
4
# Copyright (C) 2010-2011 Large Blue # Fergus Doyle: fergus.doyle@largeblue.com # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License Version 2 as published # by the Free Software Foundation. You may not use, modify or distribute #...
toast38coza/WeddingSite
refs/heads/master
faq/admin.py
1
from django.contrib import admin from faq.models import FAQ admin.site.register(FAQ)
thomasorb/orb
refs/heads/master
setup.py
1
from setuptools import setup, Extension, find_namespace_packages from Cython.Build import cythonize import io import codecs import os import sys import orb import numpy packages = find_namespace_packages(where=".") here = os.path.abspath(os.path.dirname(__file__)) with io.open(os.path.join(here, 'README.md'), encod...
sserrot/champion_relationships
refs/heads/master
venv/Lib/site-packages/prompt_toolkit/widgets/menus.py
2
from typing import Callable, Iterable, List, Optional, Sequence, Union from prompt_toolkit.application.current import get_app from prompt_toolkit.filters import Condition from prompt_toolkit.formatted_text.base import OneStyleAndTextTuple, StyleAndTextTuples from prompt_toolkit.key_binding.key_bindings import KeyBindi...
PeterTheOne/weblate
refs/heads/master
weblate/trans/tests/test_commands.py
8
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
palladius/gcloud
refs/heads/master
packages/gsutil/boto/boto/manage/volume.py
70
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.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, modi...
biddisco/VTK
refs/heads/master
Rendering/Core/Testing/Python/ImageActorStressed.py
20
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create the RenderWindow, Renderer and both Actors ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetRen...
azoft-dev-team/imagrium
refs/heads/win
env/Lib/test/Graph.py
23
from java import awt from math import * from jarray import array class Graph(awt.Canvas): def __init__(self): self.function = None def paint(self, g): if self.function is None: return self.error(g) sz = self.size xs = range(0, sz.width, 2) xscale = 4*pi/sz...
webmasterraj/GaSiProMo
refs/heads/master
flask/lib/python2.7/site-packages/numpy/compat/py3k.py
105
""" Python 3 compatibility tools. """ from __future__ import division, absolute_import, print_function __all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar', 'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested', 'asstr', 'open_latin1', 'long', 'basestring', 'sixu', ...