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
noblocknet/shadowsocks
shadowsocks/shell.py
56
12404
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 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 b...
apache-2.0
abseil/abseil-py
absl/testing/tests/parameterized_test.py
1
34718
# Copyright 2017 The Abseil Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
toddeye/home-assistant
homeassistant/components/automation/template.py
7
2014
""" homeassistant.components.automation.template ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Offers template automation rules. For more details about this automation rule, please refer to the documentation at https://home-assistant.io/components/automation/#template-trigger """ import logging from homeassistant...
mit
MickSandoz/compassion-modules
mail_sendgrid/__openerp__.py
1
1937
# -*- encoding: utf-8 -*- ############################################################################## # # ______ Releasing children from poverty _ # / ____/___ ____ ___ ____ ____ ___________(_)___ ____ # / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \ # / /___/ /_/ / / / / / / /...
agpl-3.0
gilt/incubator-airflow
tests/contrib/hooks/gcp_pubsub_hook.py
18
3735
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
bop/foundation
lib/python2.7/site-packages/django/conf/locale/nl/formats.py
329
3056
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' # '20 januari 2009' TIME_FORMAT = 'H:i' ...
gpl-2.0
rintoj/ai
demo/graphicsCrawlerDisplay.py
5
10931
# graphicsCrawlerDisplay.py # ------------------------- # Licensing Information: Please do not distribute or publish solutions to this # project. You are free to use and extend these projects for educational # purposes. The Pacman AI projects were developed at UC Berkeley, primarily by # John DeNero (denero@cs.berkeley...
mit
quozl/sugar-toolkit-gtk3
src/sugar3/graphics/toolbutton.py
2
8147
# Copyright (C) 2007, Red Hat, Inc. # Copyright (C) 2008, One Laptop Per Child # # This library 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 Software Foundation; either # version 2 of the License, or (at your option) any...
lgpl-2.1
grepme/CMPUT410Lab01
virt_env/virt1/lib/python2.7/site-packages/Pygments-2.0.1-py2.7.egg/pygments/formatters/other.py
73
5162
# -*- coding: utf-8 -*- """ pygments.formatters.other ~~~~~~~~~~~~~~~~~~~~~~~~~ Other formatters: NullFormatter, RawTokenFormatter. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments...
apache-2.0
DasIch/pyalysis
pyalysis/utils.py
1
4129
# coding: utf-8 """ pyalysis.utils ~~~~~~~~~~~~~~ :copyright: 2014 by Daniel Neuhäuser and Contributors :license: BSD, see LICENSE.rst for details """ import math import re import codecs import tokenize from collections import namedtuple from weakref import WeakKeyDictionary from contextlib import cont...
bsd-3-clause
lokeshjindal15/pd-gem5
src/mem/slicc/symbols/Func.py
43
3474
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
Accelerite/cinder
cinder/volume/drivers/netapp/dataontap/ssc_cmode.py
3
25620
# Copyright (c) 2012 NetApp, Inc. All rights reserved. # Copyright (c) 2014 Ben Swartzlander. All rights reserved. # Copyright (c) 2014 Navneet Singh. All rights reserved. # Copyright (c) 2014 Clinton Knight. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
hale36/SRTV
lib/unidecode/x005.py
87
4011
data = ( '[?]', # 0x00 '[?]', # 0x01 '[?]', # 0x02 '[?]', # 0x03 '[?]', # 0x04 '[?]', # 0x05 '[?]', # 0x06 '[?]', # 0x07 '[?]', # 0x08 '[?]', # 0x09 '[?]', # 0x0a '[?]', # 0x0b '[?]', # 0x0c '[?]', # 0x0d '[?]', # 0x0e '[?]', # 0x0f '[?]', # 0x10 '[?]', # 0x11 '[?]'...
gpl-3.0
bigdatauniversity/edx-platform
common/djangoapps/util/sandboxing.py
162
1617
import re from django.conf import settings # We'll make assets named this be importable by Python code in the sandbox. PYTHON_LIB_ZIP = "python_lib.zip" def can_execute_unsafe_code(course_id): """ Determine if this course is allowed to run unsafe code. For use from the ModuleStore. Checks the `course_i...
agpl-3.0
gho1b/ardupilot
Tools/LogAnalyzer/tests/TestVCC.py
218
1278
from LogAnalyzer import Test,TestResult import DataflashLog import collections class TestVCC(Test): '''test for VCC within recommendations, or abrupt end to log in flight''' def __init__(self): Test.__init__(self) self.name = "VCC" def run(self, logdata, verbose): self.result = ...
gpl-3.0
milliman/spark
examples/src/main/python/mllib/gradient_boosting_regression_example.py
106
2443
# # 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
NeuralEnsemble/python-neo
neo/io/elanio.py
2
1098
from neo.io.basefromrawio import BaseFromRaw from neo.rawio.elanrawio import ElanRawIO class ElanIO(ElanRawIO, BaseFromRaw): """ Class for reading data from Elan. Elan is software for studying time-frequency maps of EEG data. Elan is developed in Lyon, France, at INSERM U821 https://elan.lyon.i...
bsd-3-clause
sephii/django-cms
cms/tests/templates.py
11
4218
# -*- coding: utf-8 -*- from imp import load_module, PY_SOURCE import os.path from django.conf import settings from django.template import loader, TemplateDoesNotExist from django.test.utils import override_settings from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _ f...
bsd-3-clause
linuxmint/ubuntu-drivers-common
Quirks/quirkapplier.py
2
6113
# -*- coding: utf-8 -*- # (c) 2012 Canonical Ltd. # # Authors: Alberto Milone <alberto.milone@canonical.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or...
gpl-2.0
jonnyhtw/cylc
lib/cylc/broadcast_report.py
2
3485
#!/usr/bin/env python # THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2018 NIWA # # 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 yo...
gpl-3.0
cmusatyalab/gabriel
server/src/gabriel_server/network_engine/server_runner.py
1
11140
import asyncio import time import logging import zmq import zmq.asyncio from collections import namedtuple from gabriel_protocol import gabriel_pb2 from gabriel_server import cognitive_engine from gabriel_server import network_engine from gabriel_server.websocket_server import WebsocketServer FIVE_SECONDS = 5 logge...
apache-2.0
GreenVars/diary
tests/performance_measure.py
1
1933
from timeit import default_timer from functools import wraps from diary import Diary import os import shutil TEST_DIR = os.path.join(os.path.dirname(__file__), 'performance_test_dir') TRIAL_COUNT = 1000 def timed(timed_function): @wraps(timed_function) def timed_wrapper(trials=TRIAL_COUNT): start = de...
mit
brianwoo/django-tutorial
ENV/lib/python2.7/site-packages/django/middleware/cache.py
106
7315
""" Cache middleware. If enabled, each Django-powered page will be cached based on URL. The canonical way to enable cache middleware is to set ``UpdateCacheMiddleware`` as your first piece of middleware, and ``FetchFromCacheMiddleware`` as the last:: MIDDLEWARE_CLASSES = [ 'django.middleware.cache.UpdateCa...
gpl-3.0
ces0712/mtools
mtools/mloginfo/sections/rs_state_section.py
7
1394
from base_section import BaseSection from mtools.util.print_table import print_table from mtools.util import OrderedDict class RsStateSection(BaseSection): """ This section determines if there were any Replica Set state changes in the log file and prints out the times and information about the restarts fou...
apache-2.0
gedare/gem5
src/mem/ruby/network/garnet2.0/GarnetNetwork.py
12
3651
# Copyright (c) 2008 Princeton University # Copyright (c) 2009 Advanced Micro Devices, 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 c...
bsd-3-clause
bjornlevi/5thpower
afmaeli/env/lib/python3.6/site-packages/chardet/cli/chardetect.py
198
2738
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
mit
chrisdunelm/grpc
src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py
12
8272
# Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
bjorand/python-social-auth
social/pipeline/__init__.py
72
2386
DEFAULT_AUTH_PIPELINE = ( # Get the information we can about the user and return it in a simple # format to create the user instance later. On some cases the details are # already part of the auth response from the provider, but sometimes this # could hit a provider API. 'social.pipeline.social_auth...
bsd-3-clause
chhao91/QGIS
python/plugins/processing/algs/lidar/fusion/GridSurfaceCreate.py
13
5946
# -*- coding: utf-8 -*- """ *************************************************************************** GridSurfaceCreate.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com -----------------...
gpl-2.0
llllllllll/codetransformer
codetransformer/utils/immutable.py
1
9734
""" codetransformer.utils.immutable ------------------------------- Utilities for creating and working with immutable objects. """ from collections import ChainMap from inspect import getfullargspec from itertools import starmap, repeat from textwrap import dedent from weakref import WeakKeyDictionary class immutab...
gpl-2.0
jjs0sbw/CSPLN
apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/lib/python2.7/numpy/compat/_inspect.py
94
9117
"""Subset of inspect module from upstream python We use this instead of upstream because upstream inspect is slow to import, and significanly contributes to numpy import times. Importing this copy has almost no overhead. """ import types __all__ = ['getargspec', 'formatargspec'] # ----------------------------------...
gpl-3.0
perovic/root
tutorials/pyroot/fillrandom.py
10
1665
# # To see the output of this macro, click begin_html <a href="gif/fillrandom.gif">here</a>. end_html # from ROOT import TCanvas, TPad, TFormula, TF1, TPaveLabel, TH1F, TFile from ROOT import gROOT, gBenchmark c1 = TCanvas( 'c1', 'The FillRandom example', 200, 10, 700, 900 ) c1.SetFillColor( 18 ) pad1 = TPad( 'pad...
lgpl-2.1
Yadnyawalkya/integration_tests
cfme/tests/test_db_migrate_manual.py
2
16631
import pytest from cfme import test_requirements @pytest.mark.manual @test_requirements.upgrade @pytest.mark.tier(2) def test_upgrade_dedicated_db_migration_local(): """ Test that you can locally migrate a dedicated database after upgrade. Previously it was missing the database.yml during setup with woul...
gpl-2.0
goern/origin
cmd/cluster-capacity/go/src/github.com/kubernetes-incubator/cluster-capacity/vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-worker/lib/charms/kubernetes/flagmanager.py
290
4961
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
camagenta/youtube-dl
youtube_dl/extractor/wsj.py
104
3431
# encoding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, ) class WSJIE(InfoExtractor): _VALID_URL = r'https?://video-api\.wsj\.com/api-video/player/iframe\.html\?guid=(?P<id>[a-zA-Z0-9-]+)' IE_DESC = 'Wall Street J...
unlicense
Nindaleth/ansible-modules-core
cloud/digital_ocean/digital_ocean_sshkey.py
23
5127
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
ksmaheshkumar/mycli
mycli/packages/special/main.py
27
3852
import logging from collections import namedtuple from . import export log = logging.getLogger(__name__) NO_QUERY = 0 PARSED_QUERY = 1 RAW_QUERY = 2 SpecialCommand = namedtuple('SpecialCommand', ['handler', 'command', 'shortcut', 'description', 'arg_type', 'hidden', 'case_sensitive']) COMMANDS ...
bsd-3-clause
yildizberkay/MongoApp
libs/PIL/GdImageFile.py
40
2107
# # The Python Imaging Library. # $Id$ # # GD file handling # # History: # 1996-04-12 fl Created # # Copyright (c) 1997 by Secret Labs AB. # Copyright (c) 1996 by Fredrik Lundh. # # See the README file for information on usage and redistribution. # # NOTE: This format cannot be automatically recognized, so the # cl...
apache-2.0
reddymeghraj/showroom
erpnext/hr/report/employee_birthday/employee_birthday.py
120
1328
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_columns() dat...
agpl-3.0
newfies-dialer/newfies-dialer
newfies/agent/admin.py
4
1263
# # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2015 Star2Billing S.L. # # The primar...
mpl-2.0
pamfilos/invenio
modules/bibcatalog/lib/bibcatalog_system_rt.py
10
20496
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011, 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or ...
gpl-2.0
danakj/chromium
tools/perf/page_sets/profile_safe_urls.py
34
1181
# Copyright 2015 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 profile_creators import profile_safe_url_list from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry ...
bsd-3-clause
benchisell/photostream-bc
flask/lib/python2.7/site-packages/jinja2/debug.py
620
10980
# -*- coding: utf-8 -*- """ jinja2.debug ~~~~~~~~~~~~ Implements the debug interface for Jinja. This module does some pretty ugly stuff with the Python traceback system in order to achieve tracebacks with correct line numbers, locals and contents. :copyright: (c) 2010 by the Jinja Team. :...
bsd-3-clause
chongtianfeiyu/kbengine
kbe/res/scripts/common/Lib/distutils/tests/test_install_scripts.py
118
2625
"""Tests for distutils.command.install_scripts.""" import os import unittest from distutils.command.install_scripts import install_scripts from distutils.core import Distribution from distutils.tests import support from test.support import run_unittest class InstallScriptsTestCase(support.TempdirManager, ...
lgpl-3.0
isotoma/django-waffle
waffle/south_migrations/0009_auto__add_field_flag_site__del_unique_flag_name__add_unique_flag_name_.py
4
10091
# -*- 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): # Removing unique constraint on 'Sample', fields ['name'] db.delete_uniqu...
bsd-3-clause
valentin-krasontovitsch/ansible
lib/ansible/module_utils/facts/virtual/hpux.py
199
2486
# 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 distributed in the hope that ...
gpl-3.0
msfernandes/anato-hub
authentication/tests/test_views.py
1
1857
# -*- coding: utf-8 -*- from django.test import TestCase, Client from should_dsl import should from core.tests.format_test import FormatTest from sys import stderr from core.tests.db_mock import DatabaseMock import re #Regular expressions class TestViews(FormatTest, TestCase): def setUp(self): self.m...
mit
slightlymadphoenix/activityPointsApp
activitypoints/lib/python3.5/site-packages/django/contrib/messages/storage/session.py
109
1795
import json from django.conf import settings from django.contrib.messages.storage.base import BaseStorage from django.contrib.messages.storage.cookie import ( MessageDecoder, MessageEncoder, ) from django.utils import six class SessionStorage(BaseStorage): """ Stores messages in the session (that is, dja...
mit
thisismohitgupta/chronolapse
chronolapse.py
16
112112
""" chronolapse.py @author: Collin "Keeyai" Green @url: http://keeyai.com @summary: ChronoLapse is a tool for making time lapses. CL can save both screenshots and webcam captures, and can even do them both at the same time so they are 'synched' together. In addition to sav...
mit
Zouyiran/ryu
ryu/services/protocols/bgp/speaker.py
13
22721
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
deepsrijit1105/edx-platform
common/test/acceptance/tests/lms/test_lms_dashboard_search.py
7
7247
""" Test dashboard search """ import os import json from bok_choy.web_app_test import WebAppTest from common.test.acceptance.tests.helpers import generate_course_key from common.test.acceptance.pages.common.logout import LogoutPage from common.test.acceptance.pages.common.utils import click_css from common.test.accept...
agpl-3.0
ebagdasa/tempest
tempest/api/compute/servers/test_server_addresses.py
5
2704
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
FNNDSC/ChRIS_ultron_backEnd
chris_backend/uploadedfiles/views.py
1
4660
import logging from django.conf import settings from rest_framework import generics, permissions from rest_framework.reverse import reverse from rest_framework.response import Response from collectionjson import services from core.renderers import BinaryFileRenderer from core.swiftmanager import SwiftManager from ....
mit
Dunkas12/BeepBoopBot
lib/youtube_dl/extractor/revision3.py
73
6717
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( int_or_none, parse_iso8601, unescapeHTML, qualities, ) class Revision3EmbedIE(InfoExtractor): IE_NAME = 'revision3:embed' _VALID_URL = r'(...
gpl-3.0
RyanTech/rocksdb
tools/db_crashtest.py
25
7009
#! /usr/bin/env python import os import re import sys import time import random import getopt import logging import tempfile import subprocess import shutil # This script runs and kills db_stress multiple times. It checks consistency # in case of unsafe crashes in RocksDB. def main(argv): try: opts, args ...
bsd-3-clause
triveous/LearnFlask
flask/lib/python2.7/site-packages/werkzeug/contrib/jsrouting.py
147
8534
# -*- coding: utf-8 -*- """ werkzeug.contrib.jsrouting ~~~~~~~~~~~~~~~~~~~~~~~~~~ Addon module that allows to create a JavaScript function from a map that generates rules. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ ...
apache-2.0
rohit21122012/DCASE2013
runs/2016/baseline32/src/dataset.py
37
78389
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import urllib2 import socket import locale import zipfile import tarfile from sklearn.cross_validation import StratifiedShuffleSplit, KFold from ui import * from general import * from files import * class Dataset(object): """Dataset base class. The sp...
mit
bdh1011/wau
venv/lib/python2.7/site-packages/flask/testsuite/views.py
561
5068
# -*- coding: utf-8 -*- """ flask.testsuite.views ~~~~~~~~~~~~~~~~~~~~~ Pluggable views. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import flask.views import unittest from flask.testsuite import FlaskTestCase from werkzeug.http import par...
mit
MediaSapiens/wavesf
django/contrib/auth/forms.py
6
8825
from django.contrib.auth.models import User from django.contrib.auth import authenticate from django.contrib.auth.tokens import default_token_generator from django.contrib.sites.models import get_current_site from django.template import Context, loader from django import forms from django.utils.translation import ugett...
bsd-3-clause
KyleJamesWalker/ansible
lib/ansible/modules/web_infrastructure/ejabberd_user.py
48
7599
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2013, Peter Sprygada <sprygada@gmail.com> # # 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 ...
gpl-3.0
B-MOOC/edx-platform
lms/djangoapps/verify_student/migrations/0007_auto__add_field_verificationstatus_location_id.py
92
9831
# -*- 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): # Adding field 'VerificationStatus.location_id' db.add_column('verify_stu...
agpl-3.0
pratikmallya/heat
heat/tests/keystone/test_role.py
2
3910
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
wfxiang08/django197
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
40023247/2015cd_0505
static/Brython3.1.1-20150328-091302/Lib/reprlib.py
923
5110
"""Redo the builtin repr() (representation) but with limits on most sizes.""" __all__ = ["Repr", "repr", "recursive_repr"] import builtins from itertools import islice try: from _thread import get_ident except ImportError: from _dummy_thread import get_ident def recursive_repr(fillvalue='...'): 'Decorato...
agpl-3.0
rockstor/rockstor-core
src/rockstor/storageadmin/urls/rockons.py
2
1914
""" Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
gpl-3.0
yinchunlong/abelkhan-1
ext/c++/thirdpart/c++/boost/tools/build/src/tools/unix.py
11
4867
# Copyright (c) 2004 Vladimir Prus. # # Use, modification and distribution is subject to the Boost Software # License Version 1.0. (See accompanying file LICENSE_1_0.txt or # http://www.boost.org/LICENSE_1_0.txt) """ This file implements linking semantics common to all unixes. On unix, static libraries must be...
mit
ymcagodme/Norwalk-Judo
djangoappengine/storage.py
110
5599
import os try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.conf import settings from django.core.files.base import File from django.core.files.storage import Storage from django.core.files.uploadedfile import UploadedFile from django.core.files.uploadhandler im...
bsd-3-clause
jack198345/volatility
volatility/plugins/malware/impscan.py
44
14373
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (c) 2010 - 2012 Michael Ligh <michael.ligh@mnin.org> # # 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 Soft...
gpl-2.0
AICP/kernel_samsung_smdk4412
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
TRox1972/youtube-dl
youtube_dl/extractor/mgtv.py
9
2563
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import int_or_none class MGTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?mgtv\.com/v/(?:[^/]+/)*(?P<id>\d+)\.html' IE_DESC = '芒果TV' _TESTS = [{ 'url': 'http://www.mgtv.com/v/1/290525/f...
unlicense
Cl3MM/metagoofil
hachoir_parser/image/common.py
95
1429
from hachoir_core.field import FieldSet, UserVector, UInt8 class RGB(FieldSet): color_name = { ( 0, 0, 0): "Black", (255, 0, 0): "Red", ( 0, 255, 0): "Green", ( 0, 0, 255): "Blue", (255, 255, 255): "White", } static_size = 24 def createFields(self...
gpl-2.0
jnordling/cabin
onadata/apps/api/tasks.py
5
1781
import os import sys from celery import task from celery.result import AsyncResult from django.core.files.uploadedfile import (InMemoryUploadedFile, TemporaryUploadedFile) from django.utils.datastructures import MultiValueDict from io import BytesIO from onadata.apps.api impo...
bsd-2-clause
tjsavage/tmrwmedia
django/utils/synch.py
376
2549
""" Synchronization primitives: - reader-writer lock (preference to writers) (Contributed to Django by eugene@lazutkin.com) """ try: import threading except ImportError: import dummy_threading as threading class RWLock: """ Classic implementation of reader-writer lock with preference to writers....
bsd-3-clause
165your4/supertux
tools/sexpr.py
13
3245
#!/usr/bin/env python # Copyright (c) 2014 Ingo Ruhnke <grumbel@gmail.com> # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for ...
gpl-3.0
aristanetworks/arista-ovs-quantum
quantum/db/l3_rpc_base.py
2
2127
# Copyright (c) 2012 OpenStack, LLC. # # 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 wr...
apache-2.0
cjhak/b2share
invenio/modules/deposit/fields/doi.py
15
2116
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2014, 2015 CERN. # # Invenio 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 optio...
gpl-2.0
cltrudeau/django-yacon
yacon/tests/test_groups.py
1
4505
from django.test import TestCase from django.contrib.auth.models import User, Group from yacon.models.groupsq import GroupOfGroups, OwnedGroupOfGroups # ============================================================================ class GroupOfGroupsTests(TestCase): def _user(self, username, email, password): ...
mit
SCgeeker/OpenSesame
plugins/auto_example/auto_example.py
2
3684
#-*- coding:utf-8 -*- """ This file is part of OpenSesame. OpenSesame 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. OpenSesame is distri...
gpl-3.0
PiRSquared17/marave
marave/editor/widgets/__init__.py
7
3893
# -*- coding: utf-8 -*- from PyQt4 import QtGui, QtCore from Ui_searchwidget import Ui_Form as UI_SearchWidget from Ui_searchreplacewidget import Ui_Form as UI_SearchReplaceWidget from Ui_gotolinewidget import Ui_Form as UI_GotoLineWidget class GotoLineWidget(QtGui.QWidget): def __init__(self, editor): Q...
gpl-2.0
morreene/tradenews
venv/Lib/encodings/mac_farsi.py
272
15170
""" Python Character Mapping Codec mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.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,input,err...
bsd-3-clause
renhaoqi/gem5-stable
scons-local-2.2.0/SCons/Tool/lex.py
14
3415
"""SCons.Tool.lex Tool-specific initialization for lex. 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, 2011, 2012 The SCons Foun...
bsd-3-clause
hemmerling/codingdojo
src/game_of_life/python_coderetreat_berlin_2014-09/python_legacycrberlin02/gol02.py
1
1049
2#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: Administrator # # Created: 08/10/2011 # Copyright: (c) Administrator 2011 # Licence: <your licence> #-------------------------------------------------------------------...
apache-2.0
jeffmarcom/checkbox
plugins/environment_info.py
2
2003
# # This file is part of Checkbox. # # Copyright 2012 Canonical Ltd. # # Checkbox 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. # # C...
gpl-3.0
hifly/OpenUpgrade
addons/procurement/__openerp__.py
267
2661
# -*- 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
atomic83/youtube-dl
youtube_dl/extractor/nrk.py
13
10792
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( determine_ext, ExtractorError, float_or_none, parse_duration, unified_strdate, ) class NRKIE(InfoExtractor): _VALID_URL = r'(?:nrk:...
unlicense
lhilt/scipy
scipy/sparse/tests/test_extract.py
27
1383
"""test sparse matrix construction functions""" from __future__ import division, print_function, absolute_import from numpy.testing import assert_equal from scipy.sparse import csr_matrix import numpy as np from scipy.sparse import extract class TestExtract(object): def setup_method(self): self.cases =...
bsd-3-clause
jendap/tensorflow
tensorflow/contrib/eager/python/examples/revnet/revnet_test.py
19
12134
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
kalxas/QGIS
python/plugins/processing/script/OpenScriptFromFileAction.py
45
2373
# -*- coding: utf-8 -*- """ *************************************************************************** OpenScriptFromFileAction.py --------------------- Date : May 2018 Copyright : (C) 2018 by Mathieu Pellerin Email : nirvn dot asia at gmail dot com ******...
gpl-2.0
unifycore/ryu
ryu/tests/unit/packet/test_udp.py
1
3096
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
madcowfred/evething
thing/models/pricehistory.py
2
2284
# ------------------------------------------------------------------------------ # Copyright (c) 2010-2013, EVEthing team # 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...
bsd-2-clause
kewu1992/test-infra
gubernator/third_party/cloudstorage/storage_api.py
75
28161
# 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 ag...
apache-2.0
Jaiz909/youtube-dl
youtube_dl/extractor/ina.py
56
1062
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class InaIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?ina\.fr/video/(?P<id>I?[A-Z0-9]+)' _TEST = { 'url': 'http://www.ina.fr/video/I12055569/francois-hollande-je-crois-que-c-est-clair-video.ht...
unlicense
inodb/sufam
sufam/mutation.py
1
6815
MUTATION_TYPES = ["-", "+", "."] class MutationsAtSinglePosition(object): def __init__(self, chrom, pos, cov, ref=None): self.snvs = {} self.deletions = {} self.insertions = {} self.chrom = chrom self.pos = pos self.cov = cov if ref: self.ref = r...
mit
leilihh/novaha
nova/api/validator.py
12
3693
# Copyright 2011 Cloudscaling, 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
kosz85/django
tests/i18n/utils.py
75
2417
import os import re import shutil import tempfile source_code_dir = os.path.dirname(__file__) def copytree(src, dst): shutil.copytree(src, dst, ignore=shutil.ignore_patterns('__pycache__')) class POFileAssertionMixin: def _assertPoKeyword(self, keyword, expected_value, haystack, use_quotes=True): ...
bsd-3-clause
varunr047/homefile
homeassistant/components/switch/homematic.py
11
1959
""" Support for Homematic switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.homematic/ """ import logging from homeassistant.components.switch import SwitchDevice from homeassistant.const import STATE_UNKNOWN import homeassistant.components...
mit
feroda/connettere
connettere/connect/views.py
1
3681
# Create your views here.i from django.template import Context, loader from django.shortcuts import get_object_or_404, render_to_response from django.core.urlresolvers import reverse from django.template import RequestContext from django.conf import settings from connect.models import AGroup,AThing from django.http im...
agpl-3.0
littlstar/chromium.src
build/android/pylib/utils/xvfb.py
143
1551
# Copyright (c) 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. # pylint: disable=W0702 import os import signal import subprocess import sys import time def _IsLinux(): """Return True if on Linux; else False.""" ...
bsd-3-clause
bbbenja/SickRage
autoProcessTV/lib/requests/auth.py
197
6710
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import parse_dict_header, ...
gpl-3.0
Knotis/sorl-thumbnail
setup.py
5
1312
# -*- encoding: utf8 -*- from setuptools import setup, find_packages from setuptools.command.test import test from sorl import __version__, __author__, __maintainer__, __email__, __license__ class TestCommand(test): def run(self): from tests.runtests import runtests runtests() setup( name=...
bsd-3-clause