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
LiaoPan/scikit-learn
examples/applications/plot_outlier_detection_housing.py
243
5577
""" ==================================== Outlier detection on a real data set ==================================== This example illustrates the need for robust covariance estimation on a real data set. It is useful both for outlier detection and for a better understanding of the data structure. We selected two sets o...
bsd-3-clause
umkay/zulip
zerver/lib/migrate.py
8
4082
from __future__ import print_function from typing import Any, Callable, Tuple from django.db.models.query import QuerySet import re import time def timed_ddl(db, stmt): # type: (Any, str) -> None print() print(time.asctime()) print(stmt) t = time.time() db.execute(stmt) delay = time.time() ...
apache-2.0
pwong-mapr/private-hue
desktop/core/ext-py/Django-1.4.5/django/core/mail/backends/smtp.py
94
4022
"""SMTP email backend class.""" import smtplib import socket import threading from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.utils import DNS_NAME from django.core.mail.message import sanitize_address class EmailBackend(BaseEmailBackend): """ ...
apache-2.0
ojengwa/oh-mainline
vendor/packages/python-openid/openid/test/storetest.py
77
13015
from openid.association import Association from openid.cryptutil import randomString from openid.store.nonce import mkNonce, split import unittest import string import time import socket import random import os db_host = 'dbtest' allowed_handle = [] for c in string.printable: if c not in string.whitespace: ...
agpl-3.0
mprinc/McMap
src/scripts/CSN_Archive/check_object_names.py
1
4677
#!/usr/bin/env python # Copyright (c) 2015, Scott D. Peckham #------------------------------------------------------ # S.D. Peckham # July 9, 2015 # # Tool to extract the object part of every CSDMS Standard # Variable Name and generate a list of objects that # includes those as well as all parent objects. # # Example...
mit
liorvh/raspberry_pwn
src/pentest/fimap/singleScan.py
8
5441
# # This file is part of fimap. # # Copyright(c) 2009-2010 Iman Karim(ikarim2s@smail.inf.fh-brs.de). # http://fimap.googlecode.com # # This file may be licensed under the terms of of the # GNU General Public License Version 2 (the ``GPL''). # # Software distributed under the License is distributed # on an ``AS IS'' bas...
gpl-3.0
PrFalken/exaproxy
lib/exaproxy/icap/response.py
1
2403
class ICAPResponse (object): def __init__ (self, version, code, status, headers, icap_header, http_header): self.version = version self.code = code self.status = status self.headers = headers icap_len = len(icap_header) http_len = len(http_header) icap_end = icap_len if http_header: http_len_s...
bsd-2-clause
burntcustard/DeskBot-Zero
neural-net/keras/neuralNet.py
1
4088
''' How to run: $ source ~/Documents/tensorflow/bin/activate $ cd Documents/DeskBot-Zero/neural-net/keras $ python neuralNet.py Heavily based on: https://github.com/keras-team/keras/blob/master/examples/cifar10_cnn.py ''' import os import keras from keras.preprocessing.image import ImageDataGenerator from keras.model...
mit
BeDjango/intef-openedx
openedx/core/djangoapps/user_api/accounts/views.py
21
8229
""" NOTE: this API is WIP and has not yet been approved. Do not use this API without talking to Christina or Andy. For more information, see: https://openedx.atlassian.net/wiki/display/TNL/User+API """ from django.db import transaction from rest_framework.views import APIView from rest_framework.response import Respon...
agpl-3.0
anthonyryan1/xbmc
lib/gtest/test/gtest_shuffle_test.py
3023
12549
#!/usr/bin/env python # # Copyright 2009 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...
gpl-2.0
chidea/GoPythonDLLWrapper
bin/lib/test/test_compare.py
12
3994
import unittest from test import support class Empty: def __repr__(self): return '<Empty>' class Cmp: def __init__(self,arg): self.arg = arg def __repr__(self): return '<Cmp %s>' % self.arg def __eq__(self, other): return self.arg == other class Anything: def __e...
mit
yoe/veyepar
dj/scripts/enc.py
1
23477
#!/usr/bin/python """ assembles raw cuts into final, titles, tweaks audio, encodes to format for upload. """ import re import os import sys import subprocess import xml.etree.ElementTree from mk_mlt import mk_mlt import pprint from process import process from main.models import Client, Show, Location, Episode, Raw_...
mit
GoodCloud/johnny-cache
johnny/backends/memcached.py
1
1842
#!/usr/bin/env python # -*- coding: utf-8 -*- """Infinite caching memcached class. Caches forever when passed a timeout of 0. For Django >= 1.3, this module also provides ``MemcachedCache`` and ``PyLibMCCache``, which use the backends of their respective analogs in django's default backend modules. """ from django....
mit
freifunk-darmstadt/tools
update-telemetry.py
1
8987
#!/usr/bin/env python3 import psutil import os import json import re import itertools from contextlib import contextmanager import pprint import time import socket import subprocess import logging logger = logging.getLogger(__name__) def pairwise(iterable): "s -> (s0,s1), (s2,s3), (s4, s5), ..." a = iter(ite...
agpl-3.0
anastue/netforce
netforce_mfg/netforce_mfg/models/workcenter.py
2
4110
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, publ...
mit
ddong8/ihasy
lib/gravatar.py
12
4549
#!/usr/bin/env python3 # # python-gravatar - Copyright (c) 2009 Pablo Seminario # This software is distributed under the terms of the GNU General # Public License # # 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 So...
bsd-3-clause
maferelo/saleor
saleor/account/migrations/0001_initial.py
3
19366
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.db.models.deletion import django.utils.timezone from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("auth", "0006_require_contenttypes_0002")] replaces = [("userprofile", "0001_initial...
bsd-3-clause
elelsee/pycfn-elasticsearch
pycfn_elasticsearch/vendored/docutils/languages/he.py
148
2683
# Author: Meir Kriheli # Id: $Id: he.py 4837 2006-12-26 09:59:41Z sfcben $ # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each language:...
apache-2.0
ag-sc/QALD
4/scripts/Evaluation.py
1
26257
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.dom.minidom as dom import xml.dom from decimal import * import sys import os import datetime #from Numeric import * # Dokument erzeugen implement = xml.dom.getDOMImplementation() ###################Globale Variablen################### task=None choosen_tag={}...
mit
Re4son/Kali-Pi
Menus/menu_pause.py
1
1785
#!/usr/bin/env python import pygame, os, sys, subprocess, time import RPi.GPIO as GPIO from pygame.locals import * from subprocess import * if "TFT" in os.environ and os.environ["TFT"] == "0": # No TFT screen SCREEN=0 pass elif "TFT" in os.environ and os.environ["TFT"] == "2": # TFT screen with mouse ...
gpl-3.0
ZotPlus/zotero-better-bibtex
util/scrub-profile.py
2
3327
#!/usr/bin/env python3 import os import glob import shutil import fileinput import json import sys from configparser import ConfigParser root = os.path.expanduser('~/.BBTZ5TEST') false = False true = True def user_pref(key, value): global user_pref_key global user_pref_value user_pref_key = key user_pref_va...
unlicense
grantsewell/nzbToMedia
libs/beets/autotag/match.py
18
17713
# This file is part of beets. # Copyright 2013, Adrian Sampson. # # 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, ...
gpl-3.0
foobarbazblarg/stayclean
stayclean-2016-april/serve-signups-with-flask.py
1
8086
#!/usr/bin/python import subprocess import praw from hashlib import sha1 from flask import Flask from flask import Response from flask import request from cStringIO import StringIO from base64 import b64encode from base64 import b64decode from ConfigParser import ConfigParser import OAuth2Util import os import markdow...
mit
sentient-energy/emsw-bitbake-mirror
lib/bb/server/none.py
3
6071
# # BitBake 'dummy' Passthrough Server # # Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer # Copyright (C) 2006 - 2008 Richard Purdie # # 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 Foundatio...
gpl-2.0
zhibolau/webApp
www/models.py
1
1589
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Zhibo Liu' import time,uuid from transwarp.db import next_id # 直接from Import会出错 必须在那个目录下建立__init__.py 文件!!!!!!!! from transwarp.orm import Model, StringField, BooleanField, FloatField, TextField class User(Model): __table__ = 'users' id = StringF...
gpl-2.0
splav/servo
tests/wpt/web-platform-tests/tools/third_party/html5lib/html5lib/html5parser.py
45
118951
from __future__ import absolute_import, division, unicode_literals from six import with_metaclass, viewkeys import types from collections import OrderedDict from . import _inputstream from . import _tokenizer from . import treebuilders from .treebuilders.base import Marker from . import _utils from .constants impor...
mpl-2.0
maniteja123/numpy
numpy/distutils/command/build_py.py
264
1210
from __future__ import division, absolute_import, print_function from distutils.command.build_py import build_py as old_build_py from numpy.distutils.misc_util import is_string class build_py(old_build_py): def run(self): build_src = self.get_finalized_command('build_src') if build_src.py_modules...
bsd-3-clause
shekkbuilder/the-backdoor-factory
onionduke/onionduke.py
15
4890
#!/usr/bin/env python import struct import os def xor_file(input_file, output_file, xorkey): number_added = 0 while True: some_bytes = input_file.read(4) if len(some_bytes) == 0: break if len(some_bytes) % 4 != 0: number_added = 4 - len(some_bytes) ...
bsd-3-clause
kimjinyong/i2nsf-framework
Hackathon-104/DMS/confd-6.6/lib/pyang/pyang/xpath.py
9
5841
import re import sys # not 100% XPath / XML, but good enough for YANG namestr=r'[a-zA-Z_][a-zA-Z0-9_\-.]*' ncnamestr = '((' + namestr + '):)?(' + namestr + ')' prefixteststr = '((' + namestr + r'):)?\*' patterns = [ ('whitespace', re.compile(r'\s+')), # Expr tokens ('(', re.compile(r'\(')), (')', re.c...
apache-2.0
weisongchen/flaskapp
venv/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/whitespace.py
353
1139
from __future__ import absolute_import, division, unicode_literals import re from . import base from ..constants import rcdataElements, spaceCharacters spaceCharacters = "".join(spaceCharacters) SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) class Filter(base.Filter): spacePreserveElements = frozenset([...
mit
thomaserlang/XenBackup
src/xenbackup/XenAPI.py
1
9750
# Copyright (c) Citrix Systems, 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: # # 1) Redistributions of source code must retain the above copyright # notice, this list of conditions ...
mit
kawamon/hue
desktop/core/ext-py/urllib3-1.25.8/test/with_dummyserver/test_socketlevel.py
2
58975
# TODO: Break this module up into pieces. Maybe group by functionality tested # rather than the socket level-ness of it. from urllib3 import HTTPConnectionPool, HTTPSConnectionPool from urllib3.poolmanager import proxy_from_url from urllib3.exceptions import ( MaxRetryError, ProxyError, ReadTimeoutError, ...
apache-2.0
ageron/tensorflow
tensorflow/contrib/util/__init__.py
18
1477
# 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
nvoron23/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/framework/toolmenu.py
17
7743
# toolmenu.py import win32ui import win32con import win32api import app import sys import string tools = {} idPos = 100 # The default items should no tools menu exist in the INI file. defaultToolMenuItems = [ ('Browser', 'win32ui.GetApp().OnViewBrowse(0,0)'), ('Browse PythonPath', 'from pywin.tools import br...
apache-2.0
sp1rs/vyked
vyked/packet.py
2
5504
from collections import defaultdict from uuid import uuid4 class _Packet: _pid = 0 @classmethod def _next_pid(cls): from uuid import uuid4 return str(uuid4()) @classmethod def ack(cls, request_id): return {'pid': cls._next_pid(), 'type': 'ack', 'request_id': request_id} ...
mit
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.5/Lib/plat-freebsd6/IN.py
8
11516
# Generated by h2py from /usr/include/netinet/in.h # Included from sys/cdefs.h def __P(protos): return protos def __STRING(x): return #x def __XSTRING(x): return __STRING(x) def __P(protos): return () def __STRING(x): return "x" def __aligned(x): return __attribute__((__aligned__(x))) def __section(x): return __...
mit
aduric/crossfit
nonrel/tests/regressiontests/admin_views/customadmin.py
52
1279
""" A second, custom AdminSite -- see tests.CustomAdminSiteTests. """ from django.conf.urls.defaults import patterns from django.contrib import admin from django.http import HttpResponse import models, forms class Admin2(admin.AdminSite): login_form = forms.CustomAdminAuthenticationForm login_template = 'cust...
bsd-3-clause
kantel/processingpy
mpmathtest/mpmath/libmp/libmpi.py
6
27622
""" Computational functions for interval arithmetic. """ from .backend import xrange from .libmpf import ( ComplexResult, round_down, round_up, round_floor, round_ceiling, round_nearest, prec_to_dps, repr_dps, dps_to_prec, bitcount, from_float, fnan, finf, fninf, fzero, fhalf, fone, fnone, ...
mit
volkandkaya/trader
trader/joins/migrations/0005_auto__add_unique_join_email_ref_id.py
1
1346
# -*- 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 unique constraint on 'Join', fields ['email', 'ref_id'] db.creat...
mit
gdi2290/rethinkdb
test/rql_test/connections/http_support/flask/json.py
428
8113
# -*- coding: utf-8 -*- """ flask.jsonimpl ~~~~~~~~~~~~~~ Implementation helpers for the JSON support in Flask. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import io import uuid from datetime import datetime from .globals import current_app, request fro...
agpl-3.0
mohseniaref/PySAR-1
pysar/pysarApp.py
1
21751
#! /usr/bin/env python ############################################################################### # # Project: PySAR # Purpose: Python Module for InSAR Time-series Analysis # Author: Heresh Fattahi # Created: July 2013 # Modified: Yunjun Zhang, Feb 2015 ###########################################################...
mit
janisz/Diamond-1
src/collectors/endecadgraph/endecadgraph.py
57
3912
# coding=utf-8 """ Collects stats from Endeca Dgraph/MDEX server. Tested with: Endeca Information Access Platform version 6.3.0.655584 === Authors Jan van Bemmelen <jvanbemmelen@bol.com> Renzo Toma <rtoma@bol.com> """ import diamond.collector import urllib2 from StringIO import StringIO import re import sys if sys...
mit
AsimmHirani/ISpyPi
tensorflow/contrib/tensorflow-master/tensorflow/contrib/layers/python/ops/sparse_feature_cross_op.py
34
5025
# 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
qbuat/rootpy
rootpy/tree/model.py
1
5162
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License from __future__ import absolute_import import inspect from cStringIO import StringIO import types import ROOT from .. import log; log = log[__name__] from .treetypes import Column from .treebuffer import TreeBuffer...
gpl-3.0
Easy-as-Bit/p2pool
p2pool/util/math.py
130
6565
from __future__ import absolute_import, division import __builtin__ import math import random import time def median(x, use_float=True): # there exist better algorithms... y = sorted(x) if not y: raise ValueError('empty sequence!') left = (len(y) - 1)//2 right = len(y)//2 sum = y[left]...
gpl-3.0
uniphil/heroku-buildpack-pythonsass
vendor/setuptools-2.1/setuptools/extension.py
284
1404
import sys import distutils.core import distutils.extension from setuptools.dist import _get_unpatched _Extension = _get_unpatched(distutils.core.Extension) def have_pyrex(): """ Return True if Cython or Pyrex can be imported. """ pyrex_impls = 'Cython.Distutils.build_ext', 'Pyrex.Distutils.build_ext...
mit
natefoo/ansible-modules-extras
cloud/amazon/ec2_remote_facts.py
42
5671
#!/usr/bin/python # # This is a 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 Ansible library is distributed in the hope that i...
gpl-3.0
daxxi13/CouchPotatoServer
libs/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
gpl-3.0
tessercat/ddj
languages/tr.py
121
7256
# coding: utf-8 { '!langcode!': 'tr', '!langname!': 'Türkçe', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"güncelle" ("update") "field1=\'yenideğer\'" gibi isteğe bağlı bir ifadedir. JON sonucu güncelleyemez veya silemzsiniz.', '%s %%(shop)': '%s ...
mit
13k/pygmentize
vendor/pygments/formatters/bbcode.py
75
3314
# -*- coding: utf-8 -*- """ pygments.formatters.bbcode ~~~~~~~~~~~~~~~~~~~~~~~~~~ BBcode formatter. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.util import get_bool_opt __al...
mit
LarsDu/DeepNuc
deepnuc/nucbinaryclassifier.py
2
15464
import tensorflow as tf import numpy as np import sklearn.metrics as metrics #from databatcher import DataBatcher import nucconvmodel #import dubiotools as dbt import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pprint from itertools import cycle import os import sys #Logging imports fro...
gpl-3.0
xgwubin/vitess
py/vtproto/vtctldata_pb2.py
6
4617
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: vtctldata.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.pr...
bsd-3-clause
Guneet-Dhillon/mxnet
python/setup.py
14
3481
# 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 u...
apache-2.0
lirui-apache/hive
hcatalog/src/test/e2e/templeton/inpdir/xmlmapper.py
11
1320
#!/usr/bin/env python # dftmapper.py # 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...
apache-2.0
jolid/script.module.donnie
lib/donnie/furk.py
1
6496
import urllib2, urllib, sys, os, re, random, copy from BeautifulSoup import BeautifulSoup, Tag, NavigableString import xbmc,xbmcplugin,xbmcgui,xbmcaddon from t0mm0.common.net import Net from t0mm0.common.addon import Addon from scrapers import CommonScraper net = Net() try: import json except: # pre-frodo and python...
gpl-2.0
axinging/chromium-crosswalk
third_party/cython/src/Cython/Compiler/StringEncoding.py
97
9235
# # Cython -- encoding related tools # import re import sys if sys.version_info[0] >= 3: _unicode, _str, _bytes = str, str, bytes IS_PYTHON3 = True else: _unicode, _str, _bytes = unicode, str, str IS_PYTHON3 = False empty_bytes = _bytes() empty_unicode = _unicode() join_bytes = empty_bytes.join c...
bsd-3-clause
twitterdev/twitter-leaderboard
services/migrations/0001_initial.py
1
1248
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-28 08:34 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migration...
mit
codingforfun/Olena-Mirror
swilena/python/complex2-misc.py
2
2380
#! /usr/bin/env python # Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE) # # This file is part of Olena. # # Olena 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, version 2 of the License....
gpl-2.0
movmov/cc
vendor/Twisted-10.0.0/twisted/web/error.py
52
7408
# -*- test-case-name: twisted.web.test.test_error -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Exception definitions for L{twisted.web}. """ import operator, warnings from twisted.web import http class Error(Exception): """ A basic HTTP error. @type status:...
apache-2.0
angelman/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/commit_unittest.py
124
3270
# Copyright (C) 2012 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
was4444/chromium.src
build/android/pylib/uirobot/uirobot_test_instance.py
26
2028
# 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. import json import logging from devil.android import apk_helper from pylib.base import test_instance class UirobotTestInstance(test_instance.TestInstance):...
bsd-3-clause
ksmit799/Toontown-Source
toontown/effects/SparksTrail.py
6
4236
from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from direct.particles import ParticleEffect, Particles, ForceGroup from PooledEffect import PooledEffect from EffectController import EffectController class SparksTrail(PooledEffect, EffectController): def __init__(self): Poole...
mit
pferreir/indico
indico/web/flask/app.py
2
19781
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import os import uuid from babel.numbers import format_currency, get_currency_name from flask import _app...
mit
jayrumi/walmart-reviews
setup.py
1
1197
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name = 'walmart-reviews',...
mit
harrylewis/python-uinames
uinames/models.py
1
1384
from utils import PropertyUnavailable class People(object): """ A collection of people, represented by the Person class. """ def __init__(self, json=None): self._json = json or {} self.data = [Person(identity) for identity in self._json] def __str__(self): return self.__u...
mit
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/pandas/io/tests/test_common.py
9
2087
""" Tests for the pandas.io.common functionalities """ from pandas.compat import StringIO import os from os.path import isabs import nose import pandas.util.testing as tm from pandas.io import common try: from pathlib import Path except ImportError: pass try: from py.path import local as LocalPath e...
gpl-2.0
yonggang985/Sniper
scripts/stattrace.py
2
2693
""" stattrace.py Write a trace of deltas for an arbitrary statistic. First argument is the name of the statistic (<component-name>[.<subcomponent>].<stat-name>) Second argument is either a filename, or none to write to standard output Third argument is the interval size in nanoseconds (default is 10000) """ import sy...
mit
TheKK/Shedskin
examples/score4.py
6
4867
# connect four / four-in-a-row # http://users.softlab.ece.ntua.gr/~ttsiod/score4.html from sys import argv WIDTH = 7 HEIGHT = 6 ORANGE_WINS = 1000000 YELLOW_WINS = -ORANGE_WINS g_max_depth = 7 g_debug = False class Cell: Barren = 0 Orange = 1 Yellow = -1 def score_board(board): ...
gpl-3.0
digwanderlust/pants
tests/python/pants_test/base/test_payload_field.py
1
10723
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from hashlib import ...
apache-2.0
VeNoMouS/Sick-Beard
sickbeard/generic_queue.py
52
3782
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
gpl-3.0
RobKal/Photomasking-Deansfield
createTasks.py
34
8692
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of PyBOSSA. # # PyBOSSA 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 Foundation, either version 3 of the License, or # (at your option) any late...
agpl-3.0
valkyriesavage/gasustainability
django/utils/unittest/result.py
570
6105
"""Test result object""" import sys import traceback import unittest from StringIO import StringIO from django.utils.unittest import util from django.utils.unittest.compatibility import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'fail...
bsd-3-clause
nott/next.filmfest.by
cpm_generic/constants.py
2
7163
from django.utils.translation import ugettext_lazy as _ COUNTRIES = ( ('AD', _('Andorra')), ('AE', _('United Arab Emirates')), ('AF', _('Afghanistan')), ('AG', _('Antigua & Barbuda')), ('AI', _('Anguilla')), ('AL', _('Albania')), ('AM', _('Armenia')), ('AN', _('Netherlands Antilles')),...
unlicense
Bushstar/UFO-Project
test/functional/mempool_limit.py
2
3315
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mempool limiting together/eviction with the wallet.""" from decimal import Decimal from test_fra...
mit
hendradarwin/VTK
ThirdParty/AutobahnPython/autobahn/wamp1/prefixmap.py
35
4187
############################################################################### ## ## Copyright (C) 2011-2013 Tavendo GmbH ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## h...
bsd-3-clause
rex-xxx/mt6572_x201
external/markdown/markdown/commandline.py
126
3534
""" COMMAND-LINE SPECIFIC STUFF ============================================================================= The rest of the code is specifically for handling the case where Python Markdown is called from the command line. """ import markdown import sys import logging from logging import DEBUG, INFO, WARN, ERROR, CR...
gpl-2.0
c0deh4xor/CapTipper
storage/fiddler2pcap/fiddler2pcap.py
7
7783
#!/usr/bin/python # This is probably useful to like 4 people. Some of the packet inection stuff is taken from rule2alert https://code.google.com/p/rule2alert/ which is GPLv2 so I guess this is well. # This ultra alpha if everything isn't right it will fall on its face and probably cause you to run away from it screamin...
gpl-3.0
hectormartinez/rougexstem
taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/yaml/constructor.py
9
25101
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor', 'ConstructorError'] from error import * from nodes import * import datetime try: set except NameError: from sets import Set as set import binascii, re, sys class ConstructorError(MarkedYAMLError): pass class BaseConstructor(object): ...
apache-2.0
pinax/pinax-eventlog
pinax/eventlog/migrations/0001_initial.py
1
1443
# Generated by Django 3.1 on 2020-08-15 10:08 from django.conf import settings import django.core.serializers.json from django.db import migrations, models import django.db.models.deletion import django.utils.timezone from ..compat import JSONField class Migration(migrations.Migration): initial = True dep...
mit
wrCisco/Sigil
src/Resource_Files/python3lib/ncxgenerator.py
5
8708
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab import sys import os from quickparser import QuickXHTMLParser from hrefutils import startingDir, buildBookPath, buildRelativePath, relativePath from hrefutils import urldecodepart, urlencodepart _epubtype_guide_map = { ...
gpl-3.0
zhukaixy/kbengine
kbe/res/scripts/common/Lib/test/test_genericpath.py
81
16219
""" Tests common to genericpath, macpath, ntpath and posixpath """ import genericpath import os import sys import unittest import warnings from test import support def safe_rmdir(dirname): try: os.rmdir(dirname) except OSError: pass class GenericTest: common_attributes = ['commonprefix'...
lgpl-3.0
ppries/tensorflow
tensorflow/contrib/labeled_tensor/python/ops/core.py
8
38128
# 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
JamesMura/sentry
src/sentry/south_migrations/0069_auto__add_lostpasswordhash.py
36
19967
# -*- coding: utf-8 -*- import 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 'LostPasswordHash' db.create_table('sentry_lostpasswordhash', ( ('id', self.gf('s...
bsd-3-clause
simbha/mAngE-Gin
lib/Django 1.7/django/utils/autoreload.py
40
10748
# Autoreloading launcher. # Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org). # Some taken from Ian Bicking's Paste (http://pythonpaste.org/). # # Portions copyright (c) 2004, CherryPy Team (team@cherrypy.org) # All rights reserved. # # Redistribution and use in source and binary forms, with ...
mit
lucasb-eyer/DeepFried2
DeepFried2/containers/Backward.py
2
3344
import DeepFried2 as df def backward(start, end): """ Returns a function that, when executed, sends its argument backwards through the (sub-)graph that goes from `start` to `end`. Useful e.g. for bwd-conv and un-pooling. Please give credit when simply copy-pasting into your code. """ retu...
mit
telefonicaid/iotqatools
iotqatools/cb_ngsiv2_utils.py
2
20060
# -*- coding: utf-8 -*- """ Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U This file is part of telefonica-iotqatools iotqatools 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 Foundation, either version...
agpl-3.0
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/PIL/SpiderImagePlugin.py
10
9101
# # The Python Imaging Library. # # SPIDER image file handling # # History: # 2004-08-02 Created BB # 2006-03-02 added save method # 2006-03-13 added support for stack images # # Copyright (c) 2004 by Health Research Inc. (HRI) RENSSELAER, NY 12144. # Copyright (c) 2004 by William Baxter. # Copyright (c) 2004 ...
agpl-3.0
deathping1994/sendmail-api
venv/lib/python2.7/site-packages/wheel/util.py
219
4192
"""Utility functions.""" import sys import os import base64 import json import hashlib __all__ = ['urlsafe_b64encode', 'urlsafe_b64decode', 'utf8', 'to_json', 'from_json', 'matches_requirement'] def urlsafe_b64encode(data): """urlsafe_b64encode without padding""" return base64.urlsafe_b64encode(da...
apache-2.0
fivejjs/ibis
scripts/cleanup_testing_data.py
5
1516
#! /usr/bin/env python # Copyright 2015 Cloudera 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 a...
apache-2.0
jzoldak/edx-platform
lms/djangoapps/student_profile/test/test_views.py
113
3370
# -*- coding: utf-8 -*- """ Tests for student profile views. """ from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import RequestFactory from util.testing import UrlResetMixin from student.tests.factories import UserFactory from stu...
agpl-3.0
xme1226/sahara
sahara/utils/remote.py
2
5045
# Copyright (c) 2013 Mirantis Inc. # Copyright (c) 2013 Hortonworks, 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...
apache-2.0
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_sku.py
1
1525
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
byterom/android_external_chromium_org
tools/memory_inspector/memory_inspector/frontends/command_line.py
83
5717
# 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. """Command line frontend for Memory Inspector""" import json import memory_inspector import optparse import os import time from memory_inspector import con...
bsd-3-clause
rolando/scrapy
tests/test_utils_url.py
16
19716
# -*- coding: utf-8 -*- import unittest import six from six.moves.urllib.parse import urlparse from scrapy.spiders import Spider from scrapy.utils.url import (url_is_from_any_domain, url_is_from_spider, add_http_if_no_scheme, guess_scheme, parse_url, strip_u...
bsd-3-clause
jwhitehorn/p2pool
p2pool/util/logging.py
287
2995
import codecs import datetime import os import sys from twisted.python import log class EncodeReplacerPipe(object): def __init__(self, inner_file): self.inner_file = inner_file self.softspace = 0 def write(self, data): if isinstance(data, unicode): try: data...
gpl-3.0
tlatzko/spmcluster
.tox/docs/lib/python2.7/site-packages/docutils/transforms/parts.py
187
6980
# $Id: parts.py 6073 2009-08-06 12:21:10Z milde $ # Authors: David Goodger <goodger@python.org>; Ueli Schlaepfer; Dmitry Jemerov # Copyright: This module has been placed in the public domain. """ Transforms related to document parts. """ __docformat__ = 'reStructuredText' import re import sys from docutils import n...
bsd-2-clause
bdh1011/wau
venv/lib/python2.7/site-packages/pandas/io/tests/test_sql.py
1
93879
"""SQL io tests The SQL tests are broken down in different classes: - `PandasSQLTest`: base class with common methods for all test classes - Tests for the public API (only tests with sqlite3) - `_TestSQLApi` base class - `TestSQLApi`: test the public API with sqlalchemy engine - `TestSQLiteFallbackApi`: t...
mit
curtisstpierre/django
django/conf/locale/ru/formats.py
1059
1267
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y г.' TIME_FORMAT = 'G:i' DAT...
bsd-3-clause
lesserwhirls/scipy-cwt
doc/postprocess.py
9
1240
#!/usr/bin/env python """ %prog MODE FILES... Post-processes HTML and Latex files output by Sphinx. MODE is either 'html' or 'tex'. """ import re, optparse def main(): p = optparse.OptionParser(__doc__) options, args = p.parse_args() if len(args) < 1: p.error('no mode given') mode = args.po...
bsd-3-clause
neilLasrado/frappe
frappe/model/db_query.py
2
23555
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from six import iteritems, string_types """build query for doclistview and return results""" import frappe, json, copy, re import frappe.defaults import frappe.share import fra...
mit