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 |
|---|---|---|---|---|---|
loli/medpy | bin/medpy_diff.py | 1 | 3675 | #!/usr/bin/env python
"""
Compares the pixel values of two images and gives a measure of the difference.
Copyright (C) 2013 Oskar Maier
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 versio... | gpl-3.0 |
amrdraz/kodr | app/brython/www/src/Lib/test/test_ossaudiodev.py | 32 | 7216 | from test import support
support.requires('audio')
from test.support import findfile
ossaudiodev = support.import_module('ossaudiodev')
import errno
import sys
import sunau
import time
import audioop
import unittest
# Arggh, AFMT_S16_NE not defined on all platforms -- seems to be a
# fairly recent addition to OSS.
... | mit |
StrellaGroup/erpnext | erpnext/hr/doctype/upload_attendance/test_upload_attendance.py | 13 | 1103 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import getdate
from erpnext.hr.doctype.upload_attendance.upload_attendance import get_data
from erpnext.hr.doctype.emplo... | gpl-3.0 |
alon/polinax | libs/external_libs/docutils-0.4/docutils/statemachine.py | 6 | 55377 | # Author: David Goodger
# Contact: goodger@users.sourceforge.net
# Revision: $Revision: 4152 $
# Date: $Date: 2005-12-08 00:46:30 +0100 (Thu, 08 Dec 2005) $
# Copyright: This module has been placed in the public domain.
"""
A finite state machine specialized for regular-expression-based text filters,
this module defin... | gpl-2.0 |
disruptek/boto | boto/ecs/__init__.py | 153 | 4177 | # Copyright (c) 2010 Chris Moyer http://coredumped.org/
#
# 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, ... | mit |
reiaaoyama/contrail-controller | src/config/common/importutils.py | 18 | 2171 | # Copyright 2011 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.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
ehsanirani/slides_postdoc_interview | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py | 1824 | 3474 | # 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.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp files that they are ... | mit |
alphagov/stagecraft | stagecraft/apps/dashboards/models/dashboard.py | 1 | 14599 | from __future__ import unicode_literals
import uuid
from django.core.validators import RegexValidator
from django.db import models
from stagecraft.apps.organisation.models import Node
from stagecraft.apps.users.models import User
from django.db.models.query import QuerySet
def list_to_tuple_pairs(elements):
retu... | mit |
thispc/download-manager | module/lib/jinja2/ext.py | 64 | 23899 | # -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from collections impor... | gpl-3.0 |
zackmdavis/swift | swift/account/reaper.py | 2 | 22611 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | apache-2.0 |
abridgett/ansible | lib/ansible/runner/action_plugins/set_fact.py | 28 | 1288 | # Copyright 2013 Dag Wieers <dag@wieers.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 versio... | gpl-3.0 |
seemoo-lab/nexmon | utilities/wireshark/tools/dftestlib/time_relative.py | 40 | 1244 | # Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# Th... | gpl-3.0 |
ptchankue/youtube-dl | youtube_dl/extractor/playvid.py | 115 | 2864 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
)
from ..utils import (
clean_html,
ExtractorError,
)
class PlayvidIE(InfoExtractor):
_VALID_URL = r'https?://www\.playvid\.co... | unlicense |
spezi77/android_external_skia | platform_tools/android/bin/adb_list_devices.py | 153 | 5077 | #!/usr/bin/python
#
# Copyright (c) 2012 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.
""" adb_list_devices: list information about attached Android devices. """
import os
import re
import shlex
import subprocess
impor... | bsd-3-clause |
greggian/TapdIn | django/contrib/sessions/backends/cache.py | 13 | 1937 | from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.cache import cache
class SessionStore(SessionBase):
"""
A cache-based session store.
"""
def __init__(self, session_key=None):
self._cache = cache
super(SessionStore, self).__init__(sess... | apache-2.0 |
ottermegazord/ottermegazord.github.io | onexi/data_processing/s05_genPlots.py | 1 | 1460 | import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
import pdb
import sys
plt.style.use("ggplot")
os.chdir("..")
ipath = "./Data/Final_Data/"
ifile = "Final_Data"
opath = "./Data/Final_Data/Neighborhoods/"
imgpath = "./Plots/Neighborhood_TS/"
ext = ".csv"
input_var =... | mit |
sean93park/mozjs24 | js/src/python/mozbuild/mozbuild/frontend/sandbox.py | 3 | 13484 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
r"""Python sandbox implementation for build files.
This module contains classes for Python sandboxes that execute in a
... | mpl-2.0 |
chen0031/nupic | tests/swarming/nupic/swarming/experiments/legacy_cla_multistep/permutations.py | 38 | 4800 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
manahl/pytest-plugins | pytest-shutil/pytest_shutil/run.py | 1 | 8562 | """
Testing tools for running cmdline methods
"""
import sys
import os
import imp
import logging
from functools import update_wrapper
import inspect
import textwrap
from contextlib import closing
import subprocess
from mock import patch
import execnet
from six.moves import cPickle # @UnresolvedImport
from . impo... | mit |
joliveros/bitmex-websocket | tests/test_instrument.py | 1 | 2865 | import alog
import pytest
from mock import PropertyMock, MagicMock, mock
from bitmex_websocket import Instrument
from bitmex_websocket._instrument import SubscribeToAtLeastOneChannelException, \
SubscribeToSecureChannelException
from bitmex_websocket.constants import Channels, SecureChannels, \
SecureInstrumen... | mit |
pizzathief/scipy | scipy/misc/doccer.py | 21 | 1732 | ''' Utilities to allow inserting docstring fragments for common
parameters into function and method docstrings'''
import numpy as np
from .._lib import doccer as _ld
__all__ = ['docformat', 'inherit_docstring_from', 'indentcount_lines',
'filldoc', 'unindent_dict', 'unindent_string']
@np.deprecate(message=... | bsd-3-clause |
andris210296/andris-projeto | backend/build_scripts/babel/i18n_extractor.py | 35 | 2400 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
import shutil
import sys
import os
def patch(system):
def sys(cmd):
print cmd
return system(cmd)
return sys
os.system = patch(os.system)
# workaround to add src to path
babel_dir = os.path.dirna... | mit |
apollo13/ansible | test/lib/ansible_test/_internal/powershell_import_analysis.py | 31 | 3190 | """Analyze powershell import statements."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import re
from .io import (
read_text_file,
)
from .util import (
display,
)
from .util_common import (
resolve_csharp_ps_util,
)
from .data import (
data_co... | gpl-3.0 |
stevekuznetsov/ansible | test/units/plugins/connection/test_network_cli.py | 48 | 5631 | #
# (c) 2016 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 d... | gpl-3.0 |
hanw/p4c-fpga | ext/src/gtest/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/usr/bin/env python
#
# Copyright 2008, 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... | apache-2.0 |
fennekki/unikko | unikko/output/html.py | 1 | 3802 | from yattag import Doc, indent
from sys import stderr
def _inner_recurse_tags(obj, tree, doc, tag, text):
"""Execute inner loop structure of HTML generation.
Params:
obj (Object): The object currently being looped over
tree (Object): A VOTL Object containing the subtree-to-be
... | bsd-2-clause |
HonzaKral/django | tests/template_tests/filter_tests/test_addslashes.py | 473 | 1202 | from django.template.defaultfilters import addslashes
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class AddslashesTests(SimpleTestCase):
@setup({'addslashes01': '{% autoescape off %}{{ a|addslashes }} {{ b|addslashes }}{% endautoescape %}'})
... | bsd-3-clause |
wenyu1001/scrapy | scrapy/spiders/sitemap.py | 11 | 2736 | import re
import logging
import six
from scrapy.spiders import Spider
from scrapy.http import Request, XmlResponse
from scrapy.utils.sitemap import Sitemap, sitemap_urls_from_robots
from scrapy.utils.gz import gunzip, is_gzipped
logger = logging.getLogger(__name__)
class SitemapSpider(Spider):
sitemap_urls = (... | bsd-3-clause |
sriprasanna/django-1.3.1 | django/contrib/gis/geos/linestring.py | 411 | 5568 | from django.contrib.gis.geos.base import numpy
from django.contrib.gis.geos.coordseq import GEOSCoordSeq
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.point import Point
from django.contrib.gis.geos import prototypes as cap... | bsd-3-clause |
agry/NGECore2 | scripts/mobiles/endor/shimmering_lantern_bird.py | 2 | 1625 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 |
jrabbit/ubotu-fr | plugins/Owner/plugin.py | 6 | 25949 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2008, James Vega
# 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 copyri... | bsd-3-clause |
sdg32/flask-celery3-boilerplate | migrations/env.py | 557 | 2883 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config ... | mit |
buguelos/odoo | addons/product/pricelist.py | 7 | 26429 | # -*- 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 |
trudikampfschaf/flask-microblog | flask/lib/python2.7/site-packages/sqlalchemy/util/deprecations.py | 34 | 3906 | # util/deprecations.py
# Copyright (C) 2005-2012 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
"""Helpers related to deprecation of functions, methods, classes, other
functiona... | bsd-3-clause |
ricardog/raster-project | projections/r2py/rparser.py | 1 | 5180 | from pyparsing import *
import re
ParserElement.enablePackrat()
from .tree import Node, Operator
import pdb
def rparser():
expr = Forward()
lparen = Literal("(").suppress()
rparen = Literal(")").suppress()
double = Word(nums + ".").setParseAction(lambda t:float(t[0]))
integer = pyparsing_common.signed_int... | apache-2.0 |
doduytrung/odoo-8.0 | addons/website/tests/test_views.py | 221 | 8517 | # -*- coding: utf-8 -*-
import itertools
import unittest2
from lxml import etree as ET, html
from lxml.html import builder as h
from openerp.tests import common
def attrs(**kwargs):
return dict(('data-oe-%s' % key, str(value)) for key, value in kwargs.iteritems())
class TestViewSaving(common.TransactionCase):
... | agpl-3.0 |
shepdelacreme/ansible | lib/ansible/modules/cloud/amazon/aws_sgw_facts.py | 21 | 11555 | #!/usr/bin/python
# Copyright: (c) 2018, Loic BLOT (@nerzhul) <loic.blot@unix-experience.fr>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This module is sponsored by E.T.A.I. (www.etai.fr)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': [... | gpl-3.0 |
rajrakeshdr/pychess | lib/pychess/Utils/lutils/egtb_gaviota.py | 22 | 9260 | from __future__ import absolute_import
import os
import re
import sys
import platform
from ctypes import *
from .bitboard import firstBit, clearBit
from .lmovegen import genAllMoves, genCheckEvasions
from pychess.Utils.const import *
from pychess.System import conf
from pychess.System.prefix import addDataPrefix, getD... | gpl-3.0 |
scdoshi/djutils | djutils/gis.py | 1 | 2346 | """
GIS: GIS related utilities.
"""
###############################################################################
## Imports
###############################################################################
import math
###############################################################################
## GIS Format Con... | bsd-3-clause |
Z2PackDev/TBmodels | tests/test_hdf5.py | 1 | 3921 | #!/usr/bin/env python
# (c) 2015-2018, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <greschd@gmx.ch>
"""Tests saving and loading to HDF5 format."""
import tempfile
import pytest
import numpy as np
import tbmodels
KWARGS = [
dict(),
dict(pos=None, dim=3),
dict(uc=3 * np.eye(3))... | apache-2.0 |
manderson23/NewsBlur | apps/reader/migrations/0001_initial.py | 18 | 12215 |
from south.db import db
from django.db import models
from apps.reader.models import *
class Migration:
def forwards(self, orm):
# Adding model 'UserSubscription'
db.create_table('reader_usersubscription', (
('id', orm['reader.UserSubscription:id']),
('user', o... | mit |
ArcherSys/ArcherSys | Scripts/pildriver.py | 1 | 15521 | #!c:\xampp\htdocs\scripts\python.exe
"""PILdriver, an image-processing calculator using PIL.
An instance of class PILDriver is essentially a software stack machine
(Polish-notation interpreter) for sequencing PIL image
transformations. The state of the instance is the interpreter stack.
The only method one will norm... | mit |
peiyuwang/pants | src/python/pants/backend/docgen/tasks/generate_pants_reference.py | 16 | 4195 | # coding=utf-8
# Copyright 2016 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)
import os
from pant... | apache-2.0 |
botswana-harvard/bais-subject | bais_subject/models/attitudes_towards_people.py | 1 | 6192 | from django.db import models
from edc_base.model_fields import OtherCharField
from edc_base.model_mixins import BaseUuidModel
from ..choices import (YES_NO, TESTING_REASONS, TB_NONDISCLOSURE,
HIV_TEST_RESULT, ARV_USAGE, ARV_TREATMENT_SOURCE,
REASONS_ARV_NOT_TAKEN, TB_REAC... | gpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/distutils/command/build_py.py | 74 | 16338 | """distutils.command.build_py
Implements the Distutils 'build_py' command."""
__revision__ = "$Id$"
import os
import sys
from glob import glob
from distutils.core import Command
from distutils.errors import DistutilsOptionError, DistutilsFileError
from distutils.util import convert_path
from distutils import log
c... | mit |
smnitro555/ESWegarden | raspibot/lib/python2.7/site-packages/setuptools/monkey.py | 80 | 5255 | """
Monkey patching of distutils.
"""
import sys
import distutils.filelist
import platform
import types
import functools
import inspect
from .py26compat import import_module
import six
import setuptools
__all__ = []
"""
Everything is private. Contact the project team
if you think you need this functionality.
"""
... | gpl-3.0 |
Zlash65/erpnext | erpnext/patches/v10_0/repost_gle_for_purchase_receipts_with_rejected_items.py | 11 | 1024 | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, erpnext
def execute():
for company in frappe.get_all("Company"):
if not erpnext.is_perpetual_inventory_enabled(company.name):
continue
acc_frozen_upto... | gpl-3.0 |
somcom3x/tw_herc_kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
msrb/freeipa | ipatests/test_xmlrpc/test_permission_plugin.py | 2 | 152297 | # Authors:
# Rob Crittenden <rcritten@redhat.com>
# Pavel Zuna <pzuna@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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
# th... | gpl-3.0 |
XiaodunServerGroup/medicalmooc | common/djangoapps/xmodule_modifiers.py | 6 | 9936 | """
Functions that can are used to modify XBlock fragments for use in the LMS and Studio
"""
import datetime
import json
import logging
import static_replace
from django.conf import settings
from django.utils.timezone import UTC
from edxmako.shortcuts import render_to_string
from xblock.exceptions import InvalidScope... | agpl-3.0 |
hynnet/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/distutils/command/bdist_dumb.py | 151 | 5195 | """distutils.command.bdist_dumb
Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix)."""
__revision__ = "$Id$"
import os
from sysconfig import get_python_version
from distutils.util import get_platform
from distutil... | gpl-2.0 |
openEduConnect/eduextractor | docs/conf.py | 1 | 9538 | # -*- coding: utf-8 -*-
#
# eduextractor documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 10 17:16:14 2015.
#
# 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.
... | mit |
linebp/pandas | pandas/io/packers.py | 4 | 27509 | """
Msgpack serializer support for reading and writing pandas data structures
to disk
portions of msgpack_numpy package, by Lev Givon were incorporated
into this module (and tests_packers.py)
License
=======
Copyright (c) 2013, Lev Givon.
All rights reserved.
Redistribution and use in source and binary forms, with ... | bsd-3-clause |
grave-w-grave/zulip | analytics/management/commands/update_analytics_counts.py | 18 | 1988 | from __future__ import absolute_import
from __future__ import print_function
from argparse import ArgumentParser
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from django.utils.dateparse import parse_datetime
from analytics.models import RealmCou... | apache-2.0 |
SVoxel/R7800 | git_home/samba.git/third_party/waf/wafadmin/Constants.py | 32 | 1307 | #!/usr/bin/env python
# encoding: utf-8
# Yinon dot me gmail 2008
"""
these constants are somewhat public, try not to mess them
maintainer: the version number is updated from the top-level wscript file
"""
# do not touch these three lines, they are updated automatically
HEXVERSION=0x105019
WAFVERSION="1.5.19"
WAFREV... | gpl-2.0 |
woodrow-shen/ycmd | ycmd/completers/go/gocode_completer.py | 14 | 6808 | #!/usr/bin/env python
#
# Copyright (C) 2015 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | gpl-3.0 |
masmullin2000/kernel_tp_ts_bkl | tools/perf/scripts/python/check-perf-trace.py | 1997 | 2539 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
atruberg/django-custom | django/contrib/gis/geos/point.py | 224 | 4351 | from ctypes import c_uint
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos import prototypes as capi
from django.utils import six
from django.utils.six.moves import xrange
class Point(GEOSGeometry):
_minlength = 2
_ma... | bsd-3-clause |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/dask/array/tests/test_percentiles.py | 4 | 2323 | import pytest
pytest.importorskip('numpy')
import numpy as np
import dask.array as da
from dask.array.utils import assert_eq, same_keys
def test_percentile():
d = da.ones((16,), chunks=(4,))
assert_eq(da.percentile(d, [0, 50, 100]),
np.array([1, 1, 1], dtype=d.dtype))
x = np.array([0, 0, ... | gpl-3.0 |
fako/datascope | src/sources/models/google/text.py | 1 | 2087 | from datagrowth.exceptions import DGInvalidResource
from sources.models.google.query import GoogleQuery
class GoogleText(GoogleQuery):
URI_TEMPLATE = 'https://www.googleapis.com/customsearch/v1?q={}'
GET_SCHEMA = {
"args": {
"type": "array",
"items": [
{
... | gpl-3.0 |
SymbiFlow/prjxray | fuzzers/005-tilegrid/pcie/top.py | 1 | 1574 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import os
import random
random.seed(i... | isc |
prescottprue/PiOpenLighting | python/ola/OlaClient.py | 3 | 35025 | # This program is free software; you can redistribute it and/or modify
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ... | lgpl-2.1 |
tachang/uwsgi | tests/websockets_chat.py | 6 | 2621 | #!./uwsgi --http-socket :9090 --gevent 100 --module tests.websocket_chat --gevent-monkey-patch
import uwsgi
import time
import gevent.select
import redis
def application(env, sr):
ws_scheme = 'ws'
if 'HTTPS' in env or env['wsgi.url_scheme'] == 'https':
ws_scheme = 'wss'
if env['PATH_INFO'] == '/'... | gpl-2.0 |
pjg101/SickRage | lib/sqlalchemy/dialects/firebird/fdb.py | 79 | 4365 | # firebird/fdb.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:: firebird+fdb
:name: fdb
:dbapi: pyodbc
:connectstring: fi... | gpl-3.0 |
perkinslr/pypyjs | addedLibraries/nevow/wsgi.py | 2 | 21703 | # TODO:
# 1. make exception renderer work (currently the code is in appserver.py)
# - srid
import warnings
warnings.warn("nevow.wsgi is deprecated.", category=DeprecationWarning)
import sys, socket, math, time
import cgi # for FieldStorage
import types
from urllib import unquote, quote
from zope.interface import im... | mit |
js0701/chromium-crosswalk | tools/perf/benchmarks/blink_style.py | 17 | 1383 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from core import perf_benchmark
from measurements import blink_style
import page_sets
from telemetry import benchmark
@benchmark.Disabled('reference', 'wi... | bsd-3-clause |
nvoron23/statsmodels | statsmodels/sandbox/examples/example_maxent.py | 33 | 1286 | """
This is an example of using scipy.maxentropy to solve Jaynes' dice problem
See Golan, Judge, and Miller Section 2.3
"""
from scipy import maxentropy
import numpy as np
samplespace = [1., 2., 3., 4., 5., 6.]
def sump(x):
return x in samplespace
def meanp(x):
return np.mean(x)
# Set the constraints
# 1) W... | bsd-3-clause |
itsnotmyfault1/kimcopter2 | crazyflie-pc-client/lib/cflib/crazyflie/__init__.py | 1 | 13576 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
XiaodunServerGroup/ddyedx | common/lib/xmodule/xmodule/tests/test_combined_open_ended.py | 7 | 62964 | """
Tests for the various pieces of the CombinedOpenEndedGrading system
OpenEndedChild
OpenEndedModule
"""
import json
import logging
import unittest
from datetime import datetime
from lxml import etree
from mock import Mock, MagicMock, ANY, patch
from pytz import UTC
from webob.multidict import MultiDict
from xmo... | agpl-3.0 |
dkalashnik/tempest | tempest/tests/services/compute/test_tenant_networks_client.py | 2 | 2912 | # Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
janlindstrom/percona-xtrabackup | storage/innobase/xtrabackup/test/python/subunit/chunked.py | 64 | 7181 | #
# subunit: extensions to python unittest to get test results from subprocesses.
# Copyright (C) 2005 Robert Collins <robertc@robertcollins.net>
# Copyright (C) 2011 Martin Pool <mbp@sourcefrog.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A co... | gpl-2.0 |
sillydan1/WhatEverEngine | openglcsharp/Lib/encodings/koi8_u.py | 593 | 14018 | """ Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.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='stri... | apache-2.0 |
kleientertainment/ds_mod_tools | pkg/win32/Python27/Lib/codecs.py | 84 | 36364 | """ codecs -- Python Codec Registry, API and helpers.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import __builtin__, sys
### Registry and builtin stateless codec functions
try:
from _codecs import *
except ImportError, why:
... | mit |
eamuntz/Django-Tut | env/lib/python2.7/site-packages/django/core/management/commands/dbshell.py | 329 | 1243 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
class Command(BaseCommand):
help = ("Runs the command-line client for specified database, or the "
"default database if none is provided.")
option_lis... | mit |
Jackysonglanlan/devops | IDEs/sublime/shared-pkgs/Packages/pygments/all/pygments/lexers/nimrod.py | 45 | 5105 | # -*- coding: utf-8 -*-
"""
pygments.lexers.nimrod
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the Nimrod language.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, default
from pygments.... | mit |
Flow8/angular-phonecat | node_modules/protractor/node_modules/accessibility-developer-tools/scripts/parse_aria_schemas.py | 381 | 3069 | import json
import re
import urllib
import xml.etree.ElementTree as ET
def parse_attributes():
schema = urllib.urlopen('http://www.w3.org/MarkUp/SCHEMA/aria-attributes-1.xsd')
tree = ET.parse(schema)
for node in tree.iter():
node.tag = re.sub(r'{.*}', r'', node.tag)
type_map = {
'stat... | mit |
vitmod/dvbapp | po/xml2po.py | 40 | 1590 | #!/usr/bin/python
import sys
import os
import string
import re
from xml.sax import make_parser
from xml.sax.handler import ContentHandler, property_lexical_handler
try:
from _xmlplus.sax.saxlib import LexicalHandler
no_comments = False
except ImportError:
class LexicalHandler:
pass
no_comments = True
class parse... | gpl-2.0 |
ppwwyyxx/tensorflow | tensorflow/python/keras/optimizer_v2/adamax_test.py | 6 | 16435 | # 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 |
ruuk/script.bluray.com | lib/html5lib/ihatexml.py | 129 | 15309 | import re
baseChar = """[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5] | [#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] | #x0386 | [#x0388-#x038A] ... | gpl-2.0 |
twisted/mantissa | xmantissa/test/historic/test_privateApplication3to4.py | 1 | 3405 |
"""
Tests for the upgrade of L{PrivateApplication} schema from 3 to 4.
"""
from axiom.userbase import LoginSystem
from axiom.test.historic.stubloader import StubbedTest
from xmantissa.ixmantissa import ITemplateNameResolver, IWebViewer
from xmantissa.website import WebSite
from xmantissa.webapp import PrivateApplica... | mit |
Lemueler/Petro-UI | utils.py | 1 | 10256 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Deepin, Inc.
# 2012 Kaisheng Ye
#
# Author: Kaisheng Ye <kaisheng.ye@gmail.com>
# Maintainer: Kaisheng Ye <kaisheng.ye@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | lgpl-3.0 |
wangscript/libjingle-1 | trunk/testing/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... | bsd-3-clause |
MiyamotoAkira/kivy | doc/sources/conf.py | 35 | 7092 | # -*- coding: utf-8 -*-
#
# Kivy documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 21 22:37:12 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable... | mit |
krsjoseph/youtube-dl | youtube_dl/cache.py | 179 | 2980 | from __future__ import unicode_literals
import errno
import io
import json
import os
import re
import shutil
import traceback
from .compat import compat_expanduser, compat_getenv
from .utils import write_json_file
class Cache(object):
def __init__(self, ydl):
self._ydl = ydl
def _get_root_dir(self)... | unlicense |
40223145c2g18/c2g18 | exts/w2/static/Brython2.0.0-20140209-164925/Lib/test/support.py | 111 | 67787 | """Supporting definitions for the Python regression tests."""
if __name__ != 'test.support':
raise ImportError('support must be imported from the test package')
import contextlib
import errno
import functools
import gc
import socket
import sys
import os
import platform
import shutil
import warnings
import unittes... | gpl-2.0 |
drpaneas/linuxed.gr | lib/python2.7/site-packages/unidecode/x074.py | 252 | 4696 | data = (
'Han ', # 0x00
'Xuan ', # 0x01
'Yan ', # 0x02
'Qiu ', # 0x03
'Quan ', # 0x04
'Lang ', # 0x05
'Li ', # 0x06
'Xiu ', # 0x07
'Fu ', # 0x08
'Liu ', # 0x09
'Ye ', # 0x0a
'Xi ', # 0x0b
'Ling ', # 0x0c
'Li ', # 0x0d
'Jin ', # 0x0e
'Lian ', # 0x0f
'Suo ', # 0x10
'Chii... | mit |
mancoast/CPythonPyc_test | cpython/253_test_hotshot.py | 29 | 4199 | import hotshot
import hotshot.log
import os
import pprint
import unittest
from test import test_support
from hotshot.log import ENTER, EXIT, LINE
def shortfilename(fn):
# We use a really shortened filename since an exact match is made,
# and the source may be either a Python source file or a
# pre-compi... | gpl-3.0 |
tmenjo/cinder-2015.1.1 | cinder/tests/test_rbd.py | 1 | 50268 |
# Copyright 2012 Josh Durgin
# Copyright 2013 Canonical Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | apache-2.0 |
axbaretto/beam | build/fbcode_builder/utils.py | 17 | 2883 | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
'Miscellaneous utility functions.'
import itertools
import logging
import os
import shutil
import... | apache-2.0 |
appliedx/edx-platform | common/djangoapps/student/migrations/0006_expand_meta_field.py | 188 | 9246 | # 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):
# Changing field 'UserProfile.meta'
db.alter_column('auth_userprofile', 'meta', self.gf('django.db.models.fields.... | agpl-3.0 |
Root-Box/kernel_samsung_smdk4412 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
google/material-design-icons | update/venv/lib/python3.9/site-packages/pip/_vendor/urllib3/util/url.py | 7 | 13981 | from __future__ import absolute_import
import re
from collections import namedtuple
from ..exceptions import LocationParseError
from ..packages import six
url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]
# We only want to normalize urls with an HTTP(S) scheme.
# urllib3 infers URLs withou... | apache-2.0 |
andMYhacks/infosec_mentors_project | app/config.py | 1 | 1971 | # project/config.py
import os
# from dotenv import load_dotenv, find_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
# load_dotenv(find_dotenv())
class BaseConfig:
# Base configuration
SECRET_KEY = os.environ.get('APP_SECRET_KEY')
PASSWORD_SALT = os.environ.get('APP_PASSWORD_SALT')
DEBU... | gpl-3.0 |
gangadharkadam/vlinkfrappe | frappe/model/base_document.py | 1 | 17661 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, sys
from frappe import _
from frappe.utils import cint, flt, now, cstr, strip_html, getdate, get_datetime, to_timedelta
from frappe.model import default_fields
from... | mit |
aferrugento/SemLDA | wsd.py | 1 | 15115 | from pywsd.lesk import adapted_lesk
from nltk.corpus import wordnet as wn
import pickle
import time
import sys
def main(file_name):
start = time.time()
#string = '/home/adriana/Dropbox/mine/Tese/preprocessing/data_output/'
#string = '/home/aferrugento/Desktop/'
string = ''
h = open(string + file_name + '_proc.txt... | lgpl-2.1 |
feoff3/compute-image-packages | google-daemon/usr/share/google/google_daemon/utils.py | 3 | 6189 | #!/usr/bin/python
# Copyright 2013 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 appli... | apache-2.0 |
akirk/youtube-dl | youtube_dl/extractor/dreisat.py | 1 | 3607 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate,
determine_ext,
)
class DreiSatIE(InfoExtractor):
IE_NAME = '3sat'
_VALID_URL = r'(?:http://)?(?:www\.)?3sat\.de/mediathek/(?:index\.php|mediathek\.php)?\?(?:... | unlicense |
phani00/tovp | tovp/promotions/migrations/0003_guruparamparabrick.py | 2 | 1850 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import model_utils.fields
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('contributions', '0008_auto_20150219_1555'),
('promotions', '0002_auto_20150207... | mit |
svr93/node-gyp | gyp/pylib/gyp/easy_xml.py | 1 | 4891 | # 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.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... | mit |
zuotingbing/spark | examples/src/main/python/ml/multilayer_perceptron_classification.py | 123 | 2172 | #
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.