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
minhphung171093/OpenERP_V7
openerp/addons/auth_openid/__openerp__.py
58
1668
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
jerrybai2009/WhereHows-1
metadata-etl/src/main/resources/jython/requests/packages/urllib3/util/timeout.py
713
9596
from __future__ import absolute_import # The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # u...
apache-2.0
cswiercz/sympy
sympy/physics/quantum/state.py
58
29186
"""Dirac notation for states.""" from __future__ import print_function, division from sympy import (cacheit, conjugate, Expr, Function, integrate, oo, sqrt, Tuple) from sympy.core.compatibility import u, range from sympy.printing.pretty.stringpict import stringPict from sympy.physics.quantum.qexpr ...
bsd-3-clause
gonboy/sl4a
python/src/Lib/csv.py
62
15730
""" csv.py - read/write/investigate CSV files """ import re from functools import reduce from _csv import Error, __version__, writer, reader, register_dialect, \ unregister_dialect, get_dialect, list_dialects, \ field_size_limit, \ QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NON...
apache-2.0
elena/django
tests/template_tests/syntax_tests/test_if.py
129
27415
from django.template import TemplateSyntaxError from django.template.defaulttags import IfNode from django.test import SimpleTestCase from ..utils import TestObj, setup class IfTagTests(SimpleTestCase): @setup({'if-tag01': '{% if foo %}yes{% else %}no{% endif %}'}) def test_if_tag01(self): output = ...
bsd-3-clause
saltastro/saltefficiency
dataquality/upload_throughput.py
1
4898
import os import argparse import glob import traceback import mysql import dataquality as dq def upload_throughput(sdb, infile, force=False): """Upload throughput measurements to the Science Database Parameters ---------- sdb: ~mysql.sdb Connection to the Science Database infile: str ...
bsd-3-clause
ChrisGoedhart/Uforia
source/django/views/decorators/cache.py
83
3975
from functools import wraps from django.utils.decorators import decorator_from_middleware_with_args, available_attrs from django.utils.cache import patch_cache_control, add_never_cache_headers from django.middleware.cache import CacheMiddleware def cache_page(*args, **kwargs): """ Decorator for views that tri...
gpl-2.0
shohei/Octoprint
tests/users/__init__.py
4
4243
# coding=utf-8 """ Unit tests for octoprint.users """ from __future__ import absolute_import, division, print_function __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released...
agpl-3.0
willingc/oh-mainline
vendor/packages/celery/celery/tests/test_backends/test_redis.py
18
3445
from __future__ import absolute_import from __future__ import with_statement import sys import socket from nose import SkipTest from celery.exceptions import ImproperlyConfigured from celery import states from celery.utils import uuid from celery.backends import redis from celery.backends.redis import RedisBackend ...
agpl-3.0
rolandmansilla/microblog
flask/lib/python2.7/site-packages/migrate/changeset/databases/oracle.py
140
3655
""" Oracle database specific implementations of changeset classes. """ import sqlalchemy as sa from sqlalchemy.databases import oracle as sa_base from migrate import exceptions from migrate.changeset import ansisql OracleSchemaGenerator = sa_base.OracleDDLCompiler class OracleColumnGenerator(OracleSchemaGenerat...
bsd-3-clause
0xdyu/RouteFlow-Exodus
pox/pox/lib/packet/arp.py
27
6250
# Copyright 2011 James McCauley # Copyright 2008 (C) Nicira, Inc. # # This file is part of POX. # # POX 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) an...
apache-2.0
bheesham/hyde
tests/test_initialize.py
6
3678
# -*- coding: utf-8 -*- """ Use nose `$ pip install nose` `$ nosetests` """ from hyde.engine import Engine from hyde.exceptions import HydeException from hyde.layout import Layout from fswrap import File, Folder from nose.tools import raises, with_setup, nottest TEST_SITE = File(__file__).parent.child_folder('_test...
mit
gonzaparra/webankyrins
src/LFP/StructuralAnks/MainBundle/Resources/public/jmol/doc/source/xml2po-modes/gs.py
2
2904
# Copyright (c) 2004 Danilo Segan <danilo@kvota.net>. # # This file is part of xml2po. # # xml2po 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 late...
mit
paivaspol/appengine-try-out
settings.py
5
1608
# Initialize App Engine and import the default settings (DB backend, etc.). # If you want to use a different backend you have to remove all occurences # of "djangoappengine" from this file. from djangoappengine.settings_base import * import os # Activate django-dbindexer for the default database DATABASES['native'] =...
bsd-3-clause
ric2b/Vivaldi-browser
chromium/base/android/jni_generator/jni_refactorer.py
7
14708
#!/usr/bin/env python2.7 # Copyright 2018 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. """Tool for doing Java refactors over native methods. Converts (a) non-static natives to static natives using @JCaller e.g. class A...
bsd-3-clause
wangyum/tensorflow
tensorflow/python/kernel_tests/weights_broadcast_test.py
130
9711
# 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
dpursehouse/buck
third-party/py/twitter-commons/src/python/twitter/common/python/interpreter.py
18
13136
""" twitter.common.python support for interpreter environments. """ from __future__ import absolute_import try: from numbers import Integral except ImportError: Integral = (int, long) from collections import defaultdict import os import re import subprocess import sys from .base import maybe_requirement, maybe_r...
apache-2.0
MSusik/invenio
invenio/modules/sequencegenerator/models.py
4
1370
# -*- coding: utf-8 -*- # ## This file is part of Invenio. ## Copyright (C) 2012, 2014 CERN. ## ## Invenio 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 opti...
gpl-2.0
cjdelisle/cjdns
node_build/dependencies/libuv/build/gyp/test/defines-escaping/gyptest-defines-escaping.py
350
4737
#!/usr/bin/env python # Copyright (c) 2010 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies build of an executable with C++ define specified by a gyp define using various special characters such as quotes, commas, etc. ...
gpl-3.0
elliott10/decaf-multiOS
scripts/ordereddict.py
1047
4094
# Copyright (c) 2009 Raymond Hettinger # # 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, modify, merge, # publish,...
gpl-2.0
puzan/ansible
lib/ansible/playbook/taggable.py
32
3442
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 License, or # (at your option) an...
gpl-3.0
tizianasellitto/servo
etc/ci/performance/runner.py
14
9487
#!/usr/bin/env python3 # 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/. import argparse import itertools import json import os import subprocess from functools import p...
mpl-2.0
yashchandak/GNN
Sample_Run/Seq_Dynamic/blogDWdata.py
1
6976
from __future__ import generators, print_function import numpy as np from copy import deepcopy from random import shuffle from scipy.io import loadmat class DataSet(object): def __init__(self, cfg): """Construct a DataSet. """ self.cfg = cfg self.all_walks, self.node_seq = self.get...
mit
DirtyUnicorns/android_external_chromium_org
third_party/protobuf/python/google/protobuf/descriptor_pool.py
228
18667
# 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...
bsd-3-clause
michalliu/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/distutils/tests/test_clean.py
94
1467
"""Tests for distutils.command.clean.""" import sys import os import unittest import getpass from distutils.command.clean import clean from distutils.tests import support from test.support import run_unittest class cleanTestCase(support.TempdirManager, support.LoggingSilencer, ...
gpl-2.0
Mixser/django
django/contrib/admindocs/utils.py
411
4187
"Misc. utility functions/classes for admin documentation generator." import re from email.errors import HeaderParseError from email.parser import HeaderParser from django.core.urlresolvers import reverse from django.utils.encoding import force_bytes from django.utils.safestring import mark_safe try: import docut...
bsd-3-clause
gisce/OCB
addons/account/report/account_general_ledger.py
53
15525
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2005-2006 CamptoCamp # Copyright (c) 2006-2010 OpenERP S.A # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all po...
agpl-3.0
paran0ids0ul/infernal-twin
build/pip/pip/_vendor/html5lib/filters/whitespace.py
1730
1142
from __future__ import absolute_import, division, unicode_literals import re from . import _base from ..constants import rcdataElements, spaceCharacters spaceCharacters = "".join(spaceCharacters) SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) class Filter(_base.Filter): spacePreserveElements = frozenset...
gpl-3.0
libracore/erpnext
erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
2
32514
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe, erpnext import frappe.model from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry from frap...
gpl-3.0
MQQiang/kbengine
kbe/src/lib/python/Lib/test/test_email/test_message.py
72
26378
import unittest import textwrap from email import policy, message_from_string from email.message import EmailMessage, MIMEPart from test.test_email import TestEmailBase, parameterize # Helper. def first(iterable): return next(filter(lambda x: x is not None, iterable), None) class Test(TestEmailBase): polic...
lgpl-3.0
DOV-Vlaanderen/pydov
setup.py
1
2043
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import find_packages, setup with open('README.md') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() with open('requirements.txt') as f: requirements =...
mit
lxybox1/MissionPlanner
Lib/site-packages/numpy/distutils/misc_util.py
53
84156
import os import re import sys import imp import copy import glob import atexit import tempfile import subprocess import shutil from distutils.errors import DistutilsError try: set except NameError: from sets import Set as set from numpy.distutils.compat import get_exception __all__ = ['Configuration', 'get...
gpl-3.0
ales-erjavec/orange-canvas
orangecanvas/scheme/tests/__init__.py
1
2700
""" Scheme tests """ from AnyQt.QtCore import QObject, QEventLoop, QTimer, QCoreApplication, QEvent from typing import List class EventSpy(QObject): """ A testing utility class (similar to QSignalSpy) to record events delivered to a QObject instance. Note ---- Only event types can be recorded...
gpl-3.0
mcella/django
django/db/migrations/graph.py
351
10956
from __future__ import unicode_literals import warnings from collections import deque from functools import total_ordering from django.db.migrations.state import ProjectState from django.utils.datastructures import OrderedSet from django.utils.encoding import python_2_unicode_compatible from .exceptions import Circu...
bsd-3-clause
jsteemann/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/sqlite3/dbapi2.py
161
2615
#-*- coding: ISO-8859-1 -*- # pysqlite2/dbapi2.py: the DB-API 2.0 interface # # Copyright (C) 2004-2005 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # aris...
apache-2.0
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/doc/mpl_examples/pylab_examples/demo_bboximage.py
12
1805
import matplotlib.pyplot as plt import numpy as np from matplotlib.image import BboxImage from matplotlib.transforms import Bbox, TransformedBbox if __name__ == "__main__": fig = plt.figure(1) ax = plt.subplot(121) txt = ax.text(0.5, 0.5, "test", size=30, ha="center", color="w") kwargs = dict() ...
gpl-2.0
onyxfish/stovetop
atom/mock_service.py
277
10350
#!/usr/bin/python # # Copyright (C) 2008 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 ...
mit
Nicoretti/libslack
libslack/tests/__init__.py
1
1485
#!/usr/bin/env python3 # # Copyright (c) 2015, Nicola Coretti # 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 # ...
bsd-2-clause
edxnercel/edx-platform
pavelib/paver_tests/test_paver_get_quality_reports.py
56
1550
import os import tempfile import unittest from mock import patch, Mock from ddt import ddt, file_data import pavelib.quality import paver.easy from paver.easy import BuildFailure class TestGetReportFiles(unittest.TestCase): """ Ensure only the report files we want are returned as part of run_quality. """...
agpl-3.0
Yuriy-Leonov/nova
nova/db/sqlalchemy/migrate_repo/versions/184_fix_159_migration_sync_shadow_table.py
16
2507
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 IBM Corp. # 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/licen...
apache-2.0
vguerci/Deluge.app
deluge/core/eventmanager.py
3
3146
# # eventmanager.py # # Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com> # # Deluge is free software. # # You may 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 ...
gpl-3.0
bbedward/ZenKernel_Angler
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
AlexMathew/csipy-exercises
solution/words.py
1
1277
import sys def setup(words): new_words = [] for word in words: new_words.append(word.lower()) words = new_words # This could have been done easier with list comprehensions. # words = [word.lower() for word in words] wordset = set() wordcount = dict() for word in words: prev_size = len(wordset) wordset.ad...
mit
inf0-warri0r/music_cat
classifier/classifier.py
1
4355
#!/usr/bin/env python """ Author : tharindra galahena (inf0_warri0r) Project: classifing music using neural network Blog : http://www.inf0warri0r.blogspot.com Date : 23/05/2013 License: Copyright 2013 Tharindra Galahena This is free software: you can redistribute it and/or modify it under the terms of the G...
agpl-3.0
unseenlaser/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_numbers.py
45
8794
from ctypes import * import unittest import struct def valid_ranges(*types): # given a sequence of numeric types, collect their _type_ # attribute, which is a single format character compatible with # the struct module, use the struct module to calculate the # minimum and maximum value allowed for this...
apache-2.0
dials/dials
tests/algorithms/indexing/test_non_primitive_basis.py
1
1945
import pytest import scitbx.matrix from cctbx import sgtbx from cctbx.sgtbx import bravais_types from dxtbx.model import Crystal, Experiment, ExperimentList from dials.algorithms.indexing import assign_indices, non_primitive_basis from dials.array_family import flex @pytest.mark.parametrize("space_group_symbol", br...
bsd-3-clause
vijeth-aradhya/coala-bears
bears/js/ESLintBear.py
1
2949
import json from coalib.bearlib.abstractions.Linter import linter from dependency_management.requirements.NpmRequirement import NpmRequirement from coalib.results.Diff import Diff from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY from coalib.results.Result import Result @linter(executable='eslint', ...
agpl-3.0
CVML/cvxpy
examples/extensions/feature_selection.py
11
1062
from cvxpy import * from mixed_integer import * import numpy as np # Feature selection on a linear kernel SVM classifier. # Uses the Alternating Direction Method of Multipliers # with a (non-convex) cardinality constraint. # Generate data. np.random.seed(1) N = 50 M = 40 n = 10 data = [] for i in xrange(N): data ...
gpl-3.0
JesseLivezey/plankton
pylearn2/space/__init__.py
4
86621
""" Classes that define how vector spaces are formatted Most of our models can be viewed as linearly transforming one vector space to another. These classes define how the vector spaces should be represented as theano/numpy variables. For example, the VectorSpace class just represents a vector space with a vector, an...
bsd-3-clause
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/numpy/numarray/util.py
94
1547
import os import numpy as np __all__ = ['MathDomainError', 'UnderflowError', 'NumOverflowError', 'handleError', 'get_numarray_include_dirs'] class MathDomainError(ArithmeticError): pass class UnderflowError(ArithmeticError): pass class NumOverflowError(OverflowError, ArithmeticError): pass ...
agpl-3.0
start-jsk/jsk_apc
demos/instance_occlsegm/examples/synthetic2d/instance_image_fg_extraction/generate_item_data_mask_pred.py
2
2320
#!/usr/bin/env python import argparse import chainer import fcn import numpy as np import tqdm import instance_occlsegm_lib from instance_occlsegm_lib.contrib import synthetic2d def main(): parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) item_data_cho...
bsd-3-clause
Jgarcia-IAS/localizacion
openerp/addons-extra/odoo-pruebas/odoo-server/addons/l10n_tr/__openerp__.py
170
2160
# -*- 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
unreal666/namebench
libnamebench/cli.py
173
4760
#!/usr/bin/env python # Copyright 2009 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...
apache-2.0
javilonas/NCam
cross/android-toolchain/lib/python2.7/xml/sax/saxutils.py
43
11384
"""\ A library of useful helper classes to the SAX classes, for the convenience of application and driver writers. """ import os, urlparse, urllib, types import io import sys import handler import xmlreader try: _StringTypes = [types.StringType, types.UnicodeType] except AttributeError: _StringTypes = [types....
gpl-3.0
Sinar/mapit
bin/scrape_admin_boundaries_tables.py
2
2263
#!/usr/bin/env python import sys, re from bs4 import BeautifulSoup import urllib2 url = "http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative" f = urllib2.urlopen(url) data = f.read() f.close() soup = BeautifulSoup(data, "lxml") def strip_all_tags(element): for br in element.find_all('br'): ...
agpl-3.0
40123210/2015cd-midterm2
static/Brython3.1.1-20150328-091302/Lib/datetime.py
628
75044
"""Concrete date/time and related types. See http://www.iana.org/time-zones/repository/tz-link.html for time zone and DST data sources. """ import time as _time import math as _math def _cmp(x, y): return 0 if x == y else 1 if x > y else -1 MINYEAR = 1 MAXYEAR = 9999 _MAXORDINAL = 3652059 # date.max.toordinal()...
agpl-3.0
Big-B702/python-for-android
python3-alpha/python3-src/Lib/gzip.py
47
21968
"""Functions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module import struct, sys, time, os import zlib import builtins import io __all__ = ["GzipFile", "...
apache-2.0
franekp/millandict
ankidict/thirdparty/cherrypy/wsgiserver/ssl_builtin.py
12
4032
"""A library for integrating Python's builtin ``ssl`` library with CherryPy. The ssl module must be importable for SSL functionality. To use this module, set ``CherryPyWSGIServer.ssl_adapter`` to an instance of ``BuiltinSSLAdapter``. """ try: import ssl except ImportError: ssl = None try: from _pyio imp...
mit
googleapis/gapic-generator-python
tests/integration/goldens/asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_feeds_async.py
1
1458
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
elainenaomi/sciwonc-dataflow-examples
dissertation2017/Experiment 1B/instances/10_2_workflow_full_10files_secondary_wmj_3sh_3rs_with_annot_with_proj_3s_range_old/taskevent_8/TaskEvent_8.py
32
6282
#!/usr/bin/env python """ Computes per event type: - how many tasks are per event? - which is the average and standard deviation of CPU request per event? - which is the average and standard deviation of Memory request per event? """ # It will connect to DataStoreClient from sciwonc.dataflow.DataStoreClient impo...
gpl-3.0
bc-python-tools/mistool
test/python/dict/test_dictvalues.py
1
1422
#!/usr/bin/env python3 # --------------------- # # -- SEVERAL IMPORTS -- # # --------------------- # from pathlib import Path from pytest import fixture from orpyste.data import ReadBlock as READ # ------------------- # # -- MODULE TESTED -- # # ------------------- # from mistool import python_use # -----------...
gpl-3.0
mdanielwork/intellij-community
python/helpers/sphinxcontrib/napoleon/docstring.py
44
32526
# -*- coding: utf-8 -*- # Copyright 2014 Rob Ruana # Licensed under the BSD License, see LICENSE file for details. """Classes for docstring parsing and formatting.""" import collections import inspect import re import sys from six.moves import range from pockets import modify_iter from six import string_types _dire...
apache-2.0
jakespringer/angr_ctf
dist/scaffold15.py
4
9186
# This binary takes both an integer and a string as a parameter. A certain # integer input causes the program to reach a buffer overflow with which we can # read a string from an arbitrary memory location. Our goal is to use Angr to # search the program for this buffer overflow and then automatically generate # an exp...
gpl-3.0
nfg/yagmail
yagmail/error.py
4
1173
"""Contains the exceptions""" class YagConnectionClosed(Exception): """ The connection object has been closed by the user. This object can be used to send emails again after logging in, using self.login(). """ pass class YagAddressError(Exception): """ This means that the address w...
mit
shadow000902/blog_source
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
327
132617
# 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. import copy import ntpath import os import posixpath import re import subprocess import sys import gyp.common import gyp.easy_xml as easy_xml import gyp.generator...
mit
andriy-s/django-rest-framework
rest_framework/viewsets.py
21
5303
""" ViewSets are essentially just a type of class based view, that doesn't provide any method handlers, such as `get()`, `post()`, etc... but instead has actions, such as `list()`, `retrieve()`, `create()`, etc... Actions are only bound to methods at the point of instantiating the views. user_list = UserViewSet.a...
bsd-2-clause
bikong2/scikit-learn
sklearn/tests/test_discriminant_analysis.py
19
11711
try: # Python 2 compat reload except NameError: # Regular Python 3+ import from importlib import reload import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.t...
bsd-3-clause
priseborough/ardupilot
Tools/ardupilotwaf/ardupilotwaf.py
1
14418
#!/usr/bin/env python # encoding: utf-8 from __future__ import print_function from waflib import Build, ConfigSet, Configure, Context, Errors, Logs, Options, Utils from waflib.Configure import conf from waflib.Scripting import run_command from waflib.TaskGen import before_method, feature import os.path, os from collec...
gpl-3.0
havatv/QGIS
tests/src/python/test_qgsogcutils.py
45
17768
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsOgcUtils. From build dir, run: ctest -R PyQgsOgcUtils -V .. note:: 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,...
gpl-2.0
aurelijusb/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_future4.py
58
1513
from __future__ import unicode_literals import unittest from test import test_support class TestFuture(unittest.TestCase): def assertType(self, obj, typ): self.assert_(type(obj) is typ, "type(%r) is %r, not %r" % (obj, type(obj), typ)) def test_unicode_strings(self): self.assertTy...
apache-2.0
usc-isi/horizon-old
horizon/horizon/dashboards/settings/user/urls.py
1
1066
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/nbconvert/preprocessors/tests/test_svg2pdf.py
11
2336
"""Tests for the svg2pdf preprocessor""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from ipython_genutils.testing import decorators as dec from nbformat import v4 as nbformat from .base import PreprocessorTestsBase from ..svg2pdf import SVG2PDFPreprocessor ...
mit
hifly/Pentaho-reports-for-OpenERP
openerp_addon/pentaho_reports/ui.py
7
18357
# -*- encoding: utf-8 -*- import os import base64 from openerp.tools.safe_eval import safe_eval from openerp import models, fields, api, _ from openerp.exceptions import except_orm from openerp.tools import config from openerp import SUPERUSER_ID import core from java_oe import JAVA_MAPPING, check_java_list, PARAM_...
gpl-2.0
codelucas/facebook-context
backend-flask/backend/example.py
1
15518
#!/usr/bin/env python # Copyright 2013 AlchemyAPI # # 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 applicab...
apache-2.0
hammerhorn/hammerhorn-jive
cjh/letterator.py
6
1511
#!/usr/bin/env python """ Generates sequences, e.g., 'a', 'b', 'c', ... , 'z', 'aa', 'bb' .... and in the same manner for capital letters. """ class Letter(object): """ * Convert to closure or lambda of some kind? These two generators have a lot in common.... """ pass_no = 1 @classmethod ...
gpl-2.0
KaranToor/MA450
google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/boto/sdb/regioninfo.py
167
1524
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # 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 res...
apache-2.0
PDuckworth/strands_qsr_lib
qsr_prob_rep/src/qsrrep_utils/qtc_model_creation.py
5
4167
# -*- coding: utf-8 -*- from qsrrep_utils.model_creation_abstractclass import ModelCreationAbstractclass, return_numpy_array import numpy as np class QTCModelCreation(ModelCreationAbstractclass): class qtc_types(): qtcbs = 'qtcbs' qtccs = 'qtccs' qtcbcs = 'qtcbcs' qtch = 'qtch' ...
mit
oblique-labs/pyVM
rpython/rlib/unicodedata/test/test_unicodedata.py
1
6594
# encoding: utf-8 import random import unicodedata import py from rpython.rlib.unicodedata import ( unicodedb_3_2_0, unicodedb_5_2_0, unicodedb_6_0_0, unicodedb_6_2_0, unicodedb_8_0_0) class TestUnicodeData(object): def setup_class(cls): if unicodedata.unidata_version != '5.2.0': py....
mit
dereneaton/ipyrad
ipyrad/core/paramsinfo.py
1
21970
#!/usr/bin/env python """ Return explanation and options for each parameter. ip.get_params_info(1) or ip.get_params_info("project_dir") return the same result. If not argument, a summary of the available parameters and their numbered references is returned. Parameter info is stored as a dict of tupl...
gpl-3.0
pshchelo/heat
heat/engine/resources/stack_resource.py
1
20765
# # 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 # ...
apache-2.0
hds-lab/coding-ml
msgvis/apps/enhance/migrations/0002_auto_20160222_0230.py
1
1306
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('enhance', '0001_initial'), (b'auth', b'__first__'), # This line and the next line is for fixi...
mit
cchamberlain/npm-msys2
node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
1509
17165
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
artistic-2.0
SnappleCap/oh-mainline
vendor/packages/south/south/tests/db_firebird.py
93
1143
from django.db import models from south.db import db from south.tests import unittest, skipUnless class FirebirdTests(unittest.TestCase): """ Tests firebird related issues """ def setUp(self): print('=' * 80) print('Begin Firebird test') def tearDown(self): print('End F...
agpl-3.0
Endika/OpenUpgrade
addons/l10n_in_hr_payroll/report/payslip_report.py
340
3978
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
Nick-Hall/gramps
data/man/pl/conf.py
12
7708
# -*- coding: utf-8 -*- # # Gramps documentation build configuration file, created by # sphinx-quickstart on Sat Dec 1 14:38:29 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
gpl-2.0
BaichuanWu/Blog_on_django
site-packages/django/test/utils.py
52
17489
from contextlib import contextmanager import logging import re import sys import time from unittest import skipUnless import warnings from functools import wraps from xml.dom.minidom import parseString, Node from django.apps import apps from django.conf import settings, UserSettingsHolder from django.core import mail ...
mit
jj1bdx/wspr
WsprMod/iq.py
1
4726
#------------------------------------------------------------------ iq from Tkinter import * import Pmw import g import w import time import tkMessageBox import pickle def done(): root.withdraw() root=Toplevel() root.withdraw() root.protocol('WM_DELETE_WINDOW',done) if g.Win32: root.iconbitmap("wsjt.ico") root.ti...
gpl-2.0
xinwu/horizon
openstack_dashboard/dashboards/project/stacks/mappings.py
9
14997
# 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 th...
apache-2.0
zestyr/lbry
lbrynet/core/server/ServerRequestHandler.py
1
5866
import json import logging from twisted.internet import interfaces, defer from zope.interface import implements from lbrynet.interfaces import IRequestHandler log = logging.getLogger(__name__) class ServerRequestHandler(object): """This class handles requests from clients. It can upload blobs and return req...
mit
alexeyum/scikit-learn
sklearn/externals/joblib/hashing.py
31
10064
""" Fast cryptographic hash of Python objects, with a special case for fast hashing of numpy arrays. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import hashlib import sys import types import struct import io...
bsd-3-clause
RealImpactAnalytics/airflow
tests/contrib/hooks/test_databricks_hook.py
10
9514
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
rhattersley/iris
lib/iris/fileformats/um_cf_map.py
5
84218
# (C) British Crown Copyright 2013 - 2016, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
diegodelemos/reana-job-controller
tests/test_job_manager.py
1
4870
# -*- coding: utf-8 -*- # # This file is part of REANA. # Copyright (C) 2019 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """REANA-Job-Controller Job Manager tests.""" import json import os import uuid import mock ...
mit
intgr/django
django/contrib/sites/managers.py
132
1929
from django.conf import settings from django.core import checks from django.core.exceptions import FieldDoesNotExist from django.db import models class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the current site." use_in_migrations = True def __init__(self, f...
bsd-3-clause
ptcrypto/pycoin
tests/blockchain_test.py
22
8237
from pycoin.blockchain.BlockChain import BlockChain class FakeBlock(object): def __init__(self, n, previous_block_hash=None): if previous_block_hash is None: previous_block_hash = n - 1 self.n = n self.previous_block_hash = previous_block_hash self.difficulty = 1 ...
mit
ysywh/ryu
ryu/contrib/tinyrpc/transports/zmq.py
43
2299
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import # needed for zmq import import zmq from . import ServerTransport, ClientTransport class ZmqServerTransport(ServerTransport): """Server transport based on a :py:const:`zmq.ROUTER` socket. :param socket: A :py:const:`zmq.RO...
apache-2.0
0x19/flask-peewee
flask_peewee/tests/auth.py
7
8613
from __future__ import with_statement import datetime try: import urlparse except ImportError: from urllib import parse as urlparse from flask import get_flashed_messages from flask import request from flask import session from flask import url_for from flask_peewee.auth import Auth from flask_peewee.auth im...
mit
kencochrane/docker-django-demo
dockerdemo/voting/migrations/0001_initial.py
1
1782
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-02-16 20:05 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Creat...
mit
boyuegame/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py
2936
3291
######################## 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...
lgpl-3.0
WillGuan105/django
tests/admin_widgets/models.py
227
4760
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible class MyFileField(models.FileField): pass @python_2_unicode_compatible class Member(models.Model): name = models.CharField(max_lengt...
bsd-3-clause