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
l1ll1/cvl-fabric-launcher
pyinstaller-2.1/PyInstaller/hooks/hook-django.py
10
1943
#----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this softwa...
gpl-3.0
numenta/nupic
examples/opf/experiments/classification/scalar_TP_1/description.py
10
1680
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
ZelunZhang/graphite-web
contrib/demo-collector.py
67
6819
#!/usr/bin/env python from commands import getstatusoutput from platform import node from socket import socket, AF_INET, SOCK_STREAM from sys import argv, exit from time import sleep, time DELAY = 60 CARBON_SERVER = 'localhost' CARBON_PORT = 2003 class Carbon: def __init__(self, hostname, port): self.s = ...
apache-2.0
USGSDenverPychron/pychron
pychron/pyscripts/mass_spec_converter.py
1
4112
# =============================================================================== # Copyright 2012 Jake Ross # # 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/licens...
apache-2.0
collinjackson/mojo
sky/engine/build/scripts/make_token_matcher_unittest.py
75
7486
#!/usr/bin/env python # Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
bsd-3-clause
ashetty1/kedge
vendor/github.com/openshift/origin/cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog/vendor/github.com/kubernetes/repo-infra/verify/boilerplate/boilerplate.py
50
6433
#!/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
jimi-c/ansible
lib/ansible/modules/cloud/amazon/iam_server_certificate_facts.py
128
5371
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
jacobwegner/privileges
privileges/models.py
2
1368
import datetime from django.db import models from django.db.models import Q from django.contrib.auth.models import User from privileges.registration import registry class Privilege(models.Model): label = models.CharField(max_length=75, db_index=True) verbose_name = models.CharField(max_length=255) des...
bsd-3-clause
rmaz/buck
third-party/py/pex/pex/base.py
55
1134
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import from collections import Iterable from pkg_resources import Requirement from .compatibility import string as compatibility_string REQUIRED_ATTRIBU...
apache-2.0
ianyh/heroku-buildpack-python-opencv
vendor/.heroku/lib/python2.7/test/test_runpy.py
65
16384
# Test the runpy module import unittest import os import os.path import sys import re import tempfile from test.test_support import verbose, run_unittest, forget from test.script_helper import (temp_dir, make_script, compile_script, make_pkg, make_zip_script, make_zip_pkg) from runpy i...
mit
zCFD/zutil
zutil/post/post.py
1
38113
""" Helper functions for accessing Paraview functionality .. moduleauthor:: Zenotech Ltd """ from tqdm import tqdm from IPython.display import HTML, Javascript, display import uuid import csv from zutil import analysis import time import math from zutil import mag import json from zutil import rotate_vector from para...
mit
IronLanguages/ironpython3
Tests/modules/io_related/test_io_StringIO.py
1
11656
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. ## ## Test the io.StringIO ## based on cStringIO_test.py ## import unittest import io from iptest import run_...
apache-2.0
thjashin/tensorflow
tensorflow/contrib/training/__init__.py
14
3557
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
ircncl/linux-grsec-incremental
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
ahmetabdi/SickRage
lib/unidecode/x064.py
252
4655
data = ( 'Chan ', # 0x00 'Ge ', # 0x01 'Lou ', # 0x02 'Zong ', # 0x03 'Geng ', # 0x04 'Jiao ', # 0x05 'Gou ', # 0x06 'Qin ', # 0x07 'Yong ', # 0x08 'Que ', # 0x09 'Chou ', # 0x0a 'Chi ', # 0x0b 'Zhan ', # 0x0c 'Sun ', # 0x0d 'Sun ', # 0x0e 'Bo ', # 0x0f 'Chu ', # 0x10 ...
gpl-3.0
alajara/servo
tests/wpt/web-platform-tests/old-tests/webdriver/command_contexts/open_and_close_window_test.py
141
2529
import os import sys import random import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test repo_root = os.path.abspath(os.path.join(__file__, "../../..")) sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver")) from webdriver import exceptions class OpenAndCl...
mpl-2.0
adrianholovaty/django
tests/regressiontests/model_formsets_regress/tests.py
8
16759
from __future__ import absolute_import from django import forms from django.forms.formsets import BaseFormSet, DELETION_FIELD_NAME from django.forms.util import ErrorDict, ErrorList from django.forms.models import modelform_factory, inlineformset_factory, modelformset_factory, BaseModelFormSet from django.test import ...
bsd-3-clause
vipul-sharma20/oh-mainline
vendor/packages/django-debug-toolbar/debug_toolbar/panels/signals.py
20
3734
from __future__ import absolute_import, unicode_literals from django.core.signals import ( request_started, request_finished, got_request_exception) from django.db.backends.signals import connection_created from django.db.models.signals import ( class_prepared, pre_init, post_init, pre_save, post_save, pre...
agpl-3.0
jvkops/django
tests/file_uploads/tests.py
127
23425
#! -*- coding: utf-8 -*- from __future__ import unicode_literals import base64 import errno import hashlib import json import os import shutil import tempfile as sys_tempfile import unittest from io import BytesIO from django.core.files import temp as tempfile from django.core.files.uploadedfile import SimpleUploaded...
bsd-3-clause
cyril51/Sick-Beard
sickbeard/clients/requests/packages/charade/langthaimodel.py
206
11475
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Ri...
gpl-3.0
adam111316/SickGear
lib/sqlalchemy/orm/mapper.py
75
108686
# orm/mapper.py # Copyright (C) 2005-2014 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 """Logic to map Python classes to and from selectables. Defines the :class:`~sqlalchemy...
gpl-3.0
Neamar/django
django/forms/forms.py
39
28027
""" Form classes """ from __future__ import unicode_literals import copy import datetime from collections import OrderedDict from django.core.exceptions import NON_FIELD_ERRORS, ValidationError from django.forms.fields import Field, FileField from django.forms.utils import ErrorDict, ErrorList, flatatt from django.f...
bsd-3-clause
BellScurry/gem5-fault-injection
src/arch/x86/isa/insts/simd64/floating_point/arithmetic/reciprocal_estimation.py
91
2172
# 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
slohse/ansible
test/runner/lib/cloud/gcp.py
34
1810
# Copyright: (c) 2018, Google Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """GCP plugin for integration tests.""" from __future__ import absolute_import, print_function import os from lib.util import ( display, ) from lib.cloud import ( CloudProvider, ...
gpl-3.0
gojira/tensorflow
tensorflow/python/debug/cli/cli_shared.py
33
16304
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
navycrow/Sick-Beard
bs4/tests/test_builder_registry.py
485
5374
"""Tests of the builder registry.""" import unittest from bs4 import BeautifulSoup from bs4.builder import ( builder_registry as registry, HTMLParserTreeBuilder, TreeBuilderRegistry, ) try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError: HTML5LIB_PRESENT =...
gpl-3.0
kuwa32/chainer
tests/functions_tests/test_negative_sampling.py
5
2533
import unittest import numpy import chainer from chainer import cuda from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition if cuda.available: cuda.init() class TestNegativeSampling(unittest.TestCase): def setUp(self): ...
mit
hkariti/ansible
lib/ansible/modules/network/nxos/nxos_pim_rp_address.py
11
8203
#!/usr/bin/python # # 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 distribut...
gpl-3.0
cmunk/protwis
tools/management/commands/upload_excel_bias_pathways.py
1
15062
from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.db import connection from django.db import IntegrityError from django.utils.text import slugify from django.http import HttpResponse, JsonResponse from build.management.commands.base_build import Command as B...
apache-2.0
rwarren14/robotframework
src/robot/running/context.py
10
5763
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
zerkrx/zerkbox
lib/youtube_dl/extractor/cinchcast.py
177
1678
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( unified_strdate, xpath_text, ) class CinchcastIE(InfoExtractor): _VALID_URL = r'https?://player\.cinchcast\.com/.*?assetId=(?P<id>[0-9]+)' _TEST = { # Actual test is run in generic,...
gpl-3.0
hiliev/py-zfs-rescue
zfs/blocktree.py
1
4381
# Copyright (c) 2017 Hristo Iliev <github@hiliev.eu> # 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 c...
bsd-3-clause
jbedorf/tensorflow
tensorflow/contrib/distribute/python/estimator_training_test.py
2
23434
# 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
netscaler/horizon
openstack_dashboard/dashboards/router/nexus1000v/panel.py
11
1146
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
apache-2.0
tmikov/jscomp
runtime/deps/gyp/test/builddir/gyptest-all.py
50
2684
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verify the settings that cause a set of programs to be created in a specific build directory, and that no intermediate built files get c...
apache-2.0
danialbehzadi/Nokia-RM-1013-2.0.0.11
webkit/Tools/Scripts/webkitpy/layout_tests/layout_package/result_summary.py
15
3766
#!/usr/bin/env python # Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # *...
gpl-3.0
kurli/blink-crosswalk
Tools/Scripts/webkitpy/common/system/profiler.py
182
9421
# 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 ...
bsd-3-clause
markdryan/media-service-demo
src/msd/msd_browse.py
4
7335
# media-service-demo # # Copyright (C) 2012 Intel Corporation. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU Lesser General Public License, # version 2.1, as published by the Free Software Foundation. # # This program is dist...
lgpl-2.1
Sodki/ansible
lib/ansible/modules/cloud/ovirt/ovirt_vmpools.py
26
7566
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, 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 #...
gpl-3.0
caphrim007/ansible
lib/ansible/module_utils/vmware.py
8
41578
# -*- coding: utf-8 -*- # Copyright: (c) 2015, Joseph Callen <jcallen () csc.com> # Copyright: (c) 2018, 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 import atexit impo...
gpl-3.0
Tony-Zhang03/zookeeper
src/contrib/huebrowser/zkui/src/zkui/utils.py
114
1120
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not ...
apache-2.0
takaaptech/sky_engine
build/android/pylib/base/base_setup.py
33
2562
# Copyright (c) 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. """Base script for doing test setup.""" import logging import os from pylib import constants from pylib import valgrind_tools from pylib.utils import i...
bsd-3-clause
surajssd/kuma
kuma/demos/views.py
17
14031
import random from django.conf import settings from django.http import HttpResponseForbidden from django.shortcuts import get_object_or_404, render, redirect from django.utils.translation import ugettext_lazy as _ from django.views.decorators.clickjacking import xframe_options_sameorigin from django.views.generic impo...
mpl-2.0
chrisfranzen/django
tests/regressiontests/builtin_server/tests.py
7
1936
from __future__ import unicode_literals from io import BytesIO from django.core.servers.basehttp import ServerHandler from django.utils.unittest import TestCase # # Tests for #9659: wsgi.file_wrapper in the builtin server. # We need to mock a couple of of handlers and keep track of what # gets called when using a co...
bsd-3-clause
benfinkelcbt/CPD200
CPD200-Lab07-Python/simplejson/tests/test_namedtuple.py
147
4004
from __future__ import absolute_import import unittest import simplejson as json from simplejson.compat import StringIO try: from collections import namedtuple except ImportError: class Value(tuple): def __new__(cls, *args): return tuple.__new__(cls, args) def _asdict(self): ...
gpl-3.0
v4l3r10/nemesys-qos
nemesys/task.py
9
3700
# task.py # -*- coding: utf8 -*- # Copyright (c) 2010 Fondazione Ugo Bordoni. # # 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 ...
gpl-3.0
bq/bitbloq-offline
app/res/web2board/linux32/res/Scons/sconsFiles/SCons/Errors.py
6
7419
# # Copyright (c) 2001 - 2015 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...
gpl-3.0
tbombach/autorest
src/client/Python/msrestazure/test/unittest_operation.py
5
12623
#-------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
mit
Zopieux/pulseaudio-dlna
pulseaudio_dlna/utils/subprocess.py
6
2828
#!/usr/bin/python # This file is part of pulseaudio-dlna. # pulseaudio-dlna 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. # pulsea...
gpl-3.0
Elettronik/SickRage
lib/requests/packages/chardet/cli/chardetect.py
198
2738
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
gpl-3.0
wearpants/osf.io
scripts/migration/migrate_root_and_parent_on_node.py
32
4213
""" This will add a root and parent_node fields to all nodes. Root will be the primary key of the originating parent node. Parent_node will be the first primary parent Done so that you can filter on both root nodes and parent nodes with a DB query """ import sys import logging from modularodm import Q from website imp...
apache-2.0
flavour/helios
deployment-templates/models/000_config.py
1
28961
# -*- coding: utf-8 -*- """ Deployment settings All settings which are typically edited for a deployment should be done here Deployers shouldn't typically need to edit any other files. NOTE FOR DEVELOPERS: /models/000_config.py is NOT in the BZR repository, as this file will be changed during d...
mit
ychen820/microblog
y/google-cloud-sdk/lib/httplib2/iri2uri.py
706
3828
""" iri2uri Converts an IRI to a URI. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio" __contributors__ = [] __version__ = "1.0.0" __license__ = "MIT" __history__ = """ """ import urlparse # Convert an IRI to a URI following the rules in RFC 3987 # # The character...
bsd-3-clause
sbaechler/thumbor-universalimages
tests/test_step1.py
1
11441
# coding: utf-8 from __future__ import unicode_literals, absolute_import import numpy as np from .base import FilterTestCase from universalimages.filters.xmp.v01 import Xmp_API from os.path import abspath, join, dirname STORAGE_PATH = abspath(join(dirname(__file__), 'fixtures')) filter_data = { 'async': False,...
mit
ivanhorvath/openshift-tools
openshift/installer/vendored/openshift-ansible-3.6.173.0.59/roles/openshift_logging/library/openshift_logging_facts.py
3
14332
''' --- module: openshift_logging_facts version_added: "" short_description: Gather facts about the OpenShift logging stack description: - Determine the current facts about the OpenShift logging stack (e.g. cluster size) options: author: Red Hat, Inc ''' import copy import json # pylint: disable=redefined-builtin, ...
apache-2.0
HarmonyEnterpriseSolutions/harmony-platform
src/gnue/common/rpc/drivers/Base.py
2
12297
# GNU Enterprise Common Library - RPC interface - Base for all drivers # # Copyright 2001-2007 Free Software Foundation # # This file is part of GNU Enterprise. # # GNU Enterprise 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 So...
gpl-2.0
mkl-/scioncc
src/pyon/container/test/test_apps.py
4
1144
#!/usr/bin/env python __author__ = 'Michael Meisinger' from unittest import SkipTest from pyon.container.apps import AppManager from pyon.core.path import resolve from pyon.ion.service import BaseService from pyon.util.int_test import IonIntegrationTestCase from nose.plugins.attrib import attr class FakeContainer(o...
bsd-2-clause
jerli/sympy
examples/advanced/dense_coding_example.py
113
1612
#!/usr/bin/env python """Demonstration of quantum dense coding.""" from sympy import sqrt, pprint from sympy.physics.quantum import qapply from sympy.physics.quantum.gate import H, X, Z, CNOT from sympy.physics.quantum.qubit import Qubit from sympy.physics.quantum.circuitplot import circuit_plot from sympy.physics.qu...
bsd-3-clause
raymondnijssen/QGIS
scripts/qgis_fixes/fix_qfiledialog.py
69
1597
# -*- coding: utf-8 -*- """ Migrate QFileDialog methods from PyQt4 to PyQt5 """ # Author: Médéric Ribreux <mederic.ribreux@medspx.fr> # Adapted from fix_pyqt # and http://python3porting.com/fixers.html # Local imports from lib2to3.fixer_base import BaseFix class FixQfiledialog(BaseFix): PATTERN = """ power<...
gpl-2.0
MoonshineSG/OctoPrint
src/octoprint/cli/plugins.py
2
3050
# coding=utf-8 from __future__ import absolute_import, division, print_function __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License" import click import logging from octoprint.c...
agpl-3.0
robbwagoner/airflow
airflow/operators/bash_operator.py
9
2533
import logging from subprocess import Popen, STDOUT, PIPE from tempfile import gettempdir, NamedTemporaryFile from airflow.utils import AirflowException from airflow.models import BaseOperator from airflow.utils import apply_defaults, TemporaryDirectory class BashOperator(BaseOperator): """ Execute a Bash sc...
apache-2.0
kmaglione/olympia
apps/amo/tests/test_log.py
15
1057
"""Tests for the activitylog.""" import json from datetime import datetime from nose.tools import eq_ import amo import amo.tests from addons.models import Addon from users.models import UserProfile class LogTest(amo.tests.TestCase): def setUp(self): super(LogTest, self).setUp() u = UserProfile....
bsd-3-clause
DinoTools/dionaea
modules/python/dionaea/util.py
1
3404
# This file is part of the dionaea honeypot # # SPDX-FileCopyrightText: 2010 Mark Schloesser # SPDX-FileCopyrightText: 2009 Paul Baecher & Markus Koetter # # SPDX-License-Identifier: GPL-2.0-or-later import hashlib import logging import re logger = logging.getLogger("util") logger.setLevel(logging.DEBUG) def md5...
gpl-2.0
plok74122/bootstrap
test-infra/s3_cache.py
2166
5734
#!/usr/bin/env python2.7 # pylint: disable=C0301 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, chdir, remove as _delete_file from os.path import dirname, basename, abspath, realpath, expandvars from hashlib import sha256 from subpr...
mit
bunnyitvn/webptn
build/lib.linux-i686-2.7/django/contrib/localflavor/ch/forms.py
101
3963
""" Swiss-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.ch.ch_states import STATE_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select f...
bsd-3-clause
bparzella/secsgem
secsgem/secs/variables/base_text.py
1
6311
##################################################################### # base_text.py # # (c) Copyright 2021, Benjamin Parzella. All rights reserved. # # 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 ...
lgpl-2.1
gangadhar-kadam/smrterp
erpnext/stock/report/item_prices/item_prices.py
13
4027
# 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.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_columns(filters) item_map = get...
agpl-3.0
8l/beri
cheritest/trunk/tests/cp2/test_cp2_cunseal_ephemeral.py
2
1538
#- # Copyright (c) 2012 Michael Roe # All rights reserved. # # This software was developed by SRI International and the University of # Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 # ("CTSRD"), as part of the DARPA CRASH research programme. # # @BERI_LICENSE_HEADER_START@ # # Licensed to BER...
apache-2.0
craigslist/python-clcommon
test/test_log.py
1
1310
# Copyright 2013 craigslist # # 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, s...
apache-2.0
CSC301H-Fall2013/JuakStore
site-packages/tests/regressiontests/comment_tests/tests/feed_tests.py
47
1915
from __future__ import absolute_import from xml.etree import ElementTree as ET from django.conf import settings from django.contrib.comments.models import Comment from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from . import CommentTestCase from ..models import...
mit
zhangqifan/findSomething
FindSomething/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/ios/gyptest-archs.py
136
1786
#!/usr/bin/env python # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that device and simulator bundles are built correctly. """ import TestGyp import TestMac import collections import sys if s...
mit
yongni/grpc
tools/run_tests/run_build_statistics.py
10
10106
#!/usr/bin/env python # Copyright 2016 gRPC 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 applicable law o...
apache-2.0
mcltn/ansible-modules-extras
system/filesystem.py
35
8817
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Alexander Bulimov <lazywolf0@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 t...
gpl-3.0
jesanabriah/ejercicios
proyecto-final/entropia.py
2
3149
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt import math # Descomentar para especificar semilla #np.random.seed(19680801) # Valor de entropia maxima teorica S_MAX = 4 #Numero de iteraciones N = 9000 # Cantidad de caminantes NCAM = 400 # Tamaño del paso PAS = 1 # Numero de celdas, por...
gpl-3.0
dotsonlab/awsc
ProtoTestPython/stepper_test.py
1
1616
#!/usr/bin/python import Adafruit_BBIO.GPIO as GPIO import time GPIO.setup("P8_9", GPIO.OUT) #step pin GPIO.setup("P8_7", GPIO.OUT) #direction pin GPIO.setup("P8_11", GPIO.OUT) #ENABLE ##Define a function named Blink() def Blink(numTimes,speed): GPIO.output("P8_11", GPIO.LOW) for i in range(0,numTimes):## Run l...
mit
willharris/django
django/contrib/auth/handlers/modwsgi.py
537
1344
from django import db from django.contrib import auth from django.utils.encoding import force_bytes def check_password(environ, username, password): """ Authenticates against Django's auth database mod_wsgi docs specify None, True, False as return value depending on whether the user exists and authen...
bsd-3-clause
bryceliu/ansible
lib/ansible/template/template.py
267
1397
# (c) 2012, 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) any lat...
gpl-3.0
hectord/lettuce
tests/integration/lib/Django-1.3/django/contrib/auth/management/commands/createsuperuser.py
154
5814
""" Management utility to create superusers. """ import getpass import re import sys from optparse import make_option from django.contrib.auth.models import User from django.core import exceptions from django.core.management.base import BaseCommand, CommandError from django.utils.translation import ugettext as _ RE_V...
gpl-3.0
sdeepanshu02/microblog
flask/Lib/site-packages/werkzeug/useragents.py
257
5418
# -*- coding: utf-8 -*- """ werkzeug.useragents ~~~~~~~~~~~~~~~~~~~ This module provides a helper to inspect user agent strings. This module is far from complete but should work for most of the currently available browsers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more deta...
bsd-3-clause
tensorflow/tfx
tfx/orchestration/launcher/in_process_component_launcher.py
1
3334
# Lint as: python2, python3 # Copyright 2019 Google LLC. 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 req...
apache-2.0
ksachs/invenio
modules/bibmatch/lib/bibmatch_engine.py
5
64407
## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio 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...
gpl-2.0
benjaminjkraft/django
tests/schema/models.py
237
4275
from django.apps.registry import Apps from django.db import models from django.utils.encoding import python_2_unicode_compatible # Because we want to test creation and deletion of these as separate things, # these models are all inserted into a separate Apps so the main test # runner doesn't migrate them. new_apps = ...
bsd-3-clause
andersk/zulip
tools/tests/test_capitalization_checker.py
6
6376
from unittest import TestCase from bs4 import BeautifulSoup from tools.lib.capitalization import check_capitalization, get_safe_text, is_capitalized class GetSafeTextTestCase(TestCase): def test_get_safe_text(self) -> None: string = "Messages in __page_params.product_name__ go to a stream and have a top...
apache-2.0
Hellowlol/HTPC-Manager
libs/argparse.py
490
87791
# Author: Steven J. Bethard <steven.bethard@gmail.com>. """Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages - supports parsers that dispatch to sub-parsers The...
mit
lifemapper/core
LmServer/tools/rebuild_archive_index.py
1
4997
"""This script creates a workflow to rebuild the solr index for a gridset """ import argparse import os from LmBackend.command.common import SystemCommand from LmBackend.command.server import TouchFileCommand from LmCommon.common.lmconstants import JobStatus, ProcessType from LmCommon.common.time import gmt from LmSer...
gpl-3.0
liorvh/golismero
tools/sqlmap/plugins/dbms/maxdb/enumeration.py
8
6561
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.common import Backend from lib.core.common import randomStr from lib.core.common import safeSQLIdentificatorNaming from lib.core.common import unsafeSQLIdentific...
gpl-2.0
rolando/scrapy
scrapy/http/headers.py
34
2738
import six from w3lib.http import headers_dict_to_raw from scrapy.utils.datatypes import CaselessDict from scrapy.utils.python import to_unicode class Headers(CaselessDict): """Case insensitive http headers dictionary""" def __init__(self, seq=None, encoding='utf-8'): self.encoding = encoding ...
bsd-3-clause
zstackorg/zstack-woodpecker
integrationtest/vm/virtualrouter/test_sg_rule_close_anti-spoofing.py
2
3380
''' @author: GuoCan ''' import os import time import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.config_operations as con_ops import zstackwoodpecker.zstack_test.zstack_test_security_group as te...
apache-2.0
opendatateam/udata
udata/core/dataset/csv.py
2
2432
from udata.core.discussions.models import Discussion from udata.frontend import csv from .models import Dataset, Resource def serialize_spatial_zones(dataset): if dataset.spatial and dataset.spatial.zones: return ','.join(z.name for z in dataset.spatial.zones) @csv.adapter(Dataset) class DatasetCsvAdap...
agpl-3.0
puuu/micropython
tests/basics/class_delattr_setattr.py
4
1533
# test __delattr__ and __setattr__ # feature test for __setattr__/__delattr__ try: class Test(): def __delattr__(self, attr): pass del Test().noexist except AttributeError: import sys print('SKIP') sys.exit() # this class just prints the calls to see if they were executed class A(): de...
mit
yinglanma/AI-project
examples/load-alexnet.py
1
3395
#!/usr/bin/env python # -*- coding: UTF-8 -*- # File: load-alexnet.py # Author: Yuxin Wu <ppwwyyxxc@gmail.com> import tensorflow as tf import numpy as np import os import argparse from tensorpack import * from tensorpack.tfutils.symbolic_functions import * from tensorpack.tfutils.summary import * from tensorpack.data...
apache-2.0
n4hy/gnuradio
gnuradio-core/src/python/gnuradio/gr/qa_dc_blocker.py
8
3621
#!/usr/bin/env python # # Copyright 2011 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
jarshwah/django
tests/model_fields/models.py
28
12140
import os import tempfile import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.core.files.storage import FileSystemStorage from django.db import models from django.db.models.fields.files import Imag...
bsd-3-clause
janusnic/python_koans
python3/koans/about_modules.py
66
2375
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This is very different to AboutModules in Ruby Koans # Our AboutMultipleInheritance class is a little more comparable # from runner.koan import * from .another_local_module import * from .local_module_with_all_defined import * class AboutModules(Koan): def test_...
mit
llvtt/mongo-python-driver
test/test_collection.py
1
65479
# -*- coding: utf-8 -*- # Copyright 2009-2014 MongoDB, 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 l...
apache-2.0
40423208/2016fallcadp_hw
plugin/liquid_tags/gram.py
271
3656
""" Instagram Image Tag ------------------- By `Tom Spalding <https://github.com/digitalvapor>`_ You can see a working example at `antivapor.net/instagram-tag.html <http://antivapor.net/instagram-tag.html>`_. Based on `Liquid Image Tag <https://github.com/getpelican/pelican-plugins/blob/master/liquid_tags/img.py>`_ ...
agpl-3.0
QISKit/qiskit-sdk-py
qiskit/visualization/bloch.py
1
27046
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
apache-2.0
fangxingli/hue
desktop/core/ext-py/Django-1.6.10/django/conf/project_template/project_name/settings.py
127
2064
""" Django settings for {{ project_name }} project. For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/ """ # Build paths inside the project ...
apache-2.0
sserrot/champion_relationships
venv/Lib/site-packages/prompt_toolkit/layout/controls.py
1
35060
""" User interface Controls for the layout. """ import time from abc import ABCMeta, abstractmethod from typing import ( TYPE_CHECKING, Callable, Dict, Hashable, Iterable, List, NamedTuple, Optional, Union, ) from prompt_toolkit.application.current import get_app from prompt_toolkit...
mit
edx/course-discovery
course_discovery/apps/core/management/commands/tests/test_create_sites_and_partners.py
1
3486
import os import pytest from django.contrib.sites.models import Site from django.core.management import CommandError, call_command from django.test import TestCase from course_discovery.apps.core.models import Partner SITES = ['dummy-site'] class CreateSitesAndPartnersTests(TestCase): """ Test the create_sites...
agpl-3.0