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
cchurch/ansible
test/units/modules/storage/netapp/test_na_ontap_software_update.py
43
5876
# (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit tests ONTAP Ansible module: na_ontap_software_update ''' from __future__ import print_function import json import pytest from units.compat import unittest from units.compat.mock import patch,...
gpl-3.0
aviaryan/open-event-orga-server
migrations/versions/30ca70296a1c_.py
11
8271
"""empty message Revision ID: 30ca70296a1c Revises: None Create Date: 2015-12-20 17:54:59.544763 """ # revision identifiers, used by Alembic. revision = '30ca70296a1c' down_revision = None from alembic import op import sqlalchemy as sa import sqlalchemy_utils def upgrade(): ### commands auto generated by Alem...
gpl-3.0
krishna-pandey-git/django
django/contrib/auth/__init__.py
387
7508
import inspect import re from django.apps import apps as django_apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.middleware.csrf import rotate_token from django.utils.crypto import constant_time_compare from django.utils.module_loading import i...
bsd-3-clause
thresholdsoftware/asylum-v2.0
openerp/addons/auth_crypt/__init__.py
435
1050
############################################################################## # # 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 GNU Affero General Publ...
agpl-3.0
romain-intel/bcc
src/cc/frontends/p4/compiler/ebpfType.py
10
1117
# Copyright (c) Barefoot Networks, Inc. # Licensed under the Apache License, Version 2.0 (the "License") from compilationException import CompilationException class EbpfType(object): __doc__ = "Base class for representing a P4 type" def __init__(self, hlirType): self.hlirType = hlirType # Method...
apache-2.0
watonyweng/horizon
openstack_dashboard/dashboards/identity/projects/workflows.py
17
37664
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # 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...
apache-2.0
Rashminadig/SDN
ryu/contrib/ncclient/operations/session.py
82
1414
# Copyright 2009 Shikhar Bhushan # # 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 writin...
apache-2.0
lgautier/mashing-pumpkins
src/tests/test_parallel.py
1
6609
import pytest import mashingpumpkins.parallel from mashingpumpkins._murmurhash3 import hasharray, DEFAULT_SEED from mashingpumpkins.sequence import chunkpos_iter from mashingpumpkins import minhashsketch import random def test_sketch_initializer(): # empty initializer with pytest.raises(TypeError): ma...
mit
Bitl/RBXLegacy-src
Cut/RBXLegacyDiscordBot/lib/youtube_dl/extractor/myvi.py
36
2246
# coding: utf-8 from __future__ import unicode_literals import re from .vimple import SprutoBaseIE class MyviIE(SprutoBaseIE): _VALID_URL = r'''(?x) https?:// myvi\.(?:ru/player|tv)/ (?: (?: ...
gpl-3.0
pkmital/CADL
session-2/libs/gif.py
7
2381
"""Utility for creating a GIF. Creative Applications of Deep Learning w/ Tensorflow. Kadenze, Inc. Copyright Parag K. Mital, June 2016. """ import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation def build_gif(imgs, interval=0.1, dpi=72, save_gif=True, saveto='animat...
apache-2.0
petercable/xray
xray/test/test_plot.py
1
32894
import inspect import numpy as np import pandas as pd from xray import DataArray import xray.plot as xplt from xray.plot.plot import _infer_interval_breaks from xray.plot.utils import (_determine_cmap_params, _build_discrete_cmap, _color_palette) from . impo...
apache-2.0
unreal666/outwiker
plugins/source/source/pygments/lexers/erlang.py
6
18938
# -*- coding: utf-8 -*- """ pygments.lexers.erlang ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Erlang. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions, \ ...
gpl-3.0
chafique-delli/OpenUpgrade
addons/l10n_be/__init__.py
430
1060
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
google-code-export/pychess
testing/bitboard.py
21
1674
import unittest import random import operator from functools import reduce from pychess.Utils.lutils.bitboard import * class BitboardTestCase(unittest.TestCase): def setUp (self): self.positionSets = [] # Random positions. Ten of each length. Will also include range(64) and # range(0...
gpl-3.0
jhawkesworth/ansible
lib/ansible/modules/network/f5/bigip_device_auth_ldap.py
38
26870
#!/usr/bin/python # -*- 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
alissonperez/django-onmydesk
onmydesk/tests/test_commands.py
1
3564
from datetime import date from django.test import TestCase from io import StringIO from unittest import mock from django.core import management from onmydesk.models import Report, Scheduler class SchedulerProcesssTestCase(TestCase): def setUp(self): # Cleaning up reports Report.objects.all().de...
mit
EgideCorp/Cover
db.py
1
1710
import logging import aiomysql DB = "follow_the_white_rabbit" class Db: def __init__(self, connection): self.conn = connection self.logger = logging.getLogger(self.__module__) @classmethod async def create_db(cls, loop, user, password, host="127.0.0.1", port=3306): conn = await ...
gpl-3.0
slayher/android_kernel_samsung_zerofltetmo
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
Cenditel/cenditel.comunidades.cynin
src/ubify.cyninv2theme/ubify/cyninv2theme/portlets/spacemembersportlet.py
5
10508
############################################################################### #cyn.in is an open source Collaborative Knowledge Management Appliance that #enables teams to seamlessly work together on files, documents and content in #a secure central environment. # #cyn.in v2 an open source appliance is distrib...
gpl-3.0
lsinfo/odoo
addons/marketing_campaign/__init__.py
380
1087
# -*- 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
xuegang/gpdb
src/test/tinc/ext/unittest2/test/test_setups.py
111
16845
import sys from cStringIO import StringIO import unittest2 from unittest2.test.support import resultFactory class TestSetups(unittest2.TestCase): def getRunner(self): return unittest2.TextTestRunner(resultclass=resultFactory, stream=StringIO()) def runT...
apache-2.0
philgyford/django-spectator
tests/core/test_templatetags.py
1
9503
from distutils.version import StrictVersion from unittest.mock import Mock, patch from django import get_version from django.http import QueryDict from django.test import TestCase from .. import make_date from spectator.core.apps import Apps from spectator.core.templatetags.spectator_core import ( domain_urlize,...
mit
drpaneas/linuxed.gr
lib/python2.7/site-packages/pelican/tools/pelican_themes.py
31
7823
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import six import argparse import os import shutil import sys try: import pelican except: err('Cannot import pelican.\nYou must install Pelican in order to run this script.', -1) global _THEMES_PATH _THEME...
mit
chen2aaron/SnirteneCodes
PythonCookbookPractise/chapter8/delegating_attribute_access.py
1
2524
# 8.15. Delegating Attribute Access class A: def spam(self, x): pass def foo(self): pass class B1: """简单的代理""" def __init__(self): self._a = A() def spam(self, x): # Delegate to the internal self._a instance return self._a.spam(x) def foo(self): ...
gpl-2.0
cfossace/crits
crits/indicators/migrate.py
13
3846
from crits.core.crits_mongoengine import EmbeddedCampaign def migrate_indicator(self): """ Migrate to the latest schema version. """ migrate_2_to_3(self) def migrate_2_to_3(self): """ Migrate from schema 2 to 3. """ if self.schema_version < 2: migrate_1_to_2(self) if sel...
mit
lem9/weblate
weblate/wladmin/tests.py
1
4790
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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, eith...
gpl-3.0
NoyaInRain/tornado
maint/vm/windows/bootstrap.py
8
3262
#!/usr/bin/env python r"""Installs files needed for tornado testing on windows. These instructions are compatible with the VMs provided by http://modern.ie. The bootstrapping script works on the WinXP/IE6 and Win8/IE10 configurations, although tornado's tests do not pass on XP. 1) Install virtualbox guest additions ...
apache-2.0
Teagan42/home-assistant
homeassistant/util/logging.py
5
7075
"""Logging utilities.""" import asyncio from asyncio.events import AbstractEventLoop from functools import partial, wraps import inspect import logging import threading import traceback from typing import Any, Callable, Coroutine, Optional class HideSensitiveDataFilter(logging.Filter): """Filter API password call...
apache-2.0
StevenAston/donkbot
plugins/bf.py
11
2474
'''brainfuck interpreter adapted from (public domain) code at http://brainfuck.sourceforge.net/brain.py''' import re import random from util import hook BUFFER_SIZE = 5000 MAX_STEPS = 1000000 @hook.command def bf(inp): ".bf <prog> -- executes brainfuck program <prog>""" program = re.sub('[^][<>+-.,]', ''...
unlicense
shifter/rekall
rekall-core/rekall/plugins/darwin/WKdm.py
8
11479
# Rekall Memory Forensics # # Copyright 2014 Google Inc. All Rights Reserved. # # 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 v...
gpl-2.0
ColinIanKing/autotest
client/partition_unittest.py
6
6045
#!/usr/bin/python """Tests for autotest.client.partition.""" __author__ = 'gps@google.com (Gregory P. Smith)' import os, sys, unittest from cStringIO import StringIO try: import autotest.common as common except ImportError: import common from autotest.client.shared.test_utils import mock from autotest.client...
gpl-2.0
bop/hybrid
lib/python2.6/site-packages/setuptools/command/rotate.py
285
2062
import distutils, os from setuptools import Command from setuptools.compat import basestring from distutils.util import convert_path from distutils import log from distutils.errors import * class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N newest file...
gpl-2.0
Kubuxu/cjdns
node_build/dependencies/libuv/build/gyp/test/mac/gyptest-ldflags.py
100
2078
#!/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 that filenames passed to various linker flags are converted into build-directory relative paths correctly. """ import TestGyp ...
gpl-3.0
vasyvas/deepdive
examples/chunking/udf/ext_features.py
15
1120
#! /usr/bin/env python import fileinput import json import itertools import sys def tostr(s): # In TSV extractor, '\N' is NULL in psql, 'NULL' is NULL in mysql return '' if s is None or s in ['\N', 'NULL'] else str(s) # for each word for row in sys.stdin: # obj = json.loads(row) word_...
apache-2.0
UpYou/relay
my_gnuradio/gr/benchmark_filters.py
17
2672
#!/usr/bin/env python # # Copyright 2005,2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at you...
gpl-3.0
titasakgm/dsimapcloud
js/tools/shrinksafe.py
293
1498
#!/usr/bin/env python # # Script to provide a wrapper around the ShrinkSafe "web service" # <http://shrinksafe.dojotoolkit.org/> # # # We use this script for two reasons: # # * This avoids having to install and configure Java and the standalone # ShrinkSafe utility. # # * The current ShrinkSafe standalone utility...
gpl-3.0
pmisik/buildbot
master/buildbot/util/backoff.py
2
2713
# 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
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/unittest/test/test_runner.py
37
8609
import unittest from cStringIO import StringIO import pickle from unittest.test.support import (LoggingResult, ResultWithNoStartTestRunStopTestRun) class TestCleanUp(unittest.TestCase): def testCleanUp(self): class TestableTest(unittest.TestCase): def test...
bsd-3-clause
Lingotek/filesystem-connector
python3/ltk/actions/status_action.py
2
8811
from ltk.actions.action import * from tabulate import tabulate class StatusAction(Action): def __init__(self, path): Action.__init__(self, path) self.uploadWaitTime = 300 def get_status(self, **kwargs): try: doc_name = None detailed = False if 'deta...
mit
bhargavz/py-twitter-sentiment-analysis
twitter/FriendsFollowers.py
1
11654
#!/usr/bin/python # -*- coding: utf-8 -*- # # FILE: FriendsFollowers.py # # Object to request friends and followers of the specified user. This request # requires cursoring. This really requires throttling because of the number of # friends/followers are very large. Therefore, throttling this on by default. #...
mit
crosswalk-project/chromium-crosswalk-efl
chrome/common/extensions/docs/server2/servlet.py
34
4476
# 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. class RequestHeaders(object): '''A custom dictionary impementation for headers which ignores the case of requests, since different HTTP libraries seem t...
bsd-3-clause
maxkoryukov/headphones
lib/unidecode/x0b3.py
253
4741
data = ( 'dae', # 0x00 'daeg', # 0x01 'daegg', # 0x02 'daegs', # 0x03 'daen', # 0x04 'daenj', # 0x05 'daenh', # 0x06 'daed', # 0x07 'dael', # 0x08 'daelg', # 0x09 'daelm', # 0x0a 'daelb', # 0x0b 'daels', # 0x0c 'daelt', # 0x0d 'daelp', # 0x0e 'daelh', # 0x0f 'daem', # ...
gpl-3.0
zakandrewking/cobrapy
cobra/util/version_info.py
1
1926
# -*- coding: utf-8 -*- # Adapated from: # https://github.com/pandas-dev/pandas/blob/master/pandas/util/_print_versions.py # which is published under a BSD license. from __future__ import absolute_import, print_function from builtins import dict import platform import pip __all__ = ("show_versions",) SYS_ORDER =...
lgpl-2.1
alanjw/GreenOpenERP-Win-X86
openerp/addons/base/module/wizard/base_module_update.py
109
2185
# -*- 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
dalegregory/odoo
addons/account_anglo_saxon/product.py
384
3035
############################################################################## # # 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 GNU Affero General Publ...
agpl-3.0
asm0dey/Flexget
flexget/plugins/urlrewrite_torrentleech.py
5
6624
from __future__ import unicode_literals, division, absolute_import import re import urllib import logging from flexget import plugin from flexget.config_schema import one_or_more from flexget.entry import Entry from flexget.event import event from flexget.plugins.plugin_urlrewriting import UrlRewritingError from flexg...
mit
TeslaProject/external_chromium_org
ppapi/generators/idl_thunk.py
44
20936
#!/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. """ Generator for C++ style thunks """ import glob import os import re import sys from idl_log import ErrOut, InfoOut, WarnOut fr...
bsd-3-clause
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.2/Lib/encodings/mac_centeuro.py
257
14102
""" Python Character Mapping Codec mac_centeuro generated from 'MAPPINGS/VENDORS/APPLE/CENTEURO.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
mit
SimtterCom/gyp
test/builddir/gyptest-all.py
185
2706
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verify the settings that cause a set of programs to be created in a specific build directory, and that no intermediate built files get c...
bsd-3-clause
DMLoy/ECommerceBasic
lib/python2.7/site-packages/django/utils/feedgenerator.py
73
15643
""" Syndication feed generation library -- used for generating RSS, etc. Sample usage: >>> from django.utils import feedgenerator >>> feed = feedgenerator.Rss201rev2Feed( ... title="Poynter E-Media Tidbits", ... link="http://www.poynter.org/column.asp?id=31", ... description="A group Weblog by the sharpes...
mit
qliu/mhcdashboard
mhcdashboard/mhcdashboardapp/migrations/0023_auto_20150302_1022.py
2
1169
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mhcdashboardapp', '0022_auto_20150302_1019'), ] operations = [ migrations.AddField( model_name='organizationacti...
gpl-2.0
jack6215/kafka
kafka-patch-review.py
71
8273
#!/usr/bin/env python # # 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 # "...
apache-2.0
alfa-addon/addon
plugin.video.alfa/lib/cloudscraper/interpreters/jsunfuck.py
3
3603
MAPPING = { 'a': '(false+"")[1]', 'b': '([]["entries"]()+"")[2]', 'c': '([]["fill"]+"")[3]', 'd': '(undefined+"")[2]', 'e': '(true+"")[3]', 'f': '(false+"")[0]', 'g': '(false+[0]+String)[20]', 'h': '(+(101))["to"+String["name"]](21)[1]', 'i': '([false]+undefined)[10]', ...
gpl-3.0
ML-KULeuven/socceraction
tests/spadl/test_opta.py
1
8597
import os import pandas as pd import pytest import socceraction.spadl.config as spadlcfg from socceraction.spadl import opta as opta from socceraction.spadl.base import SPADLSchema from socceraction.spadl.opta import ( OptaCompetitionSchema, OptaEventSchema, OptaGameSchema, OptaPlayerSchema, OptaT...
mit
Endika/odoo
addons/hr_timesheet_invoice/report/__init__.py
433
1136
# -*- 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
amyhoo/django-oscar-alipay
alipay/conf.py
2
5941
# -*- coding:utf-8 -*- ####################################################################################### #淘宝接口参数意义 ####################################################################################### from django.conf import settings # 合作者身份 ID,以 2088 开头的 16 位纯数字组成 ALIPAY_PARTNER = '' # 支付宝网关 ALIPAY_GATEWAY =...
bsd-3-clause
ganeti-github-testing/ganeti-test-1
lib/utils/process.py
3
31604
# # # Copyright (C) 2006, 2007, 2010, 2011, 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: # # 1. Redistributions of source code must retain the above copyright notice, # this...
bsd-2-clause
igors10099/ilona
p2pool/bitcoin/p2p.py
36
5880
''' Implementation of Bitcoin's p2p protocol ''' import random import sys import time from twisted.internet import protocol, task import p2pool from . import data as bitcoin_data from p2pool.util import deferral, p2protocol, pack, variable class Protocol(p2protocol.Protocol): def __init__(self, net): p2...
gpl-3.0
reflectometry/direfl
direfl/api/sld_profile.py
1
8500
import cmath from math import pi, ceil import numpy as np from numpy import sin, cos from scipy.interpolate import interp1d """ References: [Majkrzak2003] C. F. Majkrzak, N. F. Berk: Physica B 336 (2003) 27-38 Phase sensitive reflectometry and the unambiguous determination of scattering leng...
mit
wataro/midso
rule/cpplint.py
163
241895
#!/usr/bin/env python # # Copyright (c) 2009 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...
mit
jrversteegh/softsailor
deps/numpy-1.6.1/numpy/core/tests/test_getlimits.py
24
1761
""" Test functions for limits module. """ from numpy.testing import * from numpy.core import finfo, iinfo from numpy import half, single, double, longdouble import numpy as np ################################################## class TestPythonFloat(TestCase): def test_singleton(self): ftype = finfo(floa...
gpl-3.0
fluks/youtube-dl
youtube_dl/extractor/mitele.py
22
2277
from __future__ import unicode_literals import json from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urlparse, ) from ..utils import ( get_element_by_attribute, parse_duration, strip_jsonp, ) class MiTeleIE(InfoExtractor): IE_NAME = 'mitele.es' _VALID_...
unlicense
spectralDNS/shenfun
demo/Gray_Scott_fractal.py
1
4395
r""" Solve Gray-Scott's equations on (-1, 1)x(-1, 1) with periodic bcs. The equations to solve are u_t = -e1*(-div(grad(u)))**(alpha1/2) + b*(1-u) - u*v**2 (1) v_t = -e2*(-div(grad(v)))**(alpha2/2) - (b+kappa)*v + u*v**2 (2) Using Fourier basis F and a vector tensor product space for u and ...
bsd-2-clause
Hehwang/Leetcode-Python
code/593 Valid Square.py
1
1345
class Solution: def validSquare(self, p1, p2, p3, p4): """ :type p1: List[int] :type p2: List[int] :type p3: List[int] :type p4: List[int] :rtype: bool """ list1=[p2,p3,p4] length_list=[] vector_list=[] for i in range(3...
mit
AXAz0r/apex-sigma
sigma/plugins/moderation/permissions/unpermitrole.py
2
3448
import discord from sigma.core.permission import check_admin from .nodes.permission_data import get_all_perms, generate_cmd_data from sigma.core.rolecheck import matching_role async def unpermitrole(cmd, message, args): if args: if len(args) >= 2: if not check_admin(message.author, message.cha...
gpl-3.0
mcanthony/rethinkdb
scripts/generate_serialize_macros.py
29
9043
#!/usr/bin/env python # Copyright 2010-2014 RethinkDB, all rights reserved. import sys """This script is used to generate the RDB_MAKE_SERIALIZABLE_*() and RDB_MAKE_ME_SERIALIZABLE_*() macro definitions. Because there are so many variations, and because they are so similar, it's easier to just have a Python script to ...
agpl-3.0
b-dollery/testing
v2/ansible/playbook/handler.py
13
1256
# (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
terrychenism/shadowsocks
shadowsocks/encrypt.py
990
5180
#!/usr/bin/env python # # Copyright 2012-2015 clowwindy # # 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 la...
apache-2.0
strogo/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Tool/hplink.py
61
2390
"""SCons.Tool.hplink Tool-specific initialization for the HP linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foun...
apache-2.0
rex-xxx/mt6572_x201
external/webkit/Tools/TestResultServer/handlers/testfilehandler.py
15
8734
# 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 the ...
gpl-2.0
smart-m3/sib-daemon
python/wilbur_m3.py
1
20587
# Copyright (c) 2009, Nokia Corporation # 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 l...
gpl-2.0
ibab/tensorflow
tensorflow/contrib/linear_optimizer/python/kernel_tests/sdca_ops_test.py
8
30879
# Copyright 2016 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
mitsuhiko/babel
scripts/make-release.py
4
4149
#!/usr/bin/env python # -*- coding: utf-8 -*- """ make-release ~~~~~~~~~~~~ Helper script that performs a release. Does pretty much everything automatically for us. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys import os import re from dat...
bsd-3-clause
ryano144/intellij-community
python/lib/Lib/pydoc.py
69
90393
#!/usr/bin/env python # -*- coding: Latin-1 -*- """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide online help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydo...
apache-2.0
matmutant/sl4a
python/src/Lib/test/mapping_tests.py
56
22395
# tests common to dict and UserDict import unittest import UserDict class BasicTestMappingProtocol(unittest.TestCase): # This base class can be used to check that an object conforms to the # mapping protocol # Functions that can be useful to override to adapt to dictionary # semantics type2test =...
apache-2.0
udrg/kalibr
aslam_offline_calibration/kalibr/python/kalibr_common/ImageDatasetReader.py
3
5820
import cv_bridge import cv2 import rosbag import os import numpy as np import pylab as pl import aslam_cv as acv import sm class BagImageDatasetReaderIterator(object): def __init__(self, dataset, indices=None): self.dataset = dataset if indices is None: self.indices = np.arange(dataset.numImages()) ...
bsd-3-clause
muffinresearch/addons-server
scripts/xpitool.py
25
1149
#!/usr/bin/env python import optparse import os import subprocess def main(): p = optparse.OptionParser( usage='%prog [options] [-x addon-1.0.xpi] [-c /path/to/addon-1.0/]') p.add_option('-x', '--extract', help='Extracts xpi into current directory', action='store_true...
bsd-3-clause
PairMhai/Backend
membership/admin.py
1
3760
from django.contrib import admin from .models import Customer, Class, User from payment.models import CreditCard from allauth.account.models import EmailAddress # ------------------------------------- # custom auth user # ------------------------------------- from django import forms from django.contrib.auth.admin im...
agpl-3.0
kevcooper/bitcoin
test/functional/bumpfee.py
1
13631
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the bumpfee RPC. Verifies that the bumpfee RPC creates replacement transactions successfully when its ...
mit
lthurlow/Boolean-Constrained-Routing
networkx-1.8.1/build/lib.linux-i686-2.7/networkx/classes/digraph.py
23
39533
"""Base class for directed graphs.""" # Copyright (C) 2004-2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. from copy import deepcopy import networkx as nx from networkx.classes.graph import Graph from ne...
mit
fedspendingtransparency/data-act-validator
tests/jobTests.py
1
11842
from __future__ import print_function from dataactcore.models.jobModels import JobDependency from dataactvalidator.models.validationModels import Rule from baseTest import BaseTest import unittest class JobTests(BaseTest): @classmethod def setUpClass(cls): """Set up class-wide resources (test data)"""...
cc0-1.0
bjuvensjo/scripts
vang/azdo/get_project.py
1
2787
#!/usr/bin/env python3 import argparse import logging from json import loads from os import environ from os.path import basename from pprint import pprint from sys import argv from typing import Dict from requests import get from vang.azdo.list_projects import list_projects logging.basicConfig(level=logging.ERROR) l...
apache-2.0
bayespy/bayespy
bayespy/demos/lssm.py
5
10690
################################################################################ # Copyright (C) 2013-2014 Jaakko Luttinen # # This file is licensed under the MIT License. ################################################################################ """ Demonstrate linear Gaussian state-space model. Some of the f...
mit
yencarnacion/jaikuengine
.google_appengine/lib/django-1.4/django/core/management/validation.py
79
19846
import sys from django.core.management.color import color_style from django.utils.itercompat import is_iterable class ModelErrorCollection: def __init__(self, outfile=sys.stdout): self.errors = [] self.outfile = outfile self.style = color_style() def add(self, context, error): ...
apache-2.0
EPDCenter/android_kernel_archos_97_titan
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
AltSchool/django-allauth
allauth/socialaccount/providers/linkedin/views.py
1
2354
from xml.etree import ElementTree from xml.parsers.expat import ExpatError from allauth.compat import six from allauth.socialaccount import providers from allauth.socialaccount.providers.oauth.client import OAuth from allauth.socialaccount.providers.oauth.views import ( OAuthAdapter, OAuthCallbackView, OAu...
mit
santoshbanda/mysql-5.6
xtrabackup/test/python/testtools/tests/test_compat.py
62
9528
# Copyright (c) 2010 testtools developers. See LICENSE for details. """Tests for miscellaneous compatibility functions""" import linecache import os import sys import tempfile import traceback import testtools from testtools.compat import ( _b, _detect_encoding, _get_source_encoding, _u, unicode...
gpl-2.0
barseghyanartur/oauth2app
tests/testsite/apps/api/tests/granttype.py
4
1894
#-*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json from base64 import b64encode from django.utils import unittest from django.contrib.auth.models import User from oauth2app.models import Client from django.test.client import Client as DjangoTestClient USER_USERNAME = "testuser" USE...
mit
gnowledge/ISON
objectapp/settings.py
3
6704
# Copyright (c) 2011, 2012 Free Software Foundation # 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 vers...
agpl-3.0
bboalimoe/ndn-cache-policy
docs/sphinx-contrib/erlangdomain/test/conf.py
3
7112
# -*- coding: utf-8 -*- # # sphinxcontrib-rubydomain-acceptancetest documentation build configuration file, created by # sphinx-quickstart on Sun Apr 25 13:27:18 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in th...
gpl-3.0
Observer-Wu/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/model/svnrevision.py
143
1735
# 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 the...
bsd-3-clause
systers/mailman
src/mailman/rules/tests/test_moderation.py
4
5825
# Copyright (C) 2014-2015 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
gpl-3.0
hujiajie/chromium-crosswalk
tools/telemetry/telemetry/internal/platform/profiler/v8_profiler.py
19
1768
# 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 logging import re import tempfile from telemetry.internal.platform import profiler class V8Profiler(profiler.Profiler): _V8_ARG = '--js-flags=--...
bsd-3-clause
highweb-project/highweb-webcl-html5spec
tools/perf/profile_creators/profile_extender.py
3
5213
# 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 copy from telemetry.core import platform from telemetry.util import wpr_modes from telemetry.internal.browser import browser_finder from telemetry.in...
bsd-3-clause
da1z/intellij-community
python/helpers/pycharm/nose_helper/util.py
85
6390
"""Utility functions and classes used by nose internally. """ import inspect import os import sys import types try: # for python 3 from types import ClassType, TypeType class_types = (ClassType, TypeType) except: class_types = (type, ) try: #for jython from compiler.consts import CO_GENERATOR e...
apache-2.0
4eek/edx-platform
common/djangoapps/student/migrations/0045_add_trk_partner_to_linkedin_config.py
102
14314
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'LinkedInAddToProfileConfiguration.trk_partner_name' db.add_column('student_linkedinaddtoprof...
agpl-3.0
Arcanemagus/plexpy
lib/tzlocal/windows_tz.py
13
31191
# This file is autogenerated by the update_windows_mapping.py script # Do not edit. win_tz = {'AUS Central Standard Time': 'Australia/Darwin', 'AUS Eastern Standard Time': 'Australia/Sydney', 'Afghanistan Standard Time': 'Asia/Kabul', 'Alaskan Standard Time': 'America/Anchorage', 'Aleutian Standard Time': 'America/...
gpl-3.0
markflyhigh/incubator-beam
sdks/python/apache_beam/transforms/cy_combiners.py
2
10475
# # 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
scrapinghub/exporters
exporters/transform/flatson_transform.py
1
1030
from exporters.transform.base_transform import BaseTransform class FlatsonTransform(BaseTransform): """ It flatten a JSON-like dataset into flat CSV-like tables using the Flatson library, please refer to Flatson `official documentation <http://flatson.readthedocs.io/en/latest/readme.html>`_. ...
bsd-3-clause
fenginx/django
django/core/management/commands/showmigrations.py
41
5855
import sys from django.apps import apps from django.core.management.base import BaseCommand from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.loader import MigrationLoader class Command(BaseCommand): help = "Shows all available migrations for the current project" def add_argument...
bsd-3-clause