repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
AndroidOpenDevelopment/android_external_chromium_org
mojo/public/tools/bindings/generators/mojom_cpp_generator.py
8
9880
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generates C++ source files from a mojom.Module.""" import mojom.generate.generator as generator import mojom.generate.module as mojom import mojom.genera...
bsd-3-clause
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/Sphinx-1.2.3-py2.7.egg/sphinx/config.py
11
10843
# -*- coding: utf-8 -*- """ sphinx.config ~~~~~~~~~~~~~ Build configuration file handling. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import re import sys from os import path from sphinx.errors import ConfigError from sp...
apache-2.0
daviddao/luminosity
sklearn-server/flask/lib/python2.7/site-packages/werkzeug/serving.py
116
25317
# -*- coding: utf-8 -*- """ werkzeug.serving ~~~~~~~~~~~~~~~~ There are many ways to serve a WSGI application. While you're developing it you usually don't want a full blown webserver like Apache but a simple standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in the standa...
bsd-3-clause
lambdamusic/testproject
konproj/libs/django_extensions/management/commands/runscript.py
5
5776
from django.core.management.base import BaseCommand from django.core.management.color import no_style from optparse import make_option import sys import os try: set except NameError: from sets import Set as set # Python 2.3 fallback def vararg_callback(option, opt_str, opt_value, parser): parser.rargs....
gpl-2.0
oiertwo/vampyr
pdftoexcel.py
1
8194
__author__ = 'oier' import os import numpy as np from data.parameters import true_params from data.parameters import false_params import distance as dist import numpy as np def pdftotext(path): os.system("pdftotext {data}".format(data=path)) return(path.replace(".pdf",".txt")) import pandas as pd def parse(p...
mit
dajohi/bitcoin
qa/rpc-tests/netutil.py
8
4561
#!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Linux network utilities import sys import socket import fcntl import struct import array import os import bin...
mit
russdill/juniper-vpn-py
tncc.py
1
22051
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import logging import StringIO import mechanize import cookielib import struct import socket import ssl import base64 import collections import zlib import HTMLParser import socket import netifaces import urlgrabber import urllib2 import platform import js...
lgpl-2.1
cjayb/mne-python
mne/datasets/tests/test_datasets.py
6
6158
import os from os import path as op import shutil import zipfile import sys import pytest from mne import datasets, read_labels_from_annot, write_labels_to_annot from mne.datasets import testing from mne.datasets._fsaverage.base import _set_montage_coreg_path from mne.datasets.utils import _manifest_check_download f...
bsd-3-clause
wufangjie/leetcode
640. Solve the Equation.py
1
1269
class Solution(object): def solveEquation(self, equation): """ :type equation: str :rtype: str """ left, right = equation.split('=') a1, b1 = self._parse(left) a2, b2 = self._parse(right) if a1 == a2: if b1 == b2: return "In...
gpl-3.0
Pointedstick/ReplicatorG
skein_engines/skeinforge-35/fabmetheus_utilities/fabmetheus_tools/interpret_plugins/gts.py
6
4607
""" This page is in the table of contents. The gts.py script is an import translator plugin to get a carving from an gts file. An import plugin is a script in the interpret_plugins folder which has the function getCarving. It is meant to be run from the interpret tool. To ensure that the plugin works on platforms wh...
gpl-2.0
zooba/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/cp852.py
593
35258
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.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
arangodb/arangodb
3rdParty/rocksdb/6.8/tools/advisor/advisor/db_options_parser.py
14
16518
# Copyright (c) 2011-present, Facebook, Inc. All rights reserved. # This source code is licensed under both the GPLv2 (found in the # COPYING file in the root directory) and Apache 2.0 License # (found in the LICENSE.Apache file in the root directory). import copy from advisor.db_log_parser import DataSource, NO_C...
apache-2.0
vlaznev/gui_plotter
plot_window/color_picker.py
1
1419
__author__ = 'user' from PyQt4 import Qt, QtGui class QColorComboBox(QtGui.QComboBox): ColorNames = ["darkGreen", "green", "gray", "red", "white", "blue", "cyan", "darkMagenta", "yellow", "darkRed", "black", "magenta"] ColorRole = Qt.Qt.UserRole + 1 def __init__(self, parent=None): ...
mit
Fritz449/SRLF
models/feed_forward.py
1
5832
import tensorflow as tf import os import sys sys.path.append(os.path.realpath("..")) from helpers.layers import denselayer from models.base_model import BaseModel import numpy as np class FeedForward(BaseModel): def __init__(self, sess, args): BaseModel.__init__(self, sess) self.n_hiddens = arg...
apache-2.0
Stefan-Schmidt/linux-wpan-next
tools/power/pm-graph/analyze_boot.py
84
31499
#!/usr/bin/python # # Tool for analyzing boot timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is dis...
gpl-2.0
sqlobject/sqlobject
sqlobject/sqlite/sqliteconnection.py
2
16587
import base64 import os try: from _thread import get_ident except ImportError: from thread import get_ident try: from urllib import quote except ImportError: from urllib.parse import quote from sqlobject import col from sqlobject import dberrors from sqlobject.dbconnection import DBAPI, Boolean sqlite...
lgpl-2.1
OrmondHugh/2048Bot
src/src/utility.py
1
3044
import readBoard as rb import State import copy def getPossibilities(state): possibilities = [] #Loop through each tile to find the spaces that can be filled by a spawning tile for i in range(4): for j in range(4): #If we find an empty space, add a child to children where a two is spawned, and a ...
mit
mcfletch/AutobahnPython
autobahn/autobahn/websocket/interfaces.py
10
11716
############################################################################### ## ## Copyright (C) 2013-2014 Tavendo GmbH ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## h...
apache-2.0
jgelens/AutobahnTestSuite
autobahntestsuite/autobahntestsuite/case/case7_1_3.py
14
1670
############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## ht...
apache-2.0
KyleMao/simple-ner-ie
.ropeproject/config.py
387
3461
# The default ``config.py`` def set_prefs(prefs): """This function is called before opening the project""" # Specify which files and folders to ignore in the project. # Changes to ignored resources are not added to the history and # VCSs. Also they are not returned in `Project.get_files()`. # No...
mit
myerpengine/odoo
addons/product_extended/__init__.py
374
1068
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
agpl-3.0
mediathread/mdtprint
app/bower_components/phantom/src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/text_format.py
261
21737
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
mit
zofuthan/airmozilla
airmozilla/surveys/views.py
9
3959
from collections import defaultdict from django.shortcuts import get_object_or_404, render, redirect from django.db import transaction from django import forms from .models import Survey, Question, Answer @transaction.atomic def load(request, id): survey = get_object_or_404(Survey, id=id, active=True) conte...
bsd-3-clause
waseem18/bedrock
vendor-local/packages/chardet/chardet/langthaimodel.py
235
11298
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mpl-2.0
idea4bsd/idea4bsd
python/helpers/pydev/tests_pydevd_python/performance_check.py
12
6676
import debugger_unittest import sys import re import os CHECK_BASELINE, CHECK_REGULAR, CHECK_CYTHON = 'baseline', 'regular', 'cython' class PerformanceWriterThread(debugger_unittest.AbstractWriterThread): CHECK = None debugger_unittest.AbstractWriterThread.get_environ # overrides def get_environ(self): ...
apache-2.0
HyperBaton/ansible
lib/ansible/modules/network/f5/bigip_sys_daemon_log_tmm.py
38
13357
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks 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', ...
gpl-3.0
Hasimir/brython
www/src/Lib/test/test_with.py
83
26527
#!/usr/bin/env python3 """Unit tests for the with statement specified in PEP 343.""" __author__ = "Mike Bland" __email__ = "mbland at acm dot org" import sys import unittest from collections import deque from contextlib import _GeneratorContextManager, contextmanager from test.support import run_unittest class Mo...
bsd-3-clause
APCVSRepo/sdl_core
src/3rd_party-static/jsoncpp/scons-tools/globtool.py
256
1667
import fnmatch import os def generate( env ): def Glob( env, includes = None, excludes = None, dir = '.' ): """Adds Glob( includes = Split( '*' ), excludes = None, dir = '.') helper function to environment. Glob both the file-system files. includes: list of file name pattern included i...
bsd-3-clause
yangleo/cloud-github
openstack_dashboard/dashboards/admin/networks/agents/tests.py
9
7633
# Copyright 2012 NEC Corporation # Copyright 2015 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
apache-2.0
xtao/code
tools/update_issue.py
3
1349
# -*- coding: utf-8 -*- from vilya.libs.store import store def main(): rs = store.execute("select id, type " "from issues " "where type='project'") for r in rs: id, _ = r rs1 = store.execute("select id, project_id, issue_id " ...
bsd-3-clause
yglazko/socorro
webapp-django/bin/linting.py
9
1558
#!/usr/bin/env python """ Use like this: find somedir | xargs flake8 | python linting.py or: flake8 somedir | python linting.py or: git ls-files somedir | python linting.py """ import os import sys # Enter any part of a warning that we deem OK. # It can be a pep8 warning error code or any other par...
mpl-2.0
DrPantera/gsiege
resistencia/tests/test_round.py
3
5377
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # This file is part of Resistencia Cadiz 1812. # # 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, e...
gpl-3.0
blackzw/openwrt_sdk_dev1
staging_dir/host/lib/python2.7/compileall.py
144
7763
"""Module/script to byte-compile all .py files to .pyc (or .pyo) files. When called as a script with arguments, this compiles the directories given as arguments recursively; the -l option prevents it from recursing into directories. Without arguments, if compiles all modules on sys.path, without recursing into subdir...
gpl-2.0
chromium/chromium
third_party/blink/tools/blinkpy/w3c/test_importer.py
5
28640
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Fetches a copy of the latest state of a W3C test repository and commits. If this script is given the argument --auto-update, it will also: 1. Upload a CL...
bsd-3-clause
aliclark/libquic
src/third_party/protobuf/objectivec/DevTools/pddm_tests.py
66
16785
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2015 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
bsd-3-clause
tianzhihen/python-mode
pymode/libs/pylama/lint/pylama_pyflakes/pyflakes/messages.py
42
3808
""" Provide the class Message and its subclasses. """ class Message(object): message = '' message_args = () def __init__(self, filename, loc): self.filename = filename self.lineno = loc.lineno self.col = getattr(loc, 'col_offset', 0) def __str__(self): return '%s:%s: ...
lgpl-3.0
sienatime/python_koans
python2/libs/colorama/win32.py
86
2730
# from winbase.h STDOUT = -11 STDERR = -12 try: from ctypes import windll except ImportError: windll = None SetConsoleTextAttribute = lambda *_: None else: from ctypes import ( byref, Structure, c_char, c_short, c_uint32, c_ushort ) handles = { STDOUT: windll.kernel32.GetStdHa...
mit
2015fallproject/2015fallcase1
static/Brython3.2.0-20150701-214155/Lib/heapq.py
628
18065
"""Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. Usag...
agpl-3.0
RT-Thread/rt-thread
bsp/qemu-vexpress-a9/rtconfig.py
11
2352
import os import uuid def get_mac_address(): mac=uuid.UUID(int = uuid.getnode()).hex[-12:] return "#define AUTOMAC".join([str(int(e/2) + 1) + ' 0x' + mac[e:e+2] + '\n' for e in range(5,11,2)]) header = ''' #ifndef __MAC_AUTO_GENERATE_H__ #define __MAC_AUTO_GENERATE_H__ /* Automatically generated file; DO ...
apache-2.0
2013Commons/hue
desktop/core/ext-py/tablib-develop/tablib/packages/openpyxl/shared/exc.py
118
2259
# file openpyxl/shared/exc.py # Copyright (c) 2010 openpyxl # # 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, mod...
apache-2.0
loic/django
tests/middleware/test_security.py
4
7727
from django.http import HttpResponse from django.test import RequestFactory, SimpleTestCase from django.test.utils import override_settings class SecurityMiddlewareTest(SimpleTestCase): @property def middleware(self): from django.middleware.security import SecurityMiddleware return SecurityMid...
bsd-3-clause
collmot/ardupilot
Tools/LogAnalyzer/tests/TestDupeLogData.py
21
2700
from __future__ import print_function from LogAnalyzer import Test,TestResult import DataflashLog class TestDupeLogData(Test): '''test for duplicated data in log, which has been happening on PX4/Pixhawk''' def __init__(self): Test.__init__(self) self.name = "Dupe Log Data" def __matchSample(self, sample, ...
gpl-3.0
2015fallproject/2015fallcase2
static/Brython3.2.0-20150701-214155/Lib/decimal.py
623
230510
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz <aahz at pobox.com> # and Tim Peters # This module should be kept in sync with ...
agpl-3.0
xcbat/vnpy
examples/CtaBacktesting/runBacktesting.py
5
1089
# encoding: UTF-8 """ 展示如何执行策略回测。 """ from __future__ import division from vnpy.trader.app.ctaStrategy.ctaBacktesting import BacktestingEngine, MINUTE_DB_NAME if __name__ == '__main__': from vnpy.trader.app.ctaStrategy.strategy.strategyAtrRsi import AtrRsiStrategy # 创建回测引擎 engine = BacktestingEng...
mit
MiLk/ansible
lib/ansible/modules/network/avi/avi_networksecuritypolicy.py
44
4118
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
blowekamp/SimpleITK
Examples/AdvancedImageReading/AdvancedImageReading.py
4
3257
#!/usr/bin/env python # ========================================================================= # # Copyright NumFOCUS # # 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:/...
apache-2.0
kmod/icbd
stdlib/python2.5/ctypes/test/__init__.py
15
6870
import glob, os, sys, unittest, getopt, time use_resources = [] class ResourceDenied(Exception): """Test skipped because it requested a disallowed resource. This is raised when a test calls requires() for a resource that has not be enabled. Resources are defined by test modules. """ def is_resource...
mit
beezee/GAE-Django-site
django/db/backends/postgresql/creation.py
247
3753
from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can contain format strings; they'll ...
bsd-3-clause
SubhasisDutta/subhasisdutta.com
src/controller/WorkAdminController.py
2
10845
import webapp2 import os from google.appengine.ext.webapp import template from google.appengine.api import users from google.appengine.ext import db from google.appengine.ext import ndb from google.appengine.api import images from src.model.WorkModels import Work,PhotoModel,WorkResourceAttribute class WorkAdminCreate...
mit
jarussi/riotpy
riotpy/managers/match_history.py
1
1786
# coding: utf-8 from riotpy.resources.match import MatchResource from base import Manager class MatchHistoryManager(Manager): """ We are spliting this one and MatchManager because Riot did it. That way, our lib is closer to their documentation. """ def get_summoner_match_history(self, sum...
bsd-3-clause
proxysh/Safejumper-for-Desktop
buildlinux/env64/lib/python2.7/site-packages/Crypto/PublicKey/__init__.py
124
1876
# -*- 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...
gpl-2.0
10clouds/edx-platform
cms/djangoapps/course_creators/models.py
62
4060
""" Table for storing information about whether or not Studio users have course creation privileges. """ from django.db import models from django.db.models.signals import post_init, post_save from django.dispatch import receiver, Signal from django.contrib.auth.models import User from django.utils import timezone from...
agpl-3.0
Gamebasis/3DGamebasisServer
GameData/blender-2.71-windows64/2.71/scripts/addons/game_engine_save_as_runtime.py
5
8665
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
gpl-3.0
wrightni/OSSP
segment.py
1
6298
# title: Watershed Transform # author: Nick Wright # adapted from: Justin Chen, Arnold Song import numpy as np import gc import warnings from skimage import filters, morphology, feature, img_as_ubyte from scipy import ndimage from ctypes import * from lib import utils # For Testing: from skimage import segmentation i...
mit
shaistaansari/django
django/db/backends/base/schema.py
339
43421
import hashlib import logging from django.db.backends.utils import truncate_name from django.db.transaction import atomic from django.utils import six from django.utils.encoding import force_bytes logger = logging.getLogger('django.db.backends.schema') def _related_non_m2m_objects(old_field, new_field): # Filte...
bsd-3-clause
toshywoshy/ansible
lib/ansible/modules/cloud/digital_ocean/digital_ocean_certificate_info.py
25
3570
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = ty...
gpl-3.0
FRidh/Sea
Sea/adapter/couplings/Coupling.py
2
3004
import abc import logging import Sea import numpy as np from ..base import Base class Coupling(Base): """ Abstract base class for all :mod:`Sea.adapter.couplings` classes. """ __metaclass__ = abc.ABCMeta def __init__(self, obj, connection, subsystem_from, subsystem_to): Base.__init__(...
bsd-3-clause
gtacoin-dev/gtacoin
qa/rpc-tests/test_framework/comptool.py
1
18090
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Gtacoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from .mininode import * from .blockstore import BlockStore, TxStore from .util import p2p_port ''' This ...
mit
NL66278/odoo
addons/resource/faces/plocale.py
433
1910
############################################################################ # Copyright (C) 2005 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free software; you can redistribute it and/or modify # ...
agpl-3.0
arrabito/DIRAC
FrameworkSystem/private/standardLogging/Formatter/ColoredBaseFormatter.py
4
2106
""" ColoredBaseFormatter """ __RCSID__ = "$Id$" import sys from DIRAC.FrameworkSystem.private.standardLogging.Formatter.BaseFormatter import BaseFormatter class ColoredBaseFormatter(BaseFormatter): """ ColoredBaseFormatter is used to format log record to create a string representing a log message. It is bas...
gpl-3.0
eLBati/odoo
openerp/tools/amount_to_text_en.py
441
5103
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
TheBigW/DRC
XMLSerializer.py
1
4179
# -*- coding: utf-8 -*- import lxml.etree as ET class Serializer(object): def __init__(self): return None @staticmethod def getSerializeMembers(SerializeObject): strSerializeMembers = [] for member in dir(SerializeObject): strMember = str(member) strType = ...
gpl-3.0
luiseduardohdbackup/odoo
openerp/modules/registry.py
220
19731
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
EDUlib/edx-platform
lms/djangoapps/mobile_api/tests/test_middleware.py
5
7822
""" Tests for Version Based App Upgrade Middleware """ from datetime import datetime from unittest import mock import ddt from django.core.cache import caches from django.http import HttpRequest, HttpResponse from pytz import UTC from lms.djangoapps.mobile_api.middleware import AppVersionUpgrade from lms.djangoapps...
agpl-3.0
adamrp/qiime
scripts/compare_alpha_diversity.py
15
12087
#!/usr/bin/env python # File created on 06 Jun 2011 from __future__ import division __author__ = "William Van Treuren" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["William Van Treuren", "Greg Caparaso", "Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "William Va...
gpl-2.0
GameKinger123x/mtasa-blue
vendor/google-breakpad/src/testing/gtest/test/gtest_test_utils.py
408
10444
#!/usr/bin/env python # # Copyright 2006, 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...
gpl-3.0
ettrig/NIPAP
nipap/nipap/errors.py
2
1301
class NipapError(Exception): """ NIPAP base error class. """ error_code = 1000 class NipapInputError(NipapError): """ Erroneous input. A general input error. """ error_code = 1100 class NipapMissingInputError(NipapInputError): """ Missing input. Most input is passed ...
mit
asser/django
tests/utils_tests/test_regex_helper.py
448
1784
from __future__ import unicode_literals import unittest from django.utils import regex_helper class NormalizeTests(unittest.TestCase): def test_empty(self): pattern = r"" expected = [('', [])] result = regex_helper.normalize(pattern) self.assertEqual(result, expected) def te...
bsd-3-clause
sonofeft/PyHatch
pyhatch/examples/example_1.py
1
1057
import sys import os from pyhatch.hatch_supt import Hatch SIMPLEDESC='''PyProTem acts as a temporary project for test purposes.''' LONGDESC="""Use pyProTem to test tox usage locally, travis CI on checkin to GitHub, tk_nosy to watch files locally and alert breakage, operation under both python 2 and 3 on Windows an...
gpl-3.0
natanlailari/PennApps2015-Heartmates
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py
328
10347
# urllib3/response.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 import logging import zlib import io from ._collections import HTTPHeaderDict from .exceptio...
apache-2.0
lokeshjindal15/pd-gem5
src/arch/alpha/AlphaInterrupts.py
69
1754
# Copyright (c) 2008 The Regents of The University of Michigan # 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
henridwyer/scikit-learn
sklearn/gaussian_process/regression_models.py
259
2166
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause """ The built-in regression models submodule for the gaussian_process module. """ import numpy as np def constant(x): """ Zero order polynomial (...
bsd-3-clause
Arafatk/sympy
sympy/vector/coordsysrect.py
9
24501
from sympy.core.basic import Basic from sympy.vector.scalar import BaseScalar from sympy import eye, trigsimp, ImmutableMatrix as Matrix, Symbol from sympy.core.compatibility import string_types, range from sympy.core.cache import cacheit from sympy.vector.orienters import (Orienter, AxisOrienter, BodyOrienter, ...
bsd-3-clause
jhg/django
tests/utils_tests/test_baseconv.py
326
1787
from unittest import TestCase from django.utils.baseconv import ( BaseConverter, base2, base16, base36, base56, base62, base64, ) from django.utils.six.moves import range class TestBaseConv(TestCase): def test_baseconv(self): nums = [-10 ** 10, 10 ** 10] + list(range(-100, 100)) for converte...
bsd-3-clause
abhishekgahlot/scikit-learn
examples/applications/topics_extraction_with_nmf.py
106
2313
""" ======================================================== Topics extraction with Non-Negative Matrix Factorization ======================================================== This is a proof of concept application of Non Negative Matrix Factorization of the term frequency matrix of a corpus of documents so as to extra...
bsd-3-clause
RoshaneH/INFO3180lab4
lib/werkzeug/testsuite/datastructures.py
97
27488
# -*- coding: utf-8 -*- """ werkzeug.testsuite.datastructures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the functionality of the provided Werkzeug datastructures. TODO: - FileMultiDict - Immutable types undertested - Split up dict tests :copyright: (c) 2013 by Armin Ronacher....
apache-2.0
G33KS44n/mysql-5.6
xtrabackup/test/python/testtools/runtest.py
42
7648
# Copyright (c) 2009-2010 testtools developers. See LICENSE for details. """Individual test case execution.""" __all__ = [ 'MultipleExceptions', 'RunTest', ] import sys from testtools.testresult import ExtendedToOriginalDecorator class MultipleExceptions(Exception): """Represents many exceptions r...
gpl-2.0
garoose/eecs494.p2
jni/external/freetype2/src/tools/docmaker/docmaker.py
463
2766
#!/usr/bin/env python # # DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org> # # This program is a re-write of the original DocMaker took used # to generate the API Reference of the FreeType font engine # by converting in-source comments into structured HTML. # # This new version is capable of outputting ...
mit
lindycoder/fake-switches
fake_switches/dell10g/command_processor/enabled.py
4
9868
# Copyright 2015 Internap. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
apache-2.0
rgommers/numpy
numpy/core/tests/test_shape_base.py
4
27579
import pytest import numpy as np from numpy.core import ( array, arange, atleast_1d, atleast_2d, atleast_3d, block, vstack, hstack, newaxis, concatenate, stack ) from numpy.core.shape_base import (_block_dispatcher, _block_setup, _block_concatenate, _block_slicing) from nu...
bsd-3-clause
cole945/binutils-gdb
gdb/testsuite/gdb.python/py-frame-args.py
41
2186
# Copyright (C) 2013-2014 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
spulec/moto
tests/test_resourcegroups/test_resourcegroups.py
1
8542
from __future__ import unicode_literals import boto3 import json import sure # noqa from moto import mock_resourcegroups @mock_resourcegroups def test_create_group(): resource_groups = boto3.client("resource-groups", region_name="us-east-1") response = resource_groups.create_group( Name="test_reso...
apache-2.0
kisel/trex-core
scripts/external_libs/nose-1.3.4/python3/nose/tools/nontrivial.py
11
4170
"""Tools not exempt from being descended into in tracebacks""" import time __all__ = ['make_decorator', 'raises', 'set_trace', 'timed', 'with_setup', 'TimeExpired', 'istest', 'nottest'] class TimeExpired(AssertionError): pass def make_decorator(func): """ Wraps a test decorator so as to pr...
apache-2.0
hobarrera/django
django/contrib/gis/db/backends/mysql/introspection.py
700
1771
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. ...
bsd-3-clause
cloudsigma/cgroupspy
cgroupspy/test/test_interfaces.py
1
8905
""" Copyright (c) 2014, CloudSigma AG 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 fo...
bsd-3-clause
imre-kerr/swarm-epuck
controllers/swarm_controller/webann.py
2
1182
# This uses the EpuckBasic code as the interface to webots, and the epuck2 code to connect an ANN # to webots. import epuck2 import epuck_basic as epb import graph import prims1 # The webann is a descendent of the webot "controller" class, and it has the ANN as an attribute. class WebAnn(epb.EpuckBasic): def __...
mit
terbolous/CouchPotatoServer
libs/pyutil/test/deprecated/test_picklesaver.py
106
1340
#!/usr/bin/env python # Copyright (c) 2002 Luke 'Artimage' Nelson # Copyright (c) 2005-2010 Zooko Wilcox-O'Hearn # This file is part of pyutil; see README.rst for licensing terms. import os try: from twisted.trial import unittest except ImportError, le: print "Skipping %s since it requires Twisted and Twist...
gpl-3.0
colinbrislawn/bioconda-recipes
recipes/fgbio/fgbio.py
7
2575
#!/opt/anaconda1anaconda2anaconda3/bin/python # # Wrapper script for invoking the jar. # # This script is written for use with the Conda package manager and is ported # from a bash script that does the same thing, adapting the style in # the peptide-shaker wrapper # (https://github.com/bioconda/bioconda-recipes/blob/ma...
mit
alexlo03/ansible
lib/ansible/modules/crypto/openssl_privatekey.py
25
10503
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Yanis Guenane <yanis+ansible@guenane.org> # 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': '...
gpl-3.0
jhseu/tensorflow
tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/shapes_for_arguments.py
21
1840
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Hasimir/pyjs
examples/widgets/__main__.py
8
1045
#!/usr/bin/env python # -*- coding: utf-8 -*- TARGETS = [ 'Widgets.py', ] PACKAGE = { 'title': 'Widgets', 'desc': 'Widgets example', } def setup(targets): '''Setup example for translation, MUST call util.setup(targets).''' util.setup(targets) def translate(): '''Translate example, MUST c...
apache-2.0
vaporry/dapp-bin
serpent_gamble/prepare.py
5
2914
# This is an ultra-minimal "dapp framework" that simplifies the deployment # process by generating a config.js file that specifies the ABI for all of # the contracts that you need and also includes the ability to update # addresses. By default, it simply scans through every .se and .sol file in # the current directory ...
mit
Zhongqilong/mykbengineer
kbe/res/scripts/common/Lib/profile.py
102
22021
#! /usr/bin/env python3 # # Class for profiling python code. rev 1.0 6/2/94 # # Written by James Roskind # Based on prior profile module by Sjoerd Mullender... # which was hacked somewhat by: Guido van Rossum """Class for profiling Python code.""" # Copyright Disney Enterprises, Inc. All Rights Reserved. # Licens...
lgpl-3.0
alu0100207385/dsi_3Django
django/contrib/gis/db/backends/spatialite/creation.py
117
5699
import os from django.conf import settings from django.core.cache import get_cache from django.core.cache.backends.db import BaseDatabaseCache from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.creation import DatabaseCreation class SpatiaLiteCreation(DatabaseCreation): def cr...
bsd-3-clause
0x19/werkzeug
bench/wzbench.py
4
12441
#!/usr/bin/env python # -*- coding: utf-8 -*- """ wzbench ~~~~~~~ A werkzeug internal benchmark module. It's used in combination with hg bisect to find out how the Werkzeug performance of some internal core parts changes over time. :copyright: 2009 by the Werkzeug Team, see AUTHORS for more d...
bsd-3-clause
ovnicraft/edx-platform
common/djangoapps/course_action_state/tests/test_managers.py
126
7219
# pylint: disable=invalid-name, attribute-defined-outside-init """ Tests for basic common operations related to Course Action State managers """ from ddt import ddt, data from django.test import TestCase from collections import namedtuple from opaque_keys.edx.locations import CourseLocator from course_action_state.mode...
agpl-3.0
nanolearningllc/edx-platform-cypress-2
cms/djangoapps/contentstore/courseware_index.py
60
26790
""" Code to allow module store to interface with courseware index """ from __future__ import absolute_import from abc import ABCMeta, abstractmethod from datetime import timedelta import logging import re from six import add_metaclass from django.conf import settings from django.utils.translation import ugettext as _ ...
agpl-3.0
dongjoon-hyun/tensorflow
tensorflow/python/saved_model/utils_test.py
62
5133
# 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
gymnasium/edx-platform
lms/djangoapps/certificates/tests/tests.py
9
10197
""" Tests for the certificates models. """ from datetime import datetime, timedelta from ddt import data, ddt, unpack from pytz import UTC from django.conf import settings from milestones.tests.utils import MilestonesTestCaseMixin from mock import patch from nose.plugins.attrib import attr from badges.tests.factories ...
agpl-3.0
oihane/odoo
addons/product/report/__init__.py
452
1080
# -*- 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...
agpl-3.0