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 |
|---|---|---|---|---|---|
tiborsimko/invenio-demosite | invenio_demosite/testsuite/regression/test_oai_harvest_admin.py | 7 | 2804 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio Demosite.
# Copyright (C) 2009, 2010, 2011, 2012 CERN.
#
# Invenio Demosite 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
# Li... | gpl-2.0 |
ZhaoCJ/django | django/contrib/gis/geoip/base.py | 5 | 11128 | import os
import re
from ctypes import c_char_p
from django.core.validators import ipv4_re
from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS
from django.contrib.gis.geoip.prototypes import (
GeoIPRecord, GeoIPTag, GeoIP_open, GeoIP_delete, GeoIP_database_info,
GeoIP_lib_version, GeoIP_record_by_addr... | bsd-3-clause |
bcesarg6/ccuem_bot | game.py | 2 | 3993 | #-*- coding: utf-8 -*-
#Lógica do game
import comandos as c
import bds
from emojis import *
def cancelarJogo(chat_id, u_id):
l = c.getLanguage(chat_id)
if bds.checkAdm(chat_id, u_id):
bds.delGame(chat_id)
keyboard = c.makeKb(c.getKb(chat_id, 'main')[0], resize_keyboard = True)
return [... | apache-2.0 |
dulems/hue | desktop/core/ext-py/Django-1.6.10/django/conf/locale/de_CH/formats.py | 118 | 1448 | # -*- 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
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DA... | apache-2.0 |
addition-it-solutions/project-all | addons/hr_gamification/models/gamification.py | 388 | 4836 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
vmindru/ansible | lib/ansible/plugins/lookup/grafana_dashboard.py | 36 | 6300 | # (c) 2018 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'... | gpl-3.0 |
popazerty/e2 | lib/python/Components/Converter/ClockToText.py | 4 | 3347 | from Converter import Converter
from time import localtime, strftime
from Components.Element import cached
class ClockToText(Converter, object):
DEFAULT = 0
WITH_SECONDS = 1
IN_MINUTES = 2
DATE = 3
FORMAT = 4
AS_LENGTH = 5
TIMESTAMP = 6
FULL = 7
SHORT_DATE = 8
LONG_DATE = 9
VFD = 10
AS_LENGTHHOURS = 11
AS... | gpl-2.0 |
oscardagrach/linux | 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 |
tchellomello/home-assistant | homeassistant/components/geofency/device_tracker.py | 7 | 4237 | """Support for the Geofency device tracker platform."""
import logging
from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE
from homeassistant.core import callback... | apache-2.0 |
drexly/tonginBlobStore | lib/django/contrib/auth/checks.py | 374 | 2098 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.core import checks
def check_user_model(**kwargs):
errors = []
cls = apps.get_model(settings.AUTH_USER_MODEL)
# Check that REQUIRED_FIELDS is a list
if not isins... | bsd-3-clause |
UKTradeInvestment/export-wins-data | mi/tests/test_sector_team_months.py | 1 | 55916 | import datetime
import json
from django.urls import reverse
from freezegun import freeze_time
from mi.models import FinancialYear
from mi.tests.base_test_case import MiApiViewsBaseTestCase
from mi.tests.test_sector_views import SectorTeamBaseTestCase
from mi.utils import month_iterator
@freeze_time(datetime.dateti... | gpl-3.0 |
hfvaldesg/neltume | audio.py | 1 | 5384 | import subprocess
import time
# sound of start up
def startup():
opt = 'audio/startup.mp3'
audio_menu = subprocess.Popen(['mpg123', '-q', opt], stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()
# time.sleep(0.5)
# sound of the intro
def intro_audio(x):
if x == 0:
for i in range... | mit |
adykstra/mne-python | examples/preprocessing/plot_shift_evoked.py | 29 | 1245 | """
==================================
Shifting time-scale in evoked data
==================================
"""
# Author: Mainak Jas <mainak@neuro.hut.fi>
#
# License: BSD (3-clause)
import matplotlib.pyplot as plt
import mne
from mne.viz import tight_layout
from mne.datasets import sample
print(__doc__)
data_path... | bsd-3-clause |
shanot/imp | modules/cnmultifit/test/test_param.py | 1 | 1887 | import IMP
import IMP.test
import IMP.cnmultifit
import os
from IMP.cnmultifit import param
class Tests(IMP.test.TestCase):
def test_param_help(self):
"""Test param module help"""
self.check_runnable_python_module("IMP.cnmultifit.param")
def test_param_usage(self):
"""Test param modu... | gpl-3.0 |
vibhorag/scikit-learn | sklearn/cluster/bicluster.py | 211 | 19443 | """Spectral biclustering algorithms.
Authors : Kemal Eren
License: BSD 3 clause
"""
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.sparse import dia_matrix
from scipy.sparse import issparse
from . import KMeans, MiniBatchKMeans
from ..base import BaseEstimator, BiclusterMixin
from ..external... | bsd-3-clause |
garwynn/L900_3.9_Experiment | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
ahmadio/edx-platform | common/test/acceptance/tests/lms/test_learner_profile.py | 17 | 31839 | # -*- coding: utf-8 -*-
"""
End-to-end tests for Student's Profile Page.
"""
from flaky import flaky
from contextlib import contextmanager
from datetime import datetime
from bok_choy.web_app_test import WebAppTest
from nose.plugins.attrib import attr
from ...pages.common.logout import LogoutPage
from ...pages.lms.acc... | agpl-3.0 |
LeeKamentsky/CellProfiler | cellprofiler/modules/tests/test_calculateimageoverlap.py | 2 | 42813 | '''test_calculateimageoverlap - test the CalculateImageOverlap module
CellProfiler is distributed under the GNU General Public License.
See the accompanying file LICENSE for details.
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2015 Broad Institute
Please see the AUTHORS file for ... | gpl-2.0 |
HanyuWorm/volatility | volatility/plugins/mac/psaux.py | 45 | 1804 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
devsarr/ONLYOFFICE-OnlineEditors | ActiveX/Common/DocxFormat/Source/XML/libxml2/XML/python/libxml.py | 14 | 24421 | import libxml2mod
import types
import sys
# The root of all libxml2 errors.
class libxmlError(Exception): pass
# Type of the wrapper class for the C objects wrappers
def checkWrapper(obj):
try:
n = type(_obj).__name__
if n != 'PyCObject' and n != 'PyCapsule':
return 1
except:
... | agpl-3.0 |
xkcd1253/SocialNetworkforTwo | flask/lib/python2.7/site-packages/flask/templating.py | 48 | 4595 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... | gpl-2.0 |
mantidproject/mantid | scripts/directtools/_validate.py | 3 | 1564 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
de... | gpl-3.0 |
cloudbau/cinder | cinder/volume/flows/base.py | 3 | 2230 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 Yahoo! 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.or... | apache-2.0 |
Exceltior/dogecoin | qa/rpc-tests/listtransactions.py | 145 | 6081 | #!/usr/bin/env python
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
# Add python-bitcoinrpc to module search path:
import os
import sys
sy... | mit |
dudochkin-victor/telepathy-yell | tools/glib-interfaces-gen.py | 14 | 6210 | #!/usr/bin/python
from sys import argv, stdout, stderr
import xml.dom.minidom
from libglibcodegen import NS_TP, get_docstring, \
get_descendant_text, get_by_path
class Generator(object):
def __init__(self, prefix, implfile, declfile, dom):
self.prefix = prefix + '_'
assert declfile.endsw... | lgpl-2.1 |
jadref/buffer_bci | python/probedMovements_psychoPy/Free_Matsuhashi.py | 2 | 9596 | # import necessary libraries from Psychopy and buffer_bci-master
from psychopy import visual, core, event, gui, sound, data, monitors
from random import shuffle
import numpy as np
import struct, sys, time
sys.path.append("../../dataAcq/buffer/python/")
import FieldTrip
# ************** Set up buffer connection... | gpl-3.0 |
iwm911/plaso | plaso/parsers/bsm_test.py | 1 | 8160 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# 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 L... | apache-2.0 |
willthames/ansible | lib/ansible/plugins/action/package.py | 31 | 2900 | # (c) 2015, Ansible 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 di... | gpl-3.0 |
willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/Bitly/Links/ShortenURL.py | 1 | 3516 | # -*- coding: utf-8 -*-
###############################################################################
#
# ShortenURL
# Returns a shortened URL for a long URL that you provide.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you m... | gpl-2.0 |
srinathv/bokeh | bokeh/server/zmq/forwarder.py | 13 | 1318 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... | bsd-3-clause |
guilhermetavares/django-debug-toolbar | tests/settings.py | 8 | 1848 | """Django settings for tests."""
import os
import django
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
SECRET_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
INTERNAL_IPS = ['127.0.0.1']
# Application definition
INSTALLED_APPS = [
'django.... | bsd-3-clause |
carolinux/QGIS | python/plugins/processing/modeler/ModelerAlgorithmProvider.py | 12 | 4201 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ModelerAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**************... | gpl-2.0 |
jdrusso/last_letter | last_letter/scripts/gyroscope.py | 2 | 4760 | #!/usr/bin/env python
import roslib
import sys
import rospy
from geometry_msgs.msg import Vector3, Vector3Stamped
import numpy as np
from uav_utils import ThermalRise
from mathutils import saturation, quat2Reb
from math import floor, exp
from last_letter.msg import SimStates, SimSensor3, Environment
#################... | gpl-3.0 |
tgianos/zerotodocker | security_monkey/0.3.4/security_monkey-scheduler/config-deploy.py | 6 | 1385 | # Insert any config items here.
# This will be fed into Flask/SQLAlchemy inside security_monkey/__init__.py
LOG_LEVEL = "DEBUG"
LOG_FILE = "/var/log/security_monkey/security_monkey-deploy.log"
SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:securitymonkeypassword@postgres:5432/secmonkey'
SQLALCHEMY_POOL_SIZE = 50
S... | apache-2.0 |
jotes/boto | boto/route53/record.py | 136 | 14689 | # Copyright (c) 2010 Chris Moyer http://coredumped.org/
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation ... | mit |
simbuerg/benchbuild | benchbuild/utils/actions.py | 1 | 11516 | """
This defines classes that can be used to implement a series of Actions.
"""
from benchbuild.settings import CFG
from benchbuild.utils.db import persist_experiment
from benchbuild.utils.run import GuardedRunException
from plumbum import local
from benchbuild.utils.cmd import mkdir, rm, rmdir
from plumbum import Pro... | mit |
rdqw/sscoin | qa/rpc-tests/disablewallet.py | 41 | 1156 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Exercise API with -disablewallet.
#
from test_framework.test_framework import BitcoinTestFramework
f... | mit |
w1ll1am23/home-assistant | homeassistant/components/tesla/binary_sensor.py | 14 | 1164 | """Support for Tesla binary sensor."""
from homeassistant.components.binary_sensor import DEVICE_CLASSES, BinarySensorEntity
from . import DOMAIN as TESLA_DOMAIN, TeslaDevice
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the Tesla binary_sensors by config_entry."""
async_add... | apache-2.0 |
samarthmed/emacs-config | .python-environments/default/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py | 1783 | 19590 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-2.0 |
trdean/grEME | gr-digital/examples/run_length.py | 87 | 2389 | #!/usr/bin/env python
#
# Copyright 2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... | gpl-3.0 |
PearsonIOKI/compose-forum | askbot/migrations/0127_save_category_tree_as_json.py | 13 | 30228 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.utils import simplejson
from django.db import models
from askbot.conf import settings as askbot_settings
def get_subtree(tree, path):
"""#this might be simpler, but not tested
clevel = tree
for st... | gpl-3.0 |
lino-framework/book | lino_book/projects/avanti1/tests/test_nullchar.py | 2 | 2585 | # -*- coding: utf-8 -*-
# Copyright 2017-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""
Tests some behaviour of the `Client.national_id` field.
You can run only these tests by issuing::
$ go adg
$ python manage.py test tests.test_nullchar
Tests whether `national_id` is set to NULL (not em... | bsd-2-clause |
Zac-HD/home-assistant | homeassistant/loader.py | 4 | 9195 | """
Provides methods for loading Home Assistant components.
This module has quite some complex parts. I have tried to add as much
documentation as possible to keep it understandable.
Components are loaded by calling get_component('switch') from your code.
If you want to retrieve a platform that is part of a component... | apache-2.0 |
eickenberg/scikit-learn | sklearn/metrics/tests/test_regression.py | 5 | 2825 | from __future__ import division, print_function
import numpy as np
from itertools import product
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.metri... | bsd-3-clause |
papados/ordersys | Lib/_abcoll.py | 218 | 14672 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... | unlicense |
crichardson17/starburst_atlas | SFH_comparison/data/Padova_inst/padova_inst_0/fullgrid/peaks_reader.py | 1 | 5057 | import csv
import matplotlib.pyplot as plt
from numpy import *
import scipy.interpolate
import math
from pylab import *
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import matplotlib.patches as patches
from matplotlib.path import Path
import os
# ---------------------------------------------------... | gpl-2.0 |
maggrey/cherrymusic | cherrymusicserver/configuration.py | 4 | 37944 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# CherryMusic - a standalone music server
# Copyright (c) 2012 - 2014 Tom Wallroth & Tilman Boerner
#
# Project page:
# http://fomori.org/cherrymusic/
# Sources on github:
# http://github.com/devsnd/cherrymusic/
#
# CherryMusic is based on
# jPlayer (GPL/MIT licens... | gpl-3.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/pandas/util/terminal.py | 16 | 3559 | """
get_terminal_size() -- return width and height of terminal as a tuple
code from:
http://stackoverflow.com/questions/566746/how-to-get-console- window-width-in-
python
written by
Harco Kuppens (http://stackoverflow.com/users/825214/harco-kuppens)
It is mentioned in the stackoverflow response that this code works
... | mit |
brad-kaiser/spark | examples/src/main/python/ml/naive_bayes_example.py | 123 | 2017 | #
# 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 |
PandaWei/tp-qemu | qemu/tests/cpuinfo_query.py | 9 | 1051 | from autotest.client.shared import error, utils
from virttest import utils_misc
@error.context_aware
def run(test, params, env):
"""
cpuinfo query test:
1). run query cmd. e.g -cpu ?cpuid
2). check the expected info is inclued in the cmd output.
3). raise error if defined info is missing.
"""... | gpl-2.0 |
barbour-em/osf.io | scripts/tests/test_osfstorage_oldels.py | 51 | 5506 | import mock
from modularodm import Q
from framework.auth import Auth
from tests.base import OsfTestCase
from tests.factories import ProjectFactory
from website.addons.osfstorage import model
from website.addons.osfstorage import utils
from website.addons.osfstorage import oldels
from scripts.osfstorage import migr... | apache-2.0 |
pathompongoo/ThGovJobApp | env/lib/python2.7/site-packages/setuptools/tests/test_markerlib.py | 449 | 2506 | import os
import unittest
from setuptools.tests.py26compat import skipIf
try:
import ast
except ImportError:
pass
class TestMarkerlib(unittest.TestCase):
@skipIf('ast' not in globals(),
"ast not available (Python < 2.6?)")
def test_markers(self):
from _markerlib import interpret, defa... | gpl-3.0 |
legalsylvain/OpenUpgrade | openerp/addons/base/tests/test_orm.py | 37 | 16485 | from collections import defaultdict
from openerp.tools import mute_logger
from openerp.tests import common
UID = common.ADMIN_USER_ID
DB = common.DB
class TestORM(common.TransactionCase):
""" test special behaviors of ORM CRUD functions
TODO: use real Exceptions types instead of Exception """
d... | agpl-3.0 |
hahalml/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Platform/__init__.py | 61 | 9379 | """SCons.Platform
SCons platform selection.
This looks for modules that define a callable object that can modify a
construction environment as appropriate for a given platform.
Note that we take a more simplistic view of "platform" than Python does.
We're looking for a single string that determines a set of
tool-ind... | apache-2.0 |
denisff/python-for-android | python3-alpha/python3-src/Tools/scripts/untabify.py | 49 | 1298 | #! /usr/bin/env python3
"Replace tabs with spaces in argument files. Print names of changed files."
import os
import sys
import getopt
import tokenize
def main():
tabsize = 8
try:
opts, args = getopt.getopt(sys.argv[1:], "t:")
if not args:
raise getopt.error("At least one file ar... | apache-2.0 |
PythonNut/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/filters/inject_meta_charset.py | 1730 | 2746 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
def __iter__(self):
state = "pre_head"
meta_found = (self.enco... | mpl-2.0 |
franklai/lyric-get | lyric_engine/modules/evesta.py | 1 | 2169 | import logging
from utils import common
from utils.lyric_base import LyricBase
site_class = 'Evesta'
site_index = 'evesta'
site_keyword = 'evesta'
site_url = 'http://lyric.evesta.jp'
test_url = 'http://lyric.evesta.jp/l7bb423.html'
class Evesta(LyricBase):
def parse_page(self):
url = self.url
h... | mit |
fdupoux/ansible | contrib/inventory/apache-libcloud.py | 151 | 11756 | #!/usr/bin/env python
# (c) 2013, Sebastien Goasguen <runseb@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 ... | gpl-3.0 |
pyfa-org/eos | tests/integration/source_switch/source_switch/test_side_effect.py | 1 | 5038 | # ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | lgpl-3.0 |
x303597316/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/maps/google/gmap.py | 174 | 9102 | from django.conf import settings
from django.template.loader import render_to_string
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.six.moves import xrange
from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker
class GoogleMapExcepti... | apache-2.0 |
bennojoy/ansible | test/units/playbook/test_playbook.py | 17 | 2231 | # (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 |
mshafiq9/django | tests/utils_tests/test_feedgenerator.py | 163 | 4306 | from __future__ import unicode_literals
import datetime
import unittest
from django.utils import feedgenerator
from django.utils.timezone import get_fixed_timezone
class FeedgeneratorTest(unittest.TestCase):
"""
Tests for the low-level syndication feed framework.
"""
def test_get_tag_uri(self):
... | bsd-3-clause |
kyvinh/home-assistant | homeassistant/components/binary_sensor/modbus.py | 28 | 1774 | """
Support for Modbus Coil sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.modbus/
"""
import logging
import voluptuous as vol
import homeassistant.components.modbus as modbus
from homeassistant.const import CONF_NAME
from homeass... | apache-2.0 |
astrocatalogs/supernovae | tasks/ptf.py | 1 | 3899 | """Import tasks for the Palomar Transient Factory (PTF).
"""
import os
from astrocats.catalog.utils import is_number, pbar
from bs4 import BeautifulSoup
from ..supernova import SUPERNOVA
def do_ptf(catalog):
# response =
# urllib.request.urlopen('http://wiserep.weizmann.ac.il/objects/list')
# bs = Beaut... | mit |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/idlelib/ReplaceDialog.py | 28 | 6641 | from Tkinter import *
from idlelib import SearchEngine
from idlelib.SearchDialogBase import SearchDialogBase
import re
def replace(text):
root = text._root()
engine = SearchEngine.get(root)
if not hasattr(engine, "_replacedialog"):
engine._replacedialog = ReplaceDialog(root, engine)
dialog = ... | gpl-2.0 |
neilLasrado/frappe | frappe/website/doctype/blog_post/test_blog_post.py | 15 | 1037 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.tests.test_website import set_request
from frappe.website.render import render
class TestBlogPost(unittest.TestCase):
def test_generato... | mit |
yuquanshan/customizedMesos | src/python/cli/src/mesos/http.py | 21 | 1629 | #!/usr/bin/env python
# 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
# "L... | apache-2.0 |
broferek/ansible | lib/ansible/modules/cloud/cloudstack/cs_physical_network.py | 13 | 14676 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, Netservers Ltd. <support@netservers.co.uk>
# 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': ... | gpl-3.0 |
chrisjaquet/FreeCAD | src/Mod/Sandbox/Init.py | 54 | 1955 | # FreeCAD init script of the Sandbox module
# (c) 2001 Juergen Riegel
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This f... | lgpl-2.1 |
dineshram/linux-media-si4713USBDriver | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/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 |
tfroehlich82/erpnext | erpnext/patches/v7_0/update_mode_of_payment_type.py | 52 | 1299 | from __future__ import unicode_literals
import frappe
from frappe.utils import flt
def execute():
frappe.reload_doc('accounts', 'doctype', 'mode_of_payment')
frappe.db.sql(""" update `tabMode of Payment` set type = 'Cash' where (type is null or type = '') and name = 'Cash'""")
for data in frappe.db.sql("""select ... | gpl-3.0 |
Som-Energia/cchloader | cchloader/parsers/parser.py | 1 | 1134 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import re
from cchloader import logger
from cchloader.exceptions import ParserNotFoundException
_PARSERS = {
}
def register(cls):
"""Register a parser
:type cls: Parser class
"""
module = cls.__module__
... | gpl-3.0 |
SimonSapin/servo | tests/wpt/web-platform-tests/tools/third_party/atomicwrites/atomicwrites/__init__.py | 52 | 5965 | import contextlib
import os
import sys
import tempfile
try:
import fcntl
except ImportError:
fcntl = None
__version__ = '1.1.5'
PY2 = sys.version_info[0] == 2
text_type = unicode if PY2 else str # noqa
def _path_to_unicode(x):
if not isinstance(x, text_type):
return x.decode(sys.getfilesyste... | mpl-2.0 |
google-research/google-research | cnn_quantization/tf_cnn_benchmarks/test_data/create_cifar10_test_data.py | 1 | 2409 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | apache-2.0 |
u0m3/gr-baz | python/message_server.py | 4 | 5683 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# message_server.py
#
# Copyright 2013 Balint Seeber <balint@crawfish>
#
# 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... | gpl-3.0 |
stephanie-wang/ray | python/ray/setup-dev.py | 1 | 2356 | #!/usr/bin/env python
"""This script allows you to develop RLlib without needing to compile Ray."""
import argparse
import click
import os
import subprocess
import ray
def do_link(package, force=False, local_path=""):
package_home = os.path.abspath(
os.path.join(ray.__file__, "../{}".format(package)))
... | apache-2.0 |
newerthcom/savagerebirth | libs/python-2.72/Lib/encodings/euc_jis_2004.py | 816 | 1051 | #
# euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('euc_jis_2004')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(m... | gpl-2.0 |
felipenaselva/felipe.repository | script.module.urlresolver/lib/urlresolver/plugins/watchers.py | 4 | 1798 | """
OVERALL CREDIT TO:
t0mm0, Eldorado, VOINAGE, BSTRDMKR, tknorris, smokdpi, TheHighway
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free So... | gpl-2.0 |
OTWillems/GEO1005 | SpatialDecision/external/networkx/algorithms/tests/test_dominance.py | 49 | 6847 | import networkx as nx
from nose.tools import *
class TestImmediateDominators(object):
def test_exceptions(self):
G = nx.Graph()
G.add_node(0)
assert_raises(nx.NetworkXNotImplemented, nx.immediate_dominators, G, 0)
G = nx.MultiGraph(G)
assert_raises(nx.NetworkXNotImplemente... | gpl-2.0 |
Richi91/nntools | lasagne/utils.py | 4 | 9388 | import numpy as np
import theano
import theano.tensor as T
def floatX(arr):
"""Converts data to a numpy array of dtype ``theano.config.floatX``.
Parameters
----------
arr : array_like
The data to be converted.
Returns
-------
numpy ndarray
The input array in the ``floatX... | mit |
weka-io/boto | boto/cognito/sync/__init__.py | 128 | 1675 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | mit |
techtonik/numpy | numpy/f2py/tests/test_return_complex.py | 69 | 4672 | from __future__ import division, absolute_import, print_function
from numpy.testing import *
from numpy import array
from numpy.compat import long
import util
class TestReturnComplex(util.F2PyTest):
def check_function(self, t):
tname = t.__doc__.split()[0]
if tname in ['t0', 't8', 's0', 's8']:
... | bsd-3-clause |
ltiao/networkx | examples/drawing/atlas.py | 54 | 2609 | #!/usr/bin/env python
"""
Atlas of all graphs of 6 nodes or less.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
# Copyright (C) 2004 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx... | bsd-3-clause |
pszemus/grpc | tools/line_count/collect-history.py | 27 | 1442 | #!/usr/bin/env python
# Copyright 2017 gRPC authors.
#
# 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 o... | apache-2.0 |
cancro7/gem5 | util/style/repo.py | 11 | 9560 | #!/usr/bin/env python
#
# Copyright (c) 2016 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementatio... | bsd-3-clause |
AntidoteLabs/Antidote-DM | Antidotes DM/youtube_dl/extractor/googlesearch.py | 168 | 1699 | from __future__ import unicode_literals
import itertools
import re
from .common import SearchInfoExtractor
from ..compat import (
compat_urllib_parse,
)
class GoogleSearchIE(SearchInfoExtractor):
IE_DESC = 'Google Video search'
_MAX_RESULTS = 1000
IE_NAME = 'video.google:search'
_SEARCH_KEY = 'g... | gpl-2.0 |
rupran/ansible | lib/ansible/modules/network/nxos/nxos_vxlan_vtep.py | 21 | 13085 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
kudlav/dnf | dnf/pycomp.py | 3 | 2953 | # pycomp.py
# Python 2 and Python 3 compatibility module
#
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
... | gpl-2.0 |
40423127/2017springcd_hw | plugin/liquid_tags/video.py | 296 | 2360 | """
Video Tag
---------
This implements a Liquid-style video tag for Pelican,
based on the octopress video tag [1]_
Syntax
------
{% video url/to/video [width height] [url/to/poster] %}
Example
-------
{% video http://site.com/video.mp4 720 480 http://site.com/poster-frame.jpg %}
Output
------
<video width='720' hei... | agpl-3.0 |
ClovisIRex/Snake-django | env/lib/python3.6/site-packages/pylint/test/regrtest_data/huge.py | 9 | 100798 | a,b=2
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,b=2,3
a,... | mit |
abdullah2891/remo | vendor-local/lib/python/unidecode/x060.py | 250 | 4642 | data = (
'Huai ', # 0x00
'Tai ', # 0x01
'Song ', # 0x02
'Wu ', # 0x03
'Ou ', # 0x04
'Chang ', # 0x05
'Chuang ', # 0x06
'Ju ', # 0x07
'Yi ', # 0x08
'Bao ', # 0x09
'Chao ', # 0x0a
'Min ', # 0x0b
'Pei ', # 0x0c
'Zuo ', # 0x0d
'Zen ', # 0x0e
'Yang ', # 0x0f
'Kou ', # 0x10
... | bsd-3-clause |
samskeller/zeroclickinfo-fathead | lib/fathead/UNCLEAN/parse_sqlserverfunction.py | 1 | 1576 | from BeautifulSoup import BeautifulSoup
import re
import os
import sys
import string
openclosetags = re.compile('''<.*?>|</.*?>''',re.DOTALL)
spaces = re.compile('''\s+''',re.DOTALL)
files = []
for file in os.listdir('./docs/sqlserver/functions/'):
if '.html' in file:
files.append('./docs/sqlserve... | apache-2.0 |
rosmo/ansible | lib/ansible/modules/cloud/azure/azure_rm_postgresqlfirewallrule_facts.py | 17 | 5890 | #!/usr/bin/python
#
# Copyright (c) 2018 Zim Kalinowski, <zikalino@microsoft.com>
#
# 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',
... | gpl-3.0 |
asajeffrey/servo | tests/wpt/web-platform-tests/tools/manifest/download.py | 4 | 6428 | from __future__ import absolute_import
import argparse
import bz2
import gzip
import json
import io
import os
from datetime import datetime, timedelta
from six.moves.urllib.request import urlopen
try:
import zstandard
except ImportError:
zstandard = None
from .utils import git
from . import log
MYPY = Fal... | mpl-2.0 |
bbenko/shinkicker | django/utils/importlib.py | 445 | 1229 | # Taken from Python 2.7 with permission from/by the original author.
import sys
def _resolve_name(name, package, level):
"""Return the absolute name of the module to be imported."""
if not hasattr(package, 'rindex'):
raise ValueError("'package' not set to a string")
dot = len(package)
for x in ... | bsd-3-clause |
radicalbit/ambari | ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py | 3 | 10876 | #!/usr/bin/env python
'''
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")... | apache-2.0 |
oarriaga/single_shot_multibox_detector | src/models/SSD300.py | 1 | 4616 | from keras.layers import Conv2D
from keras.layers import Input
from keras.layers import MaxPooling2D
from keras.layers import ZeroPadding2D
from keras.layers import GlobalAveragePooling2D
from keras.layers import Activation
from keras.models import Model
from .layers import Conv2DNormalization
from .ssd_utils import a... | mit |
frankyao47/open-hackathon | open-hackathon-server/src/hackathon/azureformation/resourceBase.py | 5 | 1611 | # -*- coding: utf-8 -*-
"""
Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
The MIT License (MIT)
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 res... | mit |
diagramsoftware/odoo | addons/crm/res_partner.py | 24 | 5161 | # -*- 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 |
markYoungH/chromium.src | tools/site_compare/site_compare.py | 179 | 6504 | #!/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.
"""SiteCompare component to handle bulk scrapes.
Invokes a list of browsers and sends them to a list of URLs,
saving the rendered ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.