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
determinedcheetahs/cheetah_juniper
hadoop/src/examples/org/apache/hadoop/examples/terasort/job_history_summary.py
323
3444
#!/usr/bin/env python # # 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
reingart/gui2py
gui/menu.py
14
13472
#!/usr/bin/python # -*- coding: utf-8 -*- "gui2py's Menu Model (encapsulates wx.MenuBar, wx.Menu and wx.MenuItems)" __author__ = "Mariano Reingart (reingart@gmail.com)" __copyright__ = "Copyright (C) 2013- Mariano Reingart" __license__ = "LGPL 3.0" # Initial implementation was inspired on PythonCard's menu ...
lgpl-3.0
gojira/tensorflow
tensorflow/contrib/boosted_trees/examples/boston_combined.py
41
5885
# 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
mrbox/django
tests/field_deconstruction/tests.py
189
18358
from __future__ import unicode_literals from django.apps import apps from django.db import models from django.test import SimpleTestCase, override_settings from django.test.utils import isolate_lru_cache from django.utils import six class FieldDeconstructionTests(SimpleTestCase): """ Tests the deconstruct() ...
bsd-3-clause
eniac/faas
factor/linalg.py
1
5126
import sys import os import re import math import utils import logging logger = logging.getLogger('Linalg') cmd_logger = logging.getLogger('cmd') # Exact configuration here will depends on instance/hardware type. def run_rankfile(linalg_params): logger.info("--- Generating rankfile ---") machines = linal...
lgpl-3.0
lordmuffin/aws-cfn-plex
functions/credstash/setuptools/command/upload_docs.py
110
7275
# -*- coding: utf-8 -*- """upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). """ from base64 import standard_b64encode from distutils import log from distutils.errors import DistutilsOptionError import os import socket import zipfile import tempfile import ...
mit
ojengwa/talk
venv/lib/python2.7/site-packages/pip/_vendor/distlib/database.py
203
49199
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2014 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """PEP 376 implementation.""" from __future__ import unicode_literals import base64 import codecs import contextlib import hashlib import logging import os import posixpath import sys import z...
mit
roadmapper/ansible
lib/ansible/modules/cloud/azure/azure_rm_virtualmachinescaleset_info.py
20
15325
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Sertac Ozercan <seozerca@microsoft.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_ver...
gpl-3.0
eirmag/weboob
modules/arte/browser.py
2
2140
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
agpl-3.0
tlatzko/spmcluster
.tox/2.6-nocov/lib/python2.6/site-packages/pip/vcs/bazaar.py
280
4427
from __future__ import absolute_import import logging import os import tempfile import re # TODO: Get this into six.moves.urllib.parse try: from urllib import parse as urllib_parse except ImportError: import urlparse as urllib_parse from pip.utils import rmtree, display_path from pip.vcs import vcs, VersionC...
bsd-2-clause
jckhang/gensim
gensim/models/wrappers/ldamallet.py
28
10798
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2014 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Python wrapper for Latent Dirichlet Allocation (LDA) from MALLET, the Java topic modelling toolkit [1]_. This module allows both L...
gpl-3.0
sexroute/commandergenius
project/jni/python/src/Lib/xml/sax/handler.py
79
13968
""" This module contains the core classes of version 2.0 of SAX for Python. This file provides only default classes with absolutely minimum functionality, from which drivers and applications can be subclassed. Many of these classes are empty and are included only as documentation of the interfaces. $Id: handler.py 35...
lgpl-2.1
sauravpratihar/sugar
extensions/cpsection/power/model.py
12
2930
# Copyright (C) 2008 One Laptop Per Child # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distribu...
gpl-2.0
eeshangarg/oh-mainline
vendor/packages/kombu/kombu/clocks.py
35
4494
""" kombu.clocks ============ Logical Clocks and Synchronization. """ from __future__ import absolute_import from threading import Lock from itertools import islice from operator import itemgetter from .five import zip __all__ = ['LamportClock', 'timetuple'] R_CLOCK = '_lamport(clock={0}, timestamp={1}, id={2} {3...
agpl-3.0
awkspace/ansible
lib/ansible/plugins/inventory/linode.py
31
6600
# 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) __metaclass__ = type DOCUMENTATION = r''' name: linode plugin_type: inventory authors: - Luke Murphy (@...
gpl-3.0
ryano144/intellij-community
python/lib/Lib/encodings/cp775.py
593
34732
""" Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict...
apache-2.0
JSkelly/Toast
examples/sprite/sprite_test.py
2
1043
from toast.scene_graph import Scene from toast.image_sheet import ImageSheet from toast.sprite import Sprite from toast.resource_loader import ResourceLoader from toast.animation import Animation from examples.demo_game import DemoGame class NewScene(Scene): def __init__(self): super(NewScene, self).__ini...
mit
NunoEdgarGub1/scikit-learn
examples/classification/plot_digits_classification.py
289
2397
""" ================================ Recognizing hand-written digits ================================ An example showing how the scikit-learn can be used to recognize images of hand-written digits. This example is commented in the :ref:`tutorial section of the user manual <introduction>`. """ print(__doc__) # Autho...
bsd-3-clause
schambers/civmarket
civmarket/lib/python2.7/site-packages/django/conf/locale/sk/formats.py
118
1173
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'G:i:s' DAT...
apache-2.0
timevortexproject/timevortex
timevortex/utils/timeserieslogger.py
1
1057
#!/usr/bin/python3 # -*- coding: utf8 -*- # -*- Mode: Python; py-indent-offset: 4 -*- """TSL functions""" from timevortex.utils.globals import ERROR_TIMESERIES_NOT_DEFINED KEY_TSL_BAD_JSON = "ts_without_json_message" KEY_TSL_NO_SITE_ID = "ts_without_site_id" KEY_TSL_NO_VARIABLE_ID = "ts_without_variable_id" KEY_TSL_...
mit
openstack/tempest
tempest/tests/fake_tempest_plugin.py
7
1674
# Copyright (c) 2015 Deutsche Telekom AG # 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 r...
apache-2.0
fos/fos-legacy
fos/actor/odfslicer.py
1
2054
import numpy as np class ODF_Slice(object): def __init__(self,odfs,vertices,faces,noiso,batch,group=None): J=0 self.odfs_no=J self.vertex_list=(odfs.shape[0]*odfs.shape[1])*[None] for index in np.ndindex(odfs.shape[:2]): values=odfs[index] if noi...
bsd-3-clause
isnnn/Sick-Beard-TPB
lib/requests/packages/charade/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...
gpl-3.0
hojel/calibre
src/calibre/library/sqlite.py
19
11844
from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' ''' Wrapper for multi-threaded access to a single sqlite database connection. Serializes all calls. ''' import sqlite3 as sqlite, traceback, time, uuid, sys, os ...
gpl-3.0
skevy/django
django/contrib/contenttypes/management.py
315
2458
from django.contrib.contenttypes.models import ContentType from django.db.models import get_apps, get_models, signals from django.utils.encoding import smart_unicode def update_contenttypes(app, created_models, verbosity=2, **kwargs): """ Creates content types for models in the given app, removing any model ...
bsd-3-clause
kkoksvik/FreeCAD
src/Mod/Start/StartPage/StartPage.py
2
26929
#*************************************************************************** #* * #* Copyright (c) 2012 * #* Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1
darktears/chromium-crosswalk
chrome/common/extensions/docs/server2/jsc_view_test.py
30
15249
#!/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. import json import os import unittest from jsc_view import GetEventByNameFromEvents from api_schema_graph import APISchemaGraph from a...
bsd-3-clause
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/pygments/lexers/felix.py
72
9410
# -*- coding: utf-8 -*- """ pygments.lexers.felix ~~~~~~~~~~~~~~~~~~~~~ Lexer for the Felix language. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups, default, words, \ comb...
bsd-3-clause
samarthmed/emacs-config
.python-environments/default/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escsm.py
2930
7839
######################## 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...
gpl-2.0
Nikita1710/ANUFifty50-Online-Mentoring-Platform
project/fifty_fifty/webcore/views.py
1
4115
from django.shortcuts import render, get_object_or_404 from django.core.mail import send_mail, BadHeaderError from django.contrib import messages from django.conf import settings from django.contrib.auth.decorators import login_required from content.models import Mentee, Mentor, Content_Summary from blog.models import ...
apache-2.0
ThinkOpen-Solutions/odoo
addons/account/project/__init__.py
427
1100
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
dcroc16/skunk_works
google_appengine/lib/django-1.3/tests/regressiontests/admin_views/tests.py
46
134255
# coding: utf-8 import re import datetime import urlparse from django.conf import settings from django.core import mail from django.core.exceptions import SuspiciousOperation from django.core.files import temp as tempfile from django.core.urlresolvers import reverse # Register auth models with the admin. from django....
mit
dcroc16/skunk_works
google_appengine/lib/django-1.4/django/contrib/localflavor/us/forms.py
87
4651
""" USA-specific Form helpers """ from __future__ import absolute_import import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select, CharField from django.utils.encoding import smart_unicode from django.utils.translatio...
mit
xflows/clowdflows-backend
workflows/management/commands/export_package_old.py
8
6287
from unicodedata import category from django.core.management.base import BaseCommand, CommandError from workflows.models import Category, AbstractWidget, AbstractInput, AbstractOutput, AbstractOption from django.core import serializers from optparse import make_option import uuid class Command(BaseCommand): ...
mit
tobbad/micropython
tests/misc/rge_sm.py
15
4422
# evolve the RGEs of the standard model from electroweak scale up # by dpgeorge import math class RungeKutta(object): def __init__(self, functions, initConditions, t0, dh, save=True): self.Trajectory, self.save = [[t0] + initConditions], save self.functions = [lambda *args: 1.0] + list(functions)...
mit
waheedahmed/edx-platform
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
2
158417
""" Provides full versioning CRUD and representation for collections of xblocks (e.g., courses, modules, etc). Representation: * course_index: a dictionary: ** '_id': a unique id which cannot change, ** 'org': the org's id. Only used for searching not identity, ** 'course': the course's catalog number ...
agpl-3.0
rockyzhang/zhangyanhit-python-for-android-mips
python3-alpha/python3-src/Lib/test/test_pep3120.py
49
1280
# This file is marked as binary in the CVS, to prevent MacCVS from recoding it. import unittest from test import support class PEP3120Test(unittest.TestCase): def test_pep3120(self): self.assertEqual( "Питон".encode("utf-8"), b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd' ) ...
apache-2.0
NicoVarg99/daf-recipes
ckan/ckan/ckan/ckan/tests/logic/action/test_delete.py
1
20446
# encoding: utf-8 import nose.tools import ckan.tests.helpers as helpers import ckan.tests.factories as factories import ckan.logic as logic import ckan.model as model import ckan.plugins as p import ckan.lib.search as search assert_equals = nose.tools.assert_equals assert_raises = nose.tools.assert_raises class T...
gpl-3.0
abalckin/cwavenet
examples/WNvsPWN/show_snr.py
2
2454
#! /usr/bin/python3 import pylab as plb import numpy as np from matplotlib import rc rc('text', usetex=True) rc('text.latex', unicode=True) rc('text.latex', preamble=r'\usepackage[russian]{babel}') #rc('font',**{'family':'serif'}) rc('font',**{'size':'19'}) res = np.loadtxt('result.txt', delimiter=', ')[0:7] #import p...
gpl-2.0
117111302/PyGithub
github/IssueComment.py
72
5924
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
Pakketeretet2/lammps
tools/eff/lmp2xyz.py
52
3446
Info=""" Module name: lmp2xyz.py Author: (c) Andres Jaramillo-Botero California Institute of Technology ajaramil@caltech.edu Project: pEFF Version: August 2009 Extracts the xyz from a lammps trajectory dump of style custom: dump 1 all custom period dump_file id type x y z spin radius ... Usage: python lmp2xyz.py...
gpl-2.0
arnaldog12/Manual-Pratico-Deep-Learning
utils/samples_generator.py
1
1868
import numpy as np def make_cubic(n_samples, x_min, x_max, a=1, b=0, c=0, d=0, noise=0.0, random_state=None): np.random.seed(random_state) x = np.linspace(x_min, x_max, n_samples) y = a*x**3 + b*x**2 + c*x + d + (2*noise*np.random.random(n_samples) - noise) return x.reshape(-1,1), y.reshape(-1,1) def ...
mit
kenorb-contrib/BitTorrent
twisted/tap/ftp.py
17
1442
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ I am the support module for making a ftp server with mktap. """ from twisted.protocols import ftp from twisted.python import usage from twisted.application import internet from twisted.cred import error, portal, checkers, credenti...
gpl-3.0
MiltosD/CEFELRC
lib/python2.7/site-packages/selenium/webdriver/common/touch_actions.py
38
4701
"""" Touch Actions implementation """ from selenium.webdriver.remote.command import Command class TouchActions(object): """ Generate touch actions. Works like ActionChains; actions are stored in the TouchActions object and are fired with perform(). """ def __init__(self, driver): """ ...
bsd-3-clause
sthyme/ZFSchizophrenia
BehaviorAnalysis/HSMovieAnalysis/setResolutionWidget.py
1
5960
#----------------------- # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'selectUI.ui' # Created: Thu Feb 26 13:45:32 2015 by: PyQt4 UI code generator 4.11.3 # # Created by Emily Conklin # February 2015 # This program is connected to the main widget (NeuroGUI.py) and is a sub-user interface...
mit
mzizzi/ansible
lib/ansible/modules/cloud/univention/udm_dns_zone.py
69
7633
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch> # # 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 Fr...
gpl-3.0
NaturalGIS/QGIS
tests/src/python/test_qgssvgcache.py
8
7946
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsSvgCache. .. 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, or (at your option) any later version. """ __aut...
gpl-2.0
zoyoe/ectool
zoyoeec/requests/structures.py
398
3575
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os import collections from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iter...
gpl-2.0
40223137/2015cbaa
static/Brython3.1.1-20150328-091302/Lib/_sre.py
622
51369
# NOT_RPYTHON """ A pure Python reimplementation of the _sre module from CPython 2.4 Copyright 2005 Nik Haldimann, licensed under the MIT license This code is based on material licensed under CNRI's Python 1.6 license and copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB """ MAXREPEAT = 2147483648 #import ar...
gpl-3.0
glmcdona/meddle
examples/base/Lib/distutils/command/clean.py
251
2814
"""distutils.command.clean Implements the Distutils 'clean' command.""" # contributed by Bastian Kleineidam <calvin@cs.uni-sb.de>, added 2000-03-18 __revision__ = "$Id$" import os from distutils.core import Command from distutils.dir_util import remove_tree from distutils import log class clean(Command): desc...
mit
mahak/ansible
test/units/parsing/test_ajson.py
34
7169
# Copyright 2018, Matt Martz <matt@sivel.net> # Copyright 2019, Andrew Klychkov @Andersson007 <aaklychkov@mail.ru> # 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 import os import json i...
gpl-3.0
xin1195/smartSearch
setting.py
1
1207
#!/usr/bin/env python3 # _*_coding:utf-8_*_ import os import motor.motor_tornado import redis from pymongo import MongoClient from common.logManageLib import get_logger settings = dict( template_path=os.path.join(os.path.dirname(__file__), "templates"), static_path=os.path.join(os.path.dirname(__file__), "st...
apache-2.0
Detry322/map-creator
app/random.py
1
1453
from app.models import all_models from app.utils import mkdir_p from app import GENERATED_TILES_FOLDER, RANDOM_FOLDER, BACKPROPS_FOLDER from scipy import misc import glob import numpy as np import os from keras.models import load_model, Model from keras.optimizers import Adam, SGD, Adagrad from keras.layers import Lo...
mit
ClearCorp/odoo-clearcorp
TODO-6.1/address_name_inc/__openerp__.py
4
2266
# -*- encoding: utf-8 -*- ############################################################################## # # address_name_inc.py # address_name_inc # First author: Mag Guevara <mag.guevara@clearcorp.co.cr> (ClearCorp S.A.) # Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserv...
agpl-3.0
PHSCRC/phsled
nfc/handover/server.py
5
5318
# -*- coding: latin-1 -*- # ----------------------------------------------------------------------------- # Copyright 2009-2011 Stephen Tiedemann <stephen.tiedemann@googlemail.com> # # Licensed under the EUPL, Version 1.1 or - as soon they # will be approved by the European Commission - subsequent # versions of the EU...
mit
prefetchnta/questlab
bin/x64bin/python/36/Lib/calendar.py
1
23926
"""Calendar printing functions Note when comparing these calendars to the ones printed by cal(1): By default, these calendars have Monday as the first day of the week, and Sunday as the last (the European convention). Use setfirstweekday() to set the first day of the week (0=Monday, 6=Sunday).""" import sys i...
lgpl-2.1
40223246/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/site-packages/highlight.py
617
2518
import keyword import _jsre as re from browser import html letters = 'abcdefghijklmnopqrstuvwxyz' letters += letters.upper()+'_' digits = '0123456789' builtin_funcs = ("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" + "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +...
gpl-3.0
befair/gasistafelice
gasistafelice/gf/gas/management/commands/import_gasmembers.py
3
11585
from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.db import IntegrityError, transaction from django.core.files import File from django.contrib.auth.models import User from lib.csvmanager import CSVManager from lib import get_params_from_template from gf.gas...
agpl-3.0
linsalrob/EdwardsLab
phage_protein_blast_genera/tax_violin_plots.py
1
2239
""" """ import os import sys import argparse import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt if __name__ == '__main__': parser = argparse.ArgumentParser(description="") parser.add_argument('-f', help='Genome average output file (from genera_per_phage_protein.py', default='/home/redw...
mit
euccas/CodingPuzzles-Python
leet/source/searchDFS/permutations.py
1
1421
class Solution(): def permute(self, nums): if nums is None: return [[]] elif len(nums) <= 1: return [nums] result = [] for i, item in enumerate(nums): #print("i={0}, item={1}".format(i, item)) for p in permute(nums[:i] + nums[i + 1:]):...
mit
jack198345/volatility
volatility/plugins/malware/svcscan.py
44
16277
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (c) 2010, 2011, 2012 Michael Ligh <michael.ligh@mnin.org> # # This file is part of Volatility. # # Volatility 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...
gpl-2.0
ganeti-github-testing/ganeti-test-1
lib/client/gnt_instance.py
1
62250
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 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: # # 1. Redistributions of source code must retain the above copyri...
bsd-2-clause
gannetson/django
tests/migrate_signals/tests.py
324
3585
from django.apps import apps from django.core import management from django.db.models import signals from django.test import TestCase, override_settings from django.utils import six APP_CONFIG = apps.get_app_config('migrate_signals') PRE_MIGRATE_ARGS = ['app_config', 'verbosity', 'interactive', 'using'] MIGRATE_DATABA...
bsd-3-clause
jwlawson/tensorflow
tensorflow/contrib/timeseries/python/timeseries/model_utils.py
70
4017
# 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
jaredly/pyjamas
library/pyjamas/ui/Tree.py
4
13256
# Copyright 2006 James Tauber and contributors # Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> # # 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/...
apache-2.0
hanselke/erpnext-1
erpnext/patches/v4_0/countrywise_coa.py
119
1034
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.reload_doc("setup", 'doctype', "company") frappe.reload_doc("accounts", 'doctype', "account") frappe.db.sql("""...
agpl-3.0
taotie12010/bigfour
common/lib/xmodule/xmodule/tests/test_split_test_module.py
34
23231
""" Tests for the Split Testing Module """ import ddt import lxml from mock import Mock, patch from fs.memoryfs import MemoryFS from xmodule.partitions.tests.test_partitions import StaticPartitionService, PartitionTestCase, MockUserPartitionScheme from xmodule.tests.xml import factories as xml from xmodule.tests.xml i...
agpl-3.0
bespike/litecoin
test/functional/wallet_groups.py
4
3973
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test wallet group functionality.""" from test_framework.test_framework import BitcoinTestFramework from tes...
mit
danieltt/nox
src/utilities/switch_command.py
16
2438
#!/usr/bin/python # # Send arbitrary command to a switch # import getopt,sys,os import httplib import simplejson import urllib # TODO: need to set the path for this from nox.webapps.webserviceclient.simple import PersistentLogin, NOXWSClient def usage(): print """ Usage: switch_command.py -d <direc...
gpl-3.0
pradeep-gr/mbed-os5-onsemi
tools/test/config/config_test.py
29
4502
""" mbed SDK Copyright (c) 2016 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 applicable law or agreed to in writing, so...
apache-2.0
ilexius/odoo
addons/account/models/account_bank_statement.py
4
46774
# -*- coding: utf-8 -*- from openerp import api, fields, models, _ from openerp.osv import expression from openerp.tools import float_is_zero from openerp.tools import float_compare, float_round from openerp.tools.misc import formatLang from openerp.exceptions import UserError, ValidationError import time import math...
gpl-3.0
waheedahmed/edx-platform
common/lib/xmodule/xmodule/tests/test_lti_unit.py
51
22199
# -*- coding: utf-8 -*- """Test for LTI Xmodule functional logic.""" import datetime from django.utils.timezone import UTC from mock import Mock, patch, PropertyMock import textwrap from lxml import etree from webob.request import Request from copy import copy import urllib from xmodule.fields import Timedelta from x...
agpl-3.0
koomik/CouchPotatoServer
libs/requests/packages/charade/constants.py
3008
1335
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
KSanthanam/rethinkdb
external/v8_3.30.33.16/build/gyp/test/msvs/list_excluded/gyptest-all.py
347
1292
#!/usr/bin/env python # 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. """ Verifies that msvs_list_excluded_files=0 doesn't list files that would normally be in _excluded_files, and that if that flag is not set,...
agpl-3.0
rafalcieslak/mimiker
launcher/outputs.py
3
2037
from .common import * class ServerOutput(Launchable): # This is a no-op class. def __init__(self): Launchable.__init__(self, 'server') def probe(self): return True def configure(self, **kwargs): pass class XTermOutput(Launchable): def __init__(self): Launchabl...
bsd-3-clause
bmazin/ARCONS-pipeline
fluxcal/fluxCal.py
1
29931
#!/bin/python ''' fluxCal.py Created by Seth Meeker on 11-21-2012 Modified on 02-16-2015 to perform absolute fluxCal with point sources Opens ARCONS observation of a spectrophotometric standard star and associated wavelength cal file, reads in all photons and converts to energies. Bins photons to generate a spectru...
gpl-2.0
emc-openstack/storops
storops_test/lib/test_tasks.py
1
3524
# coding=utf-8 # Copyright (c) 2016 EMC Corporation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
apache-2.0
diagramsoftware/odoo
addons/l10n_ma/__openerp__.py
260
2074
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010 kazacube (http://kazacube.com). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
agpl-3.0
jetskijoe/headphones
lib/unidecode/x0a2.py
253
4503
data = ( 'kax', # 0x00 'ka', # 0x01 'kap', # 0x02 'kuox', # 0x03 'kuo', # 0x04 'kuop', # 0x05 'kot', # 0x06 'kox', # 0x07 'ko', # 0x08 'kop', # 0x09 'ket', # 0x0a 'kex', # 0x0b 'ke', # 0x0c 'kep', # 0x0d 'kut', # 0x0e 'kux', # 0x0f 'ku', # 0x10 'kup', # 0x11 'kurx',...
gpl-3.0
oliciv/youtube-dl
youtube_dl/extractor/heise.py
176
2864
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, parse_iso8601, ) class HeiseIE(InfoExtractor): _VALID_URL = r'''(?x) https?://(?:www\.)?heise\.de/video/artikel/ .+?(?P<id>[0-9]+)\.html(?:$|[?#]...
unlicense
induktio/LamaTrainer
falib/PdaSimulator.py
1
2691
import sys,os,json,pprint class PDA(): """ Represents a Push-Down Automaton """ EPSILON = '_e' MAX_STEPS = 10000 def __init__(self): pass def testAutomata(self, pda, testcases): """ Tests whether the given PDA accepts or rejects the given testcases appropriately Args: * pda: PDA object to be ...
gpl-3.0
rossumai/keras-multi-gpu
keras_tf_multigpu/examples/kuza55/cifar10_cnn_functional_multigpu.py
1
4556
'''Train a simple deep CNN on the CIFAR10 small images dataset. GPU run command with Theano backend (with TensorFlow, the GPU is automatically used): THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatx=float32 python cifar10_cnn.py It gets down to 0.65 test logloss in 25 epochs, and down to 0.55 after 50 epochs. (it's s...
mit
nomadcube/scikit-learn
examples/neighbors/plot_nearest_centroid.py
264
1804
""" =============================== Nearest Centroid Classification =============================== Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap f...
bsd-3-clause
max00xam/service.maxxam.teamwatch
lib/engineio/async_aiohttp.py
3
3824
import asyncio import sys from urllib.parse import urlsplit from aiohttp.web import Response, WebSocketResponse import six def create_route(app, engineio_server, engineio_endpoint): """This function sets up the engine.io endpoint as a route for the application. Note that both GET and POST requests must ...
gpl-3.0
Vova23/limbo-android
jni/glib/glib/update-pcre/make_utt.py
47
1330
#! /usr/bin/env python # Reduce the number of relocations using a single string for the # keys in the _pcre_utt table. import re fin = open('pcre_tables.c') data = fin.read() fin.close() mo = re.search(r'const ucp_type_table _pcre_utt\[] = {', data) assert mo, '_pcre_utt not found' before = data[:mo.start()] table_...
gpl-2.0
drpngx/tensorflow
tensorflow/contrib/opt/python/training/lazy_adam_optimizer_test.py
104
6037
# 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
karlito40/servo
tests/wpt/css-tests/tools/html5lib/html5lib/tests/tokenizertotree.py
483
1965
from __future__ import absolute_import, division, unicode_literals import sys import os import json import re import html5lib from . import support from . import test_tokenizer p = html5lib.HTMLParser() unnamespaceExpected = re.compile(r"^(\|\s*)<html ([^>]+)>", re.M).sub def main(out_path): if not os.path.ex...
mpl-2.0
j-carpentier/nova
nova/vnc/__init__.py
44
2390
#!/usr/bin/env python # Copyright (c) 2010 OpenStack Foundation # 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/LICEN...
apache-2.0
lumig242/Video-Share-System
video/views.py
1
4497
from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from video.form import * from video.models import Video,Comment from django.contrib.auth.decorators import login_required import ...
mit
hrishioa/Aviato
flask/Lib/site-packages/osgeo/ogr.py
1
171430
# This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path impo...
gpl-2.0
scott48074/Restorative-Justice-App
app/facesheet.py
1
4506
''' Takes in a list of values from the database and creates a facesheet. ''' import os from docx import Document from docx.enum.text import WD_ALIGN_PARAGRAPH def assemble_address(street, apartment, city, state, zip_code): address = street.title() if apartment: address += f' APT: {apartment.title()}'...
mit
HiSPARC/station-software
user/python/Lib/idlelib/MultiStatusBar.py
10
1348
from Tkinter import * class MultiStatusBar(Frame): def __init__(self, master=None, **kw): if master is None: master = Tk() Frame.__init__(self, master, **kw) self.labels = {} def set_label(self, name, text='', side=LEFT, width=0): if name not in self.labels: ...
gpl-3.0
Adai0808/scrapy-1
scrapy/downloadermiddlewares/httpcompression.py
138
2278
import zlib from scrapy.utils.gz import gunzip, is_gzipped from scrapy.http import Response, TextResponse from scrapy.responsetypes import responsetypes from scrapy.exceptions import NotConfigured class HttpCompressionMiddleware(object): """This middleware allows compressed (gzip, deflate) traffic to be sent...
bsd-3-clause
cwilson1031/omaha
third_party/gmock/scripts/generator/cpp/gmock_class.py
85
5957
#!/usr/bin/env python # # Copyright 2008 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 requi...
apache-2.0
roselleebarle04/django
tests/m2m_recursive/models.py
410
1120
""" Many-to-many relationships between the same two tables In this example, a ``Person`` can have many friends, who are also ``Person`` objects. Friendship is a symmetrical relationship - if I am your friend, you are my friend. Here, ``friends`` is an example of a symmetrical ``ManyToManyField``. A ``Person`` can als...
bsd-3-clause
kri5/pghoard
test/test_restore.py
1
4618
""" pghoard Copyright (c) 2015 Ohmu Ltd See LICENSE for details """ from .base import PGHoardTestCase from dateutil import tz from pghoard.restore import create_recovery_conf, Restore, RestoreError from unittest.mock import Mock import datetime import os import pytest class TestRecoveryConf(PGHoardTestCase): def...
apache-2.0
shikhar413/openmc
tests/regression_tests/diff_tally/test.py
10
4122
import glob import os import pandas as pd import openmc import pytest from tests.testing_harness import PyAPITestHarness class DiffTallyTestHarness(PyAPITestHarness): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Set settings explicitly self._model.settings.ba...
mit
wtgme/labeldoc2vec
gensim/models/labeldoc2vec.py
1
45979
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Deep learning via the distributed memory and distributed bag of words models from [1]_, using either hierarchical softmax or negative ...
lgpl-2.1
grahamking/goodenergy
campaign/management/commands/ge_copy_campaign.py
1
4417
"""Copies the contents (indicators and actions) of one campaign into another """ # Copyright 2010,2011 Good Energy Research Inc. <graham@goodenergy.ca>, <jeremy@goodenergy.ca> # # This file is part of Good Energy. # # Good Energy is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
rosudrag/Freemium-winner
VirtualEnvironment/Lib/site-packages/sqlparse/filters.py
9
24242
# -*- coding: utf-8 -*- import re from os.path import abspath, join from sqlparse import sql, tokens as T from sqlparse.engine import FilterStack from sqlparse.lexer import tokenize from sqlparse.pipeline import Pipeline from sqlparse.tokens import (Comment, Comparison, Keyword, Name, Punctuation, ...
mit