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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
from __future__ import print_function
from builtins import input
import sys
import pmagpy.pmag as pmag
def main():
"""
NAME
customize_criteria.py
NB: This program has been deprecated - use demag_gui or thellier_gui
to customize acceptance criteria - OR pandas f... | lfairchild/PmagPy | programs/deprecated/customize_criteria.py | Python | bsd-3-clause | 2,536 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This packages contains affiliated package tests.
"""
import pytest
| alexrudy/Cauldron | Cauldron/tests/__init__.py | Python | bsd-3-clause | 136 |
# Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... | yohanko88/gem5-DC | tests/configs/memtest-filter.py | Python | bsd-3-clause | 3,208 |
# -*- coding: utf-8 -*-
'''
>>> import multiprocessing as mu
>>> from instatag import *
>>> tag_url_maker("test")
'http://www.instagram.com/explore/tags/test'
>>> step_2_url_maker("test")
'http://www.instagram.com/test/media/'
>>> print_line()
------------------------------
>>> print_line(30,"p")
pppppppppppppppppppppp... | Moduland/instatag | instatag/test.py | Python | mit | 685 |
from django.test import TestCase
from data_center.models import Course, FlatPrerequisite
class CourseModelTest(TestCase):
def test_course_can_be_created_with_only_no(self):
Course.objects.create(no='12345QAQ 010101')
self.assertEqual(1, Course.objects.count())
class FlatPrerequisiteModelTest(... | henryyang42/NTHU_Course | data_center/tests.py | Python | mit | 819 |
import logging
import re
import lxml.etree as ET
_account_alias_pattern = re.compile("Account: *([^(]+) *\(([0-9]+)\)")
_account_without_alias_pattern = re.compile("Account: *\(?([0-9]+)\)?")
def account_aliases(session, username, password, auth_method, saml_response, config):
alias_response = session.post(
... | venth/aws-adfs | aws_adfs/account_aliases_fetcher.py | Python | mit | 1,823 |
def test_something():
"Do some tests"
assert True
| leouieda/funghi | cryptococcus/tests/test_placeholder.py | Python | bsd-3-clause | 58 |
#!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | XiaosongWei/crosswalk-test-suite | webapi/tct-appcontrol-tizen-tests/inst.wgt.py | Python | bsd-3-clause | 6,924 |
from codecs import BOM_UTF8
import agate
import datetime
import isodate
import json
import dbt.utils
from typing import Iterable, List, Dict, Union, Optional, Any
from dbt.exceptions import RuntimeException
BOM = BOM_UTF8.decode('utf-8') # '\ufeff'
class Number(agate.data_types.Number):
# undo the change in ... | analyst-collective/dbt | core/dbt/clients/agate_helper.py | Python | apache-2.0 | 7,871 |
#
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2015
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser G... | steve-ord/daliuge | daliuge-translator/dlg/dropmake/pg_generator.py | Python | lgpl-2.1 | 103,826 |
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError
from ansible.plugins.action import ActionBase
from ansible... | maxamillion/ansible | lib/ansible/plugins/action/async_status.py | Python | gpl-3.0 | 1,981 |
from setuptools import setup, find_packages
setup(
name='offenerhaushalt',
version='2.0',
description="Visualisierte Haushalte der BRD",
long_description='',
classifiers=[
],
keywords='',
author='Open Knowledge Foundation Deutschland',
author_email='info@offenerhaushalt.de',
... | Opendatal/offenerhaushalt.de | setup.py | Python | mit | 613 |
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _
from odoo.osv import expression
from odoo.tools.float_utils import float_round as round
from odoo.exceptions import UserError, ValidationError
import math
import logging
TYPE_TAX_USE = [
('sale', 'Sales'),
('purchase', 'Purchases'),
('none',... | ddico/odoo | addons/account/models/account_tax.py | Python | agpl-3.0 | 36,558 |
import asyncio
from . import unpack
from .log import logger
class Connection(object):
def __init__(self, host, port, events, encoding, ssl):
self.events = events
self._connected = False
self.host, self.port = host, port
self.reader, self.writer = None, None
self.encoding = ... | mallegonian/bottom | bottom/connection.py | Python | mit | 2,156 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import re
import datetime
import isodate # 3rd party
import json
UTC = isodate.UTC
def datetimeFromISOdateString(s):... | Serg09/socorro | socorro/lib/datetimeutil.py | Python | mpl-2.0 | 5,235 |
"""
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Founda... | archesproject/arches | tests/views/auth_tests.py | Python | agpl-3.0 | 9,887 |
from __future__ import absolute_import
from .gp_actuator import GPActuator
class DummyGPActuator(GPActuator):
def __init__(self, *args, **kw):
super(DummyGPActuator, self).__init__(*args, **kw)
self._states = {}
def open_channel(self, ch, *args, **kw):
self._states[ch] = True
... | USGSDenverPychron/pychron | pychron/hardware/actuators/dummy_gp_actuator.py | Python | apache-2.0 | 839 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | itskewpie/tempest | tempest/api/compute/servers/test_disk_config.py | Python | apache-2.0 | 5,119 |
def classFactory(iface):
from WntOS import WntOS
return WntOS(iface)
| gc-i/wntOS | __init__.py | Python | gpl-3.0 | 78 |
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... | kvar/ansible | test/units/modules/network/f5/test_bigiq_application_http.py | Python | gpl-3.0 | 8,222 |
# Django settings for the7blogger project.
import os
APPENGINE_PRODUCTION = os.getenv('APPENGINE_PRODUCTION')
HTTP_HOST = os.environ.get('HTTP_HOST')
PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
STATIC_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'static')) + '/'
#print 'APPENGIN... | paulormart/the7blogger_project | the7blogger/the7blogger/settings.py | Python | apache-2.0 | 6,626 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/rsa.h>
"""
TYPES = """
typedef struct r... | kimvais/cryptography | src/_cffi_src/openssl/rsa.py | Python | bsd-3-clause | 2,961 |
import os
import sys
import struct
from ._compat import raw_input, text_type, string_types, \
colorama, isatty, strip_ansi, get_winterm_size, \
DEFAULT_COLUMNS, WIN
from .utils import echo
from .exceptions import Abort, UsageError
from .types import convert_type
# The prompt functions to use. The doc tool... | mottosso/pyblish-base | pyblish/vendor/click/termui.py | Python | lgpl-3.0 | 19,017 |
"""
Main module for the app
"""
from __future__ import unicode_literals, print_function
import logging.config
from flask import Flask, render_template
from flask_login import current_user, LoginManager
from google.appengine.ext import ndb
from werkzeug import debug
from config import ProductionConfig as Config
... | aaleotti-unimore/ComicsScraper | main.py | Python | apache-2.0 | 3,403 |
# Copyright (C) 2010 Joel Dunham
#
# This file is part of OnlineLinguisticDatabase.
#
# OnlineLinguisticDatabase 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 o... | jrwdunham/old-webapp | onlinelinguisticdatabase/controllers/collection.py | Python | gpl-3.0 | 26,844 |
from idv_plot import plot_patches
# Directory where the bin map and Xspec log files are located.
root = "."
# File name of the bin map.
binmap = "contbin_binmap.fits"
# Output html file name and title.
out = "MACSJ1149_Tmap.html"
out_title = "Temperature Map of MACS J1149.6+2223"
# Plot style.
title_font_size = '16... | gogrean/InteractiveFigs | X-rayMaps/MACSJ1149/example.py | Python | gpl-3.0 | 1,091 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Authorization Rule')
class TestAuthorizationRule(unittest.TestCase):
pass
| mahabuber/erpnext | erpnext/setup/doctype/authorization_rule/test_authorization_rule.py | Python | agpl-3.0 | 301 |
from subprocess import call
import os
import shutil
import subprocess
import json
import codecs
from collections import OrderedDict
BUILDER_PATH = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = os.path.join(BUILDER_PATH, '..')
DIST_PATH = os.path.join(ROOT_PATH, 'dist')
INPUT_SVG_DIR = os.path.join(ROOT_PATH,... | dmelearn/dm-icons | builder/generate.py | Python | mit | 12,766 |
#!/usr/bin/env python
import argparse
import pwndbg.commands
from pwndbg.color import message
parser = argparse.ArgumentParser(description='''
Toggles memoization (caching). Pwndbg will work slower when it's off, however
it's useful for diagnosing caching-related bugs.
''')
@pwndbg.commands.ArgparsedCommand(parser)... | pwndbg/pwndbg | pwndbg/commands/memoize.py | Python | mit | 612 |
from bz2 import BZ2Decompressor
from enum import Enum
from functools import partial
from lzma import LZMADecompressor
import zlib
class Compression(Enum):
bzip2 = ('.bz2', BZ2Decompressor)
# See <http://stackoverflow.com/q/2423866/744178>:
gzip = ('.gz', partial(zlib.decompressobj,... | jwodder/aptrepo | src/aptrepo/compression.py | Python | mit | 1,237 |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from perf_tools import smoothness_measurement
from telemetry.core import util
from telemetry.page import page_benchmark
class DidNotScrollException(page_... | plxaye/chromium | src/tools/perf/perf_tools/smoothness_benchmark.py | Python | apache-2.0 | 7,328 |
# -*- coding: utf-8 *-*
# Copyright (c) 2013 Tisserant Pierre
#
# This file is part of Dragon dice simulator.
#
# Dragon dice simulator is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either ve... | TheLazyHase/dragon_dice_simulator | business/game/action/test_save.py | Python | gpl-3.0 | 954 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 <+YOU OR YOUR COMPANY+>.
#
# This 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, or (at your option)
# any later version.
#... | muccc/darc | src/gr-darc/python/qa_layer2.py | Python | gpl-3.0 | 1,155 |
from ritoapi.endpoints.base_endpoint import BaseEndpoint
class SummonerV3(BaseEndpoint):
endpoint_prefix = 'summoner/v3/'
def summoners_by_account(self, region, account_id):
method_id = self.endpoint_prefix + 'summoners_by_account'
endpoint_url = self._construct_endpoint_url('summoners', 'by-... | FancyRice/RitoAPI | ritoapi/endpoints/summoner_v3.py | Python | mit | 947 |
# 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/python/ops/gradient_checker.py | Python | bsd-2-clause | 14,406 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"met... | hyperized/ansible | lib/ansible/modules/cloud/hcloud/hcloud_server_info.py | Python | gpl-3.0 | 6,737 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os
my_site = os.path.join(os.environ["HOME"], ".local/lib/python2.7/site-packages")
sys.path.insert(0, my_site)
import h5py
import networkx as nx
import numpy as np
import pycuda.driver as cuda
import scipy.stats as st
import sys
import aux
from consts import... | unicamp-lbic/small_world_ca | analysis.py | Python | gpl-2.0 | 19,617 |
"""Test proper parenthetics."""
import pytest
EXAMPLE_PARENS = [
['()()()', 0],
['(()', 1],
['(()))', -1],
[')))(((', -1],
['(sdg)', 0],
['(hi', 1]
]
@pytest.mark.parametrize("parens, result", EXAMPLE_PARENS)
def test_proper_parens(parens, result):
"""Test proper parens returns correct ... | clair3st/code-katas | tests/test_parenthetics.py | Python | mit | 444 |
import argparse
import parsl
from parsl.app.app import python_app
from parsl.tests.configs.local_threads import config
def test_python_memoization(n=2):
"""Testing python memoization when func bodies differ
"""
@python_app
def random_uuid(x):
import uuid
return str(uuid.uuid4())
... | Parsl/parsl | parsl/tests/test_python_apps/test_memoize_4.py | Python | apache-2.0 | 1,069 |
# Run with python -m unittest tests.test_run_chained from parent directory
import unittest
import os
import run_chained
class RunChainedTests(unittest.TestCase):
def test_root_nodes(self):
root_node = '1'
first_stage = 1
n_nodes = 4
root_nodes = run_chained.compute_parent_nodes(... | ECP-CANDLE/Supervisor | workflows/cp-leaveout/py/tests/test_run_chained.py | Python | mit | 2,449 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2018-01-03 12:57
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('baza', '0002_auto_20151209_2246'),
]
operations = [
... | szymanskirafal/ab | baza/migrations/0003_auto_20180103_1357.py | Python | mit | 3,364 |
from template.test import TestCase, main
class ListTest(TestCase):
def testList(self):
callsign = self._callsign()
vars = {
"data": [callsign[char] for char in "rjstyefz"],
"days": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
"wxyz": [{"id": callsign["z"], "name": "Zebedee", "rank": ... | gsnedders/Template-Python | t/list_test.py | Python | artistic-2.0 | 3,573 |
def extractShallotnoodleWordpressCom(item):
'''
Parser for 'shallotnoodle.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('surrounded mob wants to quietly withdraw', ... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractShallotnoodleWordpressCom.py | Python | bsd-3-clause | 1,803 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Tuxemon
# Copyright (C) 2016, William Edwards <shadowapex@gmail.com>,
# Benjamin Bean <superman2k5@gmail.com>
#
# This file is part of Tuxemon.
#
# Tuxemon is free software: you can redistribute it and/or modify
# it under the terms of the GNU General P... | Tuxemon/Tuxemon-Server | tuxemon_server/core/tools.py | Python | gpl-3.0 | 3,456 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2001-2007 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at you... | beernarrd/gramps | gramps/gui/views/pageview.py | Python | gpl-2.0 | 21,590 |
from .util.deb import deb
from .util.nrange import nrange
from .cell import Cell
#F,e,Cursor
from .grid import spoint
CURSOR_POS=None
def gcp(): #get cursor position
global CURSOR_POS
deb('gcp',CURSOR_POS)
return CURSOR_POS
def scp(x,y):
deb('scp',gcp(),x,y)
cxc=0 #todo, normalize in cursor...
global CURSOR_P... | e7dal/hexy | hexy/cursor.py | Python | gpl-3.0 | 1,100 |
#!/usr/bin/env python3
# Copyright (C) 2013-2018 Florian Festi
#
# 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.... | florianfesti/boxes | boxes/generators/unevenheightbox.py | Python | gpl-3.0 | 4,609 |
"""
Utilities to help run Django tests
* setup_view - replaces as_view
"""
from osf_tests.factories import UserFactory
def setup_view(view, request, *args, **kwargs):
"""Mimic as_view() returned callable, but returns view instance
http://tech.novapost.fr/django-unit-test-your-views-en.html
"""
view.r... | laurenrevere/osf.io | admin_tests/utilities.py | Python | apache-2.0 | 1,197 |
#!/usr/bin/python
"""
Copyright 2017 Paul Willworth <ioscode@gmail.com>
This file is part of Galaxy Harvester.
Galaxy Harvester is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of th... | druss316/G-Harvestor | html/resource.py | Python | gpl-3.0 | 9,189 |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
import os
import re
import sys
# -- Path setup ----------------------------... | scolby33/OCSPdash | docs/source/conf.py | Python | mit | 6,368 |
import os
import math
import pytest
from barvocuc import ImageAnalyzer
from barvocuc.settings import Settings
basedir = os.path.dirname(__file__)
TEST_IMG_W = 416
TEST_IMG_H = 200
def open_analyzer(test_file_name):
settings = Settings()
settings.model_version = 1
with open(os.path.join(basedir, test... | encukou/barvocuc | test_barvocuc/test_analysis.py | Python | gpl-3.0 | 5,249 |
from __future__ import unicode_literals
from datetime import date, time, datetime
import unittest
from django.utils.dateparse import parse_date, parse_time, parse_datetime
from django.utils.timezone import get_fixed_timezone
class DateParseTests(unittest.TestCase):
def test_parse_date(self):
# Valid in... | diegoguimaraes/django | tests/utils_tests/test_dateparse.py | Python | bsd-3-clause | 2,232 |
from collections.abc import Coroutine
import struct
def _pack_int24(n):
return struct.pack("<I", n)[:3]
def _lenenc_int(i):
if i < 0:
raise ValueError(
"Encoding %d is less than 0 - no representation in LengthEncodedInteger" % i
)
elif i < 0xFB:
return bytes([i])
... | aio-libs/aiomysql | aiomysql/utils.py | Python | mit | 4,486 |
# --- Part Two ---
#
# Of course, that would be the message - if you hadn't agreed to use a modified repetition code instead.
#
# In this modified code, the sender instead transmits what looks like random data, but for each character, the character
# they actually want to send is slightly less likely than the others. E... | pacificsky/AdventOfCode | 2016/day6_2.py | Python | apache-2.0 | 1,599 |
import collections
import decimal
import functools
import jqsh.channel
import jqsh.filter
import jqsh.values
import builtins as python_builtins
import threading
builtin_functions = collections.defaultdict(dict)
def get_builtin(name, *args, num_args=None):
if num_args is None:
num_args = len(args)
if n... | jq-shell/python-jqsh | jqsh/functions.py | Python | mit | 6,651 |
#
# ipachangeconf - configuration file manipulation classes and functions
# partially based on authconfig code
# Copyright (c) 1999-2007 Red Hat, Inc.
# Author: Simo Sorce <ssorce@redhat.com>
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as publi... | celestian/sssd | src/config/SSSDConfig/ipachangeconf.py | Python | gpl-3.0 | 19,217 |
import sys
from antlr4 import *
from ChatParser import ChatParser
from ChatListener import ChatListener
class HtmlChatListener(ChatListener) :
def __init__(self, output):
self.output = output
self.output.write('<html><head><meta charset="UTF-8"/></head><body>')
def enterName(self, ctx:ChatPars... | unosviluppatore/antlr-mega-tutorial | antlr-python/HtmlChatListener.py | Python | mit | 2,056 |
import atexit
def show_message(f):
"""関数デコレータのテスト"""
print('show_message関数です。')
def wrapper():
print("ここは関数デコレータで定義したメッセージです。")
return f()
return wrapper
def show_message2(f):
"""関数デコレータのテスト"""
def wrapper():
print("ここは関数デコレータで定義したメッセージ2です。")
return f()
... | ekazyam/study | パーフェクトPython/pp_132_関数デコレータ.py | Python | mit | 735 |
print("Welcome to Super Quiz Mania III!")
def pselect():
players = input("""How many players are there? (2-4)
""")
if players == "2":
p1 = input("""What's your name p1?
""")
p2 = input("""What about you p2?
""")
print("Welcome "+str(p1)+" and "+str(p2))
... | naanac02/Super-Quiz-Mania-III | Super Quiz Mania III.py | Python | gpl-3.0 | 1,052 |
#
# ChainDb.py - Bitcoin blockchain database
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import string
import cStringIO
import leveldb
import io
import os
import time
from decimal import Decimal
from Cache import Cach... | daedalus/pynode | ChainDb.py | Python | mit | 20,226 |
""" BlueSky implementation of a timer that can periodically trigger functions."""
import time
try:
from PyQt5.QtCore import QObject, pyqtSignal
except ImportError:
from PyQt4.QtCore import QObject, pyqtSignal
class Timer(QObject):
timeout = pyqtSignal()
timers = None
def __init__(self):
... | ethertricity/bluesky | bluesky/simulation/qtgl/timer.py | Python | gpl-3.0 | 859 |
import pytest
from amoco.system.structs import *
def test_rawfield():
f = RawField('I',fcount=2,fname='v')
assert f.format()=='2I'
assert f.size()==8
assert f.unpack(b'\0\x01\x02\x03AAAA') == (0x03020100,0x41414141)
def test_varfield():
f = VarField('s',fname='string')
assert f.format()=='#s'
... | LRGH/amoco | tests/test_system_structs.py | Python | gpl-2.0 | 3,557 |
class Constants(object):
def __setattr__(self, key: str, value: int) -> None:
super(Constants, self).__setattr__(key, value)
# CYCLONE_CONSTANTS
vlxDevConstants = Constants()
# /* g_cyclone_general_info */
vlxDevConstants.A_CYC_APPL_SW_VERSION = 1
vlxDevConstants.A_CYC_APPL_SW_VERSION_1 = 2
vlxDevConstan... | yozik04/vallox_websocket_api | vallox_websocket_api/constants.py | Python | lgpl-3.0 | 71,638 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | junalmeida/Sick-Beard | sickbeard/tvrage.py | Python | gpl-3.0 | 14,153 |
# ===============================================================================
# Copyright 2016 Jake Ross
#
# 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... | NMTHydro/Recharge | zobs/orecharge/__init__.py | Python | apache-2.0 | 934 |
from django.conf.urls import url
from .views import update, update_show, clear_cache, redirect_to_front
urlpatterns = [
url(r"^update/$", update, name="seriesly-shows-update"),
url(r"^update/show/$", update_show, name="seriesly-shows-update_show"),
url(r"^clear/cache/$", clear_cache, name="seriesly-shows-... | stefanw/seriesly | seriesly/series/urls.py | Python | agpl-3.0 | 418 |
# -*-coding: utf-8 -*-
"""All models for TerminalOne objects. Safe to import *"""
from .acl import ACL
from .adserver import AdServer
from .advertiser import Advertiser
from .agency import Agency
from .atomiccreative import AtomicCreative
from .audiencesegment import AudienceSegment
from .campaign import Campaign
from... | pswaminathan/t1-python | terminalone/models/__init__.py | Python | apache-2.0 | 2,840 |
#!/usr/bin/env python3
# Copyright (c) 2017 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 deprecation of RPC calls."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... | ppcoin/ppcoin | test/functional/rpc_deprecated.py | Python | mit | 1,259 |
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 1.1, s, t 2.1, s, t 3.1, s, t 4.1, s, t 5.1, s, t 6.1, s, q"
tags = "scrolling, ScrollingManager, do_not_scale"
autotest = 0
impo... | shadowmint/nwidget | lib/cocos2d-0.5.5/test/test_scrolling_manager_without_tiles.py | Python | apache-2.0 | 13,241 |
import os
import yaml
import json
import heatclient.exc
import boto.exception
from . import aws
from . import openstack
from . import renderer
from skybase.artiball import ARTIBALL_SCHEMA_ARGS
from skybase.utils import make_temp_directory
def launch_stacks(planet=None,
service=None,
... | lithiumtech/skybase.io | skybase/actions/skycloud/__init__.py | Python | apache-2.0 | 16,735 |
# 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... | onecloud/neutron | neutron/extensions/firewall.py | Python | apache-2.0 | 15,763 |
# Copyright 2015 Intel Corporation.
# 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 requir... | mahak/neutron | neutron/plugins/ml2/extensions/port_security.py | Python | apache-2.0 | 3,229 |
import os
path = os.path.dirname(os.path.abspath(__file__))
import sys
sys.path.append("%s/cython/"%(path))
import argparse
import itertools
import multiprocessing as mp
import binner_splitpy
parser = argparse.ArgumentParser(description="Split binner output into specified output and give summary")
parser.add_argument(... | Yandell-Lab/taxonomer_0.5 | taxonomer/scripts/binner_split_report.py | Python | mit | 3,203 |
# -*- coding: utf-8 -*-
from typing import Any, Dict
from zerver.lib.test_classes import WebhookTestCase
class YoHookTests(WebhookTestCase):
STREAM_NAME = 'yo'
URL_TEMPLATE = u"/api/v1/external/yo?api_key={api_key}"
FIXTURE_DIR_NAME = 'yo'
def test_yo_message(self) -> None:
"""
Yo App... | jackrzhang/zulip | zerver/webhooks/yo/tests.py | Python | apache-2.0 | 855 |
# -*- coding: utf-8 -*-
import os
import inspect
import worldmap
WORLDMAP_PATH = os.path.dirname(inspect.getfile(worldmap))
CONFIG_PATH = os.path.join(WORLDMAP_PATH, 'config') | initbrain/worldmap | worldmap/core/constants.py | Python | mit | 177 |
# -*- coding: utf-8 -*-
from __future__ import division
import array
import random
import numpy
import wx
from wx.lib.delayedresult import startWorker
#=============================================================================
# THREAD RENDER TEST
from odemis.gui.win.delphi import CalibrationProgressDialog
from... | gstiebler/odemis | src/odemis/gui/test/sandbox.py | Python | gpl-2.0 | 8,980 |
#!/usr/local/bin/python2.7
##
# OOIPLACEHOLDER
#
# Copyright 2014 Raytheon Co.
##
__author__ = 'Rachel Manoni'
import os
from mi.logging import config
from mi.dataset.dataset_parser import DataSetDriverConfigKeys
from mi.dataset.driver.moas.gl.flort_m.flort_m_glider_driver import FlortMDriver
from mi.core.versioning... | oceanobservatories/mi-instrument | mi/dataset/driver/moas/gl/flort_m/flort_m_glider_telemetered_driver.py | Python | bsd-2-clause | 720 |
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, 2017, 2018, 2019, 2020 Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (t... | CalebBell/thermo | thermo/utils/t_dependent_property.py | Python | mit | 202,501 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import ast
import os
from builtins import object
from distutils import sysconfig
from pa... | foursquare/pants | contrib/python/src/python/pants/contrib/python/checks/tasks/checkstyle/import_order.py | Python | apache-2.0 | 7,166 |
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | platformio/platformio-core | scripts/docspregen.py | Python | apache-2.0 | 33,421 |
"""Form Historia."""
from django import forms
from ..models import Historia
class HistoriaForm(forms.ModelForm):
"""Class HistoriaForm."""
class Meta:
"""Meta HistriaForm."""
model = Historia
exclude = ('numero', 'estado')
widgets = {
'persona': forms.TextInput(... | upeu-jul-20161-epis-ads2/MedicFast | apps/atencion/forms/HistoriaForm.py | Python | bsd-3-clause | 426 |
from direct.gui.DirectGui import DirectFrame, DGG, DirectLabel
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from pandac.PandaModules import Point3, TextNode
from toontown.minigame import TravelGameGlobals
from toontown.toonbase import TTLocalizer
from direct.interval.... | ksmit799/Toontown-Source | toontown/minigame/VoteResultsPanel.py | Python | mit | 6,419 |
# Copyright (c) 2018 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
import unittest
import os
import json
import logging
from time import sleep
from stat import S_IREAD
import signac
from signac.errors import Error
from signac.errors import ... | csadorf/signac | tests/test_buffered_mode.py | Python | bsd-3-clause | 8,932 |
import SimpleHTTPServer
import SocketServer
import daemon
import os
""" Setup Server Params """
handler = SimpleHTTPServer.SimpleHTTPRequestHandler
SocketServer.TCPServer.allow_reuse_address = True
httpd = SocketServer.TCPServer(("0.0.0.0", 8000), handler)
daemon_context = daemon.DaemonContext()
daemon_context.files_p... | shekkbuilder/liffy | http_server.py | Python | gpl-2.0 | 419 |
from .ComponentSchemas import ComponentSchema
from .ComponentSchemas import ComponentInputSchema
from .ComponentSchemas import ComponentPropertySchema
from .ParameterSchemas import EditParameterSchema
from .ParameterSchemas import NewParameterSchema
from .DeviceSchemas import EditDeviceSchema
from .DeviceSchemas impo... | AlexanderLang/OpenAutomatedFarm | FarmGUI/farmgui/schemas/__init__.py | Python | gpl-3.0 | 931 |
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import patterns, url
from recordtrace import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^trace$', views.trace, name='trace'),
url(r'^projects$', views.projects, name='projec... | INRIA/intertrace | recordtrace/urls.py | Python | mit | 2,001 |
#!/usr/bin/python
# This utility receives a stereo audio file as input and splits the two channels into
# separate mono files of the same codec and file type.
import os, sys, subprocess, re
def splitter(file):
nfile = os.path.splitext(file)[0]
ffprobe = subprocess.Popen(['ffprobe','-show_streams','-print_format'... | mmoss82/audio-splitter | split.py | Python | mit | 3,588 |
import base64
import json
import random
import re
import time
import uuid
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.plugin.api.useragents import CHROME as USER_AGENT
from streamlink.stream.hls import HLSStream
from streamlink.stream.http import HTTPS... | amurzeau/streamlink-debian | src/streamlink/plugins/huajiao.py | Python | bsd-2-clause | 1,969 |
import sys
import unittest
import gtk
import gobject
import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from gsignals import Signal, SignalManager, connect_external, connect_all
from gsignals.signals import SSIGNAL
def refresh_gui():
"""
Magic function to emulate gtk main loop... | baverman/scribes-goodies | gsignals/tests/test_signals.py | Python | mit | 5,891 |
# -*- coding: utf-8 -*-
# Description: game table
# By Thuong.Tran
# Date: 11 Sept. 2017
from sqlalchemy import create_engine, Table, Column, MetaData, Integer, Text, Date, Float
from sqlalchemy import select, and_
import datetime as dt
class game():
def __init__(self, db_url):
_engine = create_engine(db_url)
... | xuanthuong/golfgame | models/game.py | Python | mit | 1,135 |
import datetime
import simplejson
from api import TraktTvApi
from utils import AUTH_PATH, load_secrets
PIN_URL = 'https://trakt.tv/pin/%s'
def auth_flow(**kwargs):
api = TraktTvApi()
secrets = load_secrets()
pin_url = PIN_URL % secrets[PIN_ID]
print 'Head to %s to authenticate and enter your PIN below:' % ... | ihurrahi/autotrakttv | authenticate.py | Python | mit | 822 |
import capstone
import pwndbg.chain
import pwndbg.color.context as C
import pwndbg.color.memory as M
import pwndbg.color.syntax_highlight as H
import pwndbg.color.theme as theme
import pwndbg.config as config
import pwndbg.disasm.jump
from pwndbg.color import generateColorFunction
from pwndbg.color import ljust_colore... | pwndbg/pwndbg | pwndbg/color/disasm.py | Python | mit | 2,733 |
#!/usr/bin/env python
import logging
import sys
from BCBio import GFF
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
if __name__ == "__main__":
attr = sys.argv[2]
for record in GFF.parse(sys.argv[1]):
if len(record.features) == 0:
continue
for feature in sort... | mblue9/tools-iuc | tools/circos/text-from-gff3.py | Python | mit | 1,131 |
def edges_all():
edges = [('sd_10','as_1'),
('sd_27','as_1'),
('sd_19','as_1'),
('sd_1','as_2'),
('sd_29','as_2'),
('sd_30','as_2'),
('sd_5','as_3'),
('sd_18','as_3'),
('sd_3','as_3'),
('sd_6','as_3'),
('sd_4','as_3'),
('sd_8','as_3'),
('sd_10','as_3'),
('sd_7','as_3'),
('sd_31','as_4'),
('sd_24','as_5'),
('sd_26... | algarecu/tbwd | src/Louvain/utility.py | Python | gpl-3.0 | 25,180 |
#!usr/env/bin python
'''
Python module for The 5th Row Sports Data API
Made by Kinman Covey
BREAKDOWN:
FifthRow - the main class for the api. create an object of this class to
start using the API.
.get - the method to make requests. returns a list of Matchup objects
Matchup - a class made to rep... | KinmanCovey/fifth-row-py | fifthrow/fifthrow.py | Python | mit | 4,446 |
import os,sys
from trans_rot_coords import *
import numpy as np
from read_energy_force_new import *
from grids_structures_general import DS,Grid_Quarts
from orient_struct_2 import OrientDS as OrientDS_2
from orient_struct_3 import OrientDS as OrientDS_3
AU2KCAL = 23.0605*27.2116
R2D = 180.0/3.14159265358979
## np.pi/... | sethbrin/QM | version2/python/calculate_energy_new_coords_general.py | Python | mit | 32,462 |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2015-2016 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import Bit... | SartoNess/BitcoinUnlimited | qa/rpc-tests/abandonconflict.py | Python | mit | 7,686 |
from __future__ import absolute_import
from .minionqc import MultiqcModule
| ewels/MultiQC | multiqc/modules/minionqc/__init__.py | Python | gpl-3.0 | 75 |
import sys
from datetime import date, timedelta
import random
import shutil
import sqlite3
#------------------------------------------------------------
ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_'
LOREM_IPSUM = [
'''Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a
diam l... | wking/swc-amy | scripts/anonymizer.py | Python | mit | 10,069 |
# Copyright 2011 Florian Ledermann <ledermann@ims.tuwien.ac.at>
#
# This file is part of OpenResources
# https://bitbucket.org/floledermann/openresources/
#
# OpenResources is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
... | schoeke/django-openresources | openresources/views.py | Python | agpl-3.0 | 27,867 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.