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
knowsis/django
django/contrib/sites/models.py
114
3549
from __future__ import unicode_literals import string from django.db import models from django.db.models.signals import pre_save, pre_delete from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible from django.core.exceptions import ValidationError SITE_C...
bsd-3-clause
yencarnacion/jaikuengine
.google_appengine/lib/django-1.3/django/contrib/auth/tests/remote_user.py
150
6422
from datetime import datetime from django.conf import settings from django.contrib.auth.backends import RemoteUserBackend from django.contrib.auth.models import User from django.test import TestCase class RemoteUserTest(TestCase): urls = 'django.contrib.auth.tests.urls' middleware = 'django.contrib.auth.mid...
apache-2.0
chrispbailey/xhtml2pdf
xhtml2pdf/paragraph.py
37
24397
#!/bin/env/python # -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 # # U...
apache-2.0
jonparrott/gcloud-python
dataproc/google/cloud/dataproc_v1/gapic/cluster_controller_client_config.py
3
1989
config = { "interfaces": { "google.cloud.dataproc.v1.ClusterController": { "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], "non_idempotent": [] }, "retry_params": { "default": { "init...
apache-2.0
allanlei/django-saas
saas/multidb/models.py
1
4469
from django.db import models from django.conf import settings from django.utils import simplejson as json from django.db import connections from django.core.exceptions import ValidationError from django.db.utils import ConnectionDoesNotExist import managers from signals import db_pre_load, db_post_load, db_pre_unload,...
bsd-3-clause
opencorato/sayit
speeches/south_migrations/0054__rename_popolospeaker.py
1
19144
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.rename_table('speeches_popolospeaker', 'speeches_speaker') db.alter_column('speeches_recordingtimestamp',...
agpl-3.0
ScreamingUdder/mantid
Framework/PythonInterface/test/python/plugins/algorithms/DeltaPDF3DTest.py
3
6797
from __future__ import (absolute_import, division, print_function) import unittest from mantid.simpleapi import DeltaPDF3D, CreateMDWorkspace, FakeMDEventData, BinMD, mtd import numpy as np class DeltaPDF3DTest(unittest.TestCase): @classmethod def setUpClass(cls): """ Create fake workspaces,...
gpl-3.0
UWIT-IAM/uw-restclients
restclients/test/util/retry.py
4
5520
from django.test import TestCase from restclients.exceptions import DataFailureException from restclients.util.retry import retry class RetryableError(Exception): pass class AnotherRetryableError(Exception): pass class UnexpectedError(Exception): pass class RetryTest(TestCase): def test_bad_arg...
apache-2.0
RNAcentral/rnacentral-import-pipeline
rnacentral_pipeline/databases/genecards_suite/core/helpers.py
1
1351
# -*- coding: utf-8 -*- """ Copyright [2009-2019] EMBL-European Bioinformatics Institute 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...
apache-2.0
argonemyth/sentry
tests/sentry/tsdb/test_redis.py
4
2914
import pytz from datetime import datetime, timedelta from sentry.testutils import TestCase from sentry.tsdb.base import TSDBModel, ONE_MINUTE, ONE_HOUR, ONE_DAY from sentry.tsdb.redis import RedisTSDB class RedisTSDBTest(TestCase): def setUp(self): self.db = RedisTSDB(hosts={ 0: {'db': 9} ...
bsd-3-clause
rajanandakumar/DIRAC
FrameworkSystem/private/monitoring/RRDManager.py
4
10181
# $HeadURL$ __RCSID__ = "$Id$" import os import os.path try: import hashlib as md5 except: import md5 from DIRAC import gLogger, gConfig, S_OK, S_ERROR from DIRAC.ConfigurationSystem.Client.PathFinder import getServiceSection from DIRAC.FrameworkSystem.private.monitoring.ColorGenerator import ColorGenerator from DI...
gpl-3.0
hcs/mailman
src/mailman/core/switchboard.py
1
11246
# Copyright (C) 2001-2012 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at you...
gpl-3.0
evanepio/dotmanca
dotmanca/users/tests/test_views.py
1
2027
from django.test import RequestFactory from django.test import TestCase from ..views import ( UserRedirectView, UserUpdateView ) from ..models import User class BaseUserTestCase(TestCase): def setUp(self): self.user = User.objects.create_user(username='testuser', ...
mit
data-exp-lab/girder
plugins/item_tasks/server/slicer_cli_tasks.py
2
9672
import json from girder.api import access from girder.api.describe import autoDescribeRoute, Description from girder.api.rest import boundHandler, filtermodel from girder.constants import AccessType from girder.exceptions import RestException from girder.models.folder import Folder from girder.models.item import Item ...
apache-2.0
theshadowx/enigma2
lib/python/Components/ConfigList.py
4
7757
from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from config import KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_OK, KEY_TOGGLEOW, KEY_ASCII, KEY_TIMEOUT, KEY_NUMBERS, ConfigElement, ConfigText, ConfigPassword from Components.ActionMap import NumberActionMap...
gpl-2.0
mantidproject/mantid
qt/python/mantidqt/dialogs/errorreports/resources_qt5.py
3
234281
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.14.1) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\xdc\x69\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\xc8\x...
gpl-3.0
muadibbm/gini
frontend/src/gbuilder/UI/TabWidget.py
11
1136
"""The project tab widget to hold the canvas""" from PyQt4 import QtCore, QtGui class TabWidget(QtGui.QTabWidget): def __init__(self, parent = None): """ Create a project tab widget. """ QtGui.QTabWidget.__init__(self, parent) self.chosenSize = None self....
mit
all-of-us/raw-data-repository
rdr_service/services/google_sheets_client.py
1
13026
import backoff from googleapiclient import discovery from googleapiclient.errors import HttpError from oauth2client.service_account import ServiceAccountCredentials import socket from rdr_service.services.gcp_utils import gcp_get_iam_service_key_info class GoogleSheetsClient: """ Allows for interacting with ...
bsd-3-clause
w0rp/w0rpzone
blog/urls.py
1
2639
from django.conf.urls import re_path from django.contrib.auth.decorators import login_required from w0rplib.url import redir from .feed import LatestArticleFeed from .views import ( ArticleBanCommenterView, ArticleDeleteCommentView, ArticleDetailView, ArticleEditPageView, ArticleMonthArchiveView, ...
bsd-2-clause
mdshuai/docker-registry
docker_registry/lib/cache.py
35
1360
# -*- coding: utf-8 -*- import logging import redis from docker_registry.core import lru from . import config logger = logging.getLogger(__name__) redis_conn = None cache_prefix = None cfg = config.load() def init(): enable_redis_cache(cfg.cache, cfg.storage_path) enable_redis_lru(cfg.cache_lru, cfg.st...
apache-2.0
syaiful6/django
tests/gis_tests/gdal_tests/test_geom.py
256
20748
import json import unittest from binascii import b2a_hex from unittest import skipUnless from django.contrib.gis.gdal import HAS_GDAL from django.utils.six.moves import range from ..test_data import TestDataMixin try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle if...
bsd-3-clause
MycChiu/tensorflow
tensorflow/contrib/bayesflow/__init__.py
57
1871
# 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
darkleons/odoo
addons/account_chart/__openerp__.py
313
1451
# -*- 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
hbenarab/mt-iebkg
run_on_ollie_dataset.py
1
8580
__author__ = 'heni' import datetime import math import numpy import pickle from utils.tools import get_accuracy from ollie_comparison.utils.training_tools import create_word2ind,create_network,get_labeled_data from utils.tools import shuffle def run_on_ollie_dataset(iob_ollie_dataset_path,use_cross_validation): ...
mit
naresh21/synergetics-edx-platform
lms/djangoapps/notifier_api/serializers.py
11
2620
from django.contrib.auth.models import User from django.http import Http404 from rest_framework import serializers from openedx.core.djangoapps.course_groups.cohorts import is_course_cohorted from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY from lms.djangoapps.notification_prefs import NOTIFICATION_PREF_KEY...
agpl-3.0
konstruktoid/ansible-upstream
lib/ansible/modules/remote_management/oneview/oneview_ethernet_network.py
147
8911
#!/usr/bin/python # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # 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
xujun10110/golismero
thirdparty_libs/nltk/corpus/reader/cmudict.py
17
3476
# Natural Language Toolkit: Genesis Corpus Reader # # Copyright (C) 2001-2012 NLTK Project # Author: Steven Bird <sb@ldc.upenn.edu> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ The Carnegie Mellon Pronouncing Dictionary [cmudict.0.6] ftp://ftp.cs.cmu.edu/project/speech/dict/ Copyright 1...
gpl-2.0
righetz/pyurl
pyurl.py
1
4354
#!/usr/bin/python3 """Simple CUrl porting for Python3 """ import urllib.request, re import sys import argparse from urllib.parse import urlencode import gettext import locale def main(): """"main method""" language_set() parser = argparse.ArgumentParser() #setting possible arguments parser.add_argumen...
gpl-2.0
midori1/midorinoblog
site-packages/django/core/handlers/base.py
49
10871
from __future__ import unicode_literals import logging import sys import types from django import http from django.conf import settings from django.core import urlresolvers from django.core import signals from django.core.exceptions import MiddlewareNotUsed, PermissionDenied, SuspiciousOperation from django.db import...
apache-2.0
hgl888/chromium-crosswalk-efl
chrome/test/mini_installer/variable_expander.py
54
6255
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import base64 import hashlib import os import string import win32api import win32com.client from win32com.shell import shell, shellcon import win32security ...
bsd-3-clause
gmittal/aar-nlp-research-2016
src/pygame-pygame-6625feb3fc7f/build/lib.linux-x86_64-2.7/pygame/examples/scroll.py
32
6792
#!/usr/bin/env python """An zoomed image viewer that demonstrates Surface.scroll This example shows a scrollable image that has a zoom factor of eight. It uses the Surface.scroll function to shift the image on the display surface. A clip rectangle protects a margin area. If called as a function, the example accepts a...
mit
mstone/vscan
cpplint.py
1
123523
#!/usr/bin/python2.4 # # Copyright (c) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
bsd-3-clause
idaholab/raven
plugins/ExamplePlugin/src/SumOfExponential.py
1
5349
""" Author: A. Alfonsi Date : 11/17/2017 """ import numpy as np import math from PluginBaseClasses.ExternalModelPluginBase import ExternalModelPluginBase class SumOfExponential(ExternalModelPluginBase): # Example External Model plugin class ################################# #### RAVEN API methods BEGIN ...
apache-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/networkx/algorithms/graphical.py
4
13009
# -*- coding: utf-8 -*- """Test sequences for graphiness. """ # Copyright (C) 2004-2018 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import heapq import networkx as nx __author__ = "\n".join(['Aric Hagberg...
gpl-3.0
huangzonghao/ycmd
cpp/ycm/tests/gmock/gtest/scripts/upload.py
2511
51024
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
gpl-3.0
firebitsbr/pwn_plug_sources
src/metagoofil/hachoir_metadata/metadata.py
9
9138
# -*- coding: utf-8 -*- from hachoir_core.compatibility import any, sorted from hachoir_core.endian import endian_name from hachoir_core.tools import makePrintable, makeUnicode from hachoir_core.dict import Dict from hachoir_core.error import error, HACHOIR_ERRORS from hachoir_core.i18n import _ from hachoir_core.log i...
gpl-3.0
yinquan529/platform-external-chromium_org
chrome/test/mini_installer/verifier.py
85
2063
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class Verifier: """Verifies that the current machine states match the expectation.""" def VerifyInput(self, verifier_input, variable_expander): """...
bsd-3-clause
fujunwei/chromium-crosswalk
third_party/markdown/__init__.py
109
17943
# markdown is released under the BSD license # Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later) # Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) # Copyright 2004 Manfred Stienstra (the original version) # # All rights reserved. # # Redistribution and use in source and binary forms, with or...
bsd-3-clause
rew4332/tensorflow
tensorflow/python/ops/control_flow_grad.py
5
8484
# 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...
apache-2.0
imgmix/django-registration
registration/admin.py
19
1671
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from .models import RegistrationProfile from .users import UsernameField from .compat import RequestSite, is_app_installed, get_site_model class RegistrationAdmin(admin.ModelAdmin): actions = ['activate_users', 'resend_activ...
bsd-3-clause
jorsea/odoo-addons
document_page_adhoc/web/controllers/wiki.py
7
1192
import base64 import cherrypy import openobject from openobject.tools import expose from openerp.controllers import SecuredController class WikiView(SecuredController): _cp_path = "/wiki/wiki" def get_attachment(self, **kwargs): attachments = openobject.rpc.RPCProxy('ir.attachment') file_...
agpl-3.0
loctran17/libkml
examples/python/hellowalk.py
25
3057
#!/usr/bin/env python # Copyright 2008, Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list ...
bsd-3-clause
Intel-Corporation/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/sample_stats_test.py
24
18846
# 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
dnephin/docker-py
docker/ssladapter/ssladapter.py
46
1847
""" Resolves OpenSSL issues in some servers: https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/ https://github.com/kennethreitz/requests/pull/799 """ from distutils.version import StrictVersion from requests.adapters import HTTPAdapter import ssl try: import requests.packages.urllib3 as url...
apache-2.0
jtrain/django-cloud-media
cloud_media/forms.py
1
7970
""" A collection of forms for adding a new resource in the admin. """ from django import forms from django.conf import settings from django.contrib.admin.helpers import AdminForm from django.core.exceptions import ImproperlyConfigured from django.utils.translation import ugettext_lazy as _ from django.utils.importlib ...
bsd-3-clause
daavery/audacity
lib-src/lv2/sratom/waflib/Tools/glib2.py
330
8170
#! /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 os from waflib import Task,Utils,Options,Errors,Logs from waflib.TaskGen import taskgen_method,before_method,after_method,feature @taskgen_method def add_marshal_file(s...
gpl-2.0
yyoncho/switcher
internal/test.py
7
2961
#!/usr/bin/env python # -*- coding: utf-8 -*- # This script allows easy testing of the template project. The only argument # is the directory to which to copy and generate the template project. from __future__ import print_function import os import sys import shutil import argparse import subprocess from distutils.di...
mit
chanijjani/TizenRT
external/protobuf/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/test_util.py
51
27898
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
apache-2.0
nanolearning/edx-platform
i18n/tests/test_generate.py
15
3683
from datetime import datetime, timedelta import os import sys import string import random import re from unittest import TestCase from mock import patch from polib import pofile from pytz import UTC from i18n import extract from i18n import generate from i18n import dummy from i18n.config import CONFIGURATION class...
agpl-3.0
feroda/odoo
addons/payment_ogone/data/ogone.py
395
30321
# -*- coding: utf-8 -*- OGONE_ERROR_MAP = { '0020001001': "Authorization failed, please retry", '0020001002': "Authorization failed, please retry", '0020001003': "Authorization failed, please retry", '0020001004': "Authorization failed, please retry", '0020001005': "Authorization failed, please ret...
agpl-3.0
p0psicles/SickRage
lib/html5lib/filters/whitespace.py
1730
1142
from __future__ import absolute_import, division, unicode_literals import re from . import _base from ..constants import rcdataElements, spaceCharacters spaceCharacters = "".join(spaceCharacters) SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) class Filter(_base.Filter): spacePreserveElements = frozenset...
gpl-3.0
renatolage/wallets-BRCoin
share/qt/extract_strings_qt.py
2945
1844
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
mit
Softmotions/edx-platform
openedx/core/djangoapps/content/course_overviews/migrations/0004_default_lowest_passing_grade_to_None.py
62
3157
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'CourseOverview.lowest_passing_grade' db.alter_column('...
agpl-3.0
alfredodeza/execnet
testing/test_serializer.py
1
7330
# -*- coding: utf-8 -*- import subprocess import sys import tempfile import execnet import py import pytest MINOR_VERSIONS = {"3": "543210", "2": "76"} def _find_version(suffix=""): name = "python" + suffix executable = py.path.local.sysfind(name) if executable is None: if sys.platform == "win32...
mit
namangl/artificial-intelligence
Search/code/graphicsUtils.py
11
11887
# graphicsUtils.py # ---------------- # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to http://ai.berkel...
mit
mewiteor/shadowsocks
shadowsocks/crypto/openssl.py
1038
5414
#!/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
MarcosCommunity/odoo
addons/product_expiry/product_expiry.py
7
5654
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
agpl-3.0
liggitt/openshift-ansible
roles/openshift_health_checker/test/zz_failure_summary_test.py
53
2115
from zz_failure_summary import deduplicate_failures import pytest @pytest.mark.parametrize('failures,deduplicated', [ ( [ { 'host': 'master1', 'msg': 'One or more checks failed', }, ], [ { 'host': ('master...
apache-2.0
babycaseny/audacity
lib-src/lv2/lv2/plugins/eg-fifths.lv2/waflib/Runner.py
330
4483
#! /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 random,atexit try: from queue import Queue except ImportError: from Queue import Queue from waflib import Utils,Task,Errors,Logs GAP=10 class TaskConsumer(Utils.threa...
gpl-2.0
himaaaatti/qtile
libqtile/widget/wallpaper.py
4
3016
# Copyright (c) 2015 Muhammed Abuali # # 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, merge, publish, dis...
mit
twitter/pants
src/python/pants/task/task.py
1
28963
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os import sys from abc import abstractmethod from builtins import filter, map, obj...
apache-2.0
testalt/electrum-dgc
lib/mnemonic.py
12
5737
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 Thomas Voegtlin # # 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 y...
gpl-3.0
elainexmas/boto
boto/cognito/sync/exceptions.py
135
1648
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
ataylor32/django
tests/view_tests/tests/test_static.py
337
5470
from __future__ import unicode_literals import mimetypes import unittest from os import path from django.conf.urls.static import static from django.http import FileResponse, HttpResponseNotModified from django.test import SimpleTestCase, override_settings from django.utils.http import http_date from django.views.stat...
bsd-3-clause
daviddesancho/mdtraj
mdtraj/utils/external/astor/codegen.py
11
15848
# -*- coding: utf-8 -*- """ This module converts an AST into Python source code. Original code copyright (c) 2008 by Armin Ronacher and is distributed under the 3-clause BSD license. It was derived from a modified version found here: https://gist.github.com/1250562 """ import ast from .misc import (ExplicitNo...
lgpl-2.1
henryfjordan/django
tests/str/models.py
409
1300
# -*- coding: utf-8 -*- """ Adding __str__() or __unicode__() to models Although it's not a strict requirement, each model should have a ``_str__()`` or ``__unicode__()`` method to return a "human-readable" representation of the object. Do this not only for your own sanity when dealing with the interactive prompt, but...
bsd-3-clause
ddurdle/KODI-MediaFire
resources/lib/authorization.py
8
1695
''' Copyright (C) 2014 ddurdle 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 version. This program is distrib...
gpl-2.0
0k/openerp-server
openerp/tools/test_reports.py
67
13355
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
jzoldak/edx-platform
openedx/core/djangoapps/bookmarks/services.py
44
4441
""" Bookmarks service. """ import logging from django.core.exceptions import ObjectDoesNotExist from xmodule.modulestore.django import modulestore from xmodule.modulestore.exceptions import ItemNotFoundError from request_cache.middleware import RequestCache from . import DEFAULT_FIELDS, api log = logging.getLogger...
agpl-3.0
sephalon/python-ivi
ivi/agilent/agilent8595EM.py
6
1559
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2013-2014 Alex Forencich 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...
mit
jianglu/mojo
mojo/PRESUBMIT_test.py
10
13568
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import unittest import PRESUBMIT sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) fr...
bsd-3-clause
yongshengwang/builthue
desktop/core/ext-py/Django-1.4.5/django/views/generic/detail.py
78
5572
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import Http404 from django.utils.encoding import smart_str from django.utils.translation import ugettext as _ from django.views.generic.base import TemplateResponseMixin, View class SingleObjectMixin(object): """ Prov...
apache-2.0
binarydud/django-oscar
src/oscar/apps/offer/migrations/0001_initial.py
52
15207
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import oscar.models.fields.autoslugfield from decimal import Decimal import oscar.models.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('catalogue', ...
bsd-3-clause
coderbone/SickRage-alt
setup.py
1
2381
# -*- coding: utf-8 -* """ Use setup tools to install sickchill """ import os from setuptools import find_packages, setup from requirements.sort import file_to_dict try: from babel.messages import frontend as babel except ImportError: babel = None ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__...
gpl-3.0
jennolsen84/PyTables
tables/exceptions.py
5
11309
# -*- coding: utf-8 -*- ######################################################################## # # License: BSD # Created: December 17, 2004 # Author: Francesc Alted - faltet@pytables.com # # $Id$ # ######################################################################## """Declare exceptions and warnings that are...
bsd-3-clause
alphagov/notifications-api
tests/app/v2/notifications/test_post_notifications.py
1
48523
import uuid from unittest import mock from unittest.mock import call import pytest from boto.exception import SQSError from flask import current_app, json from app.dao import templates_dao from app.dao.service_sms_sender_dao import dao_update_service_sms_sender from app.models import ( EMAIL_TYPE, INTERNATION...
mit
CnPaMeng/WeiboMsgBackupGUI
sina/loginsinacom.py
1
22729
#!/usr/bin/python #-*- encoding: utf-8 -*- # This file is part of the Pameng, # Pameng website: http://www.cnpameng.com/, # Sina weibo: http://weibo.com/cnpameng. # This file is part of WeiboMsgBackup. # Copyright (C) 2013 Pameng. # Pameng <pameng.cn@gmail.com>, 2013. # WeiboMsgBackup is free software; you can red...
gpl-2.0
ikvk/imap_tools
tests/messages_data/error_emails/missing_body.py
1
1292
import datetime DATA = dict( subject='REDACTED', from_='redacted@attglobal.net', to=('', '@mailman.enron.com'), cc=(), bcc=(), reply_to=(), date=datetime.datetime(2001, 11, 27, 15, 2, 35, tzinfo=datetime.timezone(datetime.timedelta(-1, 57600))), date_str='Tue, 27 Nov 2001 15:02:35 -...
apache-2.0
gitprouser/appengine-bottle-skeleton
lib/OpenSSL/crypto.py
11
93923
import datetime from base64 import b16encode from functools import partial from operator import __eq__, __ne__, __lt__, __le__, __gt__, __ge__ from warnings import warn as _warn from six import ( integer_types as _integer_types, text_type as _text_type, PY3 as _PY3) from cryptography.hazmat.primitives.as...
apache-2.0
jimrybarski/piwarmer
interface/interface/main.py
2
4474
import redis import json class APIInterface(redis.StrictRedis): def clear(self): """ Resets all data, essentially stopping the current program and going back into a state where we're waiting for new instructions from the user. """ labels = ["current_temp", ...
mit
jrleja/bsfh
prospect/io/read_results.py
3
20576
import sys, os from copy import deepcopy import warnings import pickle, json import numpy as np try: import h5py except: pass try: from sedpy.observate import load_filters except: pass """Convenience functions for reading and reconstructing results from a fitting run, including reconstruction of the m...
mit
chokribr/invenio
invenio/ext/sqlalchemy/types/pickle_binary.py
17
1442
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011, 2012, 2013, 2014 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...
gpl-2.0
avitacek/TempoTrip-UI
node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py
1835
12124
# 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. """New implementation of Visual Studio project generation.""" import os import random import gyp.common # hashlib is supplied as of Python 2.5 as the replacemen...
mit
FrodeSolheim/fs-uae-launcher
system/tools/filescanner.py
1
9278
from typing import Optional import fsui from fsgamesys.amiga.amiga import Amiga from fsgamesys.context import fsgs from fsgamesys.product import Product from fswidgets.panel import Panel from fswidgets.widget import Widget from launcher.i18n import gettext from launcher.launcher_signal import LauncherSignal from launc...
gpl-2.0
guiquanz/httpie
httpie/core.py
44
6033
"""This module provides the main functionality of HTTPie. Invocation flow: 1. Read, validate and process the input (args, `stdin`). 2. Create and send a request. 3. Stream, and possibly process and format, the parts of the request-response exchange selected by output options. 4. Simultaneously write to `...
bsd-3-clause
phoenixsbk/kvmmgr
packaging/setup/plugins/ovirt-engine-common/websocket_proxy/core.py
2
1871
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2014 Red Hat, 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 # # Unl...
apache-2.0
40223110/2015cd_midterm-
static/Brython3.1.0-20150301-090019/Lib/binascii.py
620
24585
"""A pure Python implementation of binascii. Rather slow and buggy in corner cases. PyPy provides an RPython version too. """ # borrowed from https://bitbucket.org/pypy/pypy/src/f2bf94943a41/lib_pypy/binascii.py class Error(Exception): pass class Done(Exception): pass class Incomplete(Exception): pass ...
gpl-3.0
bearstech/ansible
lib/ansible/module_utils/facts/network/sunos.py
62
4804
# 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
bataeves/kaggle
instacart/imba/arboretum_cv.py
2
18971
import gc from concurrent.futures import ThreadPoolExecutor import pandas as pd import numpy as np import os import arboretum import json import sklearn.metrics from sklearn.metrics import f1_score, roc_auc_score from sklearn.model_selection import train_test_split from scipy.sparse import dok_matrix, coo_matrix from ...
unlicense
ingadhoc/odoo-addons
product_pricelist/models/product.py
5
1460
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, fields, api, _ from op...
agpl-3.0
thaumos/ansible
lib/ansible/modules/network/f5/bigip_profile_client_ssl.py
15
35488
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
freenas/py-bsd
bsd/pty.py
1
5200
"""Pseudo terminal utilities. (Slightly modified to work on FreeBSD)""" # Bugs: No signal handling. Doesn't set slave termios and window size. # Only tested on Linux. # See: W. Richard Stevens. 1992. Advanced Programming in the # UNIX Environment. Chapter 19. # Author: Steen Lumholt -- with additions ...
bsd-3-clause
shepdelacreme/ansible
lib/ansible/modules/cloud/amazon/ec2_metric_alarm.py
8
12117
#!/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': ['stableinterf...
gpl-3.0
40223227/w16b_test
static/Brython3.1.1-20150328-091302/Lib/importlib/basehook.py
608
1396
from javascript import JSObject from browser import window import urllib.request class TempMod: def __init__(self, name): self.name=name #define my custom import hook (just to see if it get called etc). class BaseHook: def __init__(self, fullname=None, path=None): self._fullname=fullname self._p...
gpl-3.0
sysadminmatmoz/odoo-clearcorp
account_report_lib/tools/__init__.py
4
1112
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
PyGithub/PyGithub
github/WorkflowRun.py
2
12106
############################ Copyrights and license ############################ # # # Copyright 2020 Steve Kowalik <steven@wedontsleep.org> # # ...
lgpl-3.0
cdepman/falcon_api
site-packages/wheel/metadata.py
230
11050
""" Tools for converting old- to new-style metadata. """ from collections import namedtuple from .pkginfo import read_pkg_info from .util import OrderedDefaultDict try: from collections import OrderedDict except ImportError: OrderedDict = dict import re import os.path import textwrap import pkg_resources impo...
mit
arrti/proxypooler
tests/test_db.py
1
1559
import pytest from proxypooler.errors import ProxyPoolerEmptyError def test_db(conn): conn.put('127.0.0.1:80', 15) conn.put('127.0.0.1:81', 14) conn.put('127.0.0.1:82', 210) conn.put('127.0.0.1:83', 2) conn.put('127.0.0.1:84', 100) assert conn.size == 5 ip = conn.get()[0].decode('utf-8') ...
apache-2.0
intfrr/Gooey
gooey/tests/gui/widgets/componenets2_runner.py
9
4927
from gooey.gui.widgets import components2 __author__ = 'Chris' import unittest import wx from wx.lib.scrolledpanel import ScrolledPanel TEXT_FIELD = components2.TextField({ 'display_name': 'cool title', 'help_msg': 'a help message', 'nargs': '+', 'commands': ['-f', '--fudge'], 'choices': [] }...
mit
AOtools/soapy
doc/source/conf.py
4
13074
# -*- coding: utf-8 -*- # # Soapy documentation build configuration file, created by # sphinx-quickstart on Tue Apr 28 11:49:44 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
gpl-3.0