repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
joomel1/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py
680
3709
#!/usr/bin/env python # # Copyright 2011, 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...
bsd-3-clause
jmerkow/VTK
ThirdParty/Twisted/twisted/trial/_dist/test/test_workerreporter.py
35
3765
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.trial._dist.workerreporter}. """ from twisted.python.failure import Failure from twisted.trial.unittest import TestCase, Todo from twisted.trial._dist.workerreporter import WorkerReporter from twisted.trial._dist import ma...
bsd-3-clause
wilebeast/FireFox-OS
B2G/gecko/testing/mozbase/mozprofile/tests/test_nonce.py
8
1384
#!/usr/bin/env python """ test nonce in prefs delimeters see https://bugzilla.mozilla.org/show_bug.cgi?id=722804 """ import os import tempfile import time import unittest from mozprofile.prefs import Preferences from mozprofile.profile import Profile class PreferencesNonceTest(unittest.TestCase): def test_nonce...
apache-2.0
archf/ansible
test/units/modules/network/nxos/test_nxos_bgp_neighbor.py
19
2404
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
CZAlmon/MangaMine
MangaMineBot_Folder/MangaBotDownloader.py
1
57509
#Ver. 0.0.7 #Author: Zach Almon import urllib.request import re import os import platform import sys import string import html import time platformType = platform.system() def Batoto(link_to_manga_site): success = False currentDirectory = os.getcwd() if platformType == 'Windows': MASTERdirecto...
gpl-2.0
jfmartinez64/test
libs/html5lib/trie/datrie.py
785
1166
from __future__ import absolute_import, division, unicode_literals from datrie import Trie as DATrie from six import text_type from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): chars = set() for key in data.keys(): if not isinstance(key, text_type): ...
gpl-3.0
xiaohan2012/lst
dump_vis_timeline_data.py
1
4095
from check_k_best_trees import k_best_trees from meta_graph_stat import MetaGraphStat, build_default_summary_kws_from_path from datetime import datetime from collections import Counter def format_time(dt): if dt.year < 1900: return str(dt) else: return datetime.strftime(dt, '%Y-%m-%d %H:%M:%S'...
mit
PythonCHB/NumpyExtras
cython_src/accumulator.py
1
4171
#!/usr/bin/env python """ accumulator class Designed to be used as an expandable numpy array, to accumulate values, rather than a python list. Note that slices return copies, rather than views, unlike regular numpy arrays. This is so that the buffer can be re-allocated without messing up any views. """ import numpy...
bsd-2-clause
nwjs/chromium.src
third_party/blink/tools/blinkpy/common/system/crash_logs_unittest.py
2
6042
# Copyright (C) 2011 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: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
bsd-3-clause
bsdlp/pugstar
pugstar/__init__.py
3
1546
import logging import os import podhub.meh import steam from flask import Flask from flask.ext.migrate import Migrate, MigrateCommand from flask.ext.openid import OpenID from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.script import Manager from logging import FileHandler from os.path import expanduser from w...
mit
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pygame/tests/sndarray_test.py
6
7264
if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path.split(parent_dir)[1] == 'pygame') if not is_pygame_pkg: sys.path.inser...
gpl-3.0
MurpheyLab/trep
examples/pendulum.py
2
2235
# Simulate an arbitrarily long pendulum. import sys import math import time import trep import trep.potentials import trep.visual as visual links = 5 dt = 0.01 tf = 10.0 def simulate_system(system): # Now we'll extract the current configuration into a tuple to use as # initial conditions for a variational i...
gpl-3.0
chb/indivo_server
indivo/tests/unit/models/record.py
4
5920
from indivo.tests.internal_tests import InternalTests, enable_transactions from indivo.tests.data.account import TEST_ACCOUNTS from indivo.tests.data.record import TEST_RECORDS from indivo.tests.data.app import TEST_USERAPPS from indivo.tests.data.message import TEST_MESSAGES from indivo.models import Record, Carenet, ...
gpl-3.0
WladimirSidorenko/DiscourseSegmenter
dsegmenter/common.py
1
4516
#!/usr/bin/env python2.7 # -*- mode: python; coding: utf-8; -*- ################################################################## # Documentation """Module defining methods common to many modules. Attributes: _ispunct (method): check if word consists only of punctuation characters prune_punc (method): remove tok...
mit
indico/indico
indico/modules/events/models/persons.py
1
17383
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from operator import attrgetter from sqlalchemy.event import listens_for from sqlalchemy.ext.declarative ...
mit
stanford-rc/shine
lib/Shine/Commands/Show.py
2
6964
# Show.py -- Show command # Copyright (C) 2008-2015 CEA # # This file is part of shine # # 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 2 # of the License, or (at your option) an...
gpl-2.0
srisankethu/coala-bears
tests/php/PHPLintBearTest.py
12
1139
import os from queue import Queue from shutil import which from unittest.case import skipIf from bears.php.PHPLintBear import PHPLintBear from coalib.testing.LocalBearTestHelper import LocalBearTestHelper from coalib.settings.Section import Section @skipIf(which('php') is None, 'PHP is not installed') class PHPLintB...
agpl-3.0
seibert/numba
numba/tests/test_indexing.py
2
39577
import decimal import itertools import numpy as np import unittest from numba.core.compiler import compile_isolated, Flags from numba import njit, typeof from numba.core import utils, types, errors from numba.tests.support import TestCase, tag from numba.core.typing import arraydecl from numba.core.types import intp,...
bsd-2-clause
khirayama/bottle
test/test_config.py
13
2574
import unittest from bottle import ConfigDict class TestConfDict(unittest.TestCase): def test_isadict(self): """ ConfigDict should behaves like a normal dict. """ # It is a dict-subclass, so this kind of pointless, but it doen't hurt. d, m = dict(), ConfigDict() d['key'], m['ke...
mit
translate/pootle
pootle/apps/pootle_config/abstracts.py
10
1957
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import collections from jsonfield.fields im...
gpl-3.0
commial/miasm
miasm/core/interval.py
5
8511
from __future__ import print_function INT_EQ = 0 # Equivalent INT_B_IN_A = 1 # B in A INT_A_IN_B = -1 # A in B INT_DISJOIN = 2 # Disjoint INT_JOIN = 3 # Overlap INT_JOIN_AB = 4 # B starts at the end of A INT_JOIN_BA = 5 # A starts at the end of B def cmp_interval(inter1, inter2): """Compare @inter1 and ...
gpl-2.0
avedaee/DIRAC
DataManagementSystem/Agent/RequestOperations/ReplicateAndRegister.py
1
16844
######################################################################## # $HeadURL $ # File: ReplicateAndRegister.py # Author: Krzysztof.Ciba@NOSPAMgmail.com # Date: 2013/03/13 18:49:12 ######################################################################## """ :mod: ReplicateAndRegister =========================...
gpl-3.0
gabrielfalcao/lettuce
tests/integration/lib/Django-1.2.5/tests/modeltests/or_lookups/tests.py
92
7584
from datetime import datetime from operator import attrgetter from django.db.models import Q from django.test import TestCase from models import Article class OrLookupsTests(TestCase): def setUp(self): self.a1 = Article.objects.create( headline='Hello', pub_date=datetime(2005, 11, 27) ...
gpl-3.0
mozilla/captain
vendor/lib/python/django/utils/dates.py
488
2237
"Commonly-used date structures" from django.utils.translation import ugettext_lazy as _, pgettext_lazy WEEKDAYS = { 0:_('Monday'), 1:_('Tuesday'), 2:_('Wednesday'), 3:_('Thursday'), 4:_('Friday'), 5:_('Saturday'), 6:_('Sunday') } WEEKDAYS_ABBR = { 0:_('Mon'), 1:_('Tue'), 2:_('Wed'), 3:_('Thu'), 4:_('Fri')...
mpl-2.0
KDGDev/meizu-mx-kernel
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
FreeAgent/djangoappengine-starter
django/contrib/sites/managers.py
491
1985
from django.conf import settings from django.db import models from django.db.models.fields import FieldDoesNotExist class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the current site." def __init__(self, field_name=None): super(CurrentSiteManager, self).__ini...
bsd-3-clause
art-solopov/mdwiki
wiki/migrations/0006_comment.py
1
1317
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-07-07 16:48 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependen...
mit
Eficent/manufacture
quality_control/models/qc_inspection.py
2
12193
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields, api, exceptions, _ cl...
agpl-3.0
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/rust/runtime/tests/build_model.py
2
2571
#!/usr/bin/env python3 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
apache-2.0
nhomar/odoo
addons/l10n_in_hr_payroll/report/report_payroll_advice.py
374
3442
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
project-hypr/hypr2
hypr/request.py
1
1190
# Copyright 2014-2016 Morgan Delahaye-Prat. All Rights Reserved. # # Licensed under the Simplified BSD License (the "License"); # you may not use this file except in compliance with the License. """Request and related classes.""" import json import asyncio from aiohttp.web_reqrep import Request as BaseRequest clas...
bsd-2-clause
andim/scipy
scipy/io/harwell_boeing/tests/test_hb.py
126
2389
from __future__ import division, print_function, absolute_import import os import sys if sys.version_info[0] >= 3: from io import StringIO else: from StringIO import StringIO import tempfile import numpy as np from numpy.testing import TestCase, assert_equal, \ assert_array_almost_equal_nulp from scipy....
bsd-3-clause
fkolacek/FIT-VUT
bp-revok/python/lib/python2.7/nntplib.py
8
21135
"""An NNTP client class based on RFC 977: Network News Transfer Protocol. Example: >>> from nntplib import NNTP >>> s = NNTP('news') >>> resp, count, first, last, name = s.group('comp.lang.python') >>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last Group comp.lang.python has 51 articles, rang...
apache-2.0
zetaops/ulakbus
ulakbus/services/personel/hitap/hizmet_unvan_getir.py
1
1181
# -*- coding: utf-8 -*- # Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. """HITAP Ünvan Sorgula Hitap üzerinden personelin ünvan bilgilerinin sorgulamasını yapar. """ from ulakbus.services.personel.hitap.hitap_sorgula impo...
gpl-3.0
MihaiMoldovanu/ansible
lib/ansible/modules/storage/netapp/na_cdot_volume.py
28
13714
#!/usr/bin/python # (c) 2017, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
bjsmith/motivation-simulation
ActionModel.py
1
1161
from UnitModel import * __author__ = 'benjaminsmith' """Inherits from UnitModel""" class ActionModel(UnitModel): """Set initial ActionModel.""" def __init__(self,action_name,tendency,value,pos_expectancy,neg_expectancy,pos_val,neg_val,threshold,chaos,persistence): super(ActionModel,self).__init__(actio...
gpl-3.0
xkollar/spacewalk
backend/server/rhnMapping.py
4
1089
# # Copyright (c) 2008--2015 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
anidata/rasp
rasp/tor_engine.py
1
6869
import getpass import os from contextlib import contextmanager from datetime import datetime, timedelta from stem import Signal from stem.connection import connect from rasp.base import DefaultEngine from rasp.errors import ControllerError class TorController(object): """ Attributes: address (str): I...
bsd-3-clause
Endika/odoo
addons/account/report/account_treasury_report.py
385
3872
# -*- 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
iuliat/nova
nova/api/openstack/compute/schemas/v3/evacuate.py
83
1175
# Copyright 2014 NEC Corporation. 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 ...
apache-2.0
feigaochn/leetcode
p745_prefix_and_suffix_search.py
2
1582
class WordFilter: def __init__(self, words): """ :type words: List[str] """ from collections import defaultdict self.prefix = defaultdict(list) self.suffix = defaultdict(list) for wi, word in enumerate(words): for i in range(len(word) + 1): ...
mit
dennybaa/st2
st2common/st2common/util/param.py
2
7537
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
apache-2.0
LukeMurphey/splunk-network-tools
tests/selenium/webdriver/support/abstract_event_listener.py
61
2033
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
openstack/taskflow
taskflow/tests/unit/worker_based/test_executor.py
2
13622
# -*- coding: utf-8 -*- # Copyright (C) 2014 Yahoo! 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...
apache-2.0
brunogamacatao/portalsaladeaula
django/core/cache/backends/memcached.py
16
3551
"Memcached cache backend" import time from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError from django.utils.encoding import smart_unicode, smart_str try: import cmemcache as memcache import warnings warnings.warn( "Support for the 'cmemcache' library has been deprecate...
bsd-3-clause
2ndQuadrant/ansible
lib/ansible/modules/storage/netapp/netapp_e_global.py
52
4992
#!/usr/bin/python # (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
sdarji/lpthw
Lib/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.py
310
12909
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import gettext _ = gettext.gettext try: from functools import reduce except ImportError: pass from ..constants import voidElements, booleanAttributes, spaceCharacters from ..constants import rcdataElement...
unlicense
gpitel/pyjs
examples/showcase/src/demos_panels/tabPanel.py
13
1600
""" The ``ui.TabPanel`` class implements a tabbed window, where clicking on a tab causes the associated contents to be displayed. The TabPanel relies heavily on cascading stylesheet definitions to operate. The following stylesheet definitions are used by the example shown below: .gwt-TabPanel { } .gwt-Ta...
apache-2.0
mickael-guene/binutils
gdb/testsuite/gdb.python/py-bad-printers.py
7
2584
# Copyright (C) 2008-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
alexlib/openpiv-python
setup.py
2
1786
from os import path from setuptools import setup, find_packages # read the contents of your README file this_directory = path.abspath(path.dirname(__file__)) # with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_d...
gpl-3.0
Grirrane/odoo
addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py
8
6789
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
etkirsch/legends-of-erukar
erukar/system/engine/commands/TargetedCommand.py
1
1711
from erukar.system.engine import Interaction from .Command import Command from .CommandResult import CommandResult class TargetedCommand(Command): def process_args(self): if not self.args: raise Exception('Cannot process args -- Command\'s args are undefined') if 'interaction' in self...
agpl-3.0
livc/Paddle
benchmark/tensorflow/rnn/rnn_multi_gpu.py
21
12436
#!/usr/bin/env python from six.moves import xrange # pylint: disable=redefined-builtin import re import math import time import numpy as np from datetime import datetime import reader import tensorflow as tf from tensorflow.python.ops import rnn FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_integer('batch_size', 6...
apache-2.0
alvin319/CarnotKE
jyhton/lib-python/2.7/distutils/tests/test_check.py
81
4050
# -*- encoding: utf8 -*- """Tests for distutils.command.check.""" import unittest from test.test_support import run_unittest from distutils.command.check import check, HAS_DOCUTILS from distutils.tests import support from distutils.errors import DistutilsSetupError class CheckTestCase(support.LoggingSilencer, ...
apache-2.0
ashione/bamslips
task/fund_realtime_net_unit.py
1
1294
from apscheduler.schedulers.blocking import BlockingScheduler from bamslips.fund.fund_realtime_info import paralle_get_fund_realtime_info_according_fund_code from bamslips.conf.fund_code_list import code_list sched = BlockingScheduler() #@sched.scheduled_job('cron',id='fund_realtime_fun_info_job',hour='0-4,9-16,21-2...
gpl-3.0
arunkgupta/gramps
gramps/webapp/grampsdb/view/note.py
1
5867
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com> # # 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 2 of the L...
gpl-2.0
icomms/wqmanager
reportlab/graphics/samples/bubble.py
7
3570
#Autogenerated by ReportLab guiedit do not edit from reportlab.graphics.charts.legends import Legend from reportlab.graphics.charts.lineplots import ScatterPlot from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String from reportlab.graphics.charts.textlabels import Label from excelcolors import * cl...
bsd-3-clause
sebastic/QGIS
python/ext-libs/yaml/nodes.py
985
1440
class Node(object): def __init__(self, tag, value, start_mark, end_mark): self.tag = tag self.value = value self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): value = self.value #if isinstance(value, list): # if len(value) == 0: ...
gpl-2.0
readbeyond/aeneas
aeneas/syncmap/fragmentlist.py
5
31617
#!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it) # Copyright (C) 2015-2017, A...
agpl-3.0
vxgmichel/asyncio
asyncio/windows_utils.py
37
6844
""" Various Windows specific bits and pieces """ import sys if sys.platform != 'win32': # pragma: no cover raise ImportError('win32 only') import _winapi import itertools import msvcrt import os import socket import subprocess import tempfile import warnings __all__ = ['socketpair', 'pipe', 'Popen', 'PIPE', '...
apache-2.0
totollo/CocosBuilder-X
CocosBuilder-X/libs/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
149
42289
# 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. """ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. """ import gyp.common import os.p...
mit
zstyblik/infernal-twin
build/pillow/PIL/IcnsImagePlugin.py
26
10597
# # The Python Imaging Library. # $Id$ # # Mac OS X icns file decoder, based on icns.py by Bob Ippolito. # # history: # 2004-10-09 fl Turned into a PIL plugin; removed 2.3 dependencies. # # Copyright (c) 2004 by Bob Ippolito. # Copyright (c) 2004 by Secret Labs. # Copyright (c) 2004 by Fredrik Lundh. # Copyright (c) ...
gpl-3.0
Architektor/PySnip
venv/lib/python2.7/site-packages/Cython/Tests/TestCodeWriter.py
132
2316
from Cython.TestUtils import CythonTest class TestCodeWriter(CythonTest): # CythonTest uses the CodeWriter heavily, so do some checking by # roundtripping Cython code through the test framework. # Note that this test is dependant upon the normal Cython parser # to generate the input trees to the CodeW...
gpl-3.0
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/GLX/SGIX/dmbuffer.py
8
3287
'''OpenGL extension SGIX.dmbuffer This module customises the behaviour of the OpenGL.raw.GLX.SGIX.dmbuffer to provide a more Python-friendly API Overview (from the spec) This extension introduces a new type of GLXPbuffer, a DM or Digital Media pbuffer. A DM pbuffer is a GLXPbuffer that adopts one or more of ...
lgpl-3.0
google/llvm-propeller
lldb/test/API/commands/expression/persistent_variables/TestPersistentVariables.py
2
1993
""" Test that lldb persistent variables works correctly. """ import lldb from lldbsuite.test.lldbtest import * class PersistentVariablesTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def test_persistent_variables(self): """Test that lldb persistent variables works correctly.""" ...
apache-2.0
adambain-vokal/django-rest-framework
rest_framework/pagination.py
13
27736
# coding: utf-8 """ Pagination serializers determine the structure of the output that should be used for paginated responses. """ from __future__ import unicode_literals import warnings from base64 import b64decode, b64encode from collections import namedtuple from django.core.paginator import Paginator as DjangoPagi...
bsd-2-clause
lilydjwg/you-get
src/you_get/util/fs.py
26
1053
#!/usr/bin/env python import platform def legitimize(text, os=platform.system()): """Converts a string to a valid filename. """ # POSIX systems text = text.translate({ 0: None, ord('/'): '-', }) if os == 'Windows': # Windows (non-POSIX namespace) text = text.t...
mit
EDUlib/eTracesX
Translation_software/edx_to_MOOCdb_piping/import.openedx.apipe/scripts/lookupOpenEdxHash.py
1
1241
#!/usr/bin/env python import os import sys # Command line tool to look up the human readable strings that # correspond to edX platform generated hash strings for problems and # videos. The given strings may be just the 32 bit hex numbers, or the # long strings in tracking logs that contain that hex number somewhere ...
agpl-3.0
FinnStutzenstein/OpenSlides
server/openslides/assignments/serializers.py
3
6716
from openslides.poll.serializers import ( BASE_OPTION_FIELDS, BASE_POLL_FIELDS, BASE_VOTE_FIELDS, BaseOptionSerializer, BasePollSerializer, BaseVoteSerializer, ) from openslides.utils.rest_api import ( BooleanField, DecimalField, IdPrimaryKeyRelatedField, IntegerField, ModelS...
mit
matrixise/odoo
addons/account/account_cash_statement.py
283
15868
# encoding: utf-8 ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # i...
agpl-3.0
gordon-/naobot
plugins/learn.py
2
3503
# -*- coding: utf-8 -*- from stdPlugin import stdPlugin from lib.markov import Markov class learn(stdPlugin): u'''Apprend continuellement les mots utilisés sur un canal, et génère des phrases aléatoires et stupides. ''' events = {'pubmsg': {'exclusive': False, 'command_namespace': 'say'}, ...
agpl-3.0
ofrobots/grpc
src/python/grpcio_health_checking/grpc/health/__init__.py
1496
1530
# Copyright 2015, 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...
bsd-3-clause
zooba/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32/lib/win32rcparser.py
6
21179
# Windows dialog .RC file parser, by Adam Walker. # This module was adapted from the spambayes project, and is Copyright # 2003/2004 The Python Software Foundation and is covered by the Python # Software Foundation license. """ This is a parser for Windows .rc files, which are text files which define dialogs and other...
apache-2.0
sgerhart/ansible
lib/ansible/modules/storage/zfs/zfs.py
55
9554
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Johan Wiren <johan.wiren.se@gmail.com> # Copyright: (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 absolute_import, division, print_function __metaclass__ = t...
mit
nxnfufunezn/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/mux_client_for_testing.py
457
25761
#!/usr/bin/env python # # 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...
mpl-2.0
adrianmugnoz/Documentacion-Divulgame
readthedocs/core/templatetags/core_tags.py
3
2737
import urllib import hashlib from django import template from django.conf import settings from django.utils.safestring import mark_safe from django.utils.encoding import force_bytes, force_text from builds.models import Version from projects.models import Project register = template.Library() @register.filter def ...
mit
pongem/python-bot-project
kms/api-client/snippets_test.py
1
5588
#!/usr/bin/env python # Copyright 2017 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 applicable law or...
apache-2.0
theflofly/tensorflow
tensorflow/contrib/learn/python/learn/estimators/test_data.py
42
2180
# 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
valmynd/MediaFetcher
src/plugins/youtube_dl/youtube_dl/extractor/ninenow.py
1
2762
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, float_or_none, smuggle_url, ) class NineNowIE(InfoExtractor): IE_NAME = '9now.com.au' _VALID_URL = r'https?://(?:www\.)?9now\.com\.au/(?:[...
gpl-3.0
ojengwa/django-1
tests/model_inheritance/models.py
99
4729
""" XX. Model inheritance Model inheritance exists in two varieties: - abstract base classes which are a way of specifying common information inherited by the subclasses. They don't exist as a separate model. - non-abstract base classes (the default), which are models in their own right with ...
bsd-3-clause
lucernae/geonode
geonode/layers/views.py
2
54490
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
codehs/closure-linter-for-everybody
closure_linter/common/position.py
285
3324
#!/usr/bin/env python # # Copyright 2008 The Closure Linter 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 #...
apache-2.0
lukeiwanski/tensorflow-opencl
tensorflow/contrib/distributions/__init__.py
6
5042
# 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
100star/h2o
py/testdir_single_jvm/test_KMeans_enum_fvec.py
9
2335
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i import h2o_kmeans, h2o_exec as h2e def write_syn_dataset(csvPathname, rowCount, colCount, SEED): r1 = random.Random(SEED) dsf = open(csvPathname, "w+") for i in range(rowCo...
apache-2.0
tri2sing/LinearAlgebraPython
submit_machine_learning_lab.py
3
17643
# version code 1049 ######## ######## # Hi there, curious student. # # # # This submission script runs some tests on your # # code and then uploads it to Coursera for grading. # # ...
apache-2.0
jsoref/django
tests/validation/test_error_messages.py
398
3642
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from unittest import TestCase from django.core.exceptions import ValidationError from django.db import models class ValidationMessagesTest(TestCase): def _test_validation_messages(self, field, value, expected): with self.assertRaises(Val...
bsd-3-clause
lalrae/qemu
tests/qemu-iotests/nbd-fault-injector.py
127
8350
#!/usr/bin/env python # NBD server - fault injection utility # # Configuration file syntax: # [inject-error "disconnect-neg1"] # event=neg1 # io=readwrite # when=before # # Note that Python's ConfigParser squashes together all sections with the same # name, so give each [inject-error] a unique name. # # inject-...
gpl-2.0
dgarage/bc2
contrib/linearize/linearize-hashes.py
27
4579
#!/usr/bin/env python3 # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ impo...
mit
adamjermyn/AstroMicroPhysics
sourceClass.py
1
14504
from scipy.interpolate import RegularGridInterpolator, RectBivariateSpline, interp1d from scipy.ndimage.filters import gaussian_filter, minimum_filter import numpy as np class source: """ An object which wraps equation of state tables and functions. """ def __init__(self, inNames, outNames, contains, smoothMask,...
gpl-2.0
treebuilder/s3-mining
s3.py
1
1359
#!/usr/bin/env python import requests import sys url = 'https://s3.amazonaws.com/' name = sys.argv[1].strip() common = ['test','dev','bucket','s3','aws','prd','prod','pub','public','production','development','testing','archive','backup','web','devops','sec','secure','hidden','secret','staging','download'] connectors ...
apache-2.0
billyhunt/osf.io
scripts/tests/test_migrate_mailing_lists_to_mailchimp_field.py
40
1354
from nose.tools import * from tests.base import OsfTestCase from tests.factories import UserFactory from scripts.migration.migrate_mailing_lists_to_mailchimp_field import main, get_users_with_no_mailchimp_mailing_lists class TestMigrateMailingLists(OsfTestCase): def setUp(self): super(TestMigrateMailingL...
apache-2.0
evgchz/scikit-learn
sklearn/linear_model/ransac.py
16
13870
# coding: utf-8 # Author: Johannes Schönberger # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone from ..utils import check_random_state, check_array, check_consistent_length from ..utils.random import sample_without_replacement from .base import ...
bsd-3-clause
darren-wang/gl
glance/tests/unit/common/test_scripts.py
20
1442
# Copyright 2014 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
wendellpbarreto/dolly
node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
1366
120842
# 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. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
mit
openworm/tracker-commons
src/Python/wcon/wcon_parser.py
3
28807
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Methods ------------ reject_duplicates Classes ------------ WCONWorms """ import six import warnings from collections import OrderedDict from six import StringIO from os import path import os import shutil import json import jsonschema import zipfile import numpy as n...
mit
mnunberg/couchbase-python-client
txcouchbase/tests/test_txconn.py
1
2526
# Copyright 2013, Couchbase, 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...
apache-2.0
winklerand/pandas
pandas/tests/test_resample.py
1
135497
# pylint: disable=E1101 from warnings import catch_warnings from datetime import datetime, timedelta from functools import partial from textwrap import dedent import pytz import pytest import dateutil import numpy as np import pandas as pd import pandas.tseries.offsets as offsets import pandas.util.testing as tm imp...
bsd-3-clause
phoenixsbk/kvmmgr
packaging/setup/ovirt_engine_setup/engine/constants.py
1
18900
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2014-2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
apache-2.0
ProfessorKaos64/openlierox
tools/DedicatedServerVideo/gdata/finance/service.py
261
8974
#!/usr/bin/python # # Copyright (C) 2009 Tan Swee Heng # # 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 la...
lgpl-2.1
hnakamur/django
tests/generic_views/views.py
286
7527
from __future__ import unicode_literals from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator from django.core.urlresolvers import reverse, reverse_lazy from django.utils.decorators import method_decorator from django.views import generic from .models import Artist, Aut...
bsd-3-clause