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
Saevon/Recipes
misc/rename_pics.py
1
1154
import os import glob from PIL import Image from PIL.ExifTags import TAGS from datetime import datetime def get_exif(fn): output = {} img = Image.open(fn) info = img._getexif() if info is None: return output for tag, value in info.items(): decoded = TAGS.get(tag, tag) outp...
mit
rcucui/Pisa-util-fix
sx/pisa3/pisa_tags.py
13
18874
# -*- 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 # # Unless r...
apache-2.0
bowlofstew/roboto
scripts/run_web_tests.py
4
4002
#!/usr/bin/python # # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
netik/dc25_spqr_badge
fabrication-rev1/macrofab_scape_to_bom.py
2
2336
#!/usr/bin/python import csv state=0 row={} comps={} def merge_two_dicts(x, y): """Given two dicts, merge them into a new dict as a shallow copy.""" z = x.copy() z.update(y) return z with open('scrape', 'r+') as f: lines = f.readlines() i=0 while i < len(lines): line = lines[i] ...
apache-2.0
evansde77/metson
tests/unit/cloudant_t/index_test.py
1
4328
#!/usr/bin/env python """ Index unittests """ import datetime import unittest from cloudant.index import python_to_couch, Index, type_or_none from cloudant.errors import CloudantArgumentError import mock class PythonToCouchTests(unittest.TestCase): """ test cases for handling checks of python_to_couch func...
apache-2.0
pkdevbox/trac
trac/db/tests/sqlite_test.py
2
3985
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consists o...
bsd-3-clause
JohnAbel/StochKit
libs/boost_1_53_0/tools/build/v2/build/project.ann.py
61
94498
f049766b (vladimir_prus 2007-10-10 09:31:06 +0000 1) # Status: being ported by Vladimir Prus ddc17f01 (vladimir_prus 2007-10-26 14:57:56 +0000 2) # Base revision: 40480 f049766b (vladimir_prus 2007-10-10 09:31:06 +0000 3) f049766b (vladimir_prus 2007-10-10 09:31:06 +0000 4) # Copyright 2002, 2003 Dave Abrahams...
gpl-3.0
nitzmahone/ansible
test/units/modules/cloud/amazon/test_ec2_vpc_vpn.py
64
15038
# (c) 2017 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
pyvec/cz.pycon.org-2016
pyconcz_2016/speakers/views.py
1
2036
import datetime from itertools import chain from django.db.models import Case from django.db.models import IntegerField from django.db.models import Q from django.db.models import Value from django.db.models import When from django.template import RequestContext from django.template.response import TemplateResponse f...
mit
prarthitm/edxplatform
lms/djangoapps/courseware/management/commands/dump_course_structure.py
23
4293
""" A Django command that dumps the structure of a course as a JSON object. The resulting JSON object has one entry for each module in the course: { "$module_url": { "category": "$module_category", "children": [$module_children_urls... ], "metadata": {$module_metadata} }, "$module_url": .... ... ...
agpl-3.0
xq262144/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/yaml/tokens.py
985
2573
class Token(object): def __init__(self, start_mark, end_mark): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in self.__dict__ if not key.endswith('_mark')] attributes.sort() arguments = ', '.join(['%s=...
apache-2.0
stefan-jonasson/home-assistant
homeassistant/components/plant.py
4
8326
""" Component to monitor plants. For more details about this component, please refer to the documentation at https://home-assistant.io/components/plant/ """ import logging import asyncio import voluptuous as vol from homeassistant.const import ( STATE_OK, STATE_PROBLEM, STATE_UNKNOWN, TEMP_CELSIUS, ATTR_TEMPERAT...
mit
aviciimaxwell/odoo
addons/hr_attendance/wizard/hr_attendance_error.py
377
2896
# -*- 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
adit-chandra/tensorflow
tensorflow/python/compiler/tensorrt/test/batch_matmul_test.py
12
3276
# Copyright 2018 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
Mikescher/Project-Euler_Befunge
compiled/Python2/Euler_Problem-066.py
1
9632
#!/usr/bin/env python2 # transpiled with BefunCompile v1.3.0 (c) 2017 import sys import zlib, base64 _g = ("AR+LCAAAAAAABADdVMGO4yAM/RW3yV5AbDGQNkEIjfYDttfOKEr3xpUTp+6/r03SadrRaKRqTmspNQXbvPfspLy+vgJb82DwpJ1+nU7fWe/t7e1b8f1+NvETOx6P1X8X" + "vqv9R/UKDN5nJ4cxdZKXyEtDSwjP1Ityn8ZBdtmjGjdFw6rMM/VmjIu1Z+8HiXyBzn76Iq0mnkuj...
mit
Swieter/Carriots-Utilities
Now/carriots_now.py
1
1327
# Carriots Utilities - Now # By Timothy D. Swieter, P.E. # MIT License # Access Carriots and pull down the latest time in various formats. # See the following link for the API information: https://www.carriots.com/documentation/api/dates # # NOTE: You must add your API Key below. import requests, json # The setup...
mit
miing/mci_migo
identityprovider/migrations/0008_add_allowed_user_attribs.py
1
18625
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'OpenIDRPConfig.allowed_user_attribs' db.add_column('ssoopenidrpconfig', 'allowed_user_attribs', self.gf('django.db....
agpl-3.0
fredericmohr/mitro
browser-ext/third_party/firefox-addon-sdk/python-lib/simplejson/scanner.py
99
2088
""" Iterator based sre token scanner """ import re from re import VERBOSE, MULTILINE, DOTALL import sre_parse import sre_compile import sre_constants from sre_constants import BRANCH, SUBPATTERN __all__ = ['Scanner', 'pattern'] FLAGS = (VERBOSE | MULTILINE | DOTALL) class Scanner(object): def __init__(self, lexi...
gpl-3.0
divya-csekar/flask-microblog-server
flask/Lib/encodings/tis_620.py
593
12556
""" Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.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_table) def decode(self,input,errors='st...
bsd-3-clause
Tranzystorek/servo
tests/wpt/css-tests/css-fonts-3_dev/xhtml1print/support/fonts/makegsubfonts.py
1616
14125
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
YangChihWei/2015cdb_g1_0623
static/Brython3.1.1-20150328-091302/Lib/_testcapi.py
742
4231
CHAR_MAX = 127 CHAR_MIN = -128 DBL_MAX = 1.7976931348623157e+308 DBL_MIN = 2.2250738585072014e-308 FLT_MAX = 3.4028234663852886e+38 FLT_MIN = 1.1754943508222875e-38 INT_MAX = 2147483647 INT_MIN = -2147483648 LLONG_MAX = 9223372036854775807 LLONG_MIN = -9223372036854775808 LONG_MAX = 2147483647 LONG_MIN = -2...
gpl-3.0
thepiper/standoff
vpy/lib/python2.7/site-packages/pip/_vendor/distlib/util.py
203
51453
# # Copyright (C) 2012-2014 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import shutil import socket import...
gpl-3.0
poros/pyleus
pyleus/configuration.py
8
4132
"""Configuration defaults and loading functions. Pyleus will look for configuration files in the following file paths in order of increasing precedence. The latter configuration overrides the previous one. #. /etc/pyleus.conf #. ~/.config/pyleus.conf #. ~/.pyleus.conf You can always specify a configuration file when...
apache-2.0
brianwoo/django-tutorial
build/Django/tests/m2m_through_regress/tests.py
25
9146
from __future__ import unicode_literals from django.contrib.auth.models import User from django.core import management from django.test import TestCase from django.utils.six import StringIO from .models import ( Car, CarDriver, Driver, Group, Membership, Person, UserMembership, ) class M2MThroughTestCase(TestCa...
gpl-3.0
kho0810/flaskr
lib/flask_wtf/form.py
12
5292
# coding: utf-8 import werkzeug.datastructures from jinja2 import Markup from flask import request, session, current_app from wtforms.fields import HiddenField from wtforms.widgets import HiddenInput from wtforms.validators import ValidationError from wtforms.ext.csrf.form import SecureForm from ._compat import text_...
apache-2.0
lz1988/django-web2015
build/lib/django/contrib/localflavor/is_/is_postalcodes.py
109
4806
# -*- coding: utf-8 -*- from __future__ import unicode_literals IS_POSTALCODES = ( ('101', '101 Reykjavík'), ('103', '103 Reykjavík'), ('104', '104 Reykjavík'), ('105', '105 Reykjavík'), ('107', '107 Reykjavík'), ('108', '108 Reykjavík'), ('109', '109 Reykjavík'), ('110', '110 Reykjavík...
bsd-2-clause
jfmartinez64/test
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/viddler.py
25
3298
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( float_or_none, int_or_none, ) class ViddlerIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?viddler\.com/(?:v|embed|player)/(?P<id>[a-z0-9]+)' _TEST = { "url": "http://www.viddler.com/v/4390378...
gpl-3.0
areski/django-registration
registration/tests/forms.py
7
5356
from __future__ import unicode_literals from django.test import TestCase from registration import forms from registration.users import UserModel class RegistrationFormTests(TestCase): """ Test the default registration forms. """ def test_registration_form(self): """ Test that ``Regi...
bsd-3-clause
ormnv/os_final_project
djangoappengine/db/compiler.py
28
17200
from functools import wraps import sys from django.db.models.fields import AutoField from django.db.models.sql import aggregates as sqlaggregates from django.db.models.sql.constants import MULTI, SINGLE from django.db.models.sql.where import AND, OR from django.db.utils import DatabaseError, IntegrityError from django...
bsd-3-clause
misterhat/youtube-dl
youtube_dl/extractor/ntvru.py
11
5024
# encoding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( clean_html, xpath_text, int_or_none, ) class NTVRuIE(InfoExtractor): IE_NAME = 'ntv.ru' _VALID_URL = r'https?://(?:www\.)?ntv\.ru/(?P<id>.+)' _TESTS = [ { 'ur...
unlicense
mganeva/mantid
qt/python/mantidqt/widgets/codeeditor/test/test_interpreter_view.py
1
1114
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2019 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + # This file is part of the mantid workbenc...
gpl-3.0
mitchelljkotler/django
tests/datetimes/tests.py
345
5922
from __future__ import unicode_literals import datetime from unittest import skipIf from django.test import TestCase, override_settings from django.utils import timezone from .models import Article, Category, Comment try: import pytz except ImportError: pytz = None class DateTimesTests(TestCase): def ...
bsd-3-clause
vlinhd11/vlinhd11-android-scripting
python/src/Lib/ctypes/test/test_random_things.py
51
2859
from ctypes import * import unittest, sys def callback_func(arg): 42 / arg raise ValueError(arg) if sys.platform == "win32": class call_function_TestCase(unittest.TestCase): # _ctypes.call_function is deprecated and private, but used by # Gary Bishp's readline module. If we have it, we m...
apache-2.0
numb3r3/kombu
kombu/entity.py
4
27157
""" kombu.entity ================ Exchange and Queue declarations. """ from __future__ import absolute_import import numbers from .abstract import MaybeChannelBound from .exceptions import ContentDisallowed from .five import string_t from .serialization import prepare_accept_content TRANSIENT_DELIVERY_MODE = 1 PER...
bsd-3-clause
tmeits/pybrain
pybrain/rl/environments/ode/tasks/acrobot.py
31
1235
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from pybrain.rl.environments import EpisodicTask from scipy import pi class GradualRewardTask(EpisodicTask): ''' task gives more reward, the higher the bar is.''' def __init__(self, environment): EpisodicTask.__init__(self, environment) sel...
bsd-3-clause
cherez/youtube-dl
youtube_dl/extractor/vidzi.py
19
1256
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class VidziIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vidzi\.tv/(?P<id>\w+)' _TEST = { 'url': 'http://vidzi.tv/cghql9yq6emu.html', 'md5': '4f16c71ca0c8c8635ab6932b5f3f1660', 'info_dict'...
unlicense
Yipit/troposphere
examples/SQS_With_CloudWatch_Alarms.py
32
2334
# Converted from SQS_With_CloudWatch_Alarms.template located at: # http://aws.amazon.com/cloudformation/aws-cloudformation-templates/ from troposphere import GetAtt, Output, Parameter, Ref, Template from troposphere.cloudwatch import Alarm, MetricDimension from troposphere.sns import Subscription, Topic from troposphe...
bsd-2-clause
stelligent/ansible-modules-extras
packaging/os/swdepot.py
51
6140
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2013, Raul Melo # Written by Raul Melo <raulmelo@gmail.com> # Based on yum module written by Seth Vidal <skvidal at fedoraproject.org> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
gpl-3.0
tomasz-wiszkowski/XfCon
src/plugins/terminal/plugin.py
1
1347
# # Copyright 2012 Tomasz Wiszkowski # # 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 w...
apache-2.0
Philip-Bachman/Sequential-Generation
MotionRenderers.py
1
14522
#!/ysr/bin/env python from __future__ import division import utils as utils import numpy as np import numpy.random as npr import theano import theano.tensor as T import time from HelperFuncs import to_fX def my_batched_dot(A, B): """ Compute: [np.dot(A[i,:,:], B[i,:,:]) for i in range(A.shape[0])] """ ...
mit
pong3489/TEST_Mission
Lib/site-packages/numpy/ma/tests/test_old_ma.py
81
34283
import numpy import types from numpy.ma import * from numpy.core.numerictypes import float32 from numpy.ma.core import umath from numpy.testing import * import sys if sys.version_info[0] >= 3: from functools import reduce pi = numpy.pi def eq(v, w, msg=''): result = allclose(v, w) if not result: p...
gpl-3.0
ubgarbage/gae-blog
django/template/loaders/cached.py
229
2469
""" Wrapper class that takes a list of template loaders as an argument and attempts to load templates from them in order, caching the result. """ from django.core.exceptions import ImproperlyConfigured from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader, get_template_fro...
bsd-3-clause
instantchow/home-assistant
homeassistant/components/zwave.py
1
9623
""" Support for Z-Wave. For more details about this component, please refer to the documentation at https://home-assistant.io/components/zwave/ """ import os.path import sys from pprint import pprint from homeassistant import bootstrap from homeassistant.const import ( ATTR_BATTERY_LEVEL, ATTR_DISCOVERED, ATTR_EN...
mit
Bloom-Project/Bloom
qa/rpc-tests/rest.py
128
3258
#!/usr/bin/env python2 # Copyright (c) 2014 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 REST interface # from test_framework import BitcoinTestFramework from util import * import json try...
mit
2uller/LotF
App/Lib/wsgiref/validate.py
3
15163
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php # Licensed to PSF under a Contributor Agreement """ Mi...
gpl-2.0
WladimirSidorenko/DiscourseSenser
dsenser/svd/svdbase.py
1
3353
#!/usr/bin/env python # -*- coding: utf-8; mode: python; -*- """Module providing abstract interface class for SVD sense classification. Attributes: SVDBaseSenser (class): abstract class defining interface for explicit and implicit classifier """ ################################################################...
mit
sandeepdsouza93/TensorFlow-15712
tensorflow/contrib/slim/python/slim/learning.py
11
30805
# 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
Ryuinferno/Blazing_Kernel_t1
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt import sh...
gpl-2.0
sguazt/prometheus
tools/giws/classRepresentation/returnDataGiws.py
1
2174
#!/usr/bin/python -u # Copyright or Copr. INRIA/Scilab - Sylvestre LEDRU # # Sylvestre LEDRU - <sylvestre.ledru@inria.fr> <sylvestre@ledru.info> # # This software is a computer program whose purpose is to generate C++ wrapper # for Java objects/methods. # # This software is governed by the CeCILL license under Fren...
apache-2.0
lukeiwanski/tensorflow-opencl
tensorflow/contrib/bayesflow/python/ops/variational_inference.py
85
1271
# 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
lukw00/shogun
applications/classification/train_multiclass_svm.py
21
3977
#!/usr/bin/env python # Copyright (c) The Shogun Machine Learning Toolbox # Written (w) 2014 Daniel Pyrathon # 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...
gpl-3.0
sjfloat/youtube-dl
youtube_dl/extractor/pluralsight.py
48
7598
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse, compat_urllib_request, compat_urlparse, ) from ..utils import ( ExtractorError, int_or_none, parse_duration, ) class PluralsightIE(InfoE...
unlicense
kenorb-contrib/BitTorrent
twisted/persisted/aot.py
20
17434
# -*- test-case-name: twisted.test.test_persisted -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ AOT: Abstract Object Trees The source-code-marshallin'est abstract-object-serializin'est persister this side of Marmalade! """ import types, new, string, copy_reg, tokenize, r...
gpl-3.0
unindented/streamcode
client/static/jsrepl/extern/python/closured/lib/python2.7/encodings/euc_kr.py
816
1027
# # euc_kr.py: Python Unicode Codec for EUC_KR # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_kr, codecs import _multibytecodec as mbc codec = _codecs_kr.getcodec('euc_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
mit
AlexOugh/horizon
openstack_dashboard/dashboards/admin/aggregates/panel.py
33
1603
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
baidu/Paddle
python/paddle/fluid/tests/unittests/test_multihead_attention.py
7
3139
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
hlef/juliet
juliet/builder.py
1
4200
import os, logging, shutil from distutils.dir_util import copy_tree from jinja2 import Template, FileSystemLoader from juliet import paths class Builder: def __init__(self, jinja_env, build_args, src, dest, noclean): """ Constructor for class Builder. Takes a jinja Environment and the build argumen...
mit
cloud9UG/odoo
addons/hw_scale/__openerp__.py
220
1699
# -*- 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
moyogo/roboto
third_party/spiro/curves/cornu.py
15
3140
from math import * # implementation adapted from cephes def polevl(x, coef): ans = coef[-1] for i in range(len(coef) - 2, -1, -1): ans = ans * x + coef[i] return ans sn = [ -2.99181919401019853726E3, 7.08840045257738576863E5, -6.29741486205862506537E7, 2.54890880573376359104E9, -4.4297951805969...
apache-2.0
JRock007/boxxy
dist/Boxxy server.app/Contents/Resources/lib/python2.7/numpy/lib/format.py
32
26117
""" Define a simple format for saving numpy arrays to disk with the full information about them. The ``.npy`` format is the standard binary file format in NumPy for persisting a *single* arbitrary NumPy array on disk. The format stores all of the shape and dtype information necessary to reconstruct the array correctly...
mit
aymeric-spiga/mcd-python
perso/inimeso/inimeso.py
1
1995
#! /usr/bin/env python ### AS 10/05/2012. A python script to prepare initial state for idealized mesoscale runs. ### use : ensure mcd class is working. fill in input_coord. execute inimeso. from string import split ; import numpy as np ; import matplotlib.pyplot as mpl from mcd import mcd ### MCD INST...
gpl-2.0
prefetchnta/questlab
bin/x64bin/python/37/Lib/xml/etree/ElementPath.py
1
10624
# # ElementTree # $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $ # # limited xpath support for element trees # # history: # 2003-05-23 fl created # 2003-05-28 fl added support for // etc # 2003-08-27 fl fixed parsing of periods in element names # 2007-09-10 fl new selection engine # 2007-09-...
lgpl-2.1
ArneBab/pypyjs
website/demo/home/rfk/repos/pypy/lib-python/2.7/test/test_sgmllib.py
139
15728
import pprint import re import unittest from test import test_support sgmllib = test_support.import_module('sgmllib', deprecated=True) class EventCollector(sgmllib.SGMLParser): def __init__(self): self.events = [] self.append = self.events.append sgmllib.SGMLParser.__init__(self) def...
mit
yukoba/sympy
sympy/concrete/expr_with_limits.py
28
15578
from __future__ import print_function, division from sympy.core.add import Add from sympy.core.expr import Expr from sympy.core.mul import Mul from sympy.core.relational import Equality from sympy.sets.sets import Interval from sympy.core.singleton import S from sympy.core.symbol import Symbol from sympy.core.sympify ...
bsd-3-clause
rajsadho/django
django/contrib/sessions/base_session.py
348
1623
""" This module allows importing AbstractBaseSession even when django.contrib.sessions is not in INSTALLED_APPS. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ class BaseSes...
bsd-3-clause
Polarcraft/KbveBot
commands/quote.py
1
5237
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson # # 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 ve...
gpl-2.0
gdanezis/petlib
examples/genzkp.py
1
18303
## An example of how to implement an engine for Zero-Knowledge # Proof of Discrete Log representations using Brands' and # Camenisch's extensions to the basic Schnor proof. # # For details of what is doing on see Chapter 3: # "Rethinking Public Key Infrastructures and Digital Certificates # Building in Privacy" By...
bsd-2-clause
kopf/script.service.restapi
resources/lib/web/wsgiserver/ssl_pyopenssl.py
177
9605
"""A library for integrating pyOpenSSL with CherryPy. The OpenSSL module must be importable for SSL functionality. You can obtain it from http://pyopenssl.sourceforge.net/ To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of SSLAdapter. There are two ways to use SSL: Method One ---------- * ``s...
apache-2.0
resmo/ansible
lib/ansible/modules/database/mysql/mysql_info.py
3
13780
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> # 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 = {...
gpl-3.0
papouso/odoo
addons/website_quote/controllers/main.py
83
8996
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
fegonda/icon_demo
code/model/mlp/logistic_sgd.py
9
16081
""" This tutorial introduces logistic regression using Theano and stochastic gradient descent. Logistic regression is a probabilistic, linear classifier. It is parametrized by a weight matrix :math:`W` and a bias vector :math:`b`. Classification is done by projecting data points onto a set of hyperplanes, the distance...
mit
dannyboi104/SickRage
autoProcessTV/lib/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
gpl-3.0
earshel/PokeyPySnipe
POGOProtos/Enums/IapItemCategory_pb2.py
16
2408
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Enums/IapItemCategory.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.prot...
mit
theolind/pymysensors
mysensors/persistence.py
1
6201
"""Handle persistence.""" import json import logging import os import pickle from .sensor import ChildSensor, Sensor _LOGGER = logging.getLogger(__name__) class Persistence: """Organize persistence file saving and loading.""" def __init__(self, sensors, schedule_factory, persistence_file="mysensors.pickle"...
mit
XeLabs/tokudb
extra/protobuf/protobuf-2.6.1/examples/list_people.py
429
1135
#! /usr/bin/python # See README.txt for information and build instructions. import addressbook_pb2 import sys # Iterates though all people in the AddressBook and prints info about them. def ListPeople(address_book): for person in address_book.person: print "Person ID:", person.id print " Name:", person.na...
gpl-2.0
erjohnso/ansible
lib/ansible/modules/cloud/amazon/aws_ssm_parameter_store.py
20
6080
#!/usr/bin/python # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.1'} DOCUMENTATION = ''' --- modul...
gpl-3.0
glennq/scikit-learn
sklearn/metrics/cluster/tests/test_bicluster.py
394
1770
"""Testing for bicluster metrics module""" import numpy as np from sklearn.utils.testing import assert_equal, assert_almost_equal from sklearn.metrics.cluster.bicluster import _jaccard from sklearn.metrics import consensus_score def test_jaccard(): a1 = np.array([True, True, False, False]) a2 = np.array([T...
bsd-3-clause
developerfm/zulip
zerver/management/commands/enqueue_digest_emails.py
115
4031
from __future__ import absolute_import import datetime import pytz import logging from django.conf import settings from django.core.management.base import BaseCommand from zerver.lib.queue import queue_json_publish from zerver.models import UserActivity, UserProfile, get_realm, Realm ## Logging setup ## log_format ...
apache-2.0
eduNEXT/edunext-platform
pavelib/paver_tests/test_servers.py
3
13016
"""Unit tests for the Paver server tasks.""" import ddt from paver.easy import call_task from ..utils.envs import Env from .utils import PaverTestCase EXPECTED_SASS_COMMAND = ( u"libsass {sass_directory}" ) EXPECTED_COMMON_SASS_DIRECTORIES = [ u"common/static/sass", ] EXPECTED_LMS_SASS_DIRECTORIES = [ u...
agpl-3.0
ben-ng/swift
benchmark/scripts/compare_perf_tests.py
1
13006
#!/usr/bin/python # -*- coding: utf-8 -*- # ===--- compare_perf_tests.py -------------------------------------------===// # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library...
apache-2.0
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/mpl_toolkits/axisartist/axislines.py
7
26173
""" Axislines includes modified implementation of the Axes class. The biggest difference is that the artists responsible to draw axis line, ticks, ticklabel and axis labels are separated out from the mpl's Axis class, which are much more than artists in the original mpl. Originally, this change was motivated to support...
mit
FroeMic/CDTM-Backend-Workshop-WT2016
solutions/server/server-09-connect-database/server/utils.py
1
1157
from flask import abort, jsonify, make_response, request from functools import wraps import re from server import * from server.database import db_list_exists def json_abort(code, text): json = { 'result': False, 'error': { 'status': code, 'text': text } } ...
mit
jcnelson/syndicate
python/syndicate/ag/curation/specfile.py
2
12177
#!/usr/bin/python """ Copyright 2014 The Trustees of Princeton University 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
indictranstech/Das_frappe
frappe/core/page/data_import_tool/exporter.py
32
7287
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json, os from frappe import _ import frappe.permissions import re from frappe.utils.csvutils import UnicodeWriter from frappe.utils import cstr, cint, flt, formatd...
mit
tzoiker/gensim
gensim/topic_coherence/probability_estimation.py
15
4017
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ This module contains functions to perform segmentation on a list of topics. """ import logging import numpy as np from gensim.corp...
lgpl-2.1
tchellomello/home-assistant
tests/components/lovelace/test_dashboard.py
10
19501
"""Test the Lovelace initialization.""" import pytest from homeassistant.components import frontend from homeassistant.components.lovelace import const, dashboard from homeassistant.setup import async_setup_component from tests.async_mock import patch from tests.common import ( assert_setup_component, async_c...
apache-2.0
zzicewind/linux
tools/perf/scripts/python/sctop.py
1996
2102
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
dato-code/SFrame
oss_src/unity/python/sframe/meta/decompiler/simple_instructions.py
16
29445
''' Created on Jul 14, 2011 @author: sean ''' from __future__ import print_function from opcode import * import _ast import sys from ..utils import py3, py3op, py2op from ..asttools.visitors.print_visitor import print_ast, dump_ast from ..asttools import cmp_ast if py3: class _ast_Print: pass else: _ast_Pri...
bsd-3-clause
AltSchool/django
tests/update_only_fields/tests.py
41
9781
from __future__ import unicode_literals from django.db.models.signals import post_save, pre_save from django.test import TestCase from .models import Account, Employee, Person, Profile, ProxyEmployee class UpdateOnlyFieldsTests(TestCase): def test_update_fields_basic(self): s = Person.objects.create(nam...
bsd-3-clause
dapeng0802/djangocms-blog
djangocms_blog/migrations/0007_auto_20150719_0933.py
12
7095
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import filer.fields.image import django.utils.timezone from django.conf import settings import djangocms_text_ckeditor.fields import django.db.models.deletion class Migration(migrations.Migration): dependenc...
bsd-3-clause
jlombacher/pyqtgraph
examples/crosshair.py
24
2649
""" Demonstrates some customized mouse interaction by drawing a crosshair that follows the mouse. """ import initExample ## Add path to library (just for examples; you do not need this) import numpy as np import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore from pyqtgraph.Point import Point #generate layo...
mit
mgax/MagicFolder
magicfolder/checksum.py
1
3959
import os from os import path from collections import namedtuple from hashlib import sha1 import cPickle as pickle from itertools import imap, ifilterfalse from contextlib import contextmanager import re import json FileItem = namedtuple('FileItem', 'path checksum size time') CHUNK_SIZE = 64 * 1024 # 64 KB def repo_...
mit
LIS/lis-tempest
tempest/services/identity/v2/json/endpoints_client.py
6
1870
# Copyright 2016 Red Hat, 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
stianrh/askbot-nordic
askbot/deps/django_authopenid/migrations/0005_auto__del_externallogindata.py
20
8367
# encoding: 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): # Deleting model 'ExternalLoginData' db.delete_table('django_authopenid_externallogindata') ...
gpl-3.0
ldoktor/virt-test
kvm/tests/perf_kvm.py
6
1472
from autotest.client import utils def run_perf_kvm(test, params, env): """ run perf tool to get kvm events info @param test: kvm test object @param params: Dictionary with the test parameters @param env: Dictionary with test environment. """ vm = env.get_vm(params["main_vm"]) vm.verif...
gpl-2.0
pyshcoder/namebench
nb_third_party/dns/rdataclass.py
248
3303
# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
liuzheng712/Misago
misago/threads/tests/test_counters.py
8
5698
from datetime import timedelta from time import time from django.core.urlresolvers import reverse from django.utils import timezone from django.utils.translation import ugettext as _ from misago.forums.models import Forum from misago.readtracker.models import ThreadRead from misago.users.testutils import Authenticate...
gpl-2.0
vguerci/Deluge.app
deluge/ui/gtkui/peers_tab.py
2
16120
# # peers_tab.py # # Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com> # # Deluge is free software. # # You may 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
swappsco/django-wordpress-api
setup.py
1
2074
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup version = '0.2.0' if sys.argv[-1] == 'publish': try: import wheel print("Wheel version: ", wheel.__version__) except ImportError: ...
mit
Rhombik/rhombik-object-repository
project/models.py
1
4971
from django.db import models from django.contrib.auth.models import User, Group from datetime import datetime import thumbnailer.shadowbox from django.conf import settings from taggit.managers import TaggableManager from filemanager.models import fileobject, fileuploadpath from djangoratings.fields import RatingField f...
agpl-3.0