repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
myhdl/myhdl
myhdl/test/conversion/toVHDL/test_keywords.py
4
4751
import myhdl from myhdl import * from myhdl import ToVHDLWarning import pytest import tempfile import shutil import sys import string import importlib import os from keyword import kwlist as python_kwlist import warnings _vhdl_keywords = ["abs", "access", "after", "alias", "all", "and", "architectu...
lgpl-2.1
apparena/docs
readthedocs/projects/views/private.py
1
22444
import logging import shutil import json from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib import messages from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotAllowed, Http404 fro...
mit
tigerneil/libcluster
python/testapi.py
2
4409
#! /usr/bin/env python # libcluster -- A collection of hierarchical Bayesian clustering algorithms. # Copyright (C) 2013 Daniel M. Steinberg (daniel.m.steinberg@gmail.com) # # This file is part of libcluster. # # libcluster is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser ...
gpl-3.0
eykd/owyl
src/owyl/core.py
1
13782
# -*- coding: utf-8 -*- """core -- core behaviors for Owyl. Copyright 2008 David Eyk. All rights reserved. $Author$\n $Rev$\n $Date$ """ __author__ = "$Author$"[9:-2] __revision__ = "$Rev$"[6:-2] __date__ = "$Date$"[7:-2] import logging try: from mx.Stack import Stack, EmptyError except ImportError: from s...
bsd-3-clause
kuhli/flask
flask/__init__.py
142
1676
# -*- coding: utf-8 -*- """ flask ~~~~~ A microframework based on Werkzeug. It's extensively documented and follows best practice patterns. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ __version__ = '0.11.dev0' # utilities we import from Werkzeug ...
bsd-3-clause
lipro-yocto/git-repo
tests/test_git_trace2_event_log.py
1
7135
# Copyright (C) 2020 The Android Open Source Project # # 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
zqhuang/COOP
lib/submit.py
1
2610
#!/usr/bin/env python ### submit cosmomc jobs #### by Zhiqi Huang (zqhuang@cita.utoronto.ca) import re import os import sys import glob import string def search_value(fname, pattern): fp = open(fname, 'r') file_content = fp.read() fp.close() m = re.search(pattern, file_content, flags = re.M + re.I) ...
gpl-3.0
Java1Guy/ansible-modules-extras
cloud/cloudstack/cs_portforward.py
11
13884
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
dpniel/snapcraft
snapcraft/tests/plugins/test_nodejs.py
4
11845
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
Johnetordoff/osf.io
scripts/clear_sessions.py
12
1349
import sys import time import logging import datetime from django.db import transaction from django.utils import timezone from framework.celery_tasks import app as celery_app from website.app import setup_django setup_django() from osf.models import Session from scripts.utils import add_file_logger logger = logging...
apache-2.0
pwong-mapr/private-hue
desktop/core/ext-py/Django-1.4.5/tests/regressiontests/localflavor/cl/tests.py
33
2239
from django.contrib.localflavor.cl.forms import CLRutField, CLRegionSelect from django.test import SimpleTestCase class CLLocalFlavorTests(SimpleTestCase): def test_CLRegionSelect(self): f = CLRegionSelect() out = u'''<select name="foo"> <option value="RM">Regi\xf3n Metropolitana de Santiago</opt...
apache-2.0
arnaud-morvan/QGIS
python/plugins/processing/algs/grass7/ext/r_li_cwed_ascii.py
12
1536
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_cwed_ascii.py ------------------ Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr **********************...
gpl-2.0
ariandi/ktmavia
backend/web/ionicons-2.0.1/builder/scripts/generate_font.py
348
5381
# Font generation script from FontCustom # https://github.com/FontCustom/fontcustom/ # http://fontcustom.com/ import fontforge import os import md5 import subprocess import tempfile import json import copy SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__)) INPUT_SVG_DIR = os.path.join(SCRIPT_PATH, '..', '..', '...
bsd-3-clause
srowe/xen-api
ocaml/idl/binding_sanity_checks/sharedstorage.py
34
1972
#!/usr/bin/env python import datetime import XenAPI import sanitychecklib #parameters for the shared storage to be created storage_type='nfs' device_config={'server':sanitychecklib.network_storage_server, 'serverpath':sanitychecklib.network_storage_path } physical_size = '100000' name_label = 'created by sharedstor...
lgpl-2.1
datalyze-solutions/pandas-qt
pandasqt/views/EditDialogs.py
4
8445
import re from pandasqt.compat import QtCore, QtGui, Qt, Slot, Signal from pandasqt.models.SupportedDtypes import SupportedDtypes import numpy from pandas import Timestamp from pandas.tslib import NaTType class DefaultValueValidator(QtGui.QValidator): def __init__(self, parent=None): super(DefaultValueV...
mit
chiragjogi/odoo
addons/stock_account/__init__.py
384
1060
# -*- 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
felipsmartins/namebench
tools/check_dns_servers.py
174
3835
#!/usr/bin/env python # Copyright 2009 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...
apache-2.0
alpinelinux/linux-stable-grsec
tools/perf/scripts/python/syscall-counts-by-pid.py
1996
2105
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
darjus-amzn/ryu
ryu/ofproto/oxs_fields.py
26
5855
# Copyright (C) 2015 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
skirsdeda/django
django/contrib/auth/tests/test_forms.py
15
21532
from __future__ import unicode_literals import os import re from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm, PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm, ReadOnlyPasswordHashField, ReadO...
bsd-3-clause
SnappleCap/oh-mainline
vendor/packages/whoosh/src/whoosh/qparser/common.py
16
2233
# Copyright 2010 Matt Chaput. 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 copyright notice, # this list of conditions and the...
agpl-3.0
gardner/youtube-dl
youtube_dl/extractor/vier.py
69
4342
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class VierIE(InfoExtractor): IE_NAME = 'vier' _VALID_URL = r'https?://(?:www\.)?vier\.be/(?:[^/]+/videos/(?P<display_id>[^/]+)(?:/(?P<id>\d+))?|video/v3/embed/(?P<embed_id>\d+))' _TESTS = [{ 'url'...
unlicense
hkernbach/arangodb
3rdParty/boost/1.62.0/tools/litre/litre.py
67
1906
from docutils import writers from docutils import nodes class LitreTranslator(nodes.GenericNodeVisitor): def __init__(self, document, config): nodes.GenericNodeVisitor.__init__(self,document) self._config = config def default_visit(self, node): pass # print '**visiting...
apache-2.0
theakholic/ThinkStats2
code/timeseries.py
66
18035
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import pandas import numpy as np import statsmodels.formula.api as smf import st...
gpl-3.0
nowopen/scrapy
tests/test_http_response.py
95
19527
import unittest import six from w3lib.encoding import resolve_encoding from scrapy.http import (Request, Response, TextResponse, HtmlResponse, XmlResponse, Headers) from scrapy.selector import Selector from scrapy.utils.python import to_native_str class BaseResponseTest(unittest.TestCase): ...
bsd-3-clause
commtrack/commtrack-core
apps/maps/views.py
1
2488
import datetime #import simplejson as json from django.utils import simplejson as json from django.db.models.query_utils import Q from django.shortcuts import get_object_or_404 from django.template.loader import render_to_string from django.contrib.auth.models import User from django.http import HttpResponse from dja...
bsd-3-clause
emgreen33/easy_bake
pin_lights.py
1
1041
# import RPi.GPIO as gpio # import time # #use board numbering on the pi # gpio.setmode(gpio.BOARD) # # output_pins = [40, 38] # output_pins = 16 # gpio.setup(output_pins, gpio.OUT) # #true and 1 are the same # # gpio.output(40, True) # # gpio.output(38, 1) # while True: # gpio.output(output_pins, (True, False))...
mit
dparshin/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/watchlist/amountchangedpattern.py
134
3279
# Copyright (C) 2011 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 of conditions and the ...
bsd-3-clause
TalShafir/ansible
lib/ansible/modules/network/cnos/cnos_image.py
14
8925
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type # # Copyright (C) 2017 Lenovo, 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 Licens...
gpl-3.0
AMOboxTV/AMOBox.LegoBuild
script.module.youtube.dl/lib/youtube_dl/extractor/camdemy.py
124
5425
# coding: utf-8 from __future__ import unicode_literals import datetime import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urlparse, ) from ..utils import ( parse_iso8601, str_to_int, ) class CamdemyIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?ca...
gpl-2.0
rtucker-mozilla/mozpackager
vendor-local/lib/python/jinja2/debug.py
112
11028
# -*- coding: utf-8 -*- """ jinja2.debug ~~~~~~~~~~~~ Implements the debug interface for Jinja. This module does some pretty ugly stuff with the Python traceback system in order to achieve tracebacks with correct line numbers, locals and contents. :copyright: (c) 2010 by the Jinja Team. :...
bsd-3-clause
IndonesiaX/edx-platform
common/lib/xmodule/xmodule/modulestore/tests/test_split_w_old_mongo.py
46
6683
import datetime import random import unittest import uuid from nose.plugins.attrib import attr import mock from opaque_keys.edx.locator import CourseLocator, BlockUsageLocator from xmodule.modulestore import ModuleStoreEnum from xmodule.x_module import XModuleMixin from xmodule.modulestore.inheritance import Inherita...
agpl-3.0
napkindrawing/ansible
lib/ansible/modules/system/openwrt_init.py
58
6912
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Andrew Gaffney <andrew@agaffney.org> # # 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 L...
gpl-3.0
lulandco/SickRage
lib/mako/_ast_util.py
39
25690
# mako/_ast_util.py # Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ ast ~~~ The `ast` module helps Python applications to process trees of the Pyth...
gpl-3.0
way2heavy/youtube-dl-1
youtube_dl/extractor/jpopsukitv.py
170
2584
# coding=utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, ) class JpopsukiIE(InfoExtractor): IE_NAME = 'jpopsuki.tv' _VALID_URL = r'https?://(?:www\.)?jpopsuki\.tv/(?:category/)?video/[^/]+/(?P<id>\S+)' _TEST = { ...
unlicense
ashang/calibre
src/calibre/utils/opensearch/__init__.py
24
1335
''' Based on the OpenSearch Python module by Ed Summers <ehs@pobox.com> from https://github.com/edsu/opensearch . This module is heavily modified and does not implement all the features from the original. The ability for the the module to perform a search and retrieve search results has been removed. The original mod...
gpl-3.0
asreimer/davitpy_asr
gme/ind/dst.py
3
10491
# Copyright (C) 2012 VT SuperDARN Lab # Full license can be found in LICENSE.txt # # 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 la...
gpl-3.0
primiano/depot_tools
third_party/boto/s3/key.py
51
73164
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Nexenta Systems Inc. # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the...
bsd-3-clause
madphysicist/numpy
numpy/matrixlib/tests/test_matrix_linalg.py
17
2059
""" Test functions for linalg module using the matrix class.""" import numpy as np from numpy.linalg.tests.test_linalg import ( LinalgCase, apply_tag, TestQR as _TestQR, LinalgTestCase, _TestNorm2D, _TestNormDoubleBase, _TestNormSingleBase, _TestNormInt64Base, SolveCases, InvCases, EigvalsCases, EigCases, ...
bsd-3-clause
houzhenggang/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_signal.py
39
18682
import unittest from test import test_support from contextlib import closing import gc import pickle import select import signal import subprocess import traceback import sys, os, time, errno if sys.platform in ('os2', 'riscos'): raise unittest.SkipTest("Can't test signal on %s" % sys.platform) class HandlerBCal...
gpl-2.0
asgard-lab/neutron
neutron/api/versions.py
23
1958
# Copyright 2011 Citrix Systems. # 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 ...
apache-2.0
ArnossArnossi/django
django/contrib/staticfiles/views.py
581
1329
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import os import posixpath from django.conf import settings from django.contrib.staticfiles import finders from django.http import Http404 from django.utils.six.moves.url...
bsd-3-clause
educloudalliance/eca-auth-connector
selector/migrations/0001_initial.py
1
3810
# -*- encoding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2015 Haltu Oy, http://haltu.fi # # 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 ...
mit
hatchery/Genepool2
genes/ubuntu/traits.py
2
1762
#!/usr/bin/env python from functools import wraps from typing import Callable, Dict, List, Optional, Tuple, TypeVar from genes.debian.traits import is_debian from genes.lib.logging import log_error, log_warn from genes.lib.traits import ErrorLevel T = TypeVar('T') def is_ubuntu(versions: Optional[List[str]] = None)...
mit
dschopf/potfit
util/kim/kim_compare_lammps/potfit.py
3
4937
################################################################ # # kim_compare_lammps # ################################################################ # # Copyright 2018 the potfit development team # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated doc...
gpl-2.0
FlintHill/SUAS-Competition
env/lib/python3.7/site-packages/pip/_vendor/chardet/__init__.py
270
1559
######################## BEGIN LICENSE BLOCK ######################## # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later ve...
mit
antoviaque/edx-platform
common/djangoapps/dark_lang/migrations/0001_initial.py
86
1203
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operati...
agpl-3.0
beezee/GAE-Django-site
djangotoolbox/db/base.py
46
3591
import datetime from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations, \ BaseDatabaseWrapper, BaseDatabaseClient, BaseDatabaseValidation, \ BaseDatabaseIntrospection from .creation import NonrelDatabaseCreation class NonrelDatabaseFeatures(BaseDatabaseFeatures): can_return_id_from_in...
bsd-3-clause
nikste/tensorflow
tensorflow/tensorboard/scripts/generate_testdata.py
39
7626
# 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
Chemcy/vnpy
vn.api/vn.ksotp/vnksotptd/test/tdtest.py
21
4659
# encoding: UTF-8 import sys from time import sleep from PyQt4 import QtGui from vnksotptd import * #---------------------------------------------------------------------- def print_dict(d): """按照键值打印一个字典""" for key,value in d.items(): print key + ':' + str(value) #----------------...
mit
abhinavp13/IITBX-edx-platform-dev
common/lib/xmodule/xmodule/x_module.py
2
31496
import logging import copy import yaml import os from lxml import etree from collections import namedtuple from pkg_resources import resource_listdir, resource_string, resource_isdir from xmodule.modulestore import Location from xmodule.modulestore.exceptions import ItemNotFoundError from xblock.core import XBlock, ...
agpl-3.0
akosyakov/intellij-community
plugins/hg4idea/testData/bin/mercurial/osutil.py
90
5363
# osutil.py - pure Python version of osutil.c # # Copyright 2009 Matt Mackall <mpm@selenic.com> and others # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import os import stat as statmod def _mode_to_kind(mode): if statmod....
apache-2.0
nathanielvarona/airflow
tests/always/test_example_dags.py
3
2575
# 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
teamfx/openjfx-9-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/tool/commands/perfalizer.py
1
8619
# Copyright (c) 2012 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 of conditions and the ...
gpl-2.0
le9i0nx/ansible
lib/ansible/utils/module_docs_fragments/k8s_name_options.py
80
2450
# # Copyright 2018 Red Hat | Ansible # # 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
akhileshpillai/treeherder
tests/webapp/api/test_resultset_api.py
2
12700
import copy from django.core.urlresolvers import reverse from rest_framework.test import APIClient from tests import test_utils from treeherder.client import TreeherderResultSetCollection from treeherder.model.models import (FailureClassification, Job, ...
mpl-2.0
mescobal/geined
consolidado.py
1
3865
#!/usr/bin/env python #! -*- coding: utf-8 -*- """Listado y creación del consolidado anual""" import cgi import cgitb; cgitb.enable() import funciones import datos import pagina import htm import csv import StringIO def listado(): """Listado de consolidado""" pag = pagina.Pagina("Consolidado anual", 4) prin...
gpl-3.0
hvnsweeting/Diamond
src/collectors/nagios/test/testnagios.py
35
2557
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from nagios import N...
mit
ridiks10/levelcoin
contrib/testgen/gen_base58_test_vectors.py
1064
4344
#!/usr/bin/env python ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json ''' # 2012 Wladimir J. van der Laan # R...
mit
NewpTone/stacklab-nova
debian/tmp/usr/lib/python2.7/dist-packages/nova/api/openstack/__init__.py
6
6628
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
hyperized/ansible
lib/ansible/module_utils/facts/network/openbsd.py
232
1600
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
yujikato/DIRAC
src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryTreeBase.py
2
41293
""" DIRAC DirectoryTree base class """ from __future__ import absolute_import from __future__ import division from __future__ import print_function __RCSID__ = "$Id$" import six import time import threading import os import stat from DIRAC import S_OK, S_ERROR, gLogger from DIRAC.DataManagementSystem.DB.FileCatalogC...
gpl-3.0
Dev-Cloud-Platform/Dev-Cloud
dev_cloud/cc1/src/wi/tests/main_test.py
2
5683
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
apache-2.0
yanlend/scikit-learn
examples/datasets/plot_iris_dataset.py
283
1928
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= The Iris Dataset ========================================================= This data sets consists of 3 different types of irises' (Setosa, Versicolour, and Virginica) petal and sepal length, stored in a 150x4 numpy...
bsd-3-clause
jetty-project/FrameworkBenchmarks
toolset/benchmark/test_types/plaintext_type.py
8
2358
from toolset.benchmark.test_types.framework_test_type import FrameworkTestType from toolset.benchmark.test_types.verifications import basic_body_verification, verify_headers from time import sleep class PlaintextTestType(FrameworkTestType): def __init__(self, config): self.plaintext_url = "" kwarg...
bsd-3-clause
girving/tensorflow
tensorflow/python/ops/cond_v2.py
1
19004
# 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
onelogin/python-saml
src/onelogin/saml2/metadata.py
1
12340
# -*- coding: utf-8 -*- """ OneLogin_Saml2_Metadata class Copyright (c) 2010-2021 OneLogin, Inc. MIT License Metadata class of OneLogin's Python Toolkit. """ from time import gmtime, strftime, time from datetime import datetime from defusedxml.minidom import parseString from onelogin.saml2.constants import OneLog...
mit
czhengsci/pymatgen
pymatgen/io/lammps/tests/test_output.py
2
5248
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, print_function, unicode_literals, \ absolute_import import os import unittest import numpy as np from pymatgen.io.lammps.output import LammpsRun, LammpsLog, LammpsDump _...
mit
albertomurillo/ansible
lib/ansible/modules/cloud/azure/azure_rm_webappslot.py
9
40667
#!/usr/bin/python # # Copyright (c) 2018 Yunge Zhu, <yungez@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_version': '1.1', ...
gpl-3.0
open-synergy/stock-logistics-warehouse
stock_available/models/product_template.py
2
1628
# -*- coding: utf-8 -*- # © 2014 Numérigraphe SARL # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api from openerp.addons import decimal_precision as dp class ProductTemplate(models.Model): _inherit = 'product.template' @api.multi @api.depends('p...
agpl-3.0
OTWillems/GEO1005
SpatialDecision/external/networkx/algorithms/isomorphism/isomorphvf2.py
76
36794
# -*- coding: utf-8 -*- """ ************* VF2 Algorithm ************* An implementation of VF2 algorithm for graph ismorphism testing. The simplest interface to use this module is to call networkx.is_isomorphic(). Introduction ------------ The GraphMatcher and DiGraphMatcher are responsible for matching graphs or d...
gpl-2.0
westinedu/similarinterest
django/utils/http.py
12
7434
import calendar import datetime import re import sys import urllib import urlparse from email.utils import formatdate from django.utils.datastructures import MultiValueDict from django.utils.encoding import smart_str, force_unicode from django.utils.functional import allow_lazy ETAG_MATCH = re.compile(r'(?:W/)?"((?:\...
bsd-3-clause
googyanas/Googy-Max4-CM-Kernel
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
dlacombejr/deepy
deepy/utils/initializers.py
2
4016
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np def get_fans(shape): fan_in = shape[0] if len(shape) == 2 else np.prod(shape[1:]) fan_out = shape[1] if len(shape) == 2 else shape[0] return fan_in, fan_out class WeightInitializer(object): """ Initializer for creating weights. ...
mit
michitomo/ansible-modules-core
packaging/os/redhat_subscription.py
29
16866
#!/usr/bin/python DOCUMENTATION = ''' --- module: redhat_subscription short_description: Manage Red Hat Network registration and subscriptions using the C(subscription-manager) command description: - Manage registration and subscription to the Red Hat Network entitlement platform. version_added: "1.2" author: "Jam...
gpl-3.0
brianlsharp/MissionPlanner
Lib/site-packages/numpy/linalg/tests/test_build.py
81
1631
from subprocess import call, PIPE, Popen import sys import re import numpy as np from numpy.linalg import lapack_lite from numpy.testing import TestCase, dec from numpy.compat import asbytes_nested class FindDependenciesLdd: def __init__(self): self.cmd = ['ldd'] try: st = call(self....
gpl-3.0
sittingbull/artefact.connectors
artefact/connectors/adwords/api/report_field.py
2
1472
class ReportField(object): REPORT_FIELD_TYPES_KNOWN = ['double', 'string', 'date', 'datetime', 'boolean'] REPORT_FIELD_TYPES_FALLBACK = 'string' REPORT_FIELD_TYPE_MAP = { 'money': 'double', 'integer': 'int', 'bid': 'double', 'long': 'int' } def __init__(self, defini...
apache-2.0
2014c2g4/2015cda0623
static/Brython3.1.0-20150301-090019/Lib/multiprocessing/__init__.py
693
6866
# # Package analogous to 'threading.py' but using processes # # multiprocessing/__init__.py # # This package is intended to duplicate the functionality (and much of # the API) of threading.py but uses processes instead of threads. A # subpackage 'multiprocessing.dummy' has the same API but is a simple # wrapper for 't...
gpl-3.0
naltatis/kryptonite
node_modules/grunt-contrib-uglify/node_modules/gzip-js/test/zipTest.py
182
1836
import os from helpers import run_cmd from colorama import Fore defaultTestDir = 'test-files' defaultOutDir = 'test-outs' """ Run a single test @param tFile- required; the full path to the file to run @param level- optional (default: all); the compression level [1-9] @return True if all tests passed; False if at lea...
mit
ABaldwinHunter/django-clone
tests/forms_tests/tests/test_forms.py
17
154413
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import datetime import json import uuid from django.core.exceptions import NON_FIELD_ERRORS from django.core.files.uploadedfile import SimpleUploadedFile from django.core.validators import RegexValidator from django.forms import ( Boolean...
bsd-3-clause
google/googleapps-message-recall
message_recall/lib/oauth2client/django_orm.py
261
3833
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
yfdyh000/olympia
apps/amo/cron.py
14
8565
import itertools from datetime import datetime, timedelta from subprocess import Popen, PIPE from django.conf import settings from django.utils import translation from django.db import connection, transaction import cronjobs import commonware.log import amo from amo.utils import chunked from amo.helpers import user_...
bsd-3-clause
wavefrontHQ/python-client
wavefront_api_client/models/module_layer.py
1
2765
# coding: utf-8 """ Wavefront REST API <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ...
apache-2.0
tsabi/Odoo-tsabi-fixes
addons/l10n_bo/__openerp__.py
114
1779
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
alexgorban/models
research/vid2depth/model.py
5
16378
# 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 applicab...
apache-2.0
lastweek/gem5
src/arch/x86/isa/insts/simd64/integer/arithmetic/addition.py
91
4737
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
simon-pepin/scikit-learn
sklearn/semi_supervised/label_propagation.py
128
15312
# coding=utf8 """ Label propagation in the context of this module refers to a set of semisupervised classification algorithms. In the high level, these algorithms work by forming a fully-connected graph between all points given and solving for the steady-state distribution of labels at each point. These algorithms per...
bsd-3-clause
JuliaSprenger/python-neo
neo/test/iotest/test_brainwaresrcio.py
3
13068
""" Tests of neo.io.brainwaresrcio """ import logging import os.path import unittest import numpy as np import quantities as pq from neo.core import (Block, Event, Group, Segment, SpikeTrain) from neo.io import BrainwareSrcIO, brainwaresrcio from neo.test.iotest.common_io_test import BaseTestI...
bsd-3-clause
dennis-sheil/commandergenius
project/jni/python/src/Lib/test/test_heapq.py
56
13195
"""Unittests for heapq.""" import random import unittest from test import test_support import sys # We do a bit of trickery here to be able to test both the C implementation # and the Python implementation of the module. # Make it impossible to import the C implementation anymore. sys.modules['_heapq'] = 0 # We must...
lgpl-2.1
chromium/chromium
third_party/blink/web_tests/http/tests/websocket/expect-unfragmented_wsh.py
7
1154
# Read 32 messages and verify that they are not fragmented. # This can be removed if the "reassemble small messages" feature is removed. See # https://crbug.com/1086273. from mod_pywebsocket import common from mod_pywebsocket import msgutil NUMBER_OF_MESSAGES = 32 def web_socket_do_extra_handshake(request): # D...
bsd-3-clause
smartfile/django-1.4
django/conf/project_template/project_name/settings.py
41
5380
# Django settings for {{ project_name }} project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '',...
bsd-3-clause
soaplib/soaplib
examples/multiple_services.py
1
1055
from classserializer import UserManager, User from soaplib.core import Application from soaplib.core.model.clazz import ClassModel from soaplib.core.model.primitive import Integer, String from soaplib.core.service import soap, DefinitionBase from soaplib.core.server import wsgi computer_database = {} computerid_seq ...
lgpl-2.1
alanljj/oca-partner-contact
account_partner_merge/partner_merge.py
37
1703
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
antonve/s4-project-mooc
lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py
114
6426
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CourseAuthorization' db.create_table('bulk_email_courseauthorization', ( ('id', ...
agpl-3.0
robclark/xbmc
lib/libUPnP/Neptune/Extras/Tools/Logging/NeptuneLogConsole.py
22
2839
#!/usr/bin/env python from socket import * from optparse import OptionParser UDP_ADDR = "0.0.0.0" UDP_PORT = 7724 BUFFER_SIZE = 65536 #HEADER_KEYS = ['Logger', 'Level', 'Source-File', 'Source-Function', 'Source-Line', 'TimeStamp'] HEADER_KEYS = { 'mini': ('Level'), 'standard': ('Logger', 'Level', 'Source-Func...
gpl-2.0
kartikp1995/gnuradio
gr-analog/python/analog/qa_pll_freqdet.py
40
6611
#!/usr/bin/env python # # Copyright 2004,2007,2010-2013 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 ...
gpl-3.0
etos/django
docs/conf.py
16
12406
# Django documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't picklable (module imports are okay...
bsd-3-clause
babycaseny/audacity
lib-src/lv2/sord/waflib/Tools/gfortran.py
276
1966
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import re from waflib import Utils from waflib.Tools import fc,fc_config,fc_scan,ar from waflib.Configure import conf @conf def find_gfortran(conf): fc=conf.find_program(['gf...
gpl-2.0
2013Commons/hue
desktop/core/ext-py/guppy-0.1.10/guppy/heapy/test/test_ER.py
37
9414
#._cv_part guppy.heapy.test.test_ER # Tests of equivalence relations. # These are also tested by test_Classifiers. # This is some more tests, tailored esp. to the user view. # (test_Classifiers was so slow already, so I start over) # o Intended to be exhaustive wrt all ER's defined # # o Intersection of ER's fro...
apache-2.0
gautam1858/tensorflow
tensorflow/contrib/tpu/python/tpu/tpu_sharding.py
42
9554
# 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