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
Laufire/ec
tests/test_utils.py
1
1168
r""" Test ec.utils. """ import unittest from ec.utils import get, static, custom, walk from support.helpers import RawInputHook as RIH, expect_exception # Tests class TestUtils(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_get(self): Inputs = 'a', 1 RIH.values(*I...
bsd-3-clause
ric2b/Vivaldi-browser
chromium/native_client_sdk/src/doc/conf.py
103
6018
# Copyright (c) 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. # -*- coding: utf-8 -*- # # Native Client documentation build configuration file, created by # sphinx-quickstart on Thu Aug 15 11:31:06 2013. # # This fi...
bsd-3-clause
lepistone/account-financial-reporting
__unported__/account_financial_report_webkit_xls/__init__.py
37
1249
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under...
agpl-3.0
CARocha/estudiocafe
lugar/models.py
2
1837
# -*- coding: UTF-8 -*- from django.db import models class Pais(models.Model): nombre = models.CharField(max_length=200) class Meta: verbose_name=u'Pais' verbose_name_plural=u'Paises' def __unicode__(self): return self.nombre class Departamento(models.Model): id = models.Int...
mit
DualSpark/ansible
v1/ansible/cache/base.py
159
1241
# (c) 2014, Brian Coca, Josh Drake, et al # # 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
mike-perdide/gitbuster
gitbuster/q_git_delegate.py
1
4118
# q_git_delegate.py # Copyright (C) 2010 Julien Miotte <miotte.julien@gmail.com> # # This module is part of gitbuster and is released under the GPLv3 # License: http://www.gnu.org/licenses/gpl-3.0.txt # from PyQt4.QtCore import QDateTime, QVariant, Qt, SIGNAL, QRect from PyQt4.QtGui import QDateTimeEdit, QItemDelegate...
gpl-3.0
Novasoft-India/OperERP-AM-Motors
openerp/addons/account_bank_statement_extensions/res_partner_bank.py
52
1601
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
WorkingOfTimtohyZhang/shadowsocks
tests/coverage_server.py
1072
1655
#!/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
heesub/linux
scripts/gdb/linux/lists.py
509
3631
# # gdb helper commands and functions for Linux kernel debugging # # list tools # # Copyright (c) Thiebaud Weksteen, 2015 # # Authors: # Thiebaud Weksteen <thiebaud@weksteen.fr> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import utils list_head = utils.CachedType("st...
gpl-2.0
hofschroeer/gnuradio
gr-blocks/python/blocks/qa_tag_share.py
12
2402
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2017 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 versio...
gpl-3.0
dmlc/tvm
tutorials/language/scan.py
3
6333
# 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...
apache-2.0
r0b0/virt-manager
src/virtManager/console.py
2
42104
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2008 Red Hat, Inc. # Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com> # Copyright (C) 2010 Marc-André Lureau <marcandre.lureau@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Lic...
gpl-2.0
SetBased/py-stratum
pystratum/command/LoaderCommand.py
1
3242
""" PyStratum """ import configparser from pydoc import locate from cleo import Command, Input, Output from pystratum.RoutineLoader import RoutineLoader from pystratum.style.PyStratumStyle import PyStratumStyle class LoaderCommand(Command): """ Command for loading stored routines into a MySQL/MsSQL/PgSQL in...
mit
m-lab/operator
tools/get-mlab-sshconfig.py
5
14623
#!/usr/bin/env python import getpass import xmlrpclib import os import sys import re import ssl SESSION_DIR=os.environ['HOME'] + "/.ssh" SESSION_FILE=SESSION_DIR + "/ssh_mlab_session" API_URL = "https://boot.planet-lab.org/PLCAPI/" VERBOSE=False DEBUG=False SEVEN_DAYS=60*60*24*7 SSL_CONTEXT = ssl.SSLContext(ssl.PROTO...
apache-2.0
luaduck/suds
soapclient.py
1
6841
### # This file is part of Soap. # # Soap is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation, version 2. # # Soap is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without ev...
gpl-2.0
cloudnull/skylab
skylab/executable.py
1
9051
# ============================================================================= # Copyright [2013] [Kevin Carter] # License Information : # This software has no warranty, it is provided 'as is'. It is your # responsibility to validate the behavior of the routines and its accuracy # using the code provided. Consult the ...
gpl-3.0
utecuy/edx-platform
lms/djangoapps/teams/migrations/0004_auto__add_field_courseteam_discussion_topic_id__add_field_courseteam_l.py
46
6547
# -*- coding: utf-8 -*- import pytz from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'CourseTeam.last_activity_at' db.add_column('t...
agpl-3.0
rcorrieri/dnspython
dns/entropy.py
8
3885
# Copyright (C) 2009, 2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND...
isc
rjschof/gem5
src/arch/x86/isa/insts/simd64/integer/save_and_restore_state.py
91
2168
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
bsd-3-clause
abdellatifkarroum/odoo
openerp/addons/test_impex/tests/test_import.py
154
30429
# -*- coding: utf-8 -*- import openerp.modules.registry import openerp from openerp.tests import common from openerp.tools.misc import mute_logger def ok(n): """ Successful import of ``n`` records :param int n: number of records which should have been imported """ return n, 0, 0, 0 def error(row, me...
agpl-3.0
Habasari/sms-tools
lectures/08-Sound-transformations/plots-code/stftFiltering-orchestra.py
18
1677
import numpy as np import time, os, sys import matplotlib.pyplot as plt sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/transformations/')) import utilFunctions as UF impo...
agpl-3.0
zsiciarz/django
tests/generic_views/test_dates.py
26
34915
import datetime from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, override_settings, skipUnlessDBFeature from django.test.utils import requires_tz_support from django.utils import timezone from .models import Artist, Author, Book, BookSigning, Page def _make_books(n, base_dat...
bsd-3-clause
google/resultstoreui
resultstoreui/resultstoreapi/cloud/devtools/resultstore_v2/proto/resultstore_download_pb2.py
2
77293
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/devtools/resultstore_v2/proto/resultstore_download.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection ...
apache-2.0
jolyonb/edx-platform
openedx/core/djangoapps/util/tests/test_update_fixtures.py
6
1877
# -*- coding: utf-8 -*- """ Tests of the update_fixtures management command for bok-choy test database initialization. """ from __future__ import absolute_import, division, print_function, unicode_literals import os import pytest from django.contrib.sites.models import Site from django.core.management import call_com...
agpl-3.0
scorphus/django
django/db/models/manager.py
301
10722
import copy import inspect from importlib import import_module from django.db import router from django.db.models.query import QuerySet from django.utils import six from django.utils.encoding import python_2_unicode_compatible def ensure_default_manager(cls): """ Ensures that a Model subclass contains a defa...
bsd-3-clause
shsingh/ansible
lib/ansible/module_utils/facts/virtual/sunos.py
199
5481
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
ryfeus/lambda-packs
Tensorflow_LightGBM_Scipy_nightly/source/numpy/distutils/lib2def.py
193
3512
from __future__ import division, absolute_import, print_function import re import sys import os import subprocess __doc__ = """This module generates a DEF file from the symbols in an MSVC-compiled DLL import library. It correctly discriminates between data and functions. The data is collected from the output of the...
mit
komsas/partner-contact
passport/__init__.py
35
1077
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013-2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and...
agpl-3.0
HyperBaton/ansible
lib/ansible/modules/network/slxos/slxos_vlan.py
38
9666
#!/usr/bin/python # # (c) 2018 Extreme Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
0k/OpenUpgrade
addons/pad/py_etherpad/__init__.py
505
7804
"""Module to talk to EtherpadLite API.""" import json import urllib import urllib2 class EtherpadLiteClient: """Client to talk to EtherpadLite API.""" API_VERSION = 1 # TODO probably 1.1 sometime soon CODE_OK = 0 CODE_INVALID_PARAMETERS = 1 CODE_INTERNAL_ERROR = 2 CODE_INVALID_FUNCTION = 3 ...
agpl-3.0
ujenmr/ansible
lib/ansible/modules/network/aci/aci_bd.py
22
15040
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
dracos/django
tests/forms_tests/field_tests/test_floatfield.py
34
4392
from django.forms import FloatField, NumberInput, ValidationError from django.test import SimpleTestCase from django.test.utils import override_settings from django.utils import formats, translation from . import FormFieldAssertionsMixin class FloatFieldTest(FormFieldAssertionsMixin, SimpleTestCase): def test_f...
bsd-3-clause
ptonner/GPy
GPy/testing/examples_tests.py
15
3721
# Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) import unittest import numpy as np import GPy import inspect import pkgutil import os import random from nose.tools import nottest import sys import itertools class ExamplesTests(unittest.TestCase): de...
bsd-3-clause
KaranToor/MA450
google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/tests/integration/sdb/__init__.py
761
1104
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # # 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, modi...
apache-2.0
tomasreimers/tensorflow-emscripten
tensorflow/python/kernel_tests/pad_op_test.py
66
8461
# 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
huiren/ece511
src/cpu/DummyChecker.py
69
2259
# Copyright (c) 2010-2011 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 functional...
bsd-3-clause
ezbake/ezbake-common-python
security/test/test_tokencache.py
2
3597
# Copyright (C) 2013-2014 Computer Sciences Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
apache-2.0
VisheshHanda/production_backup
erpnext/utilities/page/leaderboard/leaderboard.py
12
6774
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function import frappe import json from operator import itemgetter from frappe.utils import add_to_date from erpnext.accounts.party import get_dashboard_info from erpnext.a...
gpl-3.0
kmaglione/amo-validator
validator/testcases/javascript/obsolete.py
1
3693
from __future__ import absolute_import, print_function, unicode_literals from .jstypes import Hook, Interfaces OBSOLETE_EXTENSION_MANAGER = { 'on_get': 'This interface is part of the obsolete extension manager ' 'interface, which is not available in any remotely modern ' 'version of F...
bsd-3-clause
tchellomello/home-assistant
homeassistant/components/roomba/sensor.py
1
1696
"""Sensor for checking the battery level of Roomba.""" import logging from homeassistant.components.vacuum import STATE_DOCKED from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE from homeassistant.helpers.icon import icon_for_battery_level from .const import BLID, DOMAIN, ROOMBA_SESSION from .irobot_bas...
apache-2.0
NikolaYolov/invenio_backup
modules/webbasket/lib/webbasket_regression_tests.py
17
8707
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2010, 2011 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 ## Licens...
gpl-2.0
michalliu/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/xmlrpc/client.py
9
48129
# # XML-RPC CLIENT LIBRARY # $Id$ # # an XML-RPC client interface for Python. # # the marshalling and response parser code can also be used to # implement XML-RPC servers. # # Notes: # this version is designed to work with Python 2.1 or newer. # # History: # 1999-01-14 fl Created # 1999-01-15 fl Changed dateTime to u...
gpl-2.0
AsimmHirani/ISpyPi
tensorflow/contrib/tensorflow-master/tensorflow/examples/how_tos/reading_data/fully_connected_reader.py
52
7416
# 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
frreiss/tensorflow-fred
tensorflow/python/distribute/distribute_coordinator_test.py
8
36873
# 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
DreamerKing/LightweightHtmlWidgets
publish-rc/v1.0/files/Ipy.Lib/tokenize.py
122
16465
"""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 token.py) ...
gpl-3.0
adammenges/statsmodels
statsmodels/tools/tests/test_tools.py
26
18818
""" Test functions for models.tools """ from statsmodels.compat.python import lrange, range import numpy as np from numpy.random import standard_normal from numpy.testing import (assert_equal, assert_array_equal, assert_almost_equal, assert_string_equal, TestCase) from nose.tools import (asse...
bsd-3-clause
zhufangxing/ndnCDN
src/visualizer/bindings/modulegen__gcc_ILP32.py
82
361459
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
heli522/scikit-learn
examples/neighbors/plot_approximate_nearest_neighbors_scalability.py
225
5719
""" ============================================ Scalability of Approximate Nearest Neighbors ============================================ This example studies the scalability profile of approximate 10-neighbors queries using the LSHForest with ``n_estimators=20`` and ``n_candidates=200`` when varying the number of sa...
bsd-3-clause
sebast1219/Monocle
web_sanic.py
3
6230
#!/usr/bin/env python3 from pkg_resources import resource_filename from time import time from sanic import Sanic from sanic.response import html, json from jinja2 import Environment, PackageLoader, Markup from asyncpg import create_pool from monocle import sanitized as conf from monocle.bounds import center from mon...
mit
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/numpy/lib/tests/test__version.py
126
2125
"""Tests for the NumpyVersion class. """ from __future__ import division, absolute_import, print_function from numpy.testing import assert_, run_module_suite, assert_raises from numpy.lib import NumpyVersion def test_main_versions(): assert_(NumpyVersion('1.8.0') == '1.8.0') for ver in ['1.9.0', '2.0.0', '1...
mit
pvreman/cobbler
cobbler/collection_repos.py
3
2847
""" Repositories in cobbler are way to create a local mirror of a yum repository. When used in conjunction with a mirrored kickstart tree (see "cobbler import") outside bandwidth needs can be reduced and/or eliminated. Copyright 2006-2009, Red Hat, Inc Michael DeHaan <mdehaan@redhat.com> This program is free software...
gpl-2.0
Omegaphora/external_chromium_org_tools_gyp
test/mac/gyptest-strip-default.py
232
2448
#!/usr/bin/env python # 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. """ Verifies that the default STRIP_STYLEs match between different generators. """ import TestGyp import re import subprocess import sys i...
bsd-3-clause
bcopeland/speccy
scanner.py
1
9599
#!/usr/bin/python from multiprocessing import Value from threading import Thread, Lock import os import time class Scanner(object): interface = None freqlist = None process = None debugfs_dir = None is_ath10k = False lock = None run = True def dev_to_phy(self, dev): f = open(...
gpl-2.0
aequitas/CouchPotato
library/minify/js.py
10
7663
#!/usr/bin/python # This code is original from jsmin by Douglas Crockford, it was translated to # Python by Baruch Even. The original code had the following copyright and # license. # # /* jsmin.c # 2007-05-22 # # Copyright (c) 2002 Douglas Crockford (www.crockford.com) # # Permission is hereby granted, free of ch...
gpl-3.0
rainwoodman/pmesh
pmesh/coarray.py
2
10040
""" CoArray/MPI in Python This is a failed attempt to implement the CoArray 1.0 standard: http://caf.rice.edu/documentation/index.html The implementation uses the MPI 1.0 subset, mostly because I am not quite familar with MPI.Win objects and how they interact with numpy. mpi4py also has a...
gpl-3.0
zaffra/Donate
django/core/cache/__init__.py
16
2924
""" Caching framework. This package defines set of cache backends that all conform to a simple API. In a nutshell, a cache is a set of values -- which can be any object that may be pickled -- identified by string keys. For the complete API, see the abstract BaseCache class in django.core.cache.backends.base. Client ...
bsd-3-clause
halaszk/universal7420
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
jacques/connector
test/feedvalidator/feedvalidator/formatter/base.py
2
2272
"""$Id: base.py 511 2006-03-07 05:19:10Z rubys $""" __author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>" __version__ = "$Revision: 511 $" __date__ = "$Date: 2006-03-07 18:19:10 +1300 (Tue, 07 Mar 2006) $" __copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim" __license...
gpl-2.0
zieckey/sdhash
sdhash-ui/cherrypy/test/test_caching.py
36
13042
import datetime import gzip from itertools import count import os curdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) import sys import threading import time import urllib import cherrypy from cherrypy._cpcompat import next, ntob, quote, xrange from cherrypy.lib import httputil gif_bytes = ntob('GIF89a\x01\...
apache-2.0
opticron/asterisk-testsuite-temporary
contrib/scripts/rlmi_demo.py
5
3166
#!/usr/bin/env python """Demonstration of parsing and printing RLMI XML document. This script is meant to demonstrate how, given an RLMI XML document, one can use the pyxb-generated rlmi module to parse the XML document into easy-to peruse objects. The XML document used in this demo is from RFC 4662, section 5.1. Thi...
gpl-2.0
tavendo/AutobahnPython
autobahn/twisted/test/test_application_runner.py
3
5064
############################################################################### # # The MIT License (MIT) # # Copyright (c) Crossbar.io Technologies GmbH # # 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 ...
mit
kretusmaximus/MicroFTP.py
microftp/common_view.py
1
2633
# -*- coding: utf-8 -*- import Tkinter import tkFont class Window(Tkinter.Tk): def __init__(self, parent): Tkinter.Tk.__init__(self,parent) self.parent = parent def initialize(self): pass class Listbox(Tkinter.Listbox): def autowidth(self, maxwidth): f = tkFont.Font(font...
mit
mm112287/2015cda-24
static/Brython3.1.1-20150328-091302/Lib/os.py
635
35582
r"""OS routines for Mac, NT, or Posix depending on what system we're on. This exports: - all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc. - os.path is either posixpath or ntpath - os.name is either 'posix', 'nt', 'os2' or 'ce'. - os.curdir is a string representing the current directory ('.' or...
gpl-3.0
sanjeevtripurari/hue
desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/async/deltree.py
40
2633
import ldap,ldap.async class DeleteLeafs(ldap.async.AsyncSearchHandler): """ Class for deleting entries which are results of a search. DNs of Non-leaf entries are collected in DeleteLeafs.nonLeafEntries. """ _entryResultTypes = ldap.async._entryResultTypes def __init__(self,l): ldap.async.AsyncSear...
apache-2.0
wfxiang08/changes
tests/changes/api/serializer/models/test_source.py
2
1686
from datetime import datetime from changes.api.serializer import serialize from changes.config import db from changes.models import Source from changes.testutils import TestCase class SourceCrumblerTest(TestCase): def test_simple(self): repo = self.create_repo() revision = self.create_revision(re...
apache-2.0
mariosky/evo-drawings
venv/lib/python2.7/site-packages/django/contrib/admindocs/middleware.py
327
1197
from django.conf import settings from django import http class XViewMiddleware(object): """ Adds an X-View header to internal HEAD requests -- used by the documentation system. """ def process_view(self, request, view_func, view_args, view_kwargs): """ If the request method is HEAD and ...
agpl-3.0
distributed-system-analysis/pbench
server/bin/pbench-server-prep-shim-002.py
1
12572
#!/usr/bin/env python3 # -*- mode: python -*- # This script is used to prepare the tarballs that a version 002 client # submits for further processing. It copies the tarballs and their MD5 # sums to the archive (after checking) and sets the state links, so # that the dispatch script will pick them up and get the ball ...
gpl-3.0
jart/tensorflow
tensorflow/contrib/cloud/python/ops/bigquery_reader_ops_test.py
75
9668
# 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
Donkyhotay/MoonPy
zope/rdb/tests/test_gadflyphantom.py
1
2917
############################################################################## # # Copyright (c) 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
gpl-3.0
kaushik94/sympy
sympy/integrals/tests/test_integrals.py
2
59772
from sympy import ( Abs, acos, acosh, Add, And, asin, asinh, atan, Ci, cos, sinh, cosh, tanh, Derivative, diff, DiracDelta, E, Ei, Eq, exp, erf, erfc, erfi, EulerGamma, Expr, factor, Function, gamma, gammasimp, I, Idx, im, IndexedBase, integrate, Interval, Lambda, LambertW, log, Matrix, Max, meijerg, Mi...
bsd-3-clause
kushalbhola/MyStuff
Practice/PythonApplication/env/Lib/site-packages/pandas/tests/tslibs/test_libfrequencies.py
2
2889
import pytest from pandas._libs.tslibs.frequencies import ( INVALID_FREQ_ERR_MSG, _period_str_to_code, get_rule_month, is_subperiod, is_superperiod, ) from pandas.tseries import offsets @pytest.mark.parametrize( "obj,expected", [ ("W", "DEC"), (offsets.Week(), "DEC"), ...
apache-2.0
ZeroZeng/RongZeng
Assignment4/ec2-54-201-254-197.us-west-2.compute.amazonaws.com/myproject.py
2
8213
# coding=utf-8 import os import json import requests import random from flask import Flask, request, Response import time application = Flask(__name__) # FILL THESE IN WITH YOUR INFO my_bot_name = 'rong_bot' #e.g. zac_bot my_slack_username = 'rong' #e.g. zac.wentzell slack_inbound_url = 'https://hooks.slack.com/s...
mit
zhuochenKIDD/FrameworkBenchmarks
frameworks/Python/AsyncIO/yocto_http/hello/services/redis.py
108
1447
from operator import itemgetter import asyncio from random import randint @asyncio.coroutine def get_random_record(container): idx = randint(1, 10000) random_number = yield from container.engines['redis'].get('world:%i' % idx) return {'Id': idx, 'RandomNumber': random_number} @asyncio.coroutine def get_r...
bsd-3-clause
noppelmax/boxup_gmailunread
boxup_gmailunread/boxup_gmailunread.py
2
1955
#!/bin/python import ConfigParser import os import logging import imaplib import time import signal from boxup_types import Colorcodes from boxup_types import MatrixData # Load from config file logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger("boxup_gmailunread") logger.info("Reading config-file.....
gpl-2.0
brianwrf/mongo-python-driver
bson/regex.py
21
4266
# Copyright 2013-2015 MongoDB, 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 writin...
apache-2.0
susansls/zulip
analytics/lib/counts.py
5
16695
from django.conf import settings from django.db import connection, models from django.db.models import F from django.utils import timezone from analytics.models import InstallationCount, RealmCount, \ UserCount, StreamCount, BaseCount, FillState, Anomaly, installation_epoch from zerver.models import Realm, UserPro...
apache-2.0
willhardy/django
django/contrib/gis/sitemaps/views.py
144
2365
from __future__ import unicode_literals from django.apps import apps from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.functions import AsKML, Transform from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz from django.core.exceptions import FieldDoesNotExi...
bsd-3-clause
CVML/cvxpy
examples/flows/commodity_flow.py
12
2470
from cvxpy import * import create_graph as g from max_flow import Edge, Node import pickle import random as r import cvxopt # Multi-commodity flow. COMMODITIES = 5 # Number of commodities. r.seed(1) class MultiEdge(Edge): """ An undirected, capacity limited edge with multiple commodities. """ def __init__(sel...
gpl-3.0
kingvuplus/gui_test2
lib/python/Plugins/SystemPlugins/FastScan/plugin.py
59
13191
# -*- coding: utf-8 -*- from os import path as os_path, walk as os_walk, unlink as os_unlink from Plugins.Plugin import PluginDescriptor from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.config import config, ConfigSelection, ConfigYesNo, getConfigListEntry, ConfigSubsection,...
gpl-2.0
renyi533/tensorflow
tensorflow/python/estimator/exporter.py
41
1274
# Copyright 2018 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
shams169/pythonProject
ContactsDir/env/lib/python3.6/site-packages/click/types.py
196
18864
import os import stat from ._compat import open_stream, text_type, filename_to_ui, \ get_filesystem_encoding, get_streerror, _get_argv_encoding, PY2 from .exceptions import BadParameter from .utils import safecall, LazyFile class ParamType(object): """Helper for converting values through types. The followin...
mit
CFDEMproject/LAMMPS
tools/eff/bohr2ang.py
57
2023
Info=""" Module name: bohr2ang.py Author: (c) Andres Jaramillo-Botero California Institute of Technology ajaramil@caltech.edu Project: pEFF Version: August 2009 Usage: python bohr2ang.py >>Name of data file (bohr): [datafile] Results: creates a datafile with extension .ang in real units """ import os currdir=os.g...
gpl-2.0
MERKAT0R/gmail-backup-com
svc/scripting/conversions.py
26
4057
# Copyright (C) 2008 Jan Svec and Filip Jurcicek # # YOU USE THIS TOOL ON YOUR OWN RISK! # # email: info@gmail-backup.com # # # Disclaimer of Warranty # ---------------------- # # Unless required by applicable law or agreed to in writing, licensor provides # this tool (and each contributor provides its contributio...
gpl-3.0
ollie314/kuma
kuma/users/tests/test_tasks.py
3
6195
import mock from waffle.models import Switch from django.conf import settings from django.contrib import messages as django_messages from django.core import mail from django.test import RequestFactory from allauth.account.models import EmailAddress from allauth.account.signals import user_signed_up from kuma.users.t...
mpl-2.0
Jusedawg/SickRage
lib/js2py/prototypes/jsregexp.py
54
1252
class RegExpPrototype: def toString(): flags = u'' if this.glob: flags += u'g' if this.ignore_case: flags += u'i' if this.multiline: flags += u'm' v = this.value if this.value else '(?:)' return u'/%s/'%v + flags def test(stri...
gpl-3.0
ekalosak/numpy
numpy/core/tests/test_extint128.py
94
5759
from __future__ import division, absolute_import, print_function import sys import itertools import contextlib import operator import numpy as np import numpy.core.multiarray_tests as mt from numpy.compat import long from numpy.testing import assert_raises, assert_equal INT64_MAX = np.iinfo(np.int64).max INT64_MIN...
bsd-3-clause
ruo91/letsencrypt
acme/acme/jose/interfaces_test.py
33
3627
"""Tests for acme.jose.interfaces.""" import unittest class JSONDeSerializableTest(unittest.TestCase): # pylint: disable=too-many-instance-attributes def setUp(self): from acme.jose.interfaces import JSONDeSerializable # pylint: disable=missing-docstring,invalid-name class Basic(JSO...
apache-2.0
abomyi/django
tests/utils_tests/test_inspect.py
157
1161
import unittest from django.utils import inspect class Person(object): def no_arguments(self): return None def one_argument(self, something): return something def just_args(self, *args): return args def all_kinds(self, name, address='home', age=25, *args, **kwargs): ...
bsd-3-clause
shsingh/ansible
lib/ansible/modules/net_tools/nmcli.py
9
54861
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Chris Long <alcamie@gmail.com> <chlong@redhat.com> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __met...
gpl-3.0
yhfudev/docsis3ns3
bindings/python/ns3modulegen.py
199
6413
LOCAL_MODULES = [ #'my_extra_api_definitions', ] import sys import os sys.path.insert(0, sys.argv[2]) from pybindgen import FileCodeSink, write_preamble from pybindgen.module import MultiSectionFactory import pybindgen.settings pybindgen.settings.deprecated_virtuals = False from ns3modulegen_generated i...
gpl-2.0
ArcherSys/ArcherSys
Lib/test/testcodec.py
1
3278
<<<<<<< HEAD <<<<<<< HEAD """ Test Codecs (used by test_charmapcodec) Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,e...
mit
Just-D/panda3d
direct/src/tkwidgets/AppShell.py
9
22036
""" AppShell provides a GUI application framework. This is an adaption of AppShell.py found in Python and Tkinter Programming by John E. Grayson which is a streamlined adaptation of GuiAppD.py, originally created by Doug Hellmann (doughellmann@mindspring.com). """ __all__ = ['AppShell'] from direct.showbase.DirectObj...
bsd-3-clause
kmoocdev2/edx-platform
lms/djangoapps/grades/tests/test_transformer.py
9
18585
""" Test the behavior of the GradesTransformer """ import datetime import random from copy import deepcopy import ddt import pytz from lms.djangoapps.course_blocks.api import get_course_blocks from lms.djangoapps.course_blocks.transformers.tests.helpers import CourseStructureTestCase from openedx.core.djangoapps.con...
agpl-3.0
kaku289/paparazzi
sw/airborne/test/ahrs/ahrs_utils.py
86
4923
#! /usr/bin/env python # Copyright (C) 2011 Antoine Drouin # # This file is part of Paparazzi. # # Paparazzi 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, or (at your option) # any later ...
gpl-2.0
andfoy/margffoy-tuay-server
env/lib/python2.7/site-packages/django/core/management/commands/runfcgi.py
120
1073
import argparse import warnings from django.core.management.base import BaseCommand from django.utils.deprecation import RemovedInDjango19Warning class Command(BaseCommand): help = "Runs this project as a FastCGI application. Requires flup." def add_arguments(self, parser): parser.add_argument('args...
gpl-2.0
MarkTseng/django-farmersale
farmersale-env/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/coordseq.py
79
3118
from ctypes import c_double, c_int, c_uint, POINTER from django.contrib.gis.geos.libgeos import GEOM_PTR, CS_PTR from django.contrib.gis.geos.prototypes.errcheck import last_arg_byref, GEOSException from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc ## Error-checking routines specific to coordinate se...
mit
ebrelsford/django-moderation
setup.py
1
1044
from setuptools import setup, find_packages import os version = '0.3.2' setup(name='django-moderation', version=version, description="Generic Django objects moderation application", long_description=open("README.rst").read() + "\n" + open(os.path.join("docs", "HISTORY.txt")).r...
bsd-3-clause
google/skia
infra/bots/recipe_modules/doxygen/resources/generate_and_upload_doxygen.py
18
2385
#!/usr/bin/env python # 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. """Generate Doxygen documentation.""" import datetime import os import shutil import subprocess import sys DOXYFILE_BASENAME = 'Do...
bsd-3-clause
mydongistiny/external_chromium_org
tools/deep_memory_profiler/accumulate.py
100
9536
#!/usr/bin/env python # 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. # A script to accumulate values from the 'dmprof cat' command into CSV or else. # # Usage: # ./accumulate.py -f <format> -t <template...
bsd-3-clause
akx/coffin
tests/test_env.py
1
1798
"""Test construction of the implicitly provided JinjaEnvironment, in the common.py module. """ from coffin.common import get_env from django.test.utils import override_settings def test_i18n(): with override_settings(USE_I18N=True): assert get_env().from_string('{{ _("test") }}').render() == 'test' cla...
bsd-3-clause