repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
rep/certificate-transparency
python/ct/cert_analysis/algorithm_test.py
6
3138
#!/usr/bin/env python import unittest import mock import time from ct.cert_analysis import algorithm from ct.cert_analysis import base_check_test from ct.crypto.asn1 import oid from ct.crypto.asn1 import x509_common FAKE_SHA1_IDENTIFIER = mock.Mock(return_value= x509_common.AlgorithmIdentifier({"algorithm": oi...
apache-2.0
fengxiaoiie/volatility
volatility/plugins/linux/enumerate_files.py
12
2031
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
gpl-2.0
stefanstrogin/linux
tools/perf/scripts/python/sctop.py
1996
2102
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
caisq/tensorflow
tensorflow/python/feature_column/feature_column_v2_test.py
6
269665
# 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
UK992/servo
tests/wpt/web-platform-tests/tools/third_party/pywebsocket3/mod_pywebsocket/__init__.py
29
6145
# Copyright 2011, 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 f...
mpl-2.0
shuquan/leetcode
medium/combination-sum-iii/python/combination_sum_iii.py
1
1638
class Solution(object): def combinationSum3(self, k, n): """ :type k: int :type n: int :rtype: List[List[int]] """ # Use recursion to resolve the problem # The algorithm complexity is high due to it has to iterate from one # for each call given k, n. ...
apache-2.0
grembo/buildbot
master/buildbot/test/util/endpoint.py
10
4272
# 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
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/scipy/linalg/_matfuncs_sqrtm.py
77
5867
""" Matrix square root for general matrices and for upper triangular matrices. This module exists to avoid cyclic imports. """ from __future__ import division, print_function, absolute_import __all__ = ['sqrtm'] import numpy as np from scipy._lib._util import _asarray_validated # Local imports from .misc import ...
apache-2.0
balticembedded/be-kernel
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
vybstat/scikit-learn
sklearn/externals/joblib/parallel.py
79
35628
""" Helpers for embarrassingly parallel code. """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause from __future__ import division import os import sys import gc import warnings from math import sqrt import functools import time import thr...
bsd-3-clause
GStreamer/cerbero
test/test_cerbero_build_filesprovider.py
4
4885
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
SLongofono/448_Project4
mutatorTest.py
1
3874
import os,sys,inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) import Mutators def getUniquesTest(): print "Testing getUniques Function..." knownUniques = [0,99,8000] l1 = [1,2,3,4,5,6,7,8,9...
mit
rosenvladimirov/odoo-fixes
account_analytic_plans/wizard/__init__.py
445
1117
# -*- 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
duqiao/django
tests/managers_regress/tests.py
264
8342
from __future__ import unicode_literals from django.apps import apps from django.db import models from django.template import Context, Template from django.test import TestCase, override_settings from django.utils.encoding import force_text from .models import ( AbstractBase1, AbstractBase2, AbstractBase3, Child1...
bsd-3-clause
hfp/tensorflow-xsmm
tensorflow/contrib/learn/python/learn/session_run_hook.py
42
1334
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
glemaitre/UnbalancedDataset
imblearn/under_sampling/prototype_generation/cluster_centroids.py
2
7740
"""Class to perform under-sampling by generating centroids based on clustering.""" # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # Fernando Nogueira # Christos Aridas # License: MIT from __future__ import division, print_function import numpy as np from scipy import sparse from sklearn.cl...
mit
noba3/KoTos
addons/plugin.video.mega/resources/lib/platform_libraries/Linux/arm/Crypto/Hash/SHA.py
123
2841
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
gpl-2.0
kopiro/titanium_mobile
support/iphone/tools.py
34
8313
import os, sys, codecs, shutil, filecmp, subprocess # the template_dir is the path where this file lives on disk template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename)) def ensure_dev_path(debug=True): rc = subprocess.call(["xcode-select", "-print-path"], stdout=open(os.devnull, 'w'), s...
apache-2.0
ericlyf/screenly-tools-schedulespreadsheet
src/model/Asset.py
1
1601
''' Created on 11May,2016 @author: linyufeng ''' from utils.TimeZoneConverter import TimeZoneConverter class Asset(object): ''' contain the values will be insert into table Asset ''' convert = TimeZoneConverter(); def __init__(self, startTime, endTime, directory, fileName, fileType, duration...
gpl-3.0
sjfloat/youtube-dl
youtube_dl/extractor/thvideo.py
151
3033
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( unified_strdate ) class THVideoIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?thvideo\.tv/(?:v/th|mobile\.php\?cid=)(?P<id>[0-9]+)' _TEST = { 'url': 'http://thvideo.tv/v/...
unlicense
HybridF5/jacket
jacket/api/compute/openstack/compute/lock_server.py
1
2432
# Copyright 2011 OpenStack Foundation # Copyright 2013 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 requir...
apache-2.0
Glignos/inspire-next
inspirehep/utils/normalizers.py
4
1560
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
gpl-3.0
matthiascy/panda3d
direct/src/showbase/ContainerLeakDetector.py
8
50251
from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.PythonUtil import makeFlywheelGen from direct.showbase.PythonUtil import itype, serialNum, safeRepr, fastRepr from direct.showbase.Job import Job import types, weakref, random, __builtin__ def _createContainerLeak(): def leakConta...
bsd-3-clause
guanxi55nba/db-improvement
pylib/cqlshlib/test/test_cqlsh_invocation.py
160
1941
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
gkoh/pynab
scripts/nzedb_pre_import.py
2
7655
""" Pynab nzedb pre import Imports pre files from nzedb dropbox Usage: nzedb_pre_import.py large|small Options: -h --help Show this screen. --version Show version. """ # This is quite possibly the most hilariously complex import process... # What I can gather as the column name...
gpl-2.0
bukzor/sympy
sympy/printing/octave.py
52
22542
""" Octave (and Matlab) code printer The `OctaveCodePrinter` converts SymPy expressions into Octave expressions. It uses a subset of the Octave language for Matlab compatibility. A complete code generator, which uses `octave_code` extensively, can be found in `sympy.utilities.codegen`. The `codegen` module can be us...
bsd-3-clause
jbbskinny/sympy
sympy/concrete/tests/test_delta.py
87
23654
from sympy.concrete import Sum from sympy.concrete.delta import deltaproduct as dp, deltasummation as ds from sympy.core import Eq, S, symbols, oo from sympy.functions import KroneckerDelta as KD, Piecewise, piecewise_fold from sympy.logic import And i, j, k, l, m = symbols("i j k l m", integer=True, finite=True) x, y...
bsd-3-clause
eugena/django
django/contrib/auth/middleware.py
258
5718
from django.contrib import auth from django.contrib.auth import load_backend from django.contrib.auth.backends import RemoteUserBackend from django.core.exceptions import ImproperlyConfigured from django.utils.functional import SimpleLazyObject def get_user(request): if not hasattr(request, '_cached_user'): ...
bsd-3-clause
outofbits/tracker
tests/functional-tests/unittest2/__init__.py
5
2432
#!/usr/bin/python """ unittest2 unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7. It is tested to run on Python 2.4 - 2.6. To use unittest2 instead of unittest simply replace ``import unittest`` with ``import unittest2``. Copyright (c) 1999-2003 Steve Purcell Copyri...
lgpl-2.1
matteomattei/RemoteCommander
remotecommander.py
1
7055
#!/usr/bin/env python """ This program open a simple dialog that allows to issue a command to a remote server using SSH. It needs a configuration file called remotecommander.ini with the following structure: [GENERAL] Host = 127.0.0.1 Port = 22 User = root Password = xxxxx Command = shutdown -h now Comman...
mit
kalxas/QGIS
tests/src/python/test_qgsdatabaseschemamodel.py
32
10288
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsDatabaseSchemaModel .. 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
JackKelly/neuralnilm_prototype
scripts/e288.py
2
5039
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mit
joequery/django
tests/generic_relations_regress/models.py
269
5666
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models.deletion import ProtectedError from django.utils.encoding import python_2_unicode_compatible __all__ = ('Link', 'Place...
bsd-3-clause
TheoChevalier/bedrock
bin/cron.py
1
3478
#!/usr/bin/env python from __future__ import print_function, unicode_literals import datetime import os import sys from subprocess import check_call import requests from apscheduler.schedulers.blocking import BlockingScheduler from decouple import config from pathlib2 import Path schedule = BlockingScheduler() DEA...
mpl-2.0
neiudemo1/django
tests/inspectdb/models.py
208
2737
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.db import models class People(models.Model): name = models.CharField(max_length=255) parent = models.ForeignKey('self', models.CASCADE) class Message(models.Model): from_field = models.ForeignKey(People, models.CASCADE, db_co...
bsd-3-clause
dbertha/odoo
addons/decimal_precision/__init__.py
450
1128
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
mateoqac/unqTip
gui/views/boardPrint/resources.py
4
554087
# -*- coding: utf-8 -*- # Resource object code # # Created: Thu Mar 13 17:14:29 2014 # by: The Resource Compiler for PyQt (Qt v4.8.1) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x02\x18\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x...
gpl-3.0
rchlin/ShadowsocksFork
utils/autoban.py
1033
2156
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2015 clowwindy # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to u...
apache-2.0
hlt-mt/tensorflow
tensorflow/python/lib/io/tf_record.py
11
2450
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
unreal666/outwiker
plugins/source/source/pygments/lexers/testing.py
6
10752
# -*- coding: utf-8 -*- """ pygments.lexers.testing ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for testing languages. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups from pygments.token imp...
gpl-3.0
gundalow/ansible-modules-core
utilities/logic/debug.py
50
2304
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers <dag@wieers.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
bvisness/the-blue-alliance
tests/test_validation_helper.py
4
1304
import unittest2 from helpers.validation_helper import ValidationHelper class TestValidationHelper(unittest2.TestCase): def testTeamValidation(self): errors = ValidationHelper.validate([("team_id_validator", "frc01")]) self.assertEqual(errors, {"Errors": [{"team_id": "frc01 is not a valid team id...
mit
sonali0901/zulip
bots/zephyr_mirror_backend.py
2
48331
#!/usr/bin/env python # Copyright (C) 2012 Zulip, Inc. # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, m...
apache-2.0
anirudhSK/chromium
tools/telemetry/telemetry/page/actions/play_unittest.py
2
5037
# 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. from telemetry.core import util from telemetry.page.actions import play from telemetry.unittest import tab_test_case AUDIO_1_PLAYING_CHECK = 'window.__hasEv...
bsd-3-clause
wbond/csrbuilder
dev/_import.py
7
3279
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import imp import sys import os from . import build_root, package_name, package_root if sys.version_info < (3,): getcwd = os.getcwdu else: getcwd = os.getcwd def _import_from(mod, path, mod_dir=None, allow_er...
mit
ehwhydubya/pywords
words/words.py
1
9231
#! /usr/bin/env python import requests from pprint import pprint class Words(object): """A class that interfaces with the Words API at https://wordsapi.com""" pretty_print_error = ValueError('You must enter \'on\' or \'off\' to toggle the pretty print setting. Please enter a valid input.') detail_error ...
mit
Observer-Wu/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/path_unittest.py
124
3544
# 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 f...
bsd-3-clause
provaleks/o8
addons/website_certification/certification.py
385
1789
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
Raphux/passhport
passhportd/app/views_mod/target/target.py
1
26601
# -*-coding:Utf-8 -*- from flask import request from sqlalchemy import exc, and_ from sqlalchemy.orm import sessionmaker from app import app, db from app.models_mod import user, target, usergroup, exttargetaccess, passentry from . import api from subprocess import Popen, PIPE from datetime import datetime, timedelta im...
agpl-3.0
Elandril/SickRage
lib/github/tests/NamedUser.py
39
9973
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
AaronLieberman/ArduinoTinkering
FFTTest/FFTTest2-pi.py
1
2594
import numpy as np import math import wave import struct import time import wave import alsaaudio as aa import decoder import signal import sys import curses stdscr = curses.initscr() curses.cbreak() curses.noecho() curses.curs_set(0) stdscr.keypad(1) height = 16 def drawData(data, x, y): for i in range(len(data...
mit
dtroyer/python-openstacksdk
openstack/tests/functional/object_store/v1/test_obj.py
4
5971
# 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
allspark2020/S-Duos-Odin-Kernel
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
nwchandler/ansible
test/units/modules/network/netscaler/test_netscaler_server.py
47
23309
# Copyright (c) 2017 Citrix Systems # # 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. # # ...
gpl-3.0
quangounet/TOPP
src/python/Errors.py
1
1850
# -*- coding: utf-8 -*- # Copyright (C) 2013 Stéphane Caron <caron@ynl.t.u-tokyo.ac.jp> # # This file is part of the Time-Optimal Path Parameterization (TOPP) library. # TOPP is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free ...
lgpl-3.0
indashnet/InDashNet.Open.UN2000
android/bionic/libc/kernel/tools/cpp.py
5
74831
# a glorified C pre-processor parser import sys, re, string from utils import * from defaults import * debugTokens = False debugDirectiveTokenizer = False debugLineParsing = False debugCppExpr = False debugOptimIf01 = False ######################################################...
apache-2.0
etraiger/PCWG
plots.py
2
15226
import os import pandas as pd from Analysis import chckMake np = pd.np class MatplotlibPlotter(object): def __init__(self,path, analysis): self.path = path self.analysis = analysis def plot_multiple(self, windSpeedCol, powerCol, meanPowerCurveObj): try: from matplotlib impo...
mit
putcn/Paddle
python/paddle/utils/make_model_diagram.py
9
4346
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
xleng/YCM_WIN_X86
third_party/requests/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
gpl-3.0
Acehaidrey/incubator-airflow
tests/api_connexion/endpoints/test_xcom_endpoint.py
7
17945
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
jpshort/odoo
addons/account_budget/wizard/account_budget_crossovered_summary_report.py
373
2191
# -*- 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
ryokochang/Slab-GCS
packages/IronPython.StdLib.2.7.5-beta1/content/Lib/mailbox.py
74
78102
#! /usr/bin/env python """Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.""" # Notes for authors of new mailbox subclasses: # # Remember to fsync() changes to disk before closing a modified file # or returning from a flush() method. See functions _sync_flush() and # _sync_close(). import sys im...
gpl-3.0
holmes/intellij-community
plugins/hg4idea/testData/bin/mercurial/changegroup.py
91
8282
# changegroup.py - Mercurial changegroup manipulation functions # # Copyright 2006 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ from node import nullrev import mdiff, util impo...
apache-2.0
hansey/youtube-dl
youtube_dl/extractor/clubic.py
41
2057
# coding: utf-8 from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import ( clean_html, qualities, ) class ClubicIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?clubic\.com/video/(?:[^/]+/)*video.*-(?P<id>[0-9]+)\.html' _TESTS = [{ ...
unlicense
PRX/Infrastructure
etc/serverless-s3-upload/lambdas/StaticWebsiteAuthorizerFunction/lambda_function.py
1
1077
# This function is triggered by API Gateway as an authorizer. It uses the HTTP # basic auth Authorization header to permit access to API Gateway methods by # returning a policy document when the credentials match those defined as stack # parameters. import os import base64 def lambda_handler(event, context): hea...
mit
ryfeus/lambda-packs
Keras_tensorflow_nightly/source2.7/tensorflow/python/keras/_impl/keras/layers/recurrent.py
3
99323
# 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...
mit
pstjohn/cobrapy
cobra/core/DictList.py
2
12271
import re from itertools import islice from six import string_types, iteritems, PY3 try: from numpy import bool_ except: bool_ = bool class DictList(list): """A combined dict and list This object behaves like a list, but has the O(1) speed benefits of a dict when looking up elements by their id....
gpl-2.0
scottdangelo/RemoveVolumeMangerLocks
cinder/tests/unit/test_huawei_drivers_compatibility.py
20
2367
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
Thraxis/SickRage
lib/unidecode/x0cb.py
253
5012
data = ( 'jjwaels', # 0x00 'jjwaelt', # 0x01 'jjwaelp', # 0x02 'jjwaelh', # 0x03 'jjwaem', # 0x04 'jjwaeb', # 0x05 'jjwaebs', # 0x06 'jjwaes', # 0x07 'jjwaess', # 0x08 'jjwaeng', # 0x09 'jjwaej', # 0x0a 'jjwaec', # 0x0b 'jjwaek', # 0x0c 'jjwaet', # 0x0d 'jjwaep', # 0x0e 'jjw...
gpl-3.0
txtbits/daw-python
pygame/starwars/StarWars[LUISMI]/game.py
1
3787
# -*- coding: utf-8 -*- ''' Clon de Space Invaders (Basado en un script original de Kevin Harris) A partir de un ejercicio de Fernando Salamero ''' import pygame from pygame.locals import * from starwarslib import * from random import randint random.seed() pygame.init() visor = pygame.display.set_mode( (ANCHO, ALT...
mit
cnsoft/kbengine-cocos2dx
kbe/res/scripts/common/Lib/idlelib/ReplaceDialog.py
16
5829
from tkinter import * from idlelib import SearchEngine from idlelib.SearchDialogBase import SearchDialogBase import re def replace(text): root = text._root() engine = SearchEngine.get(root) if not hasattr(engine, "_replacedialog"): engine._replacedialog = ReplaceDialog(root, engine) dialog = ...
lgpl-3.0
loele/samba
third_party/waf/wafadmin/Constants.py
32
1307
#!/usr/bin/env python # encoding: utf-8 # Yinon dot me gmail 2008 """ these constants are somewhat public, try not to mess them maintainer: the version number is updated from the top-level wscript file """ # do not touch these three lines, they are updated automatically HEXVERSION=0x105019 WAFVERSION="1.5.19" WAFREV...
gpl-3.0
idea4bsd/idea4bsd
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_except.py
326
3352
"""Fixer for except statements with named exceptions. The following cases will be converted: - "except E, T:" where T is a name: except E as T: - "except E, T:" where T is not a name, tuple or list: except E as t: T = t This is done because the target of an "except" clause must be a ...
apache-2.0
jmcarp/django
django/utils/datastructures.py
394
9231
import copy from collections import OrderedDict from django.utils import six class OrderedSet(object): """ A set which keeps the ordering of the inserted items. Currently backs onto OrderedDict. """ def __init__(self, iterable=None): self.dict = OrderedDict(((x, None) for x in iterable) ...
bsd-3-clause
fxia22/ASM_xf
PythonD/site_python/twisted/python/roots.py
2
8341
# -*- test-case-name: twisted.test.test_roots -*- # # Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
gpl-2.0
huaweiswitch/neutron
neutron/plugins/cisco/common/cisco_faults.py
50
4085
# Copyright 2011 Cisco Systems, 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 requir...
apache-2.0
takeflight/django
django/core/context_processors.py
27
2462
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by RequestContext. """ from __future__ i...
bsd-3-clause
andrius-preimantas/purchase-workflow
purchase_partner_invoice_method/__openerp__.py
9
1803
# -*- encoding: utf-8 -*- ############################################################################## # # Purchase Partner Invoice Method module for Odoo # Copyright (C) 2014 Akretion (http://www.akretion.com). # @author Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: y...
agpl-3.0
bwhmather/python-linemode
linemode/drivers/command_list.py
1
1130
import sys from urllib.parse import urlparse from linemode.base import Printer def _compile_command(command): if isinstance(command, str): command_name, args = command, [] else: command_name, *args = command if len(args): return ( command_name + ": " + ", ...
bsd-3-clause
Dandandan/wikiprogramming
jsrepl/build/extern/python/reloop-closured/lib/python2.7/posixpath.py
145
13182
"""Common operations on Posix pathnames. Instead of importing this module directly, import os and refer to this module as os.path. The "os.path" name is an alias for this module on Posix systems; on other systems (e.g. Mac, Windows), os.path provides the same operations in a manner specific to that platform, and is a...
mit
julian-seward1/servo
tests/wpt/css-tests/tools/wptserve/wptserve/server.py
87
17881
import BaseHTTPServer import errno import os import socket from SocketServer import ThreadingMixIn import ssl import sys import threading import time import traceback import types import urlparse from . import routes as default_routes from .logger import get_logger from .request import Server, Request from .response i...
mpl-2.0
jabesq/home-assistant
tests/components/homekit/test_type_locks.py
13
3305
"""Test different accessory types: Locks.""" import pytest from homeassistant.components.homekit.const import ATTR_VALUE from homeassistant.components.homekit.type_locks import Lock from homeassistant.components.lock import DOMAIN from homeassistant.const import ( ATTR_CODE, ATTR_ENTITY_ID, STATE_LOCKED, STATE_UNK...
apache-2.0
jedarnaude/gmock
scripts/generator/cpp/tokenize.py
679
9703
#!/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...
bsd-3-clause
bjornlevi/5thpower
afmaeli/env/lib/python3.6/site-packages/pkg_resources/_vendor/packaging/specifiers.py
1107
28025
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import functools import itertools import re from ._compat impo...
mit
llann/django-filebrowser
setup.py
5
1335
import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='django-filebrowser', version='3.5.7', description='Media-Management with Grappelli', long_description = read('README.rst'), url = 'http://djang...
bsd-3-clause
Praveen-1987/devstack-Quantumleap
files/pip-1.4.1/pip/vendor/html5lib/treebuilders/_base.py
79
13710
from __future__ import absolute_import, division, unicode_literals from pip.vendor.six import text_type from ..constants import scopingElements, tableInsertModeElements, namespaces # The scope markers are inserted when entering object elements, # marquees, table cells, and table captions, and are used to prevent form...
apache-2.0
junhuac/MQUIC
depot_tools/third_party/logilab/astroid/raw_building.py
56
14109
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of astroid. # # astroid is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the #...
mit
tquach/talent-curator
talent_curator/apps/google/drive.py
1
1780
import requests from talent_curator import app GOOGLE_DRIVE_API_URI = 'https://www.googleapis.com/drive/v2/files/' logger = app.logger HEADERS = { 'Authorization': "Bearer {access_token}", 'Content-type': "application/json", } class GoogleDriveAPI(object): def get_document(self, access_token, document_id...
bsd-3-clause
mariopro/youtube-dl
youtube_dl/extractor/tvc.py
113
3902
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( clean_html, int_or_none, ) class TVCIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?tvc\.ru/video/iframe/id/(?P<id>\d+)' _TEST = { 'url': 'http://www.tvc.ru/video/ifra...
unlicense
SymbiFlow/symbiflow-robot
maintain-repos.py
1
2727
#!/usr/bin/env python3 import logging import os import re import sys import traceback from github3.exceptions import ForbiddenError from github3 import login from github3.repos.status import Status try: GITHUB_API_TOKEN = os.environ['GITHUB_API_TOKEN'] ORGANIZATION = os.environ['ORGANIZATION'] # PROJECT-...
mit
atloiaco/vivo-pump
uf_examples/publications/filters/author_match_filter.py
2
2750
#!/usr/bin/env/python """ author_match_filter.py -- find the authors in VIVO, and match them to authors in the source. This is often called disambiguation. There are two inputs: 1. authors in VIVO. Keyed by name parts 1. authors in the source. Keyed by name parts There are two cases: 1...
bsd-3-clause
delhivery/django
tests/gis_tests/inspectapp/tests.py
180
8022
from __future__ import unicode_literals import os import re from unittest import skipUnless from django.contrib.gis.gdal import HAS_GDAL from django.core.management import call_command from django.db import connection, connections from django.test import TestCase, skipUnlessDBFeature from django.test.utils import mod...
bsd-3-clause
blacklin/kbengine
kbe/src/lib/python/Lib/test/test_wait3.py
84
1157
"""This test checks for correct wait3() behavior. """ import os import time import unittest from test.fork_wait import ForkWait from test.support import run_unittest, reap_children if not hasattr(os, 'fork'): raise unittest.SkipTest("os.fork not defined") if not hasattr(os, 'wait3'): raise unittest.SkipTest(...
lgpl-3.0
sbidoul/odoo
addons/hr_attendance/report/attendance_errors.py
377
3669
# -*- 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
CartoDB/mapnik
scons/scons-local-3.0.1/SCons/Tool/g++.py
5
1631
"""SCons.Tool.g++ Tool-specific initialization for g++. 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 - 2017 The SCons Foundation # # Permission is hereby granted, free of charge, to...
lgpl-2.1
anryko/ansible
lib/ansible/modules/network/onyx/onyx_lldp.py
118
3101
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
SEL-Columbia/commcare-hq
custom/_legacy/pact/lib/quicksect.py
3
6312
""" Interval tree library data structure. Given a set of data that represents data that spans some time interval, create an object in memory that given a query with a datetime timestamp, return the relevant data back whose time interval matches that. Intersects ... faster. Suports GenomicInterval datatype and multi...
bsd-3-clause
setten/pymatgen
pymatgen/core/composition.py
2
38512
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals import collections import numbers import string from itertools import combinations_with_replacement, product import os import six import re from collections ...
mit
redhat-cip/numeter
poller/numeter/poller/munin_connect.py
2
4093
#!/usr/bin/env python import socket import re from logging import getLogger class MuninSock(object): '''Open and close a socket with munin-node socket. This class allow you to use ``with`` statement (for python < 3). :: with MuninSock(self.munin_host, self.munin_port) as sock: ...
agpl-3.0
qilicun/python
python2/PyMOTW-1.132/PyMOTW/shlex/shlex_split.py
1
1272
#!/usr/bin/env python # # Copyright 2007 Doug Hellmann. # # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and tha...
gpl-3.0