repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
132nd-etcher/EMFT | emft/gui/tab_about.py | 1 | 1269 | # coding=utf-8
from emft.core import constant
from emft.core.logging import make_logger
from emft.gui.base import GridLayout, HSpacer, Label, VLayout, VSpacer
from emft.gui.main_ui_tab_widget import MainUiTabChild
LOGGER = make_logger(__name__)
class TabChildAbout(MainUiTabChild):
def tab_clicked(self):
... | gpl-3.0 |
jfinkels/networkx | networkx/readwrite/graph6.py | 3 | 7803 | # Original author: D. Eppstein, UC Irvine, August 12, 2003.
# The original code at http://www.ics.uci.edu/~eppstein/PADS/ is public domain.
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# Tomas Gavenciak <gavento@ucw.cz>
... | bsd-3-clause |
imply/chuu | ppapi/generators/idl_lexer.py | 62 | 9292 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Lexer for PPAPI IDL """
#
# IDL Lexer
#
# The lexer is uses the PLY lex library to build a tokenizer which understands
# WebID... | bsd-3-clause |
sanger-pathogens/gff3toembl | gff3toembl/EMBLConverter.py | 3 | 1946 | import gff3toembl
from gt import CustomVisitor
from gff3toembl.EMBLContig import EMBLContig
class EMBLConverter(CustomVisitor):
def __init__(self, locus_tag=None, translation_table=11):
CustomVisitor.__init__(self)
self.contigs = {}
self.locus_tag = locus_tag
self.translation_table... | gpl-3.0 |
SanPen/GridCal | src/GridCal/Engine/Sparse/utils.py | 1 | 2463 | # This file is part of GridCal.
#
# GridCal 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.
#
# GridCal is distributed in the hope that... | gpl-3.0 |
trashkalmar/omim | tools/python/mwm/dump_mwm.py | 10 | 1418 | #!/usr/bin/python
import sys, os.path, random
import json
from mwm import MWM
if len(sys.argv) < 2:
print('Dumps some MWM structures.')
print('Usage: {0} <country.mwm>'.format(sys.argv[0]))
sys.exit(1)
mwm = MWM(open(sys.argv[1], 'rb'))
mwm.read_types(os.path.join(os.path.dirname(sys.argv[0]), '..', '..',... | apache-2.0 |
vergecurrency/electrum-xvg | gui/qt/version_getter.py | 2 | 4598 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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... | gpl-3.0 |
lambeau/ansible-modules-core | cloud/openstack/_quantum_router.py | 37 | 7032 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 ... | gpl-3.0 |
regionbibliotekhalland/digitalasagor | edittabvideo.py | 1 | 4897 | # Copyright 2013 Regionbibliotek Halland
#
# This file is part of Digitala sagor.
#
# Digitala sagor 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
# ... | gpl-3.0 |
devalbo/mm_anywhere | google/protobuf/internal/encoder.py | 484 | 25695 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | agpl-3.0 |
ciudadanointeligente/lobby_cplt | lobby/csv_reader.py | 1 | 1655 | from lobby.models import Active, Audiencia, Passive
from popolo.models import Identifier
import uuid
import unicodedata
from datetime import datetime
class ActivosCSVReader():
def parse_line(self, line):
active = Active()
active.name = unicode(line[3] + " " + line[4])
active.save()
... | agpl-3.0 |
marcelocure/django | django/core/management/sql.py | 399 | 1890 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
def sql_flush(style, connection, only_django=False, reset_sequences=True, allow_cascade=False):
"""
Returns a list of the SQL statements used to flush the database.
If only_django is True, then only table n... | bsd-3-clause |
johanvdw/rasterio | examples/concurrent-cpu-bound.py | 6 | 3361 | """concurrent-cpu-bound.py
Operate on a raster dataset window-by-window using a ThreadPoolExecutor.
Simulates a CPU-bound thread situation where multiple threads can improve performance.
With -j 4, the program returns in about 1/4 the time as with -j 1.
"""
import concurrent.futures
import multiprocessing
import ti... | bsd-3-clause |
Alwnikrotikz/micolog2 | plugins/wapblog/wapblog.py | 2 | 8001 | # -*- coding: utf-8 -*-
from micolog_plugin import *
import logging
import urllib
from model import *
from google.appengine.api import users
from google.appengine.api import memcache
from base import BaseRequestHandler,request_cache
from google.appengine.ext import webapp
from datetime import datetime, timedelta
def u... | gpl-3.0 |
labordoc/labordoc-next | modules/webtag/lib/webtag_forms.py | 3 | 7394 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
buguelos/odoo | addons/point_of_sale/controllers/main.py | 243 | 1576 | # -*- coding: utf-8 -*-
import logging
import simplejson
import os
import openerp
import time
import random
import werkzeug.utils
from openerp import http
from openerp.http import request
from openerp.addons.web.controllers.main import module_boot, login_redirect
_logger = logging.getLogger(__name__)
class PosContr... | agpl-3.0 |
JFriel/honours_project | networkx/networkx/algorithms/shortest_paths/dense.py | 42 | 5102 | # -*- coding: utf-8 -*-
"""Floyd-Warshall algorithm for shortest paths.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = """Aric Hagberg <aric.h... | gpl-3.0 |
kafan15536900/shadowsocks | shadowsocks/eventloop.py | 51 | 7513 | #!/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 |
indhub/mxnet | example/recommenders/randomproj.py | 14 | 6041 | # 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 u... | apache-2.0 |
nschneid/pyutil | ds/set.py | 4 | 2535 | '''
OrderedSet implementation, from http://stackoverflow.com/questions/1653970/does-python-have-an-ordered-set/1653978#1653978
The index() method and a few unit tests have been added.
@author: Nathan Schneider (nschneid)
@since: 2010-08-11
'''
# Strive towards Python 3 compatibility
from __future__ import print_func... | mit |
Dave-ts/Sigil | src/Resource_Files/plugin_launchers/python/sigil_bs4/builder/_lxml.py | 5 | 10167 | from __future__ import unicode_literals, division, absolute_import, print_function
import sys
PY3 = sys.version_info[0] == 3
if PY3:
text_type = str
binary_type = bytes
unicode = str
else:
range = xrange
text_type = unicode
binary_type = str
__all__ = [
'LXMLTreeBuilderForXML',
'LXMLTr... | gpl-3.0 |
ossdemura/django-miniblog | src/Lib/site-packages/django/contrib/gis/db/backends/postgis/pgraster.py | 491 | 5071 | import binascii
import struct
from django.forms import ValidationError
from .const import (
GDAL_TO_POSTGIS, GDAL_TO_STRUCT, POSTGIS_HEADER_STRUCTURE, POSTGIS_TO_GDAL,
STRUCT_SIZE,
)
def pack(structure, data):
"""
Pack data into hex string with little endian format.
"""
return binascii.hexli... | mit |
RootForum/magrathea | magrathea/cli/commands/version.py | 1 | 1239 | # -*- coding: utf-8 -*-
"""
magrathea.cli.commands.version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2014 by the RootForum.org team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
import magrathea
from ..base import BaseCommand
class VersionCommand(BaseCommand):
"""
... | mit |
2014c2g4/c2g4 | w2/static/Brython2.0.0-20140209-164925/Lib/xml/sax/saxutils.py | 730 | 11688 | """\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
import os, urllib.parse, urllib.request
import io
from . import handler
from . import xmlreader
def __dict_replace(s, d):
"""Replace substrings of a string using a dictionary."""
for key, val... | gpl-2.0 |
ratnania/pigasus | doc/manual/include/demo/test_neumann_quartcircle.py | 1 | 2730 | #! /usr/bin/python
# ...
try:
from matplotlib import pyplot as plt
PLOT=True
except ImportError:
PLOT=False
# ...
import numpy as np
from pigasus.gallery.poisson import *
import sys
import inspect
filename = inspect.getfile(inspect.currentframe()) # script filename (usually with path)
# ...... | mit |
aroig/offlineimap | test/OLItest/globals.py | 12 | 1373 | #Constants, that don't rely on anything else in the module
# Copyright (C) 2012- Sebastian Spaeth & contributors
#
# 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 th... | gpl-2.0 |
wsilva/fdp-folha-de-ponto-ach2077 | fdp/settings/base.py | 1 | 2384 | """
Django settings for fdp project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... | gpl-3.0 |
flyher/pymo | symbian/PythonForS60_1.9.6/module-repo/standard-modules/encodings/cp1253.py | 593 | 13350 | """ Python Character Mapping Codec cp1253 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | mit |
antonioguirola/webpy-base | forms.py | 1 | 4418 | # -*- coding: utf-8 -*-
from web import form
import re
import db
# Expresiones regulares necesarias:
#formatoVisa=re.compile(r'[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}')
# Funciones necesarias para las validaciones
def fooFunction():
pass
"""
EJEMPLO DE FORMULARIO PARA DARSE DE ALTA
formularioInscripcion = form.... | gpl-3.0 |
hehongliang/tensorflow | tensorflow/contrib/tensorrt/custom_plugin_examples/inc_op.py | 37 | 1215 | # 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 |
binghongcha08/pyQMD | sys_bath/bilinear/sys_bath_lqf.py | 2 | 10991 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 25 09:42:22 2016
@author: bing
"""
import numpy as np
#import scipy
import numba
import sys
import math
bohr_angstrom = 0.52917721092
hartree_wavenumber = 219474.63
#hartree_wavenumber = scipy.constants.value(u'hartree-inverse meter relationship') / 1e2
def M... | gpl-3.0 |
estaban/pyload | module/plugins/accounts/FileserveCom.py | 1 | 2261 | # -*- 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 |
sbellem/django | tests/template_tests/test_extends.py | 154 | 7062 | import os
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.loader_tags import ExtendsError
from django.template.loaders.base import Loader
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango20Warning
from .utils import ROOT... | bsd-3-clause |
SlimRemix/android_external_chromium_org | chrome/common/extensions/docs/server2/patcher.py | 121 | 1026 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class Patcher(object):
def GetPatchedFiles(self, version=None):
'''Returns patched files as(added_files, deleted_files, modified_files)
from the pa... | bsd-3-clause |
OCA/stock-logistics-barcode | stock_barcodes/wizard/stock_production_lot.py | 1 | 1359 | # Copyright 2019 Sergio Teruel <sergio.teruel@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class WizStockBarcodesNewLot(models.TransientModel):
_inherit = 'barcodes.barcode_events_mixin'
_name = 'wiz.stock.barcodes.new.lot'
_descriptio... | agpl-3.0 |
jalavik/invenio | invenio/modules/search/searchext/units/cataloguer.py | 9 | 1556 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | gpl-2.0 |
RoboCupULaval/RULEngine | Game/Team.py | 1 | 1310 | # Under MIT License, see LICENSE.txt
from RULEngine.Game.Player import Player
from RULEngine.Util.constant import PLAYER_PER_TEAM
from RULEngine.Util.team_color_service import TeamColor
class Team():
def __init__(self, team_color, type="friend"):
self.players = {}
for player_id in range(PLAYER_PER... | mit |
Nitaco/ansible | lib/ansible/modules/storage/netapp/netapp_e_amg_role.py | 22 | 7838 | #!/usr/bin/python
# (c) 2016, 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 |
weety/rt-thread | bsp/stm32/stm32f103-blue-pill/rtconfig.py | 14 | 4024 | import os
# toolchains options
ARCH='arm'
CPU='cortex-m3'
CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute... | apache-2.0 |
dajohnso/cfme_tests | widgetastic_manageiq/__init__.py | 1 | 87294 | # -*- coding: utf-8 -*-
import atexit
import json
import os
import re
import six
from collections import namedtuple
from datetime import date
from math import ceil
from tempfile import NamedTemporaryFile
from wait_for import wait_for
from cached_property import cached_property
from jsmin import jsmin
from lxml.html im... | gpl-2.0 |
ninnux/exscript | tests/Exscript/LogfileTest.py | 6 | 1494 | import sys, unittest, re, os.path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'src'))
from tempfile import mkdtemp
from shutil import rmtree
from LogTest import LogTest
from Exscript.Logfile import Logfile
class LogfileTest(LogTest):
CORRELATE = Logfile
d... | gpl-2.0 |
hahaps/openstack-project-generator | template/<project_name>/tests/unit/cast_as_call.py | 55 | 1168 | # Copyright 2013 Red Hat, 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 agre... | apache-2.0 |
BeegorMif/HTPC-Manager | lib/hachoir_core/field/timestamp.py | 90 | 2941 | from lib.hachoir_core.tools import (humanDatetime, humanDuration,
timestampUNIX, timestampMac32, timestampUUID60,
timestampWin64, durationWin64)
from lib.hachoir_core.field import Bits, FieldSet
from datetime import datetime
class GenericTimestamp(Bits):
def __init__(self, parent, name, size, description=N... | gpl-3.0 |
asmikhailov/i3pystatus | i3pystatus/zabbix.py | 1 | 2493 | from i3pystatus import IntervalModule
from pyzabbix import ZabbixAPI
class Zabbix(IntervalModule):
"""
Zabbix alerts watcher
Requires: pyzabbix
.. rubric:: Available formatters
* {default} - Full output count alerts like total:a5/a4/a3/a2/a1/a0
* {total} - Total count of alerts
* {aX_co... | mit |
DzinVision/adventofcode-2016 | day_13.py | 1 | 1232 | from queue import Queue
seed = 1362
seen = set()
def is_empty(x, y):
n = x*x + 3*x + 2*x*y + y + y*y + seed
return bin(n).count('1') % 2 == 0
def valid_moves(x, y):
result = []
actions = [-1, 1]
for action in actions:
new_x = x + action
if x > 0 and is_empty(new_x, y) and (new_x... | gpl-3.0 |
KitKatXperience/platform_external_chromium_org | third_party/closure_linter/closure_linter/tokenutil.py | 135 | 10976 | #!/usr/bin/env python
#
# Copyright 2007 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 |
dgzurita/odoo | addons/payment/tests/common.py | 392 | 1822 | # -*- coding: utf-8 -*-
from openerp.tests import common
class PaymentAcquirerCommon(common.TransactionCase):
def setUp(self):
super(PaymentAcquirerCommon, self).setUp()
self.payment_acquirer = self.registry('payment.acquirer')
self.payment_transaction = self.registry('payment.transactio... | agpl-3.0 |
asen6/amartyasenguptadotcom | django/contrib/gis/db/backends/base.py | 55 | 10675 | """
Base/mixin classes for the spatial backend database operations and the
`SpatialRefSys` model the backend.
"""
import re
from django.conf import settings
from django.contrib.gis import gdal
class BaseSpatialOperations(object):
"""
This module holds the base `BaseSpatialBackend` object, which is
instanti... | bsd-3-clause |
rruebner/odoo | addons/stock_dropshipping/__init__.py | 61 | 1045 | # -*- 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 |
guorendong/iridium-browser-ubuntu | chrome/test/remoting/install_and_launch_app.py | 79 | 6848 | #!/usr/bin/python
# 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.
"""A Chromedriver smoke-test that installs and launches a web-app.
Args:
driver_dir: Location of Chromedriver binary on local machin... | bsd-3-clause |
rhololkeolke/apo-website | src/flask/exceptions.py | 63 | 1462 | # -*- coding: utf-8 -*-
"""
flask.exceptions
~~~~~~~~~~~~
Flask specific additions to :class:`~werkzeug.exceptions.HTTPException`
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from werkzeug.exceptions import HTTPException, BadRequest
from .helpers import ... | bsd-3-clause |
ros2/ci | ros2_batch_job/vendor/osrf_pycommon/osrf_pycommon/process_utils/impl.py | 1 | 12684 | # Copyright 2014 Open Source Robotics Foundation, 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 |
huoxudong125/poedit | deps/boost/tools/build/test/core_at_file.py | 45 | 1341 | #!/usr/bin/python
# Copyright 2011 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester(["-ffile.jam"], pass_toolset=0)
t.write("file.jam", """\
name = n1 n2 ;... | mit |
fjbatresv/odoo | addons/fetchmail/__openerp__.py | 260 | 2887 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# mga@openerp.com
#
# This program is free software: you can redistribute it and/or mo... | agpl-3.0 |
bunnyitvn/webptn | tests/regressiontests/model_inheritance_regress/models.py | 60 | 4929 | from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
class Meta:
... | bsd-3-clause |
xydinesh/flask-restful | jinja2/testsuite/regression.py | 90 | 7583 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.regression
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests corner cases and bugs.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Template, Enviro... | apache-2.0 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.2/django/contrib/localflavor/jp/jp_prefectures.py | 543 | 2089 | from django.utils.translation import ugettext_lazy
JP_PREFECTURES = (
('hokkaido', ugettext_lazy('Hokkaido'),),
('aomori', ugettext_lazy('Aomori'),),
('iwate', ugettext_lazy('Iwate'),),
('miyagi', ugettext_lazy('Miyagi'),),
('akita', ugettext_lazy('Akita'),),
('yamagata', ugettext_lazy('Yamagat... | mit |
devanshdalal/scikit-learn | examples/gaussian_process/plot_gpr_noisy_targets.py | 64 | 3706 | """
=========================================================
Gaussian Processes regression: basic introductory example
=========================================================
A simple one-dimensional regression example computed in two different ways:
1. A noise-free case
2. A noisy case with known noise-level per ... | bsd-3-clause |
pmidford/arachadmin | models/db.py | 1 | 17623 | import os
from ConfigParser import SafeConfigParser
defaults = dict(
host="localhost",
user="user",
password="userpass",
dbname="arachadmin")
conf = SafeConfigParser(defaults)
user = password = dbname = host = ''
if os.path.isfile("applications/%s/private/localconfig" % request.application):
con... | mit |
jalilag/apspir | objedit/gnosis/util/convert/txt2dw.py | 2 | 13950 | #!/usr/bin/python
__oneliner__="Convert ASCII source files for XML presentation"
__longdoc__="""
This program is not yet particularly smart, and will produce
undefined output (or even traceback) if the source file does
not meet expected format. With time, it may get better about
this.
Usage: python txt2d... | lgpl-2.1 |
Instagram/cassandra | pylib/cqlshlib/test/winpty.py | 62 | 1757 | # 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 u... | apache-2.0 |
Mahi/EzPyGame | ezpygame/scene.py | 1 | 5091 | class Scene:
"""An isolated scene which can be ran by an application.
Create your own scene by subclassing and overriding any methods.
The hosting :class:`.Application` instance is accessible
through the :attr:`application` property.
Example usage with two scenes interacting:
.. code-block:: ... | mit |
adlius/osf.io | osf_tests/test_management_commands.py | 2 | 14643 | # -*- coding: utf-8 -*-
import mock
import pytest
import time
from collections import OrderedDict
from django.utils import timezone
from addons.osfstorage import settings as osfstorage_settings
from api_tests.utils import create_test_file
from framework.auth import Auth
from osf.management.commands.update_institutio... | apache-2.0 |
dnlm92/chokoretto | main/lib/unidecode/x07b.py | 252 | 4669 | data = (
'Mang ', # 0x00
'Zhu ', # 0x01
'Utsubo ', # 0x02
'Du ', # 0x03
'Ji ', # 0x04
'Xiao ', # 0x05
'Ba ', # 0x06
'Suan ', # 0x07
'Ji ', # 0x08
'Zhen ', # 0x09
'Zhao ', # 0x0a
'Sun ', # 0x0b
'Ya ', # 0x0c
'Zhui ', # 0x0d
'Yuan ', # 0x0e
'Hu ', # 0x0f
'Gang ', # 0x10
... | mit |
tadebayo/myedge | myvenv/Lib/site-packages/django/conf/locale/sl/formats.py | 504 | 2118 | # -*- 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 = 'd. F Y'
TIME_FORMAT = 'H:i'
DATET... | mit |
luotao1/Paddle | python/paddle/fluid/tests/unittests/test_dist_lookup_sparse_table_fuse_ops.py | 2 | 5894 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
DavidAntliff/AwaLWM2M | tools/tests/python/test_awa_client_server_interaction.py | 2 | 17796 | #/************************************************************************************************************************
# Copyright (c) 2016, Imagination Technologies Limited and/or its affiliated group companies.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modificat... | bsd-3-clause |
dmitry-sobolev/ansible | test/units/module_utils/basic/test_no_log.py | 66 | 5263 | # -*- coding: utf-8 -*-
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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
# (a... | gpl-3.0 |
airbnb/airflow | tests/providers/google/cloud/sensors/test_gcs.py | 7 | 11744 | #
# 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 |
h0nIg/ansible-modules-extras | network/snmp_facts.py | 14 | 13252 | #!/usr/bin/python
# This file is part of Networklore's snmp library for Ansible
#
# The module 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 ... | gpl-3.0 |
w1ll1am23/home-assistant | tests/components/rest/test_notify.py | 6 | 1522 | """The tests for the rest.notify platform."""
from os import path
from unittest.mock import patch
import respx
from homeassistant import config as hass_config
import homeassistant.components.notify as notify
from homeassistant.components.rest import DOMAIN
from homeassistant.const import SERVICE_RELOAD
from homeassis... | apache-2.0 |
dharmabumstead/ansible | lib/ansible/plugins/action/win_copy.py | 7 | 23402 | # This file is part of Ansible
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import base64
import json
import os
i... | gpl-3.0 |
rx2130/Leetcode | python/322 Coin Change.py | 1 | 1430 | class Solution(object):
def coinChange(self, coins, amount):
"""
:type coins: List[int]
:type amount: int
:rtype: int
"""
if amount < 1:
return 0
return self.helper(coins, amount, [0] * amount)
def helper(self, coins, target, cache):
#... | apache-2.0 |
ovnicraft/odoo | addons/membership/__openerp__.py | 197 | 2207 | # -*- 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 |
ztmtoosm/ztmtoosm-django | koordynacje/models.py | 1 | 3081 | # This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey has `on_delete` set to the desired behavior.
# * Remove `managed = False` lines if ... | mit |
yokose-ks/edx-platform | common/lib/xmodule/xmodule/modulestore/xml_exporter.py | 5 | 10839 | """
Methods for exporting course data to XML
"""
import logging
import lxml.etree
from xblock.fields import Scope
from xmodule.contentstore.content import StaticContent
from xmodule.exceptions import NotFoundError
from xmodule.modulestore import Location
from xmodule.modulestore.inheritance import own_metadata
from fs... | agpl-3.0 |
nuncjo/odoo | openerp/addons/base/module/wizard/base_import_language.py | 337 | 2644 | # -*- 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 |
oliverlee/sympy | sympy/physics/unitsystems/tests/test_units.py | 92 | 3071 | # -*- coding: utf-8 -*-
from __future__ import division
from sympy.physics.unitsystems.units import Unit
from sympy.physics.unitsystems.systems.mks import length, time
from sympy.physics.unitsystems.prefixes import PREFIXES
from sympy.utilities.pytest import raises
k = PREFIXES['k']
def test_definition():
u = ... | bsd-3-clause |
jfietkau/Streets4MPI | persistence.py | 1 | 1926 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# persistence.py
# Copyright 2012 Julian Fietkau <http://www.julian-fietkau.de/>
#
# This file is part of Streets4MPI.
#
# Streets4MPI 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... | gpl-3.0 |
eldabbagh/gae-boilerplate | bp_includes/external/pytz/reference.py | 839 | 3649 | '''
Reference tzinfo implementations from the Python docs.
Used for testing against as they are only correct for the years
1987 to 2006. Do not use these for real code.
'''
from datetime import tzinfo, timedelta, datetime
from pytz import utc, UTC, HOUR, ZERO
# A class building tzinfo objects for fixed-offset time zo... | lgpl-3.0 |
lordkman/burnman | examples/example_geotherms.py | 4 | 4049 | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU
# GPL v2 or later.
"""
example_geotherms
-----------------
This example shows each of the geotherms currently possible with BurnMan.
... | gpl-2.0 |
gauribhoite/personfinder | env/google_appengine/google/appengine/api/channel/channel.py | 12 | 6716 | #!/usr/bin/env python
#
# Copyright 2007 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 o... | apache-2.0 |
austinzheng/swift | utils/swift_build_support/tests/products/test_llvm.py | 39 | 5436 | # tests/products/test_llvm.py -----------------------------------*- python -*-
#
# This source file is part of the LLVM.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the LLVM project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt ... | apache-2.0 |
kiran/bart-sign | venv/lib/python2.7/site-packages/numpy/polynomial/laguerre.py | 75 | 55335 | """
Objects for dealing with Laguerre series.
This module provides a number of objects (mostly functions) useful for
dealing with Laguerre series, including a `Laguerre` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in th... | mit |
DanteOnline/free-art | venv/lib/python3.4/site-packages/django/conf/locale/pt_BR/formats.py | 504 | 1434 | # -*- 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 = r'j \d\e F \d\e Y'
TIME_FORMAT = '... | gpl-3.0 |
abligh/xen4.2-minideb | tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py | 42 | 1058 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Dan Smith <danms@us.ibm.com>
from XmTestLib import *
from XmTestLib.block_utils import block_detach
if ENABLE_HVM_SUPPORT:
SKIP("Block-detach not supported for HVM domains")
config = {"disk":"phy:/dev/ram0,xvda1,w"}
domain =... | gpl-2.0 |
strands-project/robomongo | src/third-party/mongodb/buildscripts/test_shell.py | 13 | 8877 | # Copyright 2009 10gen, Inc.
#
# This file is part of MongoDB.
#
# MongoDB 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.
#
# M... | gpl-3.0 |
mrquim/mrquimrepo | script.module.schism.common/lib/bs4/tests/test_tree.py | 36 | 78105 | # -*- coding: utf-8 -*-
"""Tests for Beautiful Soup's tree traversal methods.
The tree traversal methods are the main advantage of using Beautiful
Soup over just using a parser.
Different parsers will build different Beautiful Soup trees given the
same markup, but all Beautiful Soup trees can be traversed with the
me... | gpl-2.0 |
runekaagaard/django-contrib-locking | django/contrib/gis/gdal/srs.py | 8 | 12155 | """
The Spatial Reference class, represents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print(srs)
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY... | bsd-3-clause |
jpush/jbox | Server/venv/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py | 353 | 3380 | from __future__ import absolute_import
import socket
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is... | mit |
sunzuolei/youtube-dl | youtube_dl/downloader/__init__.py | 101 | 1168 | from __future__ import unicode_literals
from .common import FileDownloader
from .external import get_external_downloader
from .f4m import F4mFD
from .hls import HlsFD
from .hls import NativeHlsFD
from .http import HttpFD
from .rtsp import RtspFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from ..utils i... | unlicense |
sandeepkbhat/pylearn2 | pylearn2/costs/gated_autoencoder.py | 39 | 5793 | """
Definitions of the cost for the gated-autoencoder.
"""
from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin
from pylearn2.space import VectorSpace
class SymmetricCost(DefaultDataSpecsMixin, Cost):
"""
Summary (Class representing the symmetric cost).
Subclasses can define the type of data they... | bsd-3-clause |
mlabru/ptracks | view/dbedit/dlg_exe_data_new.py | 1 | 36600 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------------------------------
dlg_exe_data_new
mantém as informações sobre a dialog de edição da tabela de exercícios
This program is free software: you can redistribute it and/or modify
it under th... | gpl-3.0 |
xiaotdl/ansible | contrib/inventory/serf.py | 395 | 3032 | #!/usr/bin/env python
# (c) 2015, Marc Abramowitz <marca@surveymonkey.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
# (... | gpl-3.0 |
cubicova17/annet | venv/lib/python2.7/site-packages/django/utils/http.py | 31 | 9025 | from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
from binascii import Error as BinasciiError
from email.utils import formatdate
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import force_str, force_text
from django.utils.fu... | mit |
scality/cinder | cinder/tests/unit/test_san.py | 34 | 2525 | # Copyright 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
siketh/ASR | catkin_ws/src/asr/src/slam_controller.py | 1 | 1585 | #!/usr/bin/env python
import rospy, os, signal, subprocess
from std_msgs.msg import String
from std_msgs.msg import Bool
def state_callback(data):
if data.data == "Shutdown":
rospy.signal_shutdown(shutdown_hook())
def mapping_callback(data):
global mapping
mapping = data.data
def shutdown_hoo... | mit |
seanchen/taiga-back | taiga/urls.py | 4 | 1875 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.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 F... | agpl-3.0 |
diox/olympia | src/olympia/activity/tests/test_commands.py | 4 | 2696 | from django.core.management import call_command
from django.core.management.base import CommandError
import pytest
from olympia import amo
from olympia.activity.models import ActivityLogToken
from olympia.amo.tests import TestCase, addon_factory, user_factory
class TestRepudiateActivityLogToken(TestCase):
def s... | bsd-3-clause |
Yoshiofthewire/CrunchyXBMC-Legacy | script.module.cryptopy/lib/crypto/cipher/arc4_test.py | 3 | 8035 | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
""" crypto.cipher.arc4_test
Tests for arc4 encryption, uses AES for base algorithm
Copyright © (c) 2002 by Paul A. Lambert
Read LICENSE.txt for license information.
July 24, 2002
"""
import unittest
from crypto.cipher.arc4 import ARC4
from binascii_... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.