code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# Copyright (c) 2018 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
# Copyright (c) 2018 Tomas Machalek <tomas.machalek@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as publis... | czcorpus/kontext | lib/plugins/static_appbar/__init__.py | Python | gpl-2.0 | 5,274 |
#!/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from ckanext.nhm.views.default import DefaultView
from ckanext.nhm.views.specimen import SpecimenView
from ckanext.nhm.views.dwc import DarwinCoreView
from ckanext.nhm.views.indexlot impor... | NaturalHistoryMuseum/ckanext-nhm | ckanext/nhm/views/__init__.py | Python | mit | 335 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
import os
def main():
with open ('/home/phillip/git/po/newde.po', 'r') as ifile:
for line in ifile:
if " …" in line:
with open ('/home/phillip/git/po/newestde.po', 'a') as outfile:
outfile.write(line)
else:
with open ('/home/phillip/git/po/de.po... | PhillipSz/scripts | old-merge.py | Python | gpl-3.0 | 474 |
"""
WSGI config for blogsite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blogsite.settings")
from django.cor... | userimack/blogsite | blogsite/wsgi.py | Python | mit | 505 |
# Copyright (C) 2016 Jolien Creighton
# (C) 2021 Jolien Creighton & Thomas Dent
#
# 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)... | tdent/pycbc | pycbc/population/fgmc_laguerre.py | Python | gpl-3.0 | 6,246 |
import datetime
import pytz
from mock import patch
from django.contrib.auth.models import User, Group
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
# Need access to internal func to put users in the right group
from courseware.access import (has_access, _course_staff_gr... | abhinavp13/IITBX-edx-platform-dev | lms/djangoapps/courseware/tests/test_view_authentication.py | Python | agpl-3.0 | 15,295 |
# Задача 2. Вариант 28.
# Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Эпикур. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
# Cherniy F. Y.
# 28.02.2016
print ("Лучше с разумом быть несчастным, чем без разума - счастли... | swer13/pythonintask | INBa/2015/Cherniy_F_Y/task_2_28.py | Python | apache-2.0 | 644 |
class Enemy:
def __init__(self, name, hp, damage):
self.name = name
self.hp = hp
self.damage = damage
def is_alive(self):
return self.hp > 0
class GiantSpider(Enemy):
def __init__(self):
super().__init__(name="Giant Spider", hp=10, damage=2)
class Ogre(Enemy... | ignacioelola/nlp_experiments | textgame/enemies.py | Python | apache-2.0 | 402 |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
import unittest
from io import StringIO
from ..helperfunctions import _xml_to_list
from ...workbook import ... | jmcnamara/XlsxWriter | xlsxwriter/test/workbook/test_workbook01.py | Python | bsd-2-clause | 1,667 |
import matplotlib.pyplot as plt
import numpy as np
import mpld3
fig, ax = plt.subplots(subplot_kw=dict(axisbg='#EEEEEE'))
N = 100
scatter = ax.scatter(np.random.normal(size=N),
np.random.normal(size=N),
c=np.random.random(size=N),
s=1000 * np.random.rando... | acrsilva/animated-zZz-machine | pruebas/scatter_tooltips.py | Python | lgpl-3.0 | 671 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-08-23 13:10
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('webcore', '0020_profile_role'),
]
operations = [
... | Nikita1710/ANUFifty50-Online-Mentoring-Platform | project/fifty_fifty/webcore/migrations/0021_paimentee.py | Python | apache-2.0 | 661 |
"""
.. index:: ML-kNN Learner
***************************************
ML-kNN Learner
***************************************
ML-kNN Classification is an adaptation kNN for multi-label
classification. In essence, ML-kNN uses the kNN algorithm
independently for each label :math:`l`. It finds the k nearest
examples t... | vrieni/orange | Orange/multilabel/mlknn.py | Python | gpl-3.0 | 9,043 |
from __future__ import absolute_import, division, print_function
import itertools
import math
import tempfile
import inspect
import gzip
import zlib
import bz2
import os
import codecs
from sys import getdefaultencoding
from fnmatch import fnmatchcase
from glob import glob
from collections import Iterable, Iterator, de... | pombredanne/dask | dask/bag/core.py | Python | bsd-3-clause | 40,445 |
# -*- encoding: utf-8 -*-
from supriya.tools.responsetools.Response import Response
class NodeSetResponse(Response):
### CLASS VARIABLES ###
__slots__ = (
'_items',
'_node_id',
)
### INITIALIZER ###
def __init__(
self,
node_id=None,
items=None,
... | andrewyoung1991/supriya | supriya/tools/responsetools/NodeSetResponse.py | Python | mit | 668 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Msmc2(MakefilePackage):
"""
This program implements MSMC2, a method to infer populatio... | LLNL/spack | var/spack/repos/builtin/packages/msmc2/package.py | Python | lgpl-2.1 | 1,658 |
# -*- coding: utf-8 -*-
import os
from os.path import expanduser
import click
from rogue.utilities import console
from rogue.commands.init import DEFAULT_CONFIG_FILE
import rogue.api.config as api_config
@click.group()
def config():
"""Initialize rogue environment"""
@config.command()
@click.argument("options",... | 4383/rogue | rogue/commands/config.py | Python | mit | 1,585 |
from yaml.composer import Composer
from yaml.nodes import MappingNode
class AnsibleComposer(Composer):
def __init__(self):
self.__mapping_starts = []
super(Composer, self).__init__()
def compose_node(self, parent, index):
# the line number where the previous token has ended (plus empty ... | gitterHQ/ansible | v2/ansible/parsing/yaml/composer.py | Python | gpl-3.0 | 1,212 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | jwlawson/tensorflow | tensorflow/contrib/framework/python/ops/critical_section_ops.py | Python | apache-2.0 | 949 |
import _plotly_utils.basevalidators
class TickcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="tickcolor", parent_name="scatter3d.line.colorbar", **kwargs
):
super(TickcolorValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/scatter3d/line/colorbar/_tickcolor.py | Python | mit | 477 |
print 'a.py is executed'
| chintown/codeplay | test/fixtures/a.py | Python | mit | 25 |
#coding=utf-8
from setuptools import setup, find_packages
import sys, os
version = '0.0.1'
setup(name='sandglass',
version=version,
description="datetime enhance",
long_description="""\
================
sandglass
================
安装
------------
可以::
easy_install sandglass
或者::
pip ins... | kzczencode/sandglass | setup.py | Python | mit | 7,517 |
# Copyright 2014-2016 Presslabs SRL
#
# 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 wri... | PressLabs/gitfs | tests/integrations/current/test_read.py | Python | apache-2.0 | 1,610 |
"""Tests for certbot.plugins.disco."""
import unittest
import mock
import pkg_resources
import zope.interface
from certbot import errors
from certbot import interfaces
from certbot.plugins import standalone
from certbot.plugins import webroot
EP_SA = pkg_resources.EntryPoint(
"sa", "certbot.plugins.standalone",... | wteiken/letsencrypt | certbot/plugins/disco_test.py | Python | apache-2.0 | 10,343 |
# Copyright (c) 2004 Divmod.
# See LICENSE for details.
import warnings
from zope.interface import implements
from twisted.python import components
from nevow.util import Deferred, DeferredList, getPOSTCharset
from nevow import inevow, tags
from nevow.context import WovenContext
import formless
from formless.formu... | UstadMobile/exelearning-ustadmobile-work | formless/processors.py | Python | gpl-2.0 | 10,659 |
from __future__ import absolute_import, unicode_literals
import warnings
from django.test import TestCase
from .models import Domain, Kingdom, Phylum, Klass, Order, Family, Genus, Species
class SelectRelatedTests(TestCase):
def create_tree(self, stringtree):
"""
Helper to create a complete tre... | atruberg/django-custom | tests/select_related/tests.py | Python | bsd-3-clause | 7,317 |
# A googol (10^100) is a massive number: one followed by one-hundred zeros;
# 100^100 is almost unimaginably large: one followed by two-hundred zeros.
# Despite their size, the sum of the digits in each number is only 1.
# Considering natural numbers of the form, ab, where a, b < 100, what is the
# maximum digital sum... | cloudzfy/euler | src/56.py | Python | mit | 503 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-03 14:44
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
def add_profiles(apps, schema_editor):
UserProfile = apps.get_model('website', 'UserProfile')
user_app, user_model = settings.AUT... | Bugheist/website | website/migrations/0024_userprofile.py | Python | agpl-3.0 | 1,273 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("orgs", "0006_auto_20140919_2056")]
operations = [
migrations.AlterField(
model_name="invitation",
name="created_by",
... | rapidpro/dash | dash/orgs/migrations/0007_auto_20140922_1514.py | Python | bsd-3-clause | 4,336 |
"""empty message
Revision ID: b65233051af8
Revises: 748c6aef5e2b
Create Date: 2017-09-02 18:42:50.985186
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b65233051af8'
down_revision = '748c6aef5e2b'
branch_labels = None
depends_on = None
def upgrade():
# ... | Abbott-Wu/flask-blog | migrations/versions/b65233051af8_.py | Python | mit | 641 |
from datetime import datetime
import pandas as pd
from pandas import Series, date_range
import pandas._testing as tm
class TestTruncate:
def test_truncate_datetimeindex_tz(self):
# GH 9243
idx = date_range("4/1/2005", "4/30/2005", freq="D", tz="US/Pacific")
s = Series(range(len(idx)), ind... | jreback/pandas | pandas/tests/series/methods/test_truncate.py | Python | bsd-3-clause | 2,026 |
print("init b") | GLPJJ/PL | py/module_test/module/a/b/__init__.py | Python | gpl-3.0 | 15 |
import json
from rest_framework.exceptions import NotFound
from osf.models import Guid
from rest_framework.views import APIView
from django.http import JsonResponse
from api.base import permissions as base_permissions
class IACallbackView(APIView):
"""
This is the callback Pigeon makes that signals IA has fi... | Johnetordoff/osf.io | api/ia/views.py | Python | apache-2.0 | 1,081 |
"""
This GA code creates the gaModel with a circular island model
"""
from operator import attrgetter
# import sys
from deap import base, creator, tools
import numpy
from csep.loglikelihood import calcLogLikelihood as loglikelihood
from models.mathUtil import calcNumberBins
import models.model
import random
import arr... | PyQuake/earthquakemodels | code/gaModel/parallelGAModelP_AVR.py | Python | bsd-3-clause | 6,277 |
from flask import _app_ctx_stack
from flask import current_app as app
from flask import Flask, request, session, url_for, redirect, \
render_template, abort, g, flash, _app_ctx_stack
from sqlite3 import dbapi2 as sqlite3
from hashlib import md5
from datetime import datetime
def get_db():
"""Opens a new databa... | bridgetnoelleee/project2 | helpers/functions.py | Python | bsd-3-clause | 2,064 |
#/usr/bin/env python
import pika
import sys
if (len(sys.argv) != 2):
print("Usage: python", sys.argv[0], "<msg string>")
exit(1)
message = "".join(sys.argv[1])
connection = pika.BlockingConnection(pika.ConnectionParameters("localhost"))
channel = connection.channel()
channel.exchange_declare(exchange="logs", t... | flange/drift-dev | rabbitmq/python-tut/03-pubsub/emit_log.py | Python | apache-2.0 | 423 |
#-*- encoding:UTF-8 -*-
import urllib2
import re
import StringIO
import gzip
import logging
import sqlite3
import logutils
import urllib
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class logger:
def __init__(self, name):
self.log = logging.getLogger(name)
self.log.setLevel(logging.DEBUG... | maxis1314/pyutils | crawler/tools/CrawlerBase.py | Python | apache-2.0 | 7,669 |
from django.test import TestCase
from django.core.urlresolvers import reverse, resolve
from ..views import api
class XFormsUrlTest(TestCase):
def test_xforms_list(self):
assert reverse('form-list') == '/collect/formList/'
resolved = resolve('/collect/')
assert resolved.func.__name__ == a... | Cadasta/cadasta-platform | cadasta/xforms/tests/test_urls_api.py | Python | agpl-3.0 | 870 |
from __future__ import absolute_import
import errno
import warnings
import hmac
import re
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
from ..packages import six
from ..packages.rfc3986 import abnf_regexp
... | ctrlaltdel/neutrinator | vendor/urllib3/util/ssl_.py | Python | gpl-3.0 | 13,786 |
#!/usr/bin/env python
# Copyright (c) 2019 The Khronos Group Inc.
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE.txt file.
"""
Generator for shadermatrix* tests.
This file needs to be run in its folder.
"""
import sys
_DO_NOT_EDIT_WARNING = """<!--
This file is... | endlessm/chromium-browser | third_party/webgl/src/sdk/tests/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py | Python | bsd-3-clause | 2,765 |
##
# Copyright (c) 2006-2014 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | trevor/calendarserver | txdav/who/vcard.py | Python | apache-2.0 | 12,917 |
#!/usr/bin/env python3
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.car.gm.values import CAR, Ecu, ECU_FINGERPRINT, CruiseButtons, \
AccState, FINGERPRINTS
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, is_ecu_... | vntarasov/openpilot | selfdrive/car/gm/interface.py | Python | mit | 7,706 |
#!/usr/bin/env python3
import os
import sys
import scanner
import codemap
# ------------------------------------------------------------------------------
# Parameterized output filenames
def func_index_name():
return 'Function-Index.md'
def func_index_graph_name():
return 'func_index_graph.dot'
def mod_inde... | RyanSchuster/vos64 | tools/dox.py | Python | bsd-3-clause | 10,246 |
# -*- coding: utf8 -*-
__author__ = 'sergey'
"""
Class for Zstd compression helper
New version 0.3.6
"""
from dedupsqlfs.compression import BaseCompression
class Zstd036Compression(BaseCompression):
_method_name = "zstd036"
_minimal_size = 31
_has_comp_level_options = True
_deprecated = True
... | sergey-dryabzhinsky/dedupsqlfs | dedupsqlfs/compression/zstd036.py | Python | mit | 1,114 |
################################
# These variables are overwritten by Zenoss when the ZenPack is exported
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = "ZenPacks.community.AlphaPowerRectifier"
VERSION = "1.0.0"
AUTHOR = "Russell Dwarshuis"
LICENSE = "GPLv2+"
NAMESPACE_PACKAGES = ['Z... | kb8u/ZenPacks.community.AlphaPowerRectifier | setup.py | Python | gpl-2.0 | 2,981 |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
from .views import urlpatterns as test_urlpatterns... | barseghyanartur/django-rest-framework-hstore | tests/drf_hstore_tests/urls.py | Python | mit | 492 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import cms.models.fields
class Migration(migrations.Migration):
dependencies = [
('cms', '0013_urlconfrevision'),
]
operations = [
migrations.CreateModel(
name='SearchRes... | mverleg/svsite | source/base/migrations/0001_initial.py | Python | bsd-3-clause | 1,629 |
from ctypes import c_void_p, c_uint32, c_buffer, byref
from .Win32Structs import *
def adjustDebugPrivileges():
privileges = TOKEN_PRIVILEGES()
access_token = OpenProcessToken( GetCurrentProcess(), win32con.TOKEN_QUERY | win32con.TOKEN_ADJUST_PRIVILEGES)
LookupPrivilegeValue( None, "SeDebugPrivileg... | assafnativ/NativDebugging | src/Win32/Win32Utilities.py | Python | gpl-3.0 | 4,137 |
"""
KeepNote
Export HTML Extension
"""
#
# KeepNote
# Copyright (c) 2008-2009 Matt Rasmussen
# Author: Matt Rasmussen <rasmus@mit.edu>
#
# 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 Foundat... | reshadh/Keepnote-LaTeX | keepnote/extensions/export_html/__init__.py | Python | gpl-2.0 | 13,226 |
#!-*- coding:utf-8 -*-
| ozgebarbaros/collectivework | collectivework/admin.py | Python | gpl-3.0 | 24 |
# -*- coding: utf-8 -*-
# * Authors:
# * TJEBBES Gaston <g.t@majerti.fr>
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
"""
User Related views
"""
import logging
from pyramid.httpexceptions import HTTPFound
from sqlalchemy import or_
from autonomie.models.user.user import User... | CroissanceCommune/autonomie | autonomie/views/user/user.py | Python | gpl-3.0 | 6,337 |
import random
from gatesym import core, test_utils
from gatesym.blocks import multipliers
def test_ripple_multiplier():
network = core.Network()
a = test_utils.BinaryIn(network, 8)
b = test_utils.BinaryIn(network, 8)
r, c = multipliers.ripple_multiplier(a, b)
r = test_utils.BinaryOut(r)
for ... | tolomea/gatesym | gatesym/tests/blocks/test_multipliers.py | Python | mit | 577 |
# encoding: utf-8
from datetime import date, datetime
from django.conf import settings
from django.conf.urls.defaults import url, patterns, include
from django.db import models
from django.http import Http404, HttpResponse
from taggit.managers import TaggableManager
from taggit.models import Tag, TaggedItem
from phil... | ithinksw/philo | philo/contrib/penfield/models.py | Python | isc | 25,222 |
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))
... | mohittahiliani/tcp-eval-suite-ns3 | src/tap-bridge/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 263,399 |
# -*- coding: utf-8 -*-
'''
Created on 2013-3-8
@author: m00147039
'''
import sqlite3
#===============================================================================
# DB Data struct
#===============================================================================
ID = 0
PROCDUCTTYPE = 1
VERSION = 2
MODULENAME = 3
... | HuaweiSNC/OPS2 | src/python/dao/driver_mgmt.py | Python | mit | 5,150 |
# Copyright (c) 2016 Reduxio Systems
# 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 requi... | ge0rgi/cinder | cinder/volume/drivers/reduxio/rdx_cli_api.py | Python | apache-2.0 | 18,019 |
"""
Test that objective-c constant strings are generated correctly by the expression
parser.
"""
import os, time
import unittest2
import lldb
from lldbtest import *
import lldbutil
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
class ConstStringTestCase(TestBase):
mydir = os.path.joi... | s20121035/rk3288_android5.1_repo | external/lldb/test/lang/objc/foundation/TestConstStrings.py | Python | gpl-3.0 | 2,346 |
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext as RC
from django.shortcuts import render_to_response, get_object_or_404
from django.core.urlresolvers import reverse
from django_haikus.models import HaikuRating, HaikuModel
from django_haikus.composer import compose... | wieden-kennedy/django-haikus | django_haikus/views.py | Python | bsd-3-clause | 2,293 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __init__ import *
from common.models import *
from base import BaseController
class Controller(BaseController):
template_module = 'customer'
def pre_dispatch( self, action, key=None):
if key:
customer = Customer.get(key)
self._ch... | geekybeaver/Billy | common/controller/customer.py | Python | gpl-3.0 | 2,964 |
import numpy as np
import random
from audio import read_mfcc
from batcher import sample_from_mfcc
from constants import SAMPLE_RATE, NUM_FRAMES
from conv_models import DeepSpeakerModel
from test import batch_cosine_similarity
np.random.seed(123)
random.seed(123)
model = DeepSpeakerModel()
model.m.load_weights('/Users... | googleinterns/deepspeech-reconstruction | src/deep_speaker/example.py | Python | apache-2.0 | 1,066 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "flea_market.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that ... | starbt/flea_market | manage.py | Python | mit | 809 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ArviZ documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 11 18:33:59 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | arviz-devs/arviz | doc/source/conf.py | Python | apache-2.0 | 9,816 |
#!/usr/bin/env python
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | jmartinezchaine/OpenERP | openerp/addons/auth_openid/res_users.py | Python | agpl-3.0 | 4,045 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------------------------------
wnd_main_dbedit
janela principal do editor da base de dados
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General P... | mlabru/ptracks | view/dbedit/wnd_main_dbedit.py | Python | gpl-3.0 | 6,936 |
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
TESTPREAMBLE()
try:
# Test the initialization method
RandomGenerator.SetSeed(0)
# Test the state accessor for reading
initialState = RandomGenerator.GetState()
print("initialState=", repr(initialState))
# Te... | aurelieladier/openturns | python/test/t_RandomGenerator_std.py | Python | lgpl-3.0 | 2,449 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | kmee/bank-statement-reconcile | __unported__/account_invoice_reference/__openerp__.py | Python | agpl-3.0 | 6,213 |
#!/usr/bin/env python
# This file stolen and edited from cherrypy, so we should not assign
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# ... | GitHublong/hue | desktop/core/src/desktop/lib/wsgiserver.py | Python | apache-2.0 | 74,280 |
# -*- coding: utf-8 -*-
"""
jsonq.core
Contains the core processing functions.
"""
from .utils import isArr, isDict
from itertools import imap
from operator import itemgetter
import string
import re
__all__ = ('jsonq')
_orderfn = ('filter',
'sort',
'min',
'max',
'dec... | ushma/jsonq | jsonq/core.py | Python | bsd-3-clause | 1,844 |
import pygame
import sys
class treasurePos(mapSelected):
def mapTreasurePos(self,mapSelected):
pygame.init()
#create display
self.size = width, height = 1280, 960
self.display = pygame.display.set_mode(self.size)
self.background = pygame.image.load(mapSelected)
self.display.blit(self.background,(0,0))
... | 502BadGateway/project_3 | treasurePlacement.py | Python | gpl-2.0 | 875 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | chenjun0210/tensorflow | tensorflow/python/framework/function_test.py | Python | apache-2.0 | 41,155 |
"""
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
from __future__ import unicode_literals
import logging
import re
from django.conf import settings
from django.urls import get_callable
from django.utils.cache import... | gchp/django | django/middleware/csrf.py | Python | bsd-3-clause | 9,908 |
from .ucomm_server import UCommServer, UCommServerHandler, ResultForwardingClient
| sultanoid/Gabriel | server/gabriel/ucomm/__init__.py | Python | apache-2.0 | 82 |
# -*- coding: utf-8 -*-
#
# Copyright (C)2005-2009 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.e... | apache/bloodhound | trac/trac/db/api.py | Python | apache-2.0 | 13,510 |
#!/usr/bin/env python
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) | | .` | (_) || | | _|| |) | | ... | rhdedgar/openshift-tools | ansible/roles/lib_gcloud/library/gcloud_iam_sa_keys.py | Python | apache-2.0 | 21,371 |
../../../../share/pyshared/PIL/PcxImagePlugin.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/PIL/PcxImagePlugin.py | Python | gpl-3.0 | 48 |
from setuptools import setup, find_packages
packages = ['irclogview',
'irclogview.management',
'irclogview.management.commands']
setup(
name = 'irclogview',
version = '0.1',
url = 'https://github.com/fajran/irclogview',
license = 'AGPL 3.0',
description = 'IRC Log viewer fo... | BlankOn/irclogview | setup.py | Python | agpl-3.0 | 530 |
#!/usr/bin/env python
'''
GOAL:
- this code contains all of the code to make figures for paper1
REQUIRED MODULES
- LCSbase.py
'''
###########################
###### IMPORT MODULES
###########################
import LCSbase as lb
from matplotlib import pyplot as plt
import numpy as np
import os
from LCScommon imp... | rfinn/LCS | python27/LCSpaper1.py | Python | gpl-3.0 | 46,366 |
#
# Unit tests for BCDataStream class
#
import unittest
import BCDataStream
class Tests(unittest.TestCase):
def setUp(self):
self.ds = BCDataStream.BCDataStream()
def testString(self):
t = {
"\x07setting" : "setting",
"\xfd\x00\x07setting" : "setting",
"\xfe\x00\x00\x00\x07setting" : "... | bankonme/bitcointools | testBCDataStream.py | Python | mit | 545 |
# testExplorer -
import sys
import os
import win32com.client.dynamic
from win32com.client import Dispatch
import win32api
import win32gui
import win32con
import winerror
import glob
import pythoncom
import time
from win32com.test.util import CheckClean
bVisibleEventFired = 0
class ExplorerEvents:
def OnVisible(s... | sserrot/champion_relationships | venv/Lib/site-packages/win32com/test/testExplorer.py | Python | mit | 3,636 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
import sys
from urllib.parse import unquote
from urllib.parse import urlsplit
# default to using the preferred media-types ffrom the epub 3.2 spec
# https://www.w3.org/publishing/epub3/epub-spec.html#sec-cmt-supported
ex... | mihailim/Sigil | src/Resource_Files/plugin_launchers/python/hrefutils.py | Python | gpl-3.0 | 12,803 |
from django.db import models
class Train(models.Model):
''' Train Information '''
number = models.IntegerField(unique=True)
name = models.CharField(max_length=300)
date = models.DateField()
departure = models.TimeField(blank=True, null=True)
arrival = models.TimeField(blank=True, null=True)
... | vaibhavmule/reservation | booking/models.py | Python | mit | 2,046 |
"""Precip metrics"""
import calendar
import numpy as np
import pandas as pd
from pyiem.plot import figure
from pyiem.util import get_autoplot_context, get_sqlalchemy_conn
from pyiem.exceptions import NoDataFound
PDICT = {"yes": "Yes, consider trace reports", "no": "No, omit trace reports"}
def get_description():
... | akrherz/iem | htdocs/plotting/auto/scripts100/p105.py | Python | mit | 4,123 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# uptick documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 5 14:06:38 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | xeroc/uptick | docs/conf.py | Python | mit | 9,218 |
"""
Bundles functions needed to target text content and validate the input.
"""
## This file is available from https://github.com/adbar/courlan
## under GNU GPL v3 license
import re
from urllib.parse import urlparse
# content filters
WORDPRESS_CONTENT_FILTER = re.compile(r'/(?:page|seite|user|search|gallery|gall?... | adbar/url-tools | courlan/filters.py | Python | gpl-2.0 | 4,915 |
#!/usr/bin/env python
"""Mandelbrot set computed in parallel using python-csp.
Multiple-producer, single consumer architecture.
"""
from csp.csp import *
import logging, math, Numeric, pygame, time
__author__ = 'Sarah Mount <s.mount@wlv.ac.uk>'
__date__ = 'December 2008'
MAXITER = 100
"""@var: Number of iterations ... | bjlittle/python-csp | examples/mandelbrot/mandelbrot-noalt.py | Python | gpl-2.0 | 6,553 |
"""
Implementing MIB objects
++++++++++++++++++++++++
This script explains how SNMP Agent application could model
real-world data as Managed Objects defined in MIB.
"""#
from pysnmp.smi import builder
# MIB Builder is normally pre-created by SNMP engine
mibBuilder = builder.MibBuilder()
#
# This may be done in a st... | etingof/pysnmp | examples/smi/agent/custom-managed-object.py | Python | bsd-2-clause | 2,035 |
## Copyright (c) MediaArea.net SARL. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license that can
# be found in the License.html file in the root of the source tree.
##
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# Python (Windows) example
#
# ... | xucp/mpc_hc | src/thirdparty/MediaInfo/library/Source/Example/HowToUse_Dll3.py | Python | gpl-3.0 | 2,377 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutTuples(Koan):
def test_creating_a_tuple(self):
count_of_three = (1, 2, 5)
self.assertEqual(5, count_of_three[2])
def test_tuples_are_immutable_so_item_assignment_is_not_possible(self):
count_of_three =... | schodge/python_koans | python3/koans/about_tuples.py | Python | mit | 2,302 |
/*Owner & Copyrights: Vance King Saxbe. A.*/from GoldSaxEngineChinaMarkets import goldsaxenginechinamarkets
goldsaxenginechinamarkets.start()
/*email to provide support at vancekingsaxbe@powerdominionenterprise.com, businessaffairs@powerdominionenterprise.com, For donations please write to fundraising@powerdominionen... | VanceKingSaxbeA/GoldSaxEngineChinaMarkets | goldsaxenginestart.py | Python | lgpl-3.0 | 334 |
"""Component to allow running Python scripts."""
import datetime
import glob
import logging
import os
import time
import voluptuous as vol
from homeassistant.const import SERVICE_RELOAD
from homeassistant.exceptions import HomeAssistantError
from homeassistant.loader import bind_hass
from homeassistant.util import sa... | fbradyirl/home-assistant | homeassistant/components/python_script/__init__.py | Python | apache-2.0 | 7,004 |
#!/usr/bin/env python
# Copyright 2015 Jason Edelman <jason@networktocode.com>
# Network to Code, 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/LI... | joergullrich/virl-lab | library/ntc_reboot.py | Python | gpl-3.0 | 6,997 |
from SBaaS_base.postgresql_orm_base import *
class data_stage01_rnasequencing_analysis(Base):
__tablename__ = 'data_stage01_rnasequencing_analysis'
id = Column(Integer, Sequence('data_stage01_rnasequencing_analysis_id_seq'), primary_key=True)
analysis_id = Column(String(500))
experiment_id = Column(Str... | dmccloskey/SBaaS_rnasequencing | SBaaS_rnasequencing/stage01_rnasequencing_analysis_postgresql_models.py | Python | mit | 2,579 |
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS 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 (... | ppiotr/Bibedit-some-refactoring | modules/websession/lib/webaccount.py | Python | gpl-2.0 | 16,718 |
import json
import logging
import threading
import redis
import time
LOG = logging.getLogger(__name__)
def bootstrap_cache(host='127.0.0.1', password=None):
pool = redis.ConnectionPool(host=host, password=password)
return redis.StrictRedis(connection_pool=pool)
def connect_to_cache():
import os
c... | eve-basil/common | basil_common/caching.py | Python | apache-2.0 | 3,926 |
from django.contrib import admin
from management.models import UserProfile, Office
class ProfileAdmin(admin.ModelAdmin):
exclude = ('user_permissions', 'last_login', 'date_joined', 'birthday', 'is_superuser')
# actions = ['make_something']
# def make_something(self, request, queryset):
# if not r... | trivago-ggarrido/PsyAna | management/admin.py | Python | gpl-2.0 | 764 |
import django
from django.conf.urls import include, url
from django.conf import settings
from django.views.generic import TemplateView
from django.contrib import admin
from rest_framework import routers
#router = routers.DefaultRouter()
urlpatterns = [
#url(r'^', include(router.urls)),
url(r'^api/', include('... | AndyKrivovjas/notes | app/urls.py | Python | mit | 1,091 |
# This file is part of aoc2016.
#
# aoc2016 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.
#
# aoc2016 is distributed in the hope th... | T-R0D/JustForFun | aoc2016/aoc2016/day01/gridhistory.py | Python | gpl-2.0 | 1,526 |
peso = float(input('informe o peso '))
excesso = 0.0
multa = 0
if peso > 50:
exesso = peso - 50
multa = exesso * 4
print('exesso: %2.3f\nMulta R$%2.2f' %(exesso, multa))
| GlauberGoncalves/Python | Lista PythonBrasil/exer14.py | Python | mit | 181 |
import Cellule
from PyQt4 import Qt
class Widget( Qt.QWidget ):
def sizeHint( self ):
return Qt.QSize( 350, 250 )
def __init__( self, parent ):
Qt.QWidget.__init__( self, parent )
# Menus
#
menuBar = Qt.QMenuBar( self )
... | juliango202/Cellule | appli/scripts/Console.py | Python | gpl-2.0 | 8,591 |
"""Utilities for working with files."""
import datetime
import errno
import logging
import grp
import os
import os.path
import pwd
import re
import shutil
import socket
import stat as stat_fn
import tempfile
import time
import boto.utils
log = logging.getLogger(__name__)
def file_size(file_path):
"""Returns th... | amorton/cassback | cassback/file_util.py | Python | bsd-3-clause | 4,663 |
import readBoard as rb
import copy
class State():
def __init__(self, board, path, fourSpawned, probability, EV):
self.board = board
self.path = path
self.fourSpawned = fourSpawned
self.probability = probability
self.EV = EV
#Move the tile at (i1,j1) into the position of (i2,j2) and combine th... | OrmondHugh/2048Bot | src/src/State.py | Python | mit | 4,255 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.