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
rcbops/keystone-buildpackage
keystone/middleware/auth_token.py
1
16245
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2010-2011 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/lice...
apache-2.0
Prashant-Surya/anitya
tests/test_backend_npmjs.py
4
5411
# -*- coding: utf-8 -*- # # Copyright © 2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed in t...
gpl-2.0
briandalessandro/courses
deeplearning1/nbs/utils/utils.py
8
7644
from __future__ import division,print_function import math, os, json, sys, re import cPickle as pickle from glob import glob import numpy as np from matplotlib import pyplot as plt from operator import itemgetter, attrgetter, methodcaller from collections import OrderedDict import itertools from itertools import chain ...
apache-2.0
Zosoled/Cumulus
robot/Cumulus/resources/locators_45.py
1
15089
"""Locators for Spring '19""" npsp_lex_locators={ 'breadcrumb': "//li[contains(@class, 'slds-breadcrumb__item')]/span[text()='{}']", 'breadcrumb-link':"//a[@title='{}' and contains(@class,'BreadCrumbItem')]", 'placeholder': "//*[contains(@placeholder,'{}')]", 'app_launcher':{ 'select-option':'/...
bsd-3-clause
dhanunjaya/neutron
neutron/plugins/ml2/drivers/type_vxlan.py
28
3577
# Copyright (c) 2013 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 ...
apache-2.0
albertomurillo/ansible
lib/ansible/modules/cloud/kubevirt/kubevirt_template.py
16
14883
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, 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', ...
gpl-3.0
waseem18/oh-mainline
vendor/packages/python-openid/examples/djopenid/consumer/views.py
63
8152
from django import http from django.http import HttpResponseRedirect from django.views.generic.simple import direct_to_template from openid.consumer import consumer from openid.consumer.discover import DiscoveryFailure from openid.extensions import ax, pape, sreg from openid.yadis.constants import YADIS_HEADER_NAME, ...
agpl-3.0
auduny/home-assistant
homeassistant/components/demo/fan.py
7
2725
"""Demo fan platform that has a fake fan.""" from homeassistant.const import STATE_OFF from homeassistant.components.fan import ( SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM, SUPPORT_DIRECTION, SUPPORT_OSCILLATE, SUPPORT_SET_SPEED, FanEntity) FULL_SUPPORT = SUPPORT_SET_SPEED | SUPPORT_OSCILLATE | SUPPORT_DIRECTION LI...
apache-2.0
Ballz0fSteel/Umeko
lib/pip/_vendor/packaging/version.py
1151
11556
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import collections import itertools import re from ._structures import In...
gpl-3.0
jamespcole/home-assistant
tests/helpers/test_template.py
4
39409
"""Test Home Assistant template helper methods.""" import asyncio from datetime import datetime import unittest import random import math import pytz from unittest.mock import patch from homeassistant.components import group from homeassistant.exceptions import TemplateError from homeassistant.helpers import template ...
apache-2.0
t-stark/ec2cli
bash/iam_identities.py
2
2228
#!/usr/bin/env python3 """ Summary. Prints iam usernames from local awscli configuration. A usernames may be omitted from the output simply by listing them with a space between them after the call: $ python3 iam_users.py default Will print all iam usernames in the local configuration except t...
gpl-2.0
Eficent/odoomrp-wip
procurement_plan_mrp/wizard/wiz_change_procurement_date.py
11
1038
# -*- coding: utf-8 -*- # (c) 2015 Alfredo de la Fuente - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, api class WizChangeProcurementDate(models.TransientModel): _inherit = 'wiz.change.procurement.date' def _take_procurements_to_treat(self, procurement...
agpl-3.0
le9i0nx/ansible
test/units/modules/network/ios/test_ios_system.py
57
5380
# # (c) 2016 Red Hat Inc. # # 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 d...
gpl-3.0
ncdesouza/bookworm
env/lib/python2.7/site-packages/jinja2/testsuite/security.py
415
6204
# -*- coding: utf-8 -*- """ jinja2.testsuite.security ~~~~~~~~~~~~~~~~~~~~~~~~~ Checks the sandbox and other security features. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import E...
gpl-3.0
credativUK/OCB
addons/product/_common.py
111
1418
# -*- 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...
agpl-3.0
scripnichenko/glance
glance/tests/functional/v1/test_multiprocessing.py
10
2590
# 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
memo/tensorflow
tensorflow/examples/adding_an_op/zero_out_op_3.py
190
1053
# 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
iuliat/nova
nova/tests/unit/scheduler/filters/test_aggregate_image_properties_isolation_filters.py
56
5302
# 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 # d...
apache-2.0
relman/sevpn-mgmt-py
tests/cedar/test_session.py
1
6285
# -*- coding: utf-8 -*- import mock import socket import ssl import unittest from SevpnMgmtPy.cedar import Session, Watermark class TestSession(unittest.TestCase): def test_start_rpc_session(self): ba = bytearray('\xab\xcd\xef') hello_pack = mock.MagicMock() hello_pack.get_va...
mit
DarkCascade/get2gether
node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py
912
3325
# 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. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are ...
mit
Islandman93/reinforcepy
reinforcepy/learners/dqn/asynchronous/recurrent_thread_learner.py
1
2073
import numpy as np from .q_thread_learner import QThreadLearner class RecurrentThreadLearner(QThreadLearner): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.lstm_state_for_training = self.network.get_lstm_state() def reset(self): super().reset() se...
gpl-3.0
sesamesushi/satisrevude
models/vfs.py
5
3683
# 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 ...
apache-2.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/modulefinder.py
77
23421
"""Find modules used by a script, using introspection.""" import dis import importlib._bootstrap import importlib.machinery import marshal import os import sys import types import struct import warnings with warnings.catch_warnings(): warnings.simplefilter('ignore', PendingDeprecationWarning) import imp # XXX...
gpl-2.0
RAPD/RAPD
src/plugins/subcontractors/xdsme/new/xdsme-0.4.9/XOconv/pycgtypes/mat4.py
12
23700
###################################################################### # mat4 - Matrix class (4x4 matrix) # # Copyright (C) 2002, Matthias Baas (baas@ira.uka.de) # # You may distribute under the terms of the BSD license, as # specified in the file license.txt. ###########################################################...
agpl-3.0
rotofly/odoo
addons/mail/mail_followers.py
15
12402
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
hunter007/wechatpy
wechatpy/pay/api/order.py
2
6074
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import time import random from datetime import datetime, timedelta from wechatpy.utils import timezone from wechatpy.pay.utils import get_external_ip from wechatpy.pay.base import BaseWeChatPayAPI from wechatpy.utils import random_string,...
mit
ruchikd/Algorithms
Python/RankingSystem/rankingSystem.py
1
1182
class Students: def __init__ (self, name, percentage): self.name = name self.percentage = percentage def getPercentile(percentageList): percentageList = sorted(percentageList, reverse=True) print percentageList rank = [] for x in range(len(percentageList)): if percentageList[x][0] != percentageList[x-1][0...
gpl-3.0
Thraxis/SickRage
lib/github/Milestone.py
72
9198
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
DinoCow/airflow
tests/providers/apache/pinot/hooks/test_pinot.py
3
9346
# # 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...
apache-2.0
cloudbase/nova-virtualbox
nova/tests/unit/virt/xenapi/image/test_vdi_through_dev.py
70
6931
# Copyright 2013 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
Awesomeomics/webserver
env/lib/python2.7/site-packages/requests/packages/urllib3/connection.py
67
8298
import datetime import sys import socket from socket import timeout as SocketTimeout import warnings try: # Python 3 from http.client import HTTPConnection as _HTTPConnection, HTTPException except ImportError: from httplib import HTTPConnection as _HTTPConnection, HTTPException class DummyConnection(object)...
mit
sam-m888/gramps
gramps/plugins/export/export.gpr.py
1
6420
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Benny Malengier # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) ...
gpl-2.0
40223110/2015cd_midterm-
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_case.py
738
51689
import difflib import pprint import pickle import re import sys import warnings import weakref import inspect from copy import deepcopy from test import support import unittest from .support import ( TestEquality, TestHashing, LoggingResult, ResultWithNoStartTestRunStopTestRun ) class Test(object): "Ke...
gpl-3.0
badreddinetahir/pwn_plug_sources
src/fasttrack/bin/menu/servicesmenu.py
16
1851
#!/usr/bin/env python import os,time,re definepath=os.getcwd() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") ...
gpl-3.0
1200wd/1200wd_addons
delivery_transsmart_address_consolidation/models.py
1
2895
# -*- coding: utf-8 -*- ############################################################################## # # Delivery Transsmart Ingegration - Address Consolidation # Copyright (C) 2016 1200 Web Development (<http://1200wd.com/>) # (C) 2015 ONESTEiN BV (<http://www.onestein.nl>) # # This program is ...
agpl-3.0
geodynamics/gale
config/scons/scons-local-1.2.0/SCons/Scanner/D.py
12
2440
"""SCons.Scanner.D Scanner for the Digital Mars "D" programming language. Coded by Andy Friesen 17 Nov 2003 """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated doc...
gpl-2.0
insionng/httpie
httpie/models.py
48
3986
from httpie.compat import urlsplit, str class HTTPMessage(object): """Abstract class for HTTP messages.""" def __init__(self, orig): self._orig = orig def iter_body(self, chunk_size): """Return an iterator over the body.""" raise NotImplementedError() def iter_lines(self, ch...
bsd-3-clause
open-craft/XBlock
xblock/test/test_fields.py
1
17132
""" Tests for classes extending Field. """ # Allow accessing protected members for testing purposes # pylint: disable=W0212 from mock import MagicMock, Mock import unittest import datetime as dt import pytz import warnings from contextlib import contextmanager from xblock.core import XBlock, Scope from xblock.field...
apache-2.0
mydongistiny/external_chromium_org
tools/valgrind/chrome_tests.py
32
31784
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. ''' Runs various chrome tests through valgrind_test.py.''' import glob import logging import multiprocessing import optparse impor...
bsd-3-clause
christophlsa/odoo
addons/hr_payroll/report/report_contribution_register.py
377
3380
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
tomhughes/mapnik
scons/scons-local-4.1.0/SCons/Scanner/Prog.py
4
3536
# MIT License # # Copyright The SCons Foundation # # 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, ...
lgpl-2.1
drodger/django-scheduler
schedule/forms.py
2
1568
from __future__ import unicode_literals from django import forms from django.utils.translation import ugettext_lazy as _ from schedule.models import Event, Occurrence from schedule.widgets import SpectrumColorPicker class SpanForm(forms.ModelForm): start = forms.SplitDateTimeField(label=_("start")) end = fo...
bsd-3-clause
ronakkhunt/kuma
kuma/attachments/feeds.py
21
1299
from django.utils.translation import ugettext as _ from kuma.wiki.feeds import DocumentsFeed from .models import AttachmentRevision class AttachmentsFeed(DocumentsFeed): title = _("MDN recent file changes") subtitle = _("Recent revisions to MDN file attachments") def items(self): return (Attach...
mpl-2.0
mistercrunch/airflow
tests/models/test_taskinstance.py
3
79775
# # 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...
apache-2.0
heeraj123/oh-mainline
vendor/packages/sqlparse/tests/test_pipeline.py
47
1945
import unittest from sqlparse.filters import ColumnsSelect from sqlparse.lexer import tokenize from sqlparse.pipeline import Pipeline class Test(unittest.TestCase): def setUp(self): self.pipe = Pipeline() self.pipe.append(tokenize) self.pipe.append(ColumnsSelect()) def test_1(self):...
agpl-3.0
toshywoshy/ansible
lib/ansible/modules/windows/win_webpicmd.py
52
1398
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Peter Mounce <public@neverrunwithscissors.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA ...
gpl-3.0
lowitty/selenium
libs/windows/paramiko/buffered_pipe.py
3
6997
# Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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.1 of the License, or (a...
mit
tumbl3w33d/ansible
lib/ansible/modules/network/fortios/fortios_firewall_ssl_setting.py
14
12477
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, 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 Lic...
gpl-3.0
rajendrakrp/GeoMicroFormat
django/utils/unittest/suite.py
353
9293
"""TestSuite""" import sys import unittest from django.utils.unittest import case, util __unittest = True class BaseTestSuite(unittest.TestSuite): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(self, tests=()): self._tests = [] self.addTests...
bsd-3-clause
caromedellin/data-play
definingMarkovThings.py
1
2434
# -*- coding: utf-8 -*- """ Created on Thu Feb 25 17:58:31 2016 Markov Chain Monte Carol ( or something like that, MCMC) @author: katar """ import numpy import random """ Concept: 1) define a markov chain 2) run a monte carlo simulation using the markov chain to """ stateNames =['tropics','ci...
mit
kentatogashi/ansible
v1/ansible/utils/vault.py
112
18771
# (c) 2014, James Tanner <tanner.jc@gmail.com> # # 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 i...
gpl-3.0
ygol/odoo
addons/payment_paypal/tests/test_paypal.py
378
11126
# -*- coding: utf-8 -*- from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment.tests.common import PaymentAcquirerCommon from openerp.addons.payment_paypal.controllers.main import PaypalController from openerp.tools import mute_logger from lxml import objectify import u...
agpl-3.0
Nexenta/cinder
cinder/volume/drivers/huawei/rest_client.py
1
87896
# Copyright (c) 2016 Huawei Technologies Co., Ltd. # 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 # # ...
apache-2.0
AeanSR/simc
dbc_extract3/dbc/config.py
6
2934
import configparser, sys, importlib, logging, types, os import dbc.db class Config: def __init__(self, options): self.options = options self.data_store = dbc.db.DataStore(self.options) self.config = {} self.base_module_path = None self.base_module = None self.base_...
gpl-3.0
TheMOOCAgency/edx-platform
openedx/core/djangolib/testing/utils.py
7
5318
""" Utility classes for testing django applications. :py:class:`CacheIsolationMixin` A mixin helping to write tests which are isolated from cached data. :py:class:`CacheIsolationTestCase` A TestCase baseclass that has per-test isolated caches. """ import copy import crum from django import db from django.co...
agpl-3.0
prarthitm/edxplatform
common/djangoapps/student/tests/factories.py
2
5162
"""Provides factories for student models.""" import random from student.models import (User, UserProfile, Registration, CourseEnrollmentAllowed, CourseEnrollment, PendingEmailChange, UserStanding, CourseAccessRole) from course_modes.mo...
agpl-3.0
hyperized/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py
17
10884
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # 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
hrhtspr/IkaLog
tools/IkaClips.py
5
6548
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 Takeshi HASEGAWA # # 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/l...
apache-2.0
rnowling/pop-gen-models
single-pop/single_pop.py
1
3379
import sys import numpy as np import numpy.random as npr from sklearn.neighbors.kde import KernelDensity from scipy.special import gammaln import matplotlib.pyplot as plt from calculate_phist import read_counts from calculate_phist import normalize_haplotypes def log_factorial(n): return gammaln(n+1) def log_multino...
apache-2.0
SUNET/eduid-webapp
src/eduid_webapp/reset_password/schemas.py
1
4836
# -*- coding: utf-8 -*- # # Copyright (c) 2019 SUNET # 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 # noti...
bsd-3-clause
mj10777/QGIS
python/pyplugin_installer/unzip.py
53
2524
# -*- coding:utf-8 -*- """ /*************************************************************************** Plugin Installer module unzip function ------------------- Date : May 2013 Copyright : (C) 2013 ...
gpl-2.0
sirkubax/ansible-modules-extras
database/vertica/vertica_schema.py
148
11740
#!/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
USGSDenverPychron/pychron
pychron/experiment/run_history_view.py
1
3330
# =============================================================================== # Copyright 2017 ross # # 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/LICE...
apache-2.0
tanglu-org/tgl-misago
misago/apps/admin/sections/users.py
3
8888
from django.conf.urls import patterns, include, url from django.utils.translation import ugettext_lazy as _ from misago.admin import AdminAction from misago.models import Ban, Newsletter, PruningPolicy, Rank, User, WarnLevel ADMIN_ACTIONS = ( AdminAction( section='users', id='users'...
gpl-3.0
robhudson/django
tests/model_formsets/models.py
118
7878
from __future__ import unicode_literals import datetime import uuid from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) class Meta: or...
bsd-3-clause
pombreda/syzygy
syzygy/build/app_verifier.py
4
10601
# 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 a...
apache-2.0
Eddy0402/Environment
vim/ycmd/ycmd/completers/cpp/clang_helpers.py
38
1037
#!/usr/bin/env python # # Copyright (C) 2011, 2012 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 # (...
gpl-3.0
heddle317/moto
tests/test_datapipeline/test_datapipeline.py
3
5276
from __future__ import unicode_literals import boto.datapipeline import sure # noqa from moto import mock_datapipeline_deprecated from moto.datapipeline.utils import remove_capitalization_of_dict_keys def get_value_from_fields(key, fields): for field in fields: if field['key'] == key: retur...
apache-2.0
HBehrens/feedsanitizer
django/views/generic/base.py
5
5448
from django import http from django.core.exceptions import ImproperlyConfigured from django.template import RequestContext, loader from django.template.response import TemplateResponse from django.utils.functional import update_wrapper from django.utils.log import getLogger from django.utils.decorators import classonly...
mit
matrix-org/synapse
synapse/rest/client/v2_alpha/sendtodevice.py
1
2257
# Copyright 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
michaelsmit/openparliament
parliament/hansards/views.py
1
10309
import datetime from urllib import urlencode from django.core.paginator import Paginator, InvalidPage, EmptyPage from django.core import urlresolvers from django.http import HttpResponse, Http404, HttpResponsePermanentRedirect, HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.template im...
agpl-3.0
lyceel/engine
third_party/libevent/event_rpcgen.py
296
45502
#!/usr/bin/env python # # Copyright (c) 2005 Niels Provos <provos@citi.umich.edu> # All rights reserved. # # Generates marshaling code based on libevent. import sys import re # _NAME = "event_rpcgen.py" _VERSION = "0.1" _STRUCT_RE = '[a-z][a-z_0-9]*' # Globals line_count = 0 white = re.compile(r'^\s+') cppcomment =...
bsd-3-clause
sarvex/tensorflow
tensorflow/python/compiler/tensorrt/model_tests/result_analyzer.py
9
7962
# Copyright 2020 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
watonyweng/neutron
neutron/tests/unit/test_auth.py
43
5071
# 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
zrzka/blackmamba
blackmamba/lib/docutils/parsers/rst/roles.py
4
14779
# $Id: roles.py 7937 2016-05-24 10:48:48Z milde $ # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Copyright: This module has been placed in the public domain. """ This module defines standard interpreted text role functions, a registry for interpreted text roles, and an API for adding to and retrieving from ...
mit
supergis/QGIS
python/ext-libs/pygments/styles/emacs.py
364
2486
# -*- coding: utf-8 -*- """ pygments.styles.emacs ~~~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by Emacs. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import ...
gpl-2.0
StefanRijnhart/odoo
addons/product_margin/wizard/__init__.py
444
1078
# -*- 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...
agpl-3.0
klahnakoski/ActiveData-ETL
vendor/mo_hg/parse.py
2
6797
# encoding: utf-8 # # 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/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import, division...
mpl-2.0
q474818917/solr-5.2.0
dev-tools/scripts/buildAndPushRelease.py
4
10086
# 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 ...
apache-2.0
banksee/budger
config/urls.py
1
1482
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views from re...
bsd-3-clause
jchevin/MissionPlanner-master
packages/IronPython.StdLib.2.7.4/content/Lib/MimeWriter.py
315
6482
"""Generic MIME writer. This module defines the class MimeWriter. The MimeWriter class implements a basic formatter for creating MIME multi-part files. It doesn't seek around the output file nor does it use large amounts of buffer space. You must write the parts out in the order that they should occur in the final f...
gpl-3.0
phil1425/qualitySensor
neuralnet.py
1
1427
import tflearn from tflearn.data_preprocessing import DataPreprocessing from tflearn.layers.core import input_data, dropout, fully_connected, reshape from tflearn.layers.conv import conv_2d, max_pool_2d from tflearn.layers.estimator import regression from tflearn.metrics import Accuracy from tflearn.data_augmentation i...
mit
kalxas/QGIS
tests/src/python/test_qgsattributeformeditorwidget.py
45
4566
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsAttributeFormEditorWidget. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later v...
gpl-2.0
fqqb/yamcs-studio
bundles/org.csstudio.examples/examples/BOY Examples/scripts/addROI.py
5
1595
from org.csstudio.opibuilder.scriptUtil import PVUtil from org.csstudio.swt.widgets.figures.IntensityGraphFigure import IROIListener, IROIInfoProvider from org.csstudio.simplepv import IPVListener from java.lang import Thread, Runnable from org.eclipse.swt.widgets import Display roiXPV = pvs[1] roiYPV = pvs[2] roiWPV...
epl-1.0
felixbb/forseti-security
google/cloud/security/common/gcp_type/resource.py
1
4605
# Copyright 2017 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 or agreed to in writing, s...
apache-2.0
shivam1111/odoo
addons/auth_signup/controllers/main.py
144
6049
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
dmarteau/QGIS
tests/src/python/test_qgsserver_accesscontrol_wfs_transactional.py
6
8590
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer. From build dir, run: ctest -R PyQgsServerAccessControlWFSTransactional -V .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either v...
gpl-2.0
danielvdao/facebookMacBot
venv/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.py
367
13497
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. """ import fnmatch import logging import os import re from . import DistlibEx...
mit
uoaerg/linux-dccp
Documentation/conf.py
60
19545
# -*- coding: utf-8 -*- # # The Linux Kernel documentation build configuration file, created by # sphinx-quickstart on Fri Feb 12 13:51:46 2016. # # 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 fi...
gpl-2.0
vfulco/scalpel
test/gravity/tae/pos/test_pos.py
2
1712
from gravity.tae.tokenizer import Token, TokenSet from gravity.tae.pos.pos import POS from gravity import GRAVITY_LIB_HOME from gravity.tae.corpora.conll import CoNLL2002 import unittest, os class TestPOS(unittest.TestCase): def test_pos(self): self.assertEqual(len(POS.list()), 2) for n in ('...
lgpl-3.0
FlowFX/unkenmathe.de
src/um/exercises/views.py
1
3723
"""Views for exercise app.""" from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.http import HttpResponseRedirect from django.shortcuts import redirect, reverse from django.urls import reverse_lazy from django.views.generic import CreateView, DeleteView, DetailView, ListView, Upd...
agpl-3.0
willemt/yabtorrent
clib.py
1
5248
#!/usr/bin/env python # encoding: utf-8 # Willem-Hendrik Thiart, 2014 from waflib.Configure import conf import simplejson as json import os import itertools # TODO # Add exception for instances where there are multiple packages with same name class PackageNotFoundException(Exception): pass class ClibPackage...
bsd-3-clause
cloakedcode/CouchPotatoServer
libs/requests/packages/chardet2/charsetgroupprober.py
63
3636
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
gpl-3.0
oangervuori/namubufferi
namubufferiapp/models.py
2
5893
from base64 import b64encode from datetime import timedelta from decimal import Decimal from hashlib import sha256 from os import urandom import uuid from django.contrib.auth.models import User from django.dispatch import receiver from django.db.models.signals import post_save from django.conf import settings from dja...
mit
TeamEOS/external_chromium_org
third_party/simplejson/scanner.py
674
2560
"""JSON token scanner """ import re def _import_c_make_scanner(): try: from simplejson._speedups import make_scanner return make_scanner except ImportError: return None c_make_scanner = _import_c_make_scanner() __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))...
bsd-3-clause
kemcoi/libfacebookcpp
src/external-lib/jsoncpp-src-0.5.0/devtools/fixeol.py
247
1941
import os.path def fix_source_eol( path, is_dry_run = True, verbose = True, eol = '\n' ): """Makes sure that all sources have the specified eol sequence (default: unix).""" if not os.path.isfile( path ): raise ValueError( 'Path "%s" is not a file' % path ) try: f = open(path, 'rb') exce...
lgpl-2.1
heri16/AutobahnPython
examples/websocket/echo_httpheaders/server.py
17
2267
############################################################################### ## ## Copyright 2013 Tavendo GmbH ## ## 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-2.0
sysalexis/kbengine
kbe/src/lib/python/Lib/distutils/command/install_scripts.py
204
2017
"""distutils.command.install_scripts Implements the Distutils 'install_scripts' command, for installing Python scripts.""" # contributed by Bastian Kleineidam import os from distutils.core import Command from distutils import log from stat import ST_MODE class install_scripts(Command): description = "install ...
lgpl-3.0
Allend575/opencog
opencog/python/embodiment/situation.py
34
13777
from utility.generic import subsets_of_len_two __author__ = 'keyvan' from opencog.atomspace import AtomSpace, types, TruthValue from random import randrange _default_tv = TruthValue(1, 1) class CombinationDescriptor(object): pass class TypeDescriptor(CombinationDescriptor): def __init__(self, weight, obj...
agpl-3.0
dionyziz/rupture
backend/breach/tests/test_views.py
1
8744
from django.test import Client, TestCase from django.core.urlresolvers import reverse from breach.models import Target, Victim, Round, SampleSet import json from binascii import hexlify from mock import patch class ViewsTestCase(TestCase): def setUp(self): self.client = Client() self.target1 = Ta...
mit