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
devs1991/test_edx_docmode
common/lib/xmodule/xmodule/mixin.py
70
2601
""" Reusable mixins for XBlocks and/or XModules """ from xblock.fields import Scope, String, XBlockMixin # Make '_' a no-op so we can scrape strings. Using lambda instead of # `django.utils.translation.ugettext_noop` because Django cannot be imported in this file _ = lambda text: text class LicenseMixin(XBlockMixin...
agpl-3.0
henrymzhao/csss-minion
classes.py
4
4219
#pylint: disable=C import discord from discord.ext import commands FROZEN_ROLES = [228765603756900352, 289285166436843521, 314296819272122368, 296466915235332106, 228985701792743424, 229014335299649536] class Classes(): def __init__(self, bot): self.bot = bot @commands.command(pass_context = True) ...
gpl-2.0
he7d3r/revscoring
tests/languages/test_japanese.py
2
3077
import pickle from revscoring.languages import japanese from .util import compare_extraction BAD = [ "ๆญปใญ", "ใ—ใญ", "ใ‚ทใƒ", "ใ‚ใป", "ใ‚ขใƒ›", "ใฐใ‹", "ใƒใ‚ซ", "ใ‚„ใ‚Šใพใ‚“", "ใƒคใƒชใƒžใƒณ", "ใพใ‚“ใ“", "ใƒžใƒณใ‚ณ", "ใ†ใ‚“ใ“", "ใ‚ฆใƒณใ‚ณ", "ใใ‚‚ใ„", "ใ‚ญใƒขใ‚ค", "็—ดๅฅณ", "ๆทซไนฑ", "ๅœจๆ—ฅ", "ใƒใƒงใƒณ", "ๆ”ฏ้‚ฃ", "...
mit
robmcmullen/peppy
peppy/i18n/zh_CN.py
1
24750
# -*- coding: utf-8 -*- #This is generated code - do not edit encoding = 'utf-8' dict = { '&About...': '\xe5\x85\xb3\xe4\xba\x8e(&A)...', '&Close Document': '\xe5\x85\xb3\xe9\x97\xad\xe6\x96\x87\xe6\xa1\xa3(&C)', '&Comment Region': '\xe6\xb3\xa8\xe9\x87\x8a\xe5\x8c\xba\xe5\x9f\x9f(&C)', '&Delete Window': '\xe5\x88\xa0\...
gpl-2.0
Stinkdigital/three.js
utils/exporters/maya/plug-ins/threeJsFileTranslator.py
51
23623
__author__ = 'Sean Griffin' __version__ = '1.0.0' __email__ = 'sean@thoughtbot.com' import sys import os.path import json import shutil from pymel.core import * from maya.OpenMaya import * from maya.OpenMayaMPx import * kPluginTranslatorTypeName = 'Three.js' kOptionScript = 'ThreeJsExportScript' kDefaultOptionsStri...
mit
p0psicles/SickRage
lib/unidecode/x0a2.py
253
4503
data = ( 'kax', # 0x00 'ka', # 0x01 'kap', # 0x02 'kuox', # 0x03 'kuo', # 0x04 'kuop', # 0x05 'kot', # 0x06 'kox', # 0x07 'ko', # 0x08 'kop', # 0x09 'ket', # 0x0a 'kex', # 0x0b 'ke', # 0x0c 'kep', # 0x0d 'kut', # 0x0e 'kux', # 0x0f 'ku', # 0x10 'kup', # 0x11 'kurx',...
gpl-3.0
amitay/samba
lib/dnspython/dns/rrset.py
99
5895
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-3.0
GitHublong/hue
desktop/core/ext-py/Django-1.6.10/tests/view_tests/tests/test_static.py
34
5274
from __future__ import absolute_import import mimetypes from os import path import unittest from django.conf.urls.static import static from django.http import HttpResponseNotModified from django.test import TestCase from django.test.utils import override_settings from django.utils.http import http_date from django.vi...
apache-2.0
ICTU/quality-time
components/collector/src/source_collectors/azure_devops/source_up_to_dateness.py
1
3165
"""Azure Devops Server up-to-dateness collector.""" from abc import ABC from datetime import datetime import aiohttp from dateutil.parser import parse from base_collectors import SourceCollector, SourceUpToDatenessCollector from collector_utilities.type import URL, Response from source_model import SourceMeasurement...
apache-2.0
zimmermegan/MARDA
nltk-3.0.3/nltk/corpus/reader/knbc.py
10
5791
#! /usr/bin/env python # KNB Corpus reader # Copyright (C) 2001-2015 NLTK Project # Author: Masato Hagiwara <hagisan@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT # For more information, see http://lilyx.net/pages/nltkjapanesecorpus.html from __future__ import print_function import r...
mit
whd/data-pipeline
reports/stability-summary/summarize.py
4
3014
import csv import json from utils import S3CompressedReader, S3CompressedWriter, HeaderCSVReader from collections import defaultdict, Counter from itertools import izip, count default_bucket = 'telemetry-public-analysis-2' prop_list = ( 'abortedsessioncount', 'subsessionlengths', 'abortsplugin', 'abor...
mpl-2.0
RackSec/ansible
lib/ansible/modules/cloud/amazon/ec2_tag.py
71
5973
#!/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 distributed...
gpl-3.0
ladybug-analysis-tools/honeybee
honeybee/radiance/pattern/brighttext.py
3
2016
"""Radiance Brighttext Pattern. http://radsite.lbl.gov/radiance/refer/ray.html#Brighttext """ from .patternbase import RadiancePattern # TODO(): Implement the class. It's currently creates this material as generic Radiance # material class Brighttext(RadiancePattern): """Radiance Brighttext Pattern. Brightt...
gpl-3.0
sandrinr/XCSoar
build/python/build/zlib.py
13
1169
import subprocess from build.makeproject import MakeProject class ZlibProject(MakeProject): def __init__(self, url, alternative_url, md5, installed, **kwargs): MakeProject.__init__(self, url, alternative_url, md5, installed, **kwargs) def get_make_args(self, toolchain): retur...
gpl-2.0
anntzer/scipy
scipy/linalg/decomp_qr.py
12
13645
"""QR decomposition functions.""" import numpy # Local imports from .lapack import get_lapack_funcs from .misc import _datacopied __all__ = ['qr', 'qr_multiply', 'rq'] def safecall(f, name, *args, **kwargs): """Call a LAPACK routine, determining lwork automatically and handling error return values""" lw...
bsd-3-clause
astocko/statsmodels
statsmodels/stats/tests/test_contrast.py
34
1385
import numpy as np import numpy.random as R from numpy.testing import assert_almost_equal, assert_equal from statsmodels.stats.contrast import Contrast class TestContrast(object): @classmethod def setupClass(cls): R.seed(54321) cls.X = R.standard_normal((40,10)) def test_contrast1(self): ...
bsd-3-clause
erikrose/dxr
tests/test_build.py
4
12885
"""Tests for the machinery that takes offsets and markup bits from plugins and decorates source code with them to create HTML""" from unittest import TestCase import warnings from warnings import catch_warnings from nose.tools import eq_ from dxr.build import (line_boundaries, remove_overlapping_refs, Region, LINE, ...
mit
ASCrookes/django
django/views/i18n.py
82
11102
import gettext as gettext_module import importlib import json import os from django import http from django.apps import apps from django.conf import settings from django.core.urlresolvers import translate_url from django.template import Context, Engine from django.utils import six from django.utils._os import upath fr...
bsd-3-clause
tumbl3w33d/ansible
lib/ansible/modules/network/illumos/dladm_vlan.py
52
5406
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, 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
cbeck88/fifengine
engine/python/fife/extensions/pychan/widgets/ext/__init__.py
5
1458
# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public #...
lgpl-2.1
caleb531/automata
tests/test_nfa.py
1
6512
#!/usr/bin/env python3 """Classes and functions for testing the behavior of NFAs.""" import types from unittest.mock import patch import nose.tools as nose import automata.base.exceptions as exceptions import tests.test_fa as test_fa from automata.fa.nfa import NFA class TestNFA(test_fa.TestFA): """A test clas...
mit
dnjohnstone/hyperspy
hyperspy/_signals/signal2d.py
1
35008
# -*- coding: utf-8 -*- # Copyright 2007-2020 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
gpl-3.0
webdesignll/coin
contrib/pyminer/pyminer.py
1
6434
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
mit
MrSurly/micropython-esp32
tests/extmod/vfs_fat_ramdisk.py
20
2181
try: import uerrno try: import uos_vfs as uos except ImportError: import uos except ImportError: print("SKIP") raise SystemExit try: uos.VfsFat except AttributeError: print("SKIP") raise SystemExit class RAMFS: SEC_SIZE = 512 def __init__(self, blocks): ...
mit
peterbe/peekaboo
vendor-local/lib/python/sorl/thumbnail/engines/convert_engine.py
5
4948
from __future__ import with_statement import re import os from django.utils.datastructures import SortedDict from django.utils.encoding import smart_str from sorl.thumbnail.base import EXTENSIONS from sorl.thumbnail.conf import settings from sorl.thumbnail.engines.base import EngineBase from subprocess import Popen, PI...
mpl-2.0
ewels/MultiQC_OSXApp
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py
2931
1675
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
prattcmp/OpenJournal
JournalController.py
1
1314
from Journal import Journal, db from datetime import date, timedelta from PyQt5.QtCore import QTimer import time class JournalController(): def __init__(self): self.viewID = Journal.get(date = date.today()).id db.connect() if not Journal.table_exists(): Journal.create_...
mit
Evfro/polara
polara/lib/sparse.py
1
9203
import sys from concurrent.futures import ThreadPoolExecutor from concurrent.futures import as_completed import numpy as np from numpy import power from scipy.sparse import csr_matrix from scipy.sparse import diags from scipy.sparse.linalg import norm as spnorm from numba import jit, njit, guvectorize, prange from num...
mit
redbear/micropython
tests/wipy/pin.py
65
4862
""" This test need a set of pins which can be set as inputs and have no external pull up or pull down connected. GP12 and GP17 must be connected together """ from machine import Pin import os mch = os.uname().machine if 'LaunchPad' in mch: pin_map = ['GP24', 'GP12', 'GP14', 'GP15', 'GP16', 'GP17', 'GP28', 'GP8'...
mit
microy/MeshToolkit
MeshToolkit/Tool/Statistics.py
2
1149
# -*- coding:utf-8 -*- # # Provide functions to compute different statistics on an array of values # # External dependencies import numpy as np # Print statictics of the given values def Statistics( values ) : # Compute the statistics of the given values stats = list() stats.append( ('Minimum', np.amin( values ) ...
mit
lgarren/spack
var/spack/repos/builtin/packages/libdrm/package.py
3
2264
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
SnakeJenny/TensorFlow
tensorflow/compiler/tests/conv2d_test.py
43
17758
# 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
borosnborea/SwordGO_app
example/kivymap/.buildozer/venv/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...
gpl-3.0
ulrikdb/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
Dellware78/mtasa-blue
vendor/google-breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/reflection.py
260
5864
# 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...
gpl-3.0
markredballoon/clivemizen
proto/bootstrap/node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
899
2768
# 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 collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
gpl-2.0
chitr/neutron
neutron/tests/tempest/common/generator/valid_generator.py
34
2931
# Copyright 2014 Deutsche Telekom AG # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
marcoarruda/MissionPlanner
Lib/site-packages/scipy/stats/tests/test_continuous_basic.py
51
14973
import warnings import numpy.testing as npt import numpy as np import nose from scipy import stats """ Test all continuous distributions. Parameters were chosen for those distributions that pass the Kolmogorov-Smirnov test. This provides safe parameters for each distributions so that we can perform further testing...
gpl-3.0
whitepages/nova
nova/tests/unit/virt/libvirt/volume/test_net.py
11
9636
# 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
valmynd/MediaFetcher
src/plugins/youtube_dl/youtube_dl/extractor/ctsnews.py
1
2972
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import unified_timestamp class CtsNewsIE(InfoExtractor): IE_DESC = '่ฏ่ฆ–ๆ–ฐ่ž' _VALID_URL = r'https?://news\.cts\.com\.tw/[a-z]+/[a-z]+/\d+/(?P<id>\d+)\.html' _TESTS = [{ 'url': 'http://news.cts.com.tw/cts/internat...
gpl-3.0
abalkin/numpy
numpy/core/tests/test_function_base.py
6
13148
from numpy import ( logspace, linspace, geomspace, dtype, array, sctypes, arange, isnan, ndarray, sqrt, nextafter, stack ) from numpy.testing import ( assert_, assert_equal, assert_raises, assert_array_equal, assert_allclose, ) class PhysicalQuantity(float): def __new__(cls, value): re...
bsd-3-clause
ironman5366/W.I.L.L-Telegram
parser.py
1
1876
#Builtin imports import logging #External imports import spacy import dataset from spacy.symbols import nsubj, VERB from spacy.matcher import Matcher #Internal imports import plugin_handler log = logging.getLogger() nlp = None matcher = None def parse(bot, update ,job_queue, chat_data): '''Function that calls ...
mit
ArtsiomCh/tensorflow
tensorflow/python/keras/_impl/keras/applications/mobilenet.py
12
28029
# 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
samthor/intellij-community
python/lib/Lib/rfc822.py
89
33167
"""RFC 2822 message manipulation. Note: This is only a very rough sketch of a full RFC-822 parser; in particular the tokenizing of addresses does not adhere to all the quoting rules. Note: RFC 2822 is a long awaited update to RFC 822. This module should conform to RFC 2822, and is thus mis-named (it's not worth rena...
apache-2.0
tersmitten/ansible
lib/ansible/modules/network/cloudengine/ce_sflow.py
32
51332
#!/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
raviperi/storm
dev-tools/report/formatter.py
28
3248
#!/usr/bin/python # -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
telefar/stockEye
coursera-compinvest1-master/coursera-compinvest1-master/homework/Homework4.py
1
3966
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. ''' import pandas as pd import numpy as np import math import copy import QSTK.qstkutil.qsdateutil as du import datet...
bsd-3-clause
gpfreitas/bokeh
bokeh/_legacy_charts/builder/scatter_builder.py
43
7792
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Scatter class which lets you build your Scatter charts just passing the arguments to the Chart class and calling the proper functions. """ #-----------------------------------------------------------...
bsd-3-clause
dafei2015/hugular_cstolua
Client/tools/site-packages/stringconvServer.py
8
17336
# # Utility to convert strings from game2D's XML format to Excel and back. # # C.D. July 2006 # import xml.dom.minidom from pyExcelerator import * # stuff to handle text encodings import codecs enc, dec, read_wrap, write_wrap = codecs.lookup('utf-8') import struct import os RUSSIAN_MAPPING_UTF8_TO_ASCII = [ (1040,'...
mit
cloudify-cosmo/cloudify-agent
cloudify_agent/installer/runners/fabric_runner.py
1
13089
######### # Copyright (c) 2015 GigaSpaces Technologies 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 # # Unless...
apache-2.0
derwebcoder/lead
lead/jobs/DockerJob.py
1
2448
import os, sys from lead.jobs.Job import Job from lead.helpers.path_helpers import get_cwd, compute_home_directory, compute_absolute_path from lead.helpers.logging import log, log_error from lead.helpers.DockerHelper import DockerHelper class DockerJob(Job): def __init__(self, name, function, image, **kwargs): ...
apache-2.0
tempbottle/kbengine
kbe/res/scripts/common/Lib/encodings/iso2022_jp_2004.py
816
1073
# # iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class I...
lgpl-3.0
activitynet/ActivityNet
Evaluation/ava/np_box_mask_list_ops.py
1
15471
# 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...
mit
InnovaLangues/DicoAPI
vendor/doctrine/orm/docs/en/_exts/configurationblock.py
2577
3506
#Copyright (c) 2010 Fabien Potencier # #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, distrib...
mit
bguillot/OpenUpgrade
addons/mail/mail_group_menu.py
101
2718
# -*- 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
wtpayne/hiai
a3_src/h70_internal/da/check/schema/spec/spec_silcfg.py
1
1304
# -*- coding: utf-8 -*- """ Unit tests for the da.check.schema.silcfg module. --- type: python_module validation_level: v00_minimum protection: k00_public copyright: "Copyright 2016 High Integrity Artificial Intelligence Systems" license: "Licensed under the Apache License, Version 2.0 (the Lic...
apache-2.0
gunicorn/gunicorn
gunicorn/app/pasterapp.py
10
6372
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import os import pkg_resources import sys try: import configparser as ConfigParser except ImportError: import ConfigParser from paste.deploy import loadapp, loadwsgi SERVER = loadwsg...
mit
MaterialsDiscovery/PyChemia
pychemia/core/composition.py
1
16450
""" Chemical composition is just the description of the amount of atoms of each specie. In the case of clusters or molecules, ie a finite structure, it represents the complete set of atoms. For periodic structures it represents the species present on a cell. """ import re from numpy import array, argsort from math imp...
mit
alfonsodev/ansible-modules-extras
monitoring/datadog_monitor.py
74
10398
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Sebastian Kornehl <sebastian.kornehl@asideas.de> # # 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 versi...
gpl-3.0
yeKcim/warmux
old/wormux-0.8.1/tools/view_stat/view_stat.py
55
5046
#!/usr/bin/python # -*- coding: UTF-8 -*- import sys, os, types import pygtk pygtk.require ('2.0') import gtk, gtk.glade from xml.dom.minidom import parse class GUI: def __init__(self, glade_xml): xml = gtk.glade.XML(glade_xml, "main_window") self.window = xml.get_widget('main_window') sel...
gpl-2.0
haikuginger/urllib3
urllib3/contrib/appengine.py
3
9630
""" This module provides a pool manager that uses Google App Engine's `URLFetch Service <https://cloud.google.com/appengine/docs/python/urlfetch>`_. Example usage:: from urllib3 import PoolManager from urllib3.contrib.appengine import AppEngineManager, is_appengine_sandbox if is_appengine_sandbox(): ...
mit
almarklein/scikit-image
skimage/transform/finite_radon_transform.py
3
3206
""" :author: Gary Ruben, 2009 :license: modified BSD """ __all__ = ["frt2", "ifrt2"] import numpy as np from numpy import roll, newaxis def frt2(a): """Compute the 2-dimensional finite radon transform (FRT) for an n x n integer array. Parameters ---------- a : array_like A 2-D square n ...
bsd-3-clause
chriswardchrisward/blog-api
src/posts/views.py
9
4540
try: from urllib import quote_plus #python 2 except: pass try: from urllib.parse import quote_plus #python 3 except: pass from django.contrib import messages from django.contrib.contenttypes.models import ContentType from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from djang...
mit
rasata/ansible
lib/ansible/executor/stats.py
251
1716
# (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
ojengwa/odoo
addons/hr_holidays/wizard/hr_holidays_summary_department.py
337
2335
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # $Id: account.py 1005 2005-07-25 08:41:42Z nicoe $ # # This program is free software: you can redistrib...
agpl-3.0
fx2003/tensorflow-study
TensorFlowๅฎžๆˆ˜/models/object_detection/matchers/argmax_matcher_test.py
21
9704
# 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...
mit
azlanismail/prismgames
examples/games/car/networkx/algorithms/tests/test_swap.py
1
1302
#!/usr/bin/env python from nose.tools import * from networkx import * def test_double_edge_swap(): graph = barabasi_albert_graph(200,1) degrees = sorted(graph.degree().values()) G = double_edge_swap(graph, 40) assert_equal(degrees, sorted(graph.degree().values())) def test_connected_double_e...
gpl-2.0
timorieber/wagtail
wagtail/core/management/commands/replace_text.py
18
2068
from django.core.management.base import BaseCommand from django.db import models from modelcluster.models import get_all_child_relations from wagtail.core.models import PageRevision, get_page_models def replace_in_model(model, from_text, to_text): text_field_names = [field.name for field in model._meta.fields if...
bsd-3-clause
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/auth_tests/test_forms.py
12
21296
from __future__ import unicode_literals import re from django import forms from django.contrib.auth.forms import ( AuthenticationForm, PasswordChangeForm, PasswordResetForm, ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget, SetPasswordForm, UserChangeForm, UserCreationForm, ) from django.contrib.auth...
mit
nandhp/youtube-dl
youtube_dl/extractor/ndr.py
20
14258
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, parse_iso8601, qualities, ) class NDRBaseIE(InfoExtractor): def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) di...
unlicense
propellerhead/blog
gdata/tlslite/utils/jython_compat.py
358
5270
"""Miscellaneous functions to mask Python/Jython differences.""" import os import sha if os.name != "java": BaseException = Exception from sets import Set import array import math def createByteArraySequence(seq): return array.array('B', seq) def createByteArrayZeros(howMany): ...
mit
direvus/ansible
lib/ansible/modules/cloud/google/gc_storage.py
18
16892
#!/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': ['preview'],...
gpl-3.0
rimsleur/QSLime
interpreter/PropositionTree.py
2
12197
# coding: utf8 """ ะ”ั€ะตะฒะพะฒะธะดะฝะพะต ะฟั€ะตะดัั‚ะฐะฒะปะตะฝะธะต ััƒะถะดะตะฝะธั """ from PropositionTreeNode import PropositionTreeNode from PropositionTreeNodeType import PropositionTreeNodeType from PropositionTreeNodeSide import PropositionTreeNodeSide from LanguageHelper import LanguageHelper from TriggerProvider import TriggerProvider fro...
gpl-2.0
dlazz/ansible
test/units/modules/network/netscaler/test_netscaler_gslb_site.py
68
24193
# Copyright (c) 2017 Citrix Systems # # 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
g-k/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_parser.py
451
3612
from __future__ import absolute_import, division, unicode_literals import os import sys import traceback import warnings import re warnings.simplefilter("error") from .support import get_data_files from .support import TestData, convert, convertExpected, treeTypes from html5lib import html5parser, constants # Run t...
mpl-2.0
ziaa/pelican-plugins
tag_cloud/test_tag_cloud.py
37
3222
import unittest, os, sys import six import tag_cloud from pelican.generators import ArticlesGenerator from pelican.tests.support import get_settings from pelican.urlwrappers import Tag CUR_DIR = os.path.dirname(__file__) CONTENT_DIR = os.path.join(CUR_DIR, 'test_data') class TestTagCloudGeneration(unittest.TestCase)...
agpl-3.0
jwu/exlibs-cpp
ext/scintilla/test/XiteWin.py
1
16871
# -*- coding: utf-8 -*- from __future__ import with_statement import os, sys, unittest import ctypes from ctypes import wintypes from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort user32=ctypes.windll.user32 gdi32=ctypes.windll.gdi32 kernel32=ctypes.windll.kernel32 from MessageNumbers import msgs, sgsm...
lgpl-3.0
microsoft/EconML
econml/tests/test_shap.py
1
10941
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import numpy as np import unittest import shap from shap.plots import scatter, heatmap, bar, beeswarm, waterfall, force from econml.dml import * from econml.orf import * from econml.dr import * from econml.metalearners import...
mit
shubhamchopra/spark
python/pyspark/ml/param/_shared_params_code_gen.py
14
10161
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
bdh1011/wau
venv/lib/python2.7/site-packages/requests/models.py
410
29176
# -*- 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
lawrence34/python-social-auth
social/apps/django_app/views.py
76
2181
from django.conf import settings from django.contrib.auth import login, REDIRECT_FIELD_NAME from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import csrf_exempt, csrf_protect from django.views.decorators.http import require_POST from django.views.decorators.cache import never_c...
bsd-3-clause
renner/spacewalk
client/rhel/rhnlib/test/02-callbacks.py
36
1613
#!/usr/bin/python # # # import sys sys.path.append('..') from rhn.rpclib import Server, GETServer SERVER = "http://xmlrpc.rhn.redhat.com/XMLRPC" system_id_file = "/etc/sysconfig/rhn/systemid" try: SERVER = "http://%s/XMLRPC" % sys.argv[1] system_id_file = sys.argv[2] except: pass print "SERVER = %s" % SER...
gpl-2.0
tarthy6/dozer-thesis
examples/old/concrete/uniax-post.py
5
1677
#!/usr/bin/python # -*- coding: utf-8 -*- # # demonstration of the woo.post2d module (see its documentation for details) # from woo import post2d import pylab # the matlab-like interface of matplotlib loadFile='/tmp/uniax-tension.woo.gz' if not os.path.exists(loadFile): raise RuntimeError("Run uniax.py first so that %...
gpl-2.0
silveringsea/urllib3
urllib3/connectionpool.py
62
31251
import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full import Queue as _ # Platform-specific: Windows fr...
mit
sungkim11/mhargadh
django/contrib/gis/tests/relatedapp/tests.py
27
14331
from datetime import date from django.test import TestCase from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint from django.contrib.gis.db.models import Collect, Count, Extent, F, Union from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.tests.utils import mysql, oracle, no_...
bsd-3-clause
rjsmethurst/starpy
fluxes.py
2
2701
import numpy as N import scipy as S from scipy.integrate import simps from scipy import interpolate import pylab as P """ Functions to calculate the colours at every time step in a defined SFH using a specified extracted SPS model. """ model = str(raw_input('Tell me again the location of the extracted (.ised_ASCI...
apache-2.0
ProjectSWGCore/NGECore2
scripts/mobiles/talus/sleemo_delinquent.py
2
1533
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate...
lgpl-3.0
davidobrien1985/ansible-modules-extras
database/vertica/vertica_facts.py
148
9176
#!/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
sametmax/Django--an-app-at-a-time
ignore_this_directory/django/conf/locale/ru/formats.py
79
1202
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y ะณ.' TIME_FORMAT = 'G:i' DATETIME_FORMAT = 'j E Y ะณ. G:i' YEAR_MONTH_FORMAT = 'F Y ะณ.' MONTH_D...
mit
CTSRD-SOAAP/chromium-42.0.2311.135
native_client/pnacl/driver/elftools.py
7
5431
#!/usr/bin/python # Copyright (c) 2013 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Tools for parsing ELF headers. import struct from collections import namedtuple from driver_log import DriverOpen, DriverClose...
bsd-3-clause
chouseknecht/ansible
test/units/modules/storage/netapp/test_na_ontap_object_store.py
23
7128
# (c) 2019, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ unit tests for Ansible module: na_ontap_object_store """ from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import pytest from units.compat import ...
gpl-3.0
emilkjer/django-model-utils
setup.py
1
1491
from setuptools import setup, find_packages import subprocess import os.path try: # don't get confused if our sdist is unzipped in a subdir of some # other hg repo if os.path.isdir('.hg'): p = subprocess.Popen(['hg', 'parents', r'--template={rev}\n'], stdout=subprocess...
bsd-3-clause
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/utils/tzinfo.py
82
3932
"Implementation of tzinfo classes for use with datetime.datetime." from __future__ import unicode_literals import time import warnings from datetime import timedelta, tzinfo from django.utils.deprecation import RemovedInDjango19Warning from django.utils.encoding import ( DEFAULT_LOCALE_ENCODING, force_str, force...
mit
fAntel/pygroot
src/pygroot.py
1
5085
#!/usr/bin/python # # pygroot.py # # Author: # keldzh <keldzh@gmail.com> # # Copyright (c) 2015 Anton Kovalyov # # 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 t...
gpl-3.0
springcoil/pymc3
pymc3/tests/test_variational_inference.py
1
28177
import pytest import functools import operator import numpy as np from theano import theano, tensor as tt import pymc3 as pm import pymc3.util from pymc3.theanof import change_flags from pymc3.variational.approximations import ( MeanFieldGroup, FullRankGroup, NormalizingFlowGroup, EmpiricalGroup, MeanFiel...
apache-2.0
jiguanglizipao/ucore_os_lab
related_info/lab5/process-cpuio-homework.py
49
9708
#! /usr/bin/env python import sys from optparse import OptionParser import random # process switch behavior SCHED_SWITCH_ON_IO = 'SWITCH_ON_IO' # io finished behavior IO_RUN_LATER = 'IO_RUN_LATER' # process states STATE_RUNNING = 'RUNNING' STATE_READY = 'READY' STATE_DONE = 'DONE' STATE_WAIT = 'WAITING' # members ...
gpl-2.0
clef/python-social-auth
social/tests/backends/test_linkedin.py
92
1050
import json from social.p3 import urlencode from social.tests.backends.oauth import OAuth1Test, OAuth2Test class BaseLinkedinTest(object): user_data_url = 'https://api.linkedin.com/v1/people/~:' \ '(first-name,id,last-name)' expected_username = 'FooBar' access_token_body = json.d...
bsd-3-clause
ZheJiuShiMing/tango_with_django_project
tango_with_django_project/populate_script.py
2
2160
import os os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tango_with_django_project.settings') import django django.setup() from rango.models import Category, Page def populate(): python_cat = add_cat('Python',128,64) add_page(cat=python_cat, title="Official Python Tutorial", url...
gpl-2.0
dsalazarr/pfc_ii
pfc/pfc/users/admin.py
1
5528
from django import forms from django.contrib import admin from django.contrib.auth.admin import UserAdmin as AuthUserAdmin from django.contrib.auth.forms import UserChangeForm, UserCreationForm from django.utils.translation import ugettext_lazy as _ from slugify import slugify from pfc.applications.admin import Compan...
gpl-3.0
home-assistant/home-assistant
homeassistant/components/lcn/schemas.py
7
5448
"""Schema definitions for LCN configuration and websockets api.""" import voluptuous as vol from homeassistant.components.climate import DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP from homeassistant.const import ( CONF_ADDRESS, CONF_BINARY_SENSORS, CONF_COVERS, CONF_HOST, CONF_LIGHTS, CONF_NAME, CO...
apache-2.0