repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
Rasmus7700/Smarthome | plugins/cli/__init__.py | 8 | 7232 | #!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2012-2013 Marcus Popp marcus@popp.mx
#########################################################################
# ... | gpl-3.0 |
jupierce/openshift-tools | scripts/monitoring/cron-send-docker-oc-versions.py | 7 | 3819 | #!/usr/bin/python
'''
Send openshift and docker versions with miq_metric tag to metric_sender
Example:
./cron-send-docker-oc-versions.py
'''
# Disabling invalid-name because pylint doesn't like the naming conention we have.
# pylint: disable=invalid-name,import-error
import json
import os
import sys
import subp... | apache-2.0 |
ClearCorp/odoo-clearcorp | TODO-8.0/account_aged_partner_balance_report/wizard/account_aged_partner_balance_report_wizard.py | 3 | 7106 | # -*- 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 |
nateberman/Python_Koans | python2/koans/about_string_manipulation.py | 73 | 2590 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutStringManipulation(Koan):
def test_use_format_to_interpolate_variables(self):
value1 = 'one'
value2 = 2
string = "The values are {0} and {1}".format(value1, value2)
self.assertEqual(__, string)
... | mit |
danfmsouza/yipservicedesk | includes/fckeditor/editor/filemanager/connectors/py/fckoutput.py | 25 | 3923 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2009 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.or... | gpl-2.0 |
mtholder/peyotl | peyotl/api/treemachine.py | 2 | 14599 | #!/usr/bin/env python
from peyotl.utility import get_config_object, get_logger
from peyotl.api.wrapper import _WSWrapper, APIWrapper
from peyotl.api.study_ref import StudyRef
from peyotl.api.taxon import TaxonWrapper, TaxonHolder
import anyjson
_LOG = get_logger(__name__)
_EMPTY_TUPLE = tuple()
def _treemachine_tax_... | bsd-2-clause |
samarthmed/emacs-config | .python-environments/default/lib/python2.7/site-packages/pip/_vendor/colorama/ansi.py | 442 | 2304 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
OSC = '\033]'
BEL = '\007'
def code_to_chars(code):
return CSI + str(code) + 'm'
class ... | gpl-2.0 |
fedora-conary/rbuild | rbuild_test/unit_test/handletest.py | 2 | 5120 | #!/usr/bin/python
#
# Copyright (c) SAS Institute 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... | apache-2.0 |
AkihikoITOH/capybara | capybara/virtualenv/lib/python2.7/site-packages/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## 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... | mit |
alexlo03/ansible | lib/ansible/modules/notification/mattermost.py | 43 | 4764 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Benjamin Jolivot <bjolivot@gmail.com>
# Inspired by slack module :
# # (c) 2017, Steve Pletcher <steve@steve-pletcher.com>
# # (c) 2016, René Moser <mail@renemoser.net>
# # (c) 2015, Stefan Berggren <nsg@nsg.cc>
# # (c) 2014, Ramon de la Fuente <ramon@delafuente.... | gpl-3.0 |
zengenti/ansible | lib/ansible/modules/monitoring/datadog_monitor.py | 16 | 13293 | #!/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 |
biddisco/VTK | Imaging/Core/Testing/Python/ResliceInterpolationModes.py | 20 | 2894 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# this script tests vtkImageReslice with different interpolation modes
# Image pipeline
reader = vtk.vtkImageReader()
reader.ReleaseDataFlagOff()
reader.SetDataByteOrderToLittleEndian... | bsd-3-clause |
sbmlteam/deviser | generator/base_files/BaseInterfaceFile.py | 1 | 2287 | #!/usr/bin/env python
#
# @file BaseCMakeFile.py
# @brief base class for all interface files to be generated
# @author Frank Bergmann
# @author Sarah Keating
#
# <!--------------------------------------------------------------------------
#
# Copyright (c) 2013-2018 by the California Institute of Technology
# (C... | lgpl-2.1 |
ivanamihalek/tcga | tcga/01_somatic_mutations/026_per_gene_stats.py | 1 | 3818 | #!/usr/bin/python -u
# needed the index on hugoSymbol for this to work with any speed:
#
# This source code is part of tcga, a TCGA processing pipeline, written by Ivana Mihalek.
# Copyright (C) 2014-2016 Ivana Mihalek.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | gpl-3.0 |
40223220/cd0504 | static/Brython3.1.1-20150328-091302/Lib/imp.py | 637 | 9839 | """This module provides the components needed to build your own __import__
function. Undocumented functions are obsolete.
In most cases it is preferred you consider using the importlib module's
functionality over this module.
"""
# (Probably) need to stay in _imp
from _imp import (lock_held, acquire_lock, release_lo... | agpl-3.0 |
camon/Flexget | tests/test_backlog.py | 22 | 1600 | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
class TestBacklog(FlexGetBase):
__yaml__ = """
tasks:
test:
mock:
- {title: 'Test.S01E01.hdtv-FlexGet', description: ''}
set:
description: '{{desc... | mit |
tom-heimbrodt/oeplatform | api/urls.py | 1 | 4527 | from django.conf.urls import url
from api import actions
from api import views
pgsql_qualifier = r"[\w\d_]+"
equal_qualifier = r"[\w\d\s\'\=]"
structures = r'table|sequence'
urlpatterns = [
url(r'^v0/schema/(?P<schema>[\w\d_\s]+)/tables/(?P<table>[\w\d_\s]+)/$', views.Table.as_view()),
url(r'^v0/schema/(?P<sc... | agpl-3.0 |
nan86150/ImageFusion | lib/python2.7/site-packages/pip/_vendor/packaging/version.py | 439 | 11949 | # Copyright 2014 Donald Stufft
#
# 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, so... | mit |
jwjohns/PyMySQL | pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py | 10 | 7789 | #!/usr/bin/env python
from . import dbapi20
import pymysql
from pymysql.tests import base
try:
import unittest2 as unittest
except ImportError:
import unittest
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = pymysql
connect_args = ()
connect_kw_args = base.PyMySQLTestCase.databases[0].cop... | mit |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/4NodeANDES/cantilever_different_Poisson/NumberOfDivision4/PoissonRatio0.35/compare_HDF5_ALL.py | 424 | 3382 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... | cc0-1.0 |
swanndri/ROS-Healthcare-Simulator | se306/src/package1/scripts/status.py | 1 | 10098 | #!/usr/bin/env python
import roslib; roslib.load_manifest('package1')
import std_msgs.msg
import rospy
import Tkinter as tk
import ttk
import database
class StatusGUI(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
#sets the dimensions and settings of thw window
self.geometr... | mit |
gamingrobot/second-sunrise | game/plugins/core/menu/menu.py | 1 | 3648 | from direct.gui.DirectGui import *
import xml.etree.ElementTree as et
class Menu:
"""menu manager"""
def __init__(self, xml):
self.frames = []
self.directObjects = []
self.menuConfigDir = "config/menu/"
self.menuCodeDir = "plugins.core.menu.controllers"
self.currentMenu... | apache-2.0 |
Matt-Deacalion/django | tests/middleware/test_security.py | 291 | 7781 | from django.http import HttpResponse
from django.test import RequestFactory, SimpleTestCase
from django.test.utils import override_settings
class SecurityMiddlewareTest(SimpleTestCase):
@property
def middleware(self):
from django.middleware.security import SecurityMiddleware
return SecurityMid... | bsd-3-clause |
icdishb/scikit-learn | examples/plot_kernel_approximation.py | 262 | 8004 | """
==================================================
Explicit feature map approximation for RBF kernels
==================================================
An example illustrating the approximation of the feature map
of an RBF kernel.
.. currentmodule:: sklearn.kernel_approximation
It shows how to use :class:`RBFSa... | bsd-3-clause |
PhilSk/zulip | zerver/management/commands/export_usermessage_batch.py | 43 | 1977 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
import glob
import logging
import os
import shutil
import tempfi... | apache-2.0 |
papouso/odoo | addons/account_budget/wizard/account_budget_crossovered_report.py | 375 | 2089 | # -*- 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 |
pdelsante/thug | thug/DOM/W3C/HTML/HTMLSelectElement.py | 1 | 1663 | #!/usr/bin/env python
from thug.DOM.W3C.Core.DOMException import DOMException
from .HTMLElement import HTMLElement
from .HTMLOptionsCollection import HTMLOptionsCollection
from .attr_property import attr_property
from .compatibility import thug_long
class HTMLSelectElement(HTMLElement):
selectedIndex = 0
va... | gpl-2.0 |
AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_parameters.py | 6 | 1144 | # 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 ... | mit |
connoranderson/Speechables | mechanize-0.2.5/mechanize/_markupbase.py | 134 | 14399 | # Taken from Python 2.6.4 for use by _sgmllib.py
"""Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the HTMLParser and sgmllib
modules (indirectly, for htmllib as well). It has no documented
public API and should not be used directly.
"""
import re
... | apache-2.0 |
uranusjr/django | tests/file_uploads/tests.py | 45 | 23742 | import base64
import hashlib
import os
import shutil
import sys
import tempfile as sys_tempfile
import unittest
from io import BytesIO, StringIO
from urllib.parse import quote
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.http.multipartparser i... | bsd-3-clause |
theflofly/tensorflow | tensorflow/contrib/seq2seq/python/ops/basic_decoder.py | 6 | 9286 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
KnowNo/reviewboard | docs/releasenotes/conf.py | 3 | 7162 | # -*- coding: utf-8 -*-
#
# Release Notes build configuration file, created by
# sphinx-quickstart on Thu Feb 12 02:10:34 2009.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (m... | mit |
MalloyDelacroix/DownloaderForReddit | DownloaderForReddit/utils/exporters/text_exporter.py | 1 | 2962 | """
Downloader for Reddit takes a list of reddit users and subreddits and downloads content posted to reddit either by the
users or on the subreddits.
Copyright (C) 2017, Kyle Hickey
This file is part of the Downloader for Reddit.
Downloader for Reddit is free software: you can redistribute it and/or modify
it und... | gpl-3.0 |
huggingface/transformers | examples/research_projects/rag-end2end-retriever/lightning_base.py | 1 | 16400 | import argparse
import logging
import os
from pathlib import Path
from typing import Any, Dict
import pytorch_lightning as pl
from pytorch_lightning.plugins.training_type import DDPPlugin
from pytorch_lightning.utilities import rank_zero_info
from transformers import (
AdamW,
AutoConfig,
AutoModel,
Au... | apache-2.0 |
rhenanbartels/hrv | tests/test_filters.py | 1 | 4258 | from unittest import TestCase
import numpy as np
from hrv.filters import moving_average, moving_median, quotient, threshold_filter
from hrv.rri import RRi
class Filter(TestCase):
def test_moving_average_order_3(self):
fake_rri = np.array([810, 830, 860, 790, 804])
rri_filt = moving_average(fake... | bsd-3-clause |
jric/Dumper.py | test.py | 1 | 2916 | from __future__ import print_function
from dumper import dump, dumps, Dumper
import dumper
import io
import sys
buff = io.StringIO()
dumper.default_dumper = Dumper(output=buff)
# BEGIN TEST CASES
def do_dump_scalars():
dump(1)
dump('a')
dump("foo")
dump('''string
with a newline''')
return "1'a''f... | bsd-3-clause |
achang97/YouTunes | lib/python2.7/site-packages/docutils/transforms/peps.py | 10 | 11056 | # $Id: peps.py 7995 2016-12-10 17:50:59Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Transforms for PEP processing.
- `Headers`: Used to transform a PEP's initial RFC-2822 header. It remains a
field list, but some entries get processed.
- ... | mit |
matejcik/weblate | weblate/accounts/tests/test_registration.py | 1 | 10404 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://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, eith... | gpl-3.0 |
partofthething/home-assistant | homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py | 6 | 2354 | """Support for binary sensor using RPi GPIO."""
from pi4ioe5v9xxxx import pi4ioe5v9xxxx
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import DEVICE_DEFAULT_NAME
import homeassistant.helpers.config_validation as cv
CONF_INVERT_L... | mit |
martonw/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/stepsequence.py | 126 | 3584 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | bsd-3-clause |
tudennis/LeetCode---kamyu104-11-24-2015 | Python/number-of-lines-to-write-string.py | 2 | 1935 | # Time: O(n)
# Space: O(1)
# We are to write the letters of a given string S, from left to right into lines.
# Each line has maximum width 100 units, and if writing a letter would cause the width
# of the line to exceed 100 units, it is written on the next line.
# We are given an array widths, an array where widths[0... | mit |
diogocs1/comps | web/addons/l10n_multilang/l10n_multilang.py | 378 | 8428 | # -*- 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... | apache-2.0 |
r39132/airflow | airflow/utils/log/s3_task_handler.py | 3 | 7121 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
raphaelfruneaux/scrapy | scrapy/utils/iterators.py | 93 | 4569 | import re
import csv
import logging
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import six
from scrapy.http import TextResponse, Response
from scrapy.selector import Selector
from scrapy.utils.python import re_rsearch, to_unicode
logger = logging.getLogger(__nam... | bsd-3-clause |
walshjon/openmc | openmc/data/laboratory.py | 3 | 4466 | from collections.abc import Iterable
from numbers import Real, Integral
import numpy as np
import openmc.checkvalue as cv
from openmc.stats import Tabular, Univariate, Discrete, Mixture
from .angle_energy import AngleEnergy
from .function import INTERPOLATION_SCHEME
from .endf import get_tab2_record, get_tab1_record
... | mit |
manevant/django-oscar | src/oscar/apps/basket/admin.py | 37 | 1152 | from django.contrib import admin
from oscar.core.loading import get_model
Line = get_model('basket', 'line')
class LineInline(admin.TabularInline):
model = Line
readonly_fields = ('line_reference', 'product', 'price_excl_tax',
'price_incl_tax', 'price_currency', 'stockrecord')
class ... | bsd-3-clause |
bliz937/kivy | kivy/factory.py | 55 | 5771 | '''
Factory object
==============
The factory can be used to automatically register any class or module
and instantiate classes from it anywhere in your project. It is an
implementation of the
`Factory Pattern <http://en.wikipedia.org/wiki/Factory_pattern>`_.
The class list and available modules are automatically gen... | mit |
wasade/qiita | qiita_pet/handlers/download.py | 2 | 1553 | from tornado.web import authenticated
from os.path import basename
from .base_handlers import BaseHandler
from qiita_pet.exceptions import QiitaPetAuthorizationError
from qiita_db.util import filepath_id_to_rel_path
from qiita_db.meta_util import get_accessible_filepath_ids
class DownloadHandler(BaseHandler):
@... | bsd-3-clause |
MobinRanjbar/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/math.py | 56 | 1068 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | apache-2.0 |
fengshao0907/vitess | py/vtdb/vtdb_logger.py | 10 | 3117 | # Copyright 2014, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
import logging
# VtdbLogger's methods are called whenever something worth noting happens.
# The default behavior of the class is to log using the logging module.
# ... | bsd-3-clause |
YihaoLu/statsmodels | statsmodels/sandbox/regression/ols_anova_original.py | 33 | 10488 | ''' convenience functions for ANOVA type analysis with OLS
Note: statistical results of ANOVA are not checked, OLS is
checked but not whether the reported results are the ones used
in ANOVA
'''
from __future__ import print_function
import numpy as np
#from scipy import stats
from statsmodels.compat.python import lma... | bsd-3-clause |
dblessing/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 |
GoogleCloudPlatform/professional-services | examples/dataflow-production-ready/python/ml_preproc/pipeline/model/data_classes.py | 1 | 1406 | # Copyright 2021 Google LLC
#
# 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 i... | apache-2.0 |
dulems/hue | desktop/core/ext-py/tablib-develop/tablib/formats/_tsv.py | 53 | 1299 | # -*- coding: utf-8 -*-
""" Tablib - TSV (Tab Separated Values) Support.
"""
from tablib.compat import is_py3, csv, StringIO
title = 'tsv'
extensions = ('tsv',)
DEFAULT_ENCODING = 'utf-8'
def export_set(dataset):
"""Returns a TSV representation of Dataset."""
stream = StringIO()
if is_py3:
... | apache-2.0 |
jeiranj/gensim | gensim/utils.py | 4 | 41124 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module contains various general utility functions.
"""
from __future__ import with_statement
import logging
logger = logging... | gpl-3.0 |
onshape-public/onshape-clients | python/onshape_client/oas/models/bt_closed_curve_filter1206.py | 1 | 6979 | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | mit |
kylef/refract.py | refract/elements/primitives.py | 1 | 1663 | from refract.elements.base import Element, Attributes, Metadata
class String(Element):
"""
Refract String Element
>>> String(content='Hello')
"""
element = 'string'
def __init__(self, meta: Metadata = None, attributes: Attributes = None,
content: str = None) -> None:
... | bsd-3-clause |
Nixonite/Chess-RPG | unichess.py | 1 | 1049 | from unicode import *
class UniChess:
def __init__(self):
self._board = [[],[],[],[],[],[],[],[]]
for row in range(2,6):
self._board[row] = ['_']*8
def setup_board(self):
self._board[1] = [uni_chess_pieces['wP']]*8
self._board[6] = [uni_chess_pieces['bP']]*8
self._board[0] = [uni_chess_pieces['wR'],... | gpl-2.0 |
heeraj123/oh-mainline | vendor/packages/twisted/doc/core/examples/mouse.py | 19 | 2392 | #!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Example using MouseMan protocol with the SerialPort transport.
"""
# TODO set tty modes, etc.
# This works for me:
# speed 1200 baud; rows 0; columns 0; line = 0;
# intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D... | agpl-3.0 |
FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/lib2to3/fixes/fix_has_key.py | 39 | 3196 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for has_key().
Calls to .has_key() methods are expressed in terms of the 'in'
operator:
d.has_key(k) -> k in d
CAVEATS:
1) While the primary target of this fixer is dict.has_key(), the
fixer will chan... | gpl-2.0 |
guorendong/iridium-browser-ubuntu | third_party/chromite/lib/gdata_lib_unittest.py | 2 | 36491 | # Copyright (c) 2011 The Chromium OS Authors. 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 gdata_lib module."""
from __future__ import print_function
import getpass
import mox
import re
import atom.service
import gda... | bsd-3-clause |
mitsuhiko/logbook | tests/test_syslog_handler.py | 2 | 2146 | import os
import re
import socket
from contextlib import closing
import logbook
import pytest
UNIX_SOCKET = "/tmp/__unixsock_logbook.test"
DELIMITERS = {
socket.AF_INET: '\n'
}
TO_TEST = [
(socket.AF_INET, socket.SOCK_DGRAM, ('127.0.0.1', 0)),
(socket.AF_INET, socket.SOCK_STREAM, ('127.0.0.1', 0)),
]
U... | bsd-3-clause |
ghickman/django | django/conf/locale/fr/formats.py | 504 | 1454 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# 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'
DATETI... | bsd-3-clause |
mtnman38/Aggregate | Executables/Aggregate 0.8.8 for Macintosh.app/Contents/Resources/lib/python2.7/requests/packages/charade/langbulgarianmodel.py | 172 | 13013 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 Ri... | gpl-2.0 |
fkolacek/FIT-VUT | bp-revok/python/lib/python2.7/site-packages/urwid-1.3.0-py2.7-linux-x86_64.egg/urwid/tests/test_text_layout.py | 26 | 10642 | import unittest
from urwid import text_layout
from urwid.compat import B
import urwid
class CalcBreaksTest(object):
def cbtest(self, width, exp):
result = text_layout.default_layout.calculate_text_segments(
B(self.text), width, self.mode )
assert len(result) == len(exp), repr((result,... | apache-2.0 |
yongshengwang/hue | desktop/core/ext-py/boto-2.38.0/boto/gs/resumable_upload_handler.py | 153 | 31419 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | apache-2.0 |
WojciechFocus/MMVD | mmvdApp/visualization.py | 1 | 20958 | # coding: utf-8
__author__ = 'wojciech'
import time
from Tkinter import *
class Visualization(Frame):
def __init__(self, map_):
self.master = Tk()
Frame.__init__(self, self.master)
self.magazine_frame = Frame(self.master)
self.magazine_frame.pack(side=LEFT)
self.control_... | mit |
dongjoon-hyun/tensorflow | tensorflow/python/keras/utils/io_utils.py | 23 | 4871 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/tests/wsgi/tests.py | 12 | 4173 | from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.core.servers.basehttp import get_internal_wsgi_application
from django.core.signals import request_started
from django.core.wsgi import get_wsgi_application
from django.db import close_old_connections
from djang... | apache-2.0 |
binhex/moviegrabber | lib/site-packages/sqlalchemy/testing/warnings.py | 78 | 1679 | # testing/warnings.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
import warnings
from .. import exc as sa_e... | gpl-3.0 |
ericdill/scikit-beam-examples | demos/1_time_correlation/one-time-correlation.py | 3 | 2993 |
import numpy as np
from matplotlib.ticker import MaxNLocator
from matplotlib.colors import LogNorm
import matplotlib.pyplot as plt
import matplotlib.patches as mp
import skxray.core.correlation as corr
import skxray.core.roi as roi
# it would be great to have a link to what this multi-tau scheme is!
num_levels = 7
num... | bsd-3-clause |
chen0510566/MissionPlanner | Lib/site-packages/numpy/distutils/command/scons.py | 93 | 24248 | import os
import sys
import os.path
from os.path import join as pjoin, dirname as pdirname
from distutils.errors import DistutilsPlatformError
from distutils.errors import DistutilsExecError, DistutilsSetupError
from numpy.distutils.command.build_ext import build_ext as old_build_ext
from numpy.distutils.ccompiler im... | gpl-3.0 |
apixandru/intellij-community | plugins/hg4idea/testData/bin/mercurial/hbisect.py | 92 | 9226 | # changelog bisection for mercurial
#
# Copyright 2007 Matt Mackall
# Copyright 2005, 2006 Benoit Boissinot <benoit.boissinot@ens-lyon.org>
#
# Inspired by git bisect, extension skeleton taken from mq.py.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 ... | apache-2.0 |
dedalusdev/docker-registry | depends/docker-registry-core/docker_registry/testing/mock_dict.py | 38 | 1431 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Docker.
#
# 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... | apache-2.0 |
phazel/pixelated-user-agent | service/pixelated/adapter/mailstore/body_parser.py | 2 | 1493 | #
# Copyright (c) 2015 ThoughtWorks, Inc.
#
# Pixelated 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 License, or
# (at your option) any later version.
#
# Pixelated is distrib... | agpl-3.0 |
ahuarte47/QGIS | tests/src/python/test_qgslayoutmapgrid.py | 15 | 26980 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutItemMapGrid.
.. note. 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.
"... | gpl-2.0 |
hanselke/erpnext-1 | erpnext/accounts/doctype/pos_profile/pos_profile.py | 36 | 2115 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe.utils import cint
from frappe.model.document import Document
class POSProfile(Document):
def... | agpl-3.0 |
ckirby/django | tests/null_fk_ordering/tests.py | 381 | 2012 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Article, Author, Comment, Forum, Post, SystemInfo
class NullFkOrderingTests(TestCase):
def test_ordering_across_null_fk(self):
"""
Regression test for #7512
ordering across nullable Foreign Key... | bsd-3-clause |
naoliv/osmose-backend | plugins/__init__.py | 6 | 1392 | #-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Etienne Chové <chove@crans.org> 2009 ##
## ... | gpl-3.0 |
taedori81/wagtail | wagtail/wagtailredirects/tests.py | 6 | 8401 | from django.test import TestCase
from django.test.client import Client
from wagtail.wagtailredirects import models
from wagtail.tests.utils import WagtailTestUtils
from django.core.urlresolvers import reverse
class TestRedirects(TestCase):
def test_path_normalisation(self):
# Shortcut to normalise functio... | bsd-3-clause |
kalwar/openelisglobal-core | liquibase/OE2.8/testCatalogCI_LNSP/scripts/testCodes.py | 18 | 2104 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
analyze_code = []
billing_code = []
test_name = []
sample_type = []
handled_descriptions = ['']
test_file = open("testName.txt")
sample_file = open("sampleType.txt")
analyze_file = open("analyzeCode.txt")
billing_file = open("billingCode.txt")
result = open... | mpl-2.0 |
jaruba/chromium.src | tools/telemetry/PRESUBMIT.py | 15 | 1727 | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
PYLINT_BLACKLIST = []
PYLINT_DISABLED_WARNINGS = ['R0923', 'R0201', 'E1101']
def _CommonChecks(input_api, output_api):
results = []
... | bsd-3-clause |
damdam-s/OpenUpgrade | addons/payment_ogone/models/ogone.py | 34 | 19078 | # -*- coding: utf-'8' "-*-"
from hashlib import sha1
import logging
from lxml import etree, objectify
from pprint import pformat
import time
from urllib import urlencode
import urllib2
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_ogone.controll... | agpl-3.0 |
CodeMath/jinrockets | BluePrint/lib/bs4/builder/_lxml.py | 446 | 8661 | __all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from io import BytesIO
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
Parse... | mit |
c86j224s/snippet | Python_asyncio_binary_echo/pyclient2/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py | 8 | 15371 | """
SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested w... | apache-2.0 |
bboot/doorman | tts.py | 2 | 3924 | # Copyright 2017 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, ... | apache-2.0 |
tplusx/ns3-gpsr | src/visualizer/bindings/modulegen__gcc_LP64.py | 30 | 325182 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
nbetcher/latte-2.6.35-crc | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
IKholopov/HackUPC2017 | hackupc/env/lib/python3.5/site-packages/social/tests/backends/test_deezer.py | 9 | 1231 | import json
from social.tests.backends.oauth import OAuth2Test
class DeezerOAuth2Test(OAuth2Test):
backend_path = 'social.backends.deezer.DeezerOAuth2'
user_data_url = 'http://api.deezer.com/user/me'
expected_username = 'foobar'
access_token_body = 'access_token=foobar&expires=0'
user_data_body =... | apache-2.0 |
gg7/diamond | src/collectors/chronyd/test/testchronyd.py | 31 | 3260 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from chronyd import Chrony... | mit |
mtelahun/purchase-workflow | product_supplierinfo_discount/__init__.py | 11 | 1092 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
#
# This progr... | agpl-3.0 |
wevoice/wesub | apps/messages/signalhandlers.py | 6 | 1113 | # Amara, universalsubtitles.org
#
# Copyright (C) 2014 Participatory Culture Foundation
#
# 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
# License, or (at your op... | agpl-3.0 |
DinoCow/airflow | tests/providers/apache/sqoop/hooks/test_sqoop.py | 7 | 14202 | #
# 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... | apache-2.0 |
auready/django | tests/fixtures_regress/models.py | 72 | 8193 | from django.contrib.auth.models import User
from django.db import models
class Animal(models.Model):
name = models.CharField(max_length=150)
latin_name = models.CharField(max_length=150)
count = models.IntegerField()
weight = models.FloatField()
# use a non-default name for the default manager
... | bsd-3-clause |
mfazekas/safaridriver | remote/client/src/py/command.py | 3 | 2944 | # Copyright 2010 WebDriver committers
# Copyright 2010 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 ap... | apache-2.0 |
kalaidin/luigi | luigi/contrib/hdfs/hadoopcli_clients.py | 31 | 9521 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
yourlabs/django-documents | setup.py | 1 | 2216 | import os
import sys
from setuptools import setup, find_packages, Command
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
... | mit |
jhseu/tensorflow | tensorflow/lite/micro/examples/magic_wand/train/data_load_test.py | 19 | 4119 | # Lint as: python3
# Copyright 2019 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 ... | apache-2.0 |
linkdesu/shadowsocks | shadowsocks/udprelay.py | 924 | 11154 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 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 required b... | apache-2.0 |
takeshineshiro/tornado | tornado/test/locks_test.py | 61 | 15994 | # 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 th... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.