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 |
|---|---|---|---|---|---|
jaimeMF/youtube-dl | youtube_dl/extractor/ynet.py | 105 | 1741 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote_plus
class YnetIE(InfoExtractor):
_VALID_URL = r'http://(?:.+?\.)?ynet\.co\.il/(?:.+?/)?0,7340,(?P<id>L(?:-[0-9]+)+),00\.html'
_TESTS = [
{... | unlicense |
geimer/easybuild-easyblocks | easybuild/easyblocks/i/ipp.py | 4 | 3046 | ##
# Copyright 2009-2013 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
iakovos-panourgias/fluidity | tests/mms_rans_p1p1_cv_keps/mms_rans_p1p1_cv_keps_tools.py | 30 | 13064 | from math import sin, cos, tanh, pi
def u(X):
return cos(X[0]) + 0.600*sin(X[1]) + 3.00
def v(X):
return X[1]*sin(X[0])
def p(X):
return cos(X[1]) + sin(X[0]) + sin(X[0]*X[1]/pi) - 1.00
def rho(X):
return -1.30*cos(2.10*X[1]) - 1.80*sin(1.70*X[0]) + 3.70*sin(1.30*X[0]*X[1]/pi) + 5.20
def ke(X):
... | lgpl-2.1 |
marco-lancini/Showcase | django/forms/fields.py | 49 | 38087 | """
Field classes.
"""
import datetime
import os
import re
import time
import urlparse
import warnings
from decimal import Decimal, DecimalException
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.core.exceptions import ValidationError
from django.core import ... | mit |
libscie/liberator | liberator/lib/python3.6/site-packages/django/core/checks/security/sessions.py | 51 | 2782 | from django.conf import settings
from .. import Tags, Warning, register
from ..utils import patch_middleware_message
def add_session_cookie_message(message):
return message + (
" Using a secure-only session cookie makes it more difficult for "
"network traffic sniffers to hijack user sessions."
... | cc0-1.0 |
meletakis/collato | lib/python2.7/site-packages/autocomplete_light/example_apps/basic/forms.py | 2 | 1045 | from django import VERSION
try:
import genericm2m
except ImportError:
genericm2m = None
try:
import taggit
except ImportError:
taggit = None
import autocomplete_light
autocomplete_light.autodiscover()
from .models import *
class DjangoCompatMeta:
if VERSION >= (1, 6):
fields = '__all_... | gpl-2.0 |
lutrellja15/gir_app_labs_at_aamu | models/places.py | 2 | 1242 | # Copyright 2017 The GiR @ AAMU 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 |
eevee/pelican | pelican/tests/test_generators.py | 12 | 31166 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from codecs import open
try:
from unittest.mock import MagicMock
except ImportError:
try:
from mock import MagicMock
except ImportError:
MagicMock = False
from shutil import rmtree
from tempfile import mkdtemp
from p... | agpl-3.0 |
flgiordano/netcash | +/google-cloud-sdk/lib/third_party/ruamel/yaml/dumper.py | 1 | 4101 | from __future__ import absolute_import
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper', 'RoundTripDumper']
from .emitter import *
from .serializer import *
from .representer import *
from .resolver import *
class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver):
def __init__(self, stream,
... | bsd-3-clause |
mxOBS/deb-pkg_trusty_chromium-browser | tools/perf/measurements/smooth_gesture_util_unittest.py | 9 | 6377 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
import unittest
from measurements import smooth_gesture_util as sg_util
from telemetry.core.platform import tracing_category_filter
from telemetr... | bsd-3-clause |
neo1218/guisheng2 | tests/test_client.py | 2 | 1467 | # coding: utf-8
"""
test_client.py
~~~~~~~~~~~~~~
ไฝฟ็จๆต่ฏๅฎขๆท็ซฏ๏ผๆจกๆๅฎขๆท็ซฏ็่ฏทๆฑ๏ผๅ้ๅ่ฝ
"""
import unittest
from flask import url_for
from app import create_app, db
from app.models import Role, User
class FlaskClientTestCase(unittest.TestCase):
"""flask ๆต่ฏๅฎขๆท็ซฏ"""
def setUp(self):
self.app = create_ap... | mit |
ralphbean/ansible | v2/ansible/plugins/action/script.py | 10 | 4218 | # (c) 2012, 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) any lat... | gpl-3.0 |
andras-tim/sphinxcontrib-httpdomain | sphinxcontrib/autohttp/flask.py | 1 | 5419 | """
sphinxcontrib.autohttp.flask
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The sphinx.ext.autodoc-style HTTP API reference builder (from Flask)
for sphinxcontrib.httpdomain.
:copyright: Copyright 2011 by Hong Minhee
:license: BSD, see LICENSE for details.
"""
import re
import six
from docutils import no... | bsd-2-clause |
jjmleiro/hue | apps/sqoop/src/sqoop/client/resource.py | 30 | 3647 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
tinkhaven-organization/odoo | addons/account/wizard/account_chart.py | 271 | 5191 | # -*- 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 |
cyrixhero/powerline | tests/vim.py | 15 | 18840 | # vim:fileencoding=utf-8:noet
_log = []
vars = {}
vvars = {'version': 703}
_tabpage = 0
_mode = 'n'
_buf_purge_events = set()
options = {
'paste': 0,
'ambiwidth': 'single',
'columns': 80,
'encoding': 'utf-8',
}
_last_bufnr = 0
_highlights = {}
from collections import defaultdict as _defaultdict
_environ = _defaultd... | mit |
fbradyirl/home-assistant | tests/components/light/test_device_automation.py | 1 | 5092 | """The test for light device automation."""
import pytest
from homeassistant.components import light
from homeassistant.const import STATE_ON, STATE_OFF, CONF_PLATFORM
from homeassistant.setup import async_setup_component
import homeassistant.components.automation as automation
from homeassistant.components.device_aut... | apache-2.0 |
ArcherSys/ArcherSys | eclipse/plugins/org.python.pydev_4.5.5.201603221110/pysrc/third_party/pep8/lib2to3/lib2to3/pgen2/driver.py | 212 | 5164 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Modifications:
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser driver.
This provides a high-level interface to parse a file into a synta... | mit |
treesnail/tushare | test/macro_test.py | 40 | 1185 | # -*- coding:utf-8 -*-
'''
Created on 2015/3/14
@author: Jimmy Liu
'''
import unittest
import tushare.stock.macro as fd
class Test(unittest.TestCase):
def test_get_gdp_year(self):
print(fd.get_gdp_year())
def test_get_gdp_quarter(self):
print(fd.get_gdp_quarter())
... | bsd-3-clause |
timthelion/FreeCAD | src/Mod/Path/PathScripts/PathLoadTool.py | 2 | 11946 | # -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2015 Dan Falck <ddfalck@gmail.com> *
# * ... | lgpl-2.1 |
40223117cda/w17test | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/draw.py | 603 | 6456 | from javascript import console
from browser import timer
import math
class Queue:
def __init__(self):
self._list=[]
def empty(self):
return len(self._list) == 0
def put(self, element):
self._list.append(element)
def get(self):
if len(self._list) == 0:
raise BaseError
... | gpl-3.0 |
SiccarPoint/landlab | landlab/grid/structured_quad/links.py | 1 | 83060 | import numpy as np
from . import nodes
from ..base import CORE_NODE, FIXED_GRADIENT_BOUNDARY, FIXED_VALUE_BOUNDARY
from ..unstructured.links import LinkGrid
from ...core.utils import as_id_array
def neighbors_at_link(shape, links):
"""Get neighbor links.
Examples
--------
>>> import numpy as np
>... | mit |
medallia/aurora | src/main/python/apache/aurora/executor/common/announcer_zkauth_schema.py | 8 | 1155 | #
# 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
# distributed under ... | apache-2.0 |
jsteemann/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/asynchat.py | 247 | 11402 | # -*- Mode: Python; tab-width: 4 -*-
# Id: asynchat.py,v 2.26 2000/09/07 22:29:26 rushing Exp
# Author: Sam Rushing <rushing@nightmare.com>
# ======================================================================
# Copyright 1996 by Sam Rushing
#
# All Rights Reserved
#
# Permission... | apache-2.0 |
12019/python-gsmmodem | examples/dial_polling_demo.py | 12 | 2624 | #!/usr/bin/env python
"""\
Demo: dial a number (simple example using polling to check call status)
Simple demo app that makes a voice call and plays sone DTMF tones (if supported by modem)
when the call is answered, and hangs up the call.
It polls the call status to see if the call has been answered
Note: you need t... | lgpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/surface/pubsub/topics/list_subscriptions.py | 6 | 3464 | # 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 applicable law or ag... | apache-2.0 |
devops2014/djangosite | tests/migrations/test_base.py | 25 | 2508 | import os
from django.db import connection
from django.test import TransactionTestCase
from django.utils._os import upath
class MigrationTestBase(TransactionTestCase):
"""
Contains an extended set of asserts for testing migrations and schema operations.
"""
available_apps = ["migrations"]
test_d... | bsd-3-clause |
Jai-Chaudhary/vislab | vislab/vw.py | 4 | 7157 | """
Train and test Vowpal Wabbit classifier or regressor on data.
Training includes cross-validation over parameters.
"""
import os
import shutil
import socket
import vislab
import vislab.results
import vislab.vw3
def test(
collection_name, dataset, source_dataset, feature_names,
force=False, num_work... | bsd-2-clause |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/ply/cpp.py | 16 | 33639 | # -----------------------------------------------------------------------------
# cpp.py
#
# Author: David Beazley (http://www.dabeaz.com)
# Copyright (C) 2007
# All rights reserved
#
# This module implements an ANSI-C style lexical preprocessor for PLY.
# --------------------------------------------------------------... | isc |
dumoulinj/ers | ers_backend/video_processor/models.py | 1 | 25636 | import json
import logging
import cv2, os
from cv2 import cv
from django.conf import settings
from django.db import models
from math import exp
from django_enumfield import enum
from model_utils.managers import InheritanceManager
from PIL import Image, ImageStat
import time
import numpy
from dataset_manager.enums imp... | mit |
monokoo/shadowsocks | shadowsocks/common.py | 1 | 13819 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# 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 requi... | apache-2.0 |
egenerat/gae-django | djangoappengine/management/commands/deploy.py | 10 | 2540 | #!/usr/bin/python2.4
#
# 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... | mit |
vmindru/ansible | test/units/modules/network/f5/test_bigip_pool_member.py | 25 | 8557 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
nirmeshk/oh-mainline | vendor/packages/sphinx/sphinx/writers/latex.py | 15 | 57880 | # -*- coding: utf-8 -*-
"""
sphinx.writers.latex
~~~~~~~~~~~~~~~~~~~~
Custom docutils writer for LaTeX.
Much of this code is adapted from Dave Kuhlman's "docpy" writer from his
docutils sandbox.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE fo... | agpl-3.0 |
gaddman/ansible | lib/ansible/modules/storage/netapp/netapp_e_asup.py | 21 | 11223 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
Denisolt/IEEE-NYIT-MA | local/lib/python2.7/site-packages/PIL/BdfFontFile.py | 17 | 3367 | #
# The Python Imaging Library
# $Id$
#
# bitmap distribution font (bdf) file parser
#
# history:
# 1996-05-16 fl created (as bdf2pil)
# 1997-08-25 fl converted to FontFile driver
# 2001-05-25 fl removed bogus __init__ call
# 2002-11-20 fl robustification (from Kevin Cazabon, Dmitry Vasiliev)
# 2003-04-22 fl ... | gpl-3.0 |
zhuwenping/python-for-android | python3-alpha/python3-src/Lib/idlelib/configSectionNameDialog.py | 55 | 3743 | """
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
"""
from tkinter import *
import tkinter.messagebox as tkMessageBox
class GetCfgSectionNameDialog(Toplevel):
def __init__(self,parent,title,message,usedNames):
"""
messag... | apache-2.0 |
singleyoungtao/myblog-flask | tests/test_api.py | 1 | 10718 | #!/usr/bin/python
#-*-coding: utf-8 -*-
import unittest
import json
import re
from base64 import b64encode
from flask import url_for
from app import create_app, db
from app.models import User, Role, Post, Comment
class APITestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
... | mit |
virtuald/exaile | plugins/ipconsole/ipython_view/ipython_view.py | 2 | 20044 | #!/usr/bin/python3
'''
Provides IPython console widget.
@author: Eitan Isaacson
@organization: IBM Corporation
@copyright: Copyright (c) 2007 IBM Corporation
@license: BSD
All rights reserved. This program and the accompanying materials are made
available under the terms of the BSD which accompanies this distributio... | gpl-2.0 |
valtandor/easybuild-easyblocks | easybuild/easyblocks/h/hadoop.py | 2 | 5312 | ##
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
AnishShah/tensorflow | tensorflow/contrib/gan/python/losses/python/tuple_losses.py | 73 | 1231 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
rlr/kitsune | kitsune/sumo/tests/test_templates.py | 13 | 3924 | from django.conf import settings
from django.test.client import RequestFactory
from django.utils import translation
import jingo
import mock
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.sumo.tests import LocalizingClient, TestCase
from kitsune.sumo.urlresolvers import reverse
def setup(... | bsd-3-clause |
pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/flask_migrate/templates/flask-multidb/env.py | 31 | 5448 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool, MetaData
from logging.config import fileConfig
import logging
USE_TWOPHASE = False
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context... | mit |
lucperkins/heron | heron/common/src/python/utils/log.py | 1 | 3380 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2016 Twitter. 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... | apache-2.0 |
Azure/azure-sdk-for-python | sdk/confidentialledger/azure-confidentialledger/azure/confidentialledger/_generated/_generated_identity/v0_1_preview/_confidential_ledger_identity_service_client.py | 1 | 3766 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
basicthinker/THNVM | src/python/m5/config.py | 91 | 2085 | # Copyright (c) 2008 The Hewlett-Packard Development Company
# 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 |
robmcdan/python-goose | goose/extractors/__init__.py | 18 | 1179 | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | apache-2.0 |
chhao91/QGIS | tests/src/python/test_qgsblendmodes.py | 7 | 7978 | # -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgsblendmodes.py
---------------------
Date : May 2013
Copyright : (C) 2013 by Nyall Dawson, Massimo Endrighi
Email : nyall dot dawson at gmail.com
... | gpl-2.0 |
wd5/jangr | django/conf/locale/fr/formats.py | 232 | 1530 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j F Y H:i:s'
YEAR_MONTH_F... | bsd-3-clause |
marcoscaceres/bedrock | bedrock/grants/grants_db.py | 43 | 39061 | # -*- coding: utf-8 -*-
from collections import namedtuple
Grant = namedtuple('Grant', 'url, grantee, location, title, type, total_support, '
'year, description, break_down, urls')
GRANTS = [
Grant(
u'dream-yard',
u'DreamYard Project',
u'United States',
... | mpl-2.0 |
Phoenix-CJ23/stockkernel | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
mthz/rpg_svo | svo_analysis/src/svo_analysis/filter_groundtruth_smooth.py | 17 | 1875 | #!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
import transformations
from scipy import signal
save = True
data_filename = '/home/cforster/Datasets/SlamBenchmark/asl_vicon_d2/groundtruth.txt'
filtered_data_filename = '/home/cforster/Datasets/SlamBenchmark/asl_vicon_d2/groundtruth_filtered.txt'
... | gpl-3.0 |
quinox/weblate | weblate/trans/tests/test_changes.py | 2 | 3112 | # -*- coding: utf-8 -*-
#
# Copyright ยฉ 2012 - 2015 Michal ฤihaล <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
mikebenfield/scikit-learn | sklearn/__check_build/__init__.py | 345 | 1671 | """ Module to give helpful messages to the user that did not
compile the scikit properly.
"""
import os
INPLACE_MSG = """
It appears that you are importing a local scikit-learn source tree. For
this, you need to have an inplace install. Maybe you are in the source
directory and you need to try from another location.""... | bsd-3-clause |
yakky/cmsplugin-filer | cmsplugin_filer_video/settings.py | 40 | 1093 | from django.conf import settings
VIDEO_WIDTH = getattr(settings, "VIDEO_WIDTH", 320)
VIDEO_HEIGHT = getattr(settings, "VIDEO_HEIGHT", 240)
VIDEO_AUTOPLAY = getattr(settings, "VIDEO_AUTOPLAY", False)
VIDEO_AUTOHIDE = getattr(settings, "VIDEO_AUTOHIDE", False)
VIDEO_FULLSCREEN = getattr(settings, "VIDEO_FULLSCREEN", Tr... | bsd-3-clause |
iee/iee_fuse | smb/testdaemon.py | 1 | 1657 | #!/usr/bin/env python
# To kick off the script, run the following from the python directory:
# PYTHONPATH=`pwd` python testdaemon.py start
#standard python libs
import logging
import time
import stomp
#third party libs
from daemon import runner
class SampleListener(object):
def on_message(self, headers, msg):
... | gpl-3.0 |
rue89-tech/edx-analytics-pipeline | edx/analytics/tasks/tests/test_overall_events.py | 2 | 4614 | """Tests overall count of events"""
import sys
import json
from edx.analytics.tasks.tests.map_reduce_mixins import MapperTestMixin, ReducerTestMixin
import luigi
from edx.analytics.tasks.tests import unittest
from edx.analytics.tasks.overall_events import TotalEventsDailyTask
from edx.analytics.tasks.tests.opaque_key... | agpl-3.0 |
mirror/cygwin | gdb/python/lib/gdb/command/frame_filters.py | 8 | 16600 | # Frame-filter commands.
# Copyright (C) 2013 Free Software Foundation, Inc.
# 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 option) any later ver... | gpl-2.0 |
cognitiveclass/edx-platform | common/lib/xmodule/xmodule/word_cloud_module.py | 42 | 8097 | """Word cloud is ungraded xblock used by students to
generate and view word cloud.
On the client side we show:
If student does not yet answered - `num_inputs` numbers of text inputs.
If student have answered - words he entered and cloud.
"""
import json
import logging
from pkg_resources import resource_string
from x... | agpl-3.0 |
geekboxzone/lollipop_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/layout_tests/port/builders.py | 25 | 5188 | # 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 |
terbolous/SickRage | sickbeard/notifiers/nmjv2.py | 3 | 8204 | # coding=utf-8
# Author: Jasper Lanting
# Based on nmj.py by Nico Berlee: http://nico.berlee.nl/
# URL: https://sickrage.github.io
#
# 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 So... | gpl-3.0 |
3L3N4/volatility | volatility/conf.py | 57 | 15263 | ## This file was taken from PyFlag http://www.pyflag.net/
# Michael Cohen <scudette@users.sourceforge.net>
# David Collett <daveco@users.sourceforge.net>
#
# ******************************************************
# Version: FLAG $Version: 0.87-pre1 Date: Thu Jun 12 00:48:38 EST 2008$
# ********************************... | gpl-2.0 |
zbqf109/goodo | openerp/addons/l10n_cr/__openerp__.py | 4 | 2892 | # -*- encoding: utf-8 -*-
##############################################################################
#
# __openerp__.py
# l10n_cr_account
# First author: Carlos Vรกsquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.)
# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserv... | gpl-3.0 |
dsavoiu/kafe2 | kafe2/core/constraint.py | 1 | 12225 | import abc
import numpy as np
import six
from ..fit.io.file import FileIOMixin
__all__ = ['ParameterConstraintException', 'ParameterConstraint', 'GaussianSimpleParameterConstraint',
'GaussianMatrixParameterConstraint']
class ParameterConstraintException(Exception):
pass
@six.add_metaclass(abc.ABCMe... | gpl-3.0 |
akubera/AliMaster | alimaster/gui/mainwindow.py | 1 | 4120 | #
# alimaster/gui/mainwindow.py
#
from tkinter import * # noqa
from tkinter.ttk import * # noqa
from alimaster import __version__
from .filebrowser import FileBrowserWindow
from .help_window import HelpWindow
from .settings_window import SettingsWindow
import alimaster
class MainWindow():
"""
The mai... | lgpl-3.0 |
omarkhan/opencraft | instance/serializers/logentry.py | 1 | 1352 | # -*- coding: utf-8 -*-
#
# OpenCraft -- tools to aid developing and hosting free software projects
# Copyright (C) 2015 OpenCraft <xavier@opencraft.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Soft... | agpl-3.0 |
2015fallproject/2015fallcase2 | static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_memoryio.py | 25 | 26610 | """Unit tests for memory-based file-like objects.
StringIO -- for unicode strings
BytesIO -- for bytes
"""
import unittest
from test import support
import io
import _pyio as pyio
import pickle
class MemorySeekTestMixin:
def testInit(self):
buf = self.buftype("1234567890")
bytesIo = self.ioclass(... | agpl-3.0 |
polyaxon/polyaxon-api | polyaxon_lib/libs/decorators.py | 1 | 1178 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import six
from functools import wraps, WRAPPER_ASSIGNMENTS
import tensorflow as tf
class TfTemplate(object):
"""This decorator wraps a method with `tf.make_template`. For example,
Examples:
```python
>>> @tf_... | mit |
zaydhach/PyBotWarPro | libs/jython/Lib/distutils/archive_util.py | 7 | 6179 | """distutils.archive_util
Utility functions for creating archive files (tarballs, zip files,
that sort of thing)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import os
from distutils.errors import DistutilsExecError
from distutils.spawn import spawn
from distutils.dir_util impo... | gpl-2.0 |
UFAL-DSG/cloud-asr | tests/test_batch_recognition.py | 1 | 2520 | import os
import json
import time
import urllib2
import StringIO
import unittest
from jsonschema import validate
class TestBatchRecognition(unittest.TestCase):
def setUp(self):
time.sleep(1)
def test_batch_recognition(self):
response = self.get_response_for_wav()
self.assertResponse... | apache-2.0 |
prefetchnta/questlab | bin/x64bin/python/36/Lib/multiprocessing/semaphore_tracker.py | 1 | 5551 | #
# On Unix we run a server process which keeps track of unlinked
# semaphores. The server ignores SIGINT and SIGTERM and reads from a
# pipe. Every other process of the program has a copy of the writable
# end of the pipe, so we get EOF when all other processes have exited.
# Then the server process unlinks any ... | lgpl-2.1 |
drybjed/ansible-modules-extras | cloud/cloudstack/cs_account.py | 14 | 12533 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Renรฉ Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
DFO-Ocean-Navigator/Ocean-Data-Map-Project | scripts/drifter_process.py | 1 | 11800 | #!env python
'''
Reads in the raw data from the Joubeh ftp site and compiles the separate files
into one file per drifter
'''
import os
import re
import pandas as pd
import numpy as np
from netCDF4 import Dataset
from datetime import datetime
import time
import geopy
import geopy.distance
from scipy import interpolate... | gpl-3.0 |
undoware/neutron-drive | neutron-drive/django/contrib/staticfiles/handlers.py | 85 | 2316 | import urllib
from urlparse import urlparse
from django.conf import settings
from django.core.handlers.wsgi import WSGIHandler
from django.contrib.staticfiles import utils
from django.contrib.staticfiles.views import serve
class StaticFilesHandler(WSGIHandler):
"""
WSGI middleware that intercepts calls to th... | bsd-3-clause |
Endika/sale-workflow | sale_payment_term_interest/__openerp__.py | 15 | 1227 | # -*- coding: utf-8 -*-
#
#
# Authors: Guewen Baconnier
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Licens... | agpl-3.0 |
wenkaiqiu/petal | uniform_model/templates/template_manager.py | 1 | 2524 | import logging
from itertools import chain
from uniform_model.templates.other import OtherTemplate
from uniform_model.templates.processor import ProcessorTemplate
from uniform_model.templates.storage import StorageTemplate
from .chassis import ChassisTemplate
from .switch import SwitchTemplate
logging.basicConfig(for... | bsd-3-clause |
roofit-dev/parallel-roofit-scripts | profiling/vincemark/analyze_c.py | 1 | 11894 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: Patrick Bos
# @Date: 2016-11-16 16:23:55
# @Last Modified by: E. G. Patrick Bos
# @Last Modified time: 2017-06-28 14:49:23
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from pathlib import Path
import itertool... | apache-2.0 |
fayf/pyload | module/plugins/PluginManager.py | 26 | 13427 | # -*- coding: utf-8 -*-
"""
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 option) any later version.
This program is distributed in... | gpl-3.0 |
Tianhao-Gu/kb_uploadmethods | lib/installed_clients/KBaseFeatureValuesServiceClient.py | 2 | 63225 | # -*- coding: utf-8 -*-
############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
############################################################
from __future__ import print_function
# the following is a hack to get the basec... | mit |
stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/GL/feedback.py | 9 | 3420 | """Utility module to parse a Feedback buffer"""
from OpenGL import contextdata
from OpenGL.GL.VERSION import GL_1_1 as _simple
def parseFeedback( buffer, entryCount ):
"""Parse the feedback buffer into Python object records"""
bufferIndex = 0
result = []
getVertex = createGetVertex( )
while bufferI... | lgpl-3.0 |
dhalleine/tensorflow | tensorflow/python/kernel_tests/template_test.py | 1 | 9074 | # 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 |
helldorado/ansible | lib/ansible/modules/cloud/webfaction/webfaction_site.py | 44 | 6530 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Quentin Stafford-Fraser
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Create Webfaction website using Ansible and the Webfaction API
from __future__ import absolute_import, division, print_function
__met... | gpl-3.0 |
faegi/mapproxy | mapproxy/seed/cachelock.py | 5 | 3758 | # This file is part of the MapProxy project.
# Copyright (C) 2012 Omniscale <http://omniscale.de>
#
# 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... | apache-2.0 |
M4sse/chromium.src | third_party/closure_linter/closure_linter/closurizednamespacesinfo_test.py | 109 | 23362 | #!/usr/bin/env python
#
# Copyright 2010 The Closure Linter 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
#... | bsd-3-clause |
donutmonger/youtube-dl | setup.py | 107 | 3233 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os.path
import warnings
import sys
try:
from setuptools import setup
setuptools_available = True
except ImportError:
from distutils.core import setup
setuptools_available = False
try:
# This will create an... | unlicense |
EricCline/CEM_inc | env/lib/python2.7/site-packages/IPython/html/widgets/tests/test_interaction.py | 2 | 12804 | """Test interact and interactive."""
#-----------------------------------------------------------------------------
# Copyright (C) 2014 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#---------------... | mit |
bussiere/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/test/test_compiler.py | 112 | 11233 | import test.test_support
compiler = test.test_support.import_module('compiler', deprecated=True)
from compiler.ast import flatten
import os, sys, time, unittest
from random import random
from StringIO import StringIO
# How much time in seconds can pass before we print a 'Still working' message.
_PRINT_WORKING_MSG_INTE... | mit |
abartlet/samba-old | selftest/selftest.py | 2 | 16719 | #!/usr/bin/python -u
# Bootstrap Samba and run a number of tests against it.
# Copyright (C) 2005-2012 Jelmer Vernooij <jelmer@samba.org>
# Copyright (C) 2007-2009 Stefan Metzmacher <metze@samba.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | gpl-3.0 |
mattclark/osf.io | osf_tests/test_search_views.py | 6 | 15195 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest
from nose.tools import * # noqa: F403
from osf_tests import factories
from tests.base import OsfTestCase
from website.util import api_url_for
from website.views import find_bookmark_collection
@... | apache-2.0 |
dannyperry571/theapprentice | script.module.beautifulsoup4/lib/bs4/tests/test_soup.py | 272 | 17391 | # -*- coding: utf-8 -*-
"""Tests of Beautiful Soup as a whole."""
import logging
import unittest
import sys
import tempfile
from bs4 import (
BeautifulSoup,
BeautifulStoneSoup,
)
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
SoupStrainer,
NamespacedAttribute,
... | gpl-2.0 |
quantwizard-com/pythonbacktest | pythonbacktest/visualization/abstractdatavisualization.py | 1 | 1666 | import abc
class AbstractDataVisualization(object):
def __init__(self):
self.__indicators_history = None
self.__indicators_name_collections = None
self.__recorded_transaction_names = []
self.__trade_transactions = {}
def add_indicators_history(self, indicators_history, *indi... | apache-2.0 |
tdtrask/ansible | lib/ansible/plugins/lookup/csvfile.py | 22 | 4790 | # (c) 2013, Jan-Piet Mens <jpmens(at)gmail.com>
# (c) 2017 Ansible Project
# 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
DOCUMENTATION = """
lookup: csvfile
author: Jan-Piet Me... | gpl-3.0 |
kbkpbot/K860i_kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
petrus-v/odoo | addons/lunch/wizard/lunch_validation.py | 440 | 1296 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
rsheftel/pandas_market_calendars | tests/test_eurex_calendar.py | 1 | 1290 | import pandas as pd
import pytz
from pandas_market_calendars.exchange_calendar_eurex import EUREXExchangeCalendar
def test_time_zone():
assert EUREXExchangeCalendar().tz == pytz.timezone('Europe/Berlin')
assert EUREXExchangeCalendar().name == 'EUREX'
def test_2016_holidays():
# good friday: 2016-03-25
... | mit |
wimnat/ansible | lib/ansible/module_utils/facts/network/nvme.py | 92 | 1999 | # NVMe initiator related facts collection for Ansible.
#
# 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 la... | gpl-3.0 |
hfp/tensorflow-xsmm | tensorflow/python/kernel_tests/summary_v1_ops_test.py | 36 | 4072 | # 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 |
wulin9005/cocosbuilder | CocosBuilder/libs/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 151 | 1920 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | mit |
CouchPotato/CouchPotatoV1 | cherrypy/_cpmodpy.py | 82 | 11201 | """Native adapter for serving CherryPy via mod_python
Basic usage:
##########################################
# Application in a module called myapp.py
##########################################
import cherrypy
class Root:
@cherrypy.expose
def index(self):
return 'Hi there, Ho there, Hey there'
# ... | gpl-3.0 |
kennedyshead/home-assistant | tests/components/gree/test_switch.py | 2 | 3275 | """Tests for gree component."""
from greeclimate.exceptions import DeviceTimeoutError
from homeassistant.components.gree.const import DOMAIN as GREE_DOMAIN
from homeassistant.components.switch import DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_FRIENDLY_NAME,
SERVICE_TOGGLE,
SERVICE_TU... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.