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 |
|---|---|---|---|---|---|
jonzobrist/Percona-Server-5.1 | kewpie/drizzle_tests/randgen_slavePlugin/multiThread3_test.py | 1 | 2002 | #! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# 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 Softwar... | bsd-3-clause |
firerszd/kbengine | kbe/res/scripts/common/Lib/test/test_lzma.py | 72 | 72645 | from io import BytesIO, UnsupportedOperation
import os
import pickle
import random
import unittest
from test.support import (
_4G, TESTFN, import_module, bigmemtest, run_unittest, unlink
)
lzma = import_module("lzma")
from lzma import LZMACompressor, LZMADecompressor, LZMAError, LZMAFile
class CompressorDecompr... | lgpl-3.0 |
ChronoMonochrome/android_external_chromium_org | components/test/data/autofill/merge/tools/flatten.py | 162 | 2132 | #!/usr/bin/env python
# Copyright 2013 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 sys
def main():
"""Converts a vertical serialization into a compact, horizontal serialization.
"""
COLUMNS = ['First nam... | bsd-3-clause |
savoirfairelinux/django | tests/utils_tests/test_tree.py | 33 | 2488 | import copy
import unittest
from django.utils.tree import Node
class NodeTests(unittest.TestCase):
def setUp(self):
self.node1_children = [('a', 1), ('b', 2)]
self.node1 = Node(self.node1_children)
self.node2 = Node()
def test_str(self):
self.assertEqual(str(self.node1), "(DE... | bsd-3-clause |
amuehlem/misp-modules | misp_modules/modules/export_mod/cef_export.py | 2 | 2495 | import json
import base64
import datetime
misperrors = {'error': 'Error'}
# possible module-types: 'expansion', 'hover' or both
moduleinfo = {'version': '1', 'author': 'Hannah Ward',
'description': 'Export a module in CEF format',
'module-type': ['export']}
# config fields that your code ... | agpl-3.0 |
sdague/home-assistant | homeassistant/components/lannouncer/notify.py | 21 | 2445 | """Lannouncer platform for notify component."""
import logging
import socket
from urllib.parse import urlencode
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
PLATFORM_SCHEMA,
BaseNotificationService,
)
from homeassistant.const import CONF_HOST, CONF_PORT
import homeassi... | apache-2.0 |
sdlBasic/sdlbrt | win32/mingw/opt/lib/python2.7/encodings/quopri_codec.py | 419 | 2147 | """Codec for quoted-printable encoding.
Like base64 and rot13, this returns Python strings, not Unicode.
"""
import codecs, quopri
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
def quopri_encode(input, errors='strict'):
"""Encode the input, returning a tuple (outpu... | lgpl-2.1 |
vjmac15/Lyilis | lib/youtube_dl/extractor/googledrive (VJ Washington's conflicted copy 2017-08-29).py | 2 | 7901 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
lowercase_escape,
update_url_query,
)
class GoogleDriveIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:docs|drive)\.google\.com/(?:uc\?.*?id=|file/d/)|video\.go... | gpl-3.0 |
wangyikai/grpc | src/python/grpcio_test/grpc_test/_adapter/_c_test.py | 17 | 2073 | # Copyright 2015, 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 |
fpeyre/shinken | shinken/misc/sorter.py | 19 | 3125 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redis... | agpl-3.0 |
nthiep/global-ssh-server | lib/python2.7/site-packages/django/contrib/formtools/tests/wizard/wizardtests/tests.py | 93 | 16277 | from __future__ import unicode_literals
import os
from django import forms
from django.test import TestCase
from django.test.client import RequestFactory
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.formto... | agpl-3.0 |
fast90/youtube-dl | youtube_dl/extractor/regiotv.py | 99 | 2261 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
sanitized_Request,
xpath_text,
xpath_with_ns,
)
class RegioTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?regio-tv\.de/video/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'http://... | unlicense |
randerzander/wellbook | etl/lib/las.py | 2 | 2577 | import recordhelper as helper
#filters blank lines, and lines starting with characters in filter_chars
def filter_lines(text, filter_chars):
return filter(
lambda x: len(x.strip()) > 1 and x.strip()[0] not in filter_chars,\
text.split('\n')\
)
def parse_metadata(lines):
comment_blocks = ['O']
metad... | apache-2.0 |
avsej/googletest | test/gtest_env_var_test.py | 184 | 3546 | #!/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... | bsd-3-clause |
sampsyo/beets | beets/util/pipeline.py | 7 | 16616 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, 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 t... | mit |
mzdaniel/oh-mainline | vendor/packages/gdata/samples/apps/adminsettings_example.py | 41 | 5677 | #!/usr/bin/python
#
# Copyright 2009 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 b... | agpl-3.0 |
nathansamson/Telepathy-Butterfly | butterfly/channel/file_transfer.py | 3 | 12492 | # telepathy-butterfly - an MSN connection manager for Telepathy
#
# Copyright (C) 2010 Collabora Ltd.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at ... | gpl-2.0 |
mattilyra/scikit-learn | sklearn/__init__.py | 27 | 3086 | """
Machine learning module for Python
==================================
sklearn is a Python module integrating classical machine
learning algorithms in the tightly-knit world of scientific Python
packages (numpy, scipy, matplotlib).
It aims to provide simple and efficient solutions to learning problems
that are acc... | bsd-3-clause |
jamescr/LibreScan | src/utils/output/outputPreparer.py | 2 | 1419 | import os
class OutputPreparer:
def __init__(self, p_path):
self.working_dir = p_path
def _delete_pics(self):
delete_pics_file = self.working_dir + "/.toDelete.ls"
with open(delete_pics_file) as f:
for filename in f:
filename = filename[:-1]
... | gpl-3.0 |
aerospike/aerospike-client-python | test/new_tests/test_data.py | 1 | 4069 | import pytest
try:
import cPickle as pickle
except:
import pickle
class SomeClass(object):
pass
pos_data = [
(('test', 'demo', 1), {'age': 1, 'name': 'name1'}),
(('test', 'demo', 2), {'age': 2, 'name': 'Mr John', 'bmi': 3.55}),
(('test', 'demo', 'boolean_key'), {'is_pr... | apache-2.0 |
davcastroruiz/boston-django-project | webSite/repo/migrations/0002_auto_20170224_1612.py | 1 | 1210 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-24 22:12
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('repo', '0001_initial'),
]
operations = [
m... | gpl-3.0 |
samgoodgame/sf_crime | iterations/KK_scripts/transform_test_data.py | 2 | 6405 | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 20 11:25:06 2017
@author: kalvi
"""
#required imports
import pandas as pd
import numpy as np
import csv
import time
import calendar
def get_test_data(test_transformed_path, test_path, earlyWeatherDataPath, weatherData1, weatherData2):
x_data = pd.read_csv(test_tran... | mit |
unreal666/youtube-dl | youtube_dl/extractor/sunporno.py | 64 | 2653 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
int_or_none,
qualities,
determine_ext,
)
class SunPornoIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www\.)?sunporno\.com/videos|embeds\.sunporno\.com/embed)/(?P<id>\d+)'
... | unlicense |
nest/nest-simulator | pynest/nest/tests/test_connect_fixed_outdegree.py | 10 | 5721 | # -*- coding: utf-8 -*-
#
# test_connect_fixed_outdegree.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 o... | gpl-2.0 |
CyanogenMod/android_kernel_samsung_msm8660-q1 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
srh/rethinkdb | test/memcached_workloads/serial_mix.py | 49 | 4927 | #!/usr/bin/env python
# Copyright 2010-2014 RethinkDB, all rights reserved.
import os, random, sys, time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import memcached_workload_common
from vcoptparse import *
def random_key(opts):
# The reason we have keysuf... | apache-2.0 |
nerdvegas/rez | src/rez/tests/test_package_cache.py | 1 | 5704 | """
Test package caching.
"""
from rez.tests.util import TestBase, TempdirMixin, restore_os_environ, \
install_dependent
from rez.packages import get_package
from rez.package_cache import PackageCache
from rez.resolved_context import ResolvedContext
from rez.exceptions import PackageCacheError
from rez.utils.filesy... | lgpl-3.0 |
NelisVerhoef/scikit-learn | examples/cluster/plot_kmeans_digits.py | 230 | 4524 | """
===========================================================
A demo of K-Means clustering on the handwritten digits data
===========================================================
In this example we compare the various initialization strategies for
K-means in terms of runtime and quality of the results.
As the gr... | bsd-3-clause |
Juniper/contrail-dev-controller | src/opserver/docs/conf.py | 20 | 8169 | # -*- coding: utf-8 -*-
#
# Contrail Opserver documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 23 15:11:04 2013.
#
# 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 fil... | apache-2.0 |
justinbois/fish-activity | tests/test_parse.py | 1 | 8083 | import pytest
import numpy as np
import pandas as pd
from pandas.util.testing import assert_frame_equal
import fishact
def test_sniffer():
n_header, delimiter, line = fishact.parse._sniff_file_info(
'tests/single_gtype.txt')
assert n_header == 2
assert deli... | mit |
slivkamiro/sample_kafka_producer | src/sample_source_props.py | 1 | 7278 | from random import randint
def random_movie():
return movies_list[randint(0, movies_list_length - 1)]
def random_series():
return seasons_list[randint(0, seasons_list_length - 1)]
def random_user():
user_data = user_list[randint(0, user_list_length - 1)]
return {'email': user_data[0], 'name': user_da... | apache-2.0 |
fengbaicanhe/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/geos/prototypes/topology.py | 311 | 2226 | """
This module houses the GEOS ctypes prototype functions for the
topological operations on geometries.
"""
__all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull',
'geos_difference', 'geos_envelope', 'geos_intersection',
'geos_linemerge', 'geos_pointonsurface', 'geos_pre... | apache-2.0 |
m13253/pycurl-python3 | tests/test_multi_timer.py | 13 | 1749 | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
# $Id: test_multi_timer.py,v 1.1 2006/11/10 12:25:29 kjetilja Exp $
import os, sys
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import pycurl
urls = (
"http://curl.haxx.se",
"http://www.python.or... | lgpl-2.1 |
adfernandes/mbed | tools/psa/tfm/bin_utils/imgtool/keys/rsa_test.py | 5 | 4542 | # Original code taken from mcuboot project at:
# https://github.com/mcu-tools/mcuboot
# Git SHA of the original version: a8e12dae381080e898cea0c6f7408009b0163f9f
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... | apache-2.0 |
skymysky/codis | deploy/products/beta/render.py | 18 | 7522 | #!/usr/bin/env python3
import os
import json
import stat
template_root = "../../templates"
generate_root = "../../root"
def readfile(path, name):
file = os.path.join(path, name)
with open(file) as f:
return f.read()
def generate(path, name, content):
if path != "":
os.makedirs(path, exi... | mit |
SickRage/SickRage | sickrage/core/webserver/api.py | 2 | 114400 | # Author: Dennis Lutter <lad1337@gmail.com>
# Author: Jonathon Saine <thezoggy@gmail.com>
# URL: https://sickrage.ca
#
# This file is part of SickRage.
#
# SickRage 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 Foundati... | gpl-3.0 |
hifly/OpenUpgrade | addons/account_asset/report/account_asset_report.py | 279 | 4226 | # -*- encoding: 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 t... | agpl-3.0 |
freelancer/freelancer-sdk-python | examples/create_employer_review.py | 1 | 1087 | from freelancersdk.session import Session
from freelancersdk.resources.projects.projects import post_review
from freelancersdk.resources.projects.helpers import \
create_review_employer_object
from freelancersdk.resources.projects.exceptions import \
ReviewNotPostedException
import os
def sample_post_review()... | lgpl-3.0 |
niecw/stock-logistics-workflow | __unported__/stock_split_picking/__openerp__.py | 9 | 1687 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi, Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | agpl-3.0 |
niceban/django-command-extensions | django_extensions/management/commands/compile_pyc.py | 12 | 1340 | from django.core.management.base import NoArgsCommand
from django_extensions.management.utils import get_project_root
from random import choice
from optparse import make_option
from os.path import join as _j
import py_compile
import os
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
... | mit |
niltonlk/nest-simulator | examples/NESTServerClient/setup.py | 17 | 1217 | # -*- coding: utf-8 -*-
#
# setup.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at... | gpl-2.0 |
unindented/streamcode | client/static/jsrepl/extern/python/closured/lib/python2.7/encodings/cp855.py | 593 | 34106 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | mit |
Cinntax/home-assistant | tests/components/yandextts/test_tts.py | 2 | 11708 | """The tests for the Yandex SpeechKit speech platform."""
import asyncio
import os
import shutil
import homeassistant.components.tts as tts
from homeassistant.setup import setup_component
from homeassistant.components.media_player.const import (
SERVICE_PLAY_MEDIA,
DOMAIN as DOMAIN_MP,
)
from tests.common impo... | apache-2.0 |
Observer-Wu/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py | 121 | 13839 | # Copyright (C) 2011, Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | bsd-3-clause |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/languages/ru.py | 128 | 3306 | # -*- coding: utf-8 -*-
# $Id: ru.py 7123 2011-09-12 08:28:31Z milde $
# Author: Roman Suzi <rnd@onego.ru>
# 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... | gpl-2.0 |
shaded-enmity/ansible-modules-extras | monitoring/datadog_monitor.py | 74 | 10398 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Sebastian Kornehl <sebastian.kornehl@asideas.de>
#
# 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 versi... | gpl-3.0 |
makinacorpus/django | django/contrib/humanize/templatetags/humanize.py | 12 | 8919 | from __future__ import unicode_literals
import re
from datetime import date, datetime
from decimal import Decimal
from django import template
from django.conf import settings
from django.template import defaultfilters
from django.utils.encoding import force_text
from django.utils.formats import number_format
from djan... | bsd-3-clause |
adammenges/statsmodels | statsmodels/sandbox/distributions/tests/_est_fit.py | 31 | 2609 | # NOTE: contains only one test, _est_cont_fit, that is renamed so that
# nose doesn't run it
# I put this here for the record and for the case when someone wants to
# verify the quality of fit
# with current parameters: relatively small sample size, default starting values
# Ran 84 tests in 401.797s
# ... | bsd-3-clause |
DragonMastur/FakeRealNewsDetection | Serverless Functions/requests/packages/urllib3/packages/ordered_dict.py | 2040 | 8935 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... | agpl-3.0 |
linjoahow/w17test_1 | static/Brython3.1.0-20150301-090019/Lib/_thread.py | 740 | 4879 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... | gpl-3.0 |
pyjs/pyjs | pyjswidgets/pyjamas/Canvas/PathElement.py | 7 | 2742 | """
* Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http:#www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
MCopperhead/city-building | object_layer.py | 1 | 2012 | import cocos as c
from cell import Cell
from shared_data import MAP_SIZE
from objects import TestCube, Wall
class DynamicBatch(c.batch.BatchNode):
"""
Batch modification, that allows to change Z level of child object dynamically.
"""
def change_z(self, child, z):
child.set_batch(None)
... | gpl-2.0 |
magvugr/AT | EntVirtual/lib/python2.7/site-packages/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... | gpl-3.0 |
eshijia/SUR | magnum/db/sqlalchemy/models.py | 5 | 8662 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 requir... | apache-2.0 |
GoogleCloudPlatform/sap-deployment-automation | third_party/github.com/ansible/awx/awx/main/tests/unit/commands/test_replay_job_events.py | 1 | 2696 | # Copyright (c) 2017 Ansible by Red Hat
# All Rights Reserved
# Python
import pytest
from unittest import mock
from datetime import timedelta
# Django
from django.utils import timezone
# AWX
from awx.main.models import (
Job,
JobEvent,
)
from awx.main.management.commands.replay_job_events import (
Replay... | apache-2.0 |
pyramania/scipy | scipy/linalg/tests/test_solvers.py | 3 | 30247 | from __future__ import division, print_function, absolute_import
import os
import numpy as np
from numpy.testing import TestCase, run_module_suite
from numpy.testing import assert_raises, assert_array_almost_equal
from numpy.testing.noseclasses import KnownFailureTest
from scipy.linalg import solve_sylvester
from s... | bsd-3-clause |
codeinvain/object_detection | app/tracks.py | 1 | 1501 | import logging
import os
import json
import sys
from object_detector import ObjectDetector
from jsonmerge import merge
import atexit
config = {}
logger = None
def bootstrap(options):
if not os.path.exists('log'):
os.makedirs('log')
if not os.path.exists('tmp'):
os.makedirs('tmp')
creat... | mit |
hazrpg/calibre | src/calibre/gui2/widgets2.py | 9 | 6726 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
from PyQt5.Qt import (
QPushButton, QPixmap, QIcon, QColor, Qt, QColorDi... | gpl-3.0 |
satanas/libturpial | libturpial/api/models/column.py | 1 | 1346 | # -*- coding: utf-8 -*-
class Column(object):
"""
This model represents a column that holds
:class:`libturpial.api.models.status.Status` objects. You need to specify
to what *account_id* are they associated, as well as the column *slug*.
Available column slugs are available in
:class:`libturpi... | gpl-3.0 |
tblancher/pymazon | pymazon/core/tree_model.py | 4 | 2892 | """
Pymazon - A Python based downloader for the Amazon.com MP3 store
Copyright (c) 2010 Steven C. Colbert
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your ... | gpl-3.0 |
veger/ansible | lib/ansible/parsing/yaml/objects.py | 61 | 4225 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
CVML/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | 227 | 5170 | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... | bsd-3-clause |
crate/crate-python | src/crate/client/sqlalchemy/tests/dict_test.py | 1 | 16645 | # -*- coding: utf-8; -*-
#
# Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License"... | apache-2.0 |
40223143/cadp_w2 | wsgi/static/templates/jscript/Lib/random.py | 15 | 25735 | """Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | gpl-3.0 |
karimbahgat/PythonGis | pythongis/app/tk2/_frompygis/toolbars.py | 3 | 3980 | import Tkinter as tk
from .buttons import *
from .popups import *
from ... import vector
from ... import raster
# Import style
from . import theme
style_toolbar_normal = {"bg": theme.color4,
"pady": 0}
style_namelabel_normal = {"bg": theme.color4,
"font": theme.font2["... | mit |
mmcauliffe/linguistic-helper-functions | linghelper/representations/classes.py | 1 | 4708 | import re
import copy
from linghelper.representations.constants import ENGLISH_ONSETS as ONSETS,ENGLISH_VOWEL_PATTERN as VOWEL_PATTERN
class Word(object):
def __init__(self,orthography,transcription,frequency=0):
self.orthography = orthography
self.syllables = syllabify(transcription)
sel... | gpl-3.0 |
dcsquared13/Diamond | src/diamond/handler/logentries_diamond.py | 16 | 2339 | # coding=utf-8
"""
[Logentries: Log Management & Analytics Made Easy ](https://logentries.com/).
Send Diamond stats to your Logentries Account where you can monitor and alert
based on data in real time.
"""
from Handler import Handler
import logging
import urllib2
import json
from collections import deque
class Loge... | mit |
jknebel/STEN | PostStat.py | 1 | 23533 | import numpy as np
import tables
import wx
import os
import itertools
# ClassMultiple testing correction using mathematical morphology
##Tables definition
##
##tables:
##/Shape # Keep the shape of the Data, to reshape after calculation # simple array
##/Data/All #using createEArray('/','AllData',tables.Float6... | bsd-3-clause |
hynnet/openwrt-mt7620 | staging_dir/host/lib/python2.7/test/test_wait3.py | 136 | 1062 | """This test checks for correct wait3() behavior.
"""
import os
import time
import unittest
from test.fork_wait import ForkWait
from test.test_support import run_unittest, reap_children
try:
os.fork
except AttributeError:
raise unittest.SkipTest, "os.fork not defined -- skipping test_wait3"
try:
os.wait3... | gpl-2.0 |
sotdjin/glibglab | venv/lib/python2.7/site-packages/sqlalchemy/sql/expression.py | 19 | 6301 | # sql/expression.py
# Copyright (C) 2005-2016 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
"""Defines the public namespace for SQL expression constructs.
Prior to version 0... | mit |
RapidApplicationDevelopment/tensorflow | tensorflow/contrib/layers/python/layers/__init__.py | 104 | 1728 | # 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 |
RyanTech/TiNSGIF | iphone/build.py | 2 | 8599 | #!/usr/bin/env python
#
# Appcelerator Titanium Module Packager
#
#
import os, subprocess, sys, glob, string
import zipfile
from datetime import date
cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
os.chdir(cwd)
required_module_keys = ['architectures', 'name','version','moduleid','descripti... | mit |
liyu1990/tensorflow | tensorflow/models/rnn/translate/seq2seq_model.py | 5 | 12766 | """Sequence-to-sequence model with an attention mechanism."""
import random
import numpy as np
import tensorflow as tf
from tensorflow.models.rnn import rnn_cell
from tensorflow.models.rnn import seq2seq
from tensorflow.models.rnn.translate import data_utils
class Seq2SeqModel(object):
"""Sequence-to-sequence m... | apache-2.0 |
ewdurbin/sentry | src/sentry/nodestore/migrations/0001_initial.py | 36 | 1246 | # -*- 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 'Node'
db.create_table(u'nodestore_node', (
('id', self.gf('django.db.models.fiel... | bsd-3-clause |
guettli/django | tests/file_uploads/views.py | 8 | 5093 | from __future__ import unicode_literals
import contextlib
import hashlib
import json
import os
from django.core.files.uploadedfile import UploadedFile
from django.http import HttpResponse, HttpResponseServerError
from django.utils import six
from django.utils.encoding import force_bytes, force_str
from .models impor... | bsd-3-clause |
40223105/w17test | static/Brython3.1.1-20150328-091302/Lib/xml/sax/saxutils.py | 730 | 11688 | """\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
import os, urllib.parse, urllib.request
import io
from . import handler
from . import xmlreader
def __dict_replace(s, d):
"""Replace substrings of a string using a dictionary."""
for key, val... | gpl-3.0 |
HLFH/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/utils.py | 15 | 47237 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import calendar
import codecs
import contextlib
import ctypes
import datetime
import email.utils
import errno
import gzip
import itertools
import io
import json
import locale
import math
import os
import pipes
import platform
import... | gpl-3.0 |
chokribr/invenioold | modules/docextract/lib/refextract.py | 22 | 1232 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version ... | gpl-2.0 |
liamcurry/py3kwarn | py3kwarn2to3/fixes/fix_types.py | 1 | 1707 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for removing uses of the types module.
These work for only the known names in the types module. The forms above
can include types. or not. ie, It is assumed the module is imported either as:
import type... | mit |
embray/PyFITS | lib/pyfits/scripts/fitscheck.py | 1 | 6708 | """
``fitscheck`` is a command line script based on pyfits for verifying and
updating the CHECKSUM and DATASUM keywords of .fits files. ``fitscheck`` can
also detect and often fix other FITS standards violations. ``fitscheck``
facilitates re-writing the non-standard checksums originally generated by
pyfits with stand... | bsd-3-clause |
andela-bojengwa/django-simple-captcha | captcha/tests/__init__.py | 11 | 8088 | # -*- coding: utf-8 -*-
from captcha.conf import settings
from captcha.models import CaptchaStore
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers im... | mit |
monokrome/opbeat_pyramid | opbeat_pyramid/subscribers.py | 2 | 6587 | import logging
import functools
import opbeat
import os
import sys
import pyramid.tweens
from opbeat.instrumentation import control
from pyramid import events
from pyramid import httpexceptions
from pyramid import settings
from opbeat_pyramid import tweens
control.instrument()
DEFAULT_UNKNOWN_ROUTE_TEXT = 'Unk... | mit |
yfried/ansible | lib/ansible/modules/notification/matrix.py | 19 | 3770 | #!/usr/bin/python
# coding: utf-8
# (c) 2018, Jan Christian Grünhage <jan.christian@gruenhage.xyz>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_ve... | gpl-3.0 |
lavalamp-/ws-backend-community | wselasticsearch/query/dns/enumeration.py | 1 | 1098 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .base import BaseDomainNameScanQuery
class SubdomainEnumerationQuery(BaseDomainNameScanQuery):
"""
This is an Elasticsearch query class for querying SubdomainEnumerationModel objects.
"""
@classmethod
def get_queried_class(cls):... | gpl-3.0 |
huzq/scikit-learn | examples/cluster/plot_mean_shift.py | 23 | 1775 | """
=============================================
A demo of the mean-shift clustering algorithm
=============================================
Reference:
Dorin Comaniciu and Peter Meer, "Mean Shift: A robust approach toward
feature space analysis". IEEE Transactions on Pattern Analysis and
Machine Intelligence. 2002. ... | bsd-3-clause |
Maximilian-Reuter/SickRage-1 | lib/cachecontrol/heuristics.py | 374 | 4053 | import calendar
import time
from email.utils import formatdate, parsedate, parsedate_tz
from datetime import datetime, timedelta
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
def expire_after(delta, date=None):
date = date or datetime.now()
return date + delta
def datetime_to_header(dt):
return formatdate(c... | gpl-3.0 |
blacklin/kbengine | kbe/res/scripts/common/Lib/json/decoder.py | 89 | 12763 | """Implementation of JSONDecoder
"""
import re
from json import scanner
try:
from _json import scanstring as c_scanstring
except ImportError:
c_scanstring = None
__all__ = ['JSONDecoder']
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
NaN = float('nan')
PosInf = float('inf')
NegInf = float('-inf')
def line... | lgpl-3.0 |
joone/chromium-crosswalk | tools/telemetry/telemetry/web_perf/metrics/blob_timeline.py | 16 | 4129 | # 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 telemetry.value import improvement_direction
from telemetry.value import list_of_scalar_values
from telemetry.web_perf.metrics import timeline_based_met... | bsd-3-clause |
psrthegreat/heroku-buildpack-python-sklearn | test/django-1.4-skeleton/haystack/wsgi.py | 83 | 1138 | """
WSGI config for haystack project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... | mit |
40223143/cda-w15 | static/Brython3.1.1-20150328-091302/Lib/jqueryui/__init__.py | 603 | 3671 | """Wrapper around the jQuery UI library
Exposes a single object, jq, to manipulate the widgets designed in the library
This object supports :
- subscription : js[elt_id] returns an object matching the element with the
specified id
- a method get(**kw). The only keyword currently supported is "selector". The
metho... | agpl-3.0 |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/Bio/Phylo/PAML/_parse_codeml.py | 1 | 21515 | # Copyright (C) 2011 by Brandon Invergo (b.invergo@gmail.com)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
import re
line_floats_re = re.compile("-*\d+\.\d+")
try:
float("nan")
_nan_float... | apache-2.0 |
phalt/django | tests/gis_tests/geoapp/test_regress.py | 23 | 3851 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from django.contrib.gis.db.models import Extent
from django.contrib.gis.shortcuts import render_to_kmz
from django.db.models import Count, Min
from django.test import TestCase, skipUnlessDBFeature
from ..utils import no_o... | bsd-3-clause |
sairon/ncclient | ncclient/transport/session.py | 2 | 15500 | # Copyright 2013 Jan Cermak
# Copyright 2009 Shikhar Bhushan
#
# 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 applicabl... | apache-2.0 |
ly0/xxadmin | setup.py | 1 | 1788 | #!/usr/bin/env python
from setuptools import setup
# version_tuple = __import__('xadmin.version').VERSION
# version = ".".join([str(v) for v in version_tuple])
setup(
name='django-xadmin',
version='0.5.1',
description='Drop-in replacement of Django admin comes with lots of goodies, fully extensible with p... | bsd-3-clause |
waterponey/scikit-learn | examples/neighbors/plot_lof.py | 30 | 1939 | """
=================================================
Anomaly detection with Local Outlier Factor (LOF)
=================================================
This example presents the Local Outlier Factor (LOF) estimator. The LOF
algorithm is an unsupervised outlier detection method which computes the local
density deviat... | bsd-3-clause |
gx1997/chrome-loongson | tools/valgrind/memcheck_analyze.py | 10 | 22594 | #!/usr/bin/env python
# Copyright (c) 2011 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.
# memcheck_analyze.py
''' Given a valgrind XML file, parses errors and uniques them.'''
import gdb_helper
from collections impor... | bsd-3-clause |
JingZhou0404/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/executive_unittest.py | 124 | 13048 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2009 Daniel Bates (dbates@intudata.com). 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 co... | bsd-3-clause |
imsparsh/python-for-android | python3-alpha/extra_modules/pyxmpp2/mainloop/select.py | 46 | 4546 | #
# (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful... | apache-2.0 |
johncheetham/jcchess | jcchess/move_list.py | 1 | 9162 | #
# move_list.py - Display Move List Window
#
# This file is part of jcchess
#
# jcchess 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 l... | gpl-3.0 |
tundebabzy/frappe | frappe/patches/v6_4/reduce_varchar_length.py | 19 | 1110 | from __future__ import unicode_literals, print_function
import frappe
def execute():
for doctype in frappe.get_all("DocType", filters={"issingle": 0}):
doctype = doctype.name
if not frappe.db.table_exists(doctype):
continue
for column in frappe.db.sql("desc `tab{doctype}`".format(doctype=doctype), as_dict=T... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.