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
ldgarcia/django-allauth
allauth/socialaccount/providers/xing/tests.py
62
1975
# -*- coding: utf-8 -*- from __future__ import unicode_literals from allauth.socialaccount.tests import create_oauth_tests from allauth.tests import MockedResponse from allauth.socialaccount.providers import registry from .provider import XingProvider class XingTests(create_oauth_tests(registry.by_id(XingProvider.i...
mit
robin900/sqlalchemy
examples/vertical/dictlike.py
30
5034
"""Mapping a vertical table as a dictionary. This example illustrates accessing and modifying a "vertical" (or "properties", or pivoted) table via a dict-like interface. These are tables that store free-form object properties as rows instead of columns. For example, instead of:: # A regular ("horizontal") table h...
mit
jbarcia/weevely3
testsuite/test_file_gzip.py
14
5299
from testsuite.base_test import BaseTest from core import modules from core.sessions import SessionURL from testfixtures import log_capture from core import messages import logging import config import os class FileGzip(BaseTest): def setUp(self): session = SessionURL(self.url, self.password, volatile = T...
gpl-3.0
paeaetech/pybp
pybp.py
1
21540
# -*- coding: utf-8 -*- # Pybp interface to BusPirate # Copyright (C) 2010 Paeae Technologies # # 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 o...
gpl-3.0
facebook/buck
programs/test_buck_tool.py
5
7418
# Copyright (c) Facebook, Inc. and its affiliates. # # 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
Novasoft-India/OperERP-AM-Motors
openerp/addons/marketing/__openerp__.py
55
1677
# -*- 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
Davideddu/karaokivy
chardet/mbcsgroupprober.py
236
1889
######################## 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...
gpl-3.0
Tritlo/Nannon
Board.py
1
5373
class Board: """Class that implements the Nannon Board""" board = None #: The current state of the board home = lambda self,x: 0 if x == -1 else 7 #: Function that says what is home for black and white safety = lambda self,x: 7 if x == -1 else 0 #: Function that states what is safety for black and white...
gpl-3.0
douggeiger/gnuradio
gnuradio-runtime/python/gnuradio/gru/msgq_runner.py
94
2529
# # Copyright 2009 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 your option) # any later version. # #...
gpl-3.0
sandan/sqlalchemy
test/orm/test_lazy_relations.py
10
35919
"""basic tests of lazy loaded attributes""" from sqlalchemy.testing import assert_raises import datetime from sqlalchemy.orm import attributes, exc as orm_exc, configure_mappers import sqlalchemy as sa from sqlalchemy import testing, and_ from sqlalchemy import Integer, String, ForeignKey, SmallInteger, Boolean from s...
mit
asadziach/tensorflow
tensorflow/python/kernel_tests/string_to_hash_bucket_op_test.py
134
4034
# Copyright 2015 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
omnirom/android_external_chromium-org
third_party/cython/src/Cython/Compiler/StringEncoding.py
97
9235
# # Cython -- encoding related tools # import re import sys if sys.version_info[0] >= 3: _unicode, _str, _bytes = str, str, bytes IS_PYTHON3 = True else: _unicode, _str, _bytes = unicode, str, str IS_PYTHON3 = False empty_bytes = _bytes() empty_unicode = _unicode() join_bytes = empty_bytes.join c...
bsd-3-clause
mjuric/duplicity
duplicity/cached_ops.py
6
1652
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2012 Google Inc. # # This file is part of duplicity. # # Duplicity 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...
gpl-2.0
ujjvala-addsol/addsol_hr
openerp/addons/delivery/partner.py
383
1404
# -*- 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
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/matplotlib/tests/test_arrow_patches.py
7
1799
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import matplotlib.pyplot as plt from matplotlib.testing.decorators import image_comparison import matplotlib def draw_arrow(ax, t, r): ax.annotate('', xy=(0.5, 0.5 + ...
mit
cschnei3/forseti-security
google/cloud/security/common/util/email_util.py
2
6349
# 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 agreed to in writing, s...
apache-2.0
mlperf/inference_results_v0.7
closed/Gigabyte/code/common/accuracy.py
13
3141
# Copyright (c) 2020, NVIDIA 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 by appli...
apache-2.0
hall-lab/svtools
tests/lsort_tests.py
2
3857
from unittest import TestCase, main import tempfile import os import sys import difflib import svtools.lsort as lsort class Test_lsort(TestCase): def test_parser(self): parser = lsort.command_parser() args = parser.parse_args('file1 file2 file3'.split()) self.assertEqual(args.vcf_files, ['...
mit
alimuldal/numpy
numpy/lib/_iotools.py
72
32062
"""A collection of functions designed to help I/O with ascii files. """ from __future__ import division, absolute_import, print_function __docformat__ = "restructuredtext en" import sys import numpy as np import numpy.core.numeric as nx from numpy.compat import asbytes, bytes, asbytes_nested, basestring if sys.vers...
bsd-3-clause
macs03/demo-cms
cms/bin/pilfont.py
1
1058
#!/Users/miguelcardenas/Desktop/demo-cms/cms/bin/python # # The Python Imaging Library # $Id$ # # PIL raster font compiler # # history: # 1997-08-25 fl created # 2002-03-10 fl use "from PIL import" # from __future__ import print_function VERSION = "0.4" import glob, sys # drivers from PIL import BdfFontFile fro...
mit
mwoehlke/gtest
scripts/upload.py
2511
51024
#!/usr/bin/env python # # Copyright 2007 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 o...
bsd-3-clause
etos/django
django/core/management/commands/test.py
25
2292
import sys from django.conf import settings from django.core.management.base import BaseCommand from django.test.utils import get_runner class Command(BaseCommand): help = 'Discover and run tests in the specified modules or the current directory.' # DiscoverRunner runs the checks after databases are set up....
bsd-3-clause
ruud-v-a/servo
python/mach/mach/mixin/process.py
124
6762
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # This module provides mixins to perform process execution. from __future__ import absolute_import, unicode_literals i...
mpl-2.0
alexthered/kienhoc-platform
common/djangoapps/session_inactivity_timeout/middleware.py
228
1981
""" Middleware to auto-expire inactive sessions after N seconds, which is configurable in settings. To enable this feature, set in a settings.py: SESSION_INACTIVITY_TIMEOUT_IN_SECS = 300 This was taken from StackOverflow (http://stackoverflow.com/questions/14830669/how-to-expire-django-session-in-5minutes) """ fro...
agpl-3.0
races1986/SafeLanguage
CEM/pywikibot/exceptions.py
5
3668
# -*- coding: utf-8 -*- """ Exception classes used throughout the framework. """ # # (C) Pywikipedia bot team, 2008 # # Distributed under the terms of the MIT license. # __version__ = '$Id: 9f2eb10c50ec43d917bd9b4af68f85dd9afdb0c9 $' # Application specific imports import config # TODO: not certain that all of them ...
epl-1.0
AnthonyMRios/pymetamap
pymetamap/SubprocessBackendLite.py
1
5539
# 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 # distributed under the Li...
apache-2.0
naiquevin/lookupy
lookupy/tests.py
1
14908
""" lookupy.tests ~~~~~~~~~~~~~ This module contains tests for the lookupy module written using nose to be run using:: $ nosetests -v """ import re from nose.tools import assert_list_equal, assert_equal, assert_raises from .lookupy import filter_items, lookup, include_keys, Q, QuerySet, \ Co...
mit
legscoin/legscoin
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
LeartS/odoo
addons/point_of_sale/wizard/pos_box.py
381
2211
from openerp.osv import osv from openerp.tools.translate import _ from openerp.addons.account.wizard.pos_box import CashBox class PosBox(CashBox): _register = False def run(self, cr, uid, ids, context=None): if not context: context = dict() active_model = context.get('active_mod...
agpl-3.0
basicthinker/Sexain-MemController
gem5-stable/src/mem/slicc/generate/html.py
91
3325
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
apache-2.0
joopert/home-assistant
homeassistant/components/automation/device.py
2
1042
"""Offer device oriented automation.""" import voluptuous as vol from homeassistant.components.device_automation import ( TRIGGER_BASE_SCHEMA, async_get_device_automation_platform, ) from homeassistant.const import CONF_DOMAIN # mypy: allow-untyped-defs, no-check-untyped-defs TRIGGER_SCHEMA = TRIGGER_BASE_S...
apache-2.0
moreati/django
tests/auth_tests/test_management.py
116
27025
from __future__ import unicode_literals import locale import sys from datetime import date from django.apps import apps from django.contrib.auth import management, models from django.contrib.auth.checks import check_user_model from django.contrib.auth.management import create_permissions from django.contrib.auth.mana...
bsd-3-clause
brentdax/swift
utils/cmpcodesize/tests/test_list_function_sizes.py
60
1154
# test_list_function_sizes.py - list_function_sizes unit tests -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt...
apache-2.0
thenewguy/wagtail
wagtail/wagtailforms/models.py
6
6555
import json import re from six import text_type from unidecode import unidecode from django.db import models from django.shortcuts import render from django.utils.translation import ugettext_lazy as _ from django.utils.text import slugify from django.utils.encoding import python_2_unicode_compatible from wagtail.wa...
bsd-3-clause
GoogleCloudPlatform/deploymentmanager-autogen
javatests/com/google/cloud/deploymentmanager/autogen/testdata/singlevm/full_features2/golden/common/common.py
7
7308
# Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
tempbottle/dlr
Src/Hosts/Silverlight/Tests/tests/manual/test_s_fractulator/verification.py
2
1111
from SL_util import * import time sl = SilverlightDLRTest(2) def verify_1st(): sl.verify_exact('frac([123,1]) + frac([45,65])', HtmlPage.Document.formattedExpression.innerHTML) sl.verify_exact('None', HtmlPage.Document.result.innerHTML) sl.verify_exact('frac([123,1]) + frac([45,65])', HtmlPage.Document.eva...
apache-2.0
tkelman/utf8rewind
tools/converter/blns.py
1
8064
import datetime import os.path import re import sys import libs.header def codepointToHexadecimalWideUtf16(codepoint, wroteHex = False): result = '' if codepoint <= 0x7F: conversion = { 0x00: "\\0", 0x07: "\\a", 0x08: "\\b", 0x09: "\\t", 0x0A: "\\n", 0x0B: "\\v", 0x0C: "\\f", 0x0D: "\\r",...
mit
cpollard1001/FreeCAD_sf_master
src/Mod/Spreadsheet/App/Spreadsheet_legacy.py
25
43880
#*************************************************************************** #* * #* Copyright (c) 2013 - Yorik van Havre <yorik@uncreated.net> * #* * #* This pr...
lgpl-2.1
ForensicArtifacts/artifacts
tests/reader_test.py
3
12848
# -*- coding: utf-8 -*- """Tests for the artifact definitions readers.""" from __future__ import unicode_literals import io import unittest import yaml from artifacts import definitions from artifacts import errors from artifacts import reader from tests import test_lib class YamlArtifactsReaderTest(test_lib.Base...
apache-2.0
oczkers/gdown
gdown/modules/mediafire.py
1
3909
# -*- coding: utf-8 -*- """ gdown.modules.mediafire ~~~~~~~~~~~~~~~~~~~ This module contains handlers for mediafire. """ import re import time from hashlib import sha1 from dateutil import parser from requests.exceptions import ConnectionError # TODO?: import connection errors into gdown from simplejson.scanner im...
gpl-3.0
greg-hellings/cinch
cinch/bin/entry_point.py
1
3680
#!/usr/bin/env python from __future__ import print_function from argparse import ArgumentParser, REMAINDER from os import getcwd, path from wrappers import call_ansible, call_linchpin import sys def cinch_generic(playbook): # Parse the command line arguments parser = ArgumentParser(description='A wrapper aro...
gpl-3.0
TridevGuha/django
tests/field_deconstruction/tests.py
3
18388
from __future__ import unicode_literals from django.apps import apps from django.db import models from django.test import SimpleTestCase, override_settings from django.test.utils import isolate_lru_cache from django.utils import six class FieldDeconstructionTests(SimpleTestCase): """ Tests the deconstruct() ...
bsd-3-clause
FlintHill/SUAS-Competition
env/lib/python2.7/site-packages/setuptools/command/install.py
529
4683
from distutils.errors import DistutilsArgError import inspect import glob import warnings import platform import distutils.command.install as orig import setuptools # Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for # now. See https://github.com/pypa/setuptools/issues/199/ _install = orig.in...
mit
Shaps/ansible
lib/ansible/plugins/filter/urls.py
97
1865
# -*- coding: utf-8 -*- # Copyright: (c) 2012, Dag Wieers (@dagwieers) <dag@wieers.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 from ansible.module_utils.six import PY3, iteritem...
gpl-3.0
tino/django-contact-form
contact_form/views.py
3
3283
""" View which can render and send email from a contact form. """ from django.shortcuts import render_to_response, redirect from django.template import RequestContext from contact_form.forms import ContactForm def contact_form(request, form_class=ContactForm, template_name='contact_form/contact_for...
bsd-3-clause
kprkpr/kernel-e400
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py
650
1701
# urllib3/__init__.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (a...
gpl-2.0
duyetdev/islab-portfolio-by-ghost
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/hdl.py
363
16209
# -*- coding: utf-8 -*- """ pygments.lexers.hdl ~~~~~~~~~~~~~~~~~~~ Lexers for hardware descriptor languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, include, using, t...
mit
FICTURE7/youtube-dl
youtube_dl/extractor/gameone.py
208
4519
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( xpath_with_ns, parse_iso8601, float_or_none, int_or_none, ) NAMESPACE_MAP = { 'media': 'http://search.yahoo.com/mrss/', } # URL prefix to download the mp4 files directly inst...
unlicense
iegor/kdeutils
superkaramba/examples/control_management/mgmt.py
4
1338
# # Written by Luke Kenneth Casson Leighton <lkcl@lkcl.net> #this import statement allows access to the karamba functions import karamba do_nothing_txt = None mgmt_txt = None #this is called when you widget is initialized def initWidget(widget): global do_nothing_txt global do_something_txt # display new messa...
gpl-2.0
rlindner81/pyload
module/lib/beaker/synchronization.py
48
11755
"""Synchronization functions. File- and mutex-based mutual exclusion synchronizers are provided, as well as a name-based mutex which locks within an application based on a string name. """ import os import sys import tempfile try: import threading as _threading except ImportError: import dummy_threading as ...
gpl-3.0
sameetb-cuelogic/edx-platform-test
lms/djangoapps/survey/tests/test_views.py
62
5051
""" Python tests for the Survey views """ import json from collections import OrderedDict from django.test.client import Client from django.contrib.auth.models import User from django.core.urlresolvers import reverse from survey.models import SurveyForm from xmodule.modulestore.tests.factories import CourseFactory ...
agpl-3.0
cortesi/mitmproxy
pathod/language/writer.py
12
2141
import time from mitmproxy import exceptions BLOCKSIZE = 1024 # It's not clear what the upper limit for time.sleep is. It's lower than the # maximum int or float. 1 year should do. FOREVER = 60 * 60 * 24 * 365 def send_chunk(fp, val, blocksize, start, end): """ (start, end): Inclusive lower bound, exclus...
mit
polyval/CNC
flask/Lib/encodings/cp737.py
593
34937
""" Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict...
apache-2.0
analurandis/Tur
backend/venv/Lib/site-packages/pygments/lexers/felix.py
72
9410
# -*- coding: utf-8 -*- """ pygments.lexers.felix ~~~~~~~~~~~~~~~~~~~~~ Lexer for the Felix language. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups, default, words, \ comb...
mit
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/html5lib/_tokenizer.py
385
76580
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import unichr as chr from collections import deque from .constants import spaceCharacters from .constants import entities from .constants import asciiLetters, asciiUpper2Lower from .constants import digits, hexDigits, EOF from .c...
gpl-3.0
Andypsamp/CODjunit
beets/art.py
14
6851
# This file is part of beets. # Copyright 2015, 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 the rights to use, copy, ...
mit
hawk78/pyrpcgen
rpc/rpcsec/base.py
1
1071
from rpc.rpc_const import AUTH_NONE from rpc.rpc_type import opaque_auth class SecError(Exception): pass class SecFlavor(object): _none = opaque_auth(AUTH_NONE, '') def initialize(self, client): pass def secure_data(self, data, seqnum): """Filter procedure arguments before sendin...
gpl-2.0
DLR-SC/RepoGuard
src/repoguard/checks/pylint_.py
2
3430
# pylint: disable-msg=W0232,R0903,C0103 # Copyright 2008 German Aerospace Center (DLR) # # 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 # # U...
apache-2.0
mlperf/training_results_v0.5
v0.5.0/google/cloud_v3.8/gnmt-tpuv3-8/code/gnmt/model/t2t/tensor2tensor/data_generators/algorithmic_math_test.py
3
3060
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
alexis-roche/nireg
nireg/tests/test_fmri_realign4d.py
2
10533
from __future__ import absolute_import # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import warnings from nose.tools import assert_equal from numpy.testing import (assert_array_almost_equal, assert_array_equal, ...
bsd-3-clause
philoniare/horizon
openstack_dashboard/dashboards/admin/volumes/volume_types/tests.py
16
9761
# 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 # distributed under the ...
apache-2.0
venumech/cookiecutter
tests/test_generate_hooks.py
27
4438
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_generate_hooks ------------------- Tests formerly known from a unittest residing in test_generate.py named TestHooks.test_ignore_hooks_dirs TestHooks.test_run_python_hooks TestHooks.test_run_python_hooks_cwd TestHooks.test_run_shell_hooks """ from __future__ imp...
bsd-3-clause
lepinkainen/pyfibot
pyfibot/modules/available/module_expl.py
1
4422
# -*- encoding: utf-8 -*- import os import os.path import sys import re import random import fnmatch def expl_parseterm(expl): expl = expl.split(" ") expl = expl[0] expl = expl.lower() expl = expl.strip() invalidchars = re.compile(r"[^a-z0-9\ :\.-]") expl = invalidchars.sub("_", expl) ret...
bsd-3-clause
leansoft/edx-platform
lms/djangoapps/certificates/tests/tests.py
87
4494
""" Tests for the certificates models. """ from ddt import ddt, data, unpack from mock import patch from django.conf import settings from nose.plugins.attrib import attr from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from student.te...
agpl-3.0
mancoast/CPythonPyc_test
cpython/253_test_rgbimg.py
19
1847
# Testing rgbimg module import warnings warnings.filterwarnings("ignore", "the rgbimg module is deprecated", DeprecationWarning, ".*test_rgbimg$") import rgbimg import os, uu from test.test_support import verbose, unlink, findfile class error(E...
gpl-3.0
gylian/sickbeard
sickbeard/history.py
35
2768
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
races1986/SafeLanguage
CEM/login.py
1
17748
#!/usr/bin/python # -*- coding: utf-8 -*- """ Script to log the robot in to a wiki account. Suggestion is to make a special account to use for robot use only. Make sure this robot account is well known on your home wiki before using. Parameters: -all Try to log in on all sites where a username is defined...
epl-1.0
anthkris/oppia
extensions/rich_text_components/Collapsible/Collapsible.py
16
1566
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
gvanrossum/asyncio
examples/fetch3.py
13
7670
"""Fetch one URL and write its content to stdout. This version adds a primitive connection pool, redirect following and chunked transfer-encoding. It also supports a --iocp flag. """ import sys import urllib.parse from http.client import BadStatusLine from asyncio import * class ConnectionPool: # TODO: Lockin...
apache-2.0
liangazhou/django-rdp
packages/Django-1.8.6/django/utils/lorem_ipsum.py
505
4960
""" Utility functions for generating "lorem ipsum" Latin text. """ from __future__ import unicode_literals import random COMMON_P = ( 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod ' 'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim ' 'veniam, quis nostrud e...
apache-2.0
Changaco/oh-mainline
vendor/packages/PyYaml/lib/yaml/cyaml.py
537
3290
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader', 'CBaseDumper', 'CSafeDumper', 'CDumper'] from _yaml import CParser, CEmitter from constructor import * from serializer import * from representer import * from resolver import * class CBaseLoader(CParser, BaseConstructor, BaseResolver): def __init__(...
agpl-3.0
vipins/ccccms
env/Lib/site-packages/django/contrib/gis/tests/inspectapp/tests.py
57
4848
from __future__ import absolute_import import os from django.db import connections from django.test import TestCase from django.contrib.gis.gdal import Driver from django.contrib.gis.geometry.test_data import TEST_DATA from django.contrib.gis.utils.ogrinspect import ogrinspect from .models import AllOGRFields clas...
bsd-3-clause
wwj718/murp-edx
common/djangoapps/third_party_auth/tests/test_pipeline.py
78
1656
"""Unit tests for third_party_auth/pipeline.py.""" import random from third_party_auth import pipeline, provider from third_party_auth.tests import testutil # Allow tests access to protected methods (or module-protected methods) under # test. pylint: disable-msg=protected-access class MakeRandomPasswordTest(testu...
agpl-3.0
isse-augsburg/ssharp
Models/Small Models/DegradedMode/createGraphFigure.py
2
3466
#!/usr/local/bin/python3 # The MIT License (MIT) # # Copyright (c) 2014-2017, Institute for Software & Systems Engineering # # 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 restric...
mit
Nirvedh/CoarseCoherence
tests/configs/tsunami-switcheroo-full.py
52
2444
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
trondhindenes/ansible-modules-extras
windows/win_scheduled_task.py
49
2407
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. # ...
gpl-3.0
wangjun/pyload
module/lib/thrift/server/TNonblockingServer.py
83
10950
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
gpl-3.0
vineethguna/heroku-buildpack-libsandbox
vendor/distribute-0.6.34/setuptools/command/build_py.py
147
10457
import os.path, sys, fnmatch from distutils.command.build_py import build_py as _build_py from distutils.util import convert_path from glob import glob try: from distutils.util import Mixin2to3 as _Mixin2to3 # add support for converting doctests that is missing in 3.1 distutils from distutils import log ...
mit
AnselCmy/ARPS
report_spider/report_spider/spiders/USTC006.py
3
3094
# -*- coding:utf-8 -*- import sys reload(sys) sys.setdefaultencoding('utf-8') import time import scrapy from Global_function import get_localtime, print_new_number, save_messages now_time = get_localtime(time.strftime("%Y-%m-%d", time.localtime())) # now_time = 20170401 class USTC006_Spider(scrapy.Spider): name = ...
mit
jackjennings/Mechanic
src/lib/mechanic/github/request.py
4
1993
import requests from mechanic import logger class GithubRequest(object): __cache = {} def __init__(self, url): self.url = url def get(self): logger.debug('Requesting {}'.format(self.url)) return self.cache_response(self.url, self.get_with_etag_cache(self.url)) def get_wit...
mit
neverchanje/parser
tests/lib/gtest-1.7.0/test/gtest_env_var_test.py
2408
3487
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
mit
paurosello/frappe
frappe/email/doctype/auto_email_report/auto_email_report.py
1
5905
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, json from frappe import _ from frappe.model.document import Document from datetime import timedelta import frappe.utils from frappe...
mit
stacywsmith/ansible
lib/ansible/modules/cloud/vmware/vmware_vsan_cluster.py
70
4093
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Russell Teague <rteague2 () csc.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the ...
gpl-3.0
bnkr/suds
suds/mx/encoded.py
211
4651
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 distributed in the hope that it will ...
lgpl-3.0
mancoast/CPythonPyc_test
fail/322_test_fractions.py
51
24261
"""Tests for Lib/fractions.py.""" from decimal import Decimal from test.support import run_unittest, requires_IEEE_754 import math import numbers import operator import fractions import unittest from copy import copy, deepcopy from pickle import dumps, loads F = fractions.Fraction gcd = fractions.gcd class DummyFloat...
gpl-3.0
davidbrown3/reinforcement-learning
DP/PolicyIteration.py
1
1776
import numpy as np from PolicyEvaluation import policy_eval def policy_improvement(env, discount_factor=1.0): """ Policy Improvement Algorithm. Iteratively evaluates and improves a policy until an optimal policy is found. Args: env: The OpenAI envrionment. policy_eval_fn: Policy Ev...
mit
tszym/ansible
lib/ansible/modules/cloud/vmware/vsphere_guest.py
8
71539
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: 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__ = type ANSIBLE_METADATA = {'metadata_version': '1.0', ...
gpl-3.0
Tao-Ma/incubator-hawq
src/bin/gpupgrade/setcatversion.py
9
2397
import subprocess releases = {"3.0": "200703112", "3.1": "200712072", "3.2": "200808253", "3.3": "200902041"} def release2catverno(rno): if not rno in releases.keys(): raise Exception("unknown version %s" % rno) return releases[rno] def stop_cluster(): p.subprocess.Popen(['gp...
apache-2.0
evamwangi/bc-7-Todo_List
venv/Lib/site-packages/setuptools/command/install_egg_info.py
112
4035
from distutils import log, dir_util import os from setuptools.extern.six.moves import map from setuptools import Command from setuptools.archive_util import unpack_archive import pkg_resources class install_egg_info(Command): """Install an .egg-info directory for the package""" description = "Install an .e...
mit
zbqf109/goodo
openerp/report/render/html2html/html2html.py
49
3282
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.report.render.rml2pdf import utils import copy import base64 import cStringIO import re from reportlab.lib.utils import ImageReader _regex = re.compile('\[\[(.+?)\]\]') utils._regex = re.compile('\[\[\s*(.+...
gpl-3.0
mats116/gae-boilerplate
bp_includes/external/requests/packages/urllib3/packages/ordered_dict.py
1093
8936
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
lgpl-3.0
kevin-coder/tensorflow-fork
tensorflow/contrib/learn/python/learn/graph_actions_test.py
23
26409
# 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
mlperf/inference_results_v0.7
closed/QCT/code/rnnt/tensorrt/calibrator.py
12
4744
# Copyright (c) 2020, NVIDIA 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 by appli...
apache-2.0
bdoner/SickRage
lib/simplejson/encoder.py
343
16033
"""Implementation of JSONEncoder """ import re try: from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from simplejson._speedups import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ...
gpl-3.0
codeunsolved/NGS-Dashboard
py/lib/database_connector.py
1
3464
#!/usr/bin/env python # -*- coding: utf-8 -*- # PROGRAM : sql_connector # AUTHOR : codeunsolved@gmail.com # CREATED : August 22 2016 # VERSION : v0.0.1a import mysql.connector from mysql.connector import errorcode # CONFIG AREA mysql_config_example = { 'user': 'username', 'password': 'password',...
mit
isrohutamahopetechnik/MissionPlanner
Lib/tokenize.py
53
16889
"""Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line of input (or "" for EOF). It generates 5-tuples with these members: the token type (see tok...
gpl-3.0
paleocore/paleocore
hrp/import_hrp_dentition.py
1
7294
__author__ = 'reedd' """ This loader/importer script is designed to read data from a sqlite database storing the Hadar Research Project (HRP) data, and load those data into the PaleoCore postgres database. It assumes that the occurrence and biology table data has already been imported. This script reads in the data for...
gpl-2.0
falleco/sample-websockets
socketio_django/socketio_django/settings.py
1
2615
""" Django settings for socketio_django project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR,...
mit
v1bri/gnuradio
gr-uhd/python/uhd/qa_uhd.py
47
1959
#!/usr/bin/env python # # Copyright 2005,2008,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 your ...
gpl-3.0
anthgur/servo
tests/wpt/web-platform-tests/css/tools/apiclient/apiclient/uritemplate.py
79
14296
# coding=utf-8 # # Copyright © 2013 Hewlett-Packard Development Company, L.P. # # This work is distributed under the W3C® Software License [1] # in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # [1] http:...
mpl-2.0