repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
GauriGNaik/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/mux.py
636
71218
# Copyright 2012, 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...
mpl-2.0
MiltosD/CEFELRC
lib/python2.7/site-packages/django/utils/tzinfo.py
313
2511
"Implementation of tzinfo classes for use with datetime.datetime." import time from datetime import timedelta, tzinfo from django.utils.encoding import smart_unicode, smart_str, DEFAULT_LOCALE_ENCODING class FixedOffset(tzinfo): "Fixed offset in minutes east from UTC." def __init__(self, offset): if i...
bsd-3-clause
bbannier/ROOT
interpreter/llvm/src/tools/clang/bindings/python/tests/cindex/test_code_completion.py
93
2766
from clang.cindex import TranslationUnit def check_completion_results(cr, expected): assert cr is not None assert len(cr.diagnostics) == 0 completions = [str(c) for c in cr.results] for c in expected: assert c in completions def test_code_complete(): files = [('fake.c', """ /// Aaa. int ...
lgpl-2.1
catapult-project/catapult-csm
third_party/mock/mock.py
424
75527
# mock.py # Test tools for mocking and patching. # Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # mock 1.0 # http://www.voidspace.org.uk/python/mock/ # Released subject to the BSD License # Please see http://www.voidspace.org.uk/python/license.shtml # Scripts m...
bsd-3-clause
khkaminska/scikit-learn
examples/svm/plot_svm_margin.py
318
2328
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM Margins Example ========================================================= The plots below illustrate the effect the parameter `C` has on the separation line. A large value of `C` basically tells our model that w...
bsd-3-clause
RRCKI/panda-server
pandaserver/test/lsst/lsstSubmitMERGEtest.py
2
5717
import sys import time import commands import userinterface.Client as Client from taskbuffer.JobSpec import JobSpec from taskbuffer.FileSpec import FileSpec aSrvID = None prodUserNameDefault = 'jschovan' prodUserName = None prodUserNameDP = None prodUserNamePipeline = None #site = 'ANALY_BNL-LSST-OSGRPMtest' #site = '...
apache-2.0
bailey1234/hyeri7846
lib/werkzeug/debug/tbtools.py
311
16785
# -*- coding: utf-8 -*- """ werkzeug.debug.tbtools ~~~~~~~~~~~~~~~~~~~~~~ This module provides various traceback related utility functions. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import re import os import sys import json import inspect import ...
apache-2.0
Hiyorimi/scikit-image
skimage/io/manage_plugins.py
14
10495
"""Handle image reading, writing and plotting plugins. To improve performance, plugins are only loaded as needed. As a result, there can be multiple states for a given plugin: available: Defined in an *ini file located in `skimage.io._plugins`. See also `skimage.io.available_plugins`. partial definiti...
bsd-3-clause
tboyce021/home-assistant
tests/components/modbus/test_modbus_sensor.py
7
6736
"""The tests for the Modbus sensor component.""" from datetime import timedelta import pytest from homeassistant.components.modbus.const import ( CALL_TYPE_REGISTER_HOLDING, CALL_TYPE_REGISTER_INPUT, CONF_COUNT, CONF_DATA_TYPE, CONF_OFFSET, CONF_PRECISION, CONF_REGISTER, CONF_REGISTER_...
apache-2.0
mastro35/flows
flows/FlowsLogger.py
1
2063
#!/usr/bin/env python3 ''' FlowsLogger.py Logging facility module for flows ---------------------------------- Copyright 2016 Davide Mastromatteo License: Apache-2.0 ''' import logging import threading from flows import Global class FlowsLogger: """ FlowsLogger class - Logger Factory """ _instance...
apache-2.0
Zhongqilong/kbengine
kbe/src/lib/python/Doc/includes/tzinfo-examples.py
92
5060
from datetime import tzinfo, timedelta, datetime ZERO = timedelta(0) HOUR = timedelta(hours=1) # A UTC class. class UTC(tzinfo): """UTC""" def utcoffset(self, dt): return ZERO def tzname(self, dt): return "UTC" def dst(self, dt): return ZERO utc = UTC() # A class building...
lgpl-3.0
Wintellect/WintellectWebinars
2018-02-22-mongo-python-kennedy/code/services/package_service.py
1
1462
from typing import Optional, List from bson import ObjectId from data.downloads import Download from data.packages import Package from data.release_history import ReleaseHistory from data.users import User class PackageService: @classmethod def find_package_by_name(cls, name: str) -> Optional[Package]: ...
apache-2.0
TalShafir/ansible
lib/ansible/modules/network/ftd/ftd_configuration.py
14
8579
#!/usr/bin/python # Copyright (c) 2018 Cisco and/or its affiliates. # # 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 ...
gpl-3.0
Simon-Will/montesniere
montesniere/normalize.py
1
12760
#!/usr/bin/env python3 # -*- coding: utf-8 -*- class Normalizer: """Reads a parsed sentence out of a file and normalizes its structure A Normalizer object consists of a parsed sentence Each sentence is brought into a SB VB O (CONJ SB VB O form. Attributes: sentence: sentence (read out of...
gpl-3.0
herlo/linch-pin
linchpin/tests/InventoryFilters/test_DummyInventory_pass.py
2
2078
#!/usr/bin/env python # flake8: noqa import os import json import yaml from nose.tools import * from linchpin.InventoryFilters import DummyInventory def setup_dummy_inventory_filter(): global filter global topo filter = DummyInventory.DummyInventory() provider = 'general' base_path = '{0}...
gpl-3.0
jn7163/django
tests/auth_tests/test_hashers.py
185
15899
# -*- coding: utf-8 -*- from __future__ import unicode_literals from unittest import skipUnless from django.conf.global_settings import PASSWORD_HASHERS from django.contrib.auth.hashers import ( UNUSABLE_PASSWORD_PREFIX, UNUSABLE_PASSWORD_SUFFIX_LENGTH, BasePasswordHasher, PBKDF2PasswordHasher, PBKDF2SHA1Pass...
bsd-3-clause
technologiescollege/s2a_fr
s2a/Python/Lib/tempfile.py
13
18604
"""Temporary files. This module provides generic, low- and high-level interfaces for creating temporary files and directories. The interfaces listed as "safe" just below can be used without fear of race conditions. Those listed as "unsafe" cannot, and are provided for backward compatibility only. This module also pr...
gpl-3.0
neumerance/cloudloon2
.venv/lib/python2.7/site-packages/pygments/lexer.py
265
26921
# -*- coding: utf-8 -*- """ pygments.lexer ~~~~~~~~~~~~~~ Base lexer classes. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re, itertools from pygments.filter import apply_filters, Filter from pygments.filters import get_filt...
apache-2.0
goldeneye-source/ges-python
lib/test/test_wait4.py
111
1140
"""This test checks for correct wait4() behavior. """ import os import time import sys from test.fork_wait import ForkWait from test.support import run_unittest, reap_children, get_attribute # If either of these do not exist, skip this test. get_attribute(os, 'fork') get_attribute(os, 'wait4') class Wait4Test(ForkW...
gpl-3.0
amattheisen/crypto
cryptogram.py
1
10268
#!/usr/bin/env python """Cryptogram. Description: This script statistically analyses a line of text to help solve a cryptogram Author: Andrew Mattheisen Usage: cryptogram.py analyze <cyphertext>... cryptogram.py analyze -i <cyphertext>... cryptogram.py sub -f <file> <cyphertext>... cryptogram.py sub -i ...
apache-2.0
abv76/shadowsocks
shadowsocks/lru_cache.py
983
4290
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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...
apache-2.0
jowr/le-logger
webapp/database.py
1
3406
from sqlalchemy import Column, Float, Integer, String, DateTime, ForeignKey from sqlalchemy import create_engine, and_, func from sqlalchemy.dialects import postgresql from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker, relationship, reconstructor import datetime, random im...
gpl-3.0
fingeronthebutton/RIDE
src/robotide/lib/robot/utils/__init__.py
1
3456
# Copyright 2008-2015 Nokia Solutions and Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
moyogo/roboto
scripts/force_yminmax.py
7
1914
#!/usr/bin/python # # 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...
apache-2.0
xcrespo/mbed
workspace_tools/compliance/ioper_runner.py
106
4777
#!/usr/bin/env python2 """ mbed SDK Copyright (c) 2011-2015 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...
apache-2.0
ict-felix/stack
modules/resource/orchestrator/src/core/utils/credentials.py
2
8218
#!/usr/bin/python #---------------------------------------------------------------------- # Copyright (c) 2011 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restricti...
apache-2.0
jkrinke/Praktomat
src/sessionprofile/cleanup_inactive_sessions.py
20
1149
''' Created on Dec 14, 2009 @author: russn ''' import datetime from django.core.management.base import NoArgsCommand from django.contrib.sessions.models import Session from django.db import transaction from sessionprofile.models import SessionProfile class Command(NoArgsCommand): help = """ Thi...
gpl-2.0
userzimmermann/robotframework-python3
doc/quickstart/testlibs/LoginLibrary.py
5
1243
import os import sys import subprocess class LoginLibrary: def __init__(self): self._sut_path = os.path.join(os.path.dirname(__file__), '..', 'sut', 'login.py') self._status = '' def create_user(self, username, password): self._run_command('creat...
apache-2.0
frdb194/django
django/contrib/gis/sitemaps/views.py
341
2421
from __future__ import unicode_literals from django.apps import apps from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.functions import AsKML, Transform from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz from django.core.exceptions import FieldDoesNotExi...
bsd-3-clause
chungy/RetroArch
tools/cg2glsl.py
7
26292
#!/usr/bin/env python3 """ Python 3 script which converts simple RetroArch Cg shaders to modern GLSL (ES) format. Author: Hans-Kristian Arntzen (Themaister) License: Public domain """ import os import errno import subprocess import sys if sys.version_info < (3, 0, 0): sys.stderr.write("You need python 3.0 or lat...
gpl-3.0
provaleks/o8
openerp/addons/base/tests/test_views.py
176
39717
# -*- encoding: utf-8 -*- from functools import partial import itertools import unittest2 from lxml import etree as ET from lxml.builder import E from psycopg2 import IntegrityError from openerp.tests import common import openerp.tools Field = E.field class ViewCase(common.TransactionCase): def setUp(self): ...
agpl-3.0
nikesh-mahalka/nova
nova/tests/unit/api/openstack/compute/test_flavor_access.py
26
20465
# 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
yongshengwang/hue
desktop/core/ext-py/lxml/src/lxml/html/_setmixin.py
94
2488
class SetMixin(object): """ Mix-in for sets. You must define __iter__, add, remove """ def __len__(self): length = 0 for item in self: length += 1 return length def __contains__(self, item): for has_item in self: if item == has_item: ...
apache-2.0
github-account-because-they-want-it/django
django/views/i18n.py
264
12156
import gettext as gettext_module import importlib import json import os from django import http from django.apps import apps from django.conf import settings from django.core.urlresolvers import translate_url from django.template import Context, Engine from django.utils import six from django.utils._os import upath fr...
bsd-3-clause
ivanhorvath/openshift-tools
openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_utils/filter_plugins/openshift_master.py
11
20128
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Custom filters for use in openshift-master ''' import copy import sys from ansible import errors from ansible.parsing.yaml.dumper import AnsibleDumper from ansible.plugins.filter.core import to_bool as ansible_bool from ansible.module_utils.six import string_types, u imp...
apache-2.0
supertom/libcloud
libcloud/test/common/test_runabove.py
27
1181
# 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 use ...
apache-2.0
hongliuliao/simple_server
deps/googletest/googletest/test/gtest_throw_on_failure_test.py
363
5767
#!/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...
apache-2.0
kbase/transform
plugins/scripts/download/trns_transform_KBaseGenomes_ContigSet_to_FASTA_DNA_Assembly.py
2
9922
#!/usr/bin/env python # standard library imports import os import sys import argparse import logging import string # 3rd party imports # None # KBase imports import biokbase.Transform.script_utils as script_utils import biokbase.workspace.client # conversion method that can be called if this module is imported #...
mit
Jgarcia-IAS/SAT
openerp/addons/base_report_designer/wizard/base_report_designer_modify.py
314
6128
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
luisgg/iteexe
installs/osx/make.py
1
1830
#!/usr/bin/env python # a thinly disguised shell script written in Python # import sys import os import getopt import shutil import subprocess os.chdir('../..'); WDIR = os.getcwd() TEMPLATE = os.path.join(WDIR, 'installs/osx', 'exe.dmg') VOL = '/Volumes/exe' OUTPUT = os.path.join(WDIR, 'installs/osx') do_upload = F...
gpl-2.0
romain-dartigues/ansible
lib/ansible/plugins/action/edgeos_config.py
35
4391
# # Copyright 2018 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansibl...
gpl-3.0
kingvuplus/bh-s
lib/python/Screens/EventView.py
21
10394
from Screen import Screen from Screens.TimerEdit import TimerSanityConflict from Screens.MessageBox import MessageBox from Screens.ChoiceBox import ChoiceBox from Components.ActionMap import ActionMap from Components.Button import Button from Components.Label import Label from Components.ScrollLabel import ScrollLabel ...
gpl-2.0
zitouni/gnuradio-3.6.1
gnuradio-core/src/python/gnuradio/gr/qa_single_pole_iir_cc.py
17
3025
#!/usr/bin/env python # # Copyright 2005,2006,2007,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at ...
gpl-3.0
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/tools/grit/grit/format/policy_templates/writers/template_writer.py
9
9599
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class TemplateWriter(object): '''Abstract base class for writing policy templates in various formats. The methods of this clas...
apache-2.0
wemanuel/smry
smry/Crypto/Hash/SHA224.py
124
2851
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
apache-2.0
etherkit/OpenBeacon2
client/macos/venv/lib/python3.8/site-packages/macholib/itergraphreport.py
4
1892
""" Utilities for creating dot output from a MachOGraph """ from collections import deque try: from itertools import imap except ImportError: imap = map __all__ = ["itergraphreport"] def itergraphreport(nodes, describe_edge, name="G"): edges = deque() nodetoident = {} def nodevisitor(node, dat...
gpl-3.0
ahmedaljazzar/edx-platform
openedx/core/djangoapps/embargo/tests/test_models.py
33
13263
"""Test of models for embargo app""" import json from django.test import TestCase from django.db.utils import IntegrityError from opaque_keys.edx.locator import CourseLocator from ..models import ( EmbargoedCourse, EmbargoedState, IPFilter, RestrictedCourse, Country, CountryAccessRule, CourseAccessRuleHistory )...
agpl-3.0
mikewiebe-ansible/ansible
lib/ansible/modules/cloud/google/gcp_sourcerepo_repository_info.py
13
5662
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
laosiaudi/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/kullback_leibler_test.py
11
4873
# 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
QuorateTechnology/pybash
pybash/pybash.py
1
9412
import common import os import re import subprocess import threading # TODO: test with very large data: check memory usage, and compare call vs. simple speeds # TODO: logging # TODO: make fastest version (call vs. simple) default, use argument to use alternate instead of two separate methods class PyBashPipeline(ob...
apache-2.0
alihalabyah/grab
test/ext_text.py
13
2289
# coding: utf-8 from grab import DataNotFound, GrabMisuseError import six from test.util import build_grab from test.util import BaseGrabTestCase HTML = u""" <head> <title>фыва</title> <meta http-equiv="Content-Type" content="text/html; charset=cp1251" /> </head> <body> <div id="bee"> <div class="...
mit
lawrencec/horace
horace/contentNode.py
1
5098
from horace.elements import Elements from horace.exceptions import ElementNotFoundException class ContentNode(object): def __init__(self, driver): self._driver = driver self._content_instances = {} self.initialize_base() def __getattr__(self, item): if item not in self._cont...
mit
lordmuffin/aws-cfn-plex
functions/credstash/docutils/transforms/writer_aux.py
20
2609
# $Id: writer_aux.py 7808 2015-02-27 17:03:32Z milde $ # Author: Lea Wiemann <LeWiemann@gmail.com> # Copyright: This module has been placed in the public domain. """ Auxiliary transforms mainly to be used by Writer components. This module is called "writer_aux" because otherwise there would be conflicting imports lik...
mit
zjuchenyuan/BioWeb
Lib/Bio/SubsMat/__init__.py
1
23884
# Copyright 2000-2009 by Iddo Friedberg. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. # # Iddo Friedberg idoerg@cc.huji.ac.il """Substitution matrices, log odds matrices, and...
mit
Kraymer/beets
test/test_query.py
1
36873
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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 t...
mit
peterperron/speed-dreams-2
src/tools/ceguidemo/menucarselect.py
3
6125
#!/usr/bin/env python # -*- coding: utf-8 -*- """Car selection menu. """ # Import: std import sys import collections # Import: PyCEGUI import PyCEGUI # Import: Configuration from configuration import TheConfig # Import: Menu from menustandard import MenuStandard from menumanager import Men...
gpl-3.0
bayusantoso/final-assignment-web-ontology
IMPLEMENTATION/Application/SourceCode/GOApps/flask/Lib/site-packages/pip/utils/deprecation.py
271
2152
""" A module that implments tooling to enable easy warnings about deprecations. """ from __future__ import absolute_import import logging import warnings class PipDeprecationWarning(Warning): pass class RemovedInPip8Warning(PipDeprecationWarning, PendingDeprecationWarning): pass class RemovedInPip9Warnin...
gpl-3.0
rbbratta/virt-test
libvirt/tests/src/virsh_cmd/domain/virsh_cpu_baseline.py
2
2964
import re, os from autotest.client.shared import error from virttest import virsh from xml.dom.minidom import parseString def run_virsh_cpu_baseline(test, params, env): """ Test command: virsh cpu-baseline. Compute baseline CPU for a set of given CPUs. 1.Get all parameters from configuration. 2.Pr...
gpl-2.0
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/numpy/lib/tests/test_twodim_base.py
36
16684
"""Test functions for matrix module """ from __future__ import division, absolute_import, print_function from numpy.testing import ( TestCase, run_module_suite, assert_equal, assert_array_equal, assert_array_max_ulp, assert_array_almost_equal, assert_raises, rand, ) from numpy import ( arange, rot90,...
mit
justinjoy/cerbero
test/test_cerbero_packages_linux.py
27
7324
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
Benjamin-Dobell/three.js
utils/exporters/blender/addons/io_three/exporter/api/texture.py
97
3680
from bpy import data, types from .. import constants, logger from .constants import IMAGE, MAG_FILTER, MIN_FILTER, MAPPING from . import image def _texture(func): """ :param func: """ def inner(name, *args, **kwargs): """ :param name: :param *args: :param **kwargs: ...
mit
Learningtribes/edx-platform
openedx/core/djangoapps/programs/tests/factories.py
11
1665
"""Factories for generating fake program-related data.""" import factory from factory.fuzzy import FuzzyText class Program(factory.Factory): """ Factory for stubbing program resources from the Programs API (v1). """ class Meta(object): model = dict id = factory.Sequence(lambda n: n) # py...
agpl-3.0
Austin503/pyglet
contrib/scene2d/examples/text_wrap.py
29
1069
#!/usr/bin/env python '''Example of simple text wrapping without using layout. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from pyglet.gl import * from pyglet.window import Window from pyglet.window import key from pyglet import clock from pyglet import font from scene2d.textsprite import * window =...
bsd-3-clause
mancdaz/graphite-buildpackage
webapp/graphite/metrics/views.py
4
9933
"""Copyright 2009 Chris Davis 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 dist...
apache-2.0
ryfeus/lambda-packs
Selenium_PhantomJS/source/setuptools/lib2to3_ex.py
41
2015
""" Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. """ from distutils.util import Mixin2to3 as _Mixin2to3 from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package import setuptools class DistutilsRefactor...
mit
Jmainguy/ansible-modules-extras
network/f5/bigip_sys_db.py
23
5861
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2016 F5 Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
gpl-3.0
cloudify-cosmo/pyvcloud
pyvcloud/sqlair.py
3
2897
# VMware vCloud Python SDK # Copyright (c) 2014 VMware, 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...
apache-2.0
bmcfee/librosa
tests/test_convert.py
2
21343
#!/usr/bin/env python # -*- encoding: utf-8 -*- # CREATED:2015-02-14 19:13:49 by Brian McFee <brian.mcfee@nyu.edu> """Unit tests for time and frequency conversion""" import os import sys try: os.environ.pop("LIBROSA_CACHE_DIR") except KeyError: pass import warnings import librosa import numpy as np import pyt...
isc
nitzmahone/ansible
contrib/inventory/spacewalk.py
42
8719
#!/usr/bin/env python """ Spacewalk external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use...
gpl-3.0
Isendir/rednotebook
tests/test_markup.py
3
3122
import os import re import tempfile from rednotebook.util.markup import convert_to_pango, convert_from_pango, \ convert, _convert_paths def touch(path): with open(path, 'w') as f: # Silence pyflakes. assert(f) def test_pango(): vals = ( (r'--stricken--', '<s>stricken</s>'), ...
gpl-2.0
kalpana-org/kalpana
kalpana/settings.py
1
8718
# Copyright nycz 2011-2020 # This file is part of Kalpana. # Kalpana 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. # Kalpana is di...
gpl-3.0
mm112287/2015cda-24
static/Brython3.1.0-20150301-090019/Lib/_string.py
625
1112
"""string helper module""" import re class __loader__(object): pass def formatter_field_name_split(fieldname): """split the argument as a field name""" _list=[] for _name in fieldname: _parts = _name.split('.') for _item in _parts: is_attr=False #fix me if re....
gpl-3.0
sudheesh001/oh-mainline
vendor/packages/gdata/tests/gdata_tests/client_test.py
39
16933
#!/usr/bin/env python # # Copyright (C) 2008, 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
agpl-3.0
akirk/youtube-dl
youtube_dl/extractor/cinchcast.py
177
1678
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( unified_strdate, xpath_text, ) class CinchcastIE(InfoExtractor): _VALID_URL = r'https?://player\.cinchcast\.com/.*?assetId=(?P<id>[0-9]+)' _TEST = { # Actual test is run in generic,...
unlicense
mick-d/nipype
nipype/algorithms/tests/test_modelgen.py
5
8501
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import division from copy import deepcopy import os from nibabel import Nifti1Image import numpy as np import pytest import numpy.testing as npt from nipype.interf...
bsd-3-clause
Sjc1000/onEVENT
eventparser.py
1
1158
#!/usr/bin/env python3 """ Parse the events. Requires PyYaml. """ import yaml def parse(data): p = yaml.load(data) output = [] for item in p: obj = {'on': None, 'repeat': None, 'action': None, 'delay': None, 'alternative': None, 'iterate': 0} obj['delay'] = item['onEVENT'...
gpl-3.0
map222/spark
python/pyspark/ml/common.py
119
4372
# # 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
vadmium/pacman-arch
test/pacman/tests/sync306.py
23
1479
self.description = "install with recursive/cascading deps" sp = pmpkg("pacman", "4.0.1-2") sp.depends = ["glibc>=2.15", "curl"] self.addpkg2db("sync", sp) glibcdep = pmpkg("glibc", "2.15-1") self.addpkg2db("sync", glibcdep) gcldep = pmpkg("gcc-libs", "4.6.2-5") gcldep.depends = ["glibc>=2.14"] self.addpkg2db("sync",...
gpl-2.0
jaxkodex/odoo
addons/calendar/__init__.py
391
1038
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
ostcar/OpenSlides
server/openslides/assignments/apps.py
6
1834
from django.apps import AppConfig class AssignmentsAppConfig(AppConfig): name = "openslides.assignments" verbose_name = "OpenSlides Assignments" def ready(self): # Import all required stuff. from ..core.signals import permission_change from ..utils.rest_api import router f...
mit
geigerj/api-client-staging
generated/python/googleapis-common-protos/google/api/auth_pb2.py
17
10337
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/api/auth.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection a...
bsd-3-clause
SNAPPETITE/backend
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py
1776
6840
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
NervanaSystems/coach
rl_coach/data_stores/checkpoint_data_store.py
1
4092
# # Copyright (c) 2017 Intel 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 applicable law or agreed to...
apache-2.0
ingadhoc/sale
sale_three_discounts_ux/wizards/sale_order_global_discount_wizard.py
1
1225
############################################################################## # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## from odoo import models, fields class SaleGlobalDiscountWizard(models.T...
agpl-3.0
emmuchira/kps_erp
erpnext/accounts/doctype/payment_entry/test_payment_entry.py
5
10885
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from frappe.utils import flt, nowdate from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order from erpnext.accou...
gpl-3.0
chrisatthestudy/kiwi
kiwi/kiwi.py
1
21286
#!/usr/bin/python # -*- coding: utf-8 -*- """Kiwi Simple static web-site generator Usage: kiwi [SOURCE] [--target TARGET] [--template TEMPLATE] [--sortbyfile|--sortbytitle] [--savefile CONFIG] [-vc] kiwi --version Options: -h --help --versi...
mit
pshc/archipelago
native.py
1
8454
from base import * from bedrock import * from globs import * from hashlib import sha256 from os import system from types_builtin import app_map, subst ModuleMeta = DT('ModuleMeta', ('count', int), ('deps', [str])) SerialState = DT('SerialState', ('file', file), ('hash', None), ('count', int), ...
mit
samuto/Honeybee
src/Honeybee_Read RAD Result.py
1
4406
# # Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari # # This file is part of Honeybee. # # Copyright (c) 2013-2015, Mostapha Sadeghipour Roudsari <Sadeghipour@gmail.com> # Honeybee is free software; you can redistribute it and/or modify # it under the terms of the GNU Ge...
gpl-3.0
xrmx/django
django/contrib/gis/geos/libgeos.py
345
6218
""" This module houses the ctypes initialization procedures, as well as the notice and error handler function callbacks (get called when an error occurs in GEOS). This module also houses GEOS Pointer utilities, including get_pointer_arr(), and GEOM_PTR. """ import logging import os import re from ctypes import CD...
bsd-3-clause
arpadpe/plover
plover/gui/paper_tape.py
1
9043
# Copyright (c) 2013 Hesky Fisher # See LICENSE.txt for details. """A gui display of recent strokes.""" import wx import time from wx.lib.utils import AdjustRectToScreen from collections import deque from plover import system from plover.gui.util import find_fixed_width_font from plover import log TITLE = 'Plover: S...
gpl-2.0
rosarior/mayan
apps/metadata/models.py
2
3987
from __future__ import absolute_import from django.db import models from django.utils.translation import ugettext_lazy as _ from documents.models import Document, DocumentType from .conf.settings import (AVAILABLE_MODELS, AVAILABLE_FUNCTIONS) from .managers import MetadataTypeManager, MetadataSetManager available_m...
gpl-3.0
pataquets/namecoin-core
test/functional/wallet_hd.py
1
14254
#!/usr/bin/env python3 # Copyright (c) 2016-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test Hierarchical Deterministic wallet function.""" import os import shutil from test_framework.test_...
mit
lukecwik/incubator-beam
learning/katas/python/Core Transforms/Combine/Combine PerKey/tests.py
1
1707
# 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"); y...
apache-2.0
alexbruy/QGIS
python/ext-libs/future/libpasteurize/fixes/fix_features.py
61
2679
u""" Warn about features that are not present in Python 2.5, giving a message that points to the earliest version of Python 2.x (or 3.x, if none) that supports it """ from .feature_base import Feature, Features from lib2to3 import fixer_base FEATURES = [ #(FeatureName, # FeaturePattern, # FeatureMinVersio...
gpl-2.0
tacgomes/morph
morphlib/localartifactcache.py
2
6256
# Copyright (C) 2012, 2013, 2014-2015 Codethink Limited # # 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; version 2 of the License. # # This program is distributed in the hope that it will be u...
gpl-2.0
isyippee/nova
nova/tests/unit/objects/test_volume_usage.py
30
3140
# 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...
apache-2.0
patmcb/odoo
addons/event_sale/__openerp__.py
306
2163
# -*- 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
paulharter/fam
src/fam/tests/depricated/test_sync_gateway/_test_view_creation.py
1
4196
from __future__ import absolute_import import unittest import os import time import json import subprocess from fam.database import SyncGatewayWrapper from fam.mapper import ClassMapper from fam.tests.test_sync_gateway.config import * from fam.tests.models.test01 import Cat, Dog, Person from fam.acl.writer import write...
mit
ebbypeter/enso
enso/contrib/scriptotron/tracebacks.py
7
2161
import sys import traceback import xml.sax.saxutils import enso.selection from enso.messages import displayMessage from enso.commands import CommandObject MAX_EXCEPTION_TEXT_LENGTH = 80 def _makeExcInfoMsgText( exceptionType, exception, tb ): fileName, lineNo, funcName, text = traceback.extract_tb( tb )[-1] ...
bsd-3-clause
beblount/Steer-Clear-Backend-Web
env/Lib/site-packages/setuptools/command/upload_docs.py
65
6174
# -*- coding: utf-8 -*- """upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's packages.python.org). """ import os import socket import zipfile import httplib import base64 import urlparse import tempfile import sys from distutils import log from distutils.errors import Distut...
mit