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
UWPCE-PythonCert/IntroPython2016
students/baumel/session_02/grid_printer.py
3
2166
"""this is a lab to create grid patterns""" #first version simple print statement def grid_printer(): print('+ - - - - + - - - - +') print('| | |') print('| | |') print('| | |') print('| | |') print('+ - - - - + - - - - +') pri...
unlicense
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/idlelib/IdleHistory.py
122
4052
"Implement Idle Shell history mechanism with History class" from idlelib.configHandler import idleConf class History: ''' Implement Idle Shell history mechanism. store - Store source statement (called from PyShell.resetoutput). fetch - Fetch stored statement matching prefix already entered. history_n...
mit
rush-skills/ZeroNet
src/lib/PySocks/socks.py
23
27442
""" SocksiPy - Python SOCKS module. Version 1.5.3 Copyright 2006 Dan-Haim. 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 ...
gpl-2.0
andymg/androguard
androguard/core/bytecode.py
37
24731
# This file is part of Androguard. # # Copyright (C) 2012/2013, Anthony Desnos <desnos at t0t0.fr> # 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.a...
apache-2.0
n0trax/ansible
lib/ansible/modules/network/junos/junos_config.py
11
13176
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # 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
simbha/mAngE-Gin
lib/django/contrib/gis/geoip/prototypes.py
93
3944
from ctypes import c_char_p, c_float, c_int, string_at, Structure, POINTER from django.contrib.gis.geoip.libgeoip import lgeoip, free #### GeoIP C Structure definitions #### class GeoIPRecord(Structure): _fields_ = [('country_code', c_char_p), ('country_code3', c_char_p), ('countr...
mit
vrv/tensorflow
tensorflow/contrib/learn/python/learn/preprocessing/categorical_vocabulary.py
94
4204
# 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
nstockton/mapperproxy-mume
mapper/sockets/fakesocket.py
1
1829
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Future Modules: from __future__ import annotations # Built-in Modules: import logging import time from typing import...
mpl-2.0
Fireblend/scikit-learn
examples/decomposition/plot_ica_blind_source_separation.py
349
2228
""" ===================================== Blind source separation using FastICA ===================================== An example of estimating sources from noisy data. :ref:`ICA` is used to estimate sources given noisy measurements. Imagine 3 instruments playing simultaneously and 3 microphones recording the mixed si...
bsd-3-clause
formath/mxnet
example/profiler/profiler_matmul.py
25
2489
# 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
mmcdermo/helpinghand
server/venv/lib/python2.7/site-packages/django/contrib/comments/__init__.py
112
3485
import warnings from django.conf import settings from django.core import urlresolvers from django.core.exceptions import ImproperlyConfigured from django.contrib.comments.models import Comment from django.contrib.comments.forms import CommentForm from django.utils.importlib import import_module warnings.warn("django.c...
mit
venicegeo/eventkit-cloud
eventkit_cloud/auth/tests/test_views.py
1
6563
# -*- coding: utf-8 -*- import json import logging import urllib.request, urllib.parse, urllib.error from django.conf import settings from django.contrib.auth.models import User, Group from django.urls import reverse from django.test import Client, override_settings from django.test import TestCase from mock import ...
bsd-3-clause
DoubleNegativeVisualEffects/gaffer
python/GafferUI/PlugValueWidget.py
2
15985
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
bsd-3-clause
mkobos/tree_crawler
concurrent_tree_crawler/common/threads/rw_lock.py
1
4057
import threading #import time ##DEBUG #import logging ##DEBUG __author__ = "Mateusz Kobos" """ This code is a derivative of the code from ActiveState Code service at the address: http://code.activestate.com/recipes/577803-reader-writer-lock-with-priority-for-writers and is licensed under the MIT license. """ class R...
mit
thjashin/tensorflow
tensorflow/python/framework/framework_lib.py
61
3985
# 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
systembugtj/electron
tools/coffee2asar.py
150
1520
#!/usr/bin/env python import os import shutil import subprocess import sys import tempfile SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__)) def main(): archive = sys.argv[1] coffee_source_files = sys.argv[2:] output_dir = tempfile.mkdtemp() compile_coffee(coffee_source_files, output_dir) call_as...
mit
aevitas/pyREtic
Decompilers/unpyc/__init__.py
3
1727
#!/usr/bin/python # [The "BSD licence"] # Copyright (c) 2008-2009 Dmitri Kornev # 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 copyri...
gpl-3.0
romain-dartigues/ansible
lib/ansible/modules/network/cloudengine/ce_command.py
22
7712
#!/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
tchernomax/ansible
lib/ansible/modules/cloud/cloudstack/cs_network.py
37
18141
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017, René Moser <mail@renemoser.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supporte...
gpl-3.0
jjmleiro/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/comments/views/moderation.py
210
5204
from __future__ import absolute_import from django import template from django.conf import settings from django.contrib import comments from django.contrib.auth.decorators import login_required, permission_required from django.contrib.comments import signals from django.contrib.comments.views.utils import next_redirec...
apache-2.0
akusok/website-ibc
wibc/modules/add_website.py
1
2369
# -*- coding: utf-8 -*- """Converts images, returns all information. Created on Mon Sep 16 14:58:13 2013 @author: akusoka1 """ from wibc.config.wibc_config import cf import os from PIL import Image import hashlib def add_website(imglist, out_folder): """ imglist -- list of images with paths out_folder -...
gpl-2.0
cyc805/FTRerouting
src/mobility/bindings/modulegen__gcc_LP64.py
12
300893
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
Azure/azure-sdk-for-python
sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_service_fabric_management_client.py
1
7781
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
romain-dartigues/ansible
test/units/modules/network/f5/test_bigip_cli_alias.py
21
3461
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
ocadotechnology/django-nuit
example_project/example_project/wsgi.py
73
1146
""" WSGI config for test_project project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATI...
apache-2.0
scholrly/neo4django
neo4django/validators.py
3
2412
from django.core import exceptions class ArrayValidator(object): def __call__(self, values): sup = super(ArrayValidator, self) if hasattr(sup, '__call__'): sup.__call__(values) if not getattr(values, '__iter__', False): raise exceptions.ValidationError('Enter a non-...
gpl-3.0
40223247/2015cd_midterm-master
static/Brython3.1.1-20150328-091302/Lib/unittest/test/_test_warnings.py
858
2304
# helper module for test_runner.Test_TextTestRunner.test_warnings """ This module has a number of tests that raise different kinds of warnings. When the tests are run, the warnings are caught and their messages are printed to stdout. This module also accepts an arg that is then passed to unittest.main to affect the b...
agpl-3.0
les69/calvin-base
calvin/calvinsys/web/tests/facebook_test.py
1
1905
import pytest import json from calvin.calvinsys.web.facebook import Facebook, FacebookUser from facebook import GraphAPIError """ Configuration file for automated testing. Change with your credentials file FACEBOOK_CREDENTIALS = $PATHTO/yourcredentials.json The file has to be structured like the following { "acc...
apache-2.0
IntegerMan/Pi-MFD
PiMFD/Applications/Navigation/Tags/LeisureTagHandling.py
1
8389
# coding=utf-8 """ Handles the "leisure" tag """ from PiMFD.Applications.Navigation.Tags.TagHandling import TagHandler __author__ = 'Matt Eland' class LeisureTagHandler(TagHandler): def get_color(self, entity, value, cs): """ :type cs: PiMFD.UI.ColorScheme.ColorScheme """ if val...
gpl-2.0
CTSRD-SOAAP/chromium-42.0.2311.135
tools/perf/measurements/smoothness_unittest.py
3
7690
# Copyright 2013 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 from measurements import smoothness from metrics import power from telemetry import decorators from telemetry.core import exceptions from telemetr...
bsd-3-clause
krieger-od/nwjs_chromium_webrtc
build/version.py
50
1895
#!/usr/bin/env python # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All ...
bsd-3-clause
steebchen/youtube-dl
youtube_dl/extractor/pornhd.py
16
3635
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, js_to_json, ) class PornHdIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?pornhd\.com/(?:[a-z]{2,4}/)?videos/(?P<id>\d+)(?:/(?P<display_id>.+))?' _TESTS = [...
unlicense
HyperBaton/ansible
lib/ansible/modules/cloud/amazon/aws_batch_job_queue.py
11
10636
#!/usr/bin/python # Copyright (c) 2017 Jon Meran <jonathan.meran@sonos.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
jld23/saspy
saspy/tests/test_sasmagic.py
2
2323
import unittest from unittest.mock import patch, MagicMock, PropertyMock from saspy.sas_magic import SASMagic from saspy import SASsession class TestSASMagic(unittest.TestCase): @classmethod def setUpClass(cls): pass @classmethod def tearDownClass(cls): pass def setUp(self): ...
apache-2.0
maohongyuan/kbengine
kbe/res/scripts/common/Lib/threading.py
61
48900
"""Thread module emulating a subset of Java's threading model.""" import sys as _sys import _thread try: from time import monotonic as _time except ImportError: from time import time as _time from traceback import format_exc as _format_exc from _weakrefset import WeakSet from itertools import islice as _islic...
lgpl-3.0
maurofaccenda/ansible
lib/ansible/modules/cloud/ovirt/ovirt_networks.py
5
9599
#!/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
tiaotiaolong/vulnerability_platform
struts2/tasks.py
1
2692
#coding=utf-8 from celery import task from struts2 import struts_poc from struts2.models import Info_Struts2 from struts2.views import * import time @task def deal_url(target_url): #for target_url in target_url_list: result=struts_poc.struts_019(target_url) if result[0]==True: struts_019_pic=red_p...
gpl-3.0
LLNL/spack
var/spack/repos/builtin/packages/r-dendextend/package.py
5
1169
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RDendextend(RPackage): """dendextend: Extending 'Dendrogram' Functionality in R""" ho...
lgpl-2.1
uannight/reposan
plugin.video.tvalacarta/lib/youtube_dl/extractor/ccc.py
50
2839
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, parse_iso8601, ) class CCCIE(InfoExtractor): IE_NAME = 'media.ccc.de' _VALID_URL = r'https?://(?:www\.)?media\.ccc\.de/v/(?P<id>[^/?#&]+)' _TESTS = [{ 'url': 'https://media.ccc.de...
gpl-2.0
sjagoe/cygit2
cygit2/tests/test_config.py
1
1620
# -*- coding: utf-8 -*- # # Copyright 2013 The cygit2 contributors # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, # as published by the Free Software Foundation. # # In addition to the permissions in the GNU General Public License...
gpl-2.0
dbaxa/django
django/contrib/gis/db/models/query.py
224
36645
import warnings from django.contrib.gis.db.models import aggregates from django.contrib.gis.db.models.fields import ( GeometryField, LineStringField, PointField, get_srid_info, ) from django.contrib.gis.db.models.lookups import GISLookup from django.contrib.gis.db.models.sql import ( AreaField, DistanceField, ...
bsd-3-clause
cbeloni/pychronesapp
backend/appengine/config/template_middleware.py
35
2705
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from jinja2.exceptions import TemplateNotFound from tekton import router from tekton.gae.middleware.response import ResponseBase from tekton.gae.middleware import Middleware from config import template class TemplateResponse(ResponseBa...
mit
Sorsly/subtle
google-cloud-sdk/lib/surface/compute/rolling_updates/rollback.py
3
3333
# Copyright 2014 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 ag...
mit
GinnyN/towerofdimensions-django
django/db/models/fields/__init__.py
20
47014
import copy import datetime import decimal import math import warnings from itertools import tee from django.db import connection from django.db.models.query_utils import QueryWrapper from django.conf import settings from django import forms from django.core import exceptions, validators from django.utils.datastructur...
bsd-3-clause
tareqalayan/ansible
lib/ansible/playbook/block.py
14
16214
# (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
jdsika/TUM_HOly
openrave/sympy/series/residues.py
5
2020
""" This module implements the Residue function and related tools for working with residues. """ from sympy import Wild, sympify, Integer, Add def residue(expr, x, x0): """ Finds the residue of ``expr`` at the point x=x0. The residue is defined as the coefficient of 1/(x-x0) in the power series expan...
mit
franekp/millandict
ankidict/thirdparty/cherrypy/process/wspbus.py
6
16279
"""An implementation of the Web Site Process Bus. This module is completely standalone, depending only on the stdlib. Web Site Process Bus -------------------- A Bus object is used to contain and manage site-wide behavior: daemonization, HTTP server start/stop, process reload, signal handling, drop privileges, PID f...
mit
eduNEXT/edx-platform
lms/djangoapps/discussion/rest_api/tests/test_pagination.py
5
2099
""" Tests for Discussion API pagination support """ from unittest import TestCase from django.test import RequestFactory from lms.djangoapps.discussion.rest_api.pagination import DiscussionAPIPagination from lms.djangoapps.discussion.rest_api.tests.utils import make_paginated_api_response class PaginationSerializ...
agpl-3.0
nrwahl2/ansible
lib/ansible/modules/windows/win_psexec.py
2
5275
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2017, Dag Wieers <dag@wieers.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 Lic...
gpl-3.0
o5k/openerp-oemedical-v0.1
openerp/addons/purchase_double_validation/__openerp__.py
57
1994
# -*- 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
skg-net/ansible
lib/ansible/modules/network/panos/panos_pg.py
50
5869
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
felixjimenez/django
tests/deprecation/tests.py
57
6162
from __future__ import unicode_literals import warnings from django.test.testcases import SimpleTestCase from django.utils import six from django.utils.deprecation import RenameMethodsBase class RenameManagerMethods(RenameMethodsBase): renamed_methods = ( ('old', 'new', PendingDeprecationWarning), ) ...
bsd-3-clause
maxkoryukov/headphones
lib/unidecode/x028.py
253
5069
data = ( ' ', # 0x00 'a', # 0x01 '1', # 0x02 'b', # 0x03 '\'', # 0x04 'k', # 0x05 '2', # 0x06 'l', # 0x07 '@', # 0x08 'c', # 0x09 'i', # 0x0a 'f', # 0x0b '/', # 0x0c 'm', # 0x0d 's', # 0x0e 'p', # 0x0f '"', # 0x10 'e', # 0x11 '3', # 0x12 'h', # 0x13 '9', # ...
gpl-3.0
bd808/striker
striker/goals/signals/handlers.py
1
2134
# -*- coding: utf-8 -*- # # Copyright (c) 2016 Wikimedia Foundation and contributors. # All Rights Reserved. # # This file is part of Striker. # # Striker 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...
gpl-3.0
40223136/20150616test1
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/version.py
607
1334
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
gpl-3.0
virtualopensystems/nova
nova/tests/virt/vmwareapi/test_vmops.py
1
39671
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
dongjoon-hyun/tensorflow
tensorflow/contrib/slim/__init__.py
101
2359
# 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
kevthunder/codewave-subl
codewave_core/closing_promp.py
3
5683
import codewave_core.logger as logger import codewave_core.util as util class ClosingPromp(): def __init__(self, codewave,selections): self.codewave = codewave self._typed = None self.nbChanges = 0 self.selections = util.PosCollection(selections) def begin(self): self.started = True self.addCarrets() i...
gpl-2.0
randynobx/ansible
lib/ansible/modules/network/nxos/nxos_pim_interface.py
39
24286
#!/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
VT-vision-lab/VQA
PythonEvaluationTools/vqaEvaluation/vqaEval.py
1
8428
# coding=utf-8 __author__='aagrawal' import re # This code is based on the code written by Tsung-Yi Lin for MSCOCO Python API available at the following link: # (https://github.com/tylin/coco-caption/blob/master/pycocoevalcap/eval.py). import sys class VQAEval: def __init__(self, vqa, vqaRes, n=2): self.n =...
bsd-2-clause
pbrazdil/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py
121
3180
# Copyright (C) 2010 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 th...
bsd-3-clause
Mozta/pagina-diagnostijuego
venv/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py
448
4327
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import string import re from pip._vendor.pyparsing import ( stringSta...
gpl-3.0
RPGOne/scikit-learn
sklearn/metrics/tests/test_regression.py
18
6065
from __future__ import division, print_function import numpy as np from itertools import product from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils....
bsd-3-clause
chirilo/kuma
kuma/wiki/views/list.py
1
7664
# -*- coding: utf-8 -*- from django.http import Http404 from django.shortcuts import get_object_or_404, get_list_or_404, render from django.views.decorators.http import require_GET from kuma.core.utils import paginate from ..constants import DOCUMENTS_PER_PAGE from ..decorators import process_document_path, prevent_i...
mpl-2.0
haoxli/crosswalk-test-suite
cordova/cordova-webapp-android-tests/inst.apk.py
1996
3186
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short script, let tool...
bsd-3-clause
tinkerthaler/odoo
openerp/addons/base/res/res_country.py
283
4728
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
IAMATinyCoder/SocialEDU
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/tools/graphviz.py
2679
2878
#!/usr/bin/env python # Copyright (c) 2011 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. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
gpl-3.0
vmarkovtsev/django
tests/fixtures_model_package/tests.py
312
2204
from __future__ import unicode_literals import warnings from django.core import management from django.test import TestCase from .models import Article class SampleTestCase(TestCase): fixtures = ['fixture1.json', 'fixture2.json'] def testClassFixtures(self): "Test cases can load fixture objects in...
bsd-3-clause
plivo/plivo-python
plivo/rest/base_client.py
1
7843
# -*- coding: utf-8 -*- """ Base client, used for all API requests. """ import os import platform from collections import namedtuple from plivo.base import ResponseObject from plivo.exceptions import (AuthenticationError, InvalidRequestError, PlivoRestError, PlivoServerError, ...
mit
wangjun/python
renzongxian/0014/0014.py
40
1050
# Source:https://github.com/Show-Me-the-Code/show-me-the-code # Author:renzongxian # Date:2014-12-22 # Python 3.4 """ 第 0014 题: 纯文本文件 student.txt为学生信息, 里面的内容(包括花括号)如下所示: { "1":["张三",150,120,100], "2":["李四",90,99,95], "3":["王五",60,66,68] } 请将上述内容写到 student.xls 文件中。 """ import xlwt3 import json # 该部分参考了...
mit
firebitsbr/My-Gray-Hacker-Resources
Network_and_802.11/scanner/IPHeader.py
4
1256
#!/usr/bin/env python __author__ = "bt3" ''' A class for the IP header''' import os import struct import socket import ctypes class IP(ctypes.Structure): _fields_ = [ ('ihl', ctypes.c_ubyte, 4), ('version', ctypes.c_ubyte, 4), ('tos', ctypes.c_ubyte), ('len',...
mit
roadmapper/ansible
lib/ansible/plugins/action/script.py
22
7460
# (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
paulgriffiths/pyshapes
materials.py
1
3330
""" Materials classes. Library Version 1.0 Copyright 2013 Paul Griffiths Email: mail@paulgriffiths.net Distributed under the terms of the GNU General Public License. http://www.gnu.org/licenses/ """ from conversions import convert class _Material(): """ Base material class """ def __init__(self...
gpl-3.0
feureau/Small-Scripts
Windows Batch scripts/DeDRM_tools_6.5.5/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ignobleepub.py
2
17801
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import with_statement # ignobleepub.pyw, version 4.1 # Copyright © 2009-2010 by i♥cabbages # Released under the terms of the GNU General Public Licence, version 3 # <http://www.gnu.org/licenses/> # Modified 2010–2013 by some_updates, DiapDealer and Appre...
gpl-3.0
SMALLplayer/smallplayer-image-creator
storage/.xbmc/addons/script.module.requests/lib/requests/packages/urllib3/poolmanager.py
13
5354
# urllib3/poolmanager.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging from ._collections import RecentlyUsedContainer from .connectionpool import...
gpl-2.0
Alwnikrotikz/client175
mutagen/apev2.py
6
15832
# An APEv2 tag reader # # Copyright 2005 Joe Wreschnig # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # $Id: apev2.py 4008 2007-04-21 04:02:07Z piman $ """APEv2 reading and writi...
gpl-3.0
mKeRix/home-assistant
homeassistant/components/pi_hole/const.py
3
1438
"""Constants for the pi_hole integration.""" from datetime import timedelta from homeassistant.const import UNIT_PERCENTAGE DOMAIN = "pi_hole" CONF_LOCATION = "location" DEFAULT_LOCATION = "admin" DEFAULT_METHOD = "GET" DEFAULT_NAME = "Pi-Hole" DEFAULT_SSL = False DEFAULT_VERIFY_SSL = True SERVICE_DISABLE = "disab...
mit
benoitsteiner/tensorflow-xsmm
tensorflow/contrib/distribute/python/minimize_loss_test.py
9
15082
# 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
xujun10110/creepy
creepy/components/PersonProjectWizard.py
2
11164
#!/usr/bin/python # -*- coding: utf-8 -*- import os from PyQt4.QtGui import QWizard,QMessageBox,QWidget,QScrollArea,QLineEdit,QLabel,QVBoxLayout,QCheckBox,QGridLayout from PyQt4.QtCore import QString from models.PluginConfigurationListModel import PluginConfigurationListModel from models.ProjectWizardPossibleTargetsTab...
gpl-3.0
WhireCrow/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/distutils/command/check.py
32
5369
"""distutils.command.check Implements the Distutils 'check' command. """ __revision__ = "$Id$" from distutils.core import Command from distutils.dist import PKG_INFO_ENCODING from distutils.errors import DistutilsSetupError try: # docutils is installed from docutils.utils import Reporter from docutils.pa...
gpl-2.0
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_operations.py
1
4744
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
francesconuma/yowsup
yowsup/demos/cli/cli.py
57
6023
import threading, inspect, shlex try: import Queue except ImportError: import queue as Queue try: import readline except ImportError: import pyreadline as readline class clicmd(object): def __init__(self, desc, order = 0): self.desc = desc self.order = order def __call__(self, f...
gpl-3.0
globau/servo
tests/wpt/css-tests/tools/wptserve/tests/functional/test_server.py
86
1285
import unittest import urllib2 import wptserve from .base import TestUsingServer class TestFileHandler(TestUsingServer): def test_not_handled(self): with self.assertRaises(urllib2.HTTPError) as cm: resp = self.request("/not_existing") self.assertEqual(cm.exception.code, 404) class Te...
mpl-2.0
AutorestCI/azure-sdk-for-python
azure-batch/azure/batch/models/pool_patch_parameter.py
1
3692
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
hohoins/ml
cifar10/cifar10_eval.py
1
5552
# 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
gkoelln/youtube-dl
test/test_socks.py
50
3500
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import random import subprocess from test.helper import ( FakeYDL, get_params, ) from you...
unlicense
levilucio/SyVOLT
UMLRT2Kiltera_MM/transformation/from_MPS/HConnectOPState2CProcDefTransition2InstotherInTransitions.py
1
5322
from core.himesis import Himesis import uuid class HConnectOPState2CProcDefTransition2InstotherInTransitions(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule ConnectOPState2CProcDefTransition2InstotherInTransitions. """ # Flag this instance as compiled now self.is_c...
mit
eesatfan/openpli-enigma2
lib/python/Components/ServiceScan.py
6
7468
from enigma import eComponentScan, iDVBFrontend from Components.NimManager import nimmanager as nimmgr from Components.Converter.ChannelNumbers import channelnumbers class ServiceScan: Idle = 1 Running = 2 Done = 3 Error = 4 Errors = { 0: "error starting scanning", 1: "error while scanning", 2: "no resour...
gpl-2.0
fernandog/Medusa
ext/boto/cloudsearch2/domain.py
153
21247
# Copyright (c) 2014 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 # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
gpl-3.0
yanweifu/chainer
cupy/math/floating.py
4
1285
from cupy import elementwise from cupy.math import ufunc signbit = elementwise.create_ufunc( 'cupy_signbit', ['e->?', 'f->?', 'd->?'], 'out0 = signbit(in0)', doc='''Tests elementwise if the sign bit is set (i.e. less than zero). .. seealso:: :data:`numpy.signbit` ''') copysign = ufunc.crea...
mit
alsrgv/tensorflow
tensorflow/python/ops/distributions/laplace.py
15
8293
# 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
enriquesanchezb/practica_utad_2016
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py
196
11401
from __future__ import absolute_import import errno import warnings import hmac from binascii import hexlify, unhexlify from hashlib import md5, sha1, sha256 from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning SSLContext = None HAS_SNI = False create_default_context = None # Maps the leng...
apache-2.0
redhataccess/rhi-pool
insights/ui/rules.py
1
2020
import logging import time from insights.ui.base import Base from insights.ui.locators import rules_locators from insights.ui.navigator import Navigator LOGGER = logging.getLogger('insights_portal') class Rules(Base): """ Identifies contents from Rules page of Insights """ def navigate_to_entity(self...
gpl-3.0
liangazhou/django-rdp
packages/PyDev/plugins/org.python.pydev_4.4.0.201510052309/pysrc/third_party/wrapped_for_pydev/ctypes/wintypes.py
106
2387
#@PydevCodeAnalysisIgnore # XXX This module needs cleanup. from ctypes import * DWORD = c_ulong WORD = c_ushort BYTE = c_byte ULONG = c_ulong LONG = c_long LARGE_INTEGER = c_longlong ULARGE_INTEGER = c_ulonglong HANDLE = c_ulong # in the header files: void * HWND = HANDLE HDC = HANDLE HMODULE = HANDLE HINSTANCE ...
apache-2.0
BrianPainter/video_village
videos/migrations/0001_initial.py
2
1467
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-07-08 00:49 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migration...
mit
DaanHoogland/cloudstack
test/integration/component/test_escalations_templates.py
3
33155
# 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
KhalidGit/flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/cookies.py
821
16686
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import time import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading # grr, pyflakes: this fixes...
apache-2.0
g-k/servo
tests/wpt/harness/wptrunner/vcs.py
40
1379
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import subprocess from functools import partial from mozlog.structured import get_default_logger logger = None def vc...
mpl-2.0
kobotoolbox/kobo_selenium_tests
kobo_selenium_tests/selenium_ide_exported/create_form_test_template.py
1
7253
# -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException...
gpl-3.0
kustodian/ansible
lib/ansible/plugins/test/files.py
170
1518
# (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 later version. # # Ansible is di...
gpl-3.0