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
openhatch/oh-mainline
vendor/packages/python-social-auth/social/pipeline/disconnect.py
88
1082
from social.exceptions import NotAllowedToDisconnect def allowed_to_disconnect(strategy, user, name, user_storage, association_id=None, *args, **kwargs): if not user_storage.allowed_to_disconnect(user, name, association_id): raise NotAllowedToDisconnect() def get_entries(strate...
agpl-3.0
simone-campagna/zapper
lib/python/zapper/text.py
1
1993
#!/usr/bin/env python3 # # Copyright 2013 Simone Campagna # # 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
miptliot/edx-platform
cms/envs/yaml_config.py
12
8323
""" This is the default template for our main set of AWS servers. Before importing this settings file the following MUST be defined in the environment: * SERVICE_VARIANT - can be either "lms" or "cms" * CONFIG_ROOT - the directory where the application yaml config files are located """ #...
agpl-3.0
associatedpress/datakit-data
tests/commands/test_init.py
1
4495
import os from unittest import mock from conftest import ( create_plugin_config, create_project_config, dir_contents ) from datakit.utils import read_json from datakit_data import Init def test_project_buildout(caplog, fake_project, monkeypatch, tmpdir): """ Init should auto-generate directories...
isc
Sklearn-HMM/scikit-learn-HMM
sklean-hmm/naive_bayes.py
3
20231
# -*- coding: utf-8 -*- """ The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These are supervised learning methods based on applying Bayes' theorem with strong (naive) feature independence assumptions. """ # Author: Vincent Michel <vincent.michel@inria.fr> # Minor fixes by Fabian Pedre...
bsd-3-clause
kubeflow/kubeflow
testing/test_tf_serving.py
1
4781
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 The Kubeflow 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/licens...
apache-2.0
vit2/vit-e2
lib/python/Screens/Dish.py
7
8474
# -*- coding: utf-8 -*- from Screen import Screen from Components.BlinkingPixmap import BlinkingPixmapConditional from Components.Pixmap import Pixmap from Components.config import config, ConfigInteger from Components.Sources.Boolean import Boolean from Components.Label import Label from Components.ProgressBar import ...
gpl-2.0
Jorge-Rodriguez/ansible-modules-core
network/junos/junos_template.py
14
5097
#!/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
shyamalschandra/picochess
server.py
2
9171
#!/usr/bin/env python # Copyright (C) 2013-2014 Jean-Francois Romang (jromang@posteo.de) # Shivkumar Shivaji () # # 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...
gpl-3.0
sunjincheng121/flink
flink-python/pyflink/table/tests/test_environment_settings.py
13
5290
################################################################################ # 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...
apache-2.0
Nick-OpusVL/odoo
addons/sale/wizard/__init__.py
444
1129
# -*- 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
mxOBS/deb-pkg_trusty_chromium-browser
third_party/webdriver/pylib/test/selenium/webdriver/common/rendered_webelement_tests.py
28
2265
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 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 requir...
bsd-3-clause
zevanzhao/TCCL-Code
Misc/xyz2mode.py
1
1906
#!/usr/bin/env python """ This script is similiar to modemake.pl. The script will generate DIMER_VECTOR in CP2K. """ from XYZFile import * import sys, copy def GetDiffXYZ(XYZ1, XYZ2): """ Get the difference of two XYZ file. A DIMER VECTOR or MODECAR is made from this difference. """ DiffXYZ = XYZ()...
gpl-3.0
z0by/django
tests/template_tests/filter_tests/test_timesince.py
207
5422
from __future__ import unicode_literals from datetime import datetime, timedelta from django.template.defaultfilters import timesince_filter from django.test import SimpleTestCase from django.test.utils import requires_tz_support from ..utils import setup from .timezone_utils import TimezoneTestCase class Timesinc...
bsd-3-clause
dtroyer/python-openstacksdk
openstack/tests/unit/cloud/test_qos_policy.py
1
13244
# Copyright 2017 OVH SAS # 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 agreed ...
apache-2.0
KlaasDeNys/Arduino
arduino-core/src/processing/app/i18n/python/requests/sessions.py
151
15091
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from datetime import datetime from .compat import cookielib from .cookies import cookiejar_from_dict from .models import Request,...
lgpl-2.1
DirtyUnicorns/android_external_chromium-org
ppapi/generators/idl_generator.py
165
8397
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys from idl_log import ErrOut, InfoOut, WarnOut from idl_option import GetOption, Option, ParseOptions from idl_parser imp...
bsd-3-clause
ehashman/oh-mainline
vendor/packages/Pygments/pygments/lexers/special.py
270
3080
# -*- coding: utf-8 -*- """ pygments.lexers.special ~~~~~~~~~~~~~~~~~~~~~~~ Special lexers. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import cStringIO from pygments.lexer import Lexer from pygments.token import Token,...
agpl-3.0
ngoclinh84phys/QE_finite_field
dev-tools/src-normal.py
20
6001
#!/usr/bin/env python # (C) 2010 Norbert Nemec # # USAGE: src-normal.py < input.f90 > output.f90 # # Script to normalize Fortran source code: # a) expand tabs to spaces (tab width 8 characters # b) remove trailing space # c) normalize multiword keywords # d) normalize capitalization of keywords and intrinsics ...
gpl-2.0
Fireblend/chromium-crosswalk
tools/perf/page_sets/key_mobile_sites_repaint.py
5
7857
# 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 telemetry.page import page as page_module from telemetry.page import page_set as page_set_module from page_sets import key_mobile_sites_pages from page_...
bsd-3-clause
fspaolo/scikit-learn
examples/cluster/plot_kmeans_digits.py
8
4495
""" =========================================================== A demo of K-Means clustering on the handwritten digits data =========================================================== In this example with compare the various initialization strategies for K-means in terms of runtime and quality of the results. As the ...
bsd-3-clause
wmbutler/courtlistener
alert/corpus_importer/lawbox/generate_judge_stats.py
2
4545
import datetime import pickle import pprint import argparse import time from alert.corpus_importer.lawbox.import_law_box import ( get_judge, get_court_object, get_html_from_raw_text, ) from alert.search.models import Court DEBUG = 4 ########################################## # This variable is used to do statis...
agpl-3.0
proxysh/Safejumper-for-Mac
buildlinux/env64/lib/python2.7/site-packages/twisted/python/shortcut.py
12
2441
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """Creation of Windows shortcuts. Requires win32all. """ from win32com.shell import shell import pythoncom import os def open(filename): """Open an existing shortcut for reading. @return: The shortcut object @rtype: Shortcut ...
gpl-2.0
skapfer/rubber
src/tex.py
1
14284
# This file is part of Rubber and thus covered by the GPL # (c) Emmanuel Beffara, 2008 # vim: noet:ts=4 """ General-purpose classes for reading TeX code. Classes and functions from this module can be used without Rubber. """ import re from io import StringIO # The catcodes EOF = -2 CSEQ = -1 ESCAPE = 0 OPEN = 1 CLOS...
gpl-2.0
iovation/launchkey-python
launchkey/utils/shared.py
2
5725
""" Shared Utilities """ from functools import wraps from uuid import UUID import warnings import six from jwkest import JWKESTException from ..exceptions import InvalidIssuerFormat, InvalidIssuerVersion, \ JWTValidationFailure, InvalidJWTResponse, WebhookAuthorizationError, \ XiovJWTValidationFailure, XiovJ...
mit
jjmachan/activityPointsApp
activitypoints/lib/python3.5/site-packages/django/core/cache/backends/filebased.py
73
5319
"File-based cache backend" import errno import glob import hashlib import io import os import random import tempfile import time import zlib from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.core.files.move import file_move_safe from django.utils.encoding import force_bytes try: f...
mit
secondstory/dewpoint
libcloud/providers.py
1
2585
# 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 use ...
apache-2.0
bsmr-ansible/ansible-modules-extras
files/blockinfile.py
7
9731
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, 2015 YAEGASHI Takeshi <yaegashi@debian.org> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
gpl-3.0
LightberryEu/plugin.program.hyperion.configurator
resources/lib/Led.py
1
6398
import json class Led: def __init__(self): self.x_start = 0 self.x_end = 0 self.y_start = 0 self.y_end = 0 self.position = 0 self.color = bytearray([0,0,0]) def setCoordinates(self, in_x_start, in_x_end, in_y_start,in_y_end): self.x_start = in_x_start self.x_end = in_x_end self.y_st...
gpl-2.0
rittersport3/CityWatchers
boilerplate/external/httplib2/__init__.py
83
64159
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright...
lgpl-3.0
liaorubei/depot_tools
third_party/gsutil/gslib/addlhelp/prod.py
51
8580
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
bsd-3-clause
caioserra/apiAdwords
examples/adspygoogle/dfp/v201308/get_all_orders.py
2
1619
#!/usr/bin/python # # Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
slgobinath/SafeEyes
safeeyes/plugins/audiblealert/plugin.py
1
2359
#!/usr/bin/env python # Safe Eyes is a utility to remind you to take break frequently # to protect your eyes from eye strain. # Copyright (C) 2017 Gobinath # 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...
gpl-3.0
maxisi/gwsumm
gwsumm/html/utils.py
1
1587
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2013) # # This file is part of GWSumm. # # GWSumm 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) ...
gpl-3.0
chrismeyersfsu/ansible
lib/ansible/modules/network/dellos6/dellos6_command.py
32
6660
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # # Copyright (c) 2016 Dell 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 versi...
gpl-3.0
openwisp/django-netjsonconfig
django_netjsonconfig/tests/test_views.py
1
1185
from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse User = get_user_model() class TestViews(TestCase): """ tests for django_netjsonconfig.views """ def setUp(self): User.objects.create_superuser( username='admin', passwo...
gpl-3.0
ergs/rickshaw
tests/test_choose_niches.py
1
1257
# -*- coding: utf-8 -*- """ Created on Fri Sep 23 10:49:39 2016 @author: adam """ import pytest from rickshaw.simspec import SimSpec, def_niches, def_commodities from rickshaw.generate import random_niches, choose_commodity, choose_commodities @pytest.mark.parametrize("i", range(100)) def test_random_niches(i): s...
bsd-3-clause
Barmaley-exe/scikit-learn
examples/tree/plot_iris.py
271
2186
""" ================================================================ Plot the decision surface of a decision tree on the iris dataset ================================================================ Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. See :ref:`decision tree ...
bsd-3-clause
amondot/QGIS
python/plugins/processing/algs/lidar/lastools/lasgrid.py
9
3382
# -*- coding: utf-8 -*- """ *************************************************************************** lasgrid.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com --------------------- D...
gpl-2.0
qubitcoin/QubitCoin-p2pool
p2pool/web.py
6
25283
from __future__ import division import errno import json import os import sys import time import traceback from twisted.internet import defer from twisted.python import log from twisted.web import resource, static import p2pool from bitcoin import data as bitcoin_data from . import data as p2pool_data from util impo...
gpl-3.0
lardissone/mcfinance
mcfinance/settings.py
1
2971
""" Django settings for mcfinance project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ from mongoengine import connect # Build paths inside the project like t...
mit
egaxegax/django-dbcartajs
django/contrib/flatpages/templatetags/flatpages.py
227
3631
from django import template from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import get_current_site register = template.Library() class FlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): self....
gpl-2.0
ABaldwinHunter/django-clone
django/contrib/gis/utils/ogrinspect.py
391
9090
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, O...
bsd-3-clause
thumbimigwe/echorizr
lib/python2.7/site-packages/django/utils/log.py
84
5261
from __future__ import unicode_literals import logging import logging.config # needed when logging_config doesn't start with logging.config import sys import warnings from copy import copy from django.conf import settings from django.core import mail from django.core.mail import get_connection from django.utils.depr...
mit
javiergarridomellado/Empresa_django
devcodela/lib/python2.7/site-packages/django/contrib/messages/api.py
321
2952
from django.contrib.messages import constants from django.contrib.messages.storage import default_storage __all__ = ( 'add_message', 'get_messages', 'get_level', 'set_level', 'debug', 'info', 'success', 'warning', 'error', ) class MessageFailure(Exception): pass def add_message(request, level, mess...
gpl-2.0
romankagan/DDBWorkbench
python/lib/Lib/datetime.py
74
74800
"""Concrete date/time and related types -- prototype implemented in Python. See http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage See also http://dir.yahoo.com/Reference/calendars/ For a primer on DST, including many current DST rules, see http://webexhibits.org/daylightsaving/ For more about DST than you e...
apache-2.0
lodemo/CATANA
src/face_recognition/youtube_dl/extractor/tvp.py
22
8498
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, clean_html, get_element_by_attribute, ExtractorError, ) class TVPIE(InfoExtractor): IE_NAME = 'tvp' IE_DESC = 'Telewizja Polska' _VALID_URL = r'https?:...
mit
milkey-mouse/SongRater
flasktasks.py
1
4842
# -*- coding: cp1252 -*- #Copyright Milkey Mouse 2015 from HTMLParser import HTMLParser import simplejson as json import celery from celery import Celery from flask import render_template from flask.ext.gzip import Gzip from celery import task from flask import Flask import datetime import urllib2 import string import ...
mit
Arcanemagus/SickRage
sickbeard/traktTrending.py
6
5411
# coding=utf-8 from __future__ import print_function, unicode_literals import os import posixpath from libtrakt.exceptions import traktException from libtrakt.trakt import TraktAPI import sickbeard from sickbeard import helpers, logger from sickbeard.indexers.indexer_config import INDEXER_TVDB from sickrage.helper....
gpl-3.0
pieiscool/edited-hearthbreaker
tests/agents/trade_agent_tests.py
2
1499
import unittest from hearthbreaker.cards import Wisp, WarGolem, BloodfenRaptor, RiverCrocolisk, AbusiveSergeant, ArgentSquire from tests.agents.trade.test_helpers import TestHelpers from tests.agents.trade.test_case_mixin import TestCaseMixin from hearthbreaker.agents.trade.possible_play import PossiblePlays class Te...
mit
cyberark-bizdev/ansible
test/units/modules/network/netscaler/netscaler_module.py
57
1638
import sys from ansible.compat.tests.mock import patch, Mock from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase base_modules_mock = Mock() nitro_service_mock = Mock() nitro_exception_mock = Mock() base_modules_to_mock = { 'nssrc': base_modules_mock, 'nssrc.com': base_modules_mo...
gpl-3.0
CAChemE/stochastic-optimization
ConventionalDistillationColumn/column_algorithm.py
1
2956
# -*- coding: utf-8 -*- from Test_Column_ObjFnc import tac_column import time """ % ------------------------------------------------------------------------- % SIMULATION-BASED OPTIMIZATION OF A SINGLE CONVENTIONAL DISTILLATION % COLUMN USING THE PARTICLE SWARM OPTIMIZATION ALGORITHM %----------------------...
bsd-3-clause
heathseals/CouchPotatoServer
libs/tornado/util.py
102
12256
"""Miscellaneous utility functions and classes. This module is used internally by Tornado. It is not necessarily expected that the functions and classes defined here will be useful to other applications, but they are documented here in case they are. The one public-facing part of this module is the `Configurable` cl...
gpl-3.0
chris-lee-mc/MutInf
cluster_list_to_pml.py
1
20752
import re, os, sys from optparse import OptionParser from numpy import * import subprocess from communities import * class ResCluster : members = [] selection_text = None #selection text for pymol number = 0 #cluster number intra_cluster_variance = 0 extra_cluster_variance = 0 indexlist = [] ...
gpl-3.0
thanethomson/statik
tests/integration/test_issue_51.py
1
1717
# -*- coding: utf-8 -*- """Regression test for issue #51.""" import unittest import os.path from xml.etree import ElementTree as ET from statik.generator import generate class TestStaticPagesFromProjectDynamicContext(unittest.TestCase): def test_issue(self): test_path = os.path.dirname(os.path.realpath...
mit
ibc/MediaSoup
worker/deps/gyp/test/cflags/gyptest-cflags.py
38
2088
#!/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. """ Verifies the use of the environment during regeneration when the gyp file changes, specifically via build of an executable with C prepro...
isc
bnwn/ardupilot
mk/VRBRAIN/Tools/genmsg/src/genmsg/srvs.py
51
3095
# Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, 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 ...
gpl-3.0
sssemil/cjdns
node_build/dependencies/libuv/build/gyp/pylib/gyp/generator/xcode.py
426
56534
# 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. import filecmp import gyp.common import gyp.xcodeproj_file import gyp.xcode_ninja import errno import os import sys import posixpath import re import shutil import...
gpl-3.0
gauribhoite/personfinder
env/google_appengine/gen_protorpc.py
69
3127
#!/usr/bin/env python # # Copyright 2007 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 o...
apache-2.0
pombredanne/teamwork
w2/static/Brython2.0.0-20140209-164925/Lib/tokenize.py
728
24424
"""Tokenization help for Python programs. tokenize(readline) is a generator that breaks a stream of bytes into Python tokens. It decodes the bytes according to PEP-0263 for determining source file encoding. It accepts a readline-like method which is called repeatedly to get the next line of input (or b"" for EOF). ...
gpl-2.0
qt911025/pw_module_system
header_operations.py
2
141015
################################################### # header_operations.py # This file cfontains opcode declarations # DO NOT EDIT THIS FILE! ################################################### #----------------------------------------------------------------------------- # CONTROL OPERATIONS #------------------------...
bsd-3-clause
pahaz/fabtools
fabtools/require/users.py
1
1964
""" System users ============ """ from fabtools.files import is_file from fabtools.user import * import fabtools.require def user(name, comment=None, home=None, group=None, extra_groups=None, create_home=False, skeleton_dir=None, password=None, system=False, shell=None, uid=None): """ Require a user ...
bsd-2-clause
Kazade/NeHe-Website
google_appengine/lib/django_0_96/django/newforms/extras/widgets.py
32
2008
""" Extra HTML Widget classes """ from django.newforms.widgets import Widget, Select from django.utils.dates import MONTHS import datetime __all__ = ('SelectDateWidget',) class SelectDateWidget(Widget): """ A Widget that splits date input into three <select> boxes. This also serves as an example of a Wi...
bsd-3-clause
liuzzfnst/tp-libvirt
libvirt/tests/src/virsh_cmd/domain/virsh_setmem.py
7
14922
import re import os import logging import time from autotest.client.shared import error from virttest import virsh from virttest import utils_libvirtd from virttest import data_dir from virttest.utils_test import libvirt from virttest import utils_misc from virttest.libvirt_xml import vm_xml def manipulate_domain(vm_...
gpl-2.0
mrquim/repository.mrquim
plugin.video.poseidon/resources/lib/modules/tvmaze.py
4
4183
# -*- coding: utf-8 -*- ''' Poseidon Add-on Copyright (C) 2016 Poseidon 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) a...
gpl-2.0
frankvdp/django
django/utils/ipv6.py
129
1350
import ipaddress from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ def clean_ipv6_address(ip_str, unpack_ipv4=False, error_message=_("This is not a valid IPv6 address.")): """ Clean an IPv6 address string. Raise ValidationErr...
bsd-3-clause
noba3/KoTos
addons/script.module.youtube.dl/lib/youtube_dl/extractor/tagesschau.py
102
6530
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import parse_filesize class TagesschauIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tagesschau\.de/multimedia/(?:[^/]+/)*?[^/#?]+?(?P<id>-?[0-9]+)(?:~_[^/#?]+?)?\.html' _TESTS = [...
gpl-2.0
adrian-zumbler/IdealNews
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_openedgebuiltins.py
370
40661
# -*- coding: utf-8 -*- """ pygments.lexers._openedgebuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Builtin list for the OpenEdgeLexer. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ OPENEDGEKEYWORDS = [ 'ABSOLUTE', 'ABS', 'ABSO', 'A...
mit
hackerbot/DjangoDev
django/forms/fields.py
34
48292
""" Field classes. """ from __future__ import unicode_literals import copy import datetime import os import re import sys import uuid import warnings from decimal import Decimal, DecimalException from io import BytesIO from django.core import validators from django.core.exceptions import ValidationError # Provide th...
bsd-3-clause
upconsulting/IsisCB
isiscb/zotero/migrations/0026_auto_20200601_0013.py
1
4896
# Generated by Django 3.0.5 on 2020-06-01 00:13 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ('isisdata', '0091_auto_20200601_0...
mit
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_internal/download.py
7
33335
from __future__ import absolute_import import cgi import email.utils import getpass import json import logging import mimetypes import os import platform import re import shutil import sys from pip._vendor import requests, six, urllib3 from pip._vendor.cachecontrol import CacheControlAdapter from pip._vendor.cachecon...
apache-2.0
xin1195/smartSearch
test/hanzi.py
1
2343
#!/usr/bin/env python3 # _*_coding:utf-8_*_ # Created by "LiuXin" # Time import traceback import pymongo # text = """吖】ā[吖嗪](āqín)名有机化合物的一类,呈环状结构,含有一个或几个氮原子,如吡啶、哒嗪、嘧啶等。[英azine] # # 【阿】ā〈方〉前缀。①用在排行、小名或姓的前面,有亲昵的意味:~大|~宝|~唐。②用在某些亲属名称的前面:~婆|~爹|~哥。 # 另见2页•ɑ“啊”;354页ē。 # # 【阿鼻地狱】ābídìyù佛教指最深层的地狱,是犯了重罪的人死后灵魂永远受苦的地方。""" # fi...
apache-2.0
danlangridge/galah
galah/web/views/_api.py
1
7617
# Copyright 2012-2013 John Sullivan # Copyright 2012-2013 Other contributers as noted in the CONTRIBUTERS file # # This file is part of Galah. # # Galah 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, e...
agpl-3.0
muntasirsyed/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/in_/in_states.py
296
1859
""" A mapping of state misspellings/abbreviations to normalized abbreviations, and an alphabetical list of states for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ STATE_CHOICES = ( ('KA', 'Karnataka'), ('AP', 'Andhra Pr...
apache-2.0
oxtopus/nupic
nupic/regions/ImageSensorExplorers/RandomSweep.py
17
10407
# ---------------------------------------------------------------------- # 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...
gpl-3.0
Shekharrajak/django-db-mailer
dbmail/south_migrations/0034_auto__chg_field_mailgroupemail_email__chg_field_mailfromemail_email__c.py
2
19791
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'MailGroupEmail.email' db.alter_column('dbmail_mailgrou...
gpl-2.0
mateuszlis/color
tests/gmock-1.6.0/scripts/generator/cpp/keywords.py
1157
2004
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 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...
gpl-3.0
ehostunreach/qemu
scripts/tracetool/format/events_h.py
78
1406
#!/usr/bin/env python # -*- coding: utf-8 -*- """ trace/generated-events.h """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi"...
gpl-2.0
JRock007/boxxy
dist/Boxxy server.app/Contents/Resources/lib/python2.7/pygame/tests/surflock_test.py
5
5483
if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path.split(parent_dir)[1] == 'pygame') if not is_pygame_pkg: sys.pa...
mit
cldershem/osf.io
tests/test_utils.py
15
14688
# -*- coding: utf-8 -*- import os import mock import unittest from flask import Flask from nose.tools import * # noqa (PEP8 asserts) import datetime from tests.base import OsfTestCase from tests.factories import RegistrationFactory from framework.routing import Rule, json_renderer from framework.utils import secure_...
apache-2.0
akvo/akvo-rsr
akvo/rsr/management/commands/lock_unlock_periods.py
1
1998
# -*- coding: utf-8 -*- # Akvo Reporting is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. import sys from django.core.ma...
agpl-3.0
beiko-lab/gengis
bin/Lib/lib2to3/tests/data/py2_test_grammar.py
18
31954
# Python test set -- part 1, grammar. # This just tests whether the parser accepts them all. # NOTE: When you run this test as a script from the command line, you # get warnings about certain hex/oct constants. Since those are # issued by the parser, you can't suppress them by adding a # filterwarnings() call t...
gpl-3.0
thaim/ansible
lib/ansible/modules/cloud/vmware/vmware_guest_file_operation.py
23
20590
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Stéphane Travassac <stravassac@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metad...
mit
paramecio/parameciofm
paramecio/cromosoma/extrafields/slugifyfield.py
1
1059
#!/usr/bin/env python3 from paramecio.cromosoma.corefields import CharField from paramecio.citoplasma.slugify import slugify from paramecio.cromosoma.coreforms import HiddenForm class SlugifyField(CharField): def __init__(self, name, size=255, field_related=None, required=False): super(Slugi...
gpl-3.0
rs91092/subtitle-downloader
subtitle-downloader.py
1
4389
#------------------------------------------------------------------------------- # Name : subtitle downloader # Purpose : One step subtitle download # # Authors : manoj m j, arun shivaram p, Valentin Vetter, niroyb # Edited by : Valentin Vetter # Created : # Copyright : (c) www.manojmj.com # Licence : GPL ...
gpl-3.0
TobbeEdgeware/shaka-player
third_party/gjslint/closure_linter-2.3.13/closure_linter/scopeutil.py
25
5563
#!/usr/bin/env python # # Copyright 2012 The Closure Linter 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 # #...
apache-2.0
evshiron/shadowsocks
setup.py
929
1321
import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name="shadowsocks", version="2.8.2", license='http://www.apache.org/licenses/LICENSE-2.0', description="A fast tunnel proxy that help you get through firewalls", ...
apache-2.0
bmachiel/python-nport
smith/create_smith_plot.py
1
1537
""" Contains a convenience function to create a ready-made Smith plot """ # Major library imports from numpy import array, ndarray, transpose, real, imag from enthought.chaco.array_data_source import ArrayDataSource from enthought.chaco.data_range_1d import DataRange1D # Local relative imports from .smith_mapper imp...
gpl-3.0
jotacor/tradunio-web
app/tradunio/comunio_service.py
1
5174
#!/usr/bin/env python # -*- coding: utf-8 -*- from bs4 import BeautifulSoup as bs from datetime import date, timedelta, datetime import re from suds.client import Client from ..models import Player class Comunio: def __init__(self): self.client = Client(url='http://www.comunio.es/soapservice.php?wsdl') ...
mit
manishpatell/erpcustomizationssaiimpex123qwe
addons/delivery/__openerp__.py
113
1902
# -*- 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
bac/horizon
openstack_dashboard/usage/quotas.py
2
17368
# 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 # distributed under t...
apache-2.0
MiniLight/DeepCL
thirdparty/cogapp/cogapp/test_cogapp.py
10
66477
""" Test cogapp. http://nedbatchelder.com/code/cog Copyright 2004-2015, Ned Batchelder. """ from __future__ import absolute_import import os, os.path, random, re, shutil, stat, sys, tempfile # Use unittest2 if it's available, otherwise unittest. This gives us # back-ported features for 2.6. try: import...
mpl-2.0
Cinntax/home-assistant
homeassistant/components/switch/__init__.py
1
3209
"""Component to interface with switches that can be controlled remotely.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.loader import bind_hass from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity import ToggleEntity from ho...
apache-2.0
alec-heif/MIT-Thesis
spark-bin/python/pyspark/ml/param/shared.py
15
22317
# # 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 us...
mit
Asana/boto
tests/unit/beanstalk/test_layer1.py
114
6971
#!/usr/bin/env python import json from tests.unit import AWSMockServiceTestCase from boto.beanstalk.layer1 import Layer1 # These tests are just checking the basic structure of # the Elastic Beanstalk code, by picking a few calls # and verifying we get the expected results with mocked # responses. The integration t...
mit
nycholas/ask-undrgz
src/ask-undrgz/django/db/backends/postgresql/introspection.py
308
3725
from django.db.backends import BaseDatabaseIntrospection class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django Field types. data_types_reverse = { 16: 'BooleanField', 20: 'BigIntegerField', 21: 'SmallIntegerField', 23: 'IntegerField', 25: 'T...
bsd-3-clause
scifiswapnil/Project-LoCatr
lib/python2.7/site-packages/django/contrib/postgres/forms/ranges.py
132
3063
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange from django import forms from django.core import exceptions from django.forms.widgets import MultiWidget from django.utils.translation import ugettext_lazy as _ __all__ = ['IntegerRangeField', 'FloatRangeField', 'DateTimeRangeField', 'DateRangeField...
mit
xuanyuanking/spark
python/pyspark/pandas/data_type_ops/base.py
5
13688
# # 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 us...
apache-2.0
vincenzo/LIBSVM
python/svm.py
5
7768
#!/usr/bin/env python from ctypes import * from ctypes.util import find_library import sys # For unix the prefix 'lib' is not considered. if find_library('svm'): libsvm = CDLL(find_library('svm')) elif find_library('libsvm'): libsvm = CDLL(find_library('libsvm')) else: if sys.platform == 'win32': libsvm = CDLL('...
bsd-3-clause
harddevelop/jukebox
core/cipher.py
1
1196
from core.Cipher import DES from hashlib import md5 import hashlib import base64 import re import os ''' PBEWithMD5AndDES port based on ''' class PBEWithMD5AndDES(): @staticmethod def get_derived_key(password, salt, count): key = password + salt for i in range(count): m = hashlib....
gpl-2.0