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
edespino/gpdb
gpMgmt/bin/lib/pysync.py
8
26899
#!/usr/bin/env python import os, sys if sys.hexversion < 0x2040400: sys.stderr.write("pysync.py needs python version at least 2.4.4.\n") sys.stderr.write("You are using %s\n" % sys.version) sys.stderr.write("Here is a guess at where the python executable is--\n") os.system("/bin/sh -c 'type python>&2'...
apache-2.0
75651/kbengine_cloud
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py
982
19608
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
lgpl-3.0
rahul67/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/yaml3/cyaml.py
274
3294
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader', 'CBaseDumper', 'CSafeDumper', 'CDumper'] from _yaml import CParser, CEmitter from .constructor import * from .serializer import * from .representer import * from .resolver import * class CBaseLoader(CParser, BaseConstructor, BaseResolver): def __ini...
apache-2.0
AuyaJackie/odoo
addons/account/wizard/account_report_common_account.py
371
1922
# -*- 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
gennad/www_gennad_org
django/contrib/localflavor/is_/is_postalcodes.py
438
4913
# -*- coding: utf-8 -*- IS_POSTALCODES = ( ('101', u'101 Reykjavík'), ('103', u'103 Reykjavík'), ('104', u'104 Reykjavík'), ('105', u'105 Reykjavík'), ('107', u'107 Reykjavík'), ('108', u'108 Reykjavík'), ('109', u'109 Reykjavík'), ('110', u'110 Reykjavík'), ('111', u'111 Reykjavík'...
bsd-3-clause
SciTools/cartopy
lib/cartopy/tests/mpl/test_contour.py
2
2820
# Copyright Cartopy Contributors # # This file is part of Cartopy and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. import matplotlib.pyplot as plt from matplotlib.testing.decorators import cleanup import numpy as np from numpy.testing ...
lgpl-3.0
jonathanunderwood/numpy
numpy/polynomial/polyutils.py
107
11167
""" Utililty classes and functions for the polynomial modules. This module provides: error and warning objects; a polynomial base class; and some routines used in both the `polynomial` and `chebyshev` modules. Error objects ------------- .. autosummary:: :toctree: generated/ PolyError base class fo...
bsd-3-clause
adit-chandra/tensorflow
tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/debug_info.py
11
1442
# 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
pyatl/podium-django
podium/talks/models.py
1
1201
from django.db import models from django.urls import reverse TALK_STATUS_CHOICES = ( ('S', 'Submitted'), ('A', 'Approved'), ('R', 'Rejected'), ('C', 'Confirmed'), ) class Talk(models.Model): speaker_name = models.CharField(max_length=1000) speaker_email = models.CharField(max_length=1000) ...
mit
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/django-1.3/django/forms/forms.py
156
21754
""" Form classes """ from django.core.exceptions import ValidationError from django.utils.copycompat import deepcopy from django.utils.datastructures import SortedDict from django.utils.html import conditional_escape from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode from django.utils.safest...
mit
jmhsi/justin_tinker
data_science/courses/learning_dl_packages/models/research/object_detection/core/losses.py
20
23854
# Copyright 2017 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
rosmo/ansible
lib/ansible/modules/database/influxdb/influxdb_user.py
18
8190
#!/usr/bin/python # (c) 2017, Vitaliy Zhhuta <zhhuta () gmail.com> # insipred by Kamil Szczygiel <kamil.szczygiel () intel.com> influxdb_database module # 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 __meta...
gpl-3.0
MoamerEncsConcordiaCa/tensorflow
tensorflow/contrib/image/python/kernel_tests/image_ops_test.py
12
5178
# 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
sambyers/o365_fmc
.venv/lib/python3.6/site-packages/pip/_vendor/distlib/scripts.py
333
15224
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from io import BytesIO import logging import os import re import struct import sys from .compat import sysconfig, detect_encoding, ZipFi...
gpl-3.0
safwanrahman/kitsune
kitsune/search/synonym_utils.py
21
2492
""" Utitilities for working with synonyms, both in the database and in ES. """ import re from kitsune.search import es_utils from kitsune.search.models import Synonym class SynonymParseError(Exception): """One or more parser errors were found. Has a list of errors found.""" def __init__(self, errors, *args,...
bsd-3-clause
akhmadMizkat/odoo
addons/base_geolocalize/models/res_partner.py
8
2549
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import json import urllib from openerp import api, fields, models, tools, _ from openerp.exceptions import UserError def geo_find(addr): url = 'https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address...
gpl-3.0
CTSRD-SOAAP/chromium-42.0.2311.135
tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/top_20.py
21
3397
# 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class Top20Page(page_module.Page): def __init__(se...
bsd-3-clause
sinbazhou/odoo
addons/account_followup/wizard/account_followup_print.py
217
16379
# -*- 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
gamingrobot/SpockBot
spockbot/vector.py
2
6613
from __future__ import division import math class BaseVector(object): _internal_vec_type = list def __init__(self, *values): self.vector = self._internal_vec_type(values) def init(self, *args): BaseVector.__init__(self, *args) return self def __iter__(self): return ...
mit
RunningBridgesOrg/twitter-translatebot
dbConnect.py
1
1957
import sqlite3 # convert sqlite resultset row into dict def dict_factory(cursor, row): try: d = {} if row != None : for idx, col in enumerate(cursor.description): d[col[0]] = row[idx] return d except sqlite3.DataError as msg: print ('Error retriev...
gpl-3.0
typemytype/defconAppKit
setup.py
1
1215
#!/usr/bin/env python import sys from setuptools import setup try: import fontTools except: print "*** Warning: defcon requires FontTools, see:" print " fonttools.sf.net" try: import robofab except: print "*** Warning: defcon requires RoboFab, see:" print " robofab.com" #if "sdist" in ...
mit
idjaw/keystone
keystone/contrib/endpoint_filter/migrate_repo/versions/002_add_endpoint_groups.py
14
1658
# Copyright 2014 Hewlett-Packard Company # # 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...
apache-2.0
zauonlok/cs231n
assignment3/cs231n/data_utils.py
19
7424
import cPickle as pickle import numpy as np import os from scipy.misc import imread def load_CIFAR_batch(filename): """ load single batch of cifar """ with open(filename, 'rb') as f: datadict = pickle.load(f) X = datadict['data'] Y = datadict['labels'] X = X.reshape(10000, 3, 32, 32).transpose(0,2,...
mit
Techlightenment/suds
suds/transport/options.py
200
2211
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
zstackio/zstack-utility
cephprimarystorage/cephprimarystorage/cephagent.py
1
41920
import tempfile __author__ = 'frank' import pprint import traceback import zstacklib.utils.daemon as daemon import zstacklib.utils.jsonobject as jsonobject import zstacklib.utils.lock as lock import zstacklib.utils.sizeunit as sizeunit from zstacklib.utils.report import * from zstacklib.utils.bash import * from zsta...
apache-2.0
BT-rmartin/odoo
addons/stock/__openerp__.py
261
4008
# -*- 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
tudorsirb/android_kernel_lge_jagnm
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
googlei18n/nototools
nototools/compare_fonts.py
3
23184
#!/usr/bin/env python # # Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
y12uc231/edx-platform
lms/djangoapps/class_dashboard/dashboard_data.py
56
23872
""" Computes the data to display on the Instructor Dashboard """ from util.json_request import JsonResponse import json from courseware import models from django.db.models import Count from django.utils.translation import ugettext as _ from xmodule.modulestore.django import modulestore from xmodule.modulestore.inheri...
agpl-3.0
mediawiki-utilities/python-mediawiki-utilities
mw/lib/sessions/functions.py
3
1936
import logging from .cache import Cache from . import defaults logger = logging.getLogger("mw.lib.sessions.functions") def cluster(user_events, cutoff=defaults.CUTOFF): """ Clusters user sessions from a sequence of user events. Note that, `event` data will simply be returned in the case of a revert. ...
mit
cowlicks/blaze
blaze/expr/table.py
15
1260
""" An abstract Table >>> accounts = TableSymbol('accounts', '{name: string, amount: int}') >>> deadbeats = accounts.name[accounts.amount < 0] """ from __future__ import absolute_import, division, print_function import datashape from datashape.predicates import isscalar, iscollection, isrecord from .expressions impor...
bsd-3-clause
mschwager/dnsleak
dnsleak.py
1
1931
#!/usr/bin/env python import argparse # Suppress Scapy's chattiness import logging logging.getLogger("scapy.runtime").setLevel(logging.WARNING) import scapy.all as sc sc.conf.verb = 0 expected_ips = [] def dns_callback(p): if expected_ips and p[sc.IP].dst not in expected_ips: logging.getLogger("scapy.r...
gpl-2.0
bousmalis/models
syntaxnet/dragnn/python/render_parse_tree_graphviz.py
15
2471
# -*- coding: utf-8 -*- # Copyright 2017 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 require...
apache-2.0
MRigal/django
django/db/backends/dummy/base.py
429
2570
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends.base.base import BaseDatabas...
bsd-3-clause
Kurocon/WISE
yowsup-master/src/Yowsup/ConnectionIO/connectionengine.py
18
3497
''' Copyright (c) <2012> Tarek Galal <tare2.galal@gmail.com> 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, m...
gpl-2.0
eckucukoglu/arm-linux-gnueabihf
lib/python2.7/test/test_dummy_thread.py
126
7181
"""Generic thread tests. Meant to be used by dummy_thread and thread. To allow for different modules to be used, test_main() can be called with the module to use as the thread implementation as its sole argument. """ import dummy_thread as _thread import time import Queue import random import unittest from test impo...
gpl-2.0
impowski/servo
tests/wpt/css-tests/tools/html5lib/html5lib/trie/py.py
817
1763
from __future__ import absolute_import, division, unicode_literals from six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError("All keys m...
mpl-2.0
zhangtao11/scrapy
scrapy/crawler.py
69
11182
import six import signal import logging import warnings from twisted.internet import reactor, defer from zope.interface.verify import verifyClass, DoesNotImplement from scrapy.core.engine import ExecutionEngine from scrapy.resolver import CachingThreadedResolver from scrapy.interfaces import ISpiderLoader from scrapy...
bsd-3-clause
MartinSavc/scikit-learn
sklearn/externals/joblib/memory.py
194
36287
""" A context object for caching a function's return value each time it is called with the same input arguments. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. from __future__ import with_statement import os import shutil ...
bsd-3-clause
vlinhd11/vlinhd11-android-scripting
python/src/Lib/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py
82
8840
"""Suite Terminal Suite: Terms and Events for controlling the Terminal application Level 1, version 1 Generated from /Applications/Utilities/Terminal.app AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'trmx' class Terminal_Suite_Events: def GetURL(self, _object, _a...
apache-2.0
rsteca/python-social-auth
social/pipeline/utils.py
76
2057
import six SERIALIZABLE_TYPES = (dict, list, tuple, set, bool, type(None)) + \ six.integer_types + six.string_types + \ (six.text_type, six.binary_type,) def partial_to_session(strategy, next, backend, request=None, *args, **kwargs): user = kwargs.get('user') social...
bsd-3-clause
kiij/CoilSnake
coilsnake/modules/eb/TitleScreenModule.py
2
26582
import logging from coilsnake.model.common.blocks import Block from coilsnake.model.eb.blocks import EbCompressibleBlock from coilsnake.model.eb.graphics import EbGraphicTileset, EbTileArrangement from coilsnake.model.eb.palettes import EbPalette from coilsnake.model.eb.title_screen import TitleScreenLayoutEntry, \ ...
gpl-3.0
QiangF/autokey
src/test/configurationmanagertest.py
53
1681
import unittest import lib.configurationmanager as conf from lib.phrase import * CONFIG_FILE = "../../config/abbr.ini" class LegacyImporterTest(unittest.TestCase): def setUp(self): self.importer = conf.LegacyImporter() self.importer.load_config(CONFIG_FILE) def testGlobalSetting...
gpl-3.0
blacklin/kbengine
kbe/src/lib/python/Lib/optparse.py
99
60346
"""A powerful, extensible, and easy-to-use option parser. By Greg Ward <gward@python.net> Originally distributed as Optik. For support, use the optik-users@lists.sourceforge.net mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). Simple usage example: from optparse import OptionParser pa...
lgpl-3.0
mfasDa/raadev
analysis/TriggerCorrelation.py
42
3607
#! /usr/bin/env python from ROOT import TFile, TH1F, TCanvas, gPad, gDirectory, kBlack, kRed, kBlue, kGreen, kMagenta from Helper import FileReaderException, HistNotFoundException, ReadHistList from Graphics import Style from SpectrumContainer import SpectrumContainer import sys gObjects = [] class TriggerCorrelati...
gpl-3.0
picoCTF/picoCTF
infra_remote/gen_vault.py
2
2806
#!/usr/bin/env python3 """ ./gen_vault.py Utility script to generate a secure ansible-vault file for use in deploying a production platform. This script is not intended to replace the ansible-vault command. It simply exists to streamline a secure default setup (e.g. no user decisions required). As such it intentiona...
mit
seleniumbase/SeleniumBase
seleniumbase/console_scripts/sb_mkchart.py
1
10926
# -*- coding: utf-8 -*- """ Creates a new SeleniumBase chart presentation with boilerplate code. Usage: seleniumbase mkchart [FILE.py] [LANG] or sbase mkchart [FILE.py] [LANG] Example: sbase mkchart new_chart.py --en Language Options: --en / --English | --zh / --Chinese --nl / --Dutch ...
mit
supriyantomaftuh/pip
pip/_vendor/requests/packages/urllib3/util/ssl_.py
484
10037
from binascii import hexlify, unhexlify from hashlib import md5, sha1, sha256 from ..exceptions import SSLError, InsecurePlatformWarning SSLContext = None HAS_SNI = False create_default_context = None import errno import warnings try: # Test for SSL features import ssl from ssl import wrap_socket, CERT_NO...
mit
jedie/pypyjs-standalone
website/js/pypy.js-0.3.0/lib/modules/xmllib.py
227
34865
"""A parser for XML, using the derived class as static DTD.""" # Author: Sjoerd Mullender. import re import string import warnings warnings.warn("The xmllib module is obsolete. Use xml.sax instead.", DeprecationWarning, 2) del warnings version = '0.3' class Error(RuntimeError): pass # Regular e...
mit
azverkan/scons
test/SWIG/SWIGPATH.py
3
2604
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
mit
JacobStevenR/scrapy
scrapy/utils/iterators.py
93
4569
import re import csv import logging try: from cStringIO import StringIO as BytesIO except ImportError: from io import BytesIO import six from scrapy.http import TextResponse, Response from scrapy.selector import Selector from scrapy.utils.python import re_rsearch, to_unicode logger = logging.getLogger(__nam...
bsd-3-clause
puiterwijk/flask-oidc
flask_oidc/__init__.py
2
36240
# Copyright (c) 2014-2015, Erica Ehrhardt # Copyright (c) 2016, Patrick Uiterwijk <patrick@puiterwijk.org> # 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...
bsd-2-clause
hashworks/CouchPotatoServer
libs/html5lib/trie/py.py
817
1763
from __future__ import absolute_import, division, unicode_literals from six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError("All keys m...
gpl-3.0
timm/timmnix
pypy3-v5.5.0-linux64/lib-python/3/encodings/cp1026.py
272
13113
""" Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.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_table) def decode(self,inp...
mit
hyperized/ansible
lib/ansible/module_utils/network/eos/config/l3_interfaces/l3_interfaces.py
2
9161
# -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The eos_l3_interfaces class It is in this file where the current configuration (as dict) is compared to the provided configuration (as dict) and the command set necessary t...
gpl-3.0
Kazade/NeHe-Website
google_appengine/lib/django-1.4/tests/regressiontests/requests/tests.py
9
23218
# -*- coding: utf-8 -*- from __future__ import with_statement import time import warnings from datetime import datetime, timedelta from StringIO import StringIO from django.conf import settings from django.core.handlers.modpython import ModPythonRequest from django.core.exceptions import SuspiciousOperation from djan...
bsd-3-clause
appknox/vendor
ak_vendor/pcidss.py
1
24042
from gettext import gettext as _ data = [ { "title": _( "Install and maintain a firewall and router configuration to protect" "cardholder data" ), "code": "1.1", "id": "1_1", "description": _( "Establish firewall and router configuration standards that formalize " ...
mit
mads-bertelsen/McCode
support/MacOSX/gcc-hpc/10.11/gcc-6.0/lib/libstdc++.a-gdb.py
2
2388
# -*- python -*- # Copyright (C) 2009-2015 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 versio...
gpl-2.0
msiedlarek/qtwebkit
Source/JavaScriptCore/KeywordLookupGenerator.py
117
11965
# Copyright (C) 2011 Apple Inc. All rights reserved. # Copyright (C) 2012 Sony Network Entertainment. 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 retai...
lgpl-3.0
daenamkim/ansible
test/legacy/setup_gce.py
185
1423
''' Create GCE resources for use in integration tests. Takes a prefix as a command-line argument and creates two persistent disks named ${prefix}-base and ${prefix}-extra and a snapshot of the base disk named ${prefix}-snapshot. prefix will be forced to lowercase, to ensure the names are legal GCE resource names. ''' ...
gpl-3.0
westinedu/similarinterest
django/contrib/staticfiles/utils.py
322
1973
import os import fnmatch from django.conf import settings from django.core.exceptions import ImproperlyConfigured def matches_patterns(path, patterns=None): """ Return True or False depending on whether the ``path`` should be ignored (if it matches any pattern in ``ignore_patterns``). """ if patter...
bsd-3-clause
RO-ny9/python-for-android
python3-alpha/python3-src/Lib/test/test_coding.py
57
2093
import test.support, unittest from test.support import TESTFN, unlink, unload import os, sys class CodingTest(unittest.TestCase): def test_bad_coding(self): module_name = 'bad_coding' self.verify_bad_module(module_name) def test_bad_coding2(self): module_name = 'bad_coding2' s...
apache-2.0
asimshankar/tensorflow
tensorflow/python/kernel_tests/random/multinomial_op_test.py
36
10147
# 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
akhilaananthram/nupic
nupic/regions/ImageSensorExplorers/RandomEyeMovements.py
17
5165
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
grafal/xcsoar-dev
build/python/build/makeproject.py
13
1229
import subprocess, multiprocessing from build.project import Project class MakeProject(Project): def __init__(self, url, alternative_url, md5, installed, install_target='install', **kwargs): Project.__init__(self, url, alternative_url, md5, installed, **kwargs) se...
gpl-2.0
joone/chromium-crosswalk
build/win/importlibs/create_importlib_win.py
185
6790
#!/usr/bin/env python # Copyright (c) 2012 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. # """Creates an import library from an import description file.""" import ast import logging import optparse import os import os.pat...
bsd-3-clause
40223214/20150622
static/Brython3.1.1-20150328-091302/Lib/VFS_import.py
738
3059
import os from browser import doc #_scripts=doc.createElement('script') #_scripts.src="/src/py_VFS.js" #_scripts.type="text/javascript" #doc.get(tag='head')[0].appendChild(_scripts) VFS=dict(JSObject(__BRYTHON__.py_VFS)) class VFSModuleFinder: def __init__(self, path_entry): print("in VFSModuleFinder") ...
gpl-3.0
mjnowen/mjnowen-anim-studio-tools
miki/resources/template/conf.py
25
1076
# # Dr. D Studios # --------------------------------------------------- # Load centralised configuration # --------------------------------------------------- from miki.sphinx_config import * # Add any overrides required below # --------------------------------------------------- # Copyright 2008-2012 Dr D Studios ...
gpl-3.0
datenbetrieb/odoo
addons/report_webkit/wizard/report_webkit_actions.py
382
6537
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Vincent Renaville # # WARNING: This program as such is intended to be used by professional # programmers who take the...
agpl-3.0
michaelpacer/scipy_proceedings
publisher/build_template.py
4
3121
#!/usr/bin/env python import os import sys import shlex import subprocess import io import shutil from distutils import dir_util import tempita from conf import (bib_dir, build_dir, template_dir, html_dir, static_dir, status_file) from options import get_config class TeXTemplate(tempita.Template...
bsd-2-clause
edisonlz/fruit
web_project/base/site-packages/pymongo/message.py
1
5972
# Copyright 2009-2012 10gen, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
dermoth/gramps
gramps/gen/filters/rules/place/_isenclosedby.py
5
2275
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # Copyright (C) 2015 Nick Hall # # 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 v...
gpl-2.0
runekaagaard/django-contrib-locking
django/test/utils.py
5
19338
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 ...
bsd-3-clause
mrunge/horizon
openstack_dashboard/dashboards/admin/flavors/views.py
11
4876
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
nicksay/spitfire
scripts/crunner.py
3
11482
#!/usr/bin/env python # Copyright 2007 The Spitfire Authors. 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 logging import optparse import os.path import sys import time import traceback import cStringIO as StringIO fro...
bsd-3-clause
ryansb/boto
tests/integration/ses/test_cert_verification.py
126
1558
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # 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 withou...
mit
rshipp/python-appassure
appassure/session.py
1
4008
"""Python wrapper for the AppAssure 5 REST API. Handles logging in to and sending and retrieving data from an AppAssure server. Returns requested data as a Python object. """ from appassure.xml2obj import xml2obj import requests from requests_ntlm import HttpNtlmAuth # AppAssure 5 API URLs CORE_API_URL = "apprecover...
bsd-3-clause
theuni/bitcoin
qa/rpc-tests/decodescript.py
56
5892
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class Decode...
mit
ram1993/neuralnetwork
Tensorflow/XOR_multilayer_nn.py
1
1531
import tensorflow as tf import numpy as np tf.set_random_seed(234) x_data = np.array([[0, 0], [0, 1], [1, 0], [1, 1]], dtype=np.float32) y_data = np.array([[0], [1], [1], [0]], dtype=np.float32) x = tf.placeholder(tf.float32, shape = [None,2]) y = tf.placeholder(tf.float32, shape=[None, 1]) w1 = tf.Variable(tf.rando...
mit
apache/incubator-airflow
airflow/www/security.py
3
29537
# # 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...
apache-2.0
signalfx/Diamond
src/collectors/jolokia/cassandra_jolokia.py
10
4169
# coding=utf-8 """ Collects Cassandra JMX metrics from the Jolokia Agent. Extends the JolokiaCollector to interpret Histogram beans with information about the distribution of request latencies. #### Example Configuration CassandraJolokiaCollector uses a regular expression to determine which attributes represent hist...
mit
conan-io/conan
conans/cli/output.py
1
4761
import logging import sys import tqdm from colorama import Fore, Style from conans.util.env_reader import get_env class Color(object): """ Wrapper around colorama colors that are undefined in importing """ RED = Fore.RED # @UndefinedVariable WHITE = Fore.WHITE # @UndefinedVariable CYAN = Fore....
mit
Nickster28/cs106a-summer-2017
markdown/serializers.py
129
9820
# markdown/searializers.py # # Add x/html serialization to Elementree # Taken from ElementTree 1.3 preview with slight modifications # # Copyright (c) 1999-2007 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # http://www.pythonware.com # # ------------------------------------------------------------...
mit
demonshreder/pirate
pirate/urls.py
1
2735
"""pirate URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
apache-2.0
ampax/edx-platform
lms/djangoapps/support/views/enrollments.py
17
6720
""" Support tool for changing course enrollments. """ from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import transaction from django.db.models import Q from django.http import HttpResponseBadRequest from django.utils.decorators import method_decorator from django....
agpl-3.0
huanchenz/STX-h-store
tests/scripts/examples/sql_coverage/decimal-schema.py
9
1793
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2009 VoltDB L.L.C. # # 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 limita...
gpl-3.0
ARM-software/mbed-beetle
tools/singletest.py
2
11531
#!/usr/bin/env python2 """ mbed SDK Copyright (c) 2011-2014 ARM Limited 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 applicabl...
apache-2.0
antidotcb/googletest
googletest/scripts/upload.py
24
52037
#!/usr/bin/env python # # Copyright 2007, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
ajanson/SCIRun
src/Externals/gmock/test/gmock_test_utils.py
769
3684
#!/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...
mit
camagenta/youtube-dl
youtube_dl/extractor/condenast.py
115
5070
# coding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_parse_urlparse, compat_urlparse, ) from ..utils import ( orderedSet, ) class CondeNastIE(InfoExtractor): """ Condé Nast is...
unlicense
1001zippy/firesim
closure/closure/bin/build/depstree_test.py
354
3692
#!/usr/bin/env python # # Copyright 2009 The Closure Library 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 ...
gpl-3.0
dllsf/odootest
addons/account_anglo_saxon/purchase.py
427
2043
# -*- encoding: 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 t...
agpl-3.0
sony/nnabla
tutorial/nbmerge.py
1
1669
# Copyright 2017,2018,2019,2020,2021 Sony 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 applicable law...
apache-2.0
charukiewicz/beer-manager
venv/lib/python3.4/site-packages/pip/commands/zip.py
393
14821
import sys import re import fnmatch import os import shutil import zipfile from pip.util import display_path, backup_dir, rmtree from pip.log import logger from pip.exceptions import InstallationError from pip.basecommand import Command class ZipCommand(Command): """Zip individual packages.""" name = 'zip' ...
mit
marrow/tags
marrow/tags/html5.py
1
2789
# encoding: utf-8 from marrow.tags import filters from marrow.tags.base import Tag, Flush, Text __all__ = ['comment', 'html', 'flush', 'Text'] _doctype = '<!DOCTYPE HTML>' _tags = {'a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'capt...
mit
dantexier/Frameword-PC
extraccion.py
1
1073
import pandas as pd import csv headers = ["Author","Title","C1","Abstract","C2","Cant02","Keywords","Cant03","Publication Title","Year"] names = headers df = pd.read_csv("CorpusCompleto_UNdeC.csv", header=0, names = headers) # Resumen por archivo x=0 for i in df['Abstract']: x+=1 archivos = "Archivo_"+str(x...
gpl-3.0
supriyasingh01/github_basics
Internetworking Distributed Project/finalProject/ovs/pox-master/pox/log/__init__.py
8
4094
import logging from logging.handlers import * _formatter = logging.Formatter(logging.BASIC_FORMAT) def _parse (s): if s.lower() == "none": return None if s.lower() == "false": return False if s.lower() == "true": return True if s.startswith("0x"): return int(s[2:], 16) try: return int(s) except: p...
cc0-1.0
2014c2g3/cda0512
static/Brython3.1.1-20150328-091302/Lib/itertools.py
630
16041
import operator class accumulate: def __init__(self, iterable, func = operator.add): self.it = iter(iterable) self._total = None self.func = func def __iter__(self): return self def __next__(self): if not self._total: self._total = next(self.it)...
agpl-3.0
cltk/cltk
src/cltk/embeddings/embeddings.py
4
16368
"""Module for accessing pre-trained `fastText word embeddings <https://fasttext.cc/>`_ and `Word2Vec embeddings from NLPL <http://vectors.nlpl.eu/repository/>`_. Two sets of models are available from fastText, one being trained only on corpora taken from Wikipedia (`249 languages <https://fasttext.cc/docs/en/pretrained...
mit
ace0/linux-whirlwind-rng
tools/perf/python/twatch.py
1565
1316
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0