repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
guyrt/honest_ab
setup.py
1
1137
try: from setuptools import setup except ImportError: from distutils.core import setup packages = [ 'honest_ab' ] requires = [ 'Murmur==0.1.3', 'Django>=1.4.0', ] tests_require = ['mock==1.0.1'] setup( name='honest_ab', description='A/B testing framework for django', long_description=...
bsd-3-clause
sssemil/cjdns
node_build/dependencies/libuv/build/gyp/test/generator-output/gyptest-symlink.py
216
1292
#!/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 target when the --generator-output= option is used to put the build configuration files in a separate directory tree...
gpl-3.0
sanghinitin/golismero
thirdparty_libs/django/template/__init__.py
561
3247
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
gpl-2.0
tempbottle/aquila
.ycm_extra_conf.py
8
4122
import glob import os import ycm_core # These are the compilation flags that will be used in case there's no # compilation database set (by default, one is not set). # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. flags = [ '-Wall', '-Wextra', '-Werror', '-Wno-variadic-macros', '-Wshadow...
mit
rocky/python3-trepan
trepan/processor/command/restart.py
1
2540
# -*- coding: utf-8 -*- # Copyright (C) 2009, 2013, 2015, 2020 Rocky Bernstein # # 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 l...
gpl-3.0
blaiseli/p4-phylogenetics
share/Examples/K_thermus/B_homog/B_mcmc/sMcmc.py
3
1049
theRunNum = 0 read('../../noTRuberNoGapsNoAmbiguities.nex') d = Data() t = func.randomTree(taxNames=d.taxNames) t.data = d t.newComp(free=1, spec='empirical') t.newRMatrix(free=1, spec='ones') t.setNGammaCat(nGammaCat=4) t.newGdasrv(free=1, val=0.5) t.setPInvar(free=0, val=0.0) m = Mcmc(t, nChains=4, runNum=theRunNum...
gpl-2.0
0-1-0/Python-Arduino-Command-API
tests/test_arduino.py
1
5589
import logging import unittest logging.basicConfig(level=logging.DEBUG) class MockSerial(object): def __init__(self, baud, port, timeout=None): self.port = port self.baud = baud self.timeout = timeout self.output = [] self.input = [] def flush(self): pass ...
mit
ryfeus/lambda-packs
Tensorflow_OpenCV_Nightly/source/tensorflow/python/training/sync_replicas_optimizer.py
19
20193
# 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...
mit
Daniex/horizon
horizon/test/patches.py
67
2706
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
brokenjacobs/ansible
lib/ansible/modules/storage/netapp/sf_volume_access_group_manager.py
69
9488
#!/usr/bin/python # (c) 2017, NetApp, 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....
gpl-3.0
mayblue9/bokeh
bokeh/transforms/image_downsample.py
43
2158
from __future__ import absolute_import import numpy as np from ..models import ServerDataSource try: import scipy import scipy.misc except ImportError as e: print(e) def source(**kwargs): kwargs['transform'] = {'resample':'heatmap', 'global_x_range' : [0, 10], ...
bsd-3-clause
jabesq/home-assistant
tests/components/namecheapdns/test_init.py
25
2281
"""Test the NamecheapDNS component.""" import asyncio from datetime import timedelta import pytest from homeassistant.setup import async_setup_component from homeassistant.components import namecheapdns from homeassistant.util.dt import utcnow from tests.common import async_fire_time_changed HOST = 'test' DOMAIN = ...
apache-2.0
ryfeus/lambda-packs
Tensorflow_OpenCV_Nightly/source/tensorflow/contrib/learn/python/learn/learn_io/generator_io.py
52
5196
# 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...
mit
caplio/dlxj-kernel
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
szaydel/python-daemon-1
daemon/version/__init__.py
10
1295
# -*- coding: utf-8 -*- # daemon/version/__init__.py # Part of python-daemon, an implementation of PEP 3143. # # Copyright © 2008–2010 Ben Finney <ben+python@benfinney.id.au> # This is free software: you may copy, modify, and/or distribute this work # under the terms of the Python Software Foundation License, version ...
gpl-2.0
arkottke/pysra
pysra/__init__.py
1
1512
# The MIT License (MIT) # # Copyright (c) 2016-2018 Albert Kottke # # 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...
mit
kimmanuel/d8-training-project
themes/d8training/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
327
132617
# 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. import copy import ntpath import os import posixpath import re import subprocess import sys import gyp.common import gyp.easy_xml as easy_xml import gyp.generator...
gpl-2.0
RanadeepPolavarapu/kuma
vendor/packages/translate/tools/test_podebug.py
25
6654
# -*- coding: utf-8 -*- from translate.storage import base, po, xliff from translate.tools import podebug PO_DOC = """ msgid "This is a %s test, hooray." msgstr "" """ XLIFF_DOC = """<?xml version='1.0' encoding='utf-8'?> <xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1"> <file original="NoName" ...
mpl-2.0
kamalx/edx-platform
common/test/acceptance/tests/test_annotatable.py
21
5426
# -*- coding: utf-8 -*- """ E2E tests for the LMS. """ import time from unittest import skip from .helpers import UniqueCourseTest from ..pages.studio.auto_auth import AutoAuthPage from ..pages.lms.courseware import CoursewarePage from ..pages.lms.annotation_component import AnnotationComponentPage from ..fixtures.co...
agpl-3.0
eseraygun/python-entities
examples/basicusage.py
1
1373
from entities import * class Account(Entity): id = IntegerField(group=PRIMARY) # this field is in primary key group iban = IntegerField(group=SECONDARY) # this is in secondary key group balance = FloatField(default=0.0) class Name(Entity): first_name = StringField(group=SECONDARY) last_name = ...
bsd-3-clause
dracorpg/python-ivi
ivi/agilent/agilent8341A.py
6
1480
""" Python Interchangeable Virtual Instrument Library Copyright (c) 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 righ...
mit
icereval/osf.io
scripts/analytics/migrate_analytics.py
9
20115
# A script to migrate old keen analytics to a new collection, generate in-between points for choppy # data, or a little of both import os import csv import copy import pytz import logging import argparse import datetime from dateutil.parser import parse from keen.client import KeenClient from website.settings import ...
apache-2.0
ganeshnalawade/ansible
test/integration/targets/plugin_config_for_inventory/cache_plugins/none.py
33
1506
# (c) 2014, Brian Coca, Josh Drake, et al # (c) 2017 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 from ansible.plugins.cache import BaseCacheModule DOCUMENTATION = ...
gpl-3.0
sangwook236/SWDT
sw_dev/python/rnd/test/probabilistic_graphical_model/pydensecrf/pydensecrf_basic.py
2
5687
#!/usr/bin/env python # -*- coding: UTF-8 -*- # REF [site] >> https://github.com/lucasb-eyer/pydensecrf import time import numpy as np import cv2 import pydensecrf.densecrf as dcrf from pydensecrf.utils import unary_from_labels, create_pairwise_bilateral, create_pairwise_gaussian # REF [site] >> https://github.com/l...
gpl-3.0
bussiere/pypyjs
website/demo/home/rfk/repos/pypy/lib-python/2.7/idlelib/PyShell.py
18
52618
#! /usr/bin/env python import os import os.path import sys import string import getopt import re import socket import time import threading import traceback import types import linecache from code import InteractiveInterpreter try: from Tkinter import * except ImportError: print>>sys.__stderr__, "** IDLE can...
mit
cselis86/edx-platform
common/djangoapps/student/migrations/0035_access_roles.py
50
19747
# -*- coding: utf-8 -*- from south.v2 import DataMigration import re from opaque_keys.edx.locations import SlashSeparatedCourseKey from opaque_keys import InvalidKeyError import bson.son import logging from django.db.models.query_utils import Q from django.db.utils import IntegrityError from xmodule.modulestore import ...
agpl-3.0
litchfield/django
tests/inspectdb/models.py
208
2737
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.db import models class People(models.Model): name = models.CharField(max_length=255) parent = models.ForeignKey('self', models.CASCADE) class Message(models.Model): from_field = models.ForeignKey(People, models.CASCADE, db_co...
bsd-3-clause
moonboots/tensorflow
tensorflow/python/kernel_tests/random_crop_test.py
15
2626
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
arborh/tensorflow
tensorflow/python/autograph/core/unsupported_features_checker.py
4
1842
# 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
FederatedAI/FATE
python/federatedml/optim/optimizer.py
1
12739
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE 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/lic...
apache-2.0
havard024/prego
crm/lib/python2.7/site-packages/PIL/ImageWin.py
15
7664
# # The Python Imaging Library. # $Id$ # # a Windows DIB display interface # # History: # 1996-05-20 fl Created # 1996-09-20 fl Fixed subregion exposure # 1997-09-21 fl Added draw primitive (for tzPrint) # 2003-05-21 fl Added experimental Window/ImageWindow classes # 2003-09-05 fl Added fromstring/tostring me...
mit
Weicong-Lin/pymo-global
android/pgs4a-0.9.6/python-install/lib/python2.7/test/test_compile.py
29
17895
import unittest import sys import _ast from test import test_support import textwrap class TestSpecifics(unittest.TestCase): def test_no_ending_newline(self): compile("hi", "<test>", "exec") compile("hi\r", "<test>", "exec") def test_empty(self): compile("", "<test>", "exec") def...
mit
Cryptophobia/ansible
lib/ansible/parsing/yaml/dumper.py
46
1780
# (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
ckarademir/foursquared.eclair
util/oget.py
262
3416
#!/usr/bin/python """ Pull a oAuth protected page from foursquare. Expects ~/.oget to contain (one on each line): CONSUMER_KEY CONSUMER_KEY_SECRET USERNAME PASSWORD Don't forget to chmod 600 the file! """ import httplib import os import re import sys import urllib import urllib2 import urlparse import user from xml....
apache-2.0
Azure/azure-sdk-for-python
sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_storage_management_enums.py
1
6553
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
michaeljohnbarr/django-timezone-utils
tests/test_invalid_timezonefield.py
1
1782
# ============================================================================== # IMPORTS # ============================================================================== # Python import pytz # Django from django.core.exceptions import ValidationError from django.test import TestCase # App from tests.models import (...
mit
sivaramakrishnansr/ryu
ryu/services/protocols/bgp/operator/ssh.py
12
16422
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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:...
apache-2.0
SergeyPirogov/ghost
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_sourcemodbuiltins.py
274
21929
# -*- coding: utf-8 -*- """ pygments.lexers._sourcemodbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the names of SourceMod functions. It is able to re-generate itself. Do not edit the FUNCTIONS list by hand. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. ...
mit
seanfisk/buzzword-bingo-server
django/core/management/commands/startproject.py
322
1680
from django.core.management.base import copy_helper, CommandError, LabelCommand from django.utils.importlib import import_module import os import re from random import choice class Command(LabelCommand): help = "Creates a Django project directory structure for the given project name in the current directory." ...
bsd-3-clause
jupierce/openshift-tools
openshift/installer/vendored/openshift-ansible-3.3.46/roles/etcd_common/library/delegated_serial_command.py
19
8831
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # (c) 2016, Andrew Butcher <abutcher@redhat.com> # # This module is derrived from the Ansible command module. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
apache-2.0
scotty007/libavg
src/samples/logsample.py
6
1933
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging from libavg import avg, app # Setup Python Logger hdlr = logging.StreamHandler() # category is added as an extra formatting key by libavg formatter = logging.Formatter('[%(asctime)s][%(levelname)s][%(category)s] : %(message)s') hdlr.setFormatter(formatter)...
lgpl-2.1
seanli9jan/tensorflow
tensorflow/python/data/experimental/kernel_tests/serialization/map_dataset_serialization_test.py
16
4602
# 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
gpapaz/eve-wspace
evewspace/POS/models.py
3
10918
# Eve W-Space # Copyright 2014 Andrew Austin and contributors # # 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
kangningyang/RobotAutoTest
setup.py
3
1812
#!/usr/bin/env python import sys from os.path import join, dirname sys.path.append(join(dirname(__file__), 'src')) from ez_setup import use_setuptools use_setuptools() from setuptools import setup execfile(join(dirname(__file__), 'src', 'Selenium2Library', 'version.py')) DESCRIPTION = """ Selenium2Library is a web ...
apache-2.0
qinjian623/emacs-config
elpa/jedi-20140321.1323/jediepcserver.py
17
9444
#!/usr/bin/env python """ Jedi EPC server. Copyright (C) 2012 Takafumi Arakaki Author: Takafumi Arakaki <aka.tkf at gmail.com> This file is NOT part of GNU Emacs. Jedi EPC server 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 So...
gpl-3.0
sgzsh269/django
tests/sitemaps_tests/test_http.py
16
11105
from __future__ import unicode_literals import os from datetime import date from unittest import skipUnless from django.apps import apps from django.conf import settings from django.contrib.sitemaps import GenericSitemap, Sitemap from django.contrib.sites.models import Site from django.core.exceptions import Improper...
bsd-3-clause
geekboxzone/lollipop_external_chromium_org
chrome/common/extensions/docs/server2/branch_utility_test.py
77
7693
#!/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. import os import sys import unittest from branch_utility import BranchUtility, ChannelInfo from fake_url_fetcher import FakeUrlFet...
bsd-3-clause
jeboo/kernel_JB_ZSLS6_i777
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
noslenfa/tdjangorest
uw/lib/python2.7/site-packages/IPython/parallel/engine/engine.py
2
13047
"""A simple engine that talks to a controller over 0MQ. it handles registration, etc. and launches a kernel connected to the Controller's Schedulers. Authors: * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distr...
apache-2.0
kaiweifan/vse-lbaas-plugin-poc
quantum/plugins/nicira/nicira_nvp_plugin/nicira_models.py
7
2493
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nicira, 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/li...
apache-2.0
ujenmr/ansible
lib/ansible/modules/network/nxos/nxos_pim_rp_address.py
68
8038
#!/usr/bin/python # # 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 distribut...
gpl-3.0
w1ll1am23/home-assistant
tests/components/zha/test_number.py
8
5098
"""Test zha analog output.""" from unittest.mock import call, patch import pytest import zigpy.profiles.zha import zigpy.types import zigpy.zcl.clusters.general as general import zigpy.zcl.foundation as zcl_f from homeassistant.components.number import DOMAIN from homeassistant.const import STATE_UNAVAILABLE from hom...
apache-2.0
ukanga/SickRage
lib/sqlalchemy/orm/descriptor_props.py
78
24571
# orm/descriptor_props.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Descriptor properties are more "auxiliary" properties that exist as configu...
gpl-3.0
FenceAtMHacks/flaskbackend
fence-api/flask/lib/python2.7/site-packages/pip/_vendor/requests/models.py
43
28027
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
mit
lennonchan/OgreSource
Tools/Blender2.5Export/mesh_properties.py
6
5736
# ##### BEGIN MIT LICENSE BLOCK ##### # Copyright (C) 2011 by Lih-Hern Pang # 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 ...
mit
andmos/ansible
lib/ansible/modules/network/illumos/dladm_etherstub.py
52
4151
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Adam Števko <adam.stevko@gmail.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
canaltinova/servo
tests/wpt/web-platform-tests/conformance-checkers/tools/ins-del-datetime.py
107
8420
# -*- coding: utf-8 -*- import os ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) template = """<!DOCTYPE html> <meta charset=utf-8> """ errors = { "date-year-0000": "0000-12-09", "date-month-00": "2002-00-15", "date-month-13": "2002-13-15", "date-0005-02-29": "0005-02-29", "date...
mpl-2.0
moorescloud/holideck
cherrypy/test/test_routes.py
42
2411
import os curdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) import cherrypy from cherrypy.test import helper import nose class RoutesDispatchTest(helper.CPWebCase): def setup_server(): try: import routes except ImportError: raise nose.SkipTest('Install routes...
mit
jart/tensorflow
tensorflow/python/util/example_parser_configuration_test.py
157
2775
# 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
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/HTMLParser.py
85
16982
"""A parser for HTML and XHTML.""" # This file is based on sgmllib.py, but the API is slightly different. # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable character # data -- only char and entity references and end tags are special) # and CDAT...
mit
ychen820/microblog
y/google-cloud-sdk/platform/gsutil/gslib/addlhelp/acls.py
16
9354
# -*- coding: utf-8 -*- # 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 require...
bsd-3-clause
mkieszek/odoo
addons/auth_ldap/users_ldap.py
17
9858
# Part of Odoo. See LICENSE file for full copyright and licensing details. import ldap import logging from ldap.filter import filter_format import openerp.exceptions from openerp import tools from openerp.osv import fields, osv from openerp import SUPERUSER_ID from openerp.modules.registry import RegistryManager _log...
agpl-3.0
Spookz0r/Temporal_Insanity
Gabriel/Code/Keras/mnist_dataset_sorted.py
1
1969
import numpy as np from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten, pooling from keras.layers import Convolution2D, MaxPooling2D from keras.utils import np_utils from keras import backend as K from keras.models import load_model from te...
mit
dvcolgan/ludumdare27
urls.py
1
1279
from django.conf.urls import patterns, include, url from django.contrib import admin from django.core.urlresolvers import reverse from django.conf import settings from django.views.generic import TemplateView #from library.forms import * admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(adm...
mit
zulip/django
django/contrib/admin/templatetags/log.py
499
2080
from django import template from django.contrib.admin.models import LogEntry register = template.Library() class AdminLogNode(template.Node): def __init__(self, limit, varname, user): self.limit, self.varname, self.user = limit, varname, user def __repr__(self): return "<GetAdminLog Node>" ...
bsd-3-clause
CCPorg/BOS-BossCoin-Ver-1-Copy
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
Pulecz/BGames_tools
CONST.py
2
35371
fallout4_utils = { "game" : "Fallout 4", "utilities" : [ { "_comment_" : ["https://sourceforge.net/projects/modorganizer/", "https://github.com/TanninOne/modorganizer/releases", "https://github.com/LePresidente/modorganizer/releases-https://github.com/LePresidente/modorganizer/r...
gpl-2.0
patrioticcow/MessagesForSkype
packages/win32/bundle/MessagesForSkype/modules/python/1.3.1-beta/Lib/distutils/versionpredicate.py
397
5095
"""Module for parsing and testing package version predicate strings. """ import re import distutils.version import operator re_validPackage = re.compile(r"(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)") # (package) (rest) re_paren = re.compile(r"^\s*\((.*)\)\s*$") # (list) inside of parentheses re_splitComparison = re.com...
mit
Edraak/circleci-edx-platform
lms/djangoapps/ccx/tests/test_utils.py
27
1683
""" test utils """ from nose.plugins.attrib import attr from lms.djangoapps.ccx.tests.factories import CcxFactory from student.roles import CourseCcxCoachRole from student.tests.factories import ( AdminFactory, ) from xmodule.modulestore.tests.django_utils import ( ModuleStoreTestCase, TEST_DATA_SPLIT_MODU...
agpl-3.0
paulmadore/Eric-IDE
6-6.0.9/eric/ThirdParty/CharDet/chardet/big5freq.py
3133
82594
######################## 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 R...
gpl-3.0
Akasurde/virt-manager
virtinst/devicechar.py
3
10828
# # Copyright 2009, 2013 Red Hat, Inc. # Cole Robinson <crobinso@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later ve...
gpl-2.0
NeonMercury/python-lua
runtests.py
1
2759
#!/usr/bin/env python3 """Run all tests from the tests folder""" import os import re import subprocess import sys from tempfile import mkstemp from colorama import init, Fore, Style from pythonlua.translator import Translator TESTS_FOLDER = "tests" LUA_PATH = "lua" EXPECTED_FORMAT = "{}.expected" def get_all_te...
apache-2.0
akintolga/superdesk-core
apps/publish/enqueue/enqueue_corrected.py
1
3860
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from s...
agpl-3.0
bjarniegill/Cordova-Survey
csv_parser/.env/lib/python2.7/site-packages/pip/_vendor/requests/packages/__init__.py
838
1384
''' Debian and other distributions "unbundle" requests' vendored dependencies, and rewrite all imports to use the global versions of ``urllib3`` and ``chardet``. The problem with this is that not only requests itself imports those dependencies, but third-party code outside of the distros' control too. In reaction to t...
mit
sauloal/arduino
control/firmata/autoglade/build/lib/autoglade/autoglade.py
2
86702
#! /usr/bin/env python # -*- coding: utf-8 -*- """ $Id: autoglade.py 88 2009-02-03 15:35:03Z dtmilano $ """ __license__ = """ Copyright (C) 2007-2009 Diego Torres Milano <diego@codtech.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as p...
mit
youdar/work
work/Clashes/Old work/collect_pdb_files_with_different_clashscore.py
1
4379
from __future__ import division import cPickle as pickle import os ''' Collecting pdb files that have very different clashscore and nb_clashscore So we can look at the cause and evaluate the difference in scoring methods ''' def get_data(): ''' () -> dict,dict,list Read results of clash score servey for PROBE...
mit
deepaks4077/myjam
node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
2214
1347
#!/usr/bin/env python import re import json # http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
uw-it-aca/myuw
myuw/views/api/__init__.py
1
1385
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 import json import re from django.http import HttpResponse from django.views import View from django.utils.decorators import method_decorator from django.contrib.auth.decorators import login_required from myuw.views import prefetch_...
apache-2.0
dimaspivak/docker-py
docker/utils/ports.py
5
2796
import re PORT_SPEC = re.compile( "^" # Match full string "(" # External part "((?P<host>[a-fA-F\d.:]+):)?" # Address "(?P<ext>[\d]*)(-(?P<ext_end>[\d]+))?:" # External range ")?" "(?P<int>[\d]+)(-(?P<int_end>[\d]+))?" # Internal range "(?P<proto>/(udp|tcp))?" # Protocol "$" # Ma...
apache-2.0
petecummings/django
tests/foreign_object/test_forms.py
379
1098
import datetime from django import forms from django.test import TestCase from .models import Article class FormsTests(TestCase): # ForeignObjects should not have any form fields, currently the user needs # to manually deal with the foreignobject relation. class ArticleForm(forms.ModelForm): cla...
bsd-3-clause
shakamunyi/neutron
neutron/tests/unit/services/metering/test_metering_plugin.py
6
21497
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # 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 applicabl...
apache-2.0
Samsung/TizenRT
external/protobuf/python/google/protobuf/internal/api_implementation.py
19
7070
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
apache-2.0
Chilipp/psyplot
psyplot/warning.py
1
3411
# coding: utf-8 """Warning module of the psyplot python module This module controls the warning behaviour of the module via the python builtin warnings module and introduces three new warning classes: ..autosummay:: PsPylotRuntimeWarning PsyPlotWarning PsyPlotCritical""" import warnings import logging ...
gpl-2.0
mvj3/leetcode
225-implement-stack-using-queues.py
1
3205
""" Question: Implement Stack using Queues Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top() -- Get the top element. empty() -- Return whether the stack is empty. Notes: You must u...
mit
postlund/home-assistant
homeassistant/components/command_line/sensor.py
2
6076
"""Allows to configure custom shell commands to turn a value for a sensor.""" import collections from datetime import timedelta import json import logging import shlex import subprocess import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_COMM...
apache-2.0
GauravSahu/odoo
addons/l10n_multilang/__init__.py
438
1082
# -*- 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
Coolexe/shooteru-ics-crc-3.0.16-e733189
scripts/gcc-wrapper.py
484
3824
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011, Code Aurora Forum. 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 ...
gpl-2.0
dzbarsky/servo
tests/wpt/web-platform-tests/webdriver/command_contexts/open_and_close_window_test.py
141
2529
import os import sys import random import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test repo_root = os.path.abspath(os.path.join(__file__, "../../..")) sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver")) from webdriver import exceptions class OpenAndCl...
mpl-2.0
Hubert51/AutoGrading
learning/web_Haotian/venv/Lib/site-packages/pip/utils/appdirs.py
340
8811
""" This code was taken from https://github.com/ActiveState/appdirs and modified to suit our purposes. """ from __future__ import absolute_import import os import sys from pip.compat import WINDOWS, expanduser from pip._vendor.six import PY2, text_type def user_cache_dir(appname): r""" Return full path to t...
mit
40223235/w16b_test
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/dummy/connection.py
707
3049
# # Analogue of `multiprocessing.connection` which uses queues instead of sockets # # multiprocessing/dummy/connection.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditi...
agpl-3.0
hwjworld/xiaodun-platform
lms/djangoapps/shoppingcart/views.py
18
9527
import logging import datetime import pytz from django.conf import settings from django.contrib.auth.models import Group from django.http import (HttpResponse, HttpResponseRedirect, HttpResponseNotFound, HttpResponseBadRequest, HttpResponseForbidden, Http404) from django.utils.translation import ugettext as _ from ...
agpl-3.0
wakatime/wakatime
wakatime/packages/py27/pygments/lexers/theorem.py
3
18908
# -*- coding: utf-8 -*- """ pygments.lexers.theorem ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for theorem-proving languages. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, default, words from py...
bsd-3-clause
JazzeYoung/VeryDeepAutoEncoder
pylearn2/scripts/tests/test_print_monitor_cv.py
48
1927
""" Test print_monitor_cv.py by training on a short TrainCV YAML file and analyzing the output pickle. """ import os import tempfile from pylearn2.config import yaml_parse from pylearn2.scripts import print_monitor_cv from pylearn2.testing.skip import skip_if_no_sklearn def test_print_monitor_cv(): """Test print...
bsd-3-clause
ofrobots/grpc
src/python/grpcio_test/grpc_test/framework/face/testing/service.py
17
11617
# Copyright 2015, 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
asiersarasua/QGIS
python/plugins/processing/algs/qgis/Ruggedness.py
8
3299
# -*- coding: utf-8 -*- """ *************************************************************************** Ruggedness.py --------------------- Date : October 2016 Copyright : (C) 2016 by Alexander Bruy Email : alexander dot bruy at gmail dot com **************...
gpl-2.0
bbc/kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/PythonInterpreter/ServerBasedPythonInterpreter.py
6
1350
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Ver...
apache-2.0
formiano/enigma2-4.4
lib/python/Components/TuneTest.py
13
10730
from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParametersTerrestrial, eDVBFrontendParametersCable, eDVBFrontendParameters, eDVBResourceManager, eTimer class Tuner: def __init__(self, frontend, ignore_rotor=False): self.frontend = frontend self.ignore_rotor = ignore_rotor # transponder = (freque...
gpl-2.0
mzizzi/ansible
lib/ansible/modules/web_infrastructure/jenkins_script.py
9
6571
#!/usr/bin/python # encoding: utf-8 # (c) 2016, James Hogarth <james.hogarth@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 Li...
gpl-3.0
prisae/pelican-plugins
optimize_images/optimize_images.py
68
1719
# -*- coding: utf-8 -*- """ Optimized images (jpg and png) Assumes that jpegtran and optipng are isntalled on path. http://jpegclub.org/jpegtran/ http://optipng.sourceforge.net/ Copyright (c) 2012 Irfan Ahmad (http://i.com.pk) """ import logging import os from subprocess import call from pelican import signals logg...
agpl-3.0
dreibh/planetlab-lxc-nodemanager
sliver_lxc.py
1
18070
# """LXC slivers""" import subprocess import sys import time import os, os.path import grp from pwd import getpwnam from string import Template # vsys probably should not be a plugin # the thing is, the right way to handle stuff would be that # if slivers get created by doing a,b,c # then they should be deleted by d...
bsd-3-clause