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 |
|---|---|---|---|---|---|
# Written by Boudewijn Schoon
# see LICENSE.txt for license information
# the extention id for the 'ut_metadata' message
EXTEND_MSG_METADATA = 'ut_metadata'
EXTEND_MSG_METADATA_ID = chr(224)
| egbertbouman/tribler-g | Tribler/Core/DecentralizedTracking/MagnetLink/__init__.py | Python | lgpl-2.1 | 203 |
#!/usr/bin/env python
# rebase.py
# Copyright (c) 2013-2016 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111,F0401,R0914,W0141
# Standard library imports
from __future__ import print_function
import argparse
import difflib
import os
import shutil
import stat
import sys
# Putil imports
import sb... | pmacosta/putil | sbin/rebase.py | Python | mit | 4,662 |
# partial --== Decompile ==-- with fixes
import Live
from _Framework.TransportComponent import TransportComponent
from _Framework.ButtonElement import ButtonElement
from _Framework.EncoderElement import EncoderElement #added
class ShiftableTransportComponent(TransportComponent):
__doc__ = ' TransportComponent that... | jim-cooley/abletonremotescripts | remote-scripts/samples/APC40_20/ShiftableTransportComponent.py | Python | apache-2.0 | 9,766 |
'''Bubble sort'''
import os
def pedirNumeros():
vetor = []
while True:
try:
num = int(input("Digite um valor ou qualquer letra para sair: "))
vetor.append(num)
except:
break
return vetor
def bubbleSort(vetor):
if len(vetor) <= 1:
return vetor
else:
for x in range(0, len(vetor)):
for i in r... | PablNico/ScriptsAndMore | python/bubblesort.py | Python | gpl-3.0 | 533 |
# -*- coding: utf-8 -*-
"""Init and utils."""
from zope.i18nmessageid import MessageFactory
_ = MessageFactory('stv.sitecontent')
def initialize(context):
"""Initializer called when used as a Zope 2 product."""
| a25kk/stv | src/stv.sitecontent/stv/sitecontent/__init__.py | Python | mit | 219 |
# Authors: Alexandre Gramfort <[email protected]>
# Denis Engemann <[email protected]>
# Martin Luessi <[email protected]>
# Eric Larson <[email protected]>
#
# License: Simplified BSD
import os.path as op
import warnings
import numpy as np
from ... | rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | python-packages/mne-python-0.10/mne/viz/tests/test_topomap.py | Python | bsd-3-clause | 10,198 |
#
# BitBox02 Electrum plugin code.
#
import hid
from typing import TYPE_CHECKING, Dict, Tuple, Optional, List, Any, Callable
from electrum_grs import bip32, constants
from electrum_grs.i18n import _
from electrum_grs.keystore import Hardware_KeyStore
from electrum_grs.transaction import PartialTransaction
from electr... | GroestlCoin/electrum-grs | electrum_grs/plugins/bitbox02/bitbox02.py | Python | gpl-3.0 | 27,314 |
"""
WSGI config for zulip project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... | showell/zulip | zproject/wsgi.py | Python | apache-2.0 | 1,909 |
#! /usr/bin/env python
"""
A parser for the -m 8 blast output
"""
import sys
if len(sys.argv) != 2:
print "USAGE: blast-table-parser.py <blat file>"
sys.exit(1)
CONTIG_THRESHOLD = 1000
E_THRESHOLD = 1e-5
IDENTITY_THRESHOLD = 30
dict = {}
#Query id,Subject id,% identity,alignment length,mismatches,gap ope... | fandemonium/code | tiedje-scripts/blast-table-parser.py | Python | mit | 848 |
#!/usr/bin/env python
# Copyright (c) 2005-2009 Jaroslav Gresula
#
# Distributed under the MIT license (See accompanying file
# LICENSE.txt or copy at http://jagpdf.org/LICENSE.txt)
#
import jagpdf
import jag.testlib as testlib
def do_document(argv, name, cfg_opts):
cfg = testlib.test_config()
for k, v in cf... | jgresula/jagpdf | code/test/apitest/py/encrypt.py | Python | mit | 1,689 |
from .postman import Postman
from ._sanitise import sanitise
| wtsi-hgi/CoGS-Webapp | cogs/mail/__init__.py | Python | agpl-3.0 | 61 |
import ast
import collections
import contextlib
import copy
import functools
import itertools
import logging
import os
import subprocess
import sys
import tempfile
from .third_party.google.protobuf import text_format
from . import package_pb2
class UncleanFilesystemError(Exception):
pass
class InconsistentDepend... | shishkander/recipes-py | recipe_engine/package.py | Python | bsd-3-clause | 19,649 |
# Problem 1581. Teamwork
# http://acm.timus.ru/problem.aspx?space=1&num=1581
total = int(raw_input())
numbers = map(int,raw_input().split())
i = 0
count = 1
while i < total:
if (i+1 < total) and (numbers[i+1] == numbers[i]):
count += 1
else:
print count, numbers[i],
count = 1
i += 1 | mil3na/code-challenges | timus/python/p1581.py | Python | gpl-2.0 | 296 |
from .core.State import State
import time
from .utils.stickers import is_sticker
from vkapp.bot.dao import usersDAO, newsDAO, moneyDAO
import json
PROPOSAL_AMOUNT=1
PUBLISH_AMOUNT=100
MAX_DAILY_NEWS=10
class BootStrapState(State):
def on_trigger(self, trigger):
usersDAO.new_blogger(trigger.current_uid)
... | ParuninPavel/lenta4_hack | vkapp/bot/logic/user_states.py | Python | mit | 9,904 |
"""
Taiga integration for Zulip.
Tips for notification output:
*Emojis*: most of the events have specific emojis e.g.
- :notebook: - change of subject/name/description
- :chart_with_upwards_trend: - change of status
etc. If no there's no meaningful emoji for certain event, the defaults are used:
- :thought_balloon: -... | jphilipsen05/zulip | zerver/webhooks/taiga/view.py | Python | apache-2.0 | 11,630 |
# encoding: utf-8
# module gtk.gdk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/pynotify/_pynotify.so
# by generator 1.135
# no doc
# imports
from exceptions import Warning
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
import pango as __pango
import pangocairo as __p... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/gdk/__init__/PixbufSimpleAnim.py | Python | gpl-2.0 | 866 |
"""
TR-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select, CharField
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/contrib/localflavor/tr/forms.py | Python | bsd-3-clause | 3,430 |
# Copyright (C) 2018 ASTRON (Netherlands Institute for Radio Astronomy)
# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as publish... | kernsuite-debian/lofar | LTA/ltastorageoverview/lib/ingesteventhandler.py | Python | gpl-3.0 | 5,055 |
from __future__ import print_function
import torchfile
import numpy as np
EMBEDDING = torchfile.load('../lstm-char-cnn/param_init_1.t7')
KERNEL_1_W = torchfile.load('../lstm-char-cnn/param_init_2.t7')
KERNEL_1_B = torchfile.load('../lstm-char-cnn/param_init_3.t7')
LSTM_1_W = torchfile.load('../lstm-char-cnn/param_i... | mkroutikov/tf-lstm-char-cnn | read_param_init.py | Python | mit | 3,410 |
import fs
import json
print('--- start ---')
t = fs.open_fs('osfs://.')
for f in t.scandir('/', namespaces=['details']):
print( f.raw )
t.close()
print('--- end ---')
| dagnelies/restfs | fstest.py | Python | mit | 176 |
"""
Dingemans Wave Shoaling
"""
from proteus import Domain, Context
from proteus.mprans import SpatialTools as st
from proteus import WaveTools as wt
from math import *
import numpy as np
opts=Context.Options([
# predefined test cases
("water_level", 0.86, "Height of free surface above seabed"),
# tank
... | erdc-cm/air-water-vv | 2d/waveTransformation/Dingemans_wave_shoaling/DingemansWaveShoaling.py | Python | mit | 13,687 |
import pkg_resources
pkg_resources.require( "Cheetah" )
from Cheetah.Template import Template
def fill_template( template_text, context=None, **kwargs ):
if not context:
context = kwargs
return str( Template( source=template_text, searchList=[context] ) )
| mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/lib/galaxy/util/template.py | Python | gpl-3.0 | 274 |
# !/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for Test event formatter."""
import unittest
from plaso.formatters import test
from tests.formatters import test_lib
class TestTheuserFormatterTest(test_lib.EventFormatterTestCase):
"""Tests the Test theuser event formatter."""
def testInitialization(self):
... | ClaudiaSaxer/PlasoScaffolder | src/tests/end_to_end_test/ExpectedEasyGenerationRowNameFiles/formatters_test.py | Python | apache-2.0 | 1,531 |
# -*- coding: utf-8 -*-
#
# OpenStack Command Line Client documentation build configuration file, created
# by sphinx-quickstart on Wed May 16 12:05:58 2012.
#
# 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... | BjoernT/python-openstackclient | doc/source/conf.py | Python | apache-2.0 | 8,560 |
from ctypes import *
class TfsTask(Structure):
_fields_ = [
("title", c_char_p),
("description", c_char_p),
("id", c_long)
]
class TfsTaskList(Structure):
pass
TfsTaskList._fields_ = [
("task", TfsTask),
("next", POINTER(TfsTaskList))
]
class TfsWrapper(object):
def __init__(self):
self.lib = cdl... | zaibacu/PyTfs | libs/TfsWrapper.py | Python | mit | 907 |
"""
QuerySets for the FOIA application
"""
# Django
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.db import models
from django.db.models import Count, F, Max, OuterRef, Q, Subquery, Sum
from django.utils import timezone
from django.utils.text import slugify
# Standa... | MuckRock/muckrock | muckrock/foia/querysets.py | Python | agpl-3.0 | 18,338 |
# tlseabra@github
def not_McNugget(n):
mcn = lambda x: x != 3 and (x > 43 or x % 3 == 0)
for i in range(1, n+1):
d = i
while i >= 0:
if mcn(i): break
i -= 20
else: print(d)
| FreddieV4/DailyProgrammerChallenges | Intermediate Challenges/Challenge 0023 Intermediate/solutions/solution.py | Python | mit | 230 |
# General information about the project.
project = u'Triangula'
copyright = u'2015, Tom Oinn'
author = u'Tom Oinn'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
ver... | BaseBot/Triangula | src/docs/conf.py | Python | apache-2.0 | 6,075 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-12 13:15
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... | chrisdavidmills/django_local_library | catalog/migrations/0002_bookinstance_borrower.py | Python | mpl-2.0 | 663 |
# coding=utf-8
from qgis.core import (
QgsCoordinateTransform,
QgsRectangle,
QgsGeometry,
QgsPoint,
QgsCoordinateReferenceSystem,
QGis)
from qgis.gui import QgsRubberBand # pylint: disable=no-name-in-module
# noinspection PyPackageRequirements
from PyQt4.QtCore import QSettings, Qt
from safe.... | Gustry/inasafe | safe/utilities/extent.py | Python | gpl-3.0 | 8,459 |
# encoding: utf-8
from __future__ import print_function
import argparse
import os
from os.path import splitext
import platform
import traceback
import sys
import warnings
# this is needed for vitables and needs to happen BEFORE
# matplotlib.use('Qt4Agg')
# (which imports PyQt)
try:
import sip
... | benjello/liam2 | liam2/main.py | Python | gpl-3.0 | 14,344 |
import unittest
from infi.clickhouse_orm import F
from .base_test_with_data import *
from time import sleep
class MutationsTestCase(TestCaseWithData):
def setUp(self):
super().setUp()
if self.database.server_version < (18,):
raise unittest.SkipTest('ClickHouse version too old')
... | Infinidat/infi.clickhouse_orm | tests/test_mutations.py | Python | bsd-3-clause | 3,619 |
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | harshilasu/LinkurApp | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/manage/cmdshell.py | Python | gpl-3.0 | 8,585 |
"""Tests"""
import pytest
class TestDunder():
def test_contains(self, poff):
assert "a" not in poff
poff.append("a")
assert "a" in poff
def test_eq_repr_str(self, poff):
assert repr(poff) == str(poff) == poff == ""
poff.append("a")
assert repr(poff) == str(pof... | chingc/pxml | tests/test_pyhtml.py | Python | bsd-2-clause | 7,297 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals # unicode by default
import sys
import datetime
from collections import OrderedDict
import pandoc
#import bib
from flask import Flask
from flask import render_template, redirect, url_for
from flaskext.babel import Babel
from flask... | lem-usp/site-bio208 | site.py | Python | mit | 4,354 |
# Copyright 2008 Mike Wakerly <[email protected]>
#
# This file is part of the Kegboard package of the Kegbot project.
# For more information on Kegboard or Kegbot, see http://kegbot.org/
#
# Kegboard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | Indemnity83/kegboard | python/kegbot/kegboard/kegboard.py | Python | gpl-2.0 | 6,596 |
'''
Created on Mar 31, 2011
@author: Stephen O'Hara
Colorado State University
All Rights Reserved
High level functions for implementing KTH data partitioning.
Standard partition is set5 = training, sets 1-4 for testing.
It is also instructive to try leave-one-set-out protocols,
so a partitioning for that strategy is ... | Sciumo/ProximityForest | evaluation/action_data_sets/cambridgeGestures/Protocol.py | Python | gpl-3.0 | 2,973 |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... | DevilFruit99/GooglePythonClass | basic/string1.py | Python | apache-2.0 | 3,686 |
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.db import connection
from django.shortcuts import get_object_or_404
from tenant_schemas.utils import get_tenant_model, remove_www_and_dev, get_public_schema_name
class T... | jrutila/django-tenant-schemas | tenant_schemas/middleware.py | Python | mit | 2,043 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 Florian Bruhin (The Compiler) <[email protected]>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | toofar/qutebrowser | qutebrowser/mainwindow/statusbar/bar.py | Python | gpl-3.0 | 15,236 |
# 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... | alshedivat/tensorflow | tensorflow/python/data/experimental/kernel_tests/optimization/map_and_filter_fusion_test.py | Python | apache-2.0 | 4,199 |
# Copyright 2017 Starbot Discord Project
#
# 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... | dhinakg/BitSTAR | plugins/botutils.py | Python | apache-2.0 | 17,211 |
"""
Functional tests to test the AppLocation class and related methods.
"""
from unittest import TestCase
from mock import patch
from openlp.core.utils import AppLocation
class TestAppLocation(TestCase):
"""
A test suite to test out various methods around the AppLocation class.
"""
def get_data_path_... | marmyshev/transitions | tests/functional/openlp_core_utils/test_applocation.py | Python | gpl-2.0 | 5,072 |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test PrioritiseTransaction code
#
from test_framework.test_framework import BitcoinTestFramework
fro... | magacoin/magacoin | qa/rpc-tests/prioritise_transaction.py | Python | mit | 5,960 |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import unhexlif... | Emercoin/emercoin | test/functional/test_framework/util.py | Python | gpl-3.0 | 22,858 |
import timeit
import gevent
import math
from gevent.queue import Queue
from detail import AnimeDetail
from gen_id_file import IDS_FILENAME
from gevent import monkey; monkey.patch_socket()
DETAILS_FILENAME = 'animes.xml'
BATCH_SIZE = 10
WORKER_NUM = 8
MAXIMUM_WORKER_NUM = 8
NAMES_FOR_WORKER = ['Joe', 'Adam', 'Matt',... | hanjoes/anivis | api/gen_detail_file.py | Python | mit | 2,013 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: Mani
# @Date: 2017-08-28 19:20:58
# @Last Modified time: 2017-09-27 12:54:55
#
##############################################
import mani_config
import docker_config
import emby_config
SERVICE_CONFIG_OPTIONS = {
"embyserver" : {
"module":"emby... | maninator/manimediaserver | setup/lib/mani_controller.py | Python | gpl-3.0 | 2,431 |
# Copyright (C) 2013 University of Southampton
# Copyright (C) 2013 Daniel Alexander Smith
# Copyright (C) 2013 Max Van Kleek
# Copyright (C) 2013 Nigel R. Shadbolt
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, v... | sociam/indx | lib/indx/user.py | Python | agpl-3.0 | 17,310 |
#
# 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... | nathanielvarona/airflow | tests/providers/google/cloud/transfers/test_cassandra_to_gcs.py | Python | apache-2.0 | 4,021 |
# -*- coding: utf-8 -*-
"""Installer for this package."""
from setuptools import setup
from setuptools import find_packages
import os
# shamlessly stolen from Hexagon IT guys
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
version = '0.1dev'
setup(name='pipaalarm',
... | kiberpipa/pipaalarm | setup.py | Python | bsd-3-clause | 1,507 |
from django.conf import settings
from .base import BaseStaticSiteRenderer
from .disk import DiskStaticSiteRenderer
from .appengine import GAEStaticSiteRenderer
from .s3 import S3StaticSiteRenderer
from importlib import import_module
__all__ = ('BaseStaticSiteRenderer', 'DiskStaticSiteRenderer',
'S3StaticS... | botify-labs/django-medusa | django_medusa/renderers/__init__.py | Python | mit | 911 |
def extractIsogashiineetoCom(item):
'''
Parser for 'isogashiineeto.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'L... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractIsogashiineetoCom.py | Python | bsd-3-clause | 549 |
#
# Copyright (c) 2009 Canonical
#
# Written by Gustavo Niemeyer <[email protected]>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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;... | blackPantherOS/packagemanagement | smartpm/smart/plugins/landscape.py | Python | apache-2.0 | 1,481 |
# Stores data about the sequence
# NEEDS TO BE SYNCH WITH THE REST OF BIOPYTHON AND BIOPERL
# In particular, the SeqRecord and BioSQL.BioSeq.DBSeqRecord classes
# need to be in sync (this is the BioSQL "Database SeqRecord", see
# also BioSQL.BioSeq.DBSeq which is the "Database Seq" class)
class SeqRecord:
"""A Se... | dbmi-pitt/DIKB-Micropublication | scripts/mp-scripts/Bio/SeqRecord.py | Python | apache-2.0 | 4,392 |
# gcompris - hangman.py
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003, 2008 Bruno Coudoin
#
# 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 yo... | bdoin/GCompris | src/hangman-activity/hangman.py | Python | gpl-3.0 | 18,192 |
# Copyright 2013 Big Switch Networks, 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... | samsu/neutron | services/firewall/fwaas_plugin.py | Python | apache-2.0 | 12,362 |
#!/usr/bin/env python
from couchbase.bucket import Bucket
cb = Bucket('couchbase://localhost/default')
manager = cb.bucket_manager()
manager.n1ql_index_create_primary(ignore_exists=True) | couchbaselabs/devguide-examples | python/n1ql-create-primary-index.py | Python | apache-2.0 | 188 |
import subprocess
from flask import Flask, render_template, request
app = Flask(__name__)
def outer(outer_arg):
outer_ret_val = outer_arg + 'hey'
return outer_ret_val
def inner(inner_arg):
inner_ret_val = inner_arg + 'hey'
return inner_ret_val
@app.route('/menu', methods=['POST'])
def menu():
re... | python-security/pyt | examples/nested_functions_code/sink_with_result_of_user_defined_nested.py | Python | gpl-2.0 | 560 |
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
CURRENT_DIR = os.path.dirname(__file__)
setup(name='datapot',
description='Library for automatic feature extraction from JSON-datasets',
long_description=open(os.path.join(CURRENT_DIR, 'README.rst')).read(),
version='0.1.3'... | bashalex/datapot | setup.py | Python | gpl-3.0 | 1,582 |
from django.core.exceptions import ValidationError
from django.core.validators import validate_email
from email.utils import parseaddr
def is_pretty_from_address(input):
name, email = parseaddr(input)
if email == 'webmaster@localhost':
# This is the default setting for DEFAULT_FROM_EMAIL, so if
... | dominicrodger/djohno | djohno/utils.py | Python | bsd-2-clause | 581 |
# -*- coding: utf-8 -*-
"""Some utility functions."""
# Authors: Alexandre Gramfort <[email protected]>
#
# License: BSD (3-clause)
import contextlib
import inspect
from io import StringIO
import re
import sys
import logging
import os.path as op
import warnings
from ..externals.decorator import FunctionMake... | olafhauk/mne-python | mne/utils/_logging.py | Python | bsd-3-clause | 16,826 |
"""Reads vehicle status from BMW connected drive portal."""
import asyncio
import logging
from bimmer_connected.account import ConnectedDriveAccount
from bimmer_connected.country_selector import get_region_from_name
import voluptuous as vol
from homeassistant.components.notify import DOMAIN as NOTIFY_DOMAIN
from home... | tboyce021/home-assistant | homeassistant/components/bmw_connected_drive/__init__.py | Python | apache-2.0 | 11,147 |
#!/usr/bin/python3
import sys
import os
def printUsage():
sys.exit('Usage: %s server|client' % sys.argv[0])
if ((len(sys.argv)!=2) or (sys.argv[1] != 'client') and (sys.argv[1] != 'server')):
printUsage()
print("Generating daemon script\n")
fileContents = open('dyndns.sh').read( os.path.getsize('dyndns.sh') )
fi... | MilkyWeb/dyndns | install.py | Python | mit | 881 |
import bpy
def proxy_sync_loc(self, context):
if context.object == None or context.object.proxy == None:
return
if context.object.arm_proxy_sync_loc:
sync_location(context.object)
def proxy_sync_rot(self, context):
if context.object == None or context.object.proxy == None:
return
... | luboslenco/cyclesgame | blender/arm/proxy.py | Python | lgpl-3.0 | 4,104 |
# Copyright 2012 OpenStack Foundation
# 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 requ... | vedujoshi/os_tempest | tempest/api/compute/servers/test_list_server_filters.py | Python | apache-2.0 | 12,020 |
import numpy as np
from astropy import units as u
from astropy.wcs import WCS, WCSSUB_SPECTRAL
from .wcs_utils import get_spectral_scale
def slice_wcs(wcs, spatial_scale):
"""
Slice a WCS header for a spectral cube to a Position-Velocity WCS, with
ctype "OFFSET" for the spatial offset direction
Para... | bsipocz/glue | glue/external/pvextractor/utils/wcs_slicing.py | Python | bsd-3-clause | 1,042 |
# -*- coding: utf-8 -*-
#
# Copyright 2010-2013 The cygit2 contributors
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2,
# as published by the Free Software Foundation.
#
# In addition to the permissions in the GNU General Public Li... | sjagoe/cygit2 | cygit2/pygit2/reference.py | Python | gpl-2.0 | 2,663 |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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... | pferreir/indico-backup | bin/utils/VSGuideHTMLFix.py | Python | gpl-3.0 | 4,708 |
'''
Created by auto_sdk on 2015.04.21
'''
from aliyun.api.base import RestApi
class Rds20140815RevokeAccountPrivilegeRequest(RestApi):
def __init__(self,domain='rds.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.AccountName = None
self.DBInstanceId = None
self.DBName = None
def g... | wanghe4096/website | aliyun/api/rest/Rds20140815RevokeAccountPrivilegeRequest.py | Python | bsd-2-clause | 401 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-09-08 16:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("accounts", "0006_auto_20160713_0913"),
]
operations = [
migrations.AlterFie... | erudit/eruditorg | eruditorg/core/accounts/migrations/0007_auto_20170908_1104.py | Python | gpl-3.0 | 734 |
'''staagg: Python library to retrieve commission data from Stagg Web service
'''
__version__ = '1.0'
__author__ = 'Siddharth Saha ([email protected])'
import xml.etree.ElementTree as ET
import requests
class Staagg(object):
BASE_URL = 'http://www.staagg.com/webservices/v4'
key = ''
start_date =... | sidchilling/staagg | staagg/staagg.py | Python | mit | 4,171 |
# REQUIRES: python-psutil
# Test per test timeout using external shell
# RUN: not %{lit} \
# RUN: %{inputs}/shtest-timeout/infinite_loop.py \
# RUN: %{inputs}/shtest-timeout/quick_then_slow.py \
# RUN: %{inputs}/shtest-timeout/short.py \
# RUN: %{inputs}/shtest-timeout/slow.py \
# RUN: -j 1 -v --debug --timeout 1 --pa... | cd80/UtilizedLLVM | utils/lit/tests/shtest-timeout.py | Python | unlicense | 5,027 |
import os
from parglare import Grammar
this_folder = os.path.dirname(__file__)
def test_fqn_constructed_by_first_import_path():
g = Grammar.from_file(os.path.join(this_folder, 'A.pg'))
assert g.get_terminal('B.C.CTerm')
assert not g.get_terminal('C.CTerm')
assert g.get_nonterminal('B.C.CRule')
... | igordejanovic/parglare | tests/func/import/fqn/test_fqn.py | Python | mit | 360 |
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import CreateMixin, DeleteMixin, ListMixin, ObjectDeleteMixin
__all__ = [
"GroupAccessToken",
"GroupAccessTokenManager",
]
class GroupAccessToken(ObjectDeleteMixin, RESTObject):
pass
class GroupAccessTokenManager(ListMixin, CreateMixin,... | python-gitlab/python-gitlab | gitlab/v4/objects/group_access_tokens.py | Python | lgpl-3.0 | 471 |
from coco.admin.forms import CollaborationGroupAdminForm, ShareAdminForm
from coco.core.models import *
from coco.core.management.commands import import_users
from django_admin_conf_vars.models import ConfigurationVariable
from django.conf.urls import patterns
from django.contrib import admin, messages
from django.cont... | coco-project/coco | coco/admin/admin.py | Python | bsd-3-clause | 18,284 |
import wandb
import keras
import numpy as np
import tensorflow as tf
from wandb.keras import WandbCallback
def main():
#wandb.init(project="tf2")
wandb.init()
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Conv2D(
3, 3, activation="relu", input_shape=(28, 28, 1)))
model.add... | wandb/client | standalone_tests/mixed_keras.py | Python | mit | 698 |
#!/usr/bin/python
import os
import glob
import numpy as np
import networkx as nx
from mcl_clustering import networkx_mcl
from os import path
from datetime import datetime, timedelta
from collections import namedtuple
DATA_DIR = os.getenv('DATA_DIR', r"C:\Users\Jon\Documents\UIUC\CS 538\project\data")
def load_loc_r... | josting/CS538_Project | ideas.py | Python | mit | 4,897 |
# 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... | asimshankar/tensorflow | tensorflow/python/keras/optimizer_v2/nadam.py | Python | apache-2.0 | 5,695 |
# Copyright (c) 2016 Matthew Earl
#
# 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, distr... | matthewearl/photo-a-day-aligner | pada/landmarks.py | Python | mit | 2,163 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-01-30 20:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lots_admin', '0035_application_closing_invite_sent'),
]
operations = [
migrat... | datamade/large-lots | lots_admin/migrations/0036_application_organization_confirmed.py | Python | mit | 487 |
"""The test for the min/max sensor platform."""
from os import path
import statistics
import unittest
from homeassistant import config as hass_config
from homeassistant.components.min_max import DOMAIN
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
PERCENTAGE,
SERVICE_RELOAD,
STATE_UNAVAIL... | tchellomello/home-assistant | tests/components/min_max/test_sensor.py | Python | apache-2.0 | 13,832 |
"""NAMD molecular dynamics simulation datasets.
"""
from .access import load_tyr2ala
from .access import load_idws
from .access import load_restarted
from .access import load_restarted_reversed
| alchemistry/alchemtest | src/alchemtest/namd/__init__.py | Python | bsd-3-clause | 196 |
# -*- encoding: utf8 -*-
# A daemon to keep SSH forwarding connected
from __future__ import print_function, absolute_import
import os
import sys
import time
import socket
import logging
class Daemon(object):
def __init__(self):
self.heartbeat = 50
def run(self):
logging.basicConfig(filename=... | dlutxx/memo | python/daemon.py | Python | mit | 1,497 |
from fabric.api import task, local, run
from fabric.context_managers import lcd
import settings
@task(default=True)
def build():
"""
(Default) Build Sphinx HTML documentation
"""
with lcd('docs'):
local('make html')
@task()
def deploy():
"""
Upload docs to server
"""
build()
... | brady-vitrano/full-stack-django-kit | fabfile/docs.py | Python | mit | 877 |
"""
helpers.py: Helper functions for testing
Copyright 2014-2015, Outernet Inc.
Some rights reserved.
This software is free software licensed under the terms of GPLv3. See COPYING
file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.
"""
def strip_wrappers(fn):
""" For decorated fn, retu... | karanisverma/feature_langpop | tests/helpers.py | Python | gpl-3.0 | 585 |
#!/usr/bin/python
#
# Copyright 2012 Red Hat, Inc.
# Portions Copyright (C) 2012,2013 Chris Lalancette <[email protected]>
#
# 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
#
# ... | redhat-imaging/imagefactory | imagefactory_plugins/IndirectionCloud/IndirectionCloud.py | Python | apache-2.0 | 16,020 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('gallery', '0003_auto_20150925_0642'),
]
operations = [
migrations.CreateModel(
name='Medium',
fields... | mudbungie/carrieocoyle | gallery/migrations/0004_medium.py | Python | mit | 523 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "learning_site.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| davejlin/treehouse | python/django/learning_site_forms/manage.py | Python | unlicense | 256 |
# -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import logging
from odoo import api, models
from ..models.module_deprecated import PARAM_DEPRECATED
_logger = logging.getLogger(__name__)
class ModuleUpgrade(models.TransientModel):
_inherit =... | ovnicraft/server-tools | module_auto_update/wizards/module_upgrade_deprecated.py | Python | agpl-3.0 | 3,742 |
# -*- mode: python; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4; -*-
# vim: set shiftwidth=4 softtabstop=4 expandtab:
"""Admin objects for ncharts django web app.
2014 Copyright University Corporation for Atmospheric Research
This file is part of the "django-ncharts" package.
The license and distribution ... | ncareol/ncharts | ncharts/admin.py | Python | bsd-2-clause | 1,012 |
from __future__ import unicode_literals
import datetime
import sys
import unittest
from django.contrib.admin import (
AllValuesFieldListFilter, BooleanFieldListFilter, ModelAdmin,
RelatedOnlyFieldListFilter, SimpleListFilter, site,
)
from django.contrib.admin.views.main import ChangeList
from django.contrib.a... | benjaminjkraft/django | tests/admin_filters/tests.py | Python | bsd-3-clause | 46,487 |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Assign User role to all existing users.
Revision ID: 5b33357784a
Revises: 1afc3824d35b
Create Date: 2013-09-20 15:42:01.558543
"""
# revision identifiers, used by Alembic.
revision = '5b33357784a'
down... | AleksNeStu/ggrc-core | src/ggrc_basic_permissions/migrations/versions/20130920154201_5b33357784a_assign_user_role_to_.py | Python | apache-2.0 | 2,399 |
# __init__.py
# Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer [email protected]
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import inspect
from sqlalchemy.types import \
BLOB, BOOLEAN, CHAR, CLOB, DATE, DATETIME, DECI... | santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/SQLAlchemy-0.4.5-py2.5.egg/sqlalchemy/__init__.py | Python | bsd-3-clause | 1,363 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QAD Quantum Aided Design plugin
classe per gestire i simboli marcatori
-------------------
begin : 2013-05-22
copyright : iiiii
em... | geosim/QAD | qad_vertexmarker.py | Python | gpl-3.0 | 11,640 |
from horizon.test import helpers as test
class VmTests(test.TestCase):
# Unit tests for vm.
def test_me(self):
self.assertTrue(1 + 1 == 2)
| jorik041/shmoocon_2014_talk | caravan/caravan/dashboards/infrastructure/vm/tests.py | Python | bsd-2-clause | 157 |
# encoding=utf-8
import unittest
import unicodeblock.lower
class UniversalLower(unittest.TestCase):
def test_lower_kana(self):
self.assertEqual(
'ミカサ・アッカーマン',
unicodeblock.lower.lower_kanas('ミカサ・アッカーマン'))
self.assertEqual(
'ノビ太ノクセニ',
unicodeblock.l... | neuront/pyunicodeblock | test/ulower.py | Python | mit | 1,892 |
import bz2
import sys
import numpy as np
from csv import DictReader
if __name__ == '__main__':
if len(sys.argv) < 2:
print 'Usage: train.yzx.txt'
exit(-1)
file_all_name = "../../make-ipinyou-data/" + str(sys.argv[1]) + "/train.log.txt"
arr = []
for t, line in enumerate(DictRea... | orenov/optimal-rtb | python/bid_percentile.py | Python | apache-2.0 | 692 |
import looker_sdk
from looker_sdk import models
from looker_sdk.rtl import transport
import configparser
import hashlib
import csv
config_file = "../looker.ini"
sdk = looker_sdk.init31()
def main():
"""Compare the output of content validator runs
in production and development mode. Additional
broken cont... | looker-open-source/sdk-examples | python/content_validator_comparison.py | Python | mit | 5,525 |
""" BloomFilter and BloomFiter on Disk, python implementation
License: MIT
Author: Tyler Barrus ([email protected])
URL: https://github.com/barrust/bloom
"""
import math
import os
from array import array
from binascii import hexlify, unhexlify
from io import BytesIO, IOBase
from mmap import mmap
from number... | barrust/pyprobables | probables/blooms/bloom.py | Python | mit | 26,708 |
'''
A displayed box bounding the operand for feedback to user.
'''
'''
Copyright 2010, 2011 Lloyd Konneker
This file is part of Pensool.
Pensool 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 o... | bootchk/pensool | source/gui/boundingbox.py | Python | gpl-3.0 | 2,060 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.