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
pscedu/slash2-stable
slash2/utils/tsuite2/slash2_tests/citrus_tests/nested_directories.py
1
2102
# %PSCGPL_START_COPYRIGHT% # ----------------------------------------------------------------------------- # Copyright (c) 2009-2013, Pittsburgh Supercomputing Center (PSC). # # 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 # ...
isc
StuartMacKay/checklists_scrapers
checklists_scrapers/tests/spiders/worldbirds/test_checklist_parser.py
1
7400
"""Tests for parsing the WorldBirds page containing the checklist.""" from datetime import datetime from unittest import TestCase from checklists_scrapers.spiders import DOWNLOAD_FORMAT, DOWNLOAD_LANGUAGE from checklists_scrapers.spiders.worldbirds_spider import ChecklistParser from checklists_scrapers.tests.utils imp...
bsd-3-clause
koenedaele/pyramid_skosprovider
tests/test_functional.py
1
14118
# -*- coding: utf8 -*- from __future__ import unicode_literals from pyramid.config import Configurator from pyramid.compat import ( ascii_native_, string_types ) import json from webtest import TestApp import unittest from .fixtures.data import ( trees ) def skosmain(global_config, **settings): ...
mit
2014c2g12/c2g12
c2wp/exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/_pyio.py
103
72494
""" Python implementation of the io module. """ import os import abc import codecs import errno # Import _thread instead of threading to reduce startup cost try: from _thread import allocate_lock as Lock except ImportError: from _dummy_thread import allocate_lock as Lock import io from io import (__all__, SEE...
gpl-2.0
ellasafy/shadowsocks
shadowsocks/crypto/table.py
1044
8108
# !/usr/bin/env python # # 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 by applicable law or...
apache-2.0
speed-of-light/pyslider
lib/auto/match_do.py
1
1715
import numpy as np from lib.exp.base import ExpCommon from lib.exp.prepare import Prepare from lib.exp.matching import Matcher from lib.exp.evaluator.ground_truth import GroundTruth from lib.exp.evaluator.pair_evaluator import PairEvaluator class MatchDo(ExpCommon): """ Provide a simple way to rundown """...
agpl-3.0
ContextLogic/luigi
test/helpers.py
19
6931
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
nugget/python-insteonplm
insteonplm/messages/allLinkCleanupFailureReport.py
1
1428
"""INSTEON Message All-LinkCleanup Failup Report.""" from insteonplm.messages.message import Message from insteonplm.constants import ( MESSAGE_ALL_LINK_CEANUP_FAILURE_REPORT_0X56, MESSAGE_ALL_LINK_CEANUP_FAILURE_REPORT_SIZE, ) from insteonplm.address import Address class AllLinkCleanupFailureReport(Message):...
mit
vispeal/VoteHelper
weibonews/weibonews/utils/db/format.py
1
1175
''' Created on Nov 19, 2013 @author: fli ''' import re from weibonews.utils.format import dict2PropertyTable _CONN_RE = re.compile(r"(?P<hosts>(?P<host>[A-Z0-9_.-]+)(?P<portpart>:(?P<port>\d+))?(?P<repls>(?P<repl>,[A-Z0-9_.-]+(:\d+)?)*))/(?P<db>\w+)", re.IGNORECASE) def parse_conn_string(conn_str): ''' parse a ...
gpl-2.0
ArcherSys/ArcherSys
Lib/distutils/dist.py
1
149498
<<<<<<< HEAD <<<<<<< HEAD """distutils.dist Provides the Distribution class, which represents the module distribution being built/installed/distributed. """ import sys, os, re from email import message_from_file try: import warnings except ImportError: warnings = None from distutils.errors import * from dis...
mit
google/data-driven-discretization-1d
pde_superresolution/duckarray_test.py
1
2487
# Copyright 2018 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
won0089/oppia
core/tests/test_utils_test.py
30
5373
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
runcom/docker-py
docker/utils/ports/ports.py
22
2798
def add_port_mapping(port_bindings, internal_port, external): if internal_port in port_bindings: port_bindings[internal_port].append(external) else: port_bindings[internal_port] = [external] def add_port(port_bindings, internal_port_range, external_range): if external_range is None: ...
apache-2.0
TedaLIEz/sentry
src/sentry/migrations/0166_auto__chg_field_user_id__add_field_apikey_allowed_origins.py
34
36870
# -*- 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 'ApiKey.allowed_origins' db.add_column('sentry_apikey', 'a...
bsd-3-clause
indhub/mxnet
python/mxnet/gluon/rnn/rnn_layer.py
4
23858
# 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
megaumi/django
tests/auth_tests/test_remote_user.py
275
10242
from datetime import datetime from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth.backends import RemoteUserBackend from django.contrib.auth.middleware import RemoteUserMiddleware from django.contrib.auth.models import User from django.test import TestCase, modify_set...
bsd-3-clause
boh1996/LectioAPI
scrapers/subject_list.py
1
1386
#!/usr/bin/python # -*- coding: utf8 -*- from bs4 import BeautifulSoup as Soup import urls import re import proxy import functions def subject_list ( start, end, school_id ): increase = 1 subjects = [] cards = [] for code in range(0, end-start+1): cards.append(start + (code*increase)) for code in cards: u...
mit
ccnmtl/envirocon
envirocon/envirocon_main/tests/test_models.py
1
1200
from datetime import datetime from django.contrib.auth.models import User from django.test import TestCase from envirocon.envirocon_main.models import GroundWorkClass class TestGroundWorkClassModels(TestCase): def setUp(self): self.gwc = GroundWorkClass() def test_gwc_init(self): self.assert...
gpl-2.0
labase/activlets
src/test/test_model.py
1
6983
#! /usr/bin/env python # -*- coding: UTF8 -*- # Este arquivo é parte do programa Activlets # Copyright 2013-2015 Carlo Oliveira <carlo@nce.ufrj.br>, # `Labase <http://labase.selfip.org/>`__; `GPL <http://is.gd/3Udt>`__. # # Activlets é um software livre; você pode redistribuí-lo e/ou # modificá-lo dentro dos termos da ...
gpl-2.0
snamstorm/rockstor-core
src/rockstor/smart_manager/models/task.py
3
1077
""" Copyright (c) 2012-2013 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
arpitparmar5739/youtube-dl
youtube_dl/extractor/tvplay.py
86
8688
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( parse_iso8601, qualities, ) class TVPlayIE(InfoExtractor): IE_DESC = 'TV3Play and related services' _VALID_URL = r'''(?x)http://(?:www\.)? ...
unlicense
carnell69/kuma
kuma/search/signals.py
13
1554
import logging from django.conf import settings from kuma.wiki.search import WikiDocumentType log = logging.getLogger('kuma.search.signals') def render_done_handler(**kwargs): if not settings.ES_LIVE_INDEX or 'instance' not in kwargs: return from kuma.wiki.tasks import index_documents from .m...
mpl-2.0
Jay-Jay-D/LeanSTP
Algorithm.Framework/Portfolio/MinimumVariancePortfolioOptimizer.py
3
4622
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Lice...
apache-2.0
pannal/Subliminal.bundle
Contents/Code/support/lib.py
2
1469
# coding=utf-8 import plex from subzero.intent import TempIntent from subzero.lib.dict import DictProxy from subzero.lib.httpfake import PlexPyNativeResponseProxy from subzero.constants import DEFAULT_TIMEOUT class PlexPyNativeRequestProxy(object): """ A really dumb object that tries to mimic requests.Reques...
mit
ging/horizon
openstack_dashboard/dashboards/identity/users/views.py
4
5893
# 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
shravya-ks/ECN-ns3
src/fd-net-device/bindings/modulegen__gcc_LP64.py
1
326067
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
nthuoj/NTHUOJ_web
status/status_info.py
6
2628
from datetime import datetime from django.db.models import Q from contest.contest_info import get_running_contests, \ get_freeze_time_datetime, get_contestant from contest.models import Contest from problem.models import Problem, Submission, SubmissionDetail from users.models import User from utils.user_info impor...
mit
rwillmer/django
tests/unmanaged_models/tests.py
296
2174
from __future__ import unicode_literals from django.db import connection from django.test import TestCase from .models import A01, A02, B01, B02, C01, C02, Managed1, Unmanaged2 class SimpleTests(TestCase): def test_simple(self): """ The main test here is that the all the models can be created w...
bsd-3-clause
Cactuslegs/audacity-of-nope
lib-src/lv2/lv2/plugins/eg04-sampler.lv2/waflib/Tools/ifort.py
330
1460
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import re from waflib import Utils from waflib.Tools import fc,fc_config,fc_scan,ar from waflib.Configure import conf @conf def find_ifort(conf): fc=conf.find_program('ifort'...
gpl-2.0
mfraezz/osf.io
admin/subjects/views.py
11
1344
from django.contrib.auth.mixins import PermissionRequiredMixin from django.core.urlresolvers import reverse_lazy from django.views.generic import ListView, UpdateView from admin.subjects.forms import SubjectForm from osf.models.subject import Subject from osf.models.provider import PreprintProvider class SubjectList...
apache-2.0
servo/servo
tests/wpt/web-platform-tests/webdriver/tests/get_element_css_value/user_prompts.py
16
4163
# META: timeout=long import pytest from tests.support.asserts import assert_error, assert_success, assert_dialog_handled def get_element_css_value(session, element_id, prop): return session.transport.send( "GET", "session/{session_id}/element/{element_id}/css/{prop}".format( session_...
mpl-2.0
erikge/watch_gyp
pylib/gyp/generator/gypsh.py
2779
1665
# Copyright (c) 2011 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. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
bsd-3-clause
msincenselee/vnpy
vnpy/gateway/deribit/deribit_gateway.py
1
17944
from typing import Callable from vnpy.trader.object import ( TickData, OrderData, TradeData, PositionData, AccountData, ContractData, OrderRequest, CancelRequest, SubscribeRequest, HistoryRequest, ) from vnpy.trader.constant import ( Direction, Offset, Exchange, ...
mit
partofthething/home-assistant
homeassistant/components/gios/__init__.py
10
2334
"""The GIOS component.""" import logging from aiohttp.client_exceptions import ClientConnectorError from async_timeout import timeout from gios import ApiError, Gios, InvalidSensorsData, NoStationError from homeassistant.core import Config, HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from h...
mit
geertj/python-ad
lib/ad/test/base.py
2
8407
# # This file is part of Python-AD. Python-AD is free software that is made # available under the MIT license. Consult the file "LICENSE" that is # distributed together with this file for the exact licensing terms. # # Python-AD is copyright (c) 2007 by the Python-AD authors. See the file # "AUTHORS" for a complete ove...
mit
fanhero/thumbor
tests/engines/test_pil.py
4
5566
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from __future__ import unicode_literals, absolute_import from os.pat...
mit
AtScaleInc/Impala
tests/common/query.py
10
4808
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, 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
simplegeo/hadoop
contrib/hod/testing/testThreads.py
182
3075
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
apache-2.0
alash3al/rethinkdb
external/v8_3.30.33.16/build/gyp/test/generator-output/gyptest-top-all.py
216
1437
#!/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 building a project hierarchy created when the --generator-output= option is used to put the build configuration files in a sepa...
agpl-3.0
PeteTheAutomator/ACServerManager
session/migrations/0008_auto_20160902_1030.py
1
1888
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('session', '0007_auto_20160829_1728'), ] operations = [ migrations.AddField( model_name='preset', nam...
mit
djangorussia/django-1.3-branch
django/views/static.py
151
4888
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import mimetypes import os import posixpath import re import urllib from django.http import Http404, HttpResponse, HttpResponseRedirect, HttpResponseNotModified from djan...
bsd-3-clause
163gal/Time-Line
libs_arm/wx/lib/pubsub/core/kwargs/listenerimpl.py
5
3561
""" :copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved. :license: BSD, see LICENSE_BSD_Simple.txt for details. """ from .listenerbase import ListenerBase, ValidatorBase from .callables import ListenerMismatchError class Listener(ListenerBase): """ Wraps a callable so it can be store...
gpl-3.0
thardie/Diamond
src/collectors/ceph/test/testceph.py
60
7717
#!/usr/bin/python # coding=utf-8 try: import json except ImportError: import simplejson as json import subprocess from test import CollectorTestCase from test import get_collector_config from test import unittest from test import run_only from mock import patch, call from diamond.collector import Collector ...
mit
florian-dacosta/OpenUpgrade
addons/hr/res_users.py
44
3136
from openerp.osv import fields, osv from openerp.tools.translate import _ class res_users(osv.Model): """ Update of res.users class - if adding groups to an user, check if base.group_user is in it (member of 'Employee'), create an employee form linked to it. """ _name = 'res.users' _in...
agpl-3.0
myusuf3/courtside
courtside/register/factories.py
8
1871
import factory import datetime from game import models from register.models import Player, Sport from django.contrib.auth.models import User class SportFactory(factory.django.DjangoModelFactory): FACTORY_FOR = Sport sport = factory.Iterator(['soccer', 'basketball', 'volleyball', 'hockey', 'baseball'], cycle...
mit
EdLogan18/logan-repository
plugin.video.adryanlist/_ytplist.py
173
4161
import urllib import urllib2,json import xbmcvfs import requests,time import os,xbmc,xbmcaddon,xbmcgui,re addon = xbmcaddon.Addon('plugin.video.live.streamspro') profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8')) cacheDir = os.path.join(profile, 'cachedir') clean_cache=os.path.join(cacheDir,'cl...
gpl-2.0
log2timeline/plaso
plaso/parsers/sqlite_plugins/twitter_ios.py
3
12761
# -*- coding:utf-8 -*- """SQLite parser plugin for Twitter on iOS 8+ database files.""" from dfdatetime import posix_time as dfdatetime_posix_time from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions from plaso.parsers import sqlite from plaso.parsers.sqlite_p...
apache-2.0
jmartinm/invenio
modules/oaiharvest/lib/oai_harvest_config.py
21
3553
## This file is part of Invenio. ## Copyright (C) 2010, 2011 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 option) any later version. ## ...
gpl-2.0
Vifon/ranger
ranger/core/actions.py
1
53993
# This file is part of ranger, the console file manager. # License: GNU GPL version 3, see the file "AUTHORS" for details. # pylint: disable=too-many-lines,attribute-defined-outside-init from __future__ import (absolute_import, division, print_function) import codecs import os from os import link, symlink, listdir, ...
gpl-3.0
gangadhar-kadam/mtn-erpnext
setup/doctype/naming_series/naming_series.py
6
5012
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # 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...
agpl-3.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/dataframe/transforms/sparsify.py
76
2727
# 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...
bsd-2-clause
eshijia/SUR
magnum/db/sqlalchemy/alembic/versions/3a938526b35d_add_docker_volume_size.py
17
1037
# Copyright 2015 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
ndevenish/simplehistogram
simplehist/binning.py
1
2817
# coding: utf-8 """ bins.py Copyright (c) 2011 Nicholas Devenish <n.e.devenish@sussex.ac.uk> Contains the logic for creating and inspecting sequences of bins """ __license__ = """Copyright (c) 2011 Nicholas Devenish <n.e.devenish@sussex.ac.uk> MIT License <http://www.opensource.org/licenses/mit-license.php> """ im...
mit
freesmartphone/framework
framework/subsystems/opimd/pimd_messages.py
1
29060
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Open PIM Daemon (C) 2008 by Soeren Apel <abraxa@dar-clan.de> (C) 2008 Openmoko, Inc. (C) 2009 Michael 'Mickey' Lauer <mlauer@vanille-media.de> (C) 2009 Sebastian Krzyszkowiak <seba.dos1@gmail.com> (C) 2009 Tom "TAsn" Hacohen <tom@stosb.com> GPLv2 or later Messages Dom...
gpl-2.0
Dino0631/RedRain-Bot
cogs/cogs/notinusecogs/streams.py
7
25768
from discord.ext import commands from .utils.dataIO import dataIO from .utils.chat_formatting import escape_mass_mentions from .utils import checks from collections import defaultdict from string import ascii_letters from random import choice import discord import os import re import aiohttp import asyncio import loggi...
gpl-3.0
you21979/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/stack_utils.py
215
2734
# Copyright (C) 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 ...
bsd-3-clause
Amechi101/concepteur-market-app
venv/lib/python2.7/site-packages/psycopg2/tests/test_psycopg2_dbapi20.py
71
1932
#!/usr/bin/env python # test_psycopg2_dbapi20.py - DB API conformance test for psycopg2 # # Copyright (C) 2006-2011 Federico Di Gregorio <fog@debian.org> # # psycopg2 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 Softwa...
mit
jfzazo/wireshark-hwgen
src/tools/make-dissector-reg.py
35
9061
#!/usr/bin/env python # # Looks for registration routines in the protocol dissectors, # and assembles C code to call all the routines. # # This is a Python version of the make-reg-dotc shell script. # Running the shell script on Win32 is very very slow because of # all the process-launching that goes on --- multiple gr...
gpl-2.0
lilleswing/deepchem
examples/hiv/hiv_irv.py
6
1107
""" Script that trains multitask models on hiv dataset. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import numpy as np import deepchem as dc from deepchem.molnet import load_hiv # Only for debug! np.random.seed(123) # Load hiv dataset n_features =...
mit
alivecor/tensorflow
tensorflow/python/training/server_lib_sparse_job_test.py
133
1605
# 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
cloudera/hue
desktop/core/ext-py/cx_Oracle-6.4.1/samples/DatabaseShutdown.py
2
1412
#------------------------------------------------------------------------------ # Copyright 2016, 2017, Oracle and/or its affiliates. All rights reserved. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # # Portions Copyright 2001-2007, Computronix (Canada) Ltd., Edmonton, Alberta, # Canada. Al...
apache-2.0
algolia/algoliasearch-django
tests/test_decorators.py
1
3464
from mock import ( ANY, call, patch ) from django.test import TestCase from algoliasearch_django import algolia_engine from algoliasearch_django.decorators import disable_auto_indexing from .factories import UserFactory, WebsiteFactory from .models import User class DecoratorsTestCase(TestCase): de...
mit
scorpionboy30/zerorpc-python
zerorpc/heartbeat.py
12
4650
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Softwa...
mit
prarthitm/edxplatform
common/lib/xmodule/xmodule/library_root_xblock.py
2
5155
""" 'library' XBlock (LibraryRoot) """ import logging from xmodule.studio_editable import StudioEditableModule from xblock.fields import Scope, String, List, Boolean from xblock.fragment import Fragment from xblock.core import XBlock log = logging.getLogger(__name__) # Make '_' a no-op so we can scrape strings. Usi...
agpl-3.0
UrusTeam/android_ndk_toolchain_cross
share/gdb/python/gdb/command/prompt.py
26
2079
# Extended prompt. # Copyright (C) 2011-2016 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later vers...
gpl-2.0
phihag/youtube-dl
youtube_dl/extractor/makerschannel.py
66
1593
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class MakersChannelIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?makerschannel\.com/.*(?P<id_type>video|production)_id=(?P<id>[0-9]+)' _TEST = { 'url': 'http://makerschannel.com/en/zoomin/commu...
unlicense
taiyuanfang/gyp
test/subdirectory/gyptest-subdir-default.py
185
1026
#!/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 building a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output build director...
bsd-3-clause
sonuyos/couchpotato
libs/unrar2/rar_exceptions.py
153
1391
# Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov # # 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...
gpl-3.0
ForestClaw/forestclaw
applications/paper/transport_cylinder/setplot.py
3
3668
""" Set up the plot figures, axes, and items to be done for each frame. This module is imported by the plotting routines and then the function setplot is called to set the plot parameters. """ from __future__ import absolute_import #-------------------------- def setplot(plotdata=None): #--------------------...
bsd-2-clause
niphlod/w2p_tvseries
languages/hu.py
42
4423
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN', '%Y-%m-%d': '%Y.%m.%d.', '%Y-%m-%d %H:%M:%S': '%Y.%m.%d. %H:%M:%S', '%s...
gpl-3.0
righthandabacus/shadowsocks
tests/test.py
1016
5029
#!/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
szilveszter/django
django/utils/daemonize.py
169
2046
import os import sys from . import six buffering = int(six.PY3) # No unbuffered text I/O on Python 3 (#20815). if os.name == 'posix': def become_daemon(our_home_dir='.', out_log='/dev/null', err_log='/dev/null', umask=0o022): "Robustly turn into a UNIX daemon, running in our_...
bsd-3-clause
diox/zamboni
lib/iarc_v2/client.py
1
7197
# -*- coding: utf8 -*- import datetime import requests from urlparse import urljoin from uuid import UUID from django.conf import settings from django.db import transaction import commonware.log from post_request_task.task import task from lib.iarc_v2.serializers import IARCV2RatingListSerializer from mkt.site.helpe...
bsd-3-clause
openhatch/oh-mainline
vendor/packages/decorator/setup.py
23
1678
try: from setuptools import setup except ImportError: from distutils.core import setup import os.path def getversion(fname): """Get the __version__ reading the file: works both in Python 2.X and 3.X, whereas direct importing would break in Python 3.X with a syntax error""" for line in open(fname): ...
agpl-3.0
maartenq/ansible
lib/ansible/modules/cloud/vultr/vultr_dns_domain_facts.py
27
2815
#!/usr/bin/python # # (c) 2018, Yanis Guenane <yanis+ansible@guenane.org> # 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
googlearchive/rgc-models
response_model/python/metric_learning/end_to_end/stimulus_response_embedding.py
1
11824
# Copyright 2018 Google 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 writing, s...
apache-2.0
endlessm/chromium-browser
tools/perf/measurements/dual_metric_measurement.py
3
1304
# Copyright 2018 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.web_perf import story_test from telemetry.web_perf import timeline_based_measurement class DualMetricMeasurement(story_test.StoryTest): ""...
bsd-3-clause
oesteban/preprocessing-workflow
fmriprep/interfaces/nilearn.py
1
5856
#!/usr/bin/env python # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Image tools interfaces ~~~~~~~~~~~~~~~~~~~~~~ """ import nibabel as nb import numpy as np from skimage import morphology as sim from scipy.ndimage.morphol...
bsd-3-clause
Idematica/django-oscar
oscar/apps/dashboard/reports/utils.py
78
1231
from oscar.core.loading import get_class, get_classes OrderReportGenerator = get_class('order.reports', 'OrderReportGenerator') ProductReportGenerator, UserReportGenerator \ = get_classes('analytics.reports', ['ProductReportGenerator', 'UserReportGenerator']) OpenBasketReport...
bsd-3-clause
fnouama/intellij-community
python/helpers/pydev/pydevd_attach_to_process/winappdbg/breakpoint.py
102
168168
#!~/.wine/drive_c/Python25/python.exe # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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 ...
apache-2.0
bcarr092/CSignal
test/test_driver.py
1
1372
#!/usr/local/bin/python import csignal_tests import unittest import sys from test_csignal import TestsCSignal f...
apache-2.0
WebSpider/headphones
lib/yaml/nodes.py
985
1440
class Node(object): def __init__(self, tag, value, start_mark, end_mark): self.tag = tag self.value = value self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): value = self.value #if isinstance(value, list): # if len(value) == 0: ...
gpl-3.0
xiaotdl/ansible
lib/ansible/plugins/inventory/script.py
147
1055
# (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
Semi-global/edx-platform
lms/djangoapps/courseware/masquerade.py
113
10385
''' ---------------------------------------- Masquerade ---------------------------------------- Allow course staff to see a student or staff view of courseware. Which kind of view has been selected is stored in the session state. ''' import logging from django.conf import settings from django.contrib.auth.decorators...
agpl-3.0
orekyuu/intellij-community
python/lib/Lib/distutils/command/clean.py
135
2918
"""distutils.command.clean Implements the Distutils 'clean' command.""" # contributed by Bastian Kleineidam <calvin@cs.uni-sb.de>, added 2000-03-18 # This module should be kept compatible with Python 2.1. __revision__ = "$Id: clean.py 38532 2005-03-03 08:12:27Z loewis $" import os from distutils.core import Comman...
apache-2.0
mkiyer/chimerascan
chimerascan/deprecated/filter_transcriptome_multihits_v1.py
6
3886
''' Created on Jun 8, 2012 @author: mkiyer ''' import sys import logging import argparse import os # local imports import chimerascan.pysam as pysam from chimerascan.lib import config from chimerascan.lib.base import imin2 from chimerascan.lib.sam import parse_pe_reads, copy_read from chimerascan.lib.feature import T...
gpl-3.0
AccelAI/accel.ai
flask-aws/lib/python2.7/site-packages/werkzeug/contrib/limiter.py
295
1333
# -*- coding: utf-8 -*- """ werkzeug.contrib.limiter ~~~~~~~~~~~~~~~~~~~~~~~~ A middleware that limits incoming data. This works around problems with Trac_ or Django_ because those directly stream into the memory. .. _Trac: http://trac.edgewall.org/ .. _Django: http://www.djangoproject.com/ ...
mit
mfcabrera/luigi
luigi/tools/deps.py
12
4701
#!/usr/bin/env python # Finds all tasks and task outputs on the dependency paths from the given downstream task T # up to the given source/upstream task S (optional). If the upstream task is not given, # all upstream tasks on all dependancy paths of T will be returned. # Terms: # if the execution of Task T depends ...
apache-2.0
angryrancor/kivy
examples/android/takepicture/main.py
38
2522
''' Take picture ============ .. author:: Mathieu Virbel <mat@kivy.org> Little example to demonstrate how to start an Intent, and get the result. When you use the Android.startActivityForResult(), the result will be dispatched into onActivityResult. You can catch the event with the android.activity API from python-fo...
mit
TheTypoMaster/linux-pm
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
40223123/finaltestone
static/Brython3.1.3-20150514-095342/Lib/unittest/test/testmock/testwith.py
739
5806
import unittest from warnings import catch_warnings from unittest.test.testmock.support import is_instance from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call something = sentinel.Something something_else = sentinel.SomethingElse class WithTest(unittest.TestCase): def test_with_sta...
agpl-3.0
nekohayo/meld
meld/vc/cvs.py
2
7183
### Copyright (C) 2002-2005 Stephen Kennedy <stevek@gnome.org> ### Redistribution and use in source and binary forms, with or without ### modification, are permitted provided that the following conditions ### are met: ### ### 1. Redistributions of source code must retain the above copyright ### notice, this list o...
gpl-2.0
anryko/ansible
lib/ansible/modules/network/panos/_panos_cert_gen_ssh.py
37
6369
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
wbarfuss/pyunicorn
pyunicorn/climate/spearman.py
2
4757
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of pyunicorn. # Copyright (C) 2008--2015 Jonathan F. Donges and pyunicorn authors # URL: <http://www.pik-potsdam.de/members/donges/software> # License: BSD (3-clause) """ Provides classes for generating and analyzing complex climate networks. """ # # Im...
bsd-3-clause
shuggiefisher/django-on-google-app-engine-base
django/contrib/comments/forms.py
245
8730
import time import datetime from django import forms from django.forms.util import ErrorDict from django.conf import settings from django.contrib.contenttypes.models import ContentType from models import Comment from django.utils.crypto import salted_hmac, constant_time_compare from django.utils.encoding import force_...
bsd-3-clause
davisein/jitsudone
django/django/contrib/localflavor/nl/forms.py
87
2859
""" NL-specific Form helpers """ from __future__ import absolute_import import re from django.contrib.localflavor.nl.nl_provinces import PROVINCE_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, Select from django.utils.encoding i...
bsd-3-clause
fentas/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py
658
7598
# 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...
bsd-3-clause
dgnorth/drift-base
driftbase/api/machines.py
1
8672
import logging import datetime from six.moves import http_client from flask import request, url_for, g, jsonify from flask.views import MethodView import marshmallow as ma from flask_restx import reqparse from flask_smorest import Blueprint, abort from drift.core.extensions.urlregistry import Endpoints fro...
mit
flask-admin/flask-admin
examples/tinymongo/app.py
5
3592
""" Example of Flask-Admin using TinyDB with TinyMongo refer to README.txt for instructions Author: Bruno Rocha <@rochacbruno> Based in PyMongo Example and TinyMongo """ import flask_admin as admin from flask import Flask from flask_admin.contrib.pymongo import ModelView, filters from flask_admin.form import Select2W...
bsd-3-clause
mayblue9/scikit-learn
sklearn/feature_extraction/tests/test_text.py
41
35602
from __future__ import unicode_literals import warnings from sklearn.feature_extraction.text import strip_tags from sklearn.feature_extraction.text import strip_accents_unicode from sklearn.feature_extraction.text import strip_accents_ascii from sklearn.feature_extraction.text import HashingVectorizer from sklearn.fe...
bsd-3-clause