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) 2010, quantumlemur
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions,... | kg-bot/SupyBot | plugins/Timebomb/plugin.py | Python | gpl-3.0 | 15,282 |
"""
Signal handler for enabling/disabling self-generated certificates based on the course-pacing.
"""
from __future__ import absolute_import
import logging
import six
from django.db.models.signals import post_save
from django.dispatch import receiver
from course_modes.models import CourseMode
from lms.djangoapps.cer... | ESOedX/edx-platform | lms/djangoapps/certificates/signals.py | Python | agpl-3.0 | 7,268 |
from pyxb_114.bundles.wssplat.raw.whttp import *
| msherry/PyXB-1.1.4 | pyxb_114/bundles/wssplat/whttp.py | Python | apache-2.0 | 49 |
"""
This module is intended to be use only for internal pourposes of
the Heracles library.
It includes the classes required to interact with libheracles structures.
"""
from ctypes import pointer
from heracles.structs import struct_tree_p, struct_tree
from heracles.tree import get_tree_from_nodes, get_node
from herac... | llou/heracles | heracles/raw.py | Python | lgpl-3.0 | 3,328 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# django-oscar-cch documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 16 14:04:42 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in ... | thelabnyc/django-oscar-cch | docs/conf.py | Python | isc | 10,340 |
# Python 2.7
# Requires splinter and phantomjs
from splinter import Browser
import os, zipfile
from safesetup import SafeSetup
browser = Browser('phantomjs')
#browser = Browser() # Debugging - runs in Firefox
class SafeSync:
url = ''
username = ''
password = ''
def __init__(self):
self.get_c... | BenElgar/SafeSync | safesync.py | Python | gpl-2.0 | 2,358 |
#!/usr/bin/python
"""Tests for wind"""
import unittest
from wind.datastructures import FlexibleDeque, CaseInsensitiveDict
class StreamTestCase(unittest.TestCase):
"""Tests for modules in wind.stream"""
def setUp(self):
pass
def tearDown(self):
pass
def test_socket_read_bytes(self):... | daftshady/wind | test_suite.py | Python | mit | 1,519 |
import pilas
import pickle
import sys
import json
from pilas.escena import Base
from tablero import Tablero
from musica import Sonido
from conf import Config
from creds import Credits
from ayuda import Ayuda
class Menu(Base):
def __init__(self, nombre):
Base.__init__(self)
self.nombre = nombr... | gercordero/va_de_vuelta | src/menu.py | Python | gpl-3.0 | 2,331 |
import uuid
import sys
import time
from studio.artifacts import artifacts_tracker
from studio.artifacts.artifact import Artifact
from studio.util.util import shquote
from studio.dependencies_policies.dependencies_policy import DependencyPolicy
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many... | studioml/studio | studio/experiments/experiment.py | Python | apache-2.0 | 5,846 |
def extract12Superlatives(item):
"""
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
return False
| fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extract12Superlatives.py | Python | bsd-3-clause | 215 |
"""Flake8 extension that checks Python modules for an __author__ attribute.
This extension can be configured to explicitly require or forbid __author__
attributes. By default, __author__ is optional.
If the __author__ attribute is allowed, its value will be validated against a
configurable regular expression pattern ... | jparise/flake8-author | flake8_author.py | Python | mit | 3,237 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | mcldev/geonode | geonode/upload/utils.py | Python | gpl-3.0 | 32,188 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ledger', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='onedaysentry',
name='d... | ayys/siya | ledger/migrations/0002_auto_20151107_0136.py | Python | gpl-3.0 | 407 |
# This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
import numpy as np
def learn_model(features, labels):
'''Learn a simple threshold model'''
be... | krahman/BuildingMachineLearningSystemsWithPython | ch02/threshold.py | Python | mit | 1,184 |
#!/usr/bin/env python3
"""Implement a cascaded IIR filter."""
#
# Copyright 2012-2013 BrewPi/Elco Jacobs.
# Copyright 2015 Andrew Errington
#
# This file is part of BrewPi.
#
# BrewPi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the F... | andrewerrington/fuscus | fuscus/FilterCascaded.py | Python | gpl-3.0 | 2,628 |
class ArchiveError(Exception):
pass
class InvalidArchiveFormatError(ArchiveError):
pass
class MetaFileRequiredError(ArchiveError):
pass
class MetaFileFormatError(ArchiveError):
pass
class MetaFileParsingError(ArchiveError):
pass
class PixelSetParserError(Exception):
pass
class PixelS... | Candihub/pixel | apps/submission/exceptions.py | Python | bsd-3-clause | 369 |
#!/usr/bin/env python
'''sudoku solver for standard 9*9 games
Solve Every Sudoku Puzzle
See http://norvig.com/sudoku.html
References used by Peter Norvig:
http://www.scanraid.com/BasicStrategies.htm
http://www.sudokudragon.com/sudokustrategy.htm
http://www.krazydad.com/blog/2005/09/29/an-index-of-sudoku-strategies... | todool/sudoku-wxpython | sudoku-wxpython/sudokusolver.py | Python | unlicense | 5,617 |
# -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def digitalocean_host():
from terraform import digitalocean_host
return digitalocean_host
@pytest.fixture
def digitalocean_resource():
return {
"type": "digitalocean_droplet",
"primary": {
"id": "5726884", "attributes": {
... | pinterb/terraform.py | tests/test_digitalocean.py | Python | apache-2.0 | 1,975 |
# SPDX-License-Identifier: MIT
from attr.filters import * # noqa
| python-attrs/attrs | src/attrs/filters.py | Python | mit | 67 |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
int_or_none,
parse_duration,
)
class MwaveIE(InfoExtractor):
_VALID_URL = r'https?://mwave\.interest\.me/mnettv/videodetail\.m\?searchVideoDetailVO\.clip_id=(?P<id>[0-9]+)'
... | miminus/youtube-dl | youtube_dl/extractor/mwave.py | Python | unlicense | 2,046 |
# -*- coding: utf-8 -*-
'''A template utility class for card graphics generator programs.'''
# This file is part of CBG.
#
# CBG 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... | veikman/cbg | cbg/app.py | Python | gpl-3.0 | 21,113 |
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | sebrandon1/neutron | neutron/services/metering/agents/metering_agent.py | Python | apache-2.0 | 11,182 |
import matplotlib.pyplot as plt
from . import Components
from .Layout import layout
from math import *
import numpy as np
import networkx as nx
class Graph:
"""
Container of a directed graph. It contains mainly two types of objects: nodes and edges.
"""
def __init__(self,layout):
"""
In... | phievo/phievo | phievo/Networks/PlotGraph/Graph.py | Python | lgpl-3.0 | 8,889 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'stream3.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGu... | amchagas/Flypi | Python/GUI_2.2/flypi_GUI.py | Python | gpl-2.0 | 121,436 |
#
# Copyright (C) 2010 Stanislav Bohm
#
# This file is part of Kaira.
#
# Kaira 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, version 3 of the License, or
# (at your option) any later versi... | MrPablozOne/kaira | gui/cmdutils.py | Python | gpl-3.0 | 2,053 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | kaynfiretvguru/Eldritch | plugin.audio.beatz/resources/libs/modules/control.py | Python | gpl-2.0 | 7,571 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0008_productfeatured_text_css_color'),
]
operations = [
migrations.AlterField(
model_name='product',... | insta-code1/ecommerce | src/products/migrations/0009_auto_20160610_1212.py | Python | mit | 416 |
#!/usr/bin/python
import os, re, glob, sys
if len(sys.argv) < 5:
print 'Merge partitioned matrix data Li.txt generated by the Petuum NMF application'
print ''
print 'Usage: python %s <data-dirname> <data-format> <rank> <n> [<output-dirname>]' % sys.argv[0]
print ''
print 'Output: 1 merged file in d... | petchat/bosen | app/NMF/script/merge_data.py | Python | bsd-3-clause | 4,042 |
# coding=utf-8
from __future__ import unicode_literals
from django.apps import AppConfig
from django.db.models.signals import pre_save
from django.utils.translation import ugettext_lazy as _
class PetitionConfig(AppConfig):
name = 'petycja_norweskie.petitions'
verbose_name = _("Petition")
def ready(sel... | watchdogpolska/petycja-norweskie | petycja_norweskie/petitions/apps.py | Python | mit | 457 |
# vim: set fileencoding=utf-8 :
# Copyright (C) 2008 Joao Paulo de Souza Medeiros
#
# Author(s): Joao Paulo de Souza Medeiros <ignotus21@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 published by
# the Free Software Foundat... | labepi/radialnet | core/Config.py | Python | gpl-2.0 | 1,355 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Purchase - Computed Purchase Order Module for Odoo
# Copyright (C) 2013-Today GRAP (http://www.grap.coop)
# @author Julien WESTE
# @author Sylvain LE GAL (https://twitter.com/legalsylvain)
#
# Thi... | factorlibre/odoo-addons-cpo | purchase_compute_order/model/computed_purchase_order.py | Python | agpl-3.0 | 21,228 |
"""Add foreign key constraints
Revision ID: 457bbf802239
Revises: e912ea8b3cb1
Create Date: 2016-01-25 23:04:37.492418
"""
# revision identifiers, used by Alembic.
revision = '457bbf802239'
down_revision = 'e912ea8b3cb1'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upg... | thejunglejane/datums | datums/migrations/versions/457bbf802239_add_foreign_key_constraints.py | Python | mit | 2,149 |
#!/usr/bin/env python
"""
Sentry
======
Sentry is a realtime event logging and aggregation platform. It specializes
in monitoring errors and extracting all the information needed to do a proper
post-mortem without any of the hassle of the standard user feedback loop.
Sentry is a Server
------------------
The Sentry ... | Natim/sentry | setup.py | Python | bsd-3-clause | 7,160 |
# Copyright 2013 B1 Systems GmbH
#
# 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 ag... | spandanb/horizon | openstack_dashboard/dashboards/admin/hypervisors/views.py | Python | apache-2.0 | 2,471 |
#!/usr/bin/env python
__all__ = ['find_parameters']
import os, sys, traceback, getpass, time, re
from threading import Thread
from subprocess import *
import multiprocessing
#Werneck
import platform
#-------
if sys.version_info[0] < 3:
from Queue import Queue
else:
from queue import Queue
telnet_workers = []
ssh_w... | rafaelwerneck/kuaa | classifiers/libSVM_3_17/grid.py | Python | gpl-3.0 | 15,616 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'FilerLinkPlugin.file'
db.alter_column('cmsplugin_filerlinkplugin', 'file_id', self.gf('dj... | Venturi/oldcms | env/lib/python2.7/site-packages/cmsplugin_filer_link/migrations/0002_auto__chg_field_filerlinkplugin_file.py | Python | apache-2.0 | 13,433 |
import sys
import json
import sqlite3
db_name = sys.argv[1]
print db_name
con = sqlite3.connect(db_name)
c = con.cursor()
sql = "SELECT inserted, contents FROM stream_results ORDER BY inserted"
c.execute(sql)
count = 0
for row in c:
tweet = json.loads(row[1])
print tweet["lang"], tweet["user"]... | maroy/TSTA | cse-581-project-2/src/dump_statuses.py | Python | mit | 455 |
# -*- coding: utf-8 -*-
"""Test package."""
| jayvdb/flake8-putty | tests/__init__.py | Python | mit | 44 |
# encoding: utf-8
"""
Test lldb data formatter subsystem.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
from ObjCDataFormatterTestCase import ObjCDataFormatterTestCase
class ObjCDataFormatterNS... | apple/swift-lldb | packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSBundle.py | Python | apache-2.0 | 1,019 |
import copier
from .helpers import PROJECT_TEMPLATE
def test_normal_jinja2(tmp_path):
copier.copy(f"{PROJECT_TEMPLATE}_normal_jinja2", tmp_path, force=True)
todo = (tmp_path / "TODO.txt").read_text()
expected = "[[ Guybrush TODO LIST]]\n[# GROG #]\n - Become a pirate\n"
assert todo == expected
| lucuma/Voodoo | tests/test_normal_jinja2.py | Python | bsd-3-clause | 317 |
# Copyright (c) by it's authors.
# Some rights reserved. See LICENSE, AUTHORS.
import codecs
import wallaby.FX as FX
import wallaby.FXUI as FXUI
from wallaby.qt_combat import *
from ..baseWidget import *
from ..logics import *
from wallaby.pf.peer.viewer import *
from webRoom import WebRoom, WebHouse
import copy
... | FreshXOpenSource/wallaby-frontend-qt | wallaby/frontends/qt/widgets/labels/extendedWebView.py | Python | bsd-2-clause | 6,180 |
# Copyright (c) 2010, Mats Kindahl, Charles Bell, and Lars Thalmann
# All rights reserved.
#
# Use of this source code is goverened by a BSD licence that can be
# found in the LICENCE file.
"""
Test of the binary log reader.
"""
import sys, os.path
_HERE = os.path.dirname(os.path.abspath(__file__))
_ROOTPATH = os.pat... | mrramazani/mysql-replicant-python-1 | lib/tests/test_mysqlbinlog_parser.py | Python | bsd-3-clause | 1,837 |
import numpy as np
from joblib import Parallel, delayed
def penn_to_wordnet(tag):
"""
Convert a Penn Treebank PoS tag to WordNet PoS tag.
"""
if tag in ['NN', 'NNS', 'NNP', 'NNPS']:
return 'n' #wordnet.NOUN
elif tag in ['VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ']:
return 'v' #wordnet.... | frnsys/broca | broca/common/util.py | Python | mit | 1,726 |
# usage
# from fair.ancil import historical_scaling
# s = historical_scaling.all
import numpy as np
import os
filename = os.path.join(os.path.dirname(__file__), 'historical_scaling.csv')
all = np.loadtxt(filename, skiprows=0, delimiter=',')
co2 = all[:,0]
| OMS-NetZero/FAIR | fair/ancil/historical_scaling.py | Python | apache-2.0 | 258 |
"""
Post-processing of epydoc generated documentation.
"""
import os
import sys
from glob import glob
# adds MathJax capabilities to documentation
injection = """
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$']],
displayMath: [['$$','$$']],
... | lucastheis/cmt | code/utils/epydoc.py | Python | mit | 1,281 |
# -*- coding: utf8 -*-
"""
A fast python port of arc90's readability tool
Usage:
breadability [options] <resource>
breadability --version
breadability --help
Arguments:
<resource> URL or file path to process in readable form.
Options:
-f, --fragment Output html fragment by default.
-b, --bro... | bookieio/breadability | breadability/scripts/client.py | Python | bsd-2-clause | 2,316 |
"""
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.services.user_badge import (
command_service as badge_command_service,
service as badge_service,
)
from byceps.services.user_badge.transfer.models import QuantifiedBadgeAwarding
def test_award_badg... | m-ober/byceps | tests/api/user_badge/test_award_badge.py | Python | bsd-3-clause | 1,016 |
###############################################################################
# Crossover.py - An object to provide crossover operators for a gentic
# Algorithim for multiple sequence alignment
###############################################################################
# based on the work of
# da S... | DaveM8/NAlineaGA | Crossover.py | Python | gpl-3.0 | 12,678 |
#!/usr/bin/env python
"""
Unscientific benchmarking of this versus the --release rust
implementation below using the %timeit Ipython magic (times in sec)
n_kmers, py_runtime, rust_runtime
6594204, 14.4, 0.578
Both give identical counts on the files tested (and printing kmers out
and diff'ing the resul... | bovee/needletail | bench/benchmark.py | Python | mit | 1,291 |
#!/usr/bin/env python3
from atapt import atapt
import ctypes
import sys
if len(sys.argv) == 2:
if sys.argv[1][0] != '/':
dev = '/dev/' + sys.argv[1]
else:
dev = sys.argv[1]
disk = atapt.atapt(dev)
else:
print("use: example.py /dev/ice")
exit(0)
# Disk identifycation
print()
print... | kazenniy/atapt | example/example.py | Python | mit | 5,988 |
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2017 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | DataONEorg/d1_python | gmn/src/d1_gmn/app/settings_default.py | Python | apache-2.0 | 12,171 |
#!/usr/bin/env python3
# Extracts symbolic icons from a contact sheet using Inkscape.
# Copyright (c) 2013 Andrew Chadwick <a.t.chadwick@gmail.com>
# Copyright (c) 2020 The MyPaint Team
#
# Originally based on Jakub Steiner's r.rb,
# rewritten in Python for the MyPaint distrib.
# Jakub Steiner <jimmac@gmail.com>
# Dep... | mypaint/mypaint | svg/symbolic-icons-extract.py | Python | gpl-2.0 | 10,909 |
"""The tests for the demo platform."""
import unittest
from unittest.mock import patch
from homeassistant.components import geo_location
from homeassistant.components.demo.geo_location import (
NUMBER_OF_DEMO_DEVICES,
DEFAULT_UNIT_OF_MEASUREMENT,
DEFAULT_UPDATE_INTERVAL,
)
from homeassistant.setup import s... | joopert/home-assistant | tests/components/demo/test_geo_location.py | Python | apache-2.0 | 2,881 |
#
# Copyright (c) 2009-2015, Jack Poulson
# All rights reserved.
#
# This file is part of Elemental and is under the BSD 2-Clause License,
# which can be found in the LICENSE file in the root directory, or at
# http://opensource.org/licenses/BSD-2-Clause
#
import El, time
# TODO: Add noise so that the soft marg... | sg0/Elemental | examples/interface/SVM.py | Python | bsd-3-clause | 2,632 |
# Copyright 2014 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 law ... | naveensan1/nuage-openstack-neutron | nuage_neutron/db/migration/nuage/juno_to_kilo/826ff855615_add_rt_rd_to_router_mapping.py | Python | apache-2.0 | 1,218 |
########################################################################
#
# (C) 2015, Chris Houseknecht <chouse@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 Fo... | grimmjow8/ansible | lib/ansible/galaxy/token.py | Python | gpl-3.0 | 2,119 |
#!/usr/local/bin/python2.7
import os
import sys
import subprocess
import time
import socket
UPS = 'ups@localhost'
def get_real_power(ups):
try:
temp_line = subprocess.check_output('/usr/local/bin/upsc %s '
'| grep \\.realpower' % ups,
... | fhriley/freenas_config | bin/collectd_power.py | Python | gpl-2.0 | 546 |
"""
Project Euler Problem #7
=========================
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see
that the 6^th prime is 13.
What is the 10001^st prime number?
"""
from library import nth_prime
print(nth_prime(10001))
| unaizalakain/projecteuler | 007.py | Python | gpl-3.0 | 255 |
# Copyright 2012-2015 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | mongodb/motor | test/tornado_tests/test_motor_replica_set.py | Python | apache-2.0 | 2,615 |
import pytest
import numpy as np
import openpnm as op
import matplotlib.pyplot as plt
from numpy.testing import assert_allclose
from openpnm import topotools
class TopotoolsTest:
def setup_class(self):
self.ws = op.Workspace()
def teardown_class(self):
self.ws.clear()
def test_reduce_co... | TomTranter/OpenPNM | tests/unit/topotools/TopotoolsTest.py | Python | mit | 15,521 |
#!/usr/bin/python3
import suds
import suds.client
import suds.wsse
import sys
import timeit
import getopt
import csv
url="https://tt.poczta-polska.pl/Sledzenie/services/Sledzenie?wsdl"
username="sledzeniepp"
password="PPSA"
def show_data(client,numer):
spr=client.service.sprawdzPrzesylke(numer)
if not spr.dane... | theundefined/scripts | watch_pp.py | Python | gpl-2.0 | 856 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import unittest
from pyes.tests import ESTestCase
from pyes.query import TermQuery, RangeQuery
from pyes.utils import ESRange
from datetime import datetime
class SerializationTestCase(ESTestCase):
def setUp(self):
super(SerializationTestCase, s... | aparo/pyes | tests/test_serialize.py | Python | bsd-3-clause | 3,102 |
# -*- coding: utf-8 -*-
from raw._ebutts import *
| ebu/ebu-tt-live-toolkit | ebu_tt_live/bindings/_ebutts.py | Python | bsd-3-clause | 50 |
# -*- coding:utf-8 -*-
import json
from datetime import datetime
from math import ceil, floor
from os.path import abspath, join, pardir
from struct import pack
from .global_settings import (
DEBUG, DEBUG_POLY_STOP, INPUT_JSON_FILE_NAME, INVALID_ZONE_ID, NR_BYTES_H, NR_BYTES_I, NR_SHORTCUTS_PER_LAT,
NR_SHORTCUT... | MrMinimal64/timezonefinderL | timezonefinderL/file_converter.py | Python | mit | 28,893 |
# 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... | reyoung/Paddle | python/paddle/trainer_config_helpers/tests/configs/math_ops.py | Python | apache-2.0 | 1,127 |
"""Support for Keenetic routers as device tracker."""
from datetime import timedelta
import logging
from typing import List, Optional, Set
from ndms2_client import Device
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN as DEVICE_TRACKER_DOMAIN,
PLATFORM_SCHEMA as DEVICE_T... | partofthething/home-assistant | homeassistant/components/keenetic_ndms2/device_tracker.py | Python | apache-2.0 | 8,006 |
"""
FITS Align - Align and reproject FITS files from Las Cumbres Observatory
Copyright (C) 2018 Edward Gomez
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 th... | LCOGT/alipy | fits_align/star.py | Python | gpl-3.0 | 13,516 |
#!/usr/bin/env python
'''
usage - run this program to display sdss cutouts with SDSS exponential fit overlaid
ds9 must be running first!
'''
from pylab import *
import os
from LCScommon import *
from LCSReadmasterBase import baseCluster
import mystuff as my
class cluster(baseCluster):
#__init__(self,clustername)... | rfinn/LCS | paper1code/LCSViewSDSSRad.py | Python | gpl-3.0 | 2,434 |
"""Constants for the Picnic integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any, Literal
from homeassistant.components.sensor import SensorDeviceClass, SensorEntityDescription
from homeassistant.const import CURRENCY_EURO
fro... | home-assistant/home-assistant | homeassistant/components/picnic/const.py | Python | apache-2.0 | 5,679 |
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.StereoCapableWindowOn()
iren = vtk.vtkRende... | hlzz/dotfiles | graphics/VTK-7.0.0/IO/EnSight/Testing/Python/EnSightCompound.py | Python | bsd-3-clause | 1,304 |
# -*- coding: utf-8 -*-
"""Various units-related things
This module has a soft dependency on the pint units library. Please
import this module only conditionally or only if you can accept a pint
dependency.
"""
from typhon.physics.units import constants
from typhon.physics.units.common import *
from typhon.physics.... | atmtools/typhon | typhon/physics/units/__init__.py | Python | mit | 444 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | piensa/geonode | geonode/base/management/commands/fixoauthuri.py | Python | gpl-3.0 | 2,452 |
#!/usr/bin/env python
# PyQt tutorial 14
import sys
import math
import random
from PySide import QtCore, QtGui
class LCDRange(QtGui.QWidget):
def __init__(self, text=None, parent=None):
if isinstance(text, QtGui.QWidget):
parent = text
text = None
QtGui... | cherry-wb/SideTools | examples/tutorial/t14.py | Python | apache-2.0 | 13,014 |
# Initialization for oemicroservices.depict
| OpenEye-Contrib/OEMicroservices | oemicroservices/resources/depict/__init__.py | Python | apache-2.0 | 44 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 the hope that it will ... | ailove-dev/suds | suds/xsd/schema.py | Python | lgpl-3.0 | 16,141 |
from django.conf.urls import url
from .views.homeview import HomeView
urlpatterns = [
url(r'^$', HomeView.as_view(), name='home'),
] | hamtamtots/website | matt_site/home/urls.py | Python | mit | 138 |
version = '0.10.0'
| frederikhermans/pyfftw-arm | pyfftw/_version.py | Python | bsd-3-clause | 20 |
from __future__ import absolute_import
import os
import numpy as np
from scipy.ndimage import center_of_mass
from scipy.signal import fftconvolve
#
# INTERNAL DEPENDENCIES
#
from . import image_basics
from .image_basics import load_image_to_numpy
import scanomatic.io.logger as logger
#
# CLASSES
#
class FixtureI... | Scan-o-Matic/scanomatic | scanomatic/image_analysis/image_fixture.py | Python | gpl-3.0 | 8,369 |
# 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... | tensorflow/tensorflow | tensorflow/python/kernel_tests/linalg/linear_operator_kronecker_test.py | Python | apache-2.0 | 10,134 |
# ------------------------------------------------
# IMPORTS ----------------------------------------
# ------------------------------------------------
#####
# Python dist and 3rd party libraries
#####
import os, requests, json, string, datetime, logging, time
from os.path import join, dirname
from weblogger import ad... | WASdev/sample.voice.gateway | soe/python/checkDTMF.py | Python | apache-2.0 | 1,293 |
#
# (c) 2017 Michael De La Rue
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible... | defionscode/ansible | test/units/modules/cloud/amazon/test_lambda_policy.py | Python | gpl-3.0 | 8,000 |
"""ShutIt module. See http://shutit.tk
"""
from shutit_module import ShutItModule
class ruby(ShutItModule):
def build(self, shutit):
shutit.send('mkdir -p /tmp/build/ruby')
shutit.send('cd /tmp/build/ruby')
shutit.send('wget -qO- http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.0.tar.gz | tar -zxf -')
shut... | ianmiell/shutit-distro | ruby/ruby.py | Python | gpl-2.0 | 863 |
import bs4 as bs # Beautiful Soup, for extracting from web
import urllib.request # For handling URLs
import re # For regex and compile function
import time # For refresh timer
class Stock:
def __init__(self, symbol = 'symbol'):
self.companyName = 'companyName'
... | brandone-lance/python | onlineStockReader/onlineStockReader.py | Python | mit | 4,704 |
#!/bin/python3
# Arithmetic Operators
# https://www.hackerrank.com/challenges/python-arithmetic-operators/problem
def solve(a, b):
return (a // b, a / b)
if __name__ == '__main__':
a = int(input())
b = int(input())
print("\n".join(map(str,solve(a, b)))) | neiesc/Problem-solving | HackerRank/Python/Introduction/python-division.py | Python | mit | 272 |
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.api.labs import taskqueue
from google.appengine.api import memcache
from lifestream import *
class LifeStreamQueueWorker(webapp.RequestHandler):
def get(self):
memcache.set('fresh_count', 0)
indexes = LifeSt... | billychow/simplelifestream | worker.py | Python | mit | 1,047 |
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.template import RequestContext
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext as _
from django.utils impor... | DarkArtek/FFXIVITAFC | django_messages/views.py | Python | unlicense | 8,735 |
from django.conf.urls import patterns, url, include
from .api import *
from rest_framework import routers
router = routers.DefaultRouter(trailing_slash=False)
router.register(r'policydomains', PolicyDomainViewSet)
router.register(r'units', UnitViewSet, base_name='unit')
router.register(r'unitcategories', UnitCategoryV... | policycompass/policycompass-services | apps/referencepool/urls.py | Python | agpl-3.0 | 829 |
'''aws cromwell runner'''
import os
import json
import tempfile
import logging
import yaml
import utils.pipeline
def filter_list(alist, blist):
'''remove blist from alist'''
return list(set(alist)-set(blist))
def get_cwl_steps(cwlwf):
'''get cwl steps names'''
cwl = dict()
with open(cwlwf, 'r') a... | uc-cdis/cwl | genomel/aws/utils/runner.py | Python | apache-2.0 | 15,387 |
"""Test the Elk-M1 Control config flow."""
from dataclasses import asdict
from unittest.mock import patch
import pytest
from homeassistant import config_entries
from homeassistant.components import dhcp
from homeassistant.components.elkm1.const import DOMAIN
from homeassistant.const import CONF_HOST, CONF_PASSWORD
fr... | rohitranjan1991/home-assistant | tests/components/elkm1/test_config_flow.py | Python | mit | 35,692 |
import queue
import multiprocessing
import unittest
from coalib.processes.CONTROL_ELEMENT import CONTROL_ELEMENT
from coalib.results.Result import Result, RESULT_SEVERITY
from coalib.bears.LocalBear import LocalBear
from coalib.bears.GlobalBear import GlobalBear
from coalib.processes.BearRunning import (run,
... | scriptnull/coala | coalib/tests/processes/BearRunningTest.py | Python | agpl-3.0 | 11,812 |
from flask import Flask, render_template, request, session, flash, redirect, url_for
from datetime import datetime
from models import Post, Category
from forms import PostForm, LoginForm
from app import app, db
import hashlib
@app.route('/')
def index():
return render_template('index.html', nodict={})
@app.route(... | zuBux/homepage | app/views.py | Python | gpl-2.0 | 2,716 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Input file writer for SES3D 4.0.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2013
:license:
GNU General Public License, Version 3
(http://www.gnu.org/copyleft/gpl.html)
"""
EARTH_RADIUS = 6371 * 1000
import numpy as np
import obspy
impo... | KNMI/VERCE | verce-hpc-pe/src/wfs_input_generator/backends/write_ses3d_4_0.py | Python | mit | 15,462 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-30 23:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Class'... | cloudartisan/dojomaster | apps/classes/migrations/0001_initial.py | Python | mit | 490 |
# -*- 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.
#Copyright © 2012 Karol Augustin <karol@augustin.pl>... | karolaug/p300-csp | run.py | Python | gpl-3.0 | 2,444 |
import tkinter.ttk as ttk
from mmse15project.views.Config import Config
from mmse15project.views.GenericMethods import get_header
from mmse15project.views.subviews.NewFinancialRequest import NewFinancialRequest
from mmse15project.views.subviews.NewRecruitmentRequest import NewRecruitmentRequest
from mmse15project.views... | rssalessio/MMSE15Project-RussoJohansson | mmse15project/views/Production.py | Python | gpl-2.0 | 2,262 |
import atexit
import logging
import logging.config
from optparse import OptionParser
import os
from lockfile import FileLock, LockError
from StringIO import StringIO
import sys
default_log_file = os.path.expanduser(os.environ.get('PROCCER_LOG',
'~/proccer.log'))
ru... | CSIS/proccer | src/proccer/console_scripts.py | Python | mit | 2,872 |
# vim:set et sts=4 sw=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2007-2010 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Sof... | yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/ibus/factory.py | Python | mit | 4,049 |
from pika_pack import RPCBlockingConsumer
from mixins import ServiceUtils
def not_hidden_method(method_name):
return not (method_name.startswith('_') or method_name.startswith('__'))
class CustomActionControlService(ServiceUtils, RPCBlockingConsumer):
def __init__(self, rabbit_url, device_key, actions):
... | HydAu/ProjectWeekds_Pi-Control-Service | pi_control_service/custom_action.py | Python | mit | 1,154 |
# Generated by Django 2.2.10 on 2020-03-31 10:00
import InvenTree.fields
import django.core.validators
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('order', '0016_purchaseorderattachment'),
]
operations = [
migrations.AlterField(
... | inventree/InvenTree | InvenTree/order/migrations/0017_auto_20200331_1000.py | Python | mit | 588 |
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'README.rst')) as stream:
long_desc = stream.read()
requires = ['Sphinx>=0.6', 'xlrd', 'future', 'docutils']
VERSION = '0.2.2'
setup(
name = 'sphinxcontrib-exceltable... | Lemma1/MAC-POSTS | doc_builder/sphinx-contrib/exceltable/setup.py | Python | mit | 1,332 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.