repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
dimagol/trex-core
scripts/external_libs/scapy-2.3.1/python3/scapy/layers/llmnr.py
22
2396
from scapy.fields import * from scapy.packet import * from scapy.layers.inet import UDP from scapy.layers.dns import DNSQRField, DNSRRField, DNSRRCountField """ LLMNR (Link Local Multicast Node Resolution). [RFC 4795] """ ############################################################################# ### ...
apache-2.0
awkspace/ansible
lib/ansible/plugins/terminal/cnos.py
86
2824
# (C) 2017 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # GNU General Public License v3.0+ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for ...
gpl-3.0
alsoicode/django-filer
filer/utils/filer_easy_thumbnails.py
12
3444
#-*- coding: utf-8 -*- from easy_thumbnails.files import Thumbnailer import os import re from filer import settings as filer_settings # match the source filename using `__` as the seperator. ``opts_and_ext`` is non # greedy so it should match the last occurence of `__`. # in ``ThumbnailerNameMixin.get_thumbnail_name``...
bsd-3-clause
harshilasu/LinkurApp
y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/unit/cloudfront/test_invalidation_list.py
22
4037
#!/usr/bin/env python import random import string from tests.unit import unittest import mock import boto RESPONSE_TEMPLATE = r""" <InvalidationList> <Marker/> <NextMarker>%(next_marker)s</NextMarker> <MaxItems>%(max_items)s</MaxItems> <IsTruncated>%(is_truncated)s</IsTruncated> %(inval_summaries)s </...
gpl-3.0
jaor/bigmler
bigmler/options/timeseries.py
1
10871
# -*- coding: utf-8 -*- # # Copyright 2017-2020 BigML # # 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
VapourApps/va_master
va_master/host_drivers/libvirt_driver.py
1
28404
try: from . import base from .base import Step, StepResult except: import base from base import Step, StepResult from base import int_to_bytes from tornado.httpclient import AsyncHTTPClient, HTTPRequest import tornado.gen import json, yaml import subprocess import libvirt import uuid import os from x...
gpl-3.0
GdZ/scriptfile
software/googleAppEngine/lib/django_1_3/django/contrib/localflavor/ca/ca_provinces.py
237
1603
""" An alphabetical list of provinces and territories for use as `choices` in a formfield., and a mapping of province misspellings/abbreviations to normalized abbreviations Source: http://www.canada.gc.ca/othergov/prov_e.html This exists in this standalone file so that it's only imported into memory when explici...
mit
kmunve/TSanalysis
Plotting/meteo_plots.py
1
1137
#!/usr/bin/env python # -*- coding: utf-8 -*- from matplotlib import pyplot as plt from numpy import arange """ __author__: 'kmunve' """ def _temperature_plot(values, xticks=None, p_title=None, p_xlabel='Time', p_ylabel='Temperature'): """ TODO: add a check if the values are in Kelvin, Fahrenheit, or Celsi...
mit
yunify/qingcloud-cli
qingcloud/cli/iaas_client/actions/sg/describe_security_group_rules.py
1
2198
# ========================================================================= # Copyright 2012-present Yunify, Inc. # ------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this work except in compliance with the Licens...
apache-2.0
tushevorg/namebench
nb_third_party/dns/tsigkeyring.py
248
1658
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
mzdaniel/oh-mainline
vendor/packages/Django/django/db/models/manager.py
306
7872
from django.utils import copycompat as copy from django.conf import settings from django.db import router from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet from django.db.models import signals from django.db.models.fields import FieldDoesNotExist def ensure_default_manager(sender, ...
agpl-3.0
dstufft/html5lib-python
html5lib/filters/optionaltags.py
1727
10500
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2...
mit
meziti/bigbullions-test
p2pool/bitcoin/p2p.py
12
6325
''' Implementation of Bitcoin's p2p protocol ''' import random import sys import time from twisted.internet import protocol import p2pool from . import data as bitcoin_data from p2pool.util import deferral, p2protocol, pack, variable class Protocol(p2protocol.Protocol): def __init__(self, net): p2protoc...
gpl-3.0
diorcety/intellij-community
python/testData/inspections/PyNumpyType/Dtype.py
79
1189
def maximum_fill_value(obj): """ Return the minimum value that can be represented by the dtype of an object. This function is useful for calculating a fill value suitable for taking the maximum of an array with a given dtype. Parameters ---------- obj : dtype An object that can be ...
apache-2.0
gilbert-yuan/gooderp_addons
buy/wizard/buy_summary_goods_wizard.py
6
2109
# -*- coding: utf-8 -*- from datetime import date from odoo import models, fields, api from odoo.exceptions import UserError class BuySummaryGoodsWizard(models.TransientModel): _name = 'buy.summary.goods.wizard' _description = u'采购汇总表(按商品)向导' @api.model def _default_date_start(self): return ...
agpl-3.0
nwjs/chromium.src
tools/grit/grit/format/gen_predetermined_ids.py
3
4798
#!/usr/bin/env python # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ A tool to generate a predetermined resource ids file that can be used as an input to grit via the -p option. This is meant to be ru...
bsd-3-clause
moio/spacewalk
proxy/proxy/rhnConstants.py
3
1463
#!/usr/bin/python # # Copyright (c) 2008--2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should...
gpl-2.0
jakevdp/altair
tools/schemapi/codegen.py
1
7382
"""Code generation utilities""" from .utils import SchemaInfo, is_valid_identifier, indent_docstring, indent_arglist import textwrap import re class CodeSnippet(object): """Object whose repr() is a string of code""" def __init__(self, code): self.code = code def __repr__(self): return se...
bsd-3-clause
Samweli/inasafe
realtime/earthquake/shake_data.py
4
7459
# coding=utf-8 """ InaSAFE Disaster risk assessment tool developed by AusAid and World Bank - **Getting shake data from local storage** Contact : ole.moller.nielsen@gmail.com .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as pub...
gpl-3.0
jamalex/kolibri
kolibri/deployment/default/urls.py
2
1495
# -*- coding: utf-8 -*- """kolibri 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...
mit
lindamar/ecclesi
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py
515
5599
from __future__ import absolute_import # Base Exceptions class HTTPError(Exception): "Base exception used by this module." pass class HTTPWarning(Warning): "Base warning used by this module." pass class PoolError(HTTPError): "Base exception for errors caused within a pool." def __init__(se...
mit
WSULib/combine
tests/test_forms/test_field_mapper_form.py
1
1300
from django.test import TestCase from core.forms import FieldMapperForm from core.models import get_field_mapper_choices class FieldMapperFormTestCase(TestCase): def test_python_prohibited(self): test_body = { 'name': 'Test Field Mapper', 'field_mapper_type': 'python', } ...
mit
EvaSDK/sqlalchemy
lib/sqlalchemy/orm/__init__.py
70
7976
# orm/__init__.py # Copyright (C) 2005-2015 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 """ Functional constructs for ORM configuration. See the SQLAlchemy object relation...
mit
kallewoof/bitcoin
test/functional/p2p_message_capture.py
22
2883
#!/usr/bin/env python3 # Copyright (c) 2020 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 per-peer message capture capability. Additionally, the output of contrib/message-capture/message-captu...
mit
yfried/ansible
test/units/compat/unittest.py
156
1302
# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
gpl-3.0
agaldona/odoomrp-wip-1
product_variants_no_automatic_creation/models/product_configurator.py
8
12757
# -*- coding: utf-8 -*- # © 2015 Oihane Crucelaegui - AvanzOSC # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3 from openerp import api, fields, models, exceptions, _ from openerp.addons import decimal_precision as dp class ProductConfigurator(models.Abstr...
agpl-3.0
biorack/metatlas
jaws/jaws_wdls/scripts/mzml_loader_jaws.py
2
6958
#!/usr/bin/env python from __future__ import print_function import argparse import os import pwd import datetime import sys import traceback import tables import warnings warnings.filterwarnings("ignore", module="plotly") # pymzml has plotly in it and if you don't have a setup in your # home directory, you get a w...
bsd-3-clause
iDTLabssl/hr
hr_unported/hr_payroll_register_report/report/payroll_register.py
1
9329
# -*- coding:utf-8 -*- # # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com> # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it under...
agpl-3.0
40223231/2015-cdb-g4-final-test-by-6-22
static/Brython3.1.1-20150328-091302/Lib/sre_parse.py
630
29657
# # Secret Labs' Regular Expression Engine # # convert re-style regular expression to sre pattern # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" # XXX: show string offset and offending ch...
gpl-3.0
j-faria/OPEN
scons/scons-local-2.3.4/SCons/Tool/MSCommon/netframework.py
9
2754
# # Copyright (c) 2001 - 2014 The SCons Foundation # # 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...
mit
40223138/2015cd_0505
static/Brython3.1.1-20150328-091302/Lib/collections/__init__.py
625
25849
#__all__ = ['deque', 'defaultdict', 'Counter'] from _collections import deque, defaultdict #from itertools import repeat as _repeat, chain as _chain, starmap as _starmap __all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList', 'UserString', 'Counter', 'OrderedDict'] # For bootstrapping re...
agpl-3.0
fccagou/pynotif
usb/_objfinalizer.py
23
5287
# -*- coding: utf-8 -*- # # Copyright (C) 2014 André Erdmann # # The following terms apply to all files associated # with the software unless explicitly disclaimed in individual files. # # The authors hereby grant permission to use, copy, modify, distribute, # and license this software and its documentation for any pur...
gpl-2.0
wanglongqi/sympy
sympy/utilities/tests/test_pytest.py
105
1601
from sympy.utilities.pytest import raises, USE_PYTEST if USE_PYTEST: import py.test pytestmark = py.test.mark.skipif(USE_PYTEST, reason=("using py.test")) # Test callables def test_expected_exception_is_silent_callable(): def f(): raise ValueError() raise...
bsd-3-clause
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/names/cache.py
55
2752
# -*- test-case-name: twisted.names.test -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import time from zope.interface import implements from twisted.names import dns from twisted.python import failure, log from twisted.internet import interfaces, defer import common class ...
bsd-3-clause
yonglehou/pybrain
examples/supervised/neuralnets+svm/example_mixturedensity.py
26
3548
# $Id$ # Train a mixture of Gaussians to approximate a multi-mode dataset. # It seems fairly easy to fall into some local minimum. Good solutions # have errors around -200. # This example reproduces Fig. 5.21 from Bishop (2006). __author__ = 'Martin Felder' import pylab as p import numpy as np from pybrain.structure....
bsd-3-clause
backmari/moose
python/chigger/tests/new_files/old_files.py
6
1873
#!/usr/bin/env python #pylint: disable=missing-docstring ################################################################# # DO NOT MODIFY THIS HEADER # # MOOSE - Multiphysics Object Oriented Simulation Environment # # #...
lgpl-2.1
Nowheresly/odoo
addons/auth_signup/controllers/main.py
26
6356
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
jarn0ld/gnuradio
gr-uhd/examples/python/freq_hopping.py
36
9337
#!/usr/bin/env python # # Copyright 2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
gannetson/sportschooldeopenlucht
env/lib/python2.7/site-packages/django/core/files/images.py
178
1982
""" Utility functions for handling images. Requires PIL, as you might imagine. """ from django.core.files import File class ImageFile(File): """ A mixin for use alongside django.core.files.base.File, which provides additional features for dealing with images. """ def _get_width(self): ret...
bsd-3-clause
bdauvergne/python-oath
oath/_ocra.py
1
14944
import hmac import hashlib import re import random import string from . import _hotp as hotp, _utils ''' Implementation of OCRA See also http://tools.ietf.org/html/draft-mraihi-mutual-oath-hotp-variants-14 ''' __all__ = ( 'str2ocrasuite', 'StateException', 'OCRAChallengeResponseServer', 'OC...
bsd-3-clause
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/numpy/f2py/auxfuncs.py
85
21818
#!/usr/bin/env python """ Auxiliary functions for f2py2e. Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy (BSD style) LICENSE. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RIS...
gpl-3.0
ydm/eecont
eecont/tests.py
1
24177
#-*- coding: utf-8 -*- # TODO: use fixtures instead of hard coded dictionaries from __future__ import unicode_literals import copy import datetime from django.test import TestCase from django.conf import settings from django.utils import six from django.utils import timezone import pytz from eecont import inserte...
lgpl-3.0
bjolivot/ansible
lib/ansible/modules/cloud/openstack/os_user.py
26
9043
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module 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...
gpl-3.0
rtucker/sycamore
Sycamore/support/pytz/zoneinfo/Australia/Melbourne.py
9
6234
'''tzinfo timezone information for Australia/Melbourne.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Melbourne(DstTzInfo): '''Australia/Melbourne timezone definition. See datetime.tzinfo for details''' zone = 'Australi...
gpl-2.0
taoyunxing/trafficserver
tests/gold_tests/logging/ccid_ctid_observer.py
8
1528
''' Examines log generated by ccid_ctid.test.py, returns 0 if valid, 1 if not. ''' # 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 th...
apache-2.0
bregman-arie/ansible
lib/ansible/modules/network/vyos/vyos_system.py
68
6307
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
awni/tensorflow
tensorflow/python/ops/tensor_array_ops.py
4
9808
# 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 required by applicable law or a...
apache-2.0
dynaryu/inasafe
safe/utilities/analysis_handler.py
1
26118
# coding=utf-8 """ InaSAFE Disaster risk assessment tool by AusAid **GUI InaSAFE Wizard Dialog.** Contact : ole.moller.nielsen@gmail.com .. 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 Found...
gpl-3.0
vwvww/servo
tests/wpt/web-platform-tests/webdriver/tests/sessions/new_session/invalid_capabilities.py
12
4145
#META: timeout=long import pytest from webdriver import error from conftest import product, flatten @pytest.mark.parametrize("value", [None, 1, "{}", []]) def test_invalid_capabilites(new_session, value): with pytest.raises(error.InvalidArgumentException): new_session({"capabilities": value}) @pytest....
mpl-2.0
vishalbedi/CollegeScorecard
backend/flask_app/models.py
1
7158
"""All the database related entities are in this module.""" from flask_sqlalchemy import SQLAlchemy from sqlalchemy import text import numpy as np import math from scipy.stats import lognorm from sqlalchemy.ext.hybrid import hybrid_property db = SQLAlchemy() class Ethnicity(db.Model): """Ethnicity Model. We wil...
mit
av8ramit/tensorflow
tensorflow/python/saved_model/saved_model_test.py
4
44336
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
mtnbikenc/ansible-modules-extras
cloud/vmware/vca_vapp.py
72
8888
#!/usr/bin/python # Copyright (c) 2015 Ansible, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
arhik/nupic
examples/opf/clients/hotgym/anomaly/one_gym/remove_tuesdays.py
15
1039
import csv import shutil import datetime ORIGINAL = "rec-center-hourly.csv" BACKUP = "rec-center-hourly-backup.csv" DATE_FORMAT = "%m/%d/%y %H:%M" def isTuesday(date): return date.weekday() is 1 def withinOctober(date): return datetime.datetime(2010, 10, 1) <= date < datetime.datetime(2010, 11, 1) def run(...
agpl-3.0
abs0/tapiriik
tapiriik/services/Pulsstory/pulsstory.py
3
18516
from tapiriik.settings import PULSSTORY_CLIENT_ID, PULSSTORY_CLIENT_SECRET from tapiriik.services.service_base import ServiceAuthenticationType, ServiceBase from tapiriik.services.service_record import ServiceRecord from tapiriik.services.stream_sampling import StreamSampler from tapiriik.services.auto_pause import Aut...
apache-2.0
kaiyuanheshang/zulip
zerver/management/commands/query_ldap.py
113
1068
from __future__ import absolute_import import sys from django.contrib.auth import authenticate, login, get_backends from django.core.management.base import BaseCommand from django.conf import settings from django_auth_ldap.backend import LDAPBackend, _LDAPUser # Run this on a cronjob to pick up on name changes. de...
apache-2.0
mapennell/ansible
v1/ansible/runner/lookup_plugins/together.py
174
2135
# (c) 2013, Bradley Young <young.bradley@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
gpl-3.0
molotof/infernal-twin
build/reportlab/build/lib.linux-i686-2.7/reportlab/platypus/figures.py
29
18747
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/figures.py """This includes some demos of platypus for use in the API proposal""" __version__=''' $Id$ ''' import os from reportlab.lib impo...
gpl-3.0
jankeromnes/depot_tools
third_party/boto/manage/propget.py
115
2498
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
bsd-3-clause
egeor/libxsmm
samples/transpose/transpose_opentuner.py
1
6321
#!/usr/bin/env python ############################################################################### # Copyright (c) 2017-2018, Intel Corporation # # All rights reserved. # # ...
bsd-3-clause
StefanRijnhart/odoo
addons/website_forum/models/forum.py
1
37021
# -*- coding: utf-8 -*- from datetime import datetime import uuid from werkzeug.exceptions import Forbidden import openerp from openerp import api, tools from openerp import SUPERUSER_ID from openerp.addons.website.models.website import slug from openerp.exceptions import Warning from openerp.osv import osv, fields f...
agpl-3.0
PluginCafe/cinema4d_py_sdk
scripts/takesystem/takesystem_OverrideGroupMaterials.py
1
1057
import c4d from c4d import gui #Author: s_bach #TakeSystem Example def main(): takeData = doc.GetTakeData() if takeData is None: return # This code creates a take with an override group for each selected material and adds the object "object" to the newly created group. obj = doc.G...
apache-2.0
dotcool/zulip
api/integrations/svn/zulip_svn_config.py
124
2363
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2014 Zulip, Inc. # # 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 #...
apache-2.0
sharhar/USB-Thing
UpdaterFiles/Lib/python-3.5.1.amd64/Lib/site-packages/pip/_vendor/distlib/util.py
224
51518
# # Copyright (C) 2012-2014 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import shutil import socket import...
apache-2.0
agoose77/hivesystem
hiveguilib/HQt/widgets/connectionHook.py
1
16335
# <license> # Copyright (C) 2011 Andrea Interguglielmi, All rights reserved. # This file is part of the coral repository downloaded from http://code.google.com/p/coral-repo. # # Modified for the Hive system by Sjoerd de Vries # All modifications copyright (C) 2012 Sjoerd de Vries, All rights reserved # # Redistributio...
bsd-2-clause
parag2489/Image-Quality
train_imageQuality_Estmn_multiPatchSmallNetwork.py
1
19578
import numpy as np import pdb import sys from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape from keras.layers.convolutional import Convolution1D, Convolution2D, MaxPooling2D from keras.layers.convolutional import Convolution3D, MaxPooling3D # from keras.layers...
mit
Intel-Corporation/tensorflow
tensorflow/python/keras/layers/dense_attention.py
1
12205
# 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
transtone/transconfig
bin/classifier.py
1
2805
#!/usr/bin/env python import os import sys import argparse #list of known formats here can be added """ All format lists were taken from wikipedia, not all of them were added due to extensions not being exclusive to one format such as webm, or raw Audio - https://en.wikipedia.org/wiki/Audio_file_format ...
mit
davidyezsetz/kuma
vendor/packages/ipython/IPython/external/mglob.py
7
7672
#!/usr/bin/env python r""" mglob - enhanced file list expansion module Use as stand-alone utility (for xargs, `backticks` etc.), or a globbing library for own python programs. Globbing the sys.argv is something that almost every Windows script has to perform manually, and this module is here to help with that task....
mpl-2.0
erickt/hue
desktop/core/ext-py/python-openid-2.2.5/openid/yadis/xrires.py
157
4268
# -*- test-case-name: openid.test.test_xrires -*- """XRI resolution. """ from urllib import urlencode from openid import fetchers from openid.yadis import etxrd from openid.yadis.xri import toURINormal from openid.yadis.services import iterServices DEFAULT_PROXY = 'http://proxy.xri.net/' class ProxyResolver(object):...
apache-2.0
glennq/scikit-learn
sklearn/datasets/__init__.py
72
3807
""" The :mod:`sklearn.datasets` module includes utilities to load datasets, including methods to load and fetch popular reference datasets. It also features some artificial data generators. """ from .base import load_diabetes from .base import load_digits from .base import load_files from .base import load_iris from ....
bsd-3-clause
JonathanSeguin/Mariana
Mariana/tests/decorators_tests.py
1
1417
import unittest import Mariana.layers as ML import Mariana.initializations as MI import Mariana.decorators as MD import Mariana.costs as MC import Mariana.regularizations as MR import Mariana.scenari as MS import Mariana.activations as MA import theano.tensor as tt import numpy class DecoratorTests(unittest.TestCase...
apache-2.0
cznweb/arkos
arkos/signals.py
2
2713
""" Classes and functions to manage internal signal hooks and listeners. arkOS Core (c) 2016 CitizenWeb Written by Jacob Cook Licensed under GPLv3, see LICENSE.md """ from arkos import storage, logger class Listener: """ Class representing a signal listener. A signal listener is set up to track the emi...
gpl-3.0
tm-kn/django-pdf-model
django_pdf/tests/demosite/models.py
1
1859
from django.conf import settings from django.db import models from django.shortcuts import reverse from django_pdf.models import PDFModelMixin from django_pdf import pdf_fields class Report(PDFModelMixin, models.Model): title = models.CharField(max_length=255) introduction = models.CharField(max_length=255) ...
bsd-2-clause
namjae/AutobahnTestSuite
autobahntestsuite/autobahntestsuite/case/case5_11.py
14
1495
############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## 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 ## ## ht...
apache-2.0
SaschaMester/delicium
tools/perf/page_sets/gmail_compose_discard.py
1
2495
# 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 re from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry import story def _CreateXpathFunction...
bsd-3-clause
1ukash/horizon
horizon/api/base.py
4
3984
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 # no...
apache-2.0
gmatteo/pymatgen
pymatgen/cli/pmg_config.py
3
6633
#!/usr/bin/env python # coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Implementation for `pmg config` CLI. """ import glob import os import shutil import subprocess import sys from urllib.request import urlretrieve from monty.serialization import dump...
mit
ApisSys/linux-analogdevicesinc-ap6
Documentation/sphinx/rstFlatTable.py
64
13304
#!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- # pylint: disable=C0330, R0903, R0912 u""" flat-table ~~~~~~~~~~ Implementation of the ``flat-table`` reST-directive. :copyright: Copyright (C) 2016 Markus Heiser :license: GPL Version 2, June 1991 see linux/COPYING for details. ...
gpl-2.0
tsnoam/Flexget
flexget/plugins/modify/torrent_scrub.py
13
3968
""" Torrent Scrubber Plugin. """ from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin, validator from flexget.event import event from flexget.plugins.modify.torrent import TorrentFilename from flexget.utils import bittorrent log = logging.getLogger('torrent_scru...
mit
IllusionRom-deprecated/android_platform_external_chromium_org_tools_grit
grit/tool/xmb.py
34
9656
#!/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. """The 'grit xmb' tool. """ import getopt import os from xml.sax import saxutils from grit import grd_reader from grit import la...
bsd-2-clause
maxalbert/ansible
v1/ansible/inventory/script.py
109
5971
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
dnjohnstone/hyperspy
hyperspy/defaults_parser.py
1
10780
# -*- coding: utf-8 -*- # Copyright 2007-2020 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
mozilla/olympia
src/olympia/api/tests/test_pagination.py
4
4205
from unittest import mock from rest_framework import generics, serializers, status from rest_framework.test import APIRequestFactory from olympia.amo.tests import TestCase from olympia.api.pagination import ( CustomPageNumberPagination, ESPageNumberPagination, OneOrZeroPageNumberPagination, ) class Pass...
bsd-3-clause
alexteodor/odoo
addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py
301
14179
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c): # # 2005 pyopenoffice.py Martin Simon (http://www.bezirksreiter.de) # 2005 Fabien Pinckaers, TINY SPRL. (http://tiny.be) # # This program is free software: you can redistribute it and/or ...
agpl-3.0
apiaryio/snowcrash
tools/gyp/pylib/gyp/MSVSProject.py
2736
6387
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml #-------------------------------------------------------------------...
mit
jwren/intellij-community
python/helpers/typeshed/tests/check_consistent.py
5
8367
#!/usr/bin/env python3 # For security (and simplicity) reasons, only a limited kind of files can be # present in /stdlib and /stubs directories, see README for detail. Here we # verify these constraints. # In addition, for various reasons we need the contents of certain files to be # duplicated in two places, for exa...
apache-2.0
ChanderG/scipy
scipy/signal/tests/test_filter_design.py
63
96267
from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy.testing import (TestCase, assert_array_almost_equal, assert_array_equal, assert_array_less, assert_raises, assert_equal, assert_, ...
bsd-3-clause
jvrsantacruz/XlsxWriter
xlsxwriter/test/utility/test_xl_rowcol_to_cell.py
8
2341
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...utility import xl_rowcol_to_cell from ...utility import xl_rowcol_to_cell_fast class TestUtility(unittest.TestCase): ...
bsd-2-clause
wikimedia/operations-debs-kubernetes
cluster/juju/layers/kubernetes-worker/lib/charms/kubernetes/common.py
365
1084
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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 appli...
apache-2.0
donspaulding/adspygoogle
examples/adspygoogle/dfp/v201302/contact_service/create_contacts.py
3
2467
#!/usr/bin/python # # Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
donspaulding/adspygoogle
examples/adspygoogle/dfp/v201208/create_video_line_item.py
4
4536
#!/usr/bin/python # # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
wuxue/altanalyze
SQLInterace.py
2
3693
### SQL Interface import string import time import random import math import sys, os import sqlite3 import export def cleanUpLine(line): line = string.replace(line,'\n','') line = string.replace(line,'\c','') data = string.replace(line,'\r','') data = string.replace(data,'"','') return data def f...
apache-2.0
themrmax/scikit-learn
doc/conf.py
10
9807
# -*- coding: utf-8 -*- # # scikit-learn documentation build configuration file, created by # sphinx-quickstart on Fri Jan 8 09:13:42 2010. # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
bsd-3-clause
drglove/SickRage
lib/github/StatsParticipation.py
74
2654
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> # # ...
gpl-3.0
orgito/ansible
lib/ansible/modules/system/seboolean.py
2
10133
#!/usr/bin/python # Copyright: (c) 2012, Stephen Fromm <sfromm@gmail.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_version': '1.1', ...
gpl-3.0
Evervolv/android_external_chromium_org
ppapi/native_client/tools/browser_tester/browsertester/rpclistener.py
170
2297
#!/usr/bin/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. import sys import time class RPCListener(object): def __init__(self, shutdown_callback): self.shutdown_callback = shutdown_ca...
bsd-3-clause
altsen/diandiyun-platform
common/test/acceptance/fixtures/discussion.py
8
2178
""" Tools for creating discussion content fixture data. """ from datetime import datetime import json import factory import requests from . import COMMENTS_STUB_URL class ContentFactory(factory.Factory): FACTORY_FOR = dict id = None user_id = "dummy-user-id" username = "dummy-username" course_i...
agpl-3.0
Novasoft-India/OperERP-AM-Motors
openerp/addons/point_of_sale/wizard/pos_box.py
49
2231
from openerp.osv import osv, fields from openerp.tools.translate import _ from openerp.addons.account.wizard.pos_box import CashBox class PosBox(CashBox): _register = False def run(self, cr, uid, ids, context=None): if not context: context = dict() active_model = context.get('ac...
agpl-3.0
knowsis/django
django/utils/timezone.py
90
9180
""" Timezone-related classes and functions. This module uses pytz when it's available and fallbacks when it isn't. """ from datetime import datetime, timedelta, tzinfo from threading import local import sys import time as _time try: import pytz except ImportError: pytz = None from django.conf import setting...
bsd-3-clause
Mzero2010/MaxZone
plugin.video.Mzero/servers/vodbeast.py
4
1968
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para vodbeast # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import re from core import logger from core import scraper...
gpl-3.0