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
Kussie/HTPC-Manager
libs/sqlobject/constraints.py
10
1868
""" Constraints """ class BadValue(ValueError): def __init__(self, desc, obj, col, value, *args): self.desc = desc self.col = col # I want these objects to be garbage-collectable, so # I just keep their repr: self.obj = repr(obj) self.value = repr(value) fu...
mit
jsirois/commons
src/python/twitter/common/metrics/rate.py
16
2824
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
hxddh/youtube-dl
youtube_dl/extractor/mofosex.py
87
1686
from __future__ import unicode_literals import os import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_urllib_parse_urlparse, compat_urllib_request, ) class MofosexIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?P<url>mofosex\.com/videos/(?P<i...
unlicense
714168586/Test
ops-docs/python/dbuser.py
1
2974
#!/usr/bin/env python #coding=utf-8 import json import yaml from aliyunsdkcore import client from aliyunsdkrds.request.v20140815 import CreateAccountRequest,GrantAccountPrivilegeRequest,DeleteAccountRequest,DescribeAccountsRequest # 添加用户 def AddUser(DBInstanceId,username,passwd): accessKeyId, accessKeySecret = ""...
lgpl-2.1
bkahlert/seqan-research
raw/workshop11/seqan-trunk/misc/trac_plugins/DocLinks/doc_links.py
2
4362
"""Seqan Doc Links for Trac. Version 0.1. Copyright (C) 2010 Manuel Holtgrewe Install by copying this file into the plugins directory of your trac work directory. In your trac.ini, you can use something like this (the following also shows the defaults). [seqan_doc_links] prefix = seqan base_url = http://www....
mit
paolodedios/tensorflow
tensorflow/python/distribute/cross_device_ops_test.py
8
49240
# 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
mlq/python-taiga
tests/test_tasks.py
2
2039
from taiga.requestmaker import RequestMaker from taiga.models import Task, Tasks import unittest from mock import patch import six if six.PY2: import_open = '__builtin__.open' else: import_open = 'builtins.open' class TestTasks(unittest.TestCase): @patch('taiga.requestmaker.RequestMaker.get') def tes...
mit
pigshell/nhnick
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py
123
7521
# 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
tmikov/jscomp
runtime/deps/gyp/test/win/gyptest-link-pgo.py
239
2993
#!/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. """ Make sure PGO is working properly. """ import TestGyp import os import sys if sys.platform == 'win32': test = TestGyp.TestGyp(forma...
apache-2.0
thp44/delphin_6_automation
data_process/2d_1d/simon/example_sim.py
1
7655
__author__ = "Christian Kongsgaard" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules import os import json import pandas as pd import xmltodict import shutil # RiBuild Modules from delphin_6_automation.dat...
mit
axinging/chromium-crosswalk
ppapi/generators/idl_lint.py
180
4046
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Lint for IDL """ import os import sys from idl_log import ErrOut, InfoOut, WarnOut from idl_node import IDLAttribute, IDLNode from idl_ast import I...
bsd-3-clause
AQuadroTeam/CellsCycle
firstLaunchAWS.py
1
5427
# manually build and launch your instances # remember that the ip field deals with a private ip def _get_parameter(node_id, private_ip, min_key, max_key): p = {"id": node_id, "ip": private_ip, "min_key": min_key, "max_key": max_key} return p def create_instances_parameters(): """ first = _get_param...
mit
yuyuyu101/VirtualBox-NetBSD
src/libs/libxml2-2.6.31/python/tests/validate.py
87
1710
#!/usr/bin/python -u import sys import libxml2 # Memory debug specific libxml2.debugMemory(1) ctxt = libxml2.createFileParserCtxt("valid.xml") ctxt.validate(1) ctxt.parseDocument() doc = ctxt.doc() valid = ctxt.isValid() if doc.name != "valid.xml": print "doc.name failed" sys.exit(1) root = doc.children if r...
gpl-2.0
ahharu/plugin-manager
plugin_manager/core/mixins/tables.py
1
6129
from __future__ import absolute_import, unicode_literals from django.core.paginator import Paginator from django.core import urlresolvers from django.utils.html import mark_safe, escape import django_tables2 as tables from django_tables2.tables import Table from django_tables2.utils import Accessor as A, AttributeDic...
mit
macks22/scikit-learn
examples/semi_supervised/plot_label_propagation_structure.py
247
2432
""" ============================================== Label Propagation learning a complex structure ============================================== Example of LabelPropagation learning a complex internal structure to demonstrate "manifold learning". The outer circle should be labeled "red" and the inner circle "blue". Be...
bsd-3-clause
dobbymoodge/origin
vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py
24
47731
#!/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
harayz/raspberry_pwn
src/pentest/sqlmap/lib/core/session.py
7
1913
#!/usr/bin/env python """ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import re from lib.core.common import Backend from lib.core.common import Format from lib.core.common import hashDBWrite from lib.core.data import kb from lib.core.data impor...
gpl-3.0
rysson/filmkodi
plugin.video.mrknow/lib/utils/pyDes.py
2
32243
############################################################################# # Documentation # ############################################################################# # Author: Todd Whiteman # Date: 16th March, 2009 # Verion: 2.0.0 # License: Public Domain - free to d...
apache-2.0
Talanor/findmyhash
findmyhash/services/MD5Decryption.py
1
1145
from bs4 import BeautifulSoup import requests from findmyhash.algo import Algo from findmyhash.errors import * from .Service import Service class MD5DECRYPTION(Service): NAME = "md5decryption" HOST = "http://md5decryption.com" ALGO_SUPPORTED = [Algo.MD5] @classmethod def algo_supported(cls,...
gpl-3.0
sajeeshcs/nested_quota_latest
nova/api/openstack/compute/contrib/flavor_rxtx.py
79
2175
# Copyright 2012 Nebula, 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...
apache-2.0
andmos/ansible
lib/ansible/modules/cloud/amazon/ec2_scaling_policy.py
46
6822
#!/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': ['stableinterf...
gpl-3.0
smasala/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/filter_unittest.py
124
9830
# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) # # 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...
bsd-3-clause
jolth/websiteDevMicrosystem
web/wsgiserver/ssl_builtin.py
79
2589
"""A library for integrating Python's builtin ``ssl`` library with CherryPy. The ssl module must be importable for SSL functionality. To use this module, set ``CherryPyWSGIServer.ssl_adapter`` to an instance of ``BuiltinSSLAdapter``. """ try: import ssl except ImportError: ssl = None from cherrypy import ws...
apache-2.0
GheRivero/ansible
lib/ansible/modules/cloud/cloudstack/cs_instance_facts.py
37
8632
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # 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
ebar0n/django
django/urls/conf.py
90
2946
"""Functions for use in URLsconfs.""" from functools import partial from importlib import import_module from django.core.exceptions import ImproperlyConfigured from .resolvers import ( LocalePrefixPattern, RegexPattern, RoutePattern, URLPattern, URLResolver, ) def include(arg, namespace=None): app_name = No...
bsd-3-clause
poulpito/Flexget
flexget/api/plugins/tvmaze_lookup.py
4
6090
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from flask import jsonify from flask_restplus import inputs from flexget.api import api, APIResource from flexget.api.app import NotFoundError, BadRequest, etag from flexg...
mit
Poles/Poles
platforms/windows/JsonCpp/scons-local-2.3.0/SCons/Options/__init__.py
11
2679
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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, incl...
gpl-3.0
TelekomCloud/aptexport
aptexport/__init__.py
1
2923
# -*- coding: utf-8 -*- # Copyright 2013 Thomas Bechtold <thomasbechtold@jpberlin.de> # Copyright 2013 Deutsche Telekom AG # # 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
henryfjordan/django
django/contrib/postgres/forms/hstore.py
313
1484
import json from django import forms from django.core.exceptions import ValidationError from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['HStoreField'] class HStoreField(forms.CharField): """A field for HStore data which accepts JSON input.""" widget = forms.Te...
bsd-3-clause
ingenieroariel/geonode
geonode/base/management/commands/updategeoip.py
3
2478
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2017 OSGeo # # 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 ...
gpl-3.0
xin3liang/platform_external_chromium_org
chrome/test/ispy/common/cloud_bucket.py
124
2185
# 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. """Abstract injector class for GS requests.""" class FileNotFoundError(Exception): """Thrown by a subclass of CloudBucket when a file is not found.""" ...
bsd-3-clause
goshow-jp/Kraken
tests/ComponentTests/tentacle_build.py
2
1650
from kraken import plugins from kraken.core.maths import Vec3 from kraken_components.generic.tentacle_component import TentacleComponentGuide, TentacleComponentRig from kraken.core.profiler import Profiler from kraken.helpers.utility_methods import logHierarchy Profiler.getInstance().push("tentacle_build") tentacl...
bsd-3-clause
PoundPay/wtforms
docs/conf.py
4
6200
# -*- coding: utf-8 -*- # # WTForms documentation build configuration file, created by # sphinx-quickstart on Fri Aug 01 15:29:36 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...
bsd-3-clause
wri/gfw-api
lib/oauth2client/locked_file.py
144
11379
# Copyright 2011 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 writing,...
gpl-2.0
Frodox/buildbot
master/buildbot/test/unit/test_data_forceschedulers.py
1
7282
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
msopentechcn/open-hackathon
open-hackathon-client/src/client/log.py
2
2041
# -*- coding: utf-8 -*- """ This file is covered by the LICENSING file in the root of this project. """ import logging from os.path import realpath, dirname, join from logging import config, DEBUG, INFO __all__ = ["log"] class Log(object): """Wrapper of Python logging module for easier usage :Example: ...
mit
trnewman/VT-USRP-daughterboard-drivers
gnuradio-core/src/lib/filter/generate_gr_freq_xlating_fir_filter_XXX.py
17
1498
#!/bin/env python # -*- python -*- # # Copyright 2003,2004 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...
gpl-3.0
shacknetisp/vepybot
plugins/core/list.py
1
1340
# -*- coding: utf-8 -*- import bot class M_List(bot.Module): index = "list" def register(self): self.addcommand( self.list, "list", "List modules or, if <module> is specified, commands in a module, " "<module> can be * for all commands.", ...
mit
jupierce/openshift-tools
scripts/monitoring/cron-send-elb-status.py
11
4395
#!/usr/bin/env python # vim: expandtab:tabstop=4:shiftwidth=4 ''' Collect information about node within ELB ''' # # Copyright 2015 Red Hat 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 ...
apache-2.0
jhaux/tensorflow
tensorflow/python/training/saver_test_utils.py
25
3105
# 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
HenryHu/pybbs
PostEntry.py
1
5083
#!/usr/bin/env python # vim: set fileencoding=utf-8 : import struct import Config import time from Util import Util from cstruct import CStruct # PostEntry.accessed[0] FILE_SIGN = 0x1 #/* In article mode, Sign , Bigman 2000.8.12 ,in accessed[0] */ # not used FILE_OWND = 0x2 #/* accessed array */ #...
bsd-2-clause
SorX14/playbulbcandle
playbulbcandle/playbulbcandle.py
1
4940
# MIT License # Copyright (c) 2016 Steve Parker import subprocess import shlex from subprocess import call class PlayBulbCandle: commands = { 'setName': '0x001C', # writeReq needed get/set 'setEffect': '0x0014', # get/set 'setColor': '0x0016', # get/set 'getType': '0x0023', 'getFamily': '0x0025', 'getFi...
mit
openstack/tempest
tempest/api/volume/admin/test_volume_services_negative.py
1
3274
# Copyright 2018 FiberHome Telecommunication Technologies CO.,LTD # 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/LI...
apache-2.0
mtdewulf/incubator-airflow
airflow/contrib/operators/mysql_to_gcs.py
44
9126
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
ceisendle/llcp-over-nci
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt import sh...
gpl-2.0
ecologylab/BigSemanticsService
Scripts/main/bs_service_tester.py
1
2051
#!/usr/bin/python import urllib2 import urllib from simple_config import load_config tester_config = load_config("tester.conf") class ServiceTester: def __init__(self, config=None): if config is None: config = tester_config self.config = config self.timeout_seconds = config["timeout_...
apache-2.0
ubgarbage/gae-blog
django/contrib/sessions/backends/cache.py
55
1979
from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.cache import cache KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ def __init__(self, session_key=None): self._cache = cache su...
bsd-3-clause
ooici/marine-integrations
mi/instrument/harvard/massp/rga/test/test_driver.py
1
29215
""" @package mi.instrument.harvard.massp.rga.test.test_driver @file marine-integrations/mi/instrument/harvard/massp/rga/driver.py @author Peter Cable @brief Test cases for rga driver USAGE: Make tests verbose and provide stdout * From the IDK $ bin/test_driver $ bin/test_driver -u [-t testname] ...
bsd-2-clause
ddong8/ihasy
lib/sendmail.py
1
1171
#!/usr/bin/env python # coding=utf-8 # # Copyright 2017 ihasy.com # Do have a faith in what you're doing. # Make your life a story worth telling. import smtplib import sys import email from email.mime.text import MIMEText send_mail_host = 'smtp_host' send_mail_user = 'smtp_user' send_mail_user_name = u'send_mail_user...
bsd-3-clause
NMGRL/pychron
pychron/processing/analyses/analysis_group.py
1
34170
# =============================================================================== # 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
code-sauce/tensorflow
tensorflow/python/ops/gradients_impl.py
1
37128
# 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
gena701/Seleniun_php4dvd_lesson2_Rovinsky
php4dvd/php4dvd_negative.py
1
2371
# -*- 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...
apache-2.0
ntddk/pemu
roms/seabios/scripts/checkrom.py
17
3347
#!/usr/bin/env python # Script to check a bios image and report info on it. # # Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. import sys, struct import layoutrom, buildrom from python23compat import as_bytes def subst(data, offset, ...
gpl-2.0
dorapanda/qemu-2.0.0-with-fm3
roms/seabios/scripts/buildrom.py
16
1215
#!/usr/bin/env python # Fill in checksum/size of an option rom, and pad it to proper length. # # Copyright (C) 2009 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. import sys def alignpos(pos, alignbytes): mask = alignbytes - 1 return (pos + mask...
gpl-2.0
v-iam/azure-sdk-for-python
azure-mgmt-authorization/azure/mgmt/authorization/models/resource_type.py
2
1278
# 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
irvingprog/pilas
pilas/camara.py
6
3475
# -*- encoding: utf-8 -*- # Pilas engine - A video game framework. # # Copyright 2010 - Hugo Ruscitti # License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html) # # Website - http://www.pilas-engine.com.ar import pilas class Camara(object): """Representa el punto de vista de la ventana. Los atributos ``x...
lgpl-3.0
barnsnake351/nova
nova/db/sqlalchemy/migrate_repo/versions/250_remove_instance_groups_metadata.py
81
1198
# Copyright 2014 Red Hat, 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 ...
apache-2.0
ybrs/terminator-forked
build/lib.linux-x86_64-2.7/terminatorlib/titlebar.py
3
10522
#!/usr/bin/python # Terminator by Chris Jones <cmsj@tenshu.net> # GPL v2 only """titlebar.py - classes necessary to provide a terminal title bar""" import gtk import gobject from version import APP_NAME from util import dbg from terminator import Terminator from editablelabel import EditableLabel # pylint: disable-m...
gpl-2.0
kernelmilowill/PDMQBACKTEST
vn.ksgold/pyscript/generate_data_type.py
36
2369
# encoding: UTF-8 __author__ = 'CHENXY' # C++和python类型的映射字典 type_dict = { 'int': 'int', 'char': 'string', 'double': 'float', 'short': 'int', 'unsigned': 'string' } def process_line(line): """处理每行""" if '///' in line: # 注释 py_line = process_comment(line) elif 'typede...
mit
wolverineav/neutron
neutron/tests/unit/plugins/ml2/drivers/macvtap/test_macvtap_common.py
9
2462
# Copyright (c) 2016 IBM Corp. # # 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
gqwest-erp/server
openerp/addons/report_webkit/report_helper.py
42
3183
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programmers who...
agpl-3.0
cchurch/ansible
test/units/modules/storage/netapp/test_na_ontap_command.py
17
5689
# (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit test for ONTAP Command Ansible module ''' from __future__ import print_function import json import pytest from units.compat import unittest from units.compat.mock import patch, Mock from ansi...
gpl-3.0
BdEINSALyon/resa
bookings/views/bookings.py
1
6910
import datetime as dt import logging import dateutil.parser from django.contrib import messages from django.contrib.auth.decorators import login_required, permission_required from django.core.paginator import Paginator, EmptyPage from django.shortcuts import get_object_or_404, redirect from django.urls import reverse,...
gpl-3.0
kchodorow/tensorflow
tensorflow/tools/graph_transforms/python/transform_graph_test.py
170
3295
# 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 applicable ...
apache-2.0
ovnicraft/openerp-restaurant
product/report/__init__.py
452
1080
# -*- 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...
agpl-3.0
gchaimovitz/CouchPotatoServer
couchpotato/core/plugins/base.py
11
15483
import threading from urllib import quote, getproxies from urlparse import urlparse import os.path import time import traceback from couchpotato.core.event import fireEvent, addEvent from couchpotato.core.helpers.encoding import ss, toSafeString, \ toUnicode, sp from couchpotato.core.helpers.variable import md5, i...
gpl-3.0
jeremysanders/veusz
veusz/utils/feedback.py
3
6020
# Copyright (C) 2018 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # 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 # ...
gpl-2.0
waltharius/NewsBlur
vendor/tweepy/utils.py
32
1355
# Tweepy # Copyright 2010 Joshua Roesslein # See LICENSE for details. from datetime import datetime import time import htmlentitydefs import re import locale from urllib import quote from email.utils import parsedate def parse_datetime(string): return datetime(*(parsedate(string)[:6])) def parse_html_value(htm...
mit
Jolocotroco/android_kernel_samsung_smdkv210
Documentation/target/tcm_mod_builder.py
3119
42754
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
damdam-s/OpenUpgrade
addons/l10n_ve/__openerp__.py
260
2960
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved ############################################################################## # Modu...
agpl-3.0
ennoborg/gramps
gramps/gui/glade/catalog/grampswidgets.py
11
1186
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # # 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 you...
gpl-2.0
Kismuz/btgym
btgym/research/model_based/model/bivariate.py
1
29118
import numpy as np from collections import namedtuple from btgym.research.model_based.model.rec import Zscore, ZscoreState, Covariance, CovarianceState from btgym.research.model_based.model.rec import OUEstimatorState from btgym.research.model_based.model.univariate import OUProcess, TimeSeriesModel BivariateTSMode...
lgpl-3.0
chugunovyar/factoryForBuild
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py
515
5599
from __future__ import absolute_import # Base Exceptions class HTTPError(Exception): "Base exception used by this module." pass class HTTPWarning(Warning): "Base warning used by this module." pass class PoolError(HTTPError): "Base exception for errors caused within a pool." def __init__(se...
gpl-3.0
donjordano/skype4py
unittests/skypetest.py
17
26067
import unittest import skype4pytest from Skype4Py.skype import * class SkypeTest(skype4pytest.TestCase): def setUpObject(self): self.obj = self.skype # Methods # ======= def testApiSecurityContextEnabled(self): # Returned type: bool def test(): self.obj.ApiSecuri...
bsd-3-clause
jhutar/spacewalk
client/rhel/rhn-client-tools/src/up2date_client/gui.py
4
13579
# # GUI for Update Agent # Copyright (c) 1999--2016 Red Hat, Inc. Distributed under GPLv2. # # Authors: # Preston Brown <pbrown@redhat.com> # Adrian Likins <alikins@redhat.com> # Daniel Benamy <dbenamy@redhat.com> import os import sys import gtk import gtk.glade gtk.glade.bindtextdomain("rhn-client-tools",...
gpl-2.0
stevegood/filesync-server
lib/ubuntuone/storage/rzlib.py
6
18704
# Copyright 2008-2015 Canonical # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed...
agpl-3.0
robovm/robovm-studio
python/lib/Lib/site-packages/django/contrib/gis/gdal/tests/test_envelope.py
332
3742
from django.contrib.gis.gdal import Envelope, OGRException from django.utils import unittest class TestPoint(object): def __init__(self, x, y): self.x = x self.y = y class EnvelopeTest(unittest.TestCase): def setUp(self): self.e = Envelope(0, 0, 5, 5) def test01_init(self): ...
apache-2.0
jkarnows/scikit-learn
benchmarks/bench_glm.py
297
1493
""" A comparison of different methods in GLM Data comes from a random square matrix. """ from datetime import datetime import numpy as np from sklearn import linear_model from sklearn.utils.bench import total_seconds if __name__ == '__main__': import pylab as pl n_iter = 40 time_ridge = np.empty(n_it...
bsd-3-clause
D3f0/AutobahnPython
examples/wamp/rpc/profile/client.py
26
2975
############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## http://www...
apache-2.0
fkie/rosrepo
src/rosrepo/cmd_bash.py
1
2161
# coding=utf-8 # # ROSREPO # Manage ROS workspaces with multiple Gitlab repositories # # Author: Timo Röhling # # Copyright 2016 Fraunhofer FKIE # # 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 a...
apache-2.0
hsheep/limon_vbox
statan.py
2
4061
# Limon # Copyright (C) 2015 Monnappa # # This file is part of Limon. # # Limon 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. # Limo...
gpl-3.0
bjohare/cloughjordan.ie
wp-content/themes/executive-pro/api/OpenLayers-2.13.1/tools/minimize.py
297
2088
# Minimal Python Minimizer # Copyright 2008, Christopher Schmidt # Released under the MIT License # # Taken from: http://svn.crschmidt.net/personal/python/minimize.py # $Id: minimize.py 6 2008-01-03 06:33:35Z crschmidt $ # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software...
cc0-1.0
confluentinc/examples
clients/cloud/python/producer_ccsr.py
1
3189
#!/usr/bin/env python # # Copyright 2020 Confluent 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...
apache-2.0
PaulBrownMagic/LED_Arcade
constants.py
1
1687
import numpy as np from games.constants import * k = BLACK g = GREEN w = WHITE r = RED b = BLUE m = DARK_RED n = DARK_BLUE p = PURPLE o = ORANGE y = YELLOW NAV_SCREENS = { "Snake": np.array( [ [m, w, m, m, m, m, w, m], [w, m, m, m, m, m, m, w], [m, w, m, m, m, m, w...
gpl-3.0
russel1237/scikit-learn
examples/svm/plot_weighted_samples.py
188
1943
""" ===================== SVM: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. The sample weighting rescales the C parameter, which means that the classifier puts more emphasis on getting these points right. The effect might ...
bsd-3-clause
thwindbell/pox
pox/proto/dns_spy.py
45
4072
# Copyright 2011-2012 James McCauley # # 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 ...
apache-2.0
michaelkirk/QGIS
python/plugins/processing/algs/lidar/fusion/CanopyModel.py
1
5453
# -*- coding: utf-8 -*- """ *************************************************************************** CanopyModel.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com --------------------- ...
gpl-2.0
yuvipanda/nbresuse
jupyter_resource_usage/config.py
1
3739
import os from traitlets import Bool from traitlets import default from traitlets import Dict from traitlets import Float from traitlets import Int from traitlets import List from traitlets import TraitType from traitlets import Union from traitlets.config import Configurable try: # Traitlets >= 4.3.3 from tr...
bsd-2-clause
krieger-od/nwjs_chromium.src
build/android/pylib/local/device/local_device_environment.py
15
1536
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from pylib.base import environment from pylib.device import adb_wrapper from pylib.device import device_errors from pylib.device import device_utils from pyl...
bsd-3-clause
PepperPD/edx-pepper-platform
common/djangoapps/track/tests.py
13
2915
"""Tests for student tracking""" import mock from django.test import TestCase from django.core.urlresolvers import reverse, NoReverseMatch from track.models import TrackingLog from track.views import user_track from nose.plugins.skip import SkipTest class TrackingTest(TestCase): """ Tests that tracking logs ...
agpl-3.0
Basis/pip
pip/backwardcompat/__init__.py
3
2814
"""Stuff that differs in different Python versions""" import os import imp import sys import site __all__ = ['WindowsError'] uses_pycache = hasattr(imp, 'cache_from_source') class NeverUsedException(Exception): """this exception should never be raised""" try: WindowsError = WindowsError except NameError: ...
mit
varunarya10/nova_test_latest
nova/api/openstack/compute/contrib/fixed_ips.py
72
3685
# Copyright 2012 IBM Corp. # # 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 t...
apache-2.0
anas-taji/sale-workflow
__unported__/sale_fiscal_position_update/sale.py
37
3620
# -*- coding: utf-8 -*- # # # Sale Fiscal Position Update module for OpenERP # Copyright (C) 2011-2014 Julius Network Solutions SARL <contact@julius.fr> # Copyright (C) 2014 Akretion (http://www.akretion.com) # @author Mathieu Vatel <mathieu _at_ julius.fr> # @author Alexis de Lattre <alexis.delattre@akr...
agpl-3.0
xzturn/tensorflow
tensorflow/compiler/tests/gather_test.py
25
9047
# 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
mackjoner/peewee
setup.py
1
2733
import os import sys from distutils.core import setup from distutils.extension import Extension f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup_kwargs = {} try: from Cython.Distutils import build_ext except ImportError: cython_installed = False else: cytho...
mit
lbartoletti/QGIS
tests/src/python/test_qgssearchwidgetwrapper.py
25
21843
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsSearchWidgetWrapper. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version...
gpl-2.0
gunine/boeffla-kernel-jb-lte
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt import sh...
gpl-2.0
cakeboss893/volatility
volatility/plugins/procdump.py
44
9643
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu> # # Additional Authors: # Mike Auty <mike.auty@gmail.com> # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of...
gpl-2.0
pytorch/vision
test/common_utils.py
1
12886
import os import shutil import tempfile import contextlib import unittest import argparse import sys import torch import __main__ import random import inspect from numbers import Number from torch._six import string_classes from collections import OrderedDict import numpy as np from PIL import Image from _assert_uti...
bsd-3-clause
cherylyli/stress-aid
env/lib/python3.5/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py
353
14161
"""Module for supporting the lxml.etree library. The idea here is to use as much of the native library as possible, without using fragile hacks like custom element names that break between releases. The downside of this is that we cannot represent all possible trees; specifically the following are known to cause proble...
mit