repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
jclark754/MesoPy
examples/Examples Source Code/Basic_Usage.py
3
2698
""" @author: joshclark This script just demonstrates some example usage for the workshop """ from MesoPy import Meso import pprint # I import Pretty Print to make the returned dictionary look, well, pretty. pp = pprint.PrettyPrinter(indent=2) # Instance a Meso object by passing in YOUR api_token m = Meso(token='YOU...
mit
s40523116/2016fallcp_hw
pelicanconf.py
1
2006
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = 'KMOL' SITENAME = '2016Fall 課程網誌 (虎尾科大MDE)' # 不要用文章所在目錄作為類別 USE_FOLDER_AS_CATEGORY = False #PATH = 'content' #OUTPUT_PATH = 'output' TIMEZONE = 'Asia/Taipei' DEFAULT_LANG = 'en' # Feed generation is u...
agpl-3.0
gangadhar-kadam/church-erpnext
utilities/__init__.py
5
2675
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
agpl-3.0
nirmeshk/oh-mainline
vendor/packages/whoosh/src/whoosh/filedb/fieldcache.py
16
19066
# Copyright 2011 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
agpl-3.0
davgibbs/django
tests/validation/tests.py
301
8536
from __future__ import unicode_literals from django import forms from django.core.exceptions import NON_FIELD_ERRORS from django.test import TestCase from django.utils.functional import lazy from . import ValidationTestCase from .models import ( Article, Author, GenericIPAddressTestModel, GenericIPAddrUnpackUniqu...
bsd-3-clause
Lazar-T/scrapy
scrapy/settings/deprecated.py
160
1383
import warnings from scrapy.exceptions import ScrapyDeprecationWarning DEPRECATED_SETTINGS = [ ('TRACK_REFS', 'no longer needed (trackref is always enabled)'), ('RESPONSE_CLASSES', 'no longer supported'), ('DEFAULT_RESPONSE_ENCODING', 'no longer supported'), ('BOT_VERSION', 'no longer used (user agent ...
bsd-3-clause
drpngx/tensorflow
tensorflow/tools/docs/py_guide_parser_test.py
142
2457
# 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
prasanna08/oppia
core/controllers/features_test.py
2
3042
# Copyright 2019 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
oceanobservatories/mi-instrument
mi/idk/package_driver.py
11
14932
""" @file coi-services/mi.idk/package_driver.py @author Bill French @brief Main script class for running the package_driver process """ import sys import os.path import zipfile import subprocess import shutil import re import yaml from mi.core.log import get_logger ; log = get_logger() from mi.idk import prompt from...
bsd-2-clause
wtsi-hgi/irobot
irobot/tests/unit/config/test_httpd.py
1
2524
""" Copyright (c) 2017 Genome Research Ltd. Author: Christopher Harrison <ch12@sanger.ac.uk> 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 ...
gpl-3.0
nnethercote/servo
tests/wpt/web-platform-tests/mathml/tools/limits.py
101
2284
#!/usr/bin/python from utils import mathfont import fontforge nArySumCodePoint = 0x2211 # largeop operator v = 3 * mathfont.em f = mathfont.create("limits-lowerlimitbaselinedropmin%d" % v) mathfont.createSquareGlyph(f, nArySumCodePoint) f.math.LowerLimitBaselineDropMin = v f.math.LowerLimitGapMin = 0 f.math.OverbarE...
mpl-2.0
davidmueller13/lt03lte_tw_kernel_5.1.1
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
PopCap/GameIdea
Engine/Source/ThirdParty/HTML5/emsdk/emscripten/1.30.0/tools/scons/site_scons/site_tools/emscripten/emscripten.py
15
1306
#!/usr/bin/env python2 import os def generate(env, emscripten_path=None, **kw): """ SCons tool entry point """ if emscripten_path is None: # Try to find emscripten # Use same method as Emscripten's shared.py EM_CONFIG = os.environ.get('EM_CONFIG') if not EM_CONFIG: EM_CONFIG = '~/.emscripten' CONFI...
bsd-2-clause
aeph6Ee0/youtube-dl
test/test_subtitles.py
10
13734
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL, md5 from youtube_dl.extractor import ( YoutubeIE, DailymotionIE, TE...
unlicense
pjuren/pyokit
src/pyokit/scripts/overlapProfile.py
1
10357
#!/usr/bin/python """ Date of Creation: 3rd Apr 2010 Description: Script for generating a profile by piling up a set of regions and counting the number of times another set of intervals overlap these. Copyright (C) 2010-2015 Philip J. Uren, Authors: Philip J. Ur...
lgpl-2.1
adambrenecki/django
django/db/models/query_utils.py
2
7397
""" Various data structures used in query construction. Factored out from django.db.models.query to avoid making the main module very large and/or so that they can be used by other modules without getting into circular import difficulties. """ from __future__ import unicode_literals from django.db.backends import uti...
bsd-3-clause
googleapis/python-datastore
google/cloud/datastore_admin_v1/services/datastore_admin/transports/grpc.py
1
18328
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
raccoongang/edx-platform
openedx/core/djangoapps/user_api/preferences/tests/test_views.py
13
23273
# -*- coding: utf-8 -*- """ Unit tests for preference APIs. """ import ddt import json from mock import patch from django.core.urlresolvers import reverse from django.test.testcases import TransactionTestCase from rest_framework.test import APIClient from student.tests.factories import UserFactory, TEST_PASSWORD fro...
agpl-3.0
rbarraud/pelican
pelican/tests/support.py
23
5621
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals import locale import logging import os import re import subprocess import sys import unittest from contextlib import contextmanager from functools import wraps from logging.handlers import BufferingHandler from shutil import rmtree from te...
agpl-3.0
baffolobill/mb_test_1
src/mbtest1/erp_test/serializers/servers.py
1
1473
# -*- coding: utf-8 -*- from __future__ import unicode_literals from rest_framework import serializers from . import generics from ..models import Server, ServerTemplate class ServerSerializer(serializers.HyperlinkedModelSerializer): node = generics.SimpleNodeModelSerializer(many=False, read_only=True) floo...
mit
christer12/msm_kernel_codeaurora
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
anistark/mozillians
vendor-local/lib/python/unidecode/x073.py
252
4646
data = ( 'Sha ', # 0x00 'Li ', # 0x01 'Han ', # 0x02 'Xian ', # 0x03 'Jing ', # 0x04 'Pai ', # 0x05 'Fei ', # 0x06 'Yao ', # 0x07 'Ba ', # 0x08 'Qi ', # 0x09 'Ni ', # 0x0a 'Biao ', # 0x0b 'Yin ', # 0x0c 'Lai ', # 0x0d 'Xi ', # 0x0e 'Jian ', # 0x0f 'Qiang ', # 0x10 'Kun...
bsd-3-clause
jcrist/pydy
examples/Kane1985/Chapter5/Ex10.2.py
8
1978
#!/usr/bin/env python # -*- coding: utf-8 -*- """Exercise 10.2 from Kane 1985.""" from __future__ import division from sympy import collect, expand, pi, solve, symbols, trigsimp from sympy.physics.mechanics import ReferenceFrame, RigidBody, Point from sympy.physics.mechanics import dot, dynamicsymbols, inertia, msprin...
bsd-3-clause
alexzoo/python
selenium_tests/env/lib/python3.6/site-packages/pip/_vendor/cachecontrol/adapter.py
327
4608
import types import functools from pip._vendor.requests.adapters import HTTPAdapter from .controller import CacheController from .cache import DictCache from .filewrapper import CallbackFileWrapper class CacheControlAdapter(HTTPAdapter): invalidating_methods = set(['PUT', 'DELETE']) def __init__(self, cach...
apache-2.0
imsparsh/python-for-android
python-modules/twisted/twisted/internet/ssl.py
60
7496
# -*- test-case-name: twisted.test.test_ssl -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ SSL transport. Requires PyOpenSSL (http://pyopenssl.sf.net). SSL connections require a ContextFactory so they can create SSL contexts. End users should only use the ContextFactory cla...
apache-2.0
krishnazure/Flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/flask/testsuite/subclassing.py
563
1214
# -*- coding: utf-8 -*- """ flask.testsuite.subclassing ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Test that certain behavior of flask can be customized by subclasses. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from logging import Str...
apache-2.0
vincepandolfo/django
django/template/loaders/cached.py
19
7094
""" Wrapper class that takes a list of template loaders as an argument and attempts to load templates from them in order, caching the result. """ import hashlib import warnings from django.template import Origin, Template, TemplateDoesNotExist from django.template.backends.django import copy_exception from django.uti...
bsd-3-clause
pra85/calibre
src/calibre/ebooks/chm/reader.py
3
10748
from __future__ import with_statement ''' CHM File decoding support ''' __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>,' \ ' and Alex Bramley <a.bramley at gmail.com>.' import os, re, codecs from calibre import guess_type as guess_mimetype from calibre.ebooks.Bea...
gpl-3.0
jiaweihli/manga_downloader
src/util.py
2
3578
#!/usr/bin/env python #################### import gzip import io import random import re import string import time try: import socks NO_SOCKS = False except ImportError: NO_SOCKS = True import socket ################### try: import urllib2 except ImportError: import urllib.request as urllib2 ##################...
mit
othieno/geotagx-tool-validator
src/project.py
1
6100
# -*- coding: utf-8 -*- # # This module is part of the GeoTag-X project validator tool. # It contains validators for various components of a project configuration. # # Author: Jeremy Othieno (j.othieno@gmail.com) # # Copyright (c) 2016-2017 UNITAR/UNOSAT # # The MIT License (MIT) # Permission is hereby granted, free of...
mit
medspx/QGIS
tests/src/python/test_offline_editing_wfs.py
21
4971
# -*- coding: utf-8 -*- """ Offline editing Tests. WFS-T tests need using QGIS Server through qgis_wrapped_server.py. This is an integration test for QGIS Desktop WFS-T provider and QGIS Server WFS-T that check if QGIS offline editing works with a WFS-T endpoint. The test uses testdata/wfs_transactional/wfs_transact...
gpl-2.0
togaurav1981/Hello-World
node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/vim.py
364
1976
# -*- coding: utf-8 -*- """ pygments.styles.vim ~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by vim. :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 Keywor...
mit
pybrain2/pybrain2
pybrain/tools/functions.py
2
4796
__author__ = 'Tom Schaul, tom@idsia.ch' from scipy import (array, exp, tanh, clip, log, dot, sqrt, power, pi, tan, diag, rand, real_if_close) from scipy.linalg import inv, det, svd, logm, expm2 def semilinear(x): """ This function ensures that the values of the array are always positive. ...
bsd-3-clause
DONIKAN/django
tests/extra_regress/models.py
281
1401
from __future__ import unicode_literals import copy import datetime from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class RevisionableModel(models.Model): base = models.ForeignKey('self', models.S...
bsd-3-clause
bd-j/bsfh
prospect/utils/prospect_args.py
3
6814
#!/usr/bin/env python # -*- coding: utf-8 -*- """prospect_args.py - methods to get a default argument parser for prospector. """ import argparse __all__ = ["get_parser", "show_default_args"] def show_default_args(): parser = get_parser() parser.print_help() def get_parser(fitters=["optimize", "emcee", "d...
gpl-2.0
Parlin-Galanodel/scrapy
tests/test_downloadermiddleware_cookies.py
10
10372
import re import logging from unittest import TestCase from testfixtures import LogCapture from scrapy.http import Response, Request from scrapy.spiders import Spider from scrapy.utils.test import get_crawler from scrapy.exceptions import NotConfigured from scrapy.downloadermiddlewares.cookies import CookiesMiddleware...
bsd-3-clause
gc-i/wntOS
view/Ui_IntakeDialog.py
1
8647
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'IntakeDialog.ui' # # Created: Tue Sep 27 09:09:54 2016 # by: PyQt4 UI code generator 4.10.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except A...
gpl-3.0
osiell/server-tools
sql_export/wizard/wizard_file.py
4
4531
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 Akretion (<http://www.akretion.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
Gabriel439/pip
pip/_vendor/packaging/specifiers.py
527
28079
# Copyright 2014 Donald Stufft # # 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, so...
mit
Kitware/HPCCloud
server/hpccloud/hpccloud_plugin/file.py
1
2168
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2016 Kitware 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 cop...
apache-2.0
SecHackLabs/WebHackSHL
modules/tplmap/tests/env_py_tests/webserver.py
2
6287
from flask import Flask, request app = Flask(__name__) from mako.template import Template as MakoTemplates from mako.lookup import TemplateLookup from jinja2 import Environment as Jinja2Environment import tornado.template import random import time try: from string import lowercase as ascii_lowercase except ImportE...
gpl-3.0
TheTypoMaster/evennia
evennia/game_template/server/conf/mssp.py
13
4616
""" MSSP (Mud Server Status Protocol) meta information MUD website listings (that you have registered with) can use this information to keep up-to-date with your game stats as you change them. Also number of currently active players and uptime will automatically be reported. You don't have to fill in everything (and ...
bsd-3-clause
corngood/ycmd
ycmd/tests/misc_handlers_test.py
27
1507
#!/usr/bin/env python # # Copyright (C) 2013 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 # (at you...
gpl-3.0
yakky/django
django/contrib/contenttypes/fields.py
21
24531
from __future__ import unicode_literals from collections import defaultdict from django.contrib.contenttypes.models import ContentType from django.core import checks from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, models, router, transaction from django...
bsd-3-clause
wuhengzhi/chromium-crosswalk
tools/perf/page_sets/blank_page.py
22
1791
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry import story from page_sets.startup_pages import BrowserStartupSharedState class BlankPage(pag...
bsd-3-clause
brianonn/Cinnamon
files/usr/lib/cinnamon-settings/modules/cs_startup.py
3
34202
#!/usr/bin/env python2 from SettingsWidgets import * from gi.repository import Gio, Gtk, GObject, Gdk, GdkPixbuf, GLib, Pango import os import glob import shutil ENVIRON = os.environ['XDG_CURRENT_DESKTOP'] D_GROUP = "Desktop Entry" DEFAULT_ICON = "system-run" AUTOSTART_APPS = [] def list_header_func(row, before, use...
gpl-2.0
whip112/Whip112
vendor/packages/logilab/common/fileutils.py
90
12738
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
mpl-2.0
PwnArt1st/searx
searx/engines/yahoo.py
1
4101
""" Yahoo (Web) @website https://search.yahoo.com/web @provide-api yes (https://developer.yahoo.com/boss/search/), $0.80/1000 queries @using-api no (because pricing) @results HTML (using search portal) @stable no (HTML can change) @parse url, title, content, suggestion """ f...
agpl-3.0
raincoatrun/ThinkStats2
code/chap02ex.py
67
1170
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import sys from operator import itemgetter import first import thinkstats2 de...
gpl-3.0
frostblooded/kanq
api/views/posts.py
1
6392
import base64 import logging import os from django.utils import timezone from rest_framework import status from rest_framework import viewsets from rest_framework.decorators import list_route, detail_route from rest_framework.generics import get_object_or_404 from rest_framework.response import Response from api.help...
mit
JFriel/honours_project
networkx/build/lib/networkx/readwrite/tests/test_graph6.py
54
3219
#!/usr/bin/env python try: from StringIO import StringIO except ImportError: from io import StringIO from nose.tools import * import networkx as nx import networkx.readwrite.graph6 as g6 class TestGraph6Utils(object): def test_n_data_n_conversion(self): for i in [0, 1, 42, 62, 63, 64, 258047, 2580...
gpl-3.0
beav/virt-who
test.py
2
3097
""" Testing module, part of virt-who Copyright (C) 2011 Radek Novacek <rnovacek@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 l...
gpl-2.0
aewhatley/scikit-learn
examples/text/document_classification_20newsgroups.py
222
10500
""" ====================================================== Classification of text documents using sparse features ====================================================== This is an example showing how scikit-learn can be used to classify documents by topics using a bag-of-words approach. This example uses a scipy.spars...
bsd-3-clause
ossdemura/django-miniblog
Lib/encodings/cp737.py
272
34681
""" Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict...
mit
GheRivero/ansible
lib/ansible/module_utils/facts/hardware/linux.py
3
28205
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
nbcesar/sabergrade
lib/python2.7/site-packages/setuptools/ssl_support.py
332
7663
import os import socket import atexit import re import pkg_resources from pkg_resources import ResolutionError, ExtractionError from setuptools.compat import urllib2 try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_available', 'cert_paths', 'op...
apache-2.0
hax0rs/FlappyArm
rpi/LEGACY/network_listen.py
1
2457
import pigpio as io import socket from time import sleep VERSION = float(1.0) pi = io.pi() HOST = "169.254.101.80" PORT = 50007 def load_config_file(filename): """ Returns a dictionary containing the configuration elements in the file: 'filename' contained in the subfolder of the cwd: 'folder'. load_c...
mit
jlegendary/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/mock.py
465
6715
# Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
zhuyongyong/crosswalk-test-suite
tools/apkanalyser/xml.py
19
4857
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2015 Intel Corporation. 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 ...
bsd-3-clause
benjaminpope/whisky
pysco/kpi.py
2
22629
''' -------------------------------------------------------------------- PYSCO: PYthon Self Calibrating Observables -------------------------------------------------------------------- --- pysco is a python module to create, and extract Kernel-phase data structures, using the theory of ...
gpl-3.0
ekoontz/hadoop-common
src/contrib/hod/testing/testUtil.py
182
1796
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
apache-2.0
fuselock/odoo
addons/stock/stock.py
3
270008
# -*- 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
beni55/sympy
sympy/tensor/tests/test_index_methods.py
27
6932
from sympy.core import symbols, S, Pow, Function from sympy.functions import exp from sympy.utilities.pytest import raises from sympy.tensor.indexed import Idx, IndexedBase, Indexed from sympy.tensor.index_methods import IndexConformanceException # import test from sympy import get_contraction_structure, get_indices ...
bsd-3-clause
lmorchard/django
tests/template_tests/test_nodelist.py
151
3039
from unittest import TestCase from django.template import Context, Engine from django.template.base import TextNode, VariableNode from django.utils import six class NodelistTest(TestCase): @classmethod def setUpClass(cls): cls.engine = Engine() super(NodelistTest, cls).setUpClass() def ...
bsd-3-clause
MRigal/django
tests/i18n/tests.py
113
79787
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import datetime import decimal import gettext as gettext_module import os import pickle from contextlib import contextmanager from importlib import import_module from threading import local from unittest import skipUnless from django import forms from ...
bsd-3-clause
Adai0808/scikit-learn
doc/sphinxext/numpy_ext/docscrape_sphinx.py
408
8061
import re import inspect import textwrap import pydoc from .docscrape import NumpyDocString from .docscrape import FunctionDoc from .docscrape import ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config=None): config = {} if config is None else config self.use_plots...
bsd-3-clause
dotKom/onlineweb4
apps/marks/tests.py
1
2956
import logging from datetime import date from django.test import TestCase from django.utils import timezone from django_dynamic_fixture import G from apps.authentication.models import OnlineUser as User from apps.marks.models import Mark, MarkUser, _get_with_duration_and_vacation class MarksTest(TestCase): def...
mit
darkvip3r/Tron
plugins/rejoinall_plugin.py
1
2608
#===istalismanplugin=== # -*- coding: utf-8 -*- def handler_rejoinall(type, source, parameters): # print "rejoinall" # print type, source, parameters # print dir(parameters) if check_file(file='chatrooms.list'): lgcts = eval(read_file(GROUPCHAT_CACHE_FILE)) # print GROUPCHATS.keys() ...
gpl-2.0
ixiom/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/generator_test.py
252
10129
#! /usr/bin/python # # 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: # # ...
bsd-3-clause
nixonpjoshua/JNixonHelloContigsFilter
lib/JNixonHelloContigsFilter/JNixonHelloContigsFilterClient.py
1
2196
# -*- coding: utf-8 -*- ############################################################ # # Autogenerated by the KBase type compiler - # any changes made here will be overwritten # ############################################################ from __future__ import print_function # the following is a hack to get the basec...
mit
dwillmer/jedi
test/static_analysis/star_arguments.py
20
2237
# ----------------- # *args # ----------------- def simple(a): return a def nested(*args): return simple(*args) nested(1) #! 6 type-error-too-few-arguments nested() def nested_no_call_to_function(*args): return simple(1, *args) def simple2(a, b, c): return b def nested(*args): return simple...
mit
kasioumis/invenio
invenio/modules/workflows/engine.py
13
23331
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your...
gpl-2.0
tecwebjoao/TecWeb-TF-2T-B-SI
venv/Lib/hashlib.py
25
9477
#. Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) # Licensed to PSF under a Contributor Agreement. # __doc__ = """hashlib module - A common interface to many hash functions. new(name, data=b'', **kwargs) - returns a new hash object implementing the given hash function; ...
apache-2.0
aldariz/Sick-Beard
lib/requests/packages/chardet/langthaimodel.py
2930
11275
######################## 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
gvlproject/bioconda-recipes
recipes/rdptools/AbundanceStats.py
59
3263
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # Program Parameters # import os import s...
mit
hoopes/python-pptx
pptx/text/fonts.py
2
13758
# encoding: utf-8 """ Objects related to system font file lookup. """ from __future__ import absolute_import, print_function import os import sys from struct import calcsize, unpack_from from ..util import lazyproperty class FontFiles(object): """ A class-based singleton serving as a lazy cache for syste...
mit
SnabbCo/neutron
neutron/plugins/nec/extensions/packetfilter.py
3
7783
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012-2013 NEC Corporation. # 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.apac...
apache-2.0
JimCircadian/ansible
lib/ansible/modules/storage/purestorage/purefb_snap.py
52
6617
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Simon Dodsley (simon@purestorage.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
avagp/MW19
maintenance/language/zhtable/Makefile.py
21
14510
#!/usr/bin/env python # -*- coding: utf-8 -*- # @author Philip import tarfile as tf import zipfile as zf import os, re, shutil, sys, platform pyversion = platform.python_version() islinux = platform.system().lower() == 'linux' if pyversion[:3] in ['2.6', '2.7']: import urllib as urllib_request import codecs ...
gpl-2.0
toshywoshy/ansible
test/units/modules/network/fortios/test_fortios_user_security_exempt_list.py
21
7891
# 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 License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
cedk/odoo
addons/mail/tests/common.py
142
5740
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
melbit-kevinwessel/ansible-modules-extras
notification/pushbullet.py
69
5843
#!/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
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/cssutils/css/colors.py
6
6669
# -*- coding: utf-8 -*- """ Built from something like this: print [ ( row[2].text_content().strip(), eval(row[4].text_content().strip()) ) for row in lxml.html.parse('http://www.w3.org/TR/css3-color/') .xpath("//*[@class='colortable']//tr[positi...
agpl-3.0
googlei18n/TachyFont
run_time/src/gae_server/third_party/fonttools/Lib/fontTools/ttLib/tables/M_E_T_A_.py
11
9539
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.misc import sstruct from fontTools.misc.textTools import safeEval from . import DefaultTable import struct METAHeaderFormat = """ > # big endian tableVersionMajor: H tableVersionMinor: H metaE...
apache-2.0
bcarroll/authmgr
python-3.6.2-Win64/Lib/site-packages/alembic/autogenerate/rewriter.py
38
5476
from alembic import util from alembic.operations import ops class Rewriter(object): """A helper object that allows easy 'rewriting' of ops streams. The :class:`.Rewriter` object is intended to be passed along to the :paramref:`.EnvironmentContext.configure.process_revision_directives` parameter i...
bsd-3-clause
jkotchoff/Alloy-PullToRefresh-Example
plugins/ti.alloy/plugin.py
1729
5251
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
apache-2.0
vaniakov/twisted-intro
twisted-client-5/get-poetry-1.py
11
3755
# This is the Twisted Get Poetry Now! client, version 5.1 import optparse, random, sys from twisted.internet import defer from twisted.internet.protocol import Protocol, ClientFactory def parse_args(): usage = """usage: %prog [options] [hostname]:port ... This is the Get Poetry Now! client, Twisted version 5.1...
mit
macs03/demo-cms
cms/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.py
341
1877
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request.""...
mit
pgonda/servo
tests/wpt/harness/wptrunner/update/metadata.py
78
2158
# 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/. import os from .. import metadata from base import Step, StepRunner class UpdateExpected(Step): """Do the metadat...
mpl-2.0
iivic/BoiseStateX
lms/djangoapps/shoppingcart/migrations/0028_auto__add_field_courseregistrationcode_is_valid.py
84
22233
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'CourseRegistrationCode.is_valid' db.add_column('shoppingc...
agpl-3.0
OpenSlides/OpenSlides
server/tests/old/config/test_config.py
7
5232
from openslides.core.config import ConfigVariable, config from openslides.core.exceptions import ConfigError from tests.test_case import TestCase class TTestConfigException(Exception): pass class HandleConfigTest(TestCase): def setUp(self): # Save the old value of the config object and add the test ...
mit
ninnux/exscript
src/Exscriptd/config/ConfigSection.py
6
1432
# Copyright (C) 2010 Samuel Abels. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; wi...
gpl-2.0
Pluto-tv/chromium-crosswalk
tools/telemetry/telemetry/internal/platform/msr_server_win.py
69
2747
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A server that serves MSR values over TCP. Takes a port as its sole parameter. The reference client for this server is msr_power_monitor.MsrPowerMonitor. ...
bsd-3-clause
blaggacao/OpenUpgrade
addons/auth_signup/res_users.py
90
14710
# -*- 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
python-control/python-control
examples/pvtol-nested.py
2
4551
# pvtol-nested.py - inner/outer design for vectored thrust aircraft # RMM, 5 Sep 09 # # This file works through a fairly complicated control design and # analysis, corresponding to the planar vertical takeoff and landing # (PVTOL) aircraft in Astrom and Murray, Chapter 11. It is intended # to demonstrate the basic fun...
bsd-3-clause
roadmapper/ansible
lib/ansible/modules/monitoring/bigpanda.py
3
6037
#!/usr/bin/python # -*- coding: utf-8 -*- # 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', ...
gpl-3.0
ralphbean/ansible
v2/ansible/template/template.py
267
1397
# (c) 2012, 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) any lat...
gpl-3.0
jamslevy/gsoc
app/django/core/servers/basehttp.py
4
24911
""" BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21). Adapted from wsgiref.simple_server: http://svn.eby-sarna.com/wsgiref/ This is a simple server for use in testing or debugging Django apps. It hasn't been reviewed for security issues. Don't use it for production use. """ from BaseHTTPSe...
apache-2.0
Hazelsuko07/17WarmingUp
py3.6/lib/python3.6/site-packages/pip/_vendor/html5lib/_trie/py.py
1323
1775
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError...
mit
hoenirvili/distributions
distributions/geometric.py
1
2749
#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt from scipy.stats import geom from .distribution import Distribution __all__ = ['Geometric'] class Geometric(Distribution): """ The geometric distribution is the distribution of the number of trials needed to get the first suc...
mit