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
a-buck/airmozilla
mysql2postgres/py-mysql2pgsql-0.1.5/mysql2pgsql/mysql2pgsql.py
17
1196
from __future__ import absolute_import import codecs from .lib import print_red from .lib.mysql_reader import MysqlReader from .lib.postgres_file_writer import PostgresFileWriter from .lib.postgres_db_writer import PostgresDbWriter from .lib.converter import Converter from .lib.config import Config from .lib.errors i...
bsd-3-clause
no-net/gr-winelo
python/qa_winelo_mpc_channel_cc.py
1
2465
#!/usr/bin/env python # # Copyright 2012 <+YOU OR YOUR COMPANY+>. # # This 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, or (at your option) # any later version. # # This software is distri...
gpl-3.0
iamjake648/jasper-dictionary
Define.py
1
1593
#Written by Jake Schultz #TODO Add more lang support, limit number of results returned import re from urllib2 import Request, urlopen, URLError import json WORDS = ["DEFINE","WHAT DOES %S MEAN","DEFINITION", "WHAT IS [A|AN]? %S"] PRIORITY = 1 def handle(text, mic, profile, recursive=False): text = re.sub(r"(?i)...
gpl-2.0
Peddle/hue
desktop/core/ext-py/pysaml2-2.4.0/src/saml2/soap.py
32
8590
#!/usr/bin/env python # -*- coding: utf-8 -*- # """ Suppport for the client part of the SAML2.0 SOAP binding. """ import logging from saml2 import create_class_from_element_tree from saml2.samlp import NAMESPACE as SAMLP_NAMESPACE from saml2.schema import soapenv try: from xml.etree import cElementTree as Elemen...
apache-2.0
verdurin/bcbio-nextgen
bcbio/distributed/resources.py
3
8077
"""Estimate resources required for processing a set of tasks. Uses annotations provided in multitasks.py for each function to identify utilized programs, then extracts resource requirements from the input bcbio_system file. """ import copy import math from bcbio.pipeline import config_utils from bcbio.log import logg...
mit
giorgiop/scikit-learn
sklearn/linear_model/__init__.py
83
3139
""" The :mod:`sklearn.linear_model` module implements generalized linear models. It includes Ridge regression, Bayesian Regression, Lasso and Elastic Net estimators computed with Least Angle Regression and coordinate descent. It also implements Stochastic Gradient Descent related algorithms. """ # See http://scikit-le...
bsd-3-clause
luhanhan/horizon
openstack_dashboard/test/integration_tests/basewebobject.py
26
3446
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
perkinslr/pypyjs
addedLibraries/nevow/taglibrary/livetags.py
2
3045
""" This module provides helpers to define and manage live components, that is taglibrary components whose instances are client-side JS objects. Each component must have a unique name in the livepage context. This name is usually the same as (or derived from) the 'name' field in the data given to the tag renderer. T...
mit
felipenaselva/repo.felipe
plugin.video.uwc/k18.py
1
2513
''' Ultimate Whitecream Copyright (C) 2015 mortael This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
gpl-2.0
intelie/pycollector
src/third/sqlalchemy/orm/exc.py
14
5224
# orm/exc.py # Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """SQLAlchemy ORM exceptions.""" import sqlalchemy as sa orm_util = sa.util.importlater('s...
bsd-3-clause
jralls/gramps
gramps/gen/merge/mergeplacequery.py
10
3939
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2010 Michiel D. Nauta # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
gpl-2.0
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_url_path_map.py
1
3397
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
knych/u-boot-sunxi
tools/patman/get_maintainer.py
38
1977
# Copyright (c) 2012 The Chromium OS Authors. # # See file CREDITS for list of people who contributed to this # project. # # 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 # t...
gpl-2.0
zbraniecki/translate
translate/lang/dz.py
29
1044
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2013 Zuza Software Foundation # # This file is part of translate. # # translate 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 t...
gpl-2.0
chengdh/openerp-ktv
openerp/addons/ktv_sale/room_operate.py
1
3418
# -*- coding: utf-8 -*- from osv import osv,fields from room import room class room_operate(osv.osv): ''' 包厢操作类: 以下操作都属于包厢操作: 1 预定 2 正常开房 3 买钟 4 买断 5 续钟 6 退钟 7 换房 8 并房 包厢通过cur_room_operate_id与room_operate相关联,用于标示当前包厢所对应的操作 room_operate与以上各个操作是one2many的关系,这样通过一个room_o...
agpl-3.0
Kniyl/mezzanine
mezzanine/blog/defaults.py
55
2363
""" Default settings for the ``mezzanine.blog`` app. Each of these can be overridden in your project's settings module, just like regular Django settings. The ``editable`` argument for each controls whether the setting is editable via Django's admin. Thought should be given to how a setting is actually used before mak...
bsd-2-clause
Yonnick/userinfuser
serverside/tools/xss.py
14
5374
# Copyright (C) 2011, CloudCaptive # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-3.0
aitormf/JdeRobot
src/tools/visualStates/gui/treenode.py
3
2100
''' Copyright (C) 1997-2017 JDERobot Developers Team 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 pr...
gpl-3.0
dhimmel/hetio
hetnetpy/permute.py
1
9110
import collections import random import logging from hetnetpy.hetnet import Graph def permute_graph(graph, multiplier=10, seed=0, metaedge_to_excluded=dict(), log=False): """ Derive a permuted hetnet from an input hetnet. This method applies the XSwap algorithm separately for each metaedge. Hence, node d...
cc0-1.0
coetzeevs/chiron
mysite/polls/views.py
1
1976
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.template import loader from .models import Question, Choice from django.urls import reverse from django.views import generic from django.utils import timezone from django.core.mail import EmailM...
mit
yvesalexandre/bandicoot
bandicoot/__init__.py
1
1498
# The MIT License (MIT) # # Copyright (c) 2015-2016 Massachusetts Institute of Technology. # # 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 ...
mit
sphaero/appie
appie/appie.py
1
10447
#!/usr/bin/python3 # # Copyright (c) 2013, Arnaud Loonstra, All rights reserved. # Copyright (c) 2013, Stichting z25.org, All rights reserved. # # This library 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;...
gpl-3.0
kobejean/tensorflow
tensorflow/python/data/kernel_tests/cache_dataset_op_test.py
9
11862
# 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
jajberni/pcse_web
main/control/index.py
5
1922
# coding: utf-8 """ Provides logic for rendering index template """ import flask from main import app import auth import config from model import User, UserValidator, Config from api.helpers import ArgumentValidator @app.route('/') def index(): """Render index template""" return flask.render_template('index.h...
apache-2.0
KaiyuWang16/xml2json-1
xml2json.py
9
7428
#!/usr/bin/env python """xml2json.py Convert XML to JSON Relies on ElementTree for the XML parsing. This is based on pesterfish.py but uses a different XML->JSON mapping. The XML->JSON mapping is described at http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html Rewritten to a command line utili...
mit
CuonDeveloper/cuon
cuon_client/cuon/Databases/SingleDataTreeModel.py
3
2386
# -*- coding: utf-8 -*- ##Copyright (C) [2003] [Juergen Hamel, D-32584 Loehne] ##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 ver...
gpl-3.0
Senseg/Py4A
python-modules/twisted/twisted/conch/test/test_manhole.py
59
10507
# -*- test-case-name: twisted.conch.test.test_manhole -*- # Copyright (c) 2001-2007 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.manhole}. """ import traceback from twisted.trial import unittest from twisted.internet import error, defer from twisted.test.proto_helpers import ...
apache-2.0
ravindrapanda/tensorflow
tensorflow/contrib/mpi_collectives/__init__.py
51
11468
# 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
LACNIC/simon
simon-web/simon_app/templatetags/simon_extras.py
1
2401
from django import template from datetime import datetime from simon_app.functions import GMTUY import operator """ Module that holds the Simon """ register = template.Library() @register.filter(name="substract") def substract(value, arg): """ Substract """ return value - arg @register.fil...
gpl-2.0
indictranstech/focal-erpnext
stock/get_item_details.py
4
12465
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _, throw from frappe.utils import flt, cint, add_days import json from erpnext.accounts.doctype.pricing_rule.pricing...
agpl-3.0
0x0all/nupic
examples/opf/experiments/anomaly/spatial/10field_few_skewed/description.py
3
16833
# ---------------------------------------------------------------------- # 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...
gpl-3.0
gpailler/AtlassianBot
plugins/stash.py
1
1971
# coding: utf-8 import requests from utils import rest class Stash(object): def __init__(self, server): self.__server = server def get_stash_branches(self, repos, project, filter): results = [] for repo in repos: path = '/rest/api/1.0/projects/{project}/repos/{repo}/branc...
mit
nwalters512/the-blue-alliance
controllers/api_controller.py
8
5197
import csv import json import logging import StringIO import os import urllib import uuid import webapp2 from datetime import datetime from google.appengine.api import memcache, urlfetch from google.appengine.ext import deferred, ndb from google.appengine.ext.webapp import template import tba_config from helpers.ap...
mit
mfraezz/osf.io
api/actions/serializers.py
5
8933
# -*- coding: utf-8 -*- from __future__ import unicode_literals from rest_framework import generics from rest_framework import serializers as ser from api.base import utils from api.base.exceptions import Conflict from api.base.exceptions import JSONAPIAttributeException from api.base.serializers import get_meta_type...
apache-2.0
supriyasawant/gstudio
gnowsys-ndf/gnowsys_ndf/benchmarker/benchmarkreport.py
2
3116
from gnowsys_ndf.ndf.models import * from django.http import HttpResponse import random from django.template import RequestContext from django.shortcuts import render_to_response, render from datetime import date,time,timedelta import json ''' The First method to get called. ''' db = get_database() col = db[Bench...
agpl-3.0
nanolearningllc/edx-platform-cypress
common/djangoapps/track/shim.py
71
6434
"""Map new event context values to old top-level field values. Ensures events can be parsed by legacy parsers.""" import json import logging from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import UsageKey log = logging.getLogger(__name__) CONTEXT_FIELDS_TO_INCLUDE = [ 'username', 'session...
agpl-3.0
rspavel/spack
var/spack/repos/builtin/packages/py-thirdorder/package.py
5
1476
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyThirdorder(PythonPackage): """It helps ShengBTE users create FORCE_CONSTANTS_3RD files e...
lgpl-2.1
samdoshi/teletype
utils/docs.py
1
6073
#!/usr/bin/env python3 import sys from pathlib import Path import jinja2 import pypandoc import pytoml as toml from common import list_ops, list_mods, validate_toml, get_tt_version if (sys.version_info.major, sys.version_info.minor) < (3, 6): raise Exception("need Python 3.6 or later") THIS_FILE = Path(__file_...
gpl-2.0
ghandiosm/Test
addons/point_of_sale/report/pos_lines.py
44
1518
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from openerp.osv import osv from openerp.report import report_sxw class pos_lines(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(pos_lines, self).__init__(cr, uid, nam...
gpl-3.0
dushu1203/chromium.src
third_party/pycoverage/coverage/__init__.py
208
4505
"""Code coverage measurement for Python. Ned Batchelder http://nedbatchelder.com/code/coverage """ from coverage.version import __version__, __url__ from coverage.control import coverage, process_startup from coverage.data import CoverageData from coverage.cmdline import main, CoverageScript from coverage.misc impo...
bsd-3-clause
mylokin/redisext
tests/test_expire.py
1
1260
from __future__ import absolute_import import redisext.counter import redisext.key import redisext.serializer from . import fixture class ExpireCounter(redisext.counter.Counter, redisext.key.Expire): EXPIRE = 60 CONNECTION = fixture.Connection SERIALIZER = redisext.serializer.Numeric class ExpireCount...
mit
GetSomeBlocks/ServerStatus
resources/lib/IMDbPY/imdb/parser/http/bsouplxml/etree.py
143
2728
""" parser.http.bsouplxml.etree module (imdb.parser.http package). This module adapts the beautifulsoup interface to lxml.etree module. Copyright 2008 H. Turgut Uyar <uyar@tekir.org> 2008 Davide Alberani <da@erlug.linux.it> This program is free software; you can redistribute it and/or modify it under the t...
mit
wcmckee/lcacoffee
hostassign.py
1
2135
# coding: utf-8 # script to assign hostname and ip address to machine # In[63]: import os import random import json import shutil # In[37]: colordir = os.listdir('/home/wcmckee/colortest/') # In[42]: alcolrz = [] # In[43]: for cold in colordir: #print cold if '.json' in cold: print cold ...
mit
Instanssi/Instanssi.org
Instanssi/screenshow/migrations/0003_auto_20210511_0020.py
1
1515
# Generated by Django 3.2.2 on 2021-05-10 21:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('screenshow', '0002_auto_20180711_2110'), ] operations = [ migrations.AlterField( model_name='ircmessage', name='id',...
mit
pbchou/trafficserver
tests/gold_tests/pluginTest/traffic_dump/traffic_dump.test.py
1
13125
""" Verify traffic_dump functionality. """ # 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 Licen...
apache-2.0
chenc10/Spark-PAF
examples/src/main/python/ml/binarizer_example.py
3
1587
# # 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 us...
apache-2.0
diagramsoftware/odoo
openerp/report/render/html2html/html2html.py
443
4238
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
tabalinas/jsgrid-django
clients/views.py
1
1522
from django.http import HttpResponse from django.core import serializers from django.shortcuts import render from simple_rest import Resource from .models import Client def index(request): return render(request, 'index.html') class Clients(Resource): def get(self, request): clients = Client.object...
mit
VishvajitP/Django-facebook
docs/docs_env/Lib/site-packages/pip-1.0-py2.5.egg/pip/basecommand.py
25
6939
"""Base Command class, and related routines""" import os import socket import sys import traceback import time from pip import commands from pip.log import logger from pip.baseparser import parser, ConfigOptionParser, UpdatingDefaultsHelpFormatter from pip.download import urlopen from pip.exceptions import BadCommand...
bsd-3-clause
allenp/odoo
addons/website_blog/models/website_blog.py
3
12036
# -*- coding: utf-8 -*- from datetime import datetime import lxml import random from openerp import tools from openerp import SUPERUSER_ID from openerp.addons.website.models.website import slug from openerp.osv import osv, fields from openerp.tools.translate import _ class Blog(osv.Model): _name = 'blog.blog' ...
gpl-3.0
MiltosD/CEF-ELRC
lib/python2.7/site-packages/haystack/management/commands/update_index.py
3
11192
import datetime import os import warnings from optparse import make_option from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import LabelCommand from django.db import reset_queries from django.utils.encoding import smart_str from haystack import co...
bsd-3-clause
qbuat/rootpy
rootpy/tree/tree.py
1
33528
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License from __future__ import absolute_import import sys import re import fnmatch import uuid import ROOT from .. import log; log = log[__name__] from .. import asrootpy, QROOT from ..extern.ordereddict import OrderedDict...
gpl-3.0
gimite/personfinder
app/vendors/unidecode/x05e.py
250
4668
data = ( 'Za ', # 0x00 'Bi ', # 0x01 'Shi ', # 0x02 'Bu ', # 0x03 'Ding ', # 0x04 'Shuai ', # 0x05 'Fan ', # 0x06 'Nie ', # 0x07 'Shi ', # 0x08 'Fen ', # 0x09 'Pa ', # 0x0a 'Zhi ', # 0x0b 'Xi ', # 0x0c 'Hu ', # 0x0d 'Dan ', # 0x0e 'Wei ', # 0x0f 'Zhang ', # 0x10 'Tang ...
apache-2.0
kernel-bz/ml
Lectures/CNN/cnn_adam_opt.py
2
4213
''' A Convolutional Network implementation example using TensorFlow library. This example is using the MNIST database of handwritten digits (http://yann.lecun.com/exdb/mnist/) Author: Aymeric Damien Project: https://github.com/aymericdamien/TensorFlow-Examples/ ''' # Import MINST data import input_data mnist = input_...
gpl-3.0
ericmckean/syzygy
third_party/numpy/files/numpy/lib/tests/test_recfunctions.py
23
25445
import sys import numpy as np import numpy.ma as ma from numpy.ma.testutils import * from numpy.ma.mrecords import MaskedRecords from numpy.lib.recfunctions import * get_names = np.lib.recfunctions.get_names get_names_flat = np.lib.recfunctions.get_names_flat zip_descr = np.lib.recfunctions.zip_descr class TestRecF...
apache-2.0
CapOM/ChromiumGStreamerBackend
tools/git/for-all-touched-files.py
68
4374
#!/usr/bin/env python # Copyright (c) 2011 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. """ Invokes the specified (quoted) command for all files modified between the current git branch and the specified branch or co...
bsd-3-clause
Grirrane/odoo
addons/portal/mail_thread.py
390
2004
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-TODAY OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
Jason-Zhao-Jie/MagicTower
Assets/Firebase/Editor/generate_xml_from_google_services_json.py
1
13865
#!/usr/bin/python # Copyright 2016 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
bsd-3-clause
leilihh/novaha
nova/virt/vmwareapi/imagecache.py
4
8346
# Copyright (c) 2014 VMware, 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 a...
apache-2.0
abdellatifkarroum/odoo
addons/base_gengo/__openerp__.py
312
2117
# -*- 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
vinay87/flyer
.buildozer/venv/lib/python2.7/site-packages/setuptools/command/build_ext.py
177
12442
from distutils.command.build_ext import build_ext as _du_build_ext from distutils.file_util import copy_file from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler from distutils.errors import DistutilsError from distutils import log import os import sys import itertools from s...
gpl-2.0
sealcode/gpandoc
ui/recipe_ui.py
1
3014
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'recipe.ui' # # Created by: PyQt5 UI code generator 5.7.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectNa...
lgpl-3.0
dominikl/openmicroscopy
components/tools/OmeroCpp/ext/gtest-1.7.0/test/gtest_throw_on_failure_test.py
2917
5766
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
gpl-2.0
stevekuznetsov/ansible
lib/ansible/plugins/strategy/debug.py
22
5050
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import cmd import pprint import sys from ansible.plugins.strategy.linear import StrategyModule as LinearStrategyModule from ansible.compat.six.moves import reduce try: from __main__ import display except ImportError: fro...
gpl-3.0
nik-hil/fastai
deeplearning2/rossman_exp.py
10
5451
train_ratio=0.9 use_dict=True use_scaler=False init_emb=False split_contins=True samp_size = 100000 #samp_size = 0 import math, keras, datetime, pandas as pd, numpy as np, keras.backend as K import matplotlib.pyplot as plt, xgboost, operator, random, pickle, os from sklearn_pandas import DataFrameMapper from sklearn.p...
apache-2.0
kalid55/git-core
contrib/svn-fe/svnrdump_sim.py
328
2044
#!/usr/bin/python """ Simulates svnrdump by replaying an existing dump from a file, taking care of the specified revision range. To simulate incremental imports the environment variable SVNRMAX can be set to the highest revision that should be available. """ import sys import os if sys.hexversion < 0x02040000: # T...
gpl-2.0
tboyce021/home-assistant
tests/components/api/test_init.py
10
17472
"""The tests for the Home Assistant API component.""" # pylint: disable=protected-access import json from aiohttp import web import pytest import voluptuous as vol from homeassistant import const from homeassistant.bootstrap import DATA_LOGGING import homeassistant.core as ha from homeassistant.setup import async_set...
apache-2.0
Micronaet/micronaet-trip
account_trip_edi_c5/__openerp__.py
1
1740
############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program 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 ...
agpl-3.0
dkodnik/Ant
openerp/tests/test_ir_sequence.py
38
8071
# -*- coding: utf-8 -*- # Run with one of these commands: # > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \ # OPENERP_DATABASE=yy PYTHONPATH=. python tests/test_ir_sequence.py # > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \ # OPENERP_DATABASE=yy nosetests tests/test_ir_se...
agpl-3.0
GinnyN/towerofdimensions-django
build/lib/django/contrib/localflavor/ro/forms.py
85
6762
# -*- coding: utf-8 -*- """ Romanian specific form helpers. """ from __future__ import absolute_import from django.contrib.localflavor.ro.ro_counties import COUNTIES_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError, Field, RegexField, Select from django.utils.translation...
bsd-3-clause
dougbeal/gyp
test/generator-output/gyptest-depth.py
232
1561
#!/usr/bin/env python # Copyright 2014 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 building a project hierarchy created when the --generator-output= and --depth= options is used to put the build configuration files...
bsd-3-clause
devops2014/djangosite
tests/select_related/tests.py
38
8821
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from .models import ( Bookmark, Domain, Family, Genus, HybridSpecies, Kingdom, Klass, Order, Phylum, Pizza, Species, TaggedItem, ) class SelectRelatedTests(TestCase): @classmethod ...
bsd-3-clause
lookout/dd-agent
checks.d/elastic.py
3
29804
# stdlib from collections import defaultdict, namedtuple import time import urlparse # 3p import requests # project from checks import AgentCheck from config import _is_affirmative from util import headers class NodeNotFound(Exception): pass ESInstanceConfig = namedtuple( 'ESInstanceConfig', [ 'ps...
bsd-3-clause
ezequielpereira/Time-Line
libs/wx/tools/Editra/src/updater.py
2
25278
############################################################################### # Name: updater.py # # Purpose: UI and services for checking update status and downloading updates # # for Editra. # ...
gpl-3.0
thomaskeck/root
interpreter/llvm/src/tools/clang/tools/scan-build-py/tests/unit/test_clang.py
22
1387
# -*- coding: utf-8 -*- # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. import libear import libscanbuild.clang as sut import unittest import os.path class GetClangArgumentsTest(unittest.TestCase)...
lgpl-2.1
SqueezeStudioAnimation/omtk
python/omtk/libs/libPymel.py
1
14241
import logging import pymel.core as pymel from maya import OpenMaya # # A PyNodeChain is a special pymel-related object that act exactly like a standard array. # However it allow us to have more bells and whistles. # def is_valid_PyNode(val): return (val and hasattr(val, 'exists') and val.exists()) if val else ...
mit
microsoft/task_oriented_dialogue_as_dataflow_synthesis
src/dataflow/leaderboard/predict.py
1
2613
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. """ Semantic Machines\N{TRADE MARK SIGN} software. Creates the prediction files from onmt_translate output for the leaderboard. """ import argparse from typing import List import jsons from more_itertools import chunked from dataflow.core.dia...
mit
deathcap/Burger
solum/compat.py
2
6211
#!/usr/bin/env python # -*- coding: utf8 -*- """ Copyright (c) 2010-2011 Tyler Kennedy <tk@tkte.ch> 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 limitatio...
mit
nashgul/weechat
audacious_script/audacious.py
1
3067
# audacious now playing for weechat # nashgul <m.alcocer1978@gmail.com> # version 0.1 # white => "00", black => "01", darkblue => "02", darkgreen => "03", lightred => "04", darkred => "05", magenta => "06", orange => "07", yellow => "08", lightgreen => "09", cyan => "10", lightcyan => "11", lightblue => "12", lightmag...
gpl-2.0
gonboy/sl4a
python/src/Lib/plat-mac/icopen.py
73
2068
"""icopen patch OVERVIEW icopen patches MacOS Python to use the Internet Config file mappings to select the type and creator for a file. Version 1 released to the public domain 3 November 1999 by Oliver Steele (steele@cs.brandeis.edu). DETAILS This patch causes files created by Python's open(filename, 'w') command...
apache-2.0
mancoast/CPythonPyc_test
cpython/261_test_pprint.py
55
24560
import pprint import test.test_support import unittest import test.test_set try: uni = unicode except NameError: def uni(x): return x # list, tuple and dict subclasses that do or don't overwrite __repr__ class list2(list): pass class list3(list): def __repr__(self): return list.__repr...
gpl-3.0
theflofly/tensorflow
tensorflow/python/keras/utils/data_utils.py
4
23692
# 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
SerpentAI/SerpentAI
serpent/game_frame.py
1
5346
import skimage.color import skimage.measure import skimage.transform import skimage.filters import skimage.morphology import numpy as np import io from PIL import Image class GameFrameError(BaseException): pass class GameFrame: def __init__(self, frame_data, frame_variants=None, timestamp=None, **kwargs...
mit
cognitiveclass/edx-platform
common/djangoapps/embargo/tests/test_forms.py
132
4829
# -*- coding: utf-8 -*- """ Unit tests for embargo app admin forms. """ from django.test import TestCase from opaque_keys.edx.locator import CourseLocator # Explicitly import the cache from ConfigurationModel so we can reset it after each test from config_models.models import cache from embargo.models import IPFilte...
agpl-3.0
Nikoala/CouchPotatoServer
libs/pyutil/hashexpand.py
106
2890
# Copyright (c) 2002-2012 Zooko Wilcox-O'Hearn # This file is part of pyutil; see README.rst for licensing terms. import warnings """ Cryptographically strong pseudo-random number generator based on SHA256. """ class SHA256Expander: """ Provide a cryptographically strong pseudo-random number generator base...
gpl-3.0
mdeejay/android_kernel_dlxub1
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
andreslechuga/arte_mexicano_antiguo
felipegerard/code/luigi/itm/build/lib/itm/ShowLDA.py
4
5168
# coding=utf-8 #DESPUES DE PREDICTLDA #ANTES DE TrainLSI import luigi import os import re import pickle import json from pprint import pprint from lda import TrainLDA, PredictLDA class ShowLDA(luigi.Task): """Necesita PredictLDA y TrainLDA """ #variables de ShowLDA res_dir = luigi.Parameter() #variables de LDA...
agpl-3.0
ryfeus/lambda-packs
Selenium_PhantomJS/source/requests/packages/urllib3/util/url.py
713
5879
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value f...
mit
proffalken/cobbler
koan/text_wrap.py
21
13867
"""Text wrapping and filling. (note: repackaged in koan because it's not present in RHEL3) """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gward@python.net> __revision__ = "$Id: textwrap.py,v 1.32.8.2 2004/05/13 01:48:15 gward Exp $" impor...
gpl-2.0
newswangerd/ansible
lib/ansible/utils/collection_loader/_collection_config.py
18
2945
# (c) 2019 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 from ansible.module_utils.common.text.converters import to_text from ansible.module_utils.six import with_meta...
gpl-3.0
rajul/Pydev
plugins/org.python.pydev.jython/Lib/encodings/mac_cyrillic.py
593
13710
""" Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.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...
epl-1.0
cestella/incubator-metron
metron-deployment/packaging/ambari/elasticsearch-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/service_check.py
8
4846
#!/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 "License");...
apache-2.0
dexterx17/nodoSocket
clients/Python-2.7.6/Demo/turtle/tdemo_paint.py
6
1125
#!/usr/bin/env python """ turtle-example-suite: tdemo_paint.py A simple eventdriven paint program - use left mouse button to move turtle - middle mouse button to change color - right mouse button do turn filling on/off ------------------------------------------- Play around by clicking into the ...
mit
adiIspas/Machine-Learning_A-Z
Machine Learning A-Z/Part 7 - Natural Language Processing/Section 36 - Natural Language Processing/natural_language_processing.py
3
1452
# Natural Language Processing # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Restaurant_Reviews.tsv', delimiter = '\t', quoting = 3) # Cleaning the texts import re import nltk nltk.download('stopwords') from nltk.corpus ...
mit
YangChihWei/w16b_test
static/Brython3.1.3-20150514-095342/Lib/tarfile.py
728
88474
#!/usr/bin/env python3 #------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de> # All rights reserved. # # Permission is hereby granted, free of charge, to any pers...
agpl-3.0
40223236/40223236-50
static/Brython3.1.1-20150328-091302/Lib/unittest/runner.py
637
7485
"""Running tests""" import sys import time import warnings from . import result from .signals import registerResult __unittest = True class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'writeln' method""" def __init__(self,stream): self.stream = stream def __ge...
gpl-3.0
CodingCat/mxnet
example/image-classification/symbols/inception-resnet-v2.py
23
6943
# 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
goldsborough/.emacs
.emacs.d/.python-environments/default/lib/python3.5/token.py
63
3075
"""Token constants (from "token.h").""" __all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF'] # This file is automatically generated; please don't muck it up! # # To update the symbols in this file, 'cd' to the top directory of # the python source tree after building the interpreter and run: # # ./pyth...
mit
ojengwa/oh-mainline
vendor/packages/docutils/test/test_parsers/test_rst/test_directives/test_parsed_literals.py
18
1708
#! /usr/bin/env python # $Id: test_parsed_literals.py 7072 2011-07-06 15:52:30Z milde $ # Author: Lea Wiemann <LeWiemann@gmail.com> # Copyright: This module has been placed in the public domain. """ Tests for the body.py 'parsed-literal' directive. """ from __init__ import DocutilsTestSupport def suite(): s = D...
agpl-3.0
AloneRoad/Inforlearn
django/contrib/gis/tests/test_geoforms.py
74
2653
import unittest from django.forms import ValidationError from django.contrib.gis import forms from django.contrib.gis.geos import GEOSGeometry class GeometryFieldTest(unittest.TestCase): def test00_init(self): "Testing GeometryField initialization with defaults." fld = forms.GeometryField() ...
apache-2.0