repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
lmthang/bivec
scripts/visual.py
2
3018
#!/usr/bin/env python # Author: Thang Luong <luong.m.thang@gmail.com>, created on Wed Jun 3 01:22:18 MDT 2015 """ Module docstrings. """ usage = 'USAGE DESCRIPTION.' ### Module imports ### import sys import os import argparse # option parsing import re # regular expression import codecs from tsne import bh_sne imp...
apache-2.0
jhawkesworth/ansible
test/units/modules/network/f5/test_bigip_appsvcs_extension.py
17
3140
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
chugunovyar/factoryForBuild
env/lib/python2.7/site-packages/tornado/log.py
82
9819
#!/usr/bin/env python # # Copyright 2012 Facebook # # 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...
gpl-3.0
Thraxis/pymedusa
lib/unidecode/x08e.py
252
4659
data = ( 'Chu ', # 0x00 'Jing ', # 0x01 'Nie ', # 0x02 'Xiao ', # 0x03 'Bo ', # 0x04 'Chi ', # 0x05 'Qun ', # 0x06 'Mou ', # 0x07 'Shu ', # 0x08 'Lang ', # 0x09 'Yong ', # 0x0a 'Jiao ', # 0x0b 'Chou ', # 0x0c 'Qiao ', # 0x0d '[?] ', # 0x0e 'Ta ', # 0x0f 'Jian ', # 0x10...
gpl-3.0
zijistark/ck2utils
esc/check_titles.py
1
8077
#!/usr/bin/env python3 from collections import defaultdict import csv from operator import attrgetter import pathlib import pprint import re import sys import shutil import tempfile import ck2parser from ck2parser import (rootpath, vanilladir, is_codename, Obj, csv_rows, get_province_id_name_map...
gpl-2.0
pmishra02138/conference-app-scalable
Lesson_4/00_Conference_Central/utils.py
384
1576
import json import os import time import uuid from google.appengine.api import urlfetch from models import Profile def getUserId(user, id_type="email"): if id_type == "email": return user.email() if id_type == "oauth": """A workaround implementation for getting userid.""" auth = os.ge...
gpl-3.0
OriHoch/Open-Knesset
lobbyists/migrations/0002_auto__add_lobbyistcorporationdata__add_lobbyistcorporation__add_field_.py
14
22496
# -*- 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 model 'LobbyistCorporationData' db.create_table(u'lobbyists_lobb...
bsd-3-clause
elucify/robotframework-selenium2library
src/ez_setup.py
276
10240
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
apache-2.0
kennethgillen/ansible
lib/ansible/galaxy/role.py
17
15352
######################################################################## # # (C) 2015, Brian Coca <bcoca@ansible.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...
gpl-3.0
knowsis/django
tests/staticfiles_tests/tests.py
46
33062
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import codecs import os import posixpath import shutil import sys import tempfile from django.template import loader, Context from django.conf import settings from django.core.cache.backends.base import BaseCache from django.core.exceptions import Impr...
bsd-3-clause
agilgur5/LTLMoP
src/lib/handlers/nao/NaoLocomotionCommandHandler.py
7
1046
#!/usr/bin/env python """ ================================================================== naoLocomotionCommand.py - Nao Locomotion Command Handler ================================================================== Send forward, side, and angular velocity commands to the Nao. """ import lib.handlers.handlerTemplate...
gpl-3.0
atlarge-research/opendc-web-server
opendc/api/v1/simulations/simulationId/paths/endpoint.py
1
1243
from opendc.models.path import Path from opendc.models.simulation import Simulation from opendc.util import exceptions from opendc.util.rest import Response def GET(request): """Get this Simulation's Paths.""" # Make sure required parameters are there try: request.check_required_parameters( ...
mit
mojoboss/scikit-learn
sklearn/decomposition/tests/test_truncated_svd.py
240
6055
"""Test truncated SVD transformer.""" import numpy as np import scipy.sparse as sp from sklearn.decomposition import TruncatedSVD from sklearn.utils import check_random_state from sklearn.utils.testing import (assert_array_almost_equal, assert_equal, assert_raises, assert_greater, ...
bsd-3-clause
JorgeCoock/django
tests/multiple_database/tests.py
107
93762
from __future__ import unicode_literals import datetime import pickle import warnings from operator import attrgetter from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.core import management from django.db import DEFAULT_DB_ALIAS, connections, router, t...
bsd-3-clause
decvalts/cartopy
versioneer.py
1
72608
# Version: 0.15+dev """The Versioneer - like a rocketeer, but for versions. The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain * Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, and pypy * [![Latest Version] (https...
gpl-3.0
drincruz/luigi
luigi/contrib/esindex.py
39
14138
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
elopezga/ErrorRate
ivi/agilent/agilentDSO7104B.py
7
1686
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2014 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the...
mit
bt3gl/Numerical-Methods-for-Physics
others/laplace_poisson_equations/mg_test.py
1
1396
#!/usr/bin/env python """ an example of using the multigrid class to solve Laplace's equation. Here, we solve u_xx = sin(x) u = 0 on the boundary [0,1] The analytic solution is u(x) = -sin(x) + x sin(1) """ #from io import * import numpy import multigrid import pylab # the analytic solution def true(x): retu...
apache-2.0
synergeticsedx/deployment-wipro
common/djangoapps/util/organizations_helpers.py
62
3046
""" Utility library for working with the edx-organizations app """ from django.conf import settings from django.db.utils import DatabaseError def add_organization(organization_data): """ Client API operation adapter/wrapper """ if not organizations_enabled(): return None from organization...
agpl-3.0
marlengit/BitcoinUnlimited
qa/rpc-tests/prioritise_transaction.py
1
6053
#!/usr/bin/env python3 # Copyright (c) 2015 The Bitcoin Core developers # Copyright (c) 2015-2016 The Bitcoin Unlimited developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test PrioritiseTransaction code # from test_fr...
mit
TeamBliss-Devices/android_kernel_samsung_ms013g
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
kaiweifan/vse-lbaas-plugin-poc
quantum/tests/unit/test_agent_ovs_cleanup.py
2
4345
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www....
apache-2.0
chouseknecht/ansible
lib/ansible/plugins/strategy/debug.py
134
1288
# 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
tzewangdorje/SIPserv
Twisted-13.1.0/twisted/internet/fdesc.py
62
3223
# -*- test-case-name: twisted.test.test_fdesc -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Utility functions for dealing with POSIX file descriptors. """ import os import errno try: import fcntl except ImportError: fcntl = None # twisted imports from twisted.internet.main ...
gpl-3.0
drpaneas/linuxed.gr
lib/python2.7/site-packages/unidecode/x06b.py
252
4608
data = ( 'Xiang ', # 0x00 'Nong ', # 0x01 'Bo ', # 0x02 'Chan ', # 0x03 'Lan ', # 0x04 'Ju ', # 0x05 'Shuang ', # 0x06 'She ', # 0x07 'Wei ', # 0x08 'Cong ', # 0x09 'Quan ', # 0x0a 'Qu ', # 0x0b 'Cang ', # 0x0c '[?] ', # 0x0d 'Yu ', # 0x0e 'Luo ', # 0x0f 'Li ', # 0x10 ...
mit
fource/fource
your_hacks/aditya/fource_http.py
1
3453
import requests class HttpClass(object): """ Generate an HTTP Request. Accepts request parameters as params_dict during init. Accepted Parameters: HTTP URL as url - String HTTP Method as method - String HTTP Headers as headers - Dictionary HTTP Basic Auth as auth - Tuple Query String/P...
mit
BillBillBillBill/WishTalk-server
WishTalk/api/image.py
1
2980
# -*- coding: utf-8 -*- #!/usr/bin/env python import os import uuid from api import api, GlobalError from flask import request, Response from model.image import Image as Image_model from server import db from util.jsonResponse import jsonSuccess, jsonError from config import UPLOAD_PATH from werkzeug.utils import secu...
mit
infoxchange/django-localflavor
tests/test_be.py
7
2985
from __future__ import unicode_literals from django.test import SimpleTestCase from localflavor.be.forms import BEPhoneNumberField, BEPostalCodeField, BEProvinceSelect, BERegionSelect class BELocalFlavorTests(SimpleTestCase): def test_BEPostalCodeField(self): error_format = ['Enter a valid postal code i...
bsd-3-clause
dgsantana/arsenalsuite
cpp/apps/bach/data_export/FixCachedKeywords.py
10
7224
#!/usr/bin/env python2.5 # # Copyright (c) 2009 Dr. D Studios. (Please refer to license for details) # SVN_META_HEADURL = "$HeadURL: $" # SVN_META_ID = "$Id: FixCachedKeywords.py 9408 2010-03-03 22:35:49Z brobison $" # import sys import os from PyQt4.QtSql import * #--------------------------------------------------...
gpl-2.0
maestrano/openerp
doc/_themes/flask_theme_support.py
2228
4875
# flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal class FlaskyStyle(Style): background_color = "#f8f8f8" default_style = "...
agpl-3.0
michaelkressaty/ssepaperless
ssepaperless/users/views.py
57
1696
# -*- coding: utf-8 -*- # Import the reverse lookup function from django.core.urlresolvers import reverse # view imports from django.views.generic import DetailView from django.views.generic import RedirectView from django.views.generic import UpdateView from django.views.generic import ListView # Only authenticated ...
bsd-3-clause
miniconfig/home-assistant
homeassistant/components/climate/zwave.py
1
7581
""" Support for Z-Wave climate devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.zwave/ """ # Because we do not compile openzwave on CI # pylint: disable=import-error import logging from homeassistant.components.climate import DOMAIN from h...
mit
DOAJ/doaj
doajtest/unit/test_article_prepare_update_publisher.py
1
3830
from parameterized import parameterized from combinatrix.testintegration import load_parameter_sets from doajtest.fixtures import ArticleFixtureFactory, AccountFixtureFactory, JournalFixtureFactory from doajtest.helpers import DoajTestCase from portality.bll import DOAJ from portality.bll import exceptions from portal...
apache-2.0
Argon-Zhou/django
tests/template_tests/filter_tests/test_wordwrap.py
324
1666
from django.template.defaultfilters import wordwrap from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class WordwrapTests(SimpleTestCase): @setup({'wordwrap01': '{% autoescape off %}{{ a|wordwrap:"3" }} {{ b|wordwrap:"3" }}{% endautoescape %}'...
bsd-3-clause
JeroenZegers/Nabu-MSSS
nabu/postprocessing/reconstructors/deepclusteringnoise_reconstructor.py
1
5366
"""@file deepclusteringnoise_reconstructor.py contains the reconstor class using deep clustering for modified noise architecture""" from sklearn.cluster import KMeans import mask_reconstructor from nabu.postprocessing import data_reader import numpy as np import os class DeepclusteringnoiseReconstructor(mask_reconst...
mit
evernym/zeno
plenum/test/txn_author_agreement/acceptance/helper.py
2
2183
import json from indy.ledger import ( append_txn_author_agreement_acceptance_to_request, sign_request ) from plenum.common.util import randomString from plenum.test.pool_transactions.helper import ( prepare_nym_request, prepare_new_node_data, prepare_node_request ) # TODO makes sense to make more generic an...
apache-2.0
deepcell/xhtml2pdf
demo/wsgi/pisawsgidemo.py
56
2238
#!/bin/python2.5 # -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
apache-2.0
K-Constantine/Amaraki
core/deps/gyp/pylib/gyp/flock_tool.py
1835
1748
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" ...
mit
svn2github/kgyp
pylib/gyp/generator/xcode.py
8
56539
# 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 filecmp import gyp.common import gyp.xcodeproj_file import gyp.xcode_ninja import errno import os import sys import posixpath import re import shutil import...
bsd-3-clause
lgscofield/odoo
addons/sale_order_dates/__openerp__.py
260
1771
# -*- 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
nzlosh/st2
tools/migrate_triggers_to_include_ref_count.py
3
2553
#!/usr/bin/env python # Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
apache-2.0
ewbankkit/cloud-custodian
tests/test_rdsparamgroup.py
6
9956
# Copyright 2017 Capital One Services, 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 or agreed to in...
apache-2.0
arg-hya/taxiCab
Tools/Misc/TaskPointGenerator.py
1
1502
import json import shapefile as shp import matplotlib.pyplot as plt import random def mean(numbers): return float(sum(numbers)) / max(len(numbers), 1) numbersX = [] numbersY = [] TaskPoints = {} shpFilePath = r"D:\TaxiCab\mycode\Plots\ShapefileAndTrajectory\taxi_zones\taxi_zones" sf = shp.Reader(shpFil...
gpl-3.0
kleins11/intdatasci-byte2
jmankoff-mobile/lib/jinja2/bccache.py
346
12793
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
apache-2.0
Chipe1/aima-python
tests/test_mdp.py
2
8327
import pytest from mdp import * random.seed("aima-python") sequential_decision_environment_1 = GridMDP([[-0.1, -0.1, -0.1, +1], [-0.1, None, -0.1, -1], [-0.1, -0.1, -0.1, -0.1]], term...
mit
comjoy91/SouthKorean-legislativeElection-history
crawlers/election_results/crawlers/assembly/base.py
1
9308
#!/usr/bin/env python3 # -*- coding=utf-8 -*- ############### is proportional in parse! import gevent from gevent import monkey import itertools from urllib.parse import urljoin from utils import flatten, get_json, get_xpath, parse_cell, sanitize, split monkey.patch_all() class BaseCrawler(object): url_image_ba...
apache-2.0
Jyrsa/hoppy.fi
beerstatus/tasks.py
1
11309
import logging from django.conf import settings from django.template.defaultfilters import slugify from django.utils import timezone from huey.djhuey import db_periodic_task from huey.djhuey import crontab from huey.djhuey import db_task import pytz import requests import json import datetime from beerstatus import mo...
mit
acidjunk/django-scrumboard
scrumtools/apps/scrumboard/views.py
1
7382
from django.views.generic import ListView, TemplateView from django.views.generic.detail import DetailView from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.forms.models import modelform_factory from django.core.urlresolvers import reverse_lazy from django.shortcuts import render fro...
gpl-3.0
sjperkins/tensorflow
tensorflow/python/kernel_tests/sparse_split_op_test.py
138
13629
# 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
ClearCorp/odoo-costa-rica
TODO-9.0/l10n_cr_hr_payroll_pay_generator_promerica/__init__.py
3
1059
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
danbryce/dreal
benchmarks/network/water/water-triple-sat.py
11
6919
from gen import * ########## # shared # ########## flow_var[0] = """ (declare-fun tau () Real) (declare-fun x1 () Real) (declare-fun x2 () Real) (declare-fun x3 () Real) """ flow_dec[0] = """ (define-ode flow_1 ((= d/dt[x1] (/ (- 5 (* (* 0.5 (^ (* 2 9.80665) 0.5)) (^ x1 0.5))) 2)) (= d/dt[x2] (...
gpl-2.0
dalejung/edamame
edamame/tools/follow.py
1
9062
import inspect import gc import sys import os.path import difflib from collections import OrderedDict import pandas as pd from pandas.core.common import in_ipnb def is_property(code): """ Using some CPython gc magics, check if a code object is a property gc idea taken from trace.py from stdlib """ ...
mit
JavML/django
tests/order_with_respect_to/tests.py
137
4286
from __future__ import unicode_literals from operator import attrgetter from django.db import models from django.test import TestCase from .models import Answer, Post, Question class OrderWithRespectToTests(TestCase): # Hook to allow subclasses to run these tests with alternate models. Answer = Answer ...
bsd-3-clause
Nuevosmedios/django-badger
badger/migrations/0012_auto__add_field_badge_assignment_badge.py
1
10979
# -*- 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 'Badge.assignment_badge' db.add_column(u'badger_badge', 'a...
bsd-3-clause
eneldoserrata/marcos_openerp
addons/report_intrastat/__init__.py
64
1094
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
argriffing/arb
doc/source/conf.py
1
8167
# -*- coding: utf-8 -*- # # Arb documentation build configuration file, created by # sphinx-quickstart on Thu Oct 11 09:33:44 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All con...
lgpl-2.1
frdb194/django
tests/template_backends/test_dummy.py
306
3603
# coding: utf-8 from __future__ import unicode_literals from django.forms import CharField, Form, Media from django.http import HttpRequest from django.middleware.csrf import CsrfViewMiddleware, get_token from django.template import TemplateDoesNotExist, TemplateSyntaxError from django.template.backends.dummy import ...
bsd-3-clause
robbiet480/home-assistant
homeassistant/components/zha/climate.py
3
20591
""" Climate on Zigbee Home Automation networks. For more details on this platform, please refer to the documentation at https://home-assistant.io/components/zha.climate/ """ from datetime import datetime, timedelta import enum import functools import logging from random import randint from typing import List, Optional...
apache-2.0
compas-dev/compas
src/compas/numerical/ga/ga.py
1
31945
from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import random import json import copy __all__ = ['ga'] TPL = """ GA summary ========== - fitness function name: {} - fitnes function type : {} - number of generations : {} - number of individuals ...
mit
bbbenja/SickRage
lib/sqlalchemy/dialects/mysql/pyodbc.py
79
2617
# mysql/pyodbc.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 """ .. dialect:: mysql+pyodbc :name: PyODBC :dbapi: pyodbc :connectstrin...
gpl-3.0
google-code-export/evennia
game/gamesrc/objects/examples/object.py
3
8567
""" Template for Objects Copy this module up one level and name it as you like, then use it as a template to create your own Objects. To make the default commands default to creating objects of your new type (and also change the "fallback" object used when typeclass creation fails), change settings.BASE_OBJECT_TYPEC...
bsd-3-clause
shsmith/electrum-server
run_electrum_server.py
6
10908
#!/usr/bin/env python # Copyright(C) 2011-2016 Thomas Voegtlin # # 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, m...
mit
kswiat/django
django/contrib/gis/geos/tests/test_geos_mutation.py
112
5462
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. import unittest from unittest import skipUnless from .. import HAS_GEOS if HAS_GEOS: from .. import fromstr, LinearRing, LineString, MultiP...
bsd-3-clause
riccardomc/moto
moto/core/models.py
20
5501
from __future__ import unicode_literals import functools import inspect import re from httpretty import HTTPretty from .responses import metadata_response from .utils import convert_regex_to_flask_path class MockAWS(object): nested_count = 0 def __init__(self, backends): self.backends = backends ...
apache-2.0
rversteegen/commandergenius
project/jni/python/src/Tools/i18n/makelocalealias.py
52
2007
#!/usr/bin/env python """ Convert the X11 locale.alias file into a mapping dictionary suitable for locale.py. Written by Marc-Andre Lemburg <mal@genix.com>, 2004-12-10. """ import locale # Location of the alias file LOCALE_ALIAS = '/usr/lib/X11/locale/locale.alias' def parse(filename): f = open(fil...
lgpl-2.1
vinchoi/fishplay
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py
2763
11318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
gpl-3.0
frewsxcv/servo
tests/wpt/css-tests/tools/html5lib/html5lib/filters/lint.py
979
4306
from __future__ import absolute_import, division, unicode_literals from gettext import gettext _ = gettext from . import _base from ..constants import cdataElements, rcdataElements, voidElements from ..constants import spaceCharacters spaceCharacters = "".join(spaceCharacters) class LintError(Exception): pass ...
mpl-2.0
jdsika/TUM_HOly
openrave/sympy/assumptions/handlers/calculus.py
4
4242
""" This module contains query handlers responsible for calculus queries: infinitesimal, bounded, etc. """ from sympy.logic.boolalg import conjuncts from sympy.assumptions import Q, ask from sympy.assumptions.handlers import CommonHandler class AskInfinitesimalHandler(CommonHandler): """ Handler for key 'infin...
mit
sanjeevtripurari/zookeeper
src/contrib/zkpython/src/examples/watch_znode_for_changes.py
138
6544
#!/usr/bin/env python2.6 # 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 #...
apache-2.0
v-a/check_mk
web/htdocs/index.py
1
13788
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
gpl-2.0
Hasimir/brython
www/src/Lib/site-packages/simpleaio/coroutines.py
5
1700
import functools from .futures import * CO_GENERATOR = 0x20 def _gen(): yield 10 _GEN_TYPE = type(_gen()) def isgenerator_function(object): return bool(hasattr(object,'__code__') and (object.__code__.co_flags & CO_GENERATOR)) def iscoroutinefunction(func): """Return True if func is a decorated coroutin...
bsd-3-clause
cmelange/ansible
lib/ansible/modules/cloud/vmware/vmware_maintenancemode.py
27
6009
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, VMware, 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 o...
gpl-3.0
mohanprasath/Course-Work
data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part02-e04_word_frequencies/tmc/result.py
91
1502
from unittest.runner import TextTestResult from .points import _parse_points, _name_test import atexit import json import traceback results = [] class TMCResult(TextTestResult): def __init__(self, stream, descriptions, verbosity): super(TMCResult, self).__init__(stream, descriptions, verbosity) def...
gpl-3.0
unicefuganda/rapidsms-bednets
bednets/view_helpers.py
1
3046
import datetime import xlwt from time import strftime from mtrack.utils import write_xls from django.http import HttpResponse from django.db import connection def generate_excel_response(data, headings): book = xlwt.Workbook(encoding="utf8") write_xls(sheet_name="BedNets Report", headings=headings, data=data, ...
bsd-3-clause
alexhersh/calico
calico/etcddriver/test/test_hwm.py
2
6347
# -*- coding: utf-8 -*- # Copyright 2015 Metaswitch Networks # # 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 applicab...
apache-2.0
lukeiwanski/tensorflow
tensorflow/contrib/slim/python/slim/data/dataset.py
163
2444
# 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
CredoReference/edx-platform
common/lib/xmodule/xmodule/partitions/partitions.py
21
8474
"""Defines ``Group`` and ``UserPartition`` models for partitioning""" from collections import namedtuple from stevedore.extension import ExtensionManager # We use ``id`` in this file as the IDs of our Groups and UserPartitions, # which Pylint disapproves of. # pylint: disable=redefined-builtin # UserPartition IDs ...
agpl-3.0
40223142/2015cad0623
static/Brython3.1.1-20150328-091302/Lib/_abcoll.py
688
5155
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported via collections; they are defined here only to alleviate certain bootstrappin...
gpl-3.0
vbelakov/h2o
py/testdir_multi_jvm/notest_import_covtype_parse_2jvm_fvec.py
9
1398
import unittest, sys, random, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): pass print "Will build clouds with incre...
apache-2.0
stinebuu/nest-simulator
pynest/nest/tests/test_weights_as_lists.py
10
5009
# -*- coding: utf-8 -*- # # test_weights_as_lists.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 L...
gpl-2.0
EdisonAlgorithms/HackerRank
practice/ai/machine-learning/stockprediction/stockprediction.py
3
1779
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: Zeyuan Shang # @Date: 2016-01-13 14:50:43 # @Last Modified by: Zeyuan Shang # @Last Modified time: 2016-01-13 15:12:39 # Usefull reading: # http://stackoverflow.com/questions/1989992/predict-stock-market-values import numpy as np import math def read_data(...
mit
twneale/hercules
hercules/dict.py
1
5018
import functools from hercules.loop_interface import IteratorWrapperBase class KeyClobberError(KeyError): pass class NoClobberDict(dict): '''An otherwise ordinary dict that complains if you try to overwrite any existing keys. ''' KeyClobberError = KeyClobberError def __setitem__(self, key, ...
bsd-3-clause
BrotherPhil/django
tests/utils_tests/test_safestring.py
278
3677
from __future__ import unicode_literals from django.template import Context, Template from django.test import SimpleTestCase from django.utils import html, six, text from django.utils.encoding import force_bytes, force_text from django.utils.functional import lazy from django.utils.safestring import ( EscapeData, ...
bsd-3-clause
AlphaStaxLLC/docker-compose-ui
scripts/requires_auth.py
5
1293
# inspired by http://flask.pocoo.org/snippets/8/ from functools import wraps from flask import request, Response import os def authentication_enabled(): return os.environ.has_key('COMPOSE_USERNAME') and os.environ.has_key('COMPOSE_PASSWORD') def disable_authentication(): del os.environ['COMPOSE_USERNAME'] ...
mit
ageron/tensorflow
tensorflow/compiler/tests/lrn_ops_test.py
13
4787
# 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
interDist/pasportaservo
hosting/forms/places.py
1
11530
from collections import namedtuple from datetime import date from django import forms from django.contrib.auth import get_user_model from django.utils.text import format_lazy from django.utils.translation import ugettext_lazy as _ from core.models import SiteConfiguration from maps.widgets import MapboxGlWidget from...
agpl-3.0
factorlibre/OCB
openerp/addons/base/module/wizard/base_export_language.py
269
3648
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2004-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
openhatch/oh-mainline
mysite/profile/models.py
6
27395
# This file is part of OpenHatch. # Copyright (C) 2010 Parker Phinney # Copyright (C) 2009, 2010 OpenHatch, Inc. # Copyright (C) 2010 Mark Freeman # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Fo...
agpl-3.0
krasch/smart-assistants
examples/visualize_habits.py
1
1689
# -*- coding: UTF-8 -*- """ Plot visualization of user habits, i.e. show which actions typically follow some given user action. Note: the figure for "Frontdoor=Closed" slightly deviates from Figure 1 in the paper and Figure 5.1 in the dissertation (see paper_experiments.py for bibliographical information). The numb...
mit
teamfx/openjfx-9-dev-rt
modules/javafx.web/src/main/native/Source/JavaScriptCore/Scripts/builtins/builtins_generate_combined_header.py
3
6346
#!/usr/bin/env python # # Copyright (c) 2014, 2015 Apple Inc. All rights reserved. # Copyright (c) 2014 University of Washington. 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. Redistributio...
gpl-2.0
arborh/tensorflow
tensorflow/python/distribute/multi_process_runner_no_init_test.py
7
1561
# Copyright 2019 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
macosforge/ccs-calendarserver
twistedcaldav/test/test_extensions.py
1
9681
# -*- coding: utf-8 -*- ## # Copyright (c) 2009-2017 Apple 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 ...
apache-2.0
cjhak/b2share
invenio/utils/xmlhelpers.py
18
1097
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
twosigma/beaker-notebook
beakerx/beakerx_magics/java_magic.py
1
1242
# Copyright 2017 TWO SIGMA OPEN SOURCE, 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 or agr...
apache-2.0
justathoughtor2/atomicApe
cygwin/lib/python2.7/types.py
99
2094
"""Define names for all type symbols known in the standard interpreter. Types that are part of optional modules (e.g. array) are not listed. """ import sys # Iterators in Python aren't a matter of type but of protocol. A large # and changing number of builtin types implement *some* flavor of # iterator. Don't check...
gpl-3.0
jfsantos/chainer
tests/functions_tests/test_softmax_cross_entropy.py
3
2482
import math import unittest import numpy import six import chainer from chainer import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition if cuda.available: cuda.init() class TestSoftmaxCrossE...
mit
andrewor14/iolap
python/pyspark/ml/param/__init__.py
2
8455
# # 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
chheplo/jaikuengine
explore/views.py
30
2353
# Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
ybellavance/python-for-android
python-modules/twisted/twisted/python/dist.py
60
12329
""" Distutils convenience functionality. Don't use this outside of Twisted. Maintainer: Christopher Armstrong """ import sys, os from distutils.command import build_scripts, install_data, build_ext, build_py from distutils.errors import CompileError from distutils import core from distutils.core import Extension tw...
apache-2.0
rmfitzpatrick/ansible
lib/ansible/plugins/lookup/dnstxt.py
46
2169
# (c) 2012, Jan-Piet Mens <jpmens(at)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 later ver...
gpl-3.0